@mateosuarezdev/react-ui 1.0.31 → 1.0.32
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.
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +7 -1
- package/dist/index.js +282 -267
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ import { appendErrors as Wr, FormProvider as Yn, useForm as Rn, useFormContext a
|
|
|
20
20
|
import { validateFieldsNatively as nr, toNestErrors as or } from "@hookform/resolvers";
|
|
21
21
|
import { createGesture as Ar } from "@mateosuarezdev/gestures";
|
|
22
22
|
import { useInitialChangeEvent as In, navigate as tt } from "@mateosuarezdev/react-router";
|
|
23
|
-
const
|
|
23
|
+
const k = (...e) => Cn(Mn(e));
|
|
24
24
|
function Ge(e, t = 100) {
|
|
25
25
|
let r = null, n = null;
|
|
26
26
|
return function(...o) {
|
|
@@ -184,12 +184,12 @@ const ct = (e) => {
|
|
|
184
184
|
{
|
|
185
185
|
alt: "avatar",
|
|
186
186
|
src: e,
|
|
187
|
-
className:
|
|
187
|
+
className: k("rounded-full bg-base-3", St[r])
|
|
188
188
|
}
|
|
189
189
|
) : t ? /* @__PURE__ */ d(
|
|
190
190
|
"p",
|
|
191
191
|
{
|
|
192
|
-
className:
|
|
192
|
+
className: k(
|
|
193
193
|
"rounded-full font-medium dark-theme:bg-base-3 border border-base-6 dark-theme:border-base-4 flex items-center justify-center",
|
|
194
194
|
St[r],
|
|
195
195
|
n
|
|
@@ -199,7 +199,7 @@ const ct = (e) => {
|
|
|
199
199
|
) : /* @__PURE__ */ d(
|
|
200
200
|
"div",
|
|
201
201
|
{
|
|
202
|
-
className:
|
|
202
|
+
className: k(
|
|
203
203
|
"rounded-full text-2xl font-medium flex items-center justify-center",
|
|
204
204
|
"bg-base-2 dark-theme:bg-base-3 border border-base-4",
|
|
205
205
|
"lg:hover:bg-base-3 max-lg:active:bg-base-4 transition-colors",
|
|
@@ -232,7 +232,7 @@ function Ti({
|
|
|
232
232
|
return /* @__PURE__ */ d(
|
|
233
233
|
"div",
|
|
234
234
|
{
|
|
235
|
-
className:
|
|
235
|
+
className: k("flex -space-x-3 rtl:space-x-reverse", e),
|
|
236
236
|
...n,
|
|
237
237
|
children: t
|
|
238
238
|
}
|
|
@@ -307,7 +307,7 @@ const qn = (e = !0, t) => {
|
|
|
307
307
|
const [l, u] = H(!1), [f, m] = H({
|
|
308
308
|
width: 192,
|
|
309
309
|
height: 300
|
|
310
|
-
}), b = $(null), h = $(null),
|
|
310
|
+
}), b = $(null), h = $(null), g = $({
|
|
311
311
|
left: 0,
|
|
312
312
|
right: 0,
|
|
313
313
|
top: 0,
|
|
@@ -316,13 +316,13 @@ const qn = (e = !0, t) => {
|
|
|
316
316
|
y: 0,
|
|
317
317
|
width: 0,
|
|
318
318
|
height: 0
|
|
319
|
-
}),
|
|
319
|
+
}), x = $(null), T = Sr(), S = F(
|
|
320
320
|
(w) => {
|
|
321
|
-
const
|
|
322
|
-
if (!
|
|
321
|
+
const N = w ?? g.current;
|
|
322
|
+
if (!N) return { x: 0, top: 0, bottom: void 0 };
|
|
323
323
|
const W = f.width, R = f.height;
|
|
324
324
|
return Kn({
|
|
325
|
-
triggerRect:
|
|
325
|
+
triggerRect: N,
|
|
326
326
|
popoverWidth: W,
|
|
327
327
|
popoverHeight: R,
|
|
328
328
|
align: t,
|
|
@@ -332,18 +332,18 @@ const qn = (e = !0, t) => {
|
|
|
332
332
|
avoidCollisions: a
|
|
333
333
|
});
|
|
334
334
|
},
|
|
335
|
-
[
|
|
335
|
+
[g.current, f, t, r]
|
|
336
336
|
);
|
|
337
337
|
B(() => {
|
|
338
|
-
if (!l || !e || (
|
|
338
|
+
if (!l || !e || (x.current = document.getElementById(e), !x.current)) return;
|
|
339
339
|
l && _();
|
|
340
340
|
const w = () => {
|
|
341
|
-
|
|
341
|
+
x.current && (u(!1), i?.(), x.current.removeEventListener("scroll", w));
|
|
342
342
|
};
|
|
343
|
-
return s &&
|
|
343
|
+
return s && x.current.addEventListener("scroll", w, {
|
|
344
344
|
passive: !0
|
|
345
345
|
}), () => {
|
|
346
|
-
|
|
346
|
+
x.current && x.current.removeEventListener("scroll", w);
|
|
347
347
|
};
|
|
348
348
|
}, [l, e]);
|
|
349
349
|
const _ = () => {
|
|
@@ -354,7 +354,7 @@ const qn = (e = !0, t) => {
|
|
|
354
354
|
}, P = F(() => {
|
|
355
355
|
if (!b.current) return;
|
|
356
356
|
const w = b.current.getBoundingClientRect();
|
|
357
|
-
|
|
357
|
+
g.current = {
|
|
358
358
|
left: w.left,
|
|
359
359
|
right: w.right,
|
|
360
360
|
top: w.top,
|
|
@@ -363,7 +363,7 @@ const qn = (e = !0, t) => {
|
|
|
363
363
|
y: w.y,
|
|
364
364
|
width: w.width,
|
|
365
365
|
height: w.height
|
|
366
|
-
}, u((
|
|
366
|
+
}, u((N) => (N ? c?.() : i?.(), !N));
|
|
367
367
|
}, []), O = F(() => {
|
|
368
368
|
u(!1), c?.();
|
|
369
369
|
}, []);
|
|
@@ -401,25 +401,25 @@ const qn = (e = !0, t) => {
|
|
|
401
401
|
let l = 0, u = 0;
|
|
402
402
|
if (i) {
|
|
403
403
|
if (o === "right") {
|
|
404
|
-
const b = e.right + a, h = e.left - t - a,
|
|
404
|
+
const b = e.right + a, h = e.left - t - a, g = Math.max(
|
|
405
405
|
0,
|
|
406
406
|
b + t - (c.width - s)
|
|
407
|
-
),
|
|
408
|
-
|
|
407
|
+
), x = Math.max(0, s - h);
|
|
408
|
+
g <= x ? (l = b, g > 0 && (l = c.width - t - s)) : (l = h, x > 0 && (l = s)), u = e.top, u + r > c.height - s && (u = c.height - r - s), u < s && (u = s);
|
|
409
409
|
} else if (o === "left") {
|
|
410
|
-
const b = e.left - t - a, h = e.right + a,
|
|
410
|
+
const b = e.left - t - a, h = e.right + a, g = Math.max(0, s - b), x = Math.max(
|
|
411
411
|
0,
|
|
412
412
|
h + t - (c.width - s)
|
|
413
413
|
);
|
|
414
|
-
|
|
414
|
+
g <= x ? (l = b, g > 0 && (l = s)) : (l = h, x > 0 && (l = c.width - t - s)), u = e.top, u + r > c.height - s && (u = c.height - r - s), u < s && (u = s);
|
|
415
415
|
} else if (o === "bottom") {
|
|
416
416
|
const b = c.height - e.bottom, h = e.top;
|
|
417
417
|
b >= r + a ? u = e.bottom + a : h >= r + a ? u = e.top - r - a : (u = e.bottom + a, u = Math.min(u, c.height - r - s));
|
|
418
|
-
const
|
|
418
|
+
const g = c.width - e.left, x = e.right;
|
|
419
419
|
if (n === "start")
|
|
420
|
-
l = e.left, l + t > c.width - s && (
|
|
420
|
+
l = e.left, l + t > c.width - s && (x >= t ? l = e.right - t : l = c.width - t - s);
|
|
421
421
|
else if (n === "end")
|
|
422
|
-
l = e.right - t, l < s && (
|
|
422
|
+
l = e.right - t, l < s && (g >= t ? l = e.left : l = s);
|
|
423
423
|
else {
|
|
424
424
|
const T = e.left + e.width / 2 - t / 2;
|
|
425
425
|
T >= s && T + t <= c.width - s ? l = T : T < s ? l = s : l = c.width - t - s;
|
|
@@ -427,11 +427,11 @@ const qn = (e = !0, t) => {
|
|
|
427
427
|
} else {
|
|
428
428
|
const b = e.top, h = c.height - e.bottom;
|
|
429
429
|
b >= r + a ? u = e.top - r - a : h >= r + a ? u = e.bottom + a : (u = e.top - r - a, u = Math.max(s, u));
|
|
430
|
-
const
|
|
430
|
+
const g = c.width - e.left, x = e.right;
|
|
431
431
|
if (n === "start")
|
|
432
|
-
l = e.left, l + t > c.width - s && (
|
|
432
|
+
l = e.left, l + t > c.width - s && (x >= t ? l = e.right - t : l = c.width - t - s);
|
|
433
433
|
else if (n === "end")
|
|
434
|
-
l = e.right - t, l < s && (
|
|
434
|
+
l = e.right - t, l < s && (g >= t ? l = e.left : l = s);
|
|
435
435
|
else {
|
|
436
436
|
const T = e.left + e.width / 2 - t / 2;
|
|
437
437
|
T >= s && T + t <= c.width - s ? l = T : T < s ? l = s : l = c.width - t - s;
|
|
@@ -582,8 +582,8 @@ const Un = "relative shrink-0 select-none transition outline-none duration-200 e
|
|
|
582
582
|
type: m = "button",
|
|
583
583
|
...b
|
|
584
584
|
}, h) => {
|
|
585
|
-
const [
|
|
586
|
-
o === "enabled" && (f ? (
|
|
585
|
+
const [g, x] = H(!1), T = (O) => {
|
|
586
|
+
o === "enabled" && (f ? (x(!0), a && a(O), setTimeout(() => x(!1), 1e3)) : a && a(O));
|
|
587
587
|
}, { ref: S, ripple: _ } = qn(
|
|
588
588
|
c,
|
|
589
589
|
e === "contrast" || l
|
|
@@ -595,8 +595,8 @@ const Un = "relative shrink-0 select-none transition outline-none duration-200 e
|
|
|
595
595
|
type: m,
|
|
596
596
|
disabled: b.disabled ? b.disabled : o === "disabled" || o === "loading",
|
|
597
597
|
onMouseDown: _,
|
|
598
|
-
onClick: (O) =>
|
|
599
|
-
className:
|
|
598
|
+
onClick: (O) => g ? null : T(O),
|
|
599
|
+
className: k(
|
|
600
600
|
Un,
|
|
601
601
|
Gn[t],
|
|
602
602
|
Jn[r],
|
|
@@ -2716,11 +2716,11 @@ function fs(e) {
|
|
|
2716
2716
|
r
|
|
2717
2717
|
]), me(() => {
|
|
2718
2718
|
var m;
|
|
2719
|
-
let b = (m = a.current) === null || m === void 0 ? void 0 : m.nextSibling, h = [],
|
|
2719
|
+
let b = (m = a.current) === null || m === void 0 ? void 0 : m.nextSibling, h = [], g = (x) => x.stopPropagation();
|
|
2720
2720
|
for (; b && b !== s.current; )
|
|
2721
|
-
h.push(b), b.addEventListener(Yt,
|
|
2721
|
+
h.push(b), b.addEventListener(Yt, g), b = b.nextSibling;
|
|
2722
2722
|
return i.current = h, () => {
|
|
2723
|
-
for (let
|
|
2723
|
+
for (let x of h) x.removeEventListener(Yt, g);
|
|
2724
2724
|
};
|
|
2725
2725
|
}, [
|
|
2726
2726
|
t
|
|
@@ -2735,8 +2735,8 @@ function fs(e) {
|
|
|
2735
2735
|
i
|
|
2736
2736
|
]), me(() => () => {
|
|
2737
2737
|
var m, b, h;
|
|
2738
|
-
let
|
|
2739
|
-
(i === z || ht(i, z)) && (!
|
|
2738
|
+
let g = (h = (b = q.getTreeNode(i)) === null || b === void 0 || (m = b.parent) === null || m === void 0 ? void 0 : m.scopeRef) !== null && h !== void 0 ? h : null;
|
|
2739
|
+
(i === z || ht(i, z)) && (!g || q.getTreeNode(g)) && (z = g), q.removeTreeNode(i);
|
|
2740
2740
|
}, [
|
|
2741
2741
|
i
|
|
2742
2742
|
]);
|
|
@@ -3130,10 +3130,10 @@ const Gt = ({ children: e, node: t }) => Mr(e, t ?? document.body), ws = ({
|
|
|
3130
3130
|
onClose: m,
|
|
3131
3131
|
maxHeight: b = "400px",
|
|
3132
3132
|
minWidth: h = "200px",
|
|
3133
|
-
maxWidth:
|
|
3133
|
+
maxWidth: g = "500px"
|
|
3134
3134
|
}) => {
|
|
3135
3135
|
const {
|
|
3136
|
-
triggerRef:
|
|
3136
|
+
triggerRef: x,
|
|
3137
3137
|
triggerProps: T,
|
|
3138
3138
|
popoverRef: S,
|
|
3139
3139
|
getPopoverPosition: _,
|
|
@@ -3155,17 +3155,17 @@ const Gt = ({ children: e, node: t }) => Mr(e, t ?? document.body), ws = ({
|
|
|
3155
3155
|
Xn(
|
|
3156
3156
|
{
|
|
3157
3157
|
Escape: (W) => {
|
|
3158
|
-
c && (W.preventDefault(), w(),
|
|
3158
|
+
c && (W.preventDefault(), w(), x.current?.focus());
|
|
3159
3159
|
}
|
|
3160
3160
|
},
|
|
3161
3161
|
{ enabled: P }
|
|
3162
3162
|
), Ir(S, (W) => {
|
|
3163
|
-
!l || !
|
|
3163
|
+
!l || !x.current || !P || !W.target || x.current.contains(W.target) || w();
|
|
3164
3164
|
});
|
|
3165
|
-
const
|
|
3165
|
+
const N = _();
|
|
3166
3166
|
return /* @__PURE__ */ y($r, { children: [
|
|
3167
3167
|
t ? t({
|
|
3168
|
-
triggerRef:
|
|
3168
|
+
triggerRef: x,
|
|
3169
3169
|
triggerProps: T,
|
|
3170
3170
|
toggle: O,
|
|
3171
3171
|
open: P,
|
|
@@ -3173,10 +3173,10 @@ const Gt = ({ children: e, node: t }) => Mr(e, t ?? document.body), ws = ({
|
|
|
3173
3173
|
}) : /* @__PURE__ */ d(
|
|
3174
3174
|
"button",
|
|
3175
3175
|
{
|
|
3176
|
-
ref:
|
|
3176
|
+
ref: x,
|
|
3177
3177
|
...T,
|
|
3178
3178
|
onClick: O,
|
|
3179
|
-
className:
|
|
3179
|
+
className: k(
|
|
3180
3180
|
"outline-none p-2 rounded-md transition-colors",
|
|
3181
3181
|
"hover:bg-base-3 focus-visible:bg-base-3 focus-visible:ring-2 focus-visible:ring-brand",
|
|
3182
3182
|
i
|
|
@@ -3206,15 +3206,15 @@ const Gt = ({ children: e, node: t }) => Mr(e, t ?? document.body), ws = ({
|
|
|
3206
3206
|
ref: S,
|
|
3207
3207
|
style: {
|
|
3208
3208
|
position: "fixed",
|
|
3209
|
-
left:
|
|
3210
|
-
top:
|
|
3211
|
-
bottom:
|
|
3209
|
+
left: N.x,
|
|
3210
|
+
top: N.top,
|
|
3211
|
+
bottom: N.bottom,
|
|
3212
3212
|
maxHeight: typeof b == "number" ? `${b}px` : b,
|
|
3213
3213
|
minWidth: typeof h == "number" ? `${h}px` : h,
|
|
3214
|
-
maxWidth: typeof
|
|
3214
|
+
maxWidth: typeof g == "number" ? `${g}px` : g,
|
|
3215
3215
|
zIndex: 1e3
|
|
3216
3216
|
},
|
|
3217
|
-
className:
|
|
3217
|
+
className: k(
|
|
3218
3218
|
"bg-base-1 dark-theme:bg-base-2",
|
|
3219
3219
|
"border border-base-4 rounded-6",
|
|
3220
3220
|
"customscrollbar overflow-auto",
|
|
@@ -3229,7 +3229,7 @@ const Gt = ({ children: e, node: t }) => Mr(e, t ?? document.body), ws = ({
|
|
|
3229
3229
|
subtitle: t,
|
|
3230
3230
|
onClose: r,
|
|
3231
3231
|
className: n
|
|
3232
|
-
}) => /* @__PURE__ */ d("div", { className:
|
|
3232
|
+
}) => /* @__PURE__ */ d("div", { className: k("p-4 border-b border-base-4", n), children: /* @__PURE__ */ y("div", { className: "flex items-start justify-between", children: [
|
|
3233
3233
|
/* @__PURE__ */ y("div", { children: [
|
|
3234
3234
|
/* @__PURE__ */ d("h3", { className: "font-semibold text-base-12", children: e }),
|
|
3235
3235
|
t && /* @__PURE__ */ d("p", { className: "text-sm text-base-11 mt-1", children: t })
|
|
@@ -3245,10 +3245,10 @@ const Gt = ({ children: e, node: t }) => Mr(e, t ?? document.body), ws = ({
|
|
|
3245
3245
|
] }) }), Di = ({
|
|
3246
3246
|
children: e,
|
|
3247
3247
|
className: t
|
|
3248
|
-
}) => /* @__PURE__ */ d("div", { className:
|
|
3248
|
+
}) => /* @__PURE__ */ d("div", { className: k("p-4", t), children: e }), Pi = ({
|
|
3249
3249
|
children: e,
|
|
3250
3250
|
className: t
|
|
3251
|
-
}) => /* @__PURE__ */ d("div", { className:
|
|
3251
|
+
}) => /* @__PURE__ */ d("div", { className: k("p-4 border-t border-base-4", t), children: e }), ys = (e, t) => {
|
|
3252
3252
|
const r = new Date(2023, 0, 1), n = [];
|
|
3253
3253
|
for (let o = 0; o < 7; o++) {
|
|
3254
3254
|
const a = new Date(r);
|
|
@@ -3274,51 +3274,51 @@ const Gt = ({ children: e, node: t }) => Mr(e, t ?? document.body), ws = ({
|
|
|
3274
3274
|
e || /* @__PURE__ */ new Date()
|
|
3275
3275
|
), b = $(null), h = fe(() => r ? new Set(
|
|
3276
3276
|
r.map((w) => new Date(w).toDateString())
|
|
3277
|
-
) : /* @__PURE__ */ new Set(), [r]),
|
|
3278
|
-
const w = fo(l),
|
|
3277
|
+
) : /* @__PURE__ */ new Set(), [r]), g = fe(() => new Set(n || []), [n]), x = fe(() => {
|
|
3278
|
+
const w = fo(l), N = lo(l), W = new Date(w), R = new Date(N);
|
|
3279
3279
|
if (i) {
|
|
3280
3280
|
const E = w.getDay(), p = E === 0 ? 6 : E - 1;
|
|
3281
3281
|
W.setDate(w.getDate() - p);
|
|
3282
|
-
const D =
|
|
3283
|
-
R.setDate(
|
|
3282
|
+
const D = N.getDay(), M = D === 0 ? 0 : 7 - D;
|
|
3283
|
+
R.setDate(N.getDate() + M);
|
|
3284
3284
|
} else
|
|
3285
|
-
W.setDate(w.getDate() - w.getDay()), R.setDate(
|
|
3285
|
+
W.setDate(w.getDate() - w.getDay()), R.setDate(N.getDate() + (6 - N.getDay()));
|
|
3286
3286
|
return uo({ start: W, end: R });
|
|
3287
3287
|
}, [l, i]), T = fe(
|
|
3288
3288
|
() => ys(s ?? Ve, i),
|
|
3289
3289
|
[s, i]
|
|
3290
3290
|
), S = (w) => {
|
|
3291
|
-
const
|
|
3292
|
-
return !(h.has(
|
|
3291
|
+
const N = w.toDateString(), W = w.getDay();
|
|
3292
|
+
return !(h.has(N) || g.has(W) || o && w < o || a && w > a);
|
|
3293
3293
|
}, _ = (w) => {
|
|
3294
3294
|
S(w) && t && t(w), m(w);
|
|
3295
3295
|
}, P = (w) => {
|
|
3296
3296
|
if (!f) return;
|
|
3297
|
-
let
|
|
3297
|
+
let N = new Date(f), W = !0, R, E;
|
|
3298
3298
|
switch (w.key) {
|
|
3299
3299
|
case "ArrowUp":
|
|
3300
|
-
|
|
3300
|
+
N.setDate(N.getDate() - 7);
|
|
3301
3301
|
break;
|
|
3302
3302
|
case "ArrowDown":
|
|
3303
|
-
|
|
3303
|
+
N.setDate(N.getDate() + 7);
|
|
3304
3304
|
break;
|
|
3305
3305
|
case "ArrowLeft":
|
|
3306
|
-
|
|
3306
|
+
N.setDate(N.getDate() - 1);
|
|
3307
3307
|
break;
|
|
3308
3308
|
case "ArrowRight":
|
|
3309
|
-
|
|
3309
|
+
N.setDate(N.getDate() + 1);
|
|
3310
3310
|
break;
|
|
3311
3311
|
case "Home":
|
|
3312
|
-
R =
|
|
3312
|
+
R = N.getDay(), N.setDate(N.getDate() - R);
|
|
3313
3313
|
break;
|
|
3314
3314
|
case "End":
|
|
3315
|
-
E =
|
|
3315
|
+
E = N.getDay(), N.setDate(N.getDate() + (6 - E));
|
|
3316
3316
|
break;
|
|
3317
3317
|
case "PageUp":
|
|
3318
|
-
|
|
3318
|
+
N = w.shiftKey ? Dt(N, 12) : Dt(N, 1);
|
|
3319
3319
|
break;
|
|
3320
3320
|
case "PageDown":
|
|
3321
|
-
|
|
3321
|
+
N = w.shiftKey ? at(N, 12) : at(N, 1);
|
|
3322
3322
|
break;
|
|
3323
3323
|
case "Enter":
|
|
3324
3324
|
case " ":
|
|
@@ -3327,17 +3327,17 @@ const Gt = ({ children: e, node: t }) => Mr(e, t ?? document.body), ws = ({
|
|
|
3327
3327
|
default:
|
|
3328
3328
|
W = !1;
|
|
3329
3329
|
}
|
|
3330
|
-
W && (w.preventDefault(),
|
|
3330
|
+
W && (w.preventDefault(), N.getTime() !== f.getTime() && (m(N), fr(N, l) || u(N)));
|
|
3331
3331
|
}, O = (w) => {
|
|
3332
3332
|
u(
|
|
3333
|
-
(
|
|
3333
|
+
(N) => w === "prev" ? Dt(N, 1) : at(N, 1)
|
|
3334
3334
|
);
|
|
3335
3335
|
};
|
|
3336
3336
|
return /* @__PURE__ */ y(
|
|
3337
3337
|
"div",
|
|
3338
3338
|
{
|
|
3339
3339
|
ref: b,
|
|
3340
|
-
className:
|
|
3340
|
+
className: k(
|
|
3341
3341
|
"dark-theme:bg-base-3 border border-base-5 dark-theme:border-base-4 rounded-6 px-4 pt-3 pb-4 w-full lg:w-80",
|
|
3342
3342
|
c
|
|
3343
3343
|
),
|
|
@@ -3376,7 +3376,7 @@ const Gt = ({ children: e, node: t }) => Mr(e, t ?? document.body), ws = ({
|
|
|
3376
3376
|
},
|
|
3377
3377
|
w
|
|
3378
3378
|
)) }),
|
|
3379
|
-
/* @__PURE__ */ d("div", { className: "grid grid-cols-7 gap-1 mt-4", role: "grid", children:
|
|
3379
|
+
/* @__PURE__ */ d("div", { className: "grid grid-cols-7 gap-1 mt-4", role: "grid", children: x.map((w, N) => {
|
|
3380
3380
|
const W = fr(w, l), R = e ? Ct(w, e) : !1, E = f && Ct(w, f), p = S(w), D = Ct(w, /* @__PURE__ */ new Date());
|
|
3381
3381
|
return /* @__PURE__ */ d(
|
|
3382
3382
|
"button",
|
|
@@ -3393,7 +3393,7 @@ const Gt = ({ children: e, node: t }) => Mr(e, t ?? document.body), ws = ({
|
|
|
3393
3393
|
})}${R ? ", selected" : ""}${p ? "" : ", disabled"}`,
|
|
3394
3394
|
"aria-selected": R,
|
|
3395
3395
|
"aria-disabled": !p,
|
|
3396
|
-
className:
|
|
3396
|
+
className: k(
|
|
3397
3397
|
"h-8 w-8 flex items-center outline-none justify-center rounded-6 hover:bg-base-4 text-sm relative",
|
|
3398
3398
|
W ? R ? "bg-brand text-brand-text hover:bg-brand" : D ? "text-base-12 ring-1 ring-base-8" : "text-base-12" : "text-base-9",
|
|
3399
3399
|
E && "ring-1 ring-base-6",
|
|
@@ -3401,7 +3401,7 @@ const Gt = ({ children: e, node: t }) => Mr(e, t ?? document.body), ws = ({
|
|
|
3401
3401
|
),
|
|
3402
3402
|
children: Me(w, "d")
|
|
3403
3403
|
},
|
|
3404
|
-
|
|
3404
|
+
N
|
|
3405
3405
|
);
|
|
3406
3406
|
}) })
|
|
3407
3407
|
]
|
|
@@ -3562,8 +3562,8 @@ const Fi = () => /* @__PURE__ */ y("div", { children: [
|
|
|
3562
3562
|
}, u) => {
|
|
3563
3563
|
const f = () => {
|
|
3564
3564
|
r || t?.(e === "indeterminate" ? !0 : !e);
|
|
3565
|
-
}, m = (
|
|
3566
|
-
(
|
|
3565
|
+
}, m = (g) => {
|
|
3566
|
+
(g.key === " " || g.key === "Enter") && (g.preventDefault(), f());
|
|
3567
3567
|
}, b = {
|
|
3568
3568
|
xs: "h-3.5 w-3.5",
|
|
3569
3569
|
sm: "h-4 w-4",
|
|
@@ -3587,7 +3587,7 @@ const Fi = () => /* @__PURE__ */ y("div", { children: [
|
|
|
3587
3587
|
disabled: r,
|
|
3588
3588
|
onClick: f,
|
|
3589
3589
|
onKeyDown: m,
|
|
3590
|
-
className:
|
|
3590
|
+
className: k(
|
|
3591
3591
|
// Base styles
|
|
3592
3592
|
"inline-flex items-center justify-center rounded-2 border border-base-4 transition-all duration-200 ease-in-out",
|
|
3593
3593
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-base-5",
|
|
@@ -3832,7 +3832,7 @@ function _i({
|
|
|
3832
3832
|
return /* @__PURE__ */ d(Yn, { ...e, children: /* @__PURE__ */ d(
|
|
3833
3833
|
"form",
|
|
3834
3834
|
{
|
|
3835
|
-
className:
|
|
3835
|
+
className: k(
|
|
3836
3836
|
"mt-4 lg:mt-8 grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-8 relative",
|
|
3837
3837
|
a
|
|
3838
3838
|
),
|
|
@@ -3893,28 +3893,28 @@ const Ls = ({
|
|
|
3893
3893
|
containerClassName: m,
|
|
3894
3894
|
className: b,
|
|
3895
3895
|
type: h = "text",
|
|
3896
|
-
value:
|
|
3897
|
-
...
|
|
3896
|
+
value: g,
|
|
3897
|
+
...x
|
|
3898
3898
|
}, T) => {
|
|
3899
|
-
const S = $(null), _ = $(!1), [P, O] = H(!1), [w,
|
|
3899
|
+
const S = $(null), _ = $(!1), [P, O] = H(!1), [w, N] = H(!1), W = h === "password", R = W && P ? "text" : l ? "number" : h, E = g !== "" && g !== null && g !== void 0;
|
|
3900
3900
|
return B(() => {
|
|
3901
3901
|
if (!_.current) {
|
|
3902
3902
|
_.current = !0;
|
|
3903
3903
|
return;
|
|
3904
3904
|
}
|
|
3905
3905
|
S.current && zn(S.current);
|
|
3906
|
-
}, [P, S]), /* @__PURE__ */ y("div", { className:
|
|
3906
|
+
}, [P, S]), /* @__PURE__ */ y("div", { className: k("relative", f), children: [
|
|
3907
3907
|
e && r === "default" && /* @__PURE__ */ d(
|
|
3908
3908
|
"label",
|
|
3909
3909
|
{
|
|
3910
|
-
className:
|
|
3910
|
+
className: k("font-medium ml-0.5 text-xs", i && "text-red-9"),
|
|
3911
3911
|
children: e
|
|
3912
3912
|
}
|
|
3913
3913
|
),
|
|
3914
3914
|
/* @__PURE__ */ y(
|
|
3915
3915
|
"div",
|
|
3916
3916
|
{
|
|
3917
|
-
className:
|
|
3917
|
+
className: k(
|
|
3918
3918
|
"rounded-6 transition cursor-text relative",
|
|
3919
3919
|
Fs[n],
|
|
3920
3920
|
{
|
|
@@ -3929,7 +3929,7 @@ const Ls = ({
|
|
|
3929
3929
|
e && r === "floating" && /* @__PURE__ */ d(
|
|
3930
3930
|
"label",
|
|
3931
3931
|
{
|
|
3932
|
-
className:
|
|
3932
|
+
className: k(
|
|
3933
3933
|
"absolute transition-all duration-200 pointer-events-none",
|
|
3934
3934
|
"text-sm top-[18px] font-semibold left-3",
|
|
3935
3935
|
{
|
|
@@ -3944,7 +3944,7 @@ const Ls = ({
|
|
|
3944
3944
|
On,
|
|
3945
3945
|
{
|
|
3946
3946
|
size: 16,
|
|
3947
|
-
className:
|
|
3947
|
+
className: k(
|
|
3948
3948
|
"absolute top-1/2 -translate-y-1/2 left-3",
|
|
3949
3949
|
i ? "text-red-9" : "text-base-11"
|
|
3950
3950
|
)
|
|
@@ -3958,7 +3958,7 @@ const Ls = ({
|
|
|
3958
3958
|
T && (typeof T == "function" ? T(p) : T.current = p), S.current = p;
|
|
3959
3959
|
},
|
|
3960
3960
|
type: R,
|
|
3961
|
-
className:
|
|
3961
|
+
className: k(
|
|
3962
3962
|
"w-full bg-transparent focus-visible:outline-none",
|
|
3963
3963
|
"placeholder:text-sm text-sm placeholder:text-base-11",
|
|
3964
3964
|
l || u ? "pl-9" : "pl-3",
|
|
@@ -3970,11 +3970,11 @@ const Ls = ({
|
|
|
3970
3970
|
},
|
|
3971
3971
|
b
|
|
3972
3972
|
),
|
|
3973
|
-
value:
|
|
3973
|
+
value: g,
|
|
3974
3974
|
placeholder: a,
|
|
3975
|
-
onFocus: () =>
|
|
3976
|
-
onBlur: () =>
|
|
3977
|
-
...
|
|
3975
|
+
onFocus: () => N(!0),
|
|
3976
|
+
onBlur: () => N(!1),
|
|
3977
|
+
...x
|
|
3978
3978
|
}
|
|
3979
3979
|
)
|
|
3980
3980
|
]
|
|
@@ -3991,7 +3991,7 @@ const Ls = ({
|
|
|
3991
3991
|
"button",
|
|
3992
3992
|
{
|
|
3993
3993
|
type: "button",
|
|
3994
|
-
className:
|
|
3994
|
+
className: k(
|
|
3995
3995
|
r === "floating" ? "absolute right-3 top-1/2 -translate-y-1/2" : "absolute right-3 top-10"
|
|
3996
3996
|
),
|
|
3997
3997
|
onClick: () => {
|
|
@@ -4001,13 +4001,13 @@ const Ls = ({
|
|
|
4001
4001
|
Ln,
|
|
4002
4002
|
{
|
|
4003
4003
|
size: 20,
|
|
4004
|
-
className:
|
|
4004
|
+
className: k(i ? "text-red-9" : "text-base-11")
|
|
4005
4005
|
}
|
|
4006
4006
|
) : /* @__PURE__ */ d(
|
|
4007
4007
|
Fn,
|
|
4008
4008
|
{
|
|
4009
4009
|
size: 20,
|
|
4010
|
-
className:
|
|
4010
|
+
className: k(i ? "text-red-9" : "text-base-11")
|
|
4011
4011
|
}
|
|
4012
4012
|
)
|
|
4013
4013
|
}
|
|
@@ -4166,7 +4166,7 @@ const Ri = ({
|
|
|
4166
4166
|
}) => /* @__PURE__ */ d(
|
|
4167
4167
|
"div",
|
|
4168
4168
|
{
|
|
4169
|
-
className:
|
|
4169
|
+
className: k(
|
|
4170
4170
|
"rounded-7 dark-theme:bg-base-3",
|
|
4171
4171
|
e ? "border-none bg-base-3" : "border border-base-6 dark-theme:border-base-4",
|
|
4172
4172
|
t
|
|
@@ -4183,7 +4183,7 @@ const Ri = ({
|
|
|
4183
4183
|
"button",
|
|
4184
4184
|
{
|
|
4185
4185
|
onClick: e,
|
|
4186
|
-
className:
|
|
4186
|
+
className: k(
|
|
4187
4187
|
"w-full text-start first:rounded-t-7 last:rounded-b-7 border-b dark-theme:border-base-4",
|
|
4188
4188
|
"last:border-none px-3 pr-2.5 py-3 dark-theme:bg-base-3 lg:hover:bg-base-4 max-lg:active:bg-base-4",
|
|
4189
4189
|
"transition-colors hover:cursor-pointer flex items-center justify-between outline-none lg:focus-visible:ring-2 focus-visible:ring-base-6",
|
|
@@ -4209,7 +4209,7 @@ const Ri = ({
|
|
|
4209
4209
|
disabled: b = !1,
|
|
4210
4210
|
className: h
|
|
4211
4211
|
}) => {
|
|
4212
|
-
const [
|
|
4212
|
+
const [g, x] = H(""), [T, S] = H(!1), [_, P] = H(-1), O = $(null), w = $(null), N = $([]), {
|
|
4213
4213
|
triggerRef: W,
|
|
4214
4214
|
triggerProps: R,
|
|
4215
4215
|
popoverRef: E,
|
|
@@ -4225,7 +4225,7 @@ const Ri = ({
|
|
|
4225
4225
|
S(!0), m && O.current && setTimeout(() => O.current?.focus(), 10);
|
|
4226
4226
|
},
|
|
4227
4227
|
onClose: () => {
|
|
4228
|
-
S(!1),
|
|
4228
|
+
S(!1), x(""), P(-1);
|
|
4229
4229
|
}
|
|
4230
4230
|
}), j = $(
|
|
4231
4231
|
`multiselect-${Math.random().toString(36).substr(2, 9)}`
|
|
@@ -4233,15 +4233,15 @@ const Ri = ({
|
|
|
4233
4233
|
`label-${Math.random().toString(36).substr(2, 9)}`
|
|
4234
4234
|
).current, L = $(
|
|
4235
4235
|
`error-${Math.random().toString(36).substr(2, 9)}`
|
|
4236
|
-
).current,
|
|
4236
|
+
).current, v = $(
|
|
4237
4237
|
`listbox-${Math.random().toString(36).substr(2, 9)}`
|
|
4238
4238
|
).current, X = i ? n.map((C) => r.find(
|
|
4239
4239
|
(Q) => a(Q) === C || a(Q) === a(C)
|
|
4240
4240
|
)).filter(Boolean) : n, le = X.length > 0, G = m ? r.filter(
|
|
4241
|
-
(C) => s(C).toLowerCase().includes(
|
|
4241
|
+
(C) => s(C).toLowerCase().includes(g.toLowerCase())
|
|
4242
4242
|
) : r;
|
|
4243
4243
|
B(() => {
|
|
4244
|
-
|
|
4244
|
+
N.current = N.current.slice(0, G.length);
|
|
4245
4245
|
}, [G.length]);
|
|
4246
4246
|
const ae = (C) => i ? n.some(
|
|
4247
4247
|
(Y) => Y === a(C) || a(Y) === a(C)
|
|
@@ -4296,24 +4296,24 @@ const Ri = ({
|
|
|
4296
4296
|
M();
|
|
4297
4297
|
else {
|
|
4298
4298
|
const Y = _ >= G.length - 1 ? 0 : _ + 1;
|
|
4299
|
-
P(Y),
|
|
4299
|
+
P(Y), N.current[Y]?.scrollIntoView({ block: "nearest" });
|
|
4300
4300
|
}
|
|
4301
4301
|
break;
|
|
4302
4302
|
case "ArrowUp":
|
|
4303
4303
|
if (C.preventDefault(), D) {
|
|
4304
4304
|
const Y = _ <= 0 ? G.length - 1 : _ - 1;
|
|
4305
|
-
P(Y),
|
|
4305
|
+
P(Y), N.current[Y]?.scrollIntoView({ block: "nearest" });
|
|
4306
4306
|
}
|
|
4307
4307
|
break;
|
|
4308
4308
|
case "Backspace":
|
|
4309
|
-
if (m &&
|
|
4309
|
+
if (m && g === "" && X.length > 0) {
|
|
4310
4310
|
const Y = X[X.length - 1];
|
|
4311
4311
|
Je(Y);
|
|
4312
4312
|
}
|
|
4313
4313
|
break;
|
|
4314
4314
|
}
|
|
4315
4315
|
}, kn = (C) => {
|
|
4316
|
-
|
|
4316
|
+
x(C.target.value), P(-1);
|
|
4317
4317
|
}, En = () => {
|
|
4318
4318
|
b || (m && O.current && O.current.focus(), M());
|
|
4319
4319
|
}, et = (C) => {
|
|
@@ -4323,12 +4323,12 @@ const Ri = ({
|
|
|
4323
4323
|
!W.current || !D || !C.target || W.current.contains(C.target) || A();
|
|
4324
4324
|
});
|
|
4325
4325
|
const Tt = p();
|
|
4326
|
-
return /* @__PURE__ */ y("div", { className:
|
|
4326
|
+
return /* @__PURE__ */ y("div", { className: k("relative", h), children: [
|
|
4327
4327
|
/* @__PURE__ */ y("div", { className: "relative", ref: w, children: [
|
|
4328
4328
|
t === "default" && /* @__PURE__ */ d(
|
|
4329
4329
|
"label",
|
|
4330
4330
|
{
|
|
4331
|
-
className:
|
|
4331
|
+
className: k(
|
|
4332
4332
|
"top-[18px] font-medium ml-0.5 text-xs",
|
|
4333
4333
|
l && "text-red-9"
|
|
4334
4334
|
),
|
|
@@ -4340,7 +4340,7 @@ const Ri = ({
|
|
|
4340
4340
|
{
|
|
4341
4341
|
ref: W,
|
|
4342
4342
|
...R,
|
|
4343
|
-
className:
|
|
4343
|
+
className: k(
|
|
4344
4344
|
"relative rounded-6 px-2 transition cursor-pointer pr-10 min-h-[48px]",
|
|
4345
4345
|
"border border-base-4 light-theme:drop-shadow-sm dark-theme:bg-base-3",
|
|
4346
4346
|
{
|
|
@@ -4356,7 +4356,7 @@ const Ri = ({
|
|
|
4356
4356
|
role: "combobox",
|
|
4357
4357
|
"aria-expanded": D,
|
|
4358
4358
|
"aria-haspopup": "listbox",
|
|
4359
|
-
"aria-owns":
|
|
4359
|
+
"aria-owns": v,
|
|
4360
4360
|
"aria-labelledby": K,
|
|
4361
4361
|
"aria-describedby": l ? L : void 0,
|
|
4362
4362
|
onKeyDown: Ze,
|
|
@@ -4367,7 +4367,7 @@ const Ri = ({
|
|
|
4367
4367
|
{
|
|
4368
4368
|
id: K,
|
|
4369
4369
|
htmlFor: j,
|
|
4370
|
-
className:
|
|
4370
|
+
className: k(
|
|
4371
4371
|
"absolute transition-all duration-200 pointer-events-none",
|
|
4372
4372
|
"text-base top-4 font-semibold left-3",
|
|
4373
4373
|
{
|
|
@@ -4385,14 +4385,14 @@ const Ri = ({
|
|
|
4385
4385
|
/* @__PURE__ */ y(
|
|
4386
4386
|
"div",
|
|
4387
4387
|
{
|
|
4388
|
-
className:
|
|
4388
|
+
className: k("flex flex-wrap gap-2 items-center", {
|
|
4389
4389
|
"mt-2.5": t === "floating"
|
|
4390
4390
|
}),
|
|
4391
4391
|
children: [
|
|
4392
4392
|
X.map((C) => /* @__PURE__ */ y(
|
|
4393
4393
|
"div",
|
|
4394
4394
|
{
|
|
4395
|
-
className:
|
|
4395
|
+
className: k(
|
|
4396
4396
|
"border border-base-4 dark-theme:border-base-5 dark-theme:bg-base-4 rounded-full px-2 py-1 text-sm flex items-center gap-1",
|
|
4397
4397
|
{
|
|
4398
4398
|
"bg-red-4 text-red-9": l
|
|
@@ -4423,13 +4423,13 @@ const Ri = ({
|
|
|
4423
4423
|
id: j,
|
|
4424
4424
|
type: "text",
|
|
4425
4425
|
className: "flex-grow min-w-[60px] bg-transparent outline-none placeholder:text-sm",
|
|
4426
|
-
value:
|
|
4426
|
+
value: g,
|
|
4427
4427
|
onChange: kn,
|
|
4428
4428
|
onKeyDown: Ze,
|
|
4429
4429
|
placeholder: le ? "" : u,
|
|
4430
4430
|
disabled: b,
|
|
4431
4431
|
"aria-autocomplete": "list",
|
|
4432
|
-
"aria-controls":
|
|
4432
|
+
"aria-controls": v,
|
|
4433
4433
|
autoComplete: "off"
|
|
4434
4434
|
}
|
|
4435
4435
|
),
|
|
@@ -4443,7 +4443,7 @@ const Ri = ({
|
|
|
4443
4443
|
An,
|
|
4444
4444
|
{
|
|
4445
4445
|
size: 16,
|
|
4446
|
-
className:
|
|
4446
|
+
className: k("transition-transform text-base-11", {
|
|
4447
4447
|
"rotate-180": D
|
|
4448
4448
|
})
|
|
4449
4449
|
}
|
|
@@ -4468,23 +4468,23 @@ const Ri = ({
|
|
|
4468
4468
|
bottom: Tt.bottom,
|
|
4469
4469
|
width: w.current?.offsetWidth ?? 200
|
|
4470
4470
|
},
|
|
4471
|
-
className:
|
|
4471
|
+
className: k(
|
|
4472
4472
|
"bg-base-1 dark-theme:bg-base-3 border border-base-4",
|
|
4473
4473
|
"rounded-6 shadow-lg max-h-[300px] overflow-y-auto z-50",
|
|
4474
4474
|
"customscrollbarnohide"
|
|
4475
4475
|
),
|
|
4476
4476
|
role: "listbox",
|
|
4477
|
-
id:
|
|
4477
|
+
id: v,
|
|
4478
4478
|
"aria-labelledby": K,
|
|
4479
|
-
children: G.length === 0 ? /* @__PURE__ */ d("div", { className: "px-3 py-2 text-sm text-secondarytext", children:
|
|
4479
|
+
children: G.length === 0 ? /* @__PURE__ */ d("div", { className: "px-3 py-2 text-sm text-secondarytext", children: g ? "No results found" : "No options available" }) : G.map((C, Y) => {
|
|
4480
4480
|
const Q = ae(C);
|
|
4481
4481
|
return /* @__PURE__ */ y(
|
|
4482
4482
|
"div",
|
|
4483
4483
|
{
|
|
4484
4484
|
ref: ($n) => {
|
|
4485
|
-
|
|
4485
|
+
N.current[Y] = $n;
|
|
4486
4486
|
},
|
|
4487
|
-
className:
|
|
4487
|
+
className: k(
|
|
4488
4488
|
"px-3 py-2 text-sm cursor-pointer flex items-center justify-between",
|
|
4489
4489
|
// gap-x-2
|
|
4490
4490
|
"first:rounded-t-6 last:rounded-b-6",
|
|
@@ -4554,9 +4554,9 @@ const Ri = ({
|
|
|
4554
4554
|
size: r = "6",
|
|
4555
4555
|
descriptionClassName: n,
|
|
4556
4556
|
className: o
|
|
4557
|
-
}) => /* @__PURE__ */ y("div", { className:
|
|
4557
|
+
}) => /* @__PURE__ */ y("div", { className: k("text-center", o), children: [
|
|
4558
4558
|
/* @__PURE__ */ d("p", { className: `${js[r]} font-medium`, children: e }),
|
|
4559
|
-
t ? /* @__PURE__ */ d("p", { className:
|
|
4559
|
+
t ? /* @__PURE__ */ d("p", { className: k("mt-6 text-base-11", n), children: t }) : null
|
|
4560
4560
|
] }), Ki = ({
|
|
4561
4561
|
id: e,
|
|
4562
4562
|
tabPage: t,
|
|
@@ -4571,7 +4571,7 @@ const Ri = ({
|
|
|
4571
4571
|
showScrollbar: u = !0,
|
|
4572
4572
|
onScroll: f
|
|
4573
4573
|
}) => {
|
|
4574
|
-
const m = $(null), b = $(null), h = $(null),
|
|
4574
|
+
const m = $(null), b = $(null), h = $(null), g = $(null), x = $(null), [T, S] = H(!1), _ = $(null), P = $({
|
|
4575
4575
|
startY: 0,
|
|
4576
4576
|
// Track where the scroll position was when gesture started
|
|
4577
4577
|
currentY: 0,
|
|
@@ -4590,66 +4590,66 @@ const Ri = ({
|
|
|
4590
4590
|
));
|
|
4591
4591
|
}),
|
|
4592
4592
|
[]
|
|
4593
|
-
),
|
|
4594
|
-
const { maxScroll:
|
|
4595
|
-
return L > 0 ? Math.pow(L, 0.8) : L < -
|
|
4593
|
+
), N = F((L) => {
|
|
4594
|
+
const { maxScroll: v } = P.current;
|
|
4595
|
+
return L > 0 ? Math.pow(L, 0.8) : L < -v ? -v - Math.pow(-(L + v), 0.8) : L;
|
|
4596
4596
|
}, []), W = F(() => {
|
|
4597
|
-
if (!u || !m.current || !
|
|
4597
|
+
if (!u || !m.current || !g.current)
|
|
4598
4598
|
return;
|
|
4599
|
-
const { currentY: L, maxScroll:
|
|
4599
|
+
const { currentY: L, maxScroll: v } = P.current, V = m.current.offsetHeight, X = Math.max(
|
|
4600
4600
|
30,
|
|
4601
|
-
V / (V +
|
|
4601
|
+
V / (V + v) * V
|
|
4602
4602
|
), le = V - X;
|
|
4603
|
-
let G = -L /
|
|
4604
|
-
L > 0 ? (G = 0, ae = 1 - L / V,
|
|
4603
|
+
let G = -L / v * le, ae = 1;
|
|
4604
|
+
L > 0 ? (G = 0, ae = 1 - L / V, g.current.style.transformOrigin = "top") : L < -v ? (G = le, ae = 1 - Math.abs(L + v) / V, g.current.style.transformOrigin = "bottom") : g.current.style.transformOrigin = "top", g.current.style.transform = `translate3d(0, ${G}px, 0) scaleY(${ae})`, g.current.style.height = `${X}px`;
|
|
4605
4605
|
}, [u]), R = F(
|
|
4606
4606
|
(L) => {
|
|
4607
4607
|
if (P.current.currentY = L, b.current && (b.current.style.transform = `translate3d(0, ${L}px, 0)`), h.current) {
|
|
4608
|
-
const
|
|
4608
|
+
const v = Math.max(
|
|
4609
4609
|
L - P.current.refreshThreshold,
|
|
4610
4610
|
-P.current.refreshThreshold
|
|
4611
4611
|
);
|
|
4612
|
-
h.current.style.transform = `translate3d(0, ${
|
|
4612
|
+
h.current.style.transform = `translate3d(0, ${v}px, 0)`;
|
|
4613
4613
|
}
|
|
4614
4614
|
f && f(L), W();
|
|
4615
4615
|
},
|
|
4616
4616
|
[W]
|
|
4617
4617
|
), E = F(
|
|
4618
4618
|
(L) => {
|
|
4619
|
-
const
|
|
4620
|
-
|
|
4621
|
-
const V = performance.now(), X =
|
|
4619
|
+
const v = P.current;
|
|
4620
|
+
v.frameCallback && (re(v.frameCallback), v.frameCallback = null);
|
|
4621
|
+
const V = performance.now(), X = v.currentY, le = L - X, G = () => {
|
|
4622
4622
|
const ae = performance.now() - V, Re = Math.min(ae / l, 1), Je = 1 - Math.pow(1 - Re, 3), Ze = X + le * Je;
|
|
4623
|
-
R(Ze), Re >= 1 && (
|
|
4623
|
+
R(Ze), Re >= 1 && (v.frameCallback && (re(v.frameCallback), v.frameCallback = null), R(L), L === 0 && h.current && (h.current.textContent = "Pull to refresh"));
|
|
4624
4624
|
};
|
|
4625
|
-
|
|
4625
|
+
v.frameCallback = lt.render(G, !0);
|
|
4626
4626
|
},
|
|
4627
4627
|
[R, l]
|
|
4628
4628
|
), p = F(
|
|
4629
4629
|
(L) => {
|
|
4630
|
-
const
|
|
4631
|
-
|
|
4630
|
+
const v = P.current;
|
|
4631
|
+
v.frameCallback && (re(v.frameCallback), v.frameCallback = null);
|
|
4632
4632
|
let V = L, X = Date.now();
|
|
4633
4633
|
const le = () => {
|
|
4634
4634
|
const G = Date.now(), ae = G - X;
|
|
4635
|
-
if (X = G, V *= Math.pow(0.95, ae / 16),
|
|
4636
|
-
|
|
4635
|
+
if (X = G, V *= Math.pow(0.95, ae / 16), v.currentY += V * ae, v.currentY > 0 || v.currentY < -v.maxScroll) {
|
|
4636
|
+
v.frameCallback && (re(v.frameCallback), v.frameCallback = null), E(v.currentY > 0 ? 0 : -v.maxScroll);
|
|
4637
4637
|
return;
|
|
4638
4638
|
}
|
|
4639
|
-
R(
|
|
4639
|
+
R(v.currentY), Math.abs(V) < 0.01 && v.frameCallback && (re(v.frameCallback), v.frameCallback = null);
|
|
4640
4640
|
};
|
|
4641
|
-
|
|
4641
|
+
v.frameCallback = lt.render(le, !0);
|
|
4642
4642
|
},
|
|
4643
4643
|
[R, E]
|
|
4644
4644
|
), D = F(() => {
|
|
4645
|
-
if (!u || !
|
|
4646
|
-
|
|
4647
|
-
|
|
4645
|
+
if (!u || !g.current) return;
|
|
4646
|
+
x.current !== null && clearTimeout(x.current), requestAnimationFrame(() => {
|
|
4647
|
+
g.current && (g.current.style.opacity = "1");
|
|
4648
4648
|
});
|
|
4649
|
-
const L = window.requestIdleCallback || ((
|
|
4650
|
-
|
|
4649
|
+
const L = window.requestIdleCallback || ((v) => setTimeout(v, 1e3));
|
|
4650
|
+
x.current = window.setTimeout(() => {
|
|
4651
4651
|
L(() => {
|
|
4652
|
-
|
|
4652
|
+
g.current && (g.current.style.opacity = "0"), x.current = null;
|
|
4653
4653
|
});
|
|
4654
4654
|
}, 1e3);
|
|
4655
4655
|
}, [u]), M = F(
|
|
@@ -4657,28 +4657,28 @@ const Ri = ({
|
|
|
4657
4657
|
if (_.current !== null && Date.now() - _.current < 50)
|
|
4658
4658
|
return;
|
|
4659
4659
|
_.current = Date.now();
|
|
4660
|
-
const
|
|
4661
|
-
|
|
4660
|
+
const v = P.current;
|
|
4661
|
+
v.isScrolling = !0, v.startY = v.currentY, v.lastTimestamp = Date.now(), v.isPullingToRefresh = v.currentY === 0, v.pullDistance = 0, v.frameCallback && (re(v.frameCallback), v.frameCallback = null), D();
|
|
4662
4662
|
},
|
|
4663
4663
|
[D]
|
|
4664
4664
|
), A = F(
|
|
4665
4665
|
(L) => {
|
|
4666
|
-
const
|
|
4667
|
-
if (!
|
|
4668
|
-
const V =
|
|
4669
|
-
|
|
4666
|
+
const v = P.current;
|
|
4667
|
+
if (!v.isScrolling) return;
|
|
4668
|
+
const V = N(v.startY + L.deltaY);
|
|
4669
|
+
v.isPullingToRefresh && V < v.startY && (v.isPullingToRefresh = !1), R(V), a && v.isPullingToRefresh && !T && V > 0 && (v.pullDistance = V, h.current && (h.current.textContent = v.pullDistance > v.refreshThreshold ? "Release to refresh" : "Pull to refresh")), D();
|
|
4670
4670
|
},
|
|
4671
4671
|
[
|
|
4672
4672
|
a,
|
|
4673
4673
|
R,
|
|
4674
4674
|
T,
|
|
4675
4675
|
D,
|
|
4676
|
-
|
|
4676
|
+
N
|
|
4677
4677
|
]
|
|
4678
4678
|
), j = F(
|
|
4679
4679
|
(L) => {
|
|
4680
|
-
const
|
|
4681
|
-
|
|
4680
|
+
const v = P.current;
|
|
4681
|
+
v.isScrolling && (v.isScrolling = !1, a && v.isPullingToRefresh && !T && v.pullDistance > v.refreshThreshold ? K() : v.currentY > 0 || v.currentY < -v.maxScroll ? E(v.currentY > 0 ? 0 : -v.maxScroll) : p(L.velocityY), v.isPullingToRefresh = !1);
|
|
4682
4682
|
},
|
|
4683
4683
|
[a, p, E, T]
|
|
4684
4684
|
), K = F(() => {
|
|
@@ -4705,7 +4705,7 @@ const Ri = ({
|
|
|
4705
4705
|
}, [M, A, j]), B(() => {
|
|
4706
4706
|
if (m.current)
|
|
4707
4707
|
return w(), W(), window.addEventListener("resize", w), () => {
|
|
4708
|
-
window.removeEventListener("resize", w),
|
|
4708
|
+
window.removeEventListener("resize", w), x.current !== null && clearTimeout(x.current);
|
|
4709
4709
|
};
|
|
4710
4710
|
}, [w, W]), /* @__PURE__ */ y(
|
|
4711
4711
|
ke.div,
|
|
@@ -4741,7 +4741,7 @@ const Ri = ({
|
|
|
4741
4741
|
position: r ? "absolute" : "relative",
|
|
4742
4742
|
...s
|
|
4743
4743
|
},
|
|
4744
|
-
className:
|
|
4744
|
+
className: k(
|
|
4745
4745
|
"top-0 right-0 h-full w-full bg-base-1 isolate will-change-transform",
|
|
4746
4746
|
i
|
|
4747
4747
|
),
|
|
@@ -4782,7 +4782,7 @@ const Ri = ({
|
|
|
4782
4782
|
u && /* @__PURE__ */ d(
|
|
4783
4783
|
"div",
|
|
4784
4784
|
{
|
|
4785
|
-
ref:
|
|
4785
|
+
ref: g,
|
|
4786
4786
|
style: {
|
|
4787
4787
|
position: "absolute",
|
|
4788
4788
|
top: 2,
|
|
@@ -4820,7 +4820,7 @@ function Xi({
|
|
|
4820
4820
|
pullDistance: 0,
|
|
4821
4821
|
refreshThreshold: 50,
|
|
4822
4822
|
isPullingToRefresh: !1
|
|
4823
|
-
}),
|
|
4823
|
+
}), g = F(
|
|
4824
4824
|
Ge(() => {
|
|
4825
4825
|
s.current && i.current && (h.current.maxScroll = Math.max(
|
|
4826
4826
|
0,
|
|
@@ -4828,7 +4828,7 @@ function Xi({
|
|
|
4828
4828
|
));
|
|
4829
4829
|
}),
|
|
4830
4830
|
[]
|
|
4831
|
-
),
|
|
4831
|
+
), x = F((E) => {
|
|
4832
4832
|
const { maxScroll: p } = h.current;
|
|
4833
4833
|
return E > 0 ? Math.pow(E, 0.8) : E < -p ? -p - Math.pow(-(E + p), 0.8) : E;
|
|
4834
4834
|
}, []), T = F(() => {
|
|
@@ -4857,7 +4857,7 @@ function Xi({
|
|
|
4857
4857
|
const p = h.current;
|
|
4858
4858
|
p.frameCallback && (re(p.frameCallback), p.frameCallback = null);
|
|
4859
4859
|
const D = performance.now(), M = p.currentY, A = E - M, j = () => {
|
|
4860
|
-
const K = performance.now() - D, L = Math.min(K / n, 1),
|
|
4860
|
+
const K = performance.now() - D, L = Math.min(K / n, 1), v = 1 - Math.pow(1 - L, 3), V = M + A * v;
|
|
4861
4861
|
S(V), L >= 1 && (p.frameCallback && (re(p.frameCallback), p.frameCallback = null), S(E));
|
|
4862
4862
|
};
|
|
4863
4863
|
p.frameCallback = lt.render(j, !0);
|
|
@@ -4899,11 +4899,11 @@ function Xi({
|
|
|
4899
4899
|
p.isScrolling = !0, p.startY = p.currentY, p.lastTimestamp = Date.now(), p.isPullingToRefresh = p.currentY === 0, p.pullDistance = 0, p.frameCallback && (re(p.frameCallback), p.frameCallback = null), O();
|
|
4900
4900
|
},
|
|
4901
4901
|
[O]
|
|
4902
|
-
),
|
|
4902
|
+
), N = F(
|
|
4903
4903
|
(E) => {
|
|
4904
4904
|
const p = h.current;
|
|
4905
4905
|
if (!p.isScrolling) return;
|
|
4906
|
-
const D =
|
|
4906
|
+
const D = x(p.startY + E.deltaY);
|
|
4907
4907
|
p.isPullingToRefresh && D < p.startY && (p.isPullingToRefresh = !1), S(D), r && p.isPullingToRefresh && !f && D > 0 && (p.pullDistance = D), O();
|
|
4908
4908
|
},
|
|
4909
4909
|
[
|
|
@@ -4911,7 +4911,7 @@ function Xi({
|
|
|
4911
4911
|
S,
|
|
4912
4912
|
f,
|
|
4913
4913
|
O,
|
|
4914
|
-
|
|
4914
|
+
x
|
|
4915
4915
|
]
|
|
4916
4916
|
), W = F(() => {
|
|
4917
4917
|
m(!0), _(h.current.refreshThreshold), r && r().then(() => {
|
|
@@ -4932,16 +4932,16 @@ function Xi({
|
|
|
4932
4932
|
passive: !0,
|
|
4933
4933
|
direction: "y",
|
|
4934
4934
|
onStart: w,
|
|
4935
|
-
onMove:
|
|
4935
|
+
onMove: N,
|
|
4936
4936
|
onEnd: R
|
|
4937
4937
|
});
|
|
4938
4938
|
return E.init(), () => E.destroy();
|
|
4939
|
-
}, [w,
|
|
4939
|
+
}, [w, N, R]), B(() => {
|
|
4940
4940
|
if (s.current)
|
|
4941
|
-
return
|
|
4942
|
-
window.removeEventListener("resize",
|
|
4941
|
+
return g(), T(), window.addEventListener("resize", g), () => {
|
|
4942
|
+
window.removeEventListener("resize", g), u.current !== null && clearTimeout(u.current);
|
|
4943
4943
|
};
|
|
4944
|
-
}, [
|
|
4944
|
+
}, [g, T]), {
|
|
4945
4945
|
container: {
|
|
4946
4946
|
props: {
|
|
4947
4947
|
id: e,
|
|
@@ -4983,8 +4983,8 @@ function Xi({
|
|
|
4983
4983
|
}
|
|
4984
4984
|
},
|
|
4985
4985
|
refreshing: f,
|
|
4986
|
-
updateMaxScroll:
|
|
4987
|
-
rubberBandEffect:
|
|
4986
|
+
updateMaxScroll: g,
|
|
4987
|
+
rubberBandEffect: x,
|
|
4988
4988
|
updateScrollbarPosition: T,
|
|
4989
4989
|
setPosition: S
|
|
4990
4990
|
};
|
|
@@ -5010,7 +5010,7 @@ const Ui = Ue(
|
|
|
5010
5010
|
}, []), /* @__PURE__ */ y(
|
|
5011
5011
|
"div",
|
|
5012
5012
|
{
|
|
5013
|
-
className:
|
|
5013
|
+
className: k(
|
|
5014
5014
|
"rounded-6 relative flex items-center bg-base-3 border-base-5",
|
|
5015
5015
|
{
|
|
5016
5016
|
"dark-theme:bg-red-4 light-theme:border-red-9": c,
|
|
@@ -5030,7 +5030,7 @@ const Ui = Ue(
|
|
|
5030
5030
|
autoCorrect: "off",
|
|
5031
5031
|
type: "search",
|
|
5032
5032
|
autoFocus: n ? n(f) : void 0,
|
|
5033
|
-
className:
|
|
5033
|
+
className: k(
|
|
5034
5034
|
"w-full py-1.5 pl-10 pr-3 bg-transparent outline-none text-base-12 placeholder:text-base-11 [&::-webkit-search-cancel-button]:appearance-none",
|
|
5035
5035
|
c && "text-red-9 placeholder:text-red-9"
|
|
5036
5036
|
)
|
|
@@ -5040,7 +5040,7 @@ const Ui = Ue(
|
|
|
5040
5040
|
_n,
|
|
5041
5041
|
{
|
|
5042
5042
|
size: 20,
|
|
5043
|
-
className:
|
|
5043
|
+
className: k("absolute left-3 text-base-11 pointer-events-none", {
|
|
5044
5044
|
"text-red-9": c
|
|
5045
5045
|
})
|
|
5046
5046
|
}
|
|
@@ -5051,7 +5051,7 @@ const Ui = Ue(
|
|
|
5051
5051
|
onClick: () => {
|
|
5052
5052
|
o(), u.current?.focus();
|
|
5053
5053
|
},
|
|
5054
|
-
className:
|
|
5054
|
+
className: k(
|
|
5055
5055
|
"absolute right-2.5 rounded-full",
|
|
5056
5056
|
c ? "text-red-9" : "text-base-11"
|
|
5057
5057
|
),
|
|
@@ -5071,12 +5071,12 @@ const Ui = Ue(
|
|
|
5071
5071
|
}) => {
|
|
5072
5072
|
const [a, s] = H(!1), i = fe(() => e.length > t, [e]), c = fe(() => i ? a ? e : e.slice(0, t).trim() + "..." : e, [e, a, i]);
|
|
5073
5073
|
return /* @__PURE__ */ y("div", { children: [
|
|
5074
|
-
/* @__PURE__ */ d("p", { className:
|
|
5074
|
+
/* @__PURE__ */ d("p", { className: k("text-base-12", r === "sm" && "text-sm", n), children: c }),
|
|
5075
5075
|
i ? /* @__PURE__ */ d(
|
|
5076
5076
|
"button",
|
|
5077
5077
|
{
|
|
5078
5078
|
onClick: () => s((l) => !l),
|
|
5079
|
-
className:
|
|
5079
|
+
className: k("text-xs text-base-11", o),
|
|
5080
5080
|
children: a ? "Ver menos" : "Ver más"
|
|
5081
5081
|
}
|
|
5082
5082
|
) : null
|
|
@@ -5172,9 +5172,9 @@ const Ui = Ue(
|
|
|
5172
5172
|
// from,
|
|
5173
5173
|
className: b
|
|
5174
5174
|
}) => {
|
|
5175
|
-
const [h,
|
|
5175
|
+
const [h, g] = H({ left: !1, right: !1 }), { ref: x } = Bn({
|
|
5176
5176
|
onOverflow: (T) => {
|
|
5177
|
-
|
|
5177
|
+
g({ left: T.canScrollLeft, right: T.canScrollRight });
|
|
5178
5178
|
},
|
|
5179
5179
|
// enabled: inView,
|
|
5180
5180
|
trackScroll: m
|
|
@@ -5182,7 +5182,7 @@ const Ui = Ue(
|
|
|
5182
5182
|
return /* @__PURE__ */ y(
|
|
5183
5183
|
"div",
|
|
5184
5184
|
{
|
|
5185
|
-
className:
|
|
5185
|
+
className: k(
|
|
5186
5186
|
"relative overflow-hidden",
|
|
5187
5187
|
we.widths[l].container,
|
|
5188
5188
|
we.rounded[f],
|
|
@@ -5192,8 +5192,8 @@ const Ui = Ue(
|
|
|
5192
5192
|
/* @__PURE__ */ d(
|
|
5193
5193
|
"div",
|
|
5194
5194
|
{
|
|
5195
|
-
ref:
|
|
5196
|
-
className:
|
|
5195
|
+
ref: x,
|
|
5196
|
+
className: k(
|
|
5197
5197
|
"flex items-center border overflow-x-scroll scrollbar-hide",
|
|
5198
5198
|
we.rounded[f],
|
|
5199
5199
|
we.border[u]
|
|
@@ -5204,7 +5204,7 @@ const Ui = Ue(
|
|
|
5204
5204
|
"button",
|
|
5205
5205
|
{
|
|
5206
5206
|
onClick: () => r?.(T),
|
|
5207
|
-
className:
|
|
5207
|
+
className: k(
|
|
5208
5208
|
"border-r px-3 py-1 last:border-none text-nowrap shrink-0",
|
|
5209
5209
|
we.widths[l].item,
|
|
5210
5210
|
!S && "lg:hover:bg-overlay-3",
|
|
@@ -5228,7 +5228,7 @@ const Ui = Ue(
|
|
|
5228
5228
|
animate: "animate",
|
|
5229
5229
|
exit: "exit",
|
|
5230
5230
|
onClick: () => {
|
|
5231
|
-
|
|
5231
|
+
x.current && xr({ el: x.current, direction: "left" });
|
|
5232
5232
|
},
|
|
5233
5233
|
className: "absolute shrink-0 left-0 px-1 h-full bg-gradient-to-r from-base-2 top-0",
|
|
5234
5234
|
children: /* @__PURE__ */ d(Cr, { className: "text-base-13" })
|
|
@@ -5243,7 +5243,7 @@ const Ui = Ue(
|
|
|
5243
5243
|
animate: "animate",
|
|
5244
5244
|
exit: "exit",
|
|
5245
5245
|
onClick: () => {
|
|
5246
|
-
|
|
5246
|
+
x.current && xr({ el: x.current, direction: "right" });
|
|
5247
5247
|
},
|
|
5248
5248
|
className: "absolute shrink-0 right-0 px-1 h-full bg-gradient-to-l from-base-2 top-0",
|
|
5249
5249
|
children: /* @__PURE__ */ d(Dr, { className: "text-base-13" })
|
|
@@ -5254,18 +5254,18 @@ const Ui = Ue(
|
|
|
5254
5254
|
]
|
|
5255
5255
|
}
|
|
5256
5256
|
);
|
|
5257
|
-
}, Ji = ({ className: e }) => /* @__PURE__ */ d("div", { className:
|
|
5257
|
+
}, Ji = ({ className: e }) => /* @__PURE__ */ d("div", { className: k("w-full h-px bg-base-4", e) }), Hs = ({
|
|
5258
5258
|
loading: e = !0,
|
|
5259
5259
|
wrapperClassName: t,
|
|
5260
5260
|
spinnerClassName: r
|
|
5261
|
-
}) => /* @__PURE__ */ d("div", { className:
|
|
5261
|
+
}) => /* @__PURE__ */ d("div", { className: k("flex justify-center", t), children: /* @__PURE__ */ d(
|
|
5262
5262
|
"svg",
|
|
5263
5263
|
{
|
|
5264
5264
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5265
5265
|
width: "20",
|
|
5266
5266
|
height: "20",
|
|
5267
5267
|
viewBox: "0 0 20 20",
|
|
5268
|
-
className:
|
|
5268
|
+
className: k({ "animate-spin": e }, r),
|
|
5269
5269
|
children: /* @__PURE__ */ d(
|
|
5270
5270
|
"path",
|
|
5271
5271
|
{
|
|
@@ -5306,7 +5306,7 @@ const Ui = Ue(
|
|
|
5306
5306
|
Z,
|
|
5307
5307
|
{
|
|
5308
5308
|
color: "brand",
|
|
5309
|
-
className:
|
|
5309
|
+
className: k(e && t ? "" : "col-span-2"),
|
|
5310
5310
|
state: r ? "loading" : n ? "disabled" : "enabled",
|
|
5311
5311
|
type: "submit",
|
|
5312
5312
|
children: [
|
|
@@ -5377,24 +5377,25 @@ const Ui = Ue(
|
|
|
5377
5377
|
}, tl = ({
|
|
5378
5378
|
id: e,
|
|
5379
5379
|
prevPath: t,
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5380
|
+
withDelay: r,
|
|
5381
|
+
title: n,
|
|
5382
|
+
description: o,
|
|
5383
|
+
showHeader: a = !0,
|
|
5384
|
+
mode: s,
|
|
5385
|
+
onReplace: i,
|
|
5386
|
+
className: c,
|
|
5387
|
+
contentClassName: l,
|
|
5388
|
+
children: u
|
|
5388
5389
|
// ...others
|
|
5389
5390
|
}) => {
|
|
5390
|
-
const
|
|
5391
|
+
const f = In(), m = yt(), b = $(null), h = Bs(), g = fe(() => s === "modal" || m, [s, m]);
|
|
5391
5392
|
return B(() => {
|
|
5392
|
-
|
|
5393
|
-
const
|
|
5394
|
-
if (!
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5393
|
+
h.add(e);
|
|
5394
|
+
const x = h.getPrevId();
|
|
5395
|
+
if (!x || (b.current = document.getElementById(x), !b.current)) return;
|
|
5396
|
+
x && h.animateParentModal(
|
|
5397
|
+
b.current,
|
|
5398
|
+
g ? "modal" : "sheet"
|
|
5398
5399
|
);
|
|
5399
5400
|
//! cleanups not running on new router system
|
|
5400
5401
|
//! IDK WHY
|
|
@@ -5402,21 +5403,29 @@ const Ui = Ue(
|
|
|
5402
5403
|
console.log("IS THIS CLEANUP RUNNING?");
|
|
5403
5404
|
};
|
|
5404
5405
|
//! NOT RUNNING...
|
|
5405
|
-
}, [
|
|
5406
|
+
}, [m]), Tr(() => () => h.remove(e), []), /* @__PURE__ */ y(Gt, { children: [
|
|
5406
5407
|
/* @__PURE__ */ d(
|
|
5407
5408
|
ke.div,
|
|
5408
5409
|
{
|
|
5409
5410
|
initial: { opacity: 0 },
|
|
5410
5411
|
animate: {
|
|
5411
|
-
opacity: 1
|
|
5412
|
+
opacity: 1,
|
|
5413
|
+
transition: {
|
|
5414
|
+
ease: [0.32, 0.72, 0, 1],
|
|
5415
|
+
duration: 0.3,
|
|
5416
|
+
delay: r ? 200 : void 0
|
|
5417
|
+
}
|
|
5412
5418
|
},
|
|
5413
|
-
exit: {
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5419
|
+
exit: {
|
|
5420
|
+
opacity: 0,
|
|
5421
|
+
transition: {
|
|
5422
|
+
ease: [0.32, 0.72, 0, 1],
|
|
5423
|
+
duration: 0.3,
|
|
5424
|
+
delay: r ? 200 : void 0
|
|
5425
|
+
}
|
|
5417
5426
|
},
|
|
5418
5427
|
onClick: () => {
|
|
5419
|
-
|
|
5428
|
+
f ? tt.back() : tt.replace(i ?? t);
|
|
5420
5429
|
},
|
|
5421
5430
|
className: "bg-black/40 absolute w-full h-full left-0 top-0 z-[500]"
|
|
5422
5431
|
}
|
|
@@ -5426,49 +5435,55 @@ const Ui = Ue(
|
|
|
5426
5435
|
{
|
|
5427
5436
|
id: e,
|
|
5428
5437
|
initial: {
|
|
5429
|
-
scale:
|
|
5430
|
-
y:
|
|
5438
|
+
scale: g ? 0.8 : void 0,
|
|
5439
|
+
y: g ? void 0 : window.innerHeight
|
|
5431
5440
|
},
|
|
5432
5441
|
animate: {
|
|
5433
5442
|
scale: 1,
|
|
5434
|
-
y:
|
|
5443
|
+
y: g ? void 0 : 0,
|
|
5444
|
+
transition: {
|
|
5445
|
+
ease: [0.32, 0.72, 0, 1],
|
|
5446
|
+
duration: 0.3,
|
|
5447
|
+
delay: r ? 200 : void 0
|
|
5448
|
+
}
|
|
5435
5449
|
},
|
|
5436
5450
|
exit: {
|
|
5437
|
-
scale:
|
|
5438
|
-
opacity:
|
|
5439
|
-
y:
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5451
|
+
scale: g ? 0.8 : void 0,
|
|
5452
|
+
opacity: g ? 0 : void 0,
|
|
5453
|
+
y: g ? void 0 : window.innerHeight,
|
|
5454
|
+
transition: {
|
|
5455
|
+
ease: [0.32, 0.72, 0, 1],
|
|
5456
|
+
duration: 0.3,
|
|
5457
|
+
delay: r ? 200 : void 0
|
|
5458
|
+
}
|
|
5444
5459
|
},
|
|
5445
5460
|
style: {
|
|
5446
5461
|
left: "50%",
|
|
5447
5462
|
translateX: "-50%",
|
|
5448
|
-
bottom:
|
|
5449
|
-
translateY:
|
|
5450
|
-
height:
|
|
5463
|
+
bottom: g ? "50%" : 0,
|
|
5464
|
+
translateY: g ? "50%" : 0,
|
|
5465
|
+
height: g ? "65%" : "95%"
|
|
5451
5466
|
},
|
|
5452
|
-
onAnimationStart: (
|
|
5453
|
-
(
|
|
5467
|
+
onAnimationStart: (x) => {
|
|
5468
|
+
(x?.scale === 0.8 || x?.y > 50) && b.current && h.restoreParentModal(b.current);
|
|
5454
5469
|
},
|
|
5455
|
-
className:
|
|
5470
|
+
className: k(
|
|
5456
5471
|
"bg-base-1 absolute w-full lg:max-w-[600px] h-full rounded-6 overflow-hidden z-[500] flex flex-col",
|
|
5457
|
-
!
|
|
5458
|
-
|
|
5472
|
+
!g && "rounded-b-none",
|
|
5473
|
+
c
|
|
5459
5474
|
),
|
|
5460
5475
|
children: [
|
|
5461
|
-
|
|
5476
|
+
a && /* @__PURE__ */ y("div", { className: "flex items-start justify-between p-4 border-b border-base-3", children: [
|
|
5462
5477
|
/* @__PURE__ */ y("div", { children: [
|
|
5463
|
-
|
|
5464
|
-
|
|
5478
|
+
n && /* @__PURE__ */ d("p", { className: "font-medium text-lg", children: n }),
|
|
5479
|
+
o && /* @__PURE__ */ d("p", { className: "text-base-11 text-xs", children: o })
|
|
5465
5480
|
] }),
|
|
5466
5481
|
/* @__PURE__ */ d(
|
|
5467
5482
|
Z,
|
|
5468
5483
|
{
|
|
5469
5484
|
size: "xs",
|
|
5470
5485
|
onClick: () => {
|
|
5471
|
-
|
|
5486
|
+
f ? tt.back() : tt.replace(i ?? t);
|
|
5472
5487
|
},
|
|
5473
5488
|
children: /* @__PURE__ */ d(gt, { size: 20 })
|
|
5474
5489
|
}
|
|
@@ -5478,8 +5493,8 @@ const Ui = Ue(
|
|
|
5478
5493
|
"div",
|
|
5479
5494
|
{
|
|
5480
5495
|
id: `${e}-content`,
|
|
5481
|
-
className:
|
|
5482
|
-
children:
|
|
5496
|
+
className: k("grow customscrollbar p-4 pb-6", l),
|
|
5497
|
+
children: u
|
|
5483
5498
|
}
|
|
5484
5499
|
)
|
|
5485
5500
|
]
|
|
@@ -5509,7 +5524,7 @@ function Vs({
|
|
|
5509
5524
|
onClick: () => {
|
|
5510
5525
|
r || t(!e);
|
|
5511
5526
|
},
|
|
5512
|
-
className:
|
|
5527
|
+
className: k(
|
|
5513
5528
|
`relative inline-flex h-[28px] w-[48px] items-center rounded-full
|
|
5514
5529
|
transition-colors duration-200 ease-in-out
|
|
5515
5530
|
focus-visible:outline-none focus-visible:ring-1
|
|
@@ -5522,7 +5537,7 @@ function Vs({
|
|
|
5522
5537
|
/* @__PURE__ */ d(
|
|
5523
5538
|
"span",
|
|
5524
5539
|
{
|
|
5525
|
-
className:
|
|
5540
|
+
className: k(
|
|
5526
5541
|
`inline-block h-6 w-6 transform rounded-full
|
|
5527
5542
|
transition-transform duration-200 ease-in-out
|
|
5528
5543
|
shadow`,
|
|
@@ -5561,7 +5576,7 @@ const qs = ({
|
|
|
5561
5576
|
maxTags: c,
|
|
5562
5577
|
validateTag: l
|
|
5563
5578
|
}) => {
|
|
5564
|
-
const [u, f] = H(""), [m, b] = H(!1), [h,
|
|
5579
|
+
const [u, f] = H(""), [m, b] = H(!1), [h, g] = H(null), x = $(null), T = $(null), S = $([]), _ = n.length > 0, P = $(
|
|
5565
5580
|
`taginput-${Math.random().toString(36).substr(2, 9)}`
|
|
5566
5581
|
).current, O = $(
|
|
5567
5582
|
`label-${Math.random().toString(36).substr(2, 9)}`
|
|
@@ -5571,29 +5586,29 @@ const qs = ({
|
|
|
5571
5586
|
B(() => {
|
|
5572
5587
|
S.current = S.current.slice(0, n.length);
|
|
5573
5588
|
}, [n.length]);
|
|
5574
|
-
const
|
|
5589
|
+
const N = (M) => {
|
|
5575
5590
|
if (M.key === "Enter" && u.trim()) {
|
|
5576
5591
|
M.preventDefault();
|
|
5577
5592
|
const A = u.trim();
|
|
5578
5593
|
if (c && n.length >= c) {
|
|
5579
|
-
|
|
5594
|
+
g(`Maximum of ${c} tags allowed`);
|
|
5580
5595
|
return;
|
|
5581
5596
|
}
|
|
5582
5597
|
if (n.includes(A)) {
|
|
5583
|
-
|
|
5598
|
+
g("Tag already exists");
|
|
5584
5599
|
return;
|
|
5585
5600
|
}
|
|
5586
5601
|
if (l) {
|
|
5587
5602
|
const j = l(A);
|
|
5588
5603
|
if (typeof j == "string") {
|
|
5589
|
-
|
|
5604
|
+
g(j);
|
|
5590
5605
|
return;
|
|
5591
5606
|
} else if (j === !1) {
|
|
5592
|
-
|
|
5607
|
+
g("Invalid tag");
|
|
5593
5608
|
return;
|
|
5594
5609
|
}
|
|
5595
5610
|
}
|
|
5596
|
-
o([...n, A]), f(""),
|
|
5611
|
+
o([...n, A]), f(""), g(null), D(`Added tag ${A}`);
|
|
5597
5612
|
} else if (M.key === "Backspace" && !u && n.length > 0) {
|
|
5598
5613
|
const A = n[n.length - 1];
|
|
5599
5614
|
o(n.slice(0, -1)), D(`Removed tag ${A}`);
|
|
@@ -5603,17 +5618,17 @@ const qs = ({
|
|
|
5603
5618
|
M.preventDefault();
|
|
5604
5619
|
const j = n[A], K = [...n];
|
|
5605
5620
|
K.splice(A, 1), o(K), setTimeout(() => {
|
|
5606
|
-
|
|
5621
|
+
x.current && x.current.focus();
|
|
5607
5622
|
}, 0), D(`Removed tag ${j}`);
|
|
5608
|
-
} else M.key === "ArrowRight" ? (M.preventDefault(), A < n.length - 1 ? S.current[A + 1]?.focus() :
|
|
5623
|
+
} else M.key === "ArrowRight" ? (M.preventDefault(), A < n.length - 1 ? S.current[A + 1]?.focus() : x.current?.focus()) : M.key === "ArrowLeft" && (M.preventDefault(), A > 0 && S.current[A - 1]?.focus());
|
|
5609
5624
|
}, R = (M, A) => {
|
|
5610
5625
|
o(n.filter((j) => j !== M)), setTimeout(() => {
|
|
5611
|
-
A < n.length - 1 ? S.current[A]?.focus() : A > 0 ? S.current[A - 1]?.focus() :
|
|
5626
|
+
A < n.length - 1 ? S.current[A]?.focus() : A > 0 ? S.current[A - 1]?.focus() : x.current?.focus();
|
|
5612
5627
|
}, 0), D(`Removed tag ${M}`);
|
|
5613
5628
|
}, E = (M) => {
|
|
5614
|
-
f(M.target.value),
|
|
5629
|
+
f(M.target.value), g(null);
|
|
5615
5630
|
}, p = () => {
|
|
5616
|
-
|
|
5631
|
+
x.current && x.current.focus();
|
|
5617
5632
|
}, D = (M) => {
|
|
5618
5633
|
console.log(`Accessibility announcement: ${M}`);
|
|
5619
5634
|
};
|
|
@@ -5624,7 +5639,7 @@ const qs = ({
|
|
|
5624
5639
|
{
|
|
5625
5640
|
id: O,
|
|
5626
5641
|
htmlFor: P,
|
|
5627
|
-
className:
|
|
5642
|
+
className: k("text-base top-4 font-semibold left-3", {
|
|
5628
5643
|
"text-sm top-2 left-2": m || _ || i,
|
|
5629
5644
|
"text-red-9": !!s
|
|
5630
5645
|
}),
|
|
@@ -5638,7 +5653,7 @@ const qs = ({
|
|
|
5638
5653
|
/* @__PURE__ */ y(
|
|
5639
5654
|
"div",
|
|
5640
5655
|
{
|
|
5641
|
-
className:
|
|
5656
|
+
className: k("rounded-6 px-2 transition cursor-text pr-10", {
|
|
5642
5657
|
"bg-base-3": r === "solid",
|
|
5643
5658
|
"border border-uielborder focus-visible:border-transparent": r === "outline",
|
|
5644
5659
|
"py-3": t === "default",
|
|
@@ -5657,7 +5672,7 @@ const qs = ({
|
|
|
5657
5672
|
{
|
|
5658
5673
|
id: O,
|
|
5659
5674
|
htmlFor: P,
|
|
5660
|
-
className:
|
|
5675
|
+
className: k(
|
|
5661
5676
|
"absolute transition-all duration-200 pointer-events-none",
|
|
5662
5677
|
"text-base top-4 font-semibold left-3",
|
|
5663
5678
|
{
|
|
@@ -5675,7 +5690,7 @@ const qs = ({
|
|
|
5675
5690
|
/* @__PURE__ */ y(
|
|
5676
5691
|
"div",
|
|
5677
5692
|
{
|
|
5678
|
-
className:
|
|
5693
|
+
className: k("flex flex-wrap gap-1 items-center", {
|
|
5679
5694
|
"mt-2.5": t === "floating"
|
|
5680
5695
|
}),
|
|
5681
5696
|
children: [
|
|
@@ -5685,7 +5700,7 @@ const qs = ({
|
|
|
5685
5700
|
ref: (j) => {
|
|
5686
5701
|
S.current[A] = j;
|
|
5687
5702
|
},
|
|
5688
|
-
className:
|
|
5703
|
+
className: k(
|
|
5689
5704
|
"line-clamp-1 text-brand rounded-full px-2 text-sm flex items-center",
|
|
5690
5705
|
{
|
|
5691
5706
|
"bg-brandfadedbg text-brand": !s && !h,
|
|
@@ -5716,12 +5731,12 @@ const qs = ({
|
|
|
5716
5731
|
"input",
|
|
5717
5732
|
{
|
|
5718
5733
|
id: P,
|
|
5719
|
-
ref:
|
|
5734
|
+
ref: x,
|
|
5720
5735
|
type: "text",
|
|
5721
5736
|
className: "flex-grow min-w-[60px] bg-transparent outline-none placeholder:text-sm placeholder:text-secondarytext",
|
|
5722
5737
|
value: u,
|
|
5723
5738
|
onChange: E,
|
|
5724
|
-
onKeyDown:
|
|
5739
|
+
onKeyDown: N,
|
|
5725
5740
|
onFocus: () => b(!0),
|
|
5726
5741
|
onBlur: () => b(!1),
|
|
5727
5742
|
enterKeyHint: "enter",
|
|
@@ -5792,7 +5807,7 @@ const qs = ({
|
|
|
5792
5807
|
t === "default" ? /* @__PURE__ */ d(
|
|
5793
5808
|
"label",
|
|
5794
5809
|
{
|
|
5795
|
-
className:
|
|
5810
|
+
className: k(
|
|
5796
5811
|
"top-[18px] font-medium ml-0.5 text-xs",
|
|
5797
5812
|
n && "text-red-9"
|
|
5798
5813
|
),
|
|
@@ -5802,14 +5817,14 @@ const qs = ({
|
|
|
5802
5817
|
/* @__PURE__ */ y(
|
|
5803
5818
|
"div",
|
|
5804
5819
|
{
|
|
5805
|
-
className:
|
|
5820
|
+
className: k(t === "default" ? "p-0" : "pt-5 pb-2", {
|
|
5806
5821
|
"bg-red-4 text-red-9": !!n
|
|
5807
5822
|
}),
|
|
5808
5823
|
children: [
|
|
5809
5824
|
t === "floating" && /* @__PURE__ */ d(
|
|
5810
5825
|
"label",
|
|
5811
5826
|
{
|
|
5812
|
-
className:
|
|
5827
|
+
className: k(
|
|
5813
5828
|
"absolute transition-all duration-200 pointer-events-none",
|
|
5814
5829
|
"text-sm top-2.5 font-semibold left-2.5",
|
|
5815
5830
|
{
|
|
@@ -5824,7 +5839,7 @@ const qs = ({
|
|
|
5824
5839
|
"textarea",
|
|
5825
5840
|
{
|
|
5826
5841
|
ref: l,
|
|
5827
|
-
className:
|
|
5842
|
+
className: k(
|
|
5828
5843
|
!n && u && Ks[o],
|
|
5829
5844
|
"bg-base-3 border border-base-4 light-theme:drop-shadow-sm rounded-6 w-full focus-visible:outline-none customscrollbarnohide",
|
|
5830
5845
|
"placeholder:text-base-11 text-sm",
|
|
@@ -6271,7 +6286,7 @@ const oi = [
|
|
|
6271
6286
|
"div",
|
|
6272
6287
|
{
|
|
6273
6288
|
ref: n,
|
|
6274
|
-
className:
|
|
6289
|
+
className: k("p-2 rounded-xl mt-2", {
|
|
6275
6290
|
"border border-uielborder": t,
|
|
6276
6291
|
"bg-uielbg border border-transparent": !t
|
|
6277
6292
|
}),
|
|
@@ -6373,7 +6388,7 @@ export {
|
|
|
6373
6388
|
Fi as TimePicker,
|
|
6374
6389
|
Kn as calculatePopoverPosition,
|
|
6375
6390
|
ct as checkOverflow,
|
|
6376
|
-
|
|
6391
|
+
k as cn,
|
|
6377
6392
|
yi as debounce,
|
|
6378
6393
|
Ni as extractDirtyData,
|
|
6379
6394
|
jn as generateInitials,
|