@datawire-ai/busyfile-design-library 1.30.4 → 1.30.6

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 (227) hide show
  1. package/dist/index10.js +28 -25
  2. package/dist/index100.js +5 -10
  3. package/dist/index101.js +24 -219
  4. package/dist/index102.js +181 -14
  5. package/dist/index103.js +8 -30
  6. package/dist/index104.js +10 -135
  7. package/dist/index105.js +4 -16
  8. package/dist/index106.js +13 -9
  9. package/dist/index107.js +134 -48
  10. package/dist/index108.js +13 -8
  11. package/dist/index109.js +9 -4
  12. package/dist/index110.js +50 -13
  13. package/dist/index113.js +13 -14
  14. package/dist/index114.js +221 -645
  15. package/dist/index115.js +650 -13
  16. package/dist/index116.js +14 -226
  17. package/dist/index121.js +1 -1
  18. package/dist/index123.js +1 -1
  19. package/dist/index125.js +3 -3
  20. package/dist/index126.js +2 -25
  21. package/dist/index127.js +53 -29
  22. package/dist/index128.js +65 -5
  23. package/dist/index129.js +52 -2
  24. package/dist/index130.js +4 -52
  25. package/dist/index131.js +4 -64
  26. package/dist/index132.js +16 -52
  27. package/dist/index133.js +5 -4
  28. package/dist/index134.js +8 -4
  29. package/dist/index135.js +14 -13
  30. package/dist/index136.js +4 -5
  31. package/dist/index137.js +4 -8
  32. package/dist/index138.js +5 -16
  33. package/dist/index139.js +5 -4
  34. package/dist/index140.js +4 -4
  35. package/dist/index141.js +4 -5
  36. package/dist/index142.js +6 -5
  37. package/dist/index143.js +24 -4
  38. package/dist/index144.js +6 -4
  39. package/dist/index145.js +3 -5
  40. package/dist/index146.js +6 -24
  41. package/dist/index147.js +5 -6
  42. package/dist/index148.js +4 -4
  43. package/dist/index149.js +5 -6
  44. package/dist/index150.js +4 -5
  45. package/dist/index151.js +8 -4
  46. package/dist/index152.js +2 -2
  47. package/dist/index153.js +1 -1
  48. package/dist/index154.js +4 -8
  49. package/dist/index155.js +5 -4
  50. package/dist/index156.js +58 -4
  51. package/dist/index157.js +66 -4
  52. package/dist/index158.js +240 -6
  53. package/dist/index159.js +37 -56
  54. package/dist/index160.js +4 -66
  55. package/dist/index161.js +7 -240
  56. package/dist/index162.js +12 -38
  57. package/dist/index163.js +7 -4
  58. package/dist/index164.js +10 -7
  59. package/dist/index165.js +9 -12
  60. package/dist/index166.js +8 -7
  61. package/dist/index167.js +15 -9
  62. package/dist/index168.js +24 -11
  63. package/dist/index169.js +20 -9
  64. package/dist/index170.js +52 -15
  65. package/dist/index171.js +42 -24
  66. package/dist/index172.js +10 -20
  67. package/dist/index173.js +18 -51
  68. package/dist/index174.js +15 -40
  69. package/dist/index175.js +6 -9
  70. package/dist/index176.js +23 -20
  71. package/dist/index177.js +18 -16
  72. package/dist/index178.js +16 -7
  73. package/dist/index179.js +6 -23
  74. package/dist/index180.js +5 -19
  75. package/dist/index181.js +5 -16
  76. package/dist/index182.js +4 -6
  77. package/dist/index183.js +4 -4
  78. package/dist/index184.js +3 -4
  79. package/dist/index185.js +6 -4
  80. package/dist/index186.js +7 -4
  81. package/dist/index187.js +6 -3
  82. package/dist/index188.js +5 -6
  83. package/dist/index189.js +3 -7
  84. package/dist/index190.js +3 -6
  85. package/dist/index191.js +3 -5
  86. package/dist/index192.js +3 -3
  87. package/dist/index193.js +4 -3
  88. package/dist/index194.js +3 -3
  89. package/dist/index195.js +3 -3
  90. package/dist/index196.js +3 -4
  91. package/dist/index197.js +24 -3
  92. package/dist/index198.js +29 -4
  93. package/dist/index199.js +5 -4
  94. package/dist/index203.js +2 -5
  95. package/dist/index204.js +2 -3
  96. package/dist/index205.js +8 -23
  97. package/dist/index206.js +18 -108
  98. package/dist/index207.js +16 -15
  99. package/dist/index208.js +6 -2
  100. package/dist/index209.js +6 -2
  101. package/dist/index210.js +6 -8
  102. package/dist/index211.js +4 -19
  103. package/dist/index212.js +7 -16
  104. package/dist/index213.js +17 -5
  105. package/dist/index214.js +5 -5
  106. package/dist/index215.js +5 -6
  107. package/dist/index216.js +13 -4
  108. package/dist/index217.js +10 -7
  109. package/dist/index218.js +14 -17
  110. package/dist/index219.js +5 -5
  111. package/dist/index220.js +6 -5
  112. package/dist/index221.js +8 -13
  113. package/dist/index222.js +6 -10
  114. package/dist/index223.js +56 -14
  115. package/dist/index224.js +9 -5
  116. package/dist/index225.js +5 -6
  117. package/dist/index226.js +5 -8
  118. package/dist/index227.js +9 -6
  119. package/dist/index228.js +5 -56
  120. package/dist/index229.js +5 -9
  121. package/dist/index230.js +4 -5
  122. package/dist/index231.js +11 -5
  123. package/dist/index232.js +10 -9
  124. package/dist/index233.js +9 -4
  125. package/dist/index234.js +11 -5
  126. package/dist/index235.js +11 -4
  127. package/dist/index236.js +10 -11
  128. package/dist/index237.js +7 -10
  129. package/dist/index238.js +6 -10
  130. package/dist/index239.js +5 -11
  131. package/dist/index240.js +6 -11
  132. package/dist/index241.js +8 -10
  133. package/dist/index242.js +6 -7
  134. package/dist/index243.js +23 -6
  135. package/dist/index244.js +18 -5
  136. package/dist/index245.js +7 -6
  137. package/dist/index246.js +10 -8
  138. package/dist/index247.js +10 -6
  139. package/dist/index248.js +20 -22
  140. package/dist/index249.js +10 -18
  141. package/dist/index250.js +9 -7
  142. package/dist/index251.js +9 -10
  143. package/dist/index252.js +4 -10
  144. package/dist/index253.js +5 -21
  145. package/dist/index254.js +16 -10
  146. package/dist/index255.js +8 -8
  147. package/dist/index256.js +18 -9
  148. package/dist/index257.js +15 -4
  149. package/dist/index258.js +12 -5
  150. package/dist/index259.js +28 -15
  151. package/dist/index260.js +12 -9
  152. package/dist/index261.js +25 -18
  153. package/dist/index262.js +5 -15
  154. package/dist/index263.js +5 -13
  155. package/dist/index264.js +3 -30
  156. package/dist/index265.js +23 -12
  157. package/dist/index266.js +108 -24
  158. package/dist/index267.js +15 -5
  159. package/dist/index268.js +68 -65
  160. package/dist/index269.js +30 -68
  161. package/dist/index270.js +9 -9
  162. package/dist/index271.js +152 -13
  163. package/dist/index272.js +107 -65
  164. package/dist/index273.js +5 -68
  165. package/dist/index274.js +13 -31
  166. package/dist/index275.js +65 -9
  167. package/dist/index276.js +66 -150
  168. package/dist/index277.js +8 -107
  169. package/dist/index278.js +14 -5
  170. package/dist/index279.js +66 -13
  171. package/dist/index280.js +5 -3
  172. package/dist/index281.js +5 -22
  173. package/dist/index282.js +4 -6
  174. package/dist/index283.js +15 -5
  175. package/dist/index284.js +9 -4
  176. package/dist/index285.js +5 -15
  177. package/dist/index286.js +4 -8
  178. package/dist/index287.js +512 -5
  179. package/dist/index288.js +50 -5
  180. package/dist/index289.js +15 -510
  181. package/dist/index290.js +7 -50
  182. package/dist/index291.js +8 -17
  183. package/dist/index292.js +7 -6
  184. package/dist/index293.js +8 -8
  185. package/dist/index294.js +12 -7
  186. package/dist/index295.js +10 -8
  187. package/dist/index296.js +14 -12
  188. package/dist/index297.js +6 -10
  189. package/dist/index298.js +15 -14
  190. package/dist/index299.js +27 -5
  191. package/dist/index300.js +11 -14
  192. package/dist/index301.js +3 -28
  193. package/dist/index302.js +22 -12
  194. package/dist/index303.js +5 -23
  195. package/dist/index304.js +56 -12
  196. package/dist/index305.js +11 -26
  197. package/dist/index306.js +27 -4
  198. package/dist/index307.js +5 -5
  199. package/dist/index308.js +22 -56
  200. package/dist/index33.js +89 -73
  201. package/dist/index41.js +1 -1
  202. package/dist/index42.js +4 -4
  203. package/dist/index44.js +7 -7
  204. package/dist/index46.js +5 -5
  205. package/dist/index49.js +10 -10
  206. package/dist/index52.js +8 -8
  207. package/dist/index59.js +4 -4
  208. package/dist/index63.js +1 -1
  209. package/dist/index74.js +1 -1
  210. package/dist/index75.js +6 -6
  211. package/dist/index80.js +2 -2
  212. package/dist/index82.js +16 -16
  213. package/dist/index83.js +5 -5
  214. package/dist/index85.js +11 -11
  215. package/dist/index86.js +3 -3
  216. package/dist/index87.js +4 -4
  217. package/dist/index92.js +120 -46
  218. package/dist/index93.js +10 -5
  219. package/dist/index94.js +219 -24
  220. package/dist/index95.js +14 -33
  221. package/dist/index96.js +65 -177
  222. package/dist/index97.js +33 -7
  223. package/dist/index98.js +48 -66
  224. package/dist/index99.js +29 -125
  225. package/dist/style.css +1 -1
  226. package/dist/types/index.d.ts +4 -1
  227. package/package.json +1 -1
package/dist/index162.js CHANGED
@@ -1,42 +1,16 @@
1
- import { DayFlag as e } from "./index172.js";
2
- import { dateMatchModifiers as u } from "./index248.js";
3
- function V(b, S, h, M, i) {
4
- const { disabled: p, hidden: y, modifiers: d, showOutsideDays: m, broadcastCalendar: B, today: g } = S, { isSameDay: v, isSameMonth: A, startOfMonth: E, isBefore: F, endOfMonth: j, isAfter: k } = i, O = h && E(h), D = M && j(M), a = {
5
- [e.focused]: [],
6
- [e.outside]: [],
7
- [e.disabled]: [],
8
- [e.hidden]: [],
9
- [e.today]: []
10
- }, n = {};
11
- for (const s of b) {
12
- const { date: o, displayMonth: c } = s, t = !!(c && !A(o, c)), f = !!(O && F(o, O)), l = !!(D && k(o, D)), w = !!(p && u(o, p, i)), x = !!(y && u(o, y, i)) || f || l || // Broadcast calendar will show outside days as default
13
- !B && !m && t || B && m === !1 && t, C = v(o, g ?? i.today());
14
- t && a.outside.push(s), w && a.disabled.push(s), x && a.hidden.push(s), C && a.today.push(s), d && Object.keys(d).forEach((r) => {
15
- const N = d == null ? void 0 : d[r];
16
- N && u(o, N, i) && (n[r] ? n[r].push(s) : n[r] = [s]);
17
- });
18
- }
19
- return (s) => {
20
- const o = {
21
- [e.focused]: !1,
22
- [e.disabled]: !1,
23
- [e.hidden]: !1,
24
- [e.outside]: !1,
25
- [e.today]: !1
26
- }, c = {};
27
- for (const t in a) {
28
- const f = a[t];
29
- o[t] = f.some((l) => l === s);
30
- }
31
- for (const t in n)
32
- c[t] = n[t].some((f) => f === s);
33
- return {
34
- ...o,
35
- // custom modifiers should override all the previous ones
36
- ...c
37
- };
1
+ function n(e) {
2
+ const t = {
3
+ "data-mode": e.mode ?? void 0,
4
+ "data-required": "required" in e ? e.required : void 0,
5
+ "data-multiple-months": e.numberOfMonths && e.numberOfMonths > 1 || void 0,
6
+ "data-week-numbers": e.showWeekNumber || void 0,
7
+ "data-broadcast-calendar": e.broadcastCalendar || void 0,
8
+ "data-nav-layout": e.navLayout || void 0
38
9
  };
10
+ return Object.entries(e).forEach(([a, d]) => {
11
+ a.startsWith("data-") && (t[a] = d);
12
+ }), t;
39
13
  }
40
14
  export {
41
- V as createGetModifiers
15
+ n as getDataAttributes
42
16
  };
package/dist/index163.js CHANGED
@@ -1,7 +1,10 @@
1
- import { DayFlag as e, SelectionState as n, UI as d } from "./index172.js";
2
- function p(o, i, f = {}) {
3
- return Object.entries(o).filter(([, t]) => t === !0).reduce((t, [r]) => (f[r] ? t.push(f[r]) : i[e[r]] ? t.push(i[e[r]]) : i[n[r]] && t.push(i[n[r]]), t), [i[d.Day]]);
1
+ import * as f from "./index178.js";
2
+ function i(n) {
3
+ return n != null && n.formatMonthCaption && !n.formatCaption && (n.formatCaption = n.formatMonthCaption), n != null && n.formatYearCaption && !n.formatYearDropdown && (n.formatYearDropdown = n.formatYearCaption), {
4
+ ...f,
5
+ ...n
6
+ };
4
7
  }
5
8
  export {
6
- p as getClassNamesForModifiers
9
+ i as getFormatters
7
10
  };
package/dist/index164.js CHANGED
@@ -1,10 +1,13 @@
1
- import * as t from "./index132.js";
2
- function n(o) {
3
- return {
4
- ...t,
5
- ...o
6
- };
1
+ function d(o, n, s, a, e) {
2
+ const { startOfMonth: r, startOfYear: c, endOfYear: f, eachMonthOfInterval: l, getMonth: p } = e;
3
+ return l({
4
+ start: c(o),
5
+ end: f(o)
6
+ }).map((t) => {
7
+ const O = a.formatMonthDropdown(t, e), h = p(t), u = n && t < r(n) || s && t > r(s) || !1;
8
+ return { value: h, label: O, disabled: u };
9
+ });
7
10
  }
8
11
  export {
9
- n as getComponents
12
+ d as getMonthOptions
10
13
  };
package/dist/index165.js CHANGED
@@ -1,16 +1,13 @@
1
- function n(e) {
2
- const t = {
3
- "data-mode": e.mode ?? void 0,
4
- "data-required": "required" in e ? e.required : void 0,
5
- "data-multiple-months": e.numberOfMonths && e.numberOfMonths > 1 || void 0,
6
- "data-week-numbers": e.showWeekNumber || void 0,
7
- "data-broadcast-calendar": e.broadcastCalendar || void 0,
8
- "data-nav-layout": e.navLayout || void 0
9
- };
10
- return Object.entries(e).forEach(([a, d]) => {
11
- a.startsWith("data-") && (t[a] = d);
1
+ import { UI as u } from "./index169.js";
2
+ function p(o, r = {}, n = {}) {
3
+ let t = { ...r == null ? void 0 : r[u.Day] };
4
+ return Object.entries(o).filter(([, c]) => c === !0).forEach(([c]) => {
5
+ t = {
6
+ ...t,
7
+ ...n == null ? void 0 : n[c]
8
+ };
12
9
  }), t;
13
10
  }
14
11
  export {
15
- n as getDataAttributes
12
+ p as getStyleForModifiers
16
13
  };
package/dist/index166.js CHANGED
@@ -1,10 +1,11 @@
1
- import * as f from "./index181.js";
2
- function i(n) {
3
- return n != null && n.formatMonthCaption && !n.formatCaption && (n.formatCaption = n.formatMonthCaption), n != null && n.formatYearCaption && !n.formatYearDropdown && (n.formatYearDropdown = n.formatYearCaption), {
4
- ...f,
5
- ...n
6
- };
1
+ function d(t, r, c) {
2
+ const a = t.today(), e = r ? t.startOfISOWeek(a) : t.startOfWeek(a), o = [];
3
+ for (let s = 0; s < 7; s++) {
4
+ const n = t.addDays(e, s);
5
+ o.push(n);
6
+ }
7
+ return o;
7
8
  }
8
9
  export {
9
- i as getFormatters
10
+ d as getWeekdays
10
11
  };
package/dist/index167.js CHANGED
@@ -1,13 +1,19 @@
1
- function d(o, n, s, a, e) {
2
- const { startOfMonth: r, startOfYear: c, endOfYear: f, eachMonthOfInterval: l, getMonth: p } = e;
3
- return l({
4
- start: c(o),
5
- end: f(o)
6
- }).map((t) => {
7
- const O = a.formatMonthDropdown(t, e), h = p(t), u = n && t < r(n) || s && t > r(s) || !1;
8
- return { value: h, label: O, disabled: u };
1
+ function g(a, s, o, t, i = !1) {
2
+ if (!a || !s)
3
+ return;
4
+ const { startOfYear: l, endOfYear: u, addYears: Y, getYear: d, isBefore: c, isSameYear: p } = t, m = l(a), n = u(s), r = [];
5
+ let e = m;
6
+ for (; c(e, n) || p(e, n); )
7
+ r.push(e), e = Y(e, 1);
8
+ return i && r.reverse(), r.map((f) => {
9
+ const O = o.formatYearDropdown(f, t);
10
+ return {
11
+ value: d(f),
12
+ label: O,
13
+ disabled: !1
14
+ };
9
15
  });
10
16
  }
11
17
  export {
12
- d as getMonthOptions
18
+ g as getYearOptions
13
19
  };
package/dist/index168.js CHANGED
@@ -1,13 +1,26 @@
1
- import { UI as u } from "./index172.js";
2
- function p(o, r = {}, n = {}) {
3
- let t = { ...r == null ? void 0 : r[u.Day] };
4
- return Object.entries(o).filter(([, c]) => c === !0).forEach(([c]) => {
5
- t = {
6
- ...t,
7
- ...n == null ? void 0 : n[c]
8
- };
9
- }), t;
10
- }
1
+ import { labelDay as o, labelDayButton as l } from "./index186.js";
2
+ import { labelCaption as t, labelGrid as b } from "./index187.js";
3
+ import { labelGridcell as m } from "./index188.js";
4
+ import { labelMonthDropdown as f } from "./index189.js";
5
+ import { labelNav as n } from "./index190.js";
6
+ import { labelNext as u } from "./index191.js";
7
+ import { labelPrevious as N } from "./index192.js";
8
+ import { labelWeekday as y } from "./index193.js";
9
+ import { labelWeekNumber as v } from "./index194.js";
10
+ import { labelWeekNumberHeader as G } from "./index195.js";
11
+ import { labelYearDropdown as h } from "./index196.js";
11
12
  export {
12
- p as getStyleForModifiers
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
13
26
  };
package/dist/index169.js CHANGED
@@ -1,11 +1,22 @@
1
- function d(t, r, c) {
2
- const a = t.today(), e = r ? t.startOfISOWeek(a) : t.startOfWeek(a), o = [];
3
- for (let s = 0; s < 7; s++) {
4
- const n = t.addDays(e, s);
5
- o.push(n);
6
- }
7
- return o;
8
- }
1
+ var o;
2
+ (function(e) {
3
+ e.Root = "root", e.Chevron = "chevron", e.Day = "day", e.DayButton = "day_button", e.CaptionLabel = "caption_label", e.Dropdowns = "dropdowns", e.Dropdown = "dropdown", e.DropdownRoot = "dropdown_root", e.Footer = "footer", e.MonthGrid = "month_grid", e.MonthCaption = "month_caption", e.MonthsDropdown = "months_dropdown", e.Month = "month", e.Months = "months", e.Nav = "nav", e.NextMonthButton = "button_next", e.PreviousMonthButton = "button_previous", e.Week = "week", e.Weeks = "weeks", e.Weekday = "weekday", e.Weekdays = "weekdays", e.WeekNumber = "week_number", e.WeekNumberHeader = "week_number_header", e.YearsDropdown = "years_dropdown";
4
+ })(o || (o = {}));
5
+ var t;
6
+ (function(e) {
7
+ e.disabled = "disabled", e.hidden = "hidden", e.outside = "outside", e.focused = "focused", e.today = "today";
8
+ })(t || (t = {}));
9
+ var r;
10
+ (function(e) {
11
+ e.range_end = "range_end", e.range_middle = "range_middle", e.range_start = "range_start", e.selected = "selected";
12
+ })(r || (r = {}));
13
+ var n;
14
+ (function(e) {
15
+ e.weeks_before_enter = "weeks_before_enter", e.weeks_before_exit = "weeks_before_exit", e.weeks_after_enter = "weeks_after_enter", e.weeks_after_exit = "weeks_after_exit", e.caption_after_enter = "caption_after_enter", e.caption_after_exit = "caption_after_exit", e.caption_before_enter = "caption_before_enter", e.caption_before_exit = "caption_before_exit";
16
+ })(n || (n = {}));
9
17
  export {
10
- d as getWeekdays
18
+ n as Animation,
19
+ t as DayFlag,
20
+ r as SelectionState,
21
+ o as UI
11
22
  };
package/dist/index170.js CHANGED
@@ -1,19 +1,56 @@
1
- function g(a, s, o, t, i = !1) {
2
- if (!a || !s)
3
- return;
4
- const { startOfYear: l, endOfYear: u, addYears: Y, getYear: d, isBefore: c, isSameYear: p } = t, m = l(a), n = u(s), r = [];
5
- let e = m;
6
- for (; c(e, n) || p(e, n); )
7
- r.push(e), e = Y(e, 1);
8
- return i && r.reverse(), r.map((f) => {
9
- const O = o.formatYearDropdown(f, t);
10
- return {
11
- value: d(f),
12
- label: O,
13
- disabled: !1
14
- };
1
+ import { useRef as q, useLayoutEffect as z } from "react";
2
+ import { Animation as o } from "./index169.js";
3
+ const l = (e) => e instanceof HTMLElement ? e : null, w = (e) => [
4
+ ...e.querySelectorAll("[data-animated-month]") ?? []
5
+ ], I = (e) => l(e.querySelector("[data-animated-month]")), S = (e) => l(e.querySelector("[data-animated-caption]")), A = (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, b, { classNames: s, months: a, focused: g, dateLib: H }) {
7
+ const p = q(null), h = q(a), v = q(!1);
8
+ z(() => {
9
+ const f = h.current;
10
+ if (h.current = a, !b || !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 M = H.isSameMonth(a[0].date, f[0].date), u = H.isAfter(a[0].date, f[0].date), m = u ? s[o.caption_after_enter] : s[o.caption_before_enter], L = u ? s[o.weeks_after_enter] : s[o.weeks_before_enter], x = p.current, _ = e.current.cloneNode(!0);
15
+ if (_ instanceof HTMLElement ? (w(_).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 = S(t);
21
+ n && n.classList.remove(m);
22
+ const r = A(t);
23
+ r && r.classList.remove(L);
24
+ }), p.current = _) : p.current = null, v.current || M || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
25
+ g)
26
+ return;
27
+ const k = x instanceof HTMLElement ? w(x) : [], d = w(e.current);
28
+ if (d != null && d.every((i) => i instanceof HTMLElement) && k && k.every((i) => i instanceof HTMLElement)) {
29
+ v.current = !0, e.current.style.isolation = "isolate";
30
+ const i = B(e.current);
31
+ i && (i.style.zIndex = "1"), d.forEach((t, c) => {
32
+ const n = k[c];
33
+ if (!n)
34
+ return;
35
+ t.style.position = "relative", t.style.overflow = "hidden";
36
+ const r = S(t);
37
+ r && r.classList.add(m);
38
+ const y = A(t);
39
+ y && y.classList.add(L);
40
+ const W = () => {
41
+ v.current = !1, e.current && (e.current.style.isolation = ""), i && (i.style.zIndex = ""), r && r.classList.remove(m), y && y.classList.remove(L), 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 = S(n);
47
+ E && (E.classList.add(u ? s[o.caption_before_exit] : s[o.caption_after_exit]), E.addEventListener("animationend", W));
48
+ const T = A(n);
49
+ T && T.classList.add(u ? s[o.weeks_before_exit] : s[o.weeks_after_exit]), t.insertBefore(n, t.firstChild);
50
+ });
51
+ }
15
52
  });
16
53
  }
17
54
  export {
18
- g as getYearOptions
55
+ D as useAnimation
19
56
  };
package/dist/index171.js CHANGED
@@ -1,26 +1,44 @@
1
- import { labelDay as o, labelDayButton as l } from "./index189.js";
2
- import { labelCaption as t, labelGrid as b } from "./index190.js";
3
- import { labelGridcell as m } from "./index191.js";
4
- import { labelMonthDropdown as f } from "./index192.js";
5
- import { labelNav as n } from "./index193.js";
6
- import { labelNext as u } from "./index194.js";
7
- import { labelPrevious as N } from "./index195.js";
8
- import { labelWeekday as y } from "./index196.js";
9
- import { labelWeekNumber as v } from "./index197.js";
10
- import { labelWeekNumberHeader as G } from "./index198.js";
11
- import { labelYearDropdown as h } from "./index199.js";
1
+ import { useEffect as I } from "react";
2
+ import { getDates as N } from "./index244.js";
3
+ import { getDays as k } from "./index245.js";
4
+ import { getDisplayMonths as C } from "./index246.js";
5
+ import { getInitialMonth as g } from "./index247.js";
6
+ import { getMonths as O } from "./index248.js";
7
+ import { getNavMonths as q } from "./index249.js";
8
+ import { getNextMonth as F } from "./index250.js";
9
+ import { getPreviousMonth as P } from "./index251.js";
10
+ import { getWeeks as S } from "./index252.js";
11
+ import { useControlledValue as V } from "./index253.js";
12
+ function X(t, n) {
13
+ const [i, o] = q(t, n), { startOfMonth: r, endOfMonth: d } = n, c = g(t, i, o, n), [m, h] = V(
14
+ c,
15
+ // initialMonth is always computed from props.month if provided
16
+ t.month ? c : void 0
17
+ );
18
+ I(() => {
19
+ const e = g(t, i, o, n);
20
+ h(e);
21
+ }, [t.timeZone]);
22
+ const M = C(m, o, t, n), y = N(M, t.endMonth ? d(t.endMonth) : void 0, t, n), f = O(M, y, t, n), l = S(f), v = k(f), D = P(m, i, t, n), T = F(m, o, t, n), { disableNavigation: w, onMonthChange: a } = t, x = (e) => l.some((s) => s.days.some((E) => E.isEqualTo(e))), u = (e) => {
23
+ if (w)
24
+ return;
25
+ let s = r(e);
26
+ i && s < r(i) && (s = r(i)), o && s > r(o) && (s = r(o)), h(s), a == null || a(s);
27
+ };
28
+ return {
29
+ months: f,
30
+ weeks: l,
31
+ days: v,
32
+ navStart: i,
33
+ navEnd: o,
34
+ previousMonth: D,
35
+ nextMonth: T,
36
+ goToMonth: u,
37
+ goToDay: (e) => {
38
+ x(e) || u(e.date);
39
+ }
40
+ };
41
+ }
12
42
  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
43
+ X as useCalendar
26
44
  };
package/dist/index172.js CHANGED
@@ -1,22 +1,12 @@
1
- var o;
2
- (function(e) {
3
- e.Root = "root", e.Chevron = "chevron", e.Day = "day", e.DayButton = "day_button", e.CaptionLabel = "caption_label", e.Dropdowns = "dropdowns", e.Dropdown = "dropdown", e.DropdownRoot = "dropdown_root", e.Footer = "footer", e.MonthGrid = "month_grid", e.MonthCaption = "month_caption", e.MonthsDropdown = "months_dropdown", e.Month = "month", e.Months = "months", e.Nav = "nav", e.NextMonthButton = "button_next", e.PreviousMonthButton = "button_previous", e.Week = "week", e.Weeks = "weeks", e.Weekday = "weekday", e.Weekdays = "weekdays", e.WeekNumber = "week_number", e.WeekNumberHeader = "week_number_header", e.YearsDropdown = "years_dropdown";
4
- })(o || (o = {}));
5
- var t;
6
- (function(e) {
7
- e.disabled = "disabled", e.hidden = "hidden", e.outside = "outside", e.focused = "focused", e.today = "today";
8
- })(t || (t = {}));
9
- var r;
10
- (function(e) {
11
- e.range_end = "range_end", e.range_middle = "range_middle", e.range_start = "range_start", e.selected = "selected";
12
- })(r || (r = {}));
13
- var n;
14
- (function(e) {
15
- e.weeks_before_enter = "weeks_before_enter", e.weeks_before_exit = "weeks_before_exit", e.weeks_after_enter = "weeks_after_enter", e.weeks_after_exit = "weeks_after_exit", e.caption_after_enter = "caption_after_enter", e.caption_after_exit = "caption_after_exit", e.caption_before_enter = "caption_before_enter", e.caption_before_exit = "caption_before_exit";
16
- })(n || (n = {}));
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
+ }
17
9
  export {
18
- n as Animation,
19
- t as DayFlag,
20
- r as SelectionState,
21
- o as UI
10
+ o as dayPickerContext,
11
+ c as useDayPicker
22
12
  };
package/dist/index173.js CHANGED
@@ -1,56 +1,23 @@
1
- import { useRef as q, useLayoutEffect as z } from "react";
2
- import { Animation as o } from "./index172.js";
3
- const l = (e) => e instanceof HTMLElement ? e : null, w = (e) => [
4
- ...e.querySelectorAll("[data-animated-month]") ?? []
5
- ], I = (e) => l(e.querySelector("[data-animated-month]")), S = (e) => l(e.querySelector("[data-animated-caption]")), A = (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, b, { classNames: s, months: a, focused: g, dateLib: H }) {
7
- const p = q(null), h = q(a), v = q(!1);
8
- z(() => {
9
- const f = h.current;
10
- if (h.current = a, !b || !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 M = H.isSameMonth(a[0].date, f[0].date), u = H.isAfter(a[0].date, f[0].date), m = u ? s[o.caption_after_enter] : s[o.caption_before_enter], L = u ? s[o.weeks_after_enter] : s[o.weeks_before_enter], x = p.current, _ = e.current.cloneNode(!0);
15
- if (_ instanceof HTMLElement ? (w(_).forEach((t) => {
16
- if (!(t instanceof HTMLElement))
1
+ import { useState as r } from "react";
2
+ import { calculateFocusTarget as g } from "./index254.js";
3
+ import { getNextFocus as v } from "./index255.js";
4
+ function S(n, o, F, a, i) {
5
+ const { autoFocus: f } = n, [d, m] = r(), s = g(o.days, F, a || (() => !1), d), [t, u] = r(f ? s : void 0);
6
+ return {
7
+ isFocusTarget: (e) => !!(s != null && s.isEqualTo(e)),
8
+ setFocused: u,
9
+ focused: t,
10
+ blur: () => {
11
+ m(t), u(void 0);
12
+ },
13
+ moveFocus: (e, l) => {
14
+ if (!t)
17
15
  return;
18
- const c = I(t);
19
- c && t.contains(c) && t.removeChild(c);
20
- const n = S(t);
21
- n && n.classList.remove(m);
22
- const r = A(t);
23
- r && r.classList.remove(L);
24
- }), p.current = _) : p.current = null, v.current || M || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
25
- g)
26
- return;
27
- const k = x instanceof HTMLElement ? w(x) : [], d = w(e.current);
28
- if (d != null && d.every((i) => i instanceof HTMLElement) && k && k.every((i) => i instanceof HTMLElement)) {
29
- v.current = !0, e.current.style.isolation = "isolate";
30
- const i = B(e.current);
31
- i && (i.style.zIndex = "1"), d.forEach((t, c) => {
32
- const n = k[c];
33
- if (!n)
34
- return;
35
- t.style.position = "relative", t.style.overflow = "hidden";
36
- const r = S(t);
37
- r && r.classList.add(m);
38
- const y = A(t);
39
- y && y.classList.add(L);
40
- const W = () => {
41
- v.current = !1, e.current && (e.current.style.isolation = ""), i && (i.style.zIndex = ""), r && r.classList.remove(m), y && y.classList.remove(L), 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 = S(n);
47
- E && (E.classList.add(u ? s[o.caption_before_exit] : s[o.caption_after_exit]), E.addEventListener("animationend", W));
48
- const T = A(n);
49
- T && T.classList.add(u ? s[o.weeks_before_exit] : s[o.weeks_after_exit]), t.insertBefore(n, t.firstChild);
50
- });
16
+ const c = v(e, l, t, o.navStart, o.navEnd, n, i);
17
+ c && (o.goToDay(c), u(c));
51
18
  }
52
- });
19
+ };
53
20
  }
54
21
  export {
55
- D as useAnimation
22
+ S as useFocus
56
23
  };
package/dist/index174.js CHANGED
@@ -1,44 +1,19 @@
1
- import { useEffect as I } from "react";
2
- import { getDates as N } from "./index249.js";
3
- import { getDays as k } from "./index250.js";
4
- import { getDisplayMonths as C } from "./index251.js";
5
- import { getInitialMonth as g } from "./index252.js";
6
- import { getMonths as O } from "./index253.js";
7
- import { getNavMonths as q } from "./index254.js";
8
- import { getNextMonth as F } from "./index255.js";
9
- import { getPreviousMonth as P } from "./index256.js";
10
- import { getWeeks as S } from "./index257.js";
11
- import { useControlledValue as V } from "./index258.js";
12
- function X(t, n) {
13
- const [i, o] = q(t, n), { startOfMonth: r, endOfMonth: d } = n, c = g(t, i, o, n), [m, h] = V(
14
- c,
15
- // initialMonth is always computed from props.month if provided
16
- t.month ? c : void 0
17
- );
18
- I(() => {
19
- const e = g(t, i, o, n);
20
- h(e);
21
- }, [t.timeZone]);
22
- const M = C(m, o, t, n), y = N(M, t.endMonth ? d(t.endMonth) : void 0, t, n), f = O(M, y, t, n), l = S(f), v = k(f), D = P(m, i, t, n), T = F(m, o, t, n), { disableNavigation: w, onMonthChange: a } = t, x = (e) => l.some((s) => s.days.some((E) => E.isEqualTo(e))), u = (e) => {
23
- if (w)
1
+ import { useMulti as i } from "./index256.js";
2
+ import { useRange as o } from "./index257.js";
3
+ import { useSingle as s } from "./index258.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:
24
14
  return;
25
- let s = r(e);
26
- i && s < r(i) && (s = r(i)), o && s > r(o) && (s = r(o)), h(s), a == null || a(s);
27
- };
28
- return {
29
- months: f,
30
- weeks: l,
31
- days: v,
32
- navStart: i,
33
- navEnd: o,
34
- previousMonth: D,
35
- nextMonth: T,
36
- goToMonth: u,
37
- goToDay: (e) => {
38
- x(e) || u(e.date);
39
- }
40
- };
15
+ }
41
16
  }
42
17
  export {
43
- X as useCalendar
18
+ f as useSelection
44
19
  };
package/dist/index175.js CHANGED
@@ -1,12 +1,9 @@
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;
1
+ import { defaultDateLib as s } from "./index158.js";
2
+ function u(f, r, t = !1, o = s) {
3
+ let { from: n, to: e } = f;
4
+ const { differenceInCalendarDays: i, isSameDay: a } = o;
5
+ return n && e ? (i(e, n) < 0 && ([n, e] = [e, n]), i(r, n) >= (t ? 1 : 0) && i(e, r) >= (t ? 1 : 0)) : !t && e ? a(e, r) : !t && n ? a(n, r) : !1;
8
6
  }
9
7
  export {
10
- o as dayPickerContext,
11
- c as useDayPicker
8
+ u as rangeIncludesDate
12
9
  };
package/dist/index176.js CHANGED
@@ -1,23 +1,26 @@
1
- import { useState as r } from "react";
2
- import { calculateFocusTarget as g } from "./index259.js";
3
- import { getNextFocus as v } from "./index260.js";
4
- function S(n, o, F, a, i) {
5
- const { autoFocus: f } = n, [d, m] = r(), s = g(o.days, F, a || (() => !1), d), [t, u] = r(f ? s : void 0);
6
- return {
7
- isFocusTarget: (e) => !!(s != null && s.isEqualTo(e)),
8
- setFocused: u,
9
- focused: t,
10
- blur: () => {
11
- m(t), u(void 0);
12
- },
13
- moveFocus: (e, l) => {
14
- if (!t)
15
- return;
16
- const c = v(e, l, t, o.navStart, o.navEnd, n, i);
17
- c && (o.goToDay(c), u(c));
18
- }
19
- };
1
+ function o(e) {
2
+ return !!(e && typeof e == "object" && "before" in e && "after" in e);
3
+ }
4
+ function t(e) {
5
+ return !!(e && typeof e == "object" && "from" in e);
6
+ }
7
+ function r(e) {
8
+ return !!(e && typeof e == "object" && "after" in e);
9
+ }
10
+ function f(e) {
11
+ return !!(e && typeof e == "object" && "before" in e);
12
+ }
13
+ function i(e) {
14
+ return !!(e && typeof e == "object" && "dayOfWeek" in e);
15
+ }
16
+ function y(e, n) {
17
+ return Array.isArray(e) && e.every(n.isDate);
20
18
  }
21
19
  export {
22
- S as useFocus
20
+ r as isDateAfterType,
21
+ f as isDateBeforeType,
22
+ o as isDateInterval,
23
+ t as isDateRange,
24
+ y as isDatesArray,
25
+ i as isDayOfWeekType
23
26
  };