@boxcustodia/library 0.2.3 → 0.2.4

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 (248) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.es101.js +2 -2
  3. package/dist/index.es104.js +9 -4
  4. package/dist/index.es105.js +4 -14
  5. package/dist/index.es106.js +14 -5
  6. package/dist/index.es107.js +4 -56
  7. package/dist/index.es108.js +55 -222
  8. package/dist/index.es109.js +224 -11
  9. package/dist/index.es110.js +4 -4
  10. package/dist/index.es111.js +11 -41
  11. package/dist/index.es112.js +41 -11
  12. package/dist/index.es113.js +21 -33
  13. package/dist/index.es114.js +12 -21
  14. package/dist/index.es115.js +4 -5
  15. package/dist/index.es116.js +4 -3
  16. package/dist/index.es117.js +4 -5
  17. package/dist/index.es118.js +14 -14
  18. package/dist/index.es119.js +813 -55
  19. package/dist/index.es120.js +9 -822
  20. package/dist/index.es121.js +5 -3
  21. package/dist/index.es122.js +4 -11
  22. package/dist/index.es123.js +64 -4
  23. package/dist/index.es124.js +33 -13
  24. package/dist/index.es125.js +13 -33
  25. package/dist/index.es126.js +216 -13
  26. package/dist/index.es127.js +13 -8
  27. package/dist/index.es128.js +7 -215
  28. package/dist/index.es130.js +1 -1
  29. package/dist/index.es131.js +1 -1
  30. package/dist/index.es132.js +12 -9
  31. package/dist/index.es133.js +196 -204
  32. package/dist/index.es134.js +41 -10
  33. package/dist/index.es135.js +9 -12
  34. package/dist/index.es136.js +204 -196
  35. package/dist/index.es137.js +10 -41
  36. package/dist/index.es139.js +1 -1
  37. package/dist/index.es140.js +1 -1
  38. package/dist/index.es141.js +12 -6
  39. package/dist/index.es142.js +5 -63
  40. package/dist/index.es143.js +64 -10
  41. package/dist/index.es144.js +10 -124
  42. package/dist/index.es145.js +116 -126
  43. package/dist/index.es146.js +134 -13
  44. package/dist/index.es147.js +14 -33
  45. package/dist/index.es148.js +32 -14
  46. package/dist/index.es149.js +14 -8
  47. package/dist/index.es15.js +1 -1
  48. package/dist/index.es150.js +9 -50
  49. package/dist/index.es151.js +50 -6
  50. package/dist/index.es152.js +6 -2
  51. package/dist/index.es153.js +2 -44
  52. package/dist/index.es154.js +40 -646
  53. package/dist/index.es155.js +648 -11
  54. package/dist/index.es156.js +5 -5
  55. package/dist/index.es157.js +4 -4
  56. package/dist/index.es158.js +45 -3
  57. package/dist/index.es159.js +7 -45
  58. package/dist/index.es160.js +4 -8
  59. package/dist/index.es162.js +1 -1
  60. package/dist/index.es163.js +6 -118
  61. package/dist/index.es164.js +3 -35
  62. package/dist/index.es165.js +2054 -2
  63. package/dist/index.es166.js +118 -2
  64. package/dist/index.es167.js +33 -6
  65. package/dist/index.es168.js +4 -3
  66. package/dist/index.es169.js +2 -2054
  67. package/dist/index.es176.js +1 -1
  68. package/dist/index.es177.js +1 -1
  69. package/dist/index.es178.js +1 -1
  70. package/dist/index.es181.js +2 -2
  71. package/dist/index.es183.js +1 -1
  72. package/dist/index.es203.js +1 -1
  73. package/dist/index.es22.js +2 -2
  74. package/dist/index.es236.js +176 -19
  75. package/dist/index.es237.js +15 -3
  76. package/dist/index.es238.js +3 -32
  77. package/dist/index.es239.js +32 -12
  78. package/dist/index.es240.js +17 -177
  79. package/dist/index.es242.js +5 -5
  80. package/dist/index.es243.js +16 -18
  81. package/dist/index.es246.js +1 -1
  82. package/dist/index.es247.js +1 -1
  83. package/dist/index.es248.js +3 -3
  84. package/dist/index.es27.js +1 -1
  85. package/dist/index.es275.js +12 -12
  86. package/dist/index.es276.js +2 -2
  87. package/dist/index.es277.js +2 -2
  88. package/dist/index.es278.js +8 -8
  89. package/dist/index.es279.js +2 -2
  90. package/dist/index.es28.js +1 -1
  91. package/dist/index.es283.js +16 -15
  92. package/dist/index.es284.js +8 -3
  93. package/dist/index.es285.js +15 -16
  94. package/dist/index.es286.js +3 -8
  95. package/dist/index.es29.js +3 -3
  96. package/dist/index.es30.js +23 -23
  97. package/dist/index.es32.js +2 -2
  98. package/dist/index.es325.js +1 -1
  99. package/dist/index.es33.js +2 -2
  100. package/dist/index.es335.js +3 -3
  101. package/dist/index.es338.js +1 -1
  102. package/dist/index.es339.js +1 -1
  103. package/dist/index.es34.js +46 -35
  104. package/dist/index.es342.js +2 -2
  105. package/dist/index.es343.js +2 -2
  106. package/dist/index.es35.js +2 -2
  107. package/dist/index.es350.js +2 -29
  108. package/dist/index.es351.js +106 -5
  109. package/dist/index.es352.js +76 -2
  110. package/dist/index.es353.js +36 -107
  111. package/dist/index.es354.js +60 -73
  112. package/dist/index.es355.js +28 -30
  113. package/dist/index.es356.js +63 -61
  114. package/dist/index.es357.js +109 -30
  115. package/dist/index.es358.js +87 -59
  116. package/dist/index.es359.js +40 -110
  117. package/dist/index.es360.js +3 -94
  118. package/dist/index.es361.js +3 -43
  119. package/dist/index.es362.js +2 -2
  120. package/dist/index.es363.js +2 -2
  121. package/dist/index.es364.js +2 -2
  122. package/dist/index.es366.js +2 -2
  123. package/dist/index.es367.js +2 -2
  124. package/dist/index.es368.js +2 -2
  125. package/dist/index.es369.js +241 -4
  126. package/dist/index.es370.js +384 -4
  127. package/dist/index.es371.js +132 -204
  128. package/dist/index.es372.js +103 -334
  129. package/dist/index.es373.js +75 -102
  130. package/dist/index.es374.js +4 -153
  131. package/dist/index.es375.js +4 -142
  132. package/dist/index.es376.js +2 -2
  133. package/dist/index.es377.js +2 -2
  134. package/dist/index.es378.js +2 -2
  135. package/dist/index.es379.js +2 -2
  136. package/dist/index.es38.js +1 -1
  137. package/dist/index.es380.js +29 -2
  138. package/dist/index.es381.js +5 -2
  139. package/dist/index.es39.js +1 -1
  140. package/dist/index.es393.js +1 -1
  141. package/dist/index.es394.js +1 -1
  142. package/dist/index.es404.js +68 -2
  143. package/dist/index.es405.js +31 -47
  144. package/dist/index.es406.js +16 -83
  145. package/dist/index.es407.js +140 -13
  146. package/dist/index.es408.js +113 -340
  147. package/dist/index.es409.js +507 -63
  148. package/dist/index.es41.js +1 -1
  149. package/dist/index.es410.js +126 -10
  150. package/dist/index.es411.js +117 -510
  151. package/dist/index.es412.js +64 -116
  152. package/dist/index.es413.js +10 -125
  153. package/dist/index.es414.js +2 -68
  154. package/dist/index.es415.js +47 -31
  155. package/dist/index.es416.js +83 -16
  156. package/dist/index.es417.js +13 -140
  157. package/dist/index.es418.js +340 -113
  158. package/dist/index.es43.js +1 -1
  159. package/dist/index.es439.js +2 -2
  160. package/dist/index.es44.js +4 -4
  161. package/dist/index.es441.js +275 -3
  162. package/dist/index.es442.js +78 -105
  163. package/dist/index.es443.js +166 -2
  164. package/dist/index.es444.js +3 -2
  165. package/dist/index.es445.js +100 -268
  166. package/dist/index.es446.js +2 -80
  167. package/dist/index.es447.js +2 -166
  168. package/dist/index.es45.js +1 -1
  169. package/dist/index.es46.js +5 -5
  170. package/dist/index.es475.js +1 -1
  171. package/dist/index.es476.js +1 -1
  172. package/dist/index.es49.js +2 -2
  173. package/dist/index.es50.js +1 -1
  174. package/dist/index.es51.js +4 -4
  175. package/dist/index.es54.js +1 -1
  176. package/dist/index.es57.js +3 -3
  177. package/dist/index.es59.js +2 -2
  178. package/dist/index.es61.js +1 -1
  179. package/dist/index.es62.js +1 -1
  180. package/dist/index.es63.js +2 -2
  181. package/dist/index.es64.js +1 -1
  182. package/dist/index.es65.js +3 -3
  183. package/dist/index.es66.js +2 -2
  184. package/dist/index.es67.js +2 -2
  185. package/dist/index.es753.js +5 -5
  186. package/dist/index.es754.js +22 -14
  187. package/dist/index.es755.js +82 -59
  188. package/dist/index.es756.js +14 -22
  189. package/dist/index.es757.js +59 -82
  190. package/dist/index.es769.js +2 -8
  191. package/dist/index.es770.js +2 -56
  192. package/dist/index.es771.js +7 -18
  193. package/dist/index.es772.js +56 -2
  194. package/dist/index.es773.js +19 -2
  195. package/dist/index.es780.js +28 -28
  196. package/dist/index.es782.js +5 -5
  197. package/dist/index.es783.js +13 -17
  198. package/dist/index.es785.js +5 -11
  199. package/dist/index.es786.js +28 -28
  200. package/dist/index.es787.js +5 -5
  201. package/dist/index.es788.js +17 -13
  202. package/dist/index.es789.js +11 -5
  203. package/dist/index.es79.js +1 -1
  204. package/dist/index.es790.js +1 -1
  205. package/dist/index.es796.js +1 -1
  206. package/dist/index.es797.js +1 -1
  207. package/dist/index.es798.js +1 -1
  208. package/dist/index.es799.js +1 -1
  209. package/dist/index.es80.js +1 -1
  210. package/dist/index.es801.js +1 -1
  211. package/dist/index.es805.js +8 -10
  212. package/dist/index.es806.js +9 -7
  213. package/dist/index.es807.js +1 -1
  214. package/dist/index.es808.js +10 -8
  215. package/dist/index.es809.js +7 -9
  216. package/dist/index.es810.js +5 -5
  217. package/dist/index.es811.js +2 -2
  218. package/dist/index.es812.js +1 -1
  219. package/dist/index.es814.js +2 -2
  220. package/dist/index.es822.js +1 -1
  221. package/dist/index.es824.js +25 -38
  222. package/dist/index.es825.js +38 -25
  223. package/dist/index.es826.js +15 -64
  224. package/dist/index.es827.js +7 -11
  225. package/dist/index.es828.js +61 -38
  226. package/dist/index.es829.js +7 -54
  227. package/dist/index.es830.js +40 -16
  228. package/dist/index.es831.js +57 -17
  229. package/dist/index.es832.js +20 -7
  230. package/dist/index.es833.js +1 -1
  231. package/dist/index.es84.js +305 -33
  232. package/dist/index.es85.js +12 -46
  233. package/dist/index.es86.js +34 -29
  234. package/dist/index.es87.js +42 -26
  235. package/dist/index.es88.js +27 -304
  236. package/dist/index.es89.js +30 -12
  237. package/dist/index.es90.js +55 -9
  238. package/dist/index.es91.js +52 -52
  239. package/dist/index.es92.js +92 -55
  240. package/dist/index.es93.js +34 -87
  241. package/dist/index.es94.js +23 -36
  242. package/dist/index.es95.js +24 -18
  243. package/dist/index.es96.js +257 -28
  244. package/dist/index.es97.js +5 -5
  245. package/dist/index.es98.js +32 -258
  246. package/dist/index.es99.js +5 -5
  247. package/dist/style.css +8 -8
  248. package/package.json +1 -1
@@ -1,309 +1,32 @@
1
- import { a as ve } from "./index.es135.js";
2
- import { Root as pe, Portal as be, Overlay as he, Content as ge } from "./index.es136.js";
3
- import * as n from "react";
4
- import { Primitive as C } from "./index.es137.js";
5
- var L = '[cmdk-group=""]', _ = '[cmdk-group-items=""]', Ee = '[cmdk-group-heading=""]', Q = '[cmdk-item=""]', ie = `${Q}:not([aria-disabled="true"])`, J = "cmdk-item-select", $ = "data-value", ye = (r, l, t) => ve(r, l, t), oe = n.createContext(void 0), q = () => n.useContext(oe), ce = n.createContext(void 0), X = () => n.useContext(ce), de = n.createContext(void 0), se = n.forwardRef((r, l) => {
6
- let t = P(() => {
7
- var e, u;
8
- return { search: "", value: (u = (e = r.value) != null ? e : r.defaultValue) != null ? u : "", filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
9
- }), v = P(() => /* @__PURE__ */ new Set()), i = P(() => /* @__PURE__ */ new Map()), d = P(() => /* @__PURE__ */ new Map()), s = P(() => /* @__PURE__ */ new Set()), m = fe(r), { label: p, children: g, value: c, onValueChange: w, filter: k, shouldFilter: S, loop: V, disablePointerSelection: O = !1, vimBindings: R = !0, ...j } = r, Y = n.useId(), Z = n.useId(), ee = n.useId(), x = n.useRef(null), b = Pe();
10
- M(() => {
11
- if (c !== void 0) {
12
- let e = c.trim();
13
- t.current.value = e, E.emit();
14
- }
15
- }, [c]), M(() => {
16
- b(6, re);
17
- }, []);
18
- let E = n.useMemo(() => ({ subscribe: (e) => (s.current.add(e), () => s.current.delete(e)), snapshot: () => t.current, setState: (e, u, o) => {
19
- var a, f, h;
20
- if (!Object.is(t.current[e], u)) {
21
- if (t.current[e] = u, e === "search") W(), U(), b(1, G);
22
- else if (e === "value" && (o || b(5, re), ((a = m.current) == null ? void 0 : a.value) !== void 0)) {
23
- let y = u ?? "";
24
- (h = (f = m.current).onValueChange) == null || h.call(f, y);
25
- return;
26
- }
27
- E.emit();
28
- }
29
- }, emit: () => {
30
- s.current.forEach((e) => e());
31
- } }), []), z = n.useMemo(() => ({ value: (e, u, o) => {
32
- var a;
33
- u !== ((a = d.current.get(e)) == null ? void 0 : a.value) && (d.current.set(e, { value: u, keywords: o }), t.current.filtered.items.set(e, te(u, o)), b(2, () => {
34
- U(), E.emit();
35
- }));
36
- }, item: (e, u) => (v.current.add(e), u && (i.current.has(u) ? i.current.get(u).add(e) : i.current.set(u, /* @__PURE__ */ new Set([e]))), b(3, () => {
37
- W(), U(), t.current.value || G(), E.emit();
38
- }), () => {
39
- d.current.delete(e), v.current.delete(e), t.current.filtered.items.delete(e);
40
- let o = D();
41
- b(4, () => {
42
- W(), (o == null ? void 0 : o.getAttribute("id")) === e && G(), E.emit();
43
- });
44
- }), group: (e) => (i.current.has(e) || i.current.set(e, /* @__PURE__ */ new Set()), () => {
45
- d.current.delete(e), i.current.delete(e);
46
- }), filter: () => m.current.shouldFilter, label: p || r["aria-label"], disablePointerSelection: O, listId: Y, inputId: ee, labelId: Z, listInnerRef: x }), []);
47
- function te(e, u) {
48
- var o, a;
49
- let f = (a = (o = m.current) == null ? void 0 : o.filter) != null ? a : ye;
50
- return e ? f(e, t.current.search, u) : 0;
51
- }
52
- function U() {
53
- if (!t.current.search || m.current.shouldFilter === !1) return;
54
- let e = t.current.filtered.items, u = [];
55
- t.current.filtered.groups.forEach((a) => {
56
- let f = i.current.get(a), h = 0;
57
- f.forEach((y) => {
58
- let I = e.get(y);
59
- h = Math.max(I, h);
60
- }), u.push([a, h]);
61
- });
62
- let o = x.current;
63
- K().sort((a, f) => {
64
- var h, y;
65
- let I = a.getAttribute("id"), H = f.getAttribute("id");
66
- return ((h = e.get(H)) != null ? h : 0) - ((y = e.get(I)) != null ? y : 0);
67
- }).forEach((a) => {
68
- let f = a.closest(_);
69
- f ? f.appendChild(a.parentElement === f ? a : a.closest(`${_} > *`)) : o.appendChild(a.parentElement === o ? a : a.closest(`${_} > *`));
70
- }), u.sort((a, f) => f[1] - a[1]).forEach((a) => {
71
- let f = x.current.querySelector(`${L}[${$}="${encodeURIComponent(a[0])}"]`);
72
- f == null || f.parentElement.appendChild(f);
73
- });
74
- }
75
- function G() {
76
- let e = K().find((o) => o.getAttribute("aria-disabled") !== "true"), u = e == null ? void 0 : e.getAttribute($);
77
- E.setState("value", u || void 0);
78
- }
79
- function W() {
80
- var e, u, o, a;
81
- if (!t.current.search || m.current.shouldFilter === !1) {
82
- t.current.filtered.count = v.current.size;
83
- return;
84
- }
85
- t.current.filtered.groups = /* @__PURE__ */ new Set();
86
- let f = 0;
87
- for (let h of v.current) {
88
- let y = (u = (e = d.current.get(h)) == null ? void 0 : e.value) != null ? u : "", I = (a = (o = d.current.get(h)) == null ? void 0 : o.keywords) != null ? a : [], H = te(y, I);
89
- t.current.filtered.items.set(h, H), H > 0 && f++;
90
- }
91
- for (let [h, y] of i.current) for (let I of y) if (t.current.filtered.items.get(I) > 0) {
92
- t.current.filtered.groups.add(h);
93
- break;
94
- }
95
- t.current.filtered.count = f;
96
- }
97
- function re() {
98
- var e, u, o;
99
- let a = D();
100
- a && (((e = a.parentElement) == null ? void 0 : e.firstChild) === a && ((o = (u = a.closest(L)) == null ? void 0 : u.querySelector(Ee)) == null || o.scrollIntoView({ block: "nearest" })), a.scrollIntoView({ block: "nearest" }));
101
- }
102
- function D() {
103
- var e;
104
- return (e = x.current) == null ? void 0 : e.querySelector(`${Q}[aria-selected="true"]`);
105
- }
106
- function K() {
107
- var e;
108
- return Array.from((e = x.current) == null ? void 0 : e.querySelectorAll(ie));
109
- }
110
- function B(e) {
111
- let u = K()[e];
112
- u && E.setState("value", u.getAttribute($));
113
- }
114
- function T(e) {
115
- var u;
116
- let o = D(), a = K(), f = a.findIndex((y) => y === o), h = a[f + e];
117
- (u = m.current) != null && u.loop && (h = f + e < 0 ? a[a.length - 1] : f + e === a.length ? a[0] : a[f + e]), h && E.setState("value", h.getAttribute($));
118
- }
119
- function ne(e) {
120
- let u = D(), o = u == null ? void 0 : u.closest(L), a;
121
- for (; o && !a; ) o = e > 0 ? Me(o, L) : Ae(o, L), a = o == null ? void 0 : o.querySelector(ie);
122
- a ? E.setState("value", a.getAttribute($)) : T(e);
123
- }
124
- let le = () => B(K().length - 1), ae = (e) => {
125
- e.preventDefault(), e.metaKey ? le() : e.altKey ? ne(1) : T(1);
126
- }, ue = (e) => {
127
- e.preventDefault(), e.metaKey ? B(0) : e.altKey ? ne(-1) : T(-1);
128
- };
129
- return n.createElement(C.div, { ref: l, tabIndex: -1, ...j, "cmdk-root": "", onKeyDown: (e) => {
130
- var u;
131
- if ((u = j.onKeyDown) == null || u.call(j, e), !e.defaultPrevented) switch (e.key) {
132
- case "n":
133
- case "j": {
134
- R && e.ctrlKey && ae(e);
135
- break;
136
- }
137
- case "ArrowDown": {
138
- ae(e);
139
- break;
140
- }
141
- case "p":
142
- case "k": {
143
- R && e.ctrlKey && ue(e);
144
- break;
145
- }
146
- case "ArrowUp": {
147
- ue(e);
148
- break;
149
- }
150
- case "Home": {
151
- e.preventDefault(), B(0);
152
- break;
153
- }
154
- case "End": {
155
- e.preventDefault(), le();
156
- break;
157
- }
158
- case "Enter":
159
- if (!e.nativeEvent.isComposing && e.keyCode !== 229) {
160
- e.preventDefault();
161
- let o = D();
162
- if (o) {
163
- let a = new Event(J);
164
- o.dispatchEvent(a);
165
- }
1
+ import { j as o } from "./index.es83.js";
2
+ import { useRef as r } from "react";
3
+ import i from "./index.es136.js";
4
+ import a from "./index.es117.js";
5
+ import { cn as m } from "./index.es73.js";
6
+ const s = ({ loading: e, ...t }) => {
7
+ const n = r(null);
8
+ return /* @__PURE__ */ o.jsx(
9
+ i,
10
+ {
11
+ unmountOnExit: !0,
12
+ mountOnEnter: !0,
13
+ timeout: 200,
14
+ in: e,
15
+ classNames: "btn-loader",
16
+ nodeRef: n,
17
+ children: /* @__PURE__ */ o.jsx(
18
+ a,
19
+ {
20
+ ...t,
21
+ ref: n,
22
+ "data-testid": "btn-loader",
23
+ className: m("ui-animate-spin", t.className)
166
24
  }
25
+ )
167
26
  }
168
- } }, n.createElement("label", { "cmdk-label": "", htmlFor: z.inputId, id: z.labelId, style: Ke }, p), N(r, (e) => n.createElement(ce.Provider, { value: E }, n.createElement(oe.Provider, { value: z }, e))));
169
- }), we = n.forwardRef((r, l) => {
170
- var t, v;
171
- let i = n.useId(), d = n.useRef(null), s = n.useContext(de), m = q(), p = fe(r), g = (v = (t = p.current) == null ? void 0 : t.forceMount) != null ? v : s == null ? void 0 : s.forceMount;
172
- M(() => {
173
- if (!g) return m.item(i, s == null ? void 0 : s.id);
174
- }, [g]);
175
- let c = me(i, d, [r.value, r.children, d], r.keywords), w = X(), k = A((b) => b.value && b.value === c.current), S = A((b) => g || m.filter() === !1 ? !0 : b.search ? b.filtered.items.get(i) > 0 : !0);
176
- n.useEffect(() => {
177
- let b = d.current;
178
- if (!(!b || r.disabled)) return b.addEventListener(J, V), () => b.removeEventListener(J, V);
179
- }, [S, r.onSelect, r.disabled]);
180
- function V() {
181
- var b, E;
182
- O(), (E = (b = p.current).onSelect) == null || E.call(b, c.current);
183
- }
184
- function O() {
185
- w.setState("value", c.current, !0);
186
- }
187
- if (!S) return null;
188
- let { disabled: R, value: j, onSelect: Y, forceMount: Z, keywords: ee, ...x } = r;
189
- return n.createElement(C.div, { ref: F([d, l]), ...x, id: i, "cmdk-item": "", role: "option", "aria-disabled": !!R, "aria-selected": !!k, "data-disabled": !!R, "data-selected": !!k, onPointerMove: R || m.disablePointerSelection ? void 0 : O, onClick: R ? void 0 : V }, r.children);
190
- }), Se = n.forwardRef((r, l) => {
191
- let { heading: t, children: v, forceMount: i, ...d } = r, s = n.useId(), m = n.useRef(null), p = n.useRef(null), g = n.useId(), c = q(), w = A((S) => i || c.filter() === !1 ? !0 : S.search ? S.filtered.groups.has(s) : !0);
192
- M(() => c.group(s), []), me(s, m, [r.value, r.heading, p]);
193
- let k = n.useMemo(() => ({ id: s, forceMount: i }), [i]);
194
- return n.createElement(C.div, { ref: F([m, l]), ...d, "cmdk-group": "", role: "presentation", hidden: w ? void 0 : !0 }, t && n.createElement("div", { ref: p, "cmdk-group-heading": "", "aria-hidden": !0, id: g }, t), N(r, (S) => n.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": t ? g : void 0 }, n.createElement(de.Provider, { value: k }, S))));
195
- }), Ce = n.forwardRef((r, l) => {
196
- let { alwaysRender: t, ...v } = r, i = n.useRef(null), d = A((s) => !s.search);
197
- return !t && !d ? null : n.createElement(C.div, { ref: F([i, l]), ...v, "cmdk-separator": "", role: "separator" });
198
- }), ke = n.forwardRef((r, l) => {
199
- let { onValueChange: t, ...v } = r, i = r.value != null, d = X(), s = A((c) => c.search), m = A((c) => c.value), p = q(), g = n.useMemo(() => {
200
- var c;
201
- let w = (c = p.listInnerRef.current) == null ? void 0 : c.querySelector(`${Q}[${$}="${encodeURIComponent(m)}"]`);
202
- return w == null ? void 0 : w.getAttribute("id");
203
- }, []);
204
- return n.useEffect(() => {
205
- r.value != null && d.setState("search", r.value);
206
- }, [r.value]), n.createElement(C.input, { ref: l, ...v, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": p.listId, "aria-labelledby": p.labelId, "aria-activedescendant": g, id: p.inputId, type: "text", value: i ? r.value : s, onChange: (c) => {
207
- i || d.setState("search", c.target.value), t == null || t(c.target.value);
208
- } });
209
- }), Re = n.forwardRef((r, l) => {
210
- let { children: t, label: v = "Suggestions", ...i } = r, d = n.useRef(null), s = n.useRef(null), m = q();
211
- return n.useEffect(() => {
212
- if (s.current && d.current) {
213
- let p = s.current, g = d.current, c, w = new ResizeObserver(() => {
214
- c = requestAnimationFrame(() => {
215
- let k = p.offsetHeight;
216
- g.style.setProperty("--cmdk-list-height", k.toFixed(1) + "px");
217
- });
218
- });
219
- return w.observe(p), () => {
220
- cancelAnimationFrame(c), w.unobserve(p);
221
- };
222
- }
223
- }, []), n.createElement(C.div, { ref: F([d, l]), ...i, "cmdk-list": "", role: "listbox", "aria-label": v, id: m.listId }, N(r, (p) => n.createElement("div", { ref: F([s, m.listInnerRef]), "cmdk-list-sizer": "" }, p)));
224
- }), xe = n.forwardRef((r, l) => {
225
- let { open: t, onOpenChange: v, overlayClassName: i, contentClassName: d, container: s, ...m } = r;
226
- return n.createElement(pe, { open: t, onOpenChange: v }, n.createElement(be, { container: s }, n.createElement(he, { "cmdk-overlay": "", className: i }), n.createElement(ge, { "aria-label": r.label, "cmdk-dialog": "", className: d }, n.createElement(se, { ref: l, ...m }))));
227
- }), Ie = n.forwardRef((r, l) => A((t) => t.filtered.count === 0) ? n.createElement(C.div, { ref: l, ...r, "cmdk-empty": "", role: "presentation" }) : null), $e = n.forwardRef((r, l) => {
228
- let { progress: t, children: v, label: i = "Loading...", ...d } = r;
229
- return n.createElement(C.div, { ref: l, ...d, "cmdk-loading": "", role: "progressbar", "aria-valuenow": t, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": i }, N(r, (s) => n.createElement("div", { "aria-hidden": !0 }, s)));
230
- }), Ve = Object.assign(se, { List: Re, Item: we, Input: ke, Group: Se, Separator: Ce, Dialog: xe, Empty: Ie, Loading: $e });
231
- function Me(r, l) {
232
- let t = r.nextElementSibling;
233
- for (; t; ) {
234
- if (t.matches(l)) return t;
235
- t = t.nextElementSibling;
236
- }
237
- }
238
- function Ae(r, l) {
239
- let t = r.previousElementSibling;
240
- for (; t; ) {
241
- if (t.matches(l)) return t;
242
- t = t.previousElementSibling;
243
- }
244
- }
245
- function fe(r) {
246
- let l = n.useRef(r);
247
- return M(() => {
248
- l.current = r;
249
- }), l;
250
- }
251
- var M = typeof window > "u" ? n.useEffect : n.useLayoutEffect;
252
- function P(r) {
253
- let l = n.useRef();
254
- return l.current === void 0 && (l.current = r()), l;
255
- }
256
- function F(r) {
257
- return (l) => {
258
- r.forEach((t) => {
259
- typeof t == "function" ? t(l) : t != null && (t.current = l);
260
- });
261
- };
262
- }
263
- function A(r) {
264
- let l = X(), t = () => r(l.snapshot());
265
- return n.useSyncExternalStore(l.subscribe, t, t);
266
- }
267
- function me(r, l, t, v = []) {
268
- let i = n.useRef(), d = q();
269
- return M(() => {
270
- var s;
271
- let m = (() => {
272
- var g;
273
- for (let c of t) {
274
- if (typeof c == "string") return c.trim();
275
- if (typeof c == "object" && "current" in c) return c.current ? (g = c.current.textContent) == null ? void 0 : g.trim() : i.current;
276
- }
277
- })(), p = v.map((g) => g.trim());
278
- d.value(r, m, p), (s = l.current) == null || s.setAttribute($, m), i.current = m;
279
- }), i;
280
- }
281
- var Pe = () => {
282
- let [r, l] = n.useState(), t = P(() => /* @__PURE__ */ new Map());
283
- return M(() => {
284
- t.current.forEach((v) => v()), t.current = /* @__PURE__ */ new Map();
285
- }, [r]), (v, i) => {
286
- t.current.set(v, i), l({});
287
- };
27
+ );
288
28
  };
289
- function De(r) {
290
- let l = r.type;
291
- return typeof l == "function" ? l(r.props) : "render" in l ? l.render(r.props) : r;
292
- }
293
- function N({ asChild: r, children: l }, t) {
294
- return r && n.isValidElement(l) ? n.cloneElement(De(l), { ref: l.ref }, t(l.props.children)) : t(l);
295
- }
296
- var Ke = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
29
+ s.displayName = "LoadingIcon";
297
30
  export {
298
- Ve as Command,
299
- xe as CommandDialog,
300
- Ie as CommandEmpty,
301
- Se as CommandGroup,
302
- ke as CommandInput,
303
- we as CommandItem,
304
- Re as CommandList,
305
- $e as CommandLoading,
306
- se as CommandRoot,
307
- Ce as CommandSeparator,
308
- A as useCommandState
31
+ s as LoadingIcon
309
32
  };
@@ -1,14 +1,32 @@
1
- import e from "./index.es236.js";
2
- /**
3
- * @license lucide-react v0.379.0 - ISC
4
- *
5
- * This source code is licensed under the ISC license.
6
- * See the LICENSE file in the root directory of this source tree.
7
- */
8
- const r = e("Search", [
9
- ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
10
- ["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
11
- ]);
1
+ import * as l from "react";
2
+ import { useCallbackRef as f } from "./index.es137.js";
3
+ function R({
4
+ prop: t,
5
+ defaultProp: r,
6
+ onChange: s = () => {
7
+ }
8
+ }) {
9
+ const [e, n] = v({ defaultProp: r, onChange: s }), o = t !== void 0, i = o ? t : e, u = f(s), d = l.useCallback(
10
+ (c) => {
11
+ if (o) {
12
+ const a = typeof c == "function" ? c(t) : c;
13
+ a !== t && u(a);
14
+ } else
15
+ n(c);
16
+ },
17
+ [o, t, n, u]
18
+ );
19
+ return [i, d];
20
+ }
21
+ function v({
22
+ defaultProp: t,
23
+ onChange: r
24
+ }) {
25
+ const s = l.useState(t), [e] = s, n = l.useRef(e), o = f(r);
26
+ return l.useEffect(() => {
27
+ n.current !== e && (o(e), n.current = e);
28
+ }, [e, n, o]), s;
29
+ }
12
30
  export {
13
- r as default
31
+ R as useControllableState
14
32
  };
@@ -1,11 +1,57 @@
1
- import e from "./index.es236.js";
2
- /**
3
- * @license lucide-react v0.379.0 - ISC
4
- *
5
- * This source code is licensed under the ISC license.
6
- * See the LICENSE file in the root directory of this source tree.
7
- */
8
- const t = e("Check", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]);
1
+ import { useControllableState as b } from "./index.es89.js";
2
+ import { l as o } from "./index.es101.js";
3
+ import { createContext as h } from "react";
4
+ import { isDateRange as f } from "./index.es105.js";
5
+ import w from "./index.es138.js";
6
+ import y from "./index.es139.js";
7
+ import A from "./index.es140.js";
8
+ import { isDate as u } from "./index.es107.js";
9
+ const B = h({
10
+ defaultStartDate: /* @__PURE__ */ new Date(),
11
+ mode: "single",
12
+ isSingleMode: !1,
13
+ isRangeMode: !1,
14
+ selected: void 0,
15
+ selectDate: () => {
16
+ },
17
+ isSelected: () => !1,
18
+ isFirstDayFromRange: () => !1,
19
+ isLastDayFromRange: () => !1,
20
+ isInRange: () => !1
21
+ });
22
+ function G(d) {
23
+ const { mode: r, value: c, defaultValue: g, onChange: m, disabled: p } = d, a = r === "single", s = r === "range", l = r === "multiple", [e, n] = b({
24
+ prop: c,
25
+ onChange: m,
26
+ defaultProp: g
27
+ }), { selectSingleDate: D, isSingleSelected: S } = A(
28
+ u(e) ? e : void 0,
29
+ n
30
+ ), { selectRangeDate: C, isInRange: i, ...M } = y(
31
+ f(e) ? e : void 0,
32
+ n,
33
+ p
34
+ ), { selectMultipleDate: R, isMultipleSelected: v } = w(
35
+ o.isArray(e) ? e : void 0,
36
+ n
37
+ ), x = (t) => {
38
+ if (a) return D(t);
39
+ if (s) return C(t);
40
+ if (l) return R(t);
41
+ }, F = (t) => a ? S(t) : s ? i(t) : l ? v(t) : !1;
42
+ return {
43
+ defaultStartDate: u(e) ? e : o.isArray(e) ? e[0] : f(e) && e.start ? e.start : /* @__PURE__ */ new Date(),
44
+ isSingleMode: a,
45
+ isRangeMode: s,
46
+ selected: e,
47
+ isSelected: F,
48
+ selectDate: x,
49
+ isInRange: i,
50
+ mode: r,
51
+ ...M
52
+ };
53
+ }
9
54
  export {
10
- t as default
55
+ B as CalendarContext,
56
+ G as default
11
57
  };
@@ -1,57 +1,57 @@
1
- import { useControllableState as b } from "./index.es87.js";
2
- import { l as o } from "./index.es101.js";
3
- import { createContext as h } from "react";
4
- import { isDateRange as f } from "./index.es104.js";
5
- import w from "./index.es138.js";
6
- import y from "./index.es139.js";
7
- import A from "./index.es140.js";
8
- import { isDate as u } from "./index.es106.js";
9
- const B = h({
10
- defaultStartDate: /* @__PURE__ */ new Date(),
11
- mode: "single",
12
- isSingleMode: !1,
13
- isRangeMode: !1,
14
- selected: void 0,
15
- selectDate: () => {
16
- },
17
- isSelected: () => !1,
18
- isFirstDayFromRange: () => !1,
19
- isLastDayFromRange: () => !1,
20
- isInRange: () => !1
21
- });
22
- function G(d) {
23
- const { mode: r, value: c, defaultValue: g, onChange: m, disabled: p } = d, a = r === "single", s = r === "range", l = r === "multiple", [e, n] = b({
24
- prop: c,
25
- onChange: m,
26
- defaultProp: g
27
- }), { selectSingleDate: D, isSingleSelected: S } = A(
28
- u(e) ? e : void 0,
29
- n
30
- ), { selectRangeDate: C, isInRange: i, ...M } = y(
31
- f(e) ? e : void 0,
32
- n,
33
- p
34
- ), { selectMultipleDate: R, isMultipleSelected: v } = w(
35
- o.isArray(e) ? e : void 0,
36
- n
37
- ), x = (t) => {
38
- if (a) return D(t);
39
- if (s) return C(t);
40
- if (l) return R(t);
41
- }, F = (t) => a ? S(t) : s ? i(t) : l ? v(t) : !1;
1
+ import { useState as m, useMemo as f } from "react";
2
+ import { parse as D } from "./index.es224.js";
3
+ import { startOfToday as M } from "./index.es234.js";
4
+ import { addMonths as y } from "./index.es187.js";
5
+ import { addYears as a } from "./index.es188.js";
6
+ import { formatDate as s } from "./index.es108.js";
7
+ function w(i = M()) {
8
+ const [o, c] = m({
9
+ month: s(i, "MM"),
10
+ year: s(i, "yyyy")
11
+ }), e = f(
12
+ () => D(`${o.month}-${o.year}`, "MM-yyyy", /* @__PURE__ */ new Date()),
13
+ [o]
14
+ ), n = (t) => {
15
+ c({
16
+ ...o,
17
+ month: s(t, "MM")
18
+ });
19
+ }, r = (t) => {
20
+ c({
21
+ ...o,
22
+ year: s(t, "yyyy")
23
+ });
24
+ };
42
25
  return {
43
- defaultStartDate: u(e) ? e : o.isArray(e) ? e[0] : f(e) && e.start ? e.start : /* @__PURE__ */ new Date(),
44
- isSingleMode: a,
45
- isRangeMode: s,
46
- selected: e,
47
- isSelected: F,
48
- selectDate: x,
49
- isInRange: i,
50
- mode: r,
51
- ...M
26
+ navigationDate: e,
27
+ setMonth: n,
28
+ setYear: r,
29
+ previousMonth: () => {
30
+ const t = y(e, -1);
31
+ n(t);
32
+ },
33
+ nextMonth: () => {
34
+ const t = y(e, 1);
35
+ n(t);
36
+ },
37
+ previousYear: () => {
38
+ const t = a(e, -1);
39
+ r(t);
40
+ },
41
+ nextYear: () => {
42
+ const t = a(e, 1);
43
+ r(t);
44
+ },
45
+ previousDecade: () => {
46
+ const t = a(e, -10);
47
+ r(t);
48
+ },
49
+ nextDecade: () => {
50
+ const t = a(e, 10);
51
+ r(t);
52
+ }
52
53
  };
53
54
  }
54
55
  export {
55
- B as CalendarContext,
56
- G as default
56
+ w as default
57
57
  };