@mateosuarezdev/react-ui 1.0.42 → 1.0.43
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 +3 -3
- package/dist/index.d.ts +3 -1
- package/dist/index.js +558 -551
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* See LICENSE file for full terms.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { jsx as d, jsxs as
|
|
11
|
+
import { jsx as d, jsxs as y, Fragment as jt } from "react/jsx-runtime";
|
|
12
12
|
import Oe, { useRef as T, useEffect as B, useState as z, useSyncExternalStore as xn, useLayoutEffect as $r, useCallback as A, useId as Er, forwardRef as qe, useContext as bt, useMemo as de, memo as Nn, createContext as zt } from "react";
|
|
13
13
|
import { createPortal as Tr } from "react-dom";
|
|
14
14
|
import { clsx as kn } from "clsx";
|
|
@@ -20,7 +20,7 @@ import { appendErrors as Lr, FormProvider as Fn, useForm as Wn, useFormContext a
|
|
|
20
20
|
import { validateFieldsNatively as rr, toNestErrors as nr } from "@hookform/resolvers";
|
|
21
21
|
import { createGesture as Fr } from "@mateosuarezdev/gestures";
|
|
22
22
|
import { useInitialChangeEvent as An, navigate as et } from "@mateosuarezdev/react-router";
|
|
23
|
-
const
|
|
23
|
+
const N = (...e) => $n(kn(e));
|
|
24
24
|
function Ue(e, t = 100) {
|
|
25
25
|
let r = null, n = null;
|
|
26
26
|
return function(...o) {
|
|
@@ -184,12 +184,12 @@ const st = (e) => {
|
|
|
184
184
|
{
|
|
185
185
|
alt: "avatar",
|
|
186
186
|
src: e,
|
|
187
|
-
className:
|
|
187
|
+
className: N("rounded-full bg-base-3", Tt[r])
|
|
188
188
|
}
|
|
189
189
|
) : t ? /* @__PURE__ */ d(
|
|
190
190
|
"p",
|
|
191
191
|
{
|
|
192
|
-
className:
|
|
192
|
+
className: N(
|
|
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
|
Tt[r],
|
|
195
195
|
n
|
|
@@ -199,14 +199,14 @@ const st = (e) => {
|
|
|
199
199
|
) : /* @__PURE__ */ d(
|
|
200
200
|
"div",
|
|
201
201
|
{
|
|
202
|
-
className:
|
|
202
|
+
className: N(
|
|
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",
|
|
206
206
|
Tt[r],
|
|
207
207
|
n
|
|
208
208
|
),
|
|
209
|
-
children: /* @__PURE__ */
|
|
209
|
+
children: /* @__PURE__ */ y(
|
|
210
210
|
Ms,
|
|
211
211
|
{
|
|
212
212
|
size: r === "xs" ? 16 : r === "sm" ? 20 : 24,
|
|
@@ -232,7 +232,7 @@ function Ci({
|
|
|
232
232
|
return /* @__PURE__ */ d(
|
|
233
233
|
"div",
|
|
234
234
|
{
|
|
235
|
-
className:
|
|
235
|
+
className: N("flex -space-x-3 rtl:space-x-reverse", e),
|
|
236
236
|
...n,
|
|
237
237
|
children: t
|
|
238
238
|
}
|
|
@@ -307,7 +307,7 @@ const zn = (e = !0, t) => {
|
|
|
307
307
|
const [l, u] = z(!1), [f, m] = z({
|
|
308
308
|
width: 192,
|
|
309
309
|
height: 300
|
|
310
|
-
}), b = T(null), h = T(null),
|
|
310
|
+
}), b = T(null), h = T(null), g = T({
|
|
311
311
|
left: 0,
|
|
312
312
|
right: 0,
|
|
313
313
|
top: 0,
|
|
@@ -316,15 +316,15 @@ const zn = (e = !0, t) => {
|
|
|
316
316
|
y: 0,
|
|
317
317
|
width: 0,
|
|
318
318
|
height: 0
|
|
319
|
-
}),
|
|
320
|
-
(
|
|
321
|
-
const
|
|
322
|
-
if (!
|
|
323
|
-
const L = f.width,
|
|
319
|
+
}), v = T(null), E = Er(), S = A(
|
|
320
|
+
(x) => {
|
|
321
|
+
const k = x ?? g.current;
|
|
322
|
+
if (!k) return { x: 0, top: 0, bottom: void 0 };
|
|
323
|
+
const L = f.width, Y = f.height;
|
|
324
324
|
return Hn({
|
|
325
|
-
triggerRect:
|
|
325
|
+
triggerRect: k,
|
|
326
326
|
popoverWidth: L,
|
|
327
|
-
popoverHeight:
|
|
327
|
+
popoverHeight: Y,
|
|
328
328
|
align: t,
|
|
329
329
|
side: r,
|
|
330
330
|
offset: n,
|
|
@@ -332,39 +332,39 @@ const zn = (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 || (
|
|
339
|
-
l &&
|
|
340
|
-
const
|
|
341
|
-
|
|
338
|
+
if (!l || !e || (v.current = document.getElementById(e), !v.current)) return;
|
|
339
|
+
l && _();
|
|
340
|
+
const x = () => {
|
|
341
|
+
v.current && (u(!1), i?.(), v.current.removeEventListener("scroll", x));
|
|
342
342
|
};
|
|
343
|
-
return s &&
|
|
343
|
+
return s && v.current.addEventListener("scroll", x, {
|
|
344
344
|
passive: !0
|
|
345
345
|
}), () => {
|
|
346
|
-
|
|
346
|
+
v.current && v.current.removeEventListener("scroll", x);
|
|
347
347
|
};
|
|
348
348
|
}, [l, e]);
|
|
349
|
-
const
|
|
349
|
+
const _ = () => {
|
|
350
350
|
h.current && m({
|
|
351
351
|
width: h.current.offsetWidth,
|
|
352
352
|
height: h.current.offsetHeight
|
|
353
353
|
});
|
|
354
|
-
},
|
|
354
|
+
}, D = A(() => {
|
|
355
355
|
if (!b.current) return;
|
|
356
|
-
const
|
|
357
|
-
|
|
358
|
-
left:
|
|
359
|
-
right:
|
|
360
|
-
top:
|
|
361
|
-
bottom:
|
|
362
|
-
x:
|
|
363
|
-
y:
|
|
364
|
-
width:
|
|
365
|
-
height:
|
|
366
|
-
}, u((
|
|
367
|
-
}, []),
|
|
356
|
+
const x = b.current.getBoundingClientRect();
|
|
357
|
+
g.current = {
|
|
358
|
+
left: x.left,
|
|
359
|
+
right: x.right,
|
|
360
|
+
top: x.top,
|
|
361
|
+
bottom: x.bottom,
|
|
362
|
+
x: x.x,
|
|
363
|
+
y: x.y,
|
|
364
|
+
width: x.width,
|
|
365
|
+
height: x.height
|
|
366
|
+
}, u((k) => (k ? c?.() : i?.(), !k));
|
|
367
|
+
}, []), P = A(() => {
|
|
368
368
|
u(!1), c?.();
|
|
369
369
|
}, []);
|
|
370
370
|
return {
|
|
@@ -381,8 +381,8 @@ const zn = (e = !0, t) => {
|
|
|
381
381
|
*/
|
|
382
382
|
getPopoverPosition: S,
|
|
383
383
|
open: l,
|
|
384
|
-
toggle:
|
|
385
|
-
close:
|
|
384
|
+
toggle: D,
|
|
385
|
+
close: P
|
|
386
386
|
};
|
|
387
387
|
}, Hn = ({
|
|
388
388
|
triggerRect: e,
|
|
@@ -401,25 +401,25 @@ const zn = (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
|
+
), v = Math.max(0, s - h);
|
|
408
|
+
g <= v ? (l = b, g > 0 && (l = c.width - t - s)) : (l = h, v > 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), v = Math.max(
|
|
411
411
|
0,
|
|
412
412
|
h + t - (c.width - s)
|
|
413
413
|
);
|
|
414
|
-
|
|
414
|
+
g <= v ? (l = b, g > 0 && (l = s)) : (l = h, v > 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, v = 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 && (v >= 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 E = e.left + e.width / 2 - t / 2;
|
|
425
425
|
E >= s && E + t <= c.width - s ? l = E : E < s ? l = s : l = c.width - t - s;
|
|
@@ -427,11 +427,11 @@ const zn = (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, v = 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 && (v >= 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 E = e.left + e.width / 2 - t / 2;
|
|
437
437
|
E >= s && E + t <= c.width - s ? l = E : E < s ? l = s : l = c.width - t - s;
|
|
@@ -582,21 +582,21 @@ const Vn = "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 ? (
|
|
587
|
-
}, { ref: S, ripple:
|
|
585
|
+
const [g, v] = z(!1), E = (P) => {
|
|
586
|
+
o === "enabled" && (f ? (v(!0), a && a(P), setTimeout(() => v(!1), 1e3)) : a && a(P));
|
|
587
|
+
}, { ref: S, ripple: _ } = zn(
|
|
588
588
|
c,
|
|
589
589
|
e === "contrast" || l
|
|
590
|
-
),
|
|
590
|
+
), D = Ar(S, h);
|
|
591
591
|
return /* @__PURE__ */ d(
|
|
592
592
|
"button",
|
|
593
593
|
{
|
|
594
|
-
ref:
|
|
594
|
+
ref: D,
|
|
595
595
|
type: m,
|
|
596
596
|
disabled: b.disabled ? b.disabled : o === "disabled" || o === "loading",
|
|
597
|
-
onMouseDown:
|
|
598
|
-
onClick: (
|
|
599
|
-
className:
|
|
597
|
+
onMouseDown: _,
|
|
598
|
+
onClick: (P) => g ? null : E(P),
|
|
599
|
+
className: N(
|
|
600
600
|
Vn,
|
|
601
601
|
qn[t],
|
|
602
602
|
Kn[r],
|
|
@@ -2716,11 +2716,11 @@ function ls(e) {
|
|
|
2716
2716
|
r
|
|
2717
2717
|
]), fe(() => {
|
|
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 = (v) => v.stopPropagation();
|
|
2720
2720
|
for (; b && b !== s.current; )
|
|
2721
|
-
h.push(b), b.addEventListener(At,
|
|
2721
|
+
h.push(b), b.addEventListener(At, g), b = b.nextSibling;
|
|
2722
2722
|
return i.current = h, () => {
|
|
2723
|
-
for (let
|
|
2723
|
+
for (let v of h) v.removeEventListener(At, g);
|
|
2724
2724
|
};
|
|
2725
2725
|
}, [
|
|
2726
2726
|
t
|
|
@@ -2735,8 +2735,8 @@ function ls(e) {
|
|
|
2735
2735
|
i
|
|
2736
2736
|
]), fe(() => () => {
|
|
2737
2737
|
var m, b, h;
|
|
2738
|
-
let
|
|
2739
|
-
(i === H || dt(i, H)) && (!
|
|
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 === H || dt(i, H)) && (!g || q.getTreeNode(g)) && (H = g), q.removeTreeNode(i);
|
|
2740
2740
|
}, [
|
|
2741
2741
|
i
|
|
2742
2742
|
]);
|
|
@@ -3130,16 +3130,16 @@ const kt = ({ children: e, node: t }) => Tr(e, t ?? document.body), bs = ({
|
|
|
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: v,
|
|
3137
3137
|
triggerProps: E,
|
|
3138
3138
|
popoverRef: S,
|
|
3139
|
-
getPopoverPosition:
|
|
3140
|
-
open:
|
|
3141
|
-
toggle:
|
|
3142
|
-
close:
|
|
3139
|
+
getPopoverPosition: _,
|
|
3140
|
+
open: D,
|
|
3141
|
+
toggle: P,
|
|
3142
|
+
close: x
|
|
3143
3143
|
} = Ht({
|
|
3144
3144
|
align: n,
|
|
3145
3145
|
side: o,
|
|
@@ -3155,28 +3155,28 @@ const kt = ({ children: e, node: t }) => Tr(e, t ?? document.body), bs = ({
|
|
|
3155
3155
|
Bn(
|
|
3156
3156
|
{
|
|
3157
3157
|
Escape: (L) => {
|
|
3158
|
-
c && (L.preventDefault(),
|
|
3158
|
+
c && (L.preventDefault(), x(), v.current?.focus());
|
|
3159
3159
|
}
|
|
3160
3160
|
},
|
|
3161
|
-
{ enabled:
|
|
3161
|
+
{ enabled: D }
|
|
3162
3162
|
), Bt(S, (L) => {
|
|
3163
|
-
!l || !
|
|
3163
|
+
!l || !v.current || !D || !L.target || v.current.contains(L.target) || x();
|
|
3164
3164
|
});
|
|
3165
|
-
const
|
|
3166
|
-
return /* @__PURE__ */
|
|
3165
|
+
const k = _();
|
|
3166
|
+
return /* @__PURE__ */ y(jt, { children: [
|
|
3167
3167
|
t ? t({
|
|
3168
|
-
triggerRef:
|
|
3168
|
+
triggerRef: v,
|
|
3169
3169
|
triggerProps: E,
|
|
3170
|
-
toggle:
|
|
3171
|
-
open:
|
|
3172
|
-
close:
|
|
3170
|
+
toggle: P,
|
|
3171
|
+
open: D,
|
|
3172
|
+
close: x
|
|
3173
3173
|
}) : /* @__PURE__ */ d(
|
|
3174
3174
|
"button",
|
|
3175
3175
|
{
|
|
3176
|
-
ref:
|
|
3176
|
+
ref: v,
|
|
3177
3177
|
...E,
|
|
3178
|
-
onClick:
|
|
3179
|
-
className:
|
|
3178
|
+
onClick: P,
|
|
3179
|
+
className: N(
|
|
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
|
|
@@ -3184,7 +3184,7 @@ const kt = ({ children: e, node: t }) => Tr(e, t ?? document.body), bs = ({
|
|
|
3184
3184
|
children: r
|
|
3185
3185
|
}
|
|
3186
3186
|
),
|
|
3187
|
-
/* @__PURE__ */ d(gt, { children:
|
|
3187
|
+
/* @__PURE__ */ d(gt, { children: D && /* @__PURE__ */ d(kt, { children: /* @__PURE__ */ d(ls, { contain: !0, restoreFocus: !0, autoFocus: !0, children: /* @__PURE__ */ d(
|
|
3188
3188
|
be.div,
|
|
3189
3189
|
{
|
|
3190
3190
|
initial: {
|
|
@@ -3206,21 +3206,21 @@ const kt = ({ children: e, node: t }) => Tr(e, t ?? document.body), bs = ({
|
|
|
3206
3206
|
ref: S,
|
|
3207
3207
|
style: {
|
|
3208
3208
|
position: "fixed",
|
|
3209
|
-
left:
|
|
3210
|
-
top:
|
|
3211
|
-
bottom:
|
|
3209
|
+
left: k.x,
|
|
3210
|
+
top: k.top,
|
|
3211
|
+
bottom: k.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: N(
|
|
3218
3218
|
"bg-base-1 dark-theme:bg-base-2",
|
|
3219
3219
|
"border border-base-4 rounded-6",
|
|
3220
3220
|
"customscrollbar overflow-auto",
|
|
3221
3221
|
s
|
|
3222
3222
|
),
|
|
3223
|
-
children: typeof e == "function" ? e(
|
|
3223
|
+
children: typeof e == "function" ? e(P) : e
|
|
3224
3224
|
}
|
|
3225
3225
|
) }) }) })
|
|
3226
3226
|
] });
|
|
@@ -3229,8 +3229,8 @@ const kt = ({ children: e, node: t }) => Tr(e, t ?? document.body), bs = ({
|
|
|
3229
3229
|
subtitle: t,
|
|
3230
3230
|
onClose: r,
|
|
3231
3231
|
className: n
|
|
3232
|
-
}) => /* @__PURE__ */ d("div", { className:
|
|
3233
|
-
/* @__PURE__ */
|
|
3232
|
+
}) => /* @__PURE__ */ d("div", { className: N("p-4 border-b border-base-4", n), children: /* @__PURE__ */ y("div", { className: "flex items-start justify-between", children: [
|
|
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 })
|
|
3236
3236
|
] }),
|
|
@@ -3245,10 +3245,10 @@ const kt = ({ children: e, node: t }) => Tr(e, t ?? document.body), bs = ({
|
|
|
3245
3245
|
] }) }), Oi = ({
|
|
3246
3246
|
children: e,
|
|
3247
3247
|
className: t
|
|
3248
|
-
}) => /* @__PURE__ */ d("div", { className:
|
|
3248
|
+
}) => /* @__PURE__ */ d("div", { className: N("p-4", t), children: e }), Li = ({
|
|
3249
3249
|
children: e,
|
|
3250
3250
|
className: t
|
|
3251
|
-
}) => /* @__PURE__ */ d("div", { className:
|
|
3251
|
+
}) => /* @__PURE__ */ d("div", { className: N("p-4 border-t border-base-4", t), children: e }), ps = (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);
|
|
@@ -3273,52 +3273,52 @@ const kt = ({ children: e, node: t }) => Tr(e, t ?? document.body), bs = ({
|
|
|
3273
3273
|
const [l, u] = z(e || /* @__PURE__ */ new Date()), [f, m] = z(
|
|
3274
3274
|
e || /* @__PURE__ */ new Date()
|
|
3275
3275
|
), b = T(null), h = de(() => r ? new Set(
|
|
3276
|
-
r.map((
|
|
3277
|
-
) : /* @__PURE__ */ new Set(), [r]),
|
|
3278
|
-
const
|
|
3276
|
+
r.map((x) => new Date(x).toDateString())
|
|
3277
|
+
) : /* @__PURE__ */ new Set(), [r]), g = de(() => new Set(n || []), [n]), v = de(() => {
|
|
3278
|
+
const x = io(l), k = oo(l), L = new Date(x), Y = new Date(k);
|
|
3279
3279
|
if (i) {
|
|
3280
|
-
const $ =
|
|
3281
|
-
L.setDate(
|
|
3282
|
-
const
|
|
3283
|
-
|
|
3280
|
+
const $ = x.getDay(), p = $ === 0 ? 6 : $ - 1;
|
|
3281
|
+
L.setDate(x.getDate() - p);
|
|
3282
|
+
const M = k.getDay(), C = M === 0 ? 0 : 7 - M;
|
|
3283
|
+
Y.setDate(k.getDate() + C);
|
|
3284
3284
|
} else
|
|
3285
|
-
L.setDate(
|
|
3286
|
-
return so({ start: L, end:
|
|
3285
|
+
L.setDate(x.getDate() - x.getDay()), Y.setDate(k.getDate() + (6 - k.getDay()));
|
|
3286
|
+
return so({ start: L, end: Y });
|
|
3287
3287
|
}, [l, i]), E = de(
|
|
3288
3288
|
() => ps(s ?? He, i),
|
|
3289
3289
|
[s, i]
|
|
3290
|
-
), S = (
|
|
3291
|
-
const
|
|
3292
|
-
return !(h.has(
|
|
3293
|
-
},
|
|
3294
|
-
S(
|
|
3295
|
-
},
|
|
3290
|
+
), S = (x) => {
|
|
3291
|
+
const k = x.toDateString(), L = x.getDay();
|
|
3292
|
+
return !(h.has(k) || g.has(L) || o && x < o || a && x > a);
|
|
3293
|
+
}, _ = (x) => {
|
|
3294
|
+
S(x) && t && t(x), m(x);
|
|
3295
|
+
}, D = (x) => {
|
|
3296
3296
|
if (!f) return;
|
|
3297
|
-
let
|
|
3298
|
-
switch (
|
|
3297
|
+
let k = new Date(f), L = !0, Y, $;
|
|
3298
|
+
switch (x.key) {
|
|
3299
3299
|
case "ArrowUp":
|
|
3300
|
-
|
|
3300
|
+
k.setDate(k.getDate() - 7);
|
|
3301
3301
|
break;
|
|
3302
3302
|
case "ArrowDown":
|
|
3303
|
-
|
|
3303
|
+
k.setDate(k.getDate() + 7);
|
|
3304
3304
|
break;
|
|
3305
3305
|
case "ArrowLeft":
|
|
3306
|
-
|
|
3306
|
+
k.setDate(k.getDate() - 1);
|
|
3307
3307
|
break;
|
|
3308
3308
|
case "ArrowRight":
|
|
3309
|
-
|
|
3309
|
+
k.setDate(k.getDate() + 1);
|
|
3310
3310
|
break;
|
|
3311
3311
|
case "Home":
|
|
3312
|
-
|
|
3312
|
+
Y = k.getDay(), k.setDate(k.getDate() - Y);
|
|
3313
3313
|
break;
|
|
3314
3314
|
case "End":
|
|
3315
|
-
$ =
|
|
3315
|
+
$ = k.getDay(), k.setDate(k.getDate() + (6 - $));
|
|
3316
3316
|
break;
|
|
3317
3317
|
case "PageUp":
|
|
3318
|
-
|
|
3318
|
+
k = x.shiftKey ? Mt(k, 12) : Mt(k, 1);
|
|
3319
3319
|
break;
|
|
3320
3320
|
case "PageDown":
|
|
3321
|
-
|
|
3321
|
+
k = x.shiftKey ? ot(k, 12) : ot(k, 1);
|
|
3322
3322
|
break;
|
|
3323
3323
|
case "Enter":
|
|
3324
3324
|
case " ":
|
|
@@ -3327,30 +3327,30 @@ const kt = ({ children: e, node: t }) => Tr(e, t ?? document.body), bs = ({
|
|
|
3327
3327
|
default:
|
|
3328
3328
|
L = !1;
|
|
3329
3329
|
}
|
|
3330
|
-
L && (
|
|
3331
|
-
},
|
|
3330
|
+
L && (x.preventDefault(), k.getTime() !== f.getTime() && (m(k), dr(k, l) || u(k)));
|
|
3331
|
+
}, P = (x) => {
|
|
3332
3332
|
u(
|
|
3333
|
-
(
|
|
3333
|
+
(k) => x === "prev" ? Mt(k, 1) : ot(k, 1)
|
|
3334
3334
|
);
|
|
3335
3335
|
};
|
|
3336
|
-
return /* @__PURE__ */
|
|
3336
|
+
return /* @__PURE__ */ y(
|
|
3337
3337
|
"div",
|
|
3338
3338
|
{
|
|
3339
3339
|
ref: b,
|
|
3340
|
-
className:
|
|
3340
|
+
className: N(
|
|
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
|
),
|
|
3344
|
-
onKeyDown:
|
|
3344
|
+
onKeyDown: D,
|
|
3345
3345
|
tabIndex: 0,
|
|
3346
3346
|
role: "grid",
|
|
3347
3347
|
"aria-label": "Calendar",
|
|
3348
3348
|
children: [
|
|
3349
|
-
/* @__PURE__ */
|
|
3349
|
+
/* @__PURE__ */ y("div", { className: "flex items-center justify-between", children: [
|
|
3350
3350
|
/* @__PURE__ */ d(
|
|
3351
3351
|
J,
|
|
3352
3352
|
{
|
|
3353
|
-
onClick: () =>
|
|
3353
|
+
onClick: () => P("prev"),
|
|
3354
3354
|
size: "iconSm",
|
|
3355
3355
|
"aria-label": "Previous month",
|
|
3356
3356
|
children: /* @__PURE__ */ d(Sr, { size: 16 })
|
|
@@ -3360,48 +3360,48 @@ const kt = ({ children: e, node: t }) => Tr(e, t ?? document.body), bs = ({
|
|
|
3360
3360
|
/* @__PURE__ */ d(
|
|
3361
3361
|
J,
|
|
3362
3362
|
{
|
|
3363
|
-
onClick: () =>
|
|
3363
|
+
onClick: () => P("next"),
|
|
3364
3364
|
size: "iconSm",
|
|
3365
3365
|
"aria-label": "Next month",
|
|
3366
3366
|
children: /* @__PURE__ */ d(Cr, { size: 16 })
|
|
3367
3367
|
}
|
|
3368
3368
|
)
|
|
3369
3369
|
] }),
|
|
3370
|
-
/* @__PURE__ */ d("div", { className: "grid grid-cols-7 gap-1 mt-4", role: "row", children: E.map((
|
|
3370
|
+
/* @__PURE__ */ d("div", { className: "grid grid-cols-7 gap-1 mt-4", role: "row", children: E.map((x) => /* @__PURE__ */ d(
|
|
3371
3371
|
"div",
|
|
3372
3372
|
{
|
|
3373
3373
|
className: "text-xs flex items-center w-8 justify-center text-base-11",
|
|
3374
3374
|
role: "columnheader",
|
|
3375
|
-
children:
|
|
3375
|
+
children: x
|
|
3376
3376
|
},
|
|
3377
|
-
|
|
3377
|
+
x
|
|
3378
3378
|
)) }),
|
|
3379
|
-
/* @__PURE__ */ d("div", { className: "grid grid-cols-7 gap-1 mt-4", role: "grid", children:
|
|
3380
|
-
const L = dr(
|
|
3379
|
+
/* @__PURE__ */ d("div", { className: "grid grid-cols-7 gap-1 mt-4", role: "grid", children: v.map((x, k) => {
|
|
3380
|
+
const L = dr(x, l), Y = e ? Ct(x, e) : !1, $ = f && Ct(x, f), p = S(x), M = Ct(x, /* @__PURE__ */ new Date());
|
|
3381
3381
|
return /* @__PURE__ */ d(
|
|
3382
3382
|
"button",
|
|
3383
3383
|
{
|
|
3384
|
-
onClick: () =>
|
|
3384
|
+
onClick: () => _(x),
|
|
3385
3385
|
disabled: !p,
|
|
3386
3386
|
tabIndex: $ ? 0 : -1,
|
|
3387
3387
|
role: "gridcell",
|
|
3388
|
-
"aria-label": `${
|
|
3388
|
+
"aria-label": `${x.toLocaleDateString("en-US", {
|
|
3389
3389
|
weekday: "long",
|
|
3390
3390
|
month: "long",
|
|
3391
3391
|
day: "numeric",
|
|
3392
3392
|
year: "numeric"
|
|
3393
|
-
})}${
|
|
3394
|
-
"aria-selected":
|
|
3393
|
+
})}${Y ? ", selected" : ""}${p ? "" : ", disabled"}`,
|
|
3394
|
+
"aria-selected": Y,
|
|
3395
3395
|
"aria-disabled": !p,
|
|
3396
|
-
className:
|
|
3396
|
+
className: N(
|
|
3397
3397
|
"h-8 w-8 flex items-center outline-none justify-center rounded-6 hover:bg-base-4 text-sm relative",
|
|
3398
|
-
L ?
|
|
3398
|
+
L ? Y ? "bg-brand text-brand-text hover:bg-brand" : M ? "text-base-12 ring-1 ring-base-8" : "text-base-12" : "text-base-9",
|
|
3399
3399
|
$ && "ring-1 ring-base-6",
|
|
3400
3400
|
(!p || !L) && "pointer-events-none text-base-9"
|
|
3401
3401
|
),
|
|
3402
|
-
children: Ee(
|
|
3402
|
+
children: Ee(x, "d")
|
|
3403
3403
|
},
|
|
3404
|
-
|
|
3404
|
+
k
|
|
3405
3405
|
);
|
|
3406
3406
|
}) })
|
|
3407
3407
|
]
|
|
@@ -3411,7 +3411,7 @@ const kt = ({ children: e, node: t }) => Tr(e, t ?? document.body), bs = ({
|
|
|
3411
3411
|
const [e, t] = z(
|
|
3412
3412
|
new Date(2025, 8, 21)
|
|
3413
3413
|
);
|
|
3414
|
-
return /* @__PURE__ */ d("div", { className: "p-8 bg-gray-100 min-h-screen", children: /* @__PURE__ */
|
|
3414
|
+
return /* @__PURE__ */ d("div", { className: "p-8 bg-gray-100 min-h-screen", children: /* @__PURE__ */ y("div", { className: "max-w-md mx-auto", children: [
|
|
3415
3415
|
/* @__PURE__ */ d("h1", { className: "text-2xl font-bold mb-6 text-gray-800", children: "Calendar Date Picker Demo" }),
|
|
3416
3416
|
/* @__PURE__ */ d("div", { className: "mb-6", children: /* @__PURE__ */ d(
|
|
3417
3417
|
Zr,
|
|
@@ -3429,7 +3429,7 @@ const kt = ({ children: e, node: t }) => Tr(e, t ?? document.body), bs = ({
|
|
|
3429
3429
|
maxDate: new Date(2025, 11, 31)
|
|
3430
3430
|
}
|
|
3431
3431
|
) }),
|
|
3432
|
-
e && /* @__PURE__ */
|
|
3432
|
+
e && /* @__PURE__ */ y("div", { className: "bg-white p-4 rounded-lg shadow", children: [
|
|
3433
3433
|
/* @__PURE__ */ d("h3", { className: "font-semibold text-gray-800 mb-2", children: "Selected Date:" }),
|
|
3434
3434
|
/* @__PURE__ */ d("p", { className: "text-gray-600", children: e.toLocaleDateString("en-US", {
|
|
3435
3435
|
weekday: "long",
|
|
@@ -3437,39 +3437,39 @@ const kt = ({ children: e, node: t }) => Tr(e, t ?? document.body), bs = ({
|
|
|
3437
3437
|
month: "long",
|
|
3438
3438
|
day: "numeric"
|
|
3439
3439
|
}) }),
|
|
3440
|
-
/* @__PURE__ */
|
|
3440
|
+
/* @__PURE__ */ y("p", { className: "text-sm text-gray-500 mt-1", children: [
|
|
3441
3441
|
"ISO: ",
|
|
3442
3442
|
e.toISOString()
|
|
3443
3443
|
] })
|
|
3444
3444
|
] }),
|
|
3445
|
-
/* @__PURE__ */
|
|
3445
|
+
/* @__PURE__ */ y("div", { className: "mt-6 bg-white p-4 rounded-lg shadow", children: [
|
|
3446
3446
|
/* @__PURE__ */ d("h3", { className: "font-semibold text-gray-800 mb-2", children: "Keyboard Navigation:" }),
|
|
3447
|
-
/* @__PURE__ */
|
|
3448
|
-
/* @__PURE__ */
|
|
3447
|
+
/* @__PURE__ */ y("div", { className: "text-sm text-gray-600 space-y-1", children: [
|
|
3448
|
+
/* @__PURE__ */ y("p", { children: [
|
|
3449
3449
|
/* @__PURE__ */ d("strong", { children: "Arrow Keys:" }),
|
|
3450
3450
|
" Navigate between dates"
|
|
3451
3451
|
] }),
|
|
3452
|
-
/* @__PURE__ */
|
|
3452
|
+
/* @__PURE__ */ y("p", { children: [
|
|
3453
3453
|
/* @__PURE__ */ d("strong", { children: "Enter/Space:" }),
|
|
3454
3454
|
" Select focused date"
|
|
3455
3455
|
] }),
|
|
3456
|
-
/* @__PURE__ */
|
|
3456
|
+
/* @__PURE__ */ y("p", { children: [
|
|
3457
3457
|
/* @__PURE__ */ d("strong", { children: "Home/End:" }),
|
|
3458
3458
|
" Go to start/end of week"
|
|
3459
3459
|
] }),
|
|
3460
|
-
/* @__PURE__ */
|
|
3460
|
+
/* @__PURE__ */ y("p", { children: [
|
|
3461
3461
|
/* @__PURE__ */ d("strong", { children: "Page Up/Down:" }),
|
|
3462
3462
|
" Previous/next month"
|
|
3463
3463
|
] }),
|
|
3464
|
-
/* @__PURE__ */
|
|
3464
|
+
/* @__PURE__ */ y("p", { children: [
|
|
3465
3465
|
/* @__PURE__ */ d("strong", { children: "Shift + Page Up/Down:" }),
|
|
3466
3466
|
" Previous/next year"
|
|
3467
3467
|
] })
|
|
3468
3468
|
] })
|
|
3469
3469
|
] }),
|
|
3470
|
-
/* @__PURE__ */
|
|
3470
|
+
/* @__PURE__ */ y("div", { className: "mt-4 bg-white p-4 rounded-lg shadow", children: [
|
|
3471
3471
|
/* @__PURE__ */ d("h3", { className: "font-semibold text-gray-800 mb-2", children: "Features:" }),
|
|
3472
|
-
/* @__PURE__ */
|
|
3472
|
+
/* @__PURE__ */ y("ul", { className: "text-sm text-gray-600 space-y-1", children: [
|
|
3473
3473
|
/* @__PURE__ */ d("li", { children: "✅ All dates enabled by default" }),
|
|
3474
3474
|
/* @__PURE__ */ d("li", { children: "✅ Disable specific dates (PostgreSQL ISO strings)" }),
|
|
3475
3475
|
/* @__PURE__ */ d("li", { children: "✅ Disable entire days of week (e.g., weekends)" }),
|
|
@@ -3490,7 +3490,7 @@ function Wi({
|
|
|
3490
3490
|
{
|
|
3491
3491
|
className: "p-0",
|
|
3492
3492
|
scrollerId: t,
|
|
3493
|
-
customTrigger: ({ toggle: o, triggerRef: a }) => e ? e(o, a) : /* @__PURE__ */
|
|
3493
|
+
customTrigger: ({ toggle: o, triggerRef: a }) => e ? e(o, a) : /* @__PURE__ */ y(
|
|
3494
3494
|
J,
|
|
3495
3495
|
{
|
|
3496
3496
|
ref: a,
|
|
@@ -3518,25 +3518,25 @@ function Wi({
|
|
|
3518
3518
|
}
|
|
3519
3519
|
);
|
|
3520
3520
|
}
|
|
3521
|
-
const Ai = () => /* @__PURE__ */
|
|
3521
|
+
const Ai = () => /* @__PURE__ */ y("div", { children: [
|
|
3522
3522
|
/* @__PURE__ */ d("p", { className: "text-xs font-medium ml-0.5", children: "Start Time" }),
|
|
3523
|
-
/* @__PURE__ */
|
|
3523
|
+
/* @__PURE__ */ y(J, { color: "solid", className: "px-3 mt-1", children: [
|
|
3524
3524
|
Ee(/* @__PURE__ */ new Date(), "p", { locale: He }),
|
|
3525
3525
|
/* @__PURE__ */ d("span", { className: "grow" }),
|
|
3526
3526
|
/* @__PURE__ */ d(Dr, { size: 18, className: "text-base-11" })
|
|
3527
3527
|
] })
|
|
3528
|
-
] }), _i = () => /* @__PURE__ */
|
|
3529
|
-
/* @__PURE__ */
|
|
3528
|
+
] }), _i = () => /* @__PURE__ */ y("div", { className: "flex items-center gap-x-4", children: [
|
|
3529
|
+
/* @__PURE__ */ y("div", { className: "grow", children: [
|
|
3530
3530
|
/* @__PURE__ */ d("p", { className: "text-xs font-medium ml-0.5", children: "Start Date" }),
|
|
3531
|
-
/* @__PURE__ */
|
|
3531
|
+
/* @__PURE__ */ y(J, { color: "solid", className: "px-3 mt-1 w-full justify-start", children: [
|
|
3532
3532
|
Ee(/* @__PURE__ */ new Date(), "PP", { locale: He }),
|
|
3533
3533
|
/* @__PURE__ */ d("span", { className: "grow" }),
|
|
3534
3534
|
/* @__PURE__ */ d(Mr, { size: 18, className: "text-base-11" })
|
|
3535
3535
|
] })
|
|
3536
3536
|
] }),
|
|
3537
|
-
/* @__PURE__ */
|
|
3537
|
+
/* @__PURE__ */ y("div", { children: [
|
|
3538
3538
|
/* @__PURE__ */ d("p", { className: "text-xs font-medium ml-0.5", children: "Start Time" }),
|
|
3539
|
-
/* @__PURE__ */
|
|
3539
|
+
/* @__PURE__ */ y(J, { color: "solid", className: "px-3 mt-1", children: [
|
|
3540
3540
|
Ee(/* @__PURE__ */ new Date(), "p", { locale: He }),
|
|
3541
3541
|
/* @__PURE__ */ d("span", { className: "grow" }),
|
|
3542
3542
|
/* @__PURE__ */ d(Dr, { size: 18, className: "text-base-11" })
|
|
@@ -3562,8 +3562,8 @@ const Ai = () => /* @__PURE__ */ x("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",
|
|
@@ -3575,8 +3575,8 @@ const Ai = () => /* @__PURE__ */ x("div", { children: [
|
|
|
3575
3575
|
md: 14,
|
|
3576
3576
|
lg: 16
|
|
3577
3577
|
};
|
|
3578
|
-
return /* @__PURE__ */
|
|
3579
|
-
/* @__PURE__ */
|
|
3578
|
+
return /* @__PURE__ */ y(jt, { children: [
|
|
3579
|
+
/* @__PURE__ */ y(
|
|
3580
3580
|
"button",
|
|
3581
3581
|
{
|
|
3582
3582
|
ref: u,
|
|
@@ -3587,7 +3587,7 @@ const Ai = () => /* @__PURE__ */ x("div", { children: [
|
|
|
3587
3587
|
disabled: r,
|
|
3588
3588
|
onClick: f,
|
|
3589
3589
|
onKeyDown: m,
|
|
3590
|
-
className:
|
|
3590
|
+
className: N(
|
|
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 Ri({
|
|
|
3832
3832
|
return /* @__PURE__ */ d(Fn, { ...e, children: /* @__PURE__ */ d(
|
|
3833
3833
|
"form",
|
|
3834
3834
|
{
|
|
3835
|
-
className:
|
|
3835
|
+
className: N(
|
|
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,35 +3893,35 @@ const Ms = ({
|
|
|
3893
3893
|
containerClassName: m,
|
|
3894
3894
|
className: b,
|
|
3895
3895
|
type: h = "text",
|
|
3896
|
-
value:
|
|
3897
|
-
...
|
|
3896
|
+
value: g,
|
|
3897
|
+
...v
|
|
3898
3898
|
}, E) => {
|
|
3899
|
-
const S = T(null),
|
|
3899
|
+
const S = T(null), _ = T(!1), [D, P] = z(!1), [x, k] = z(!1), L = h === "password", Y = L && D ? "text" : l ? "number" : h, $ = g !== "" && g !== null && g !== void 0;
|
|
3900
3900
|
return B(() => {
|
|
3901
|
-
if (!
|
|
3902
|
-
|
|
3901
|
+
if (!_.current) {
|
|
3902
|
+
_.current = !0;
|
|
3903
3903
|
return;
|
|
3904
3904
|
}
|
|
3905
3905
|
S.current && Yn(S.current);
|
|
3906
|
-
}, [
|
|
3906
|
+
}, [D, S]), /* @__PURE__ */ y("div", { className: N("relative", f), children: [
|
|
3907
3907
|
e && r === "default" && /* @__PURE__ */ d(
|
|
3908
3908
|
"label",
|
|
3909
3909
|
{
|
|
3910
|
-
className:
|
|
3910
|
+
className: N("font-medium ml-0.5 text-xs", i && "text-red-9"),
|
|
3911
3911
|
children: e
|
|
3912
3912
|
}
|
|
3913
3913
|
),
|
|
3914
|
-
/* @__PURE__ */
|
|
3914
|
+
/* @__PURE__ */ y(
|
|
3915
3915
|
"div",
|
|
3916
3916
|
{
|
|
3917
|
-
className:
|
|
3917
|
+
className: N(
|
|
3918
3918
|
"rounded-6 transition cursor-text relative",
|
|
3919
3919
|
Ds[n],
|
|
3920
3920
|
{
|
|
3921
3921
|
"pt-[22px] pb-1.5": r === "floating",
|
|
3922
|
-
[Ps[o]]: !i &&
|
|
3922
|
+
[Ps[o]]: !i && x,
|
|
3923
3923
|
"bg-red-4 text-red-9": !!i,
|
|
3924
|
-
"ring-1 ring-red-9": !!i &&
|
|
3924
|
+
"ring-1 ring-red-9": !!i && x
|
|
3925
3925
|
},
|
|
3926
3926
|
m
|
|
3927
3927
|
),
|
|
@@ -3929,11 +3929,11 @@ const Ms = ({
|
|
|
3929
3929
|
e && r === "floating" && /* @__PURE__ */ d(
|
|
3930
3930
|
"label",
|
|
3931
3931
|
{
|
|
3932
|
-
className:
|
|
3932
|
+
className: N(
|
|
3933
3933
|
"absolute transition-all duration-200 pointer-events-none",
|
|
3934
3934
|
"text-sm top-[18px] font-semibold left-3",
|
|
3935
3935
|
{
|
|
3936
|
-
"text-xs top-2.5":
|
|
3936
|
+
"text-xs top-2.5": x || $ || a,
|
|
3937
3937
|
"text-red-9": !!i
|
|
3938
3938
|
}
|
|
3939
3939
|
),
|
|
@@ -3944,7 +3944,7 @@ const Ms = ({
|
|
|
3944
3944
|
Sn,
|
|
3945
3945
|
{
|
|
3946
3946
|
size: 16,
|
|
3947
|
-
className:
|
|
3947
|
+
className: N(
|
|
3948
3948
|
"absolute top-1/2 -translate-y-1/2 left-3",
|
|
3949
3949
|
i ? "text-red-9" : "text-base-11"
|
|
3950
3950
|
)
|
|
@@ -3957,8 +3957,8 @@ const Ms = ({
|
|
|
3957
3957
|
ref: (p) => {
|
|
3958
3958
|
E && (typeof E == "function" ? E(p) : E.current = p), S.current = p;
|
|
3959
3959
|
},
|
|
3960
|
-
type:
|
|
3961
|
-
className:
|
|
3960
|
+
type: Y,
|
|
3961
|
+
className: N(
|
|
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 Ms = ({
|
|
|
3970
3970
|
},
|
|
3971
3971
|
b
|
|
3972
3972
|
),
|
|
3973
|
-
value:
|
|
3973
|
+
value: g,
|
|
3974
3974
|
placeholder: a,
|
|
3975
|
-
onFocus: () =>
|
|
3976
|
-
onBlur: () =>
|
|
3977
|
-
...
|
|
3975
|
+
onFocus: () => k(!0),
|
|
3976
|
+
onBlur: () => k(!1),
|
|
3977
|
+
...v
|
|
3978
3978
|
}
|
|
3979
3979
|
)
|
|
3980
3980
|
]
|
|
@@ -3991,23 +3991,23 @@ const Ms = ({
|
|
|
3991
3991
|
"button",
|
|
3992
3992
|
{
|
|
3993
3993
|
type: "button",
|
|
3994
|
-
className:
|
|
3994
|
+
className: N(
|
|
3995
3995
|
r === "floating" ? "absolute right-3 top-1/2 -translate-y-1/2" : "absolute right-3 top-10"
|
|
3996
3996
|
),
|
|
3997
3997
|
onClick: () => {
|
|
3998
|
-
|
|
3998
|
+
P(!D);
|
|
3999
3999
|
},
|
|
4000
|
-
children:
|
|
4000
|
+
children: D ? /* @__PURE__ */ d(
|
|
4001
4001
|
Cn,
|
|
4002
4002
|
{
|
|
4003
4003
|
size: 20,
|
|
4004
|
-
className:
|
|
4004
|
+
className: N(i ? "text-red-9" : "text-base-11")
|
|
4005
4005
|
}
|
|
4006
4006
|
) : /* @__PURE__ */ d(
|
|
4007
4007
|
Mn,
|
|
4008
4008
|
{
|
|
4009
4009
|
size: 20,
|
|
4010
|
-
className:
|
|
4010
|
+
className: N(i ? "text-red-9" : "text-base-11")
|
|
4011
4011
|
}
|
|
4012
4012
|
)
|
|
4013
4013
|
}
|
|
@@ -4048,7 +4048,7 @@ const ji = ({
|
|
|
4048
4048
|
}
|
|
4049
4049
|
)
|
|
4050
4050
|
}
|
|
4051
|
-
) : (console.error(`Form control is missing for field: ${e}`), /* @__PURE__ */
|
|
4051
|
+
) : (console.error(`Form control is missing for field: ${e}`), /* @__PURE__ */ y("p", { children: [
|
|
4052
4052
|
"Form control missing for field: ",
|
|
4053
4053
|
e
|
|
4054
4054
|
] }));
|
|
@@ -4066,7 +4066,7 @@ const ji = ({
|
|
|
4066
4066
|
), o = T(
|
|
4067
4067
|
{}
|
|
4068
4068
|
);
|
|
4069
|
-
return /* @__PURE__ */
|
|
4069
|
+
return /* @__PURE__ */ y(
|
|
4070
4070
|
Os,
|
|
4071
4071
|
{
|
|
4072
4072
|
value: {
|
|
@@ -4166,7 +4166,7 @@ const ji = ({
|
|
|
4166
4166
|
}) => /* @__PURE__ */ d(
|
|
4167
4167
|
"div",
|
|
4168
4168
|
{
|
|
4169
|
-
className:
|
|
4169
|
+
className: N(
|
|
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 ji = ({
|
|
|
4183
4183
|
"button",
|
|
4184
4184
|
{
|
|
4185
4185
|
onClick: e,
|
|
4186
|
-
className:
|
|
4186
|
+
className: N(
|
|
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,39 +4209,39 @@ const ji = ({
|
|
|
4209
4209
|
disabled: b = !1,
|
|
4210
4210
|
className: h
|
|
4211
4211
|
}) => {
|
|
4212
|
-
const [
|
|
4212
|
+
const [g, v] = z(""), [E, S] = z(!1), [_, D] = z(-1), P = T(null), x = T(null), k = T([]), {
|
|
4213
4213
|
triggerRef: L,
|
|
4214
|
-
triggerProps:
|
|
4214
|
+
triggerProps: Y,
|
|
4215
4215
|
popoverRef: $,
|
|
4216
4216
|
getPopoverPosition: p,
|
|
4217
|
-
open:
|
|
4218
|
-
toggle:
|
|
4219
|
-
close:
|
|
4217
|
+
open: M,
|
|
4218
|
+
toggle: C,
|
|
4219
|
+
close: W
|
|
4220
4220
|
} = Ht({
|
|
4221
4221
|
align: "start",
|
|
4222
4222
|
side: "top",
|
|
4223
4223
|
avoidCollisions: !1,
|
|
4224
4224
|
onOpen: () => {
|
|
4225
|
-
S(!0), m &&
|
|
4225
|
+
S(!0), m && P.current && setTimeout(() => P.current?.focus(), 10);
|
|
4226
4226
|
},
|
|
4227
4227
|
onClose: () => {
|
|
4228
|
-
S(!1),
|
|
4228
|
+
S(!1), v(""), D(-1);
|
|
4229
4229
|
}
|
|
4230
4230
|
}), j = T(
|
|
4231
4231
|
`multiselect-${Math.random().toString(36).substr(2, 9)}`
|
|
4232
4232
|
).current, X = T(
|
|
4233
4233
|
`label-${Math.random().toString(36).substr(2, 9)}`
|
|
4234
|
-
).current,
|
|
4234
|
+
).current, F = T(
|
|
4235
4235
|
`error-${Math.random().toString(36).substr(2, 9)}`
|
|
4236
4236
|
).current, w = T(
|
|
4237
4237
|
`listbox-${Math.random().toString(36).substr(2, 9)}`
|
|
4238
4238
|
).current, K = i ? n.map((O) => r.find(
|
|
4239
4239
|
(G) => a(G) === O || a(G) === a(O)
|
|
4240
4240
|
)).filter(Boolean) : n, ie = K.length > 0, Q = m ? r.filter(
|
|
4241
|
-
(O) => s(O).toLowerCase().includes(
|
|
4241
|
+
(O) => s(O).toLowerCase().includes(g.toLowerCase())
|
|
4242
4242
|
) : r;
|
|
4243
4243
|
B(() => {
|
|
4244
|
-
|
|
4244
|
+
k.current = k.current.slice(0, Q.length);
|
|
4245
4245
|
}, [Q.length]);
|
|
4246
4246
|
const oe = (O) => i ? n.some(
|
|
4247
4247
|
(R) => R === a(O) || a(R) === a(O)
|
|
@@ -4286,88 +4286,88 @@ const ji = ({
|
|
|
4286
4286
|
if (!b)
|
|
4287
4287
|
switch (O.key) {
|
|
4288
4288
|
case "Enter":
|
|
4289
|
-
O.preventDefault(),
|
|
4289
|
+
O.preventDefault(), M ? _ >= 0 && _e(Q[_]) : C();
|
|
4290
4290
|
break;
|
|
4291
4291
|
case "Escape":
|
|
4292
|
-
O.preventDefault(),
|
|
4292
|
+
O.preventDefault(), W();
|
|
4293
4293
|
break;
|
|
4294
4294
|
case "ArrowDown":
|
|
4295
|
-
if (O.preventDefault(), !
|
|
4296
|
-
|
|
4295
|
+
if (O.preventDefault(), !M)
|
|
4296
|
+
C();
|
|
4297
4297
|
else {
|
|
4298
|
-
const R =
|
|
4299
|
-
|
|
4298
|
+
const R = _ >= Q.length - 1 ? 0 : _ + 1;
|
|
4299
|
+
D(R), k.current[R]?.scrollIntoView({ block: "nearest" });
|
|
4300
4300
|
}
|
|
4301
4301
|
break;
|
|
4302
4302
|
case "ArrowUp":
|
|
4303
|
-
if (O.preventDefault(),
|
|
4304
|
-
const R =
|
|
4305
|
-
|
|
4303
|
+
if (O.preventDefault(), M) {
|
|
4304
|
+
const R = _ <= 0 ? Q.length - 1 : _ - 1;
|
|
4305
|
+
D(R), k.current[R]?.scrollIntoView({ block: "nearest" });
|
|
4306
4306
|
}
|
|
4307
4307
|
break;
|
|
4308
4308
|
case "Backspace":
|
|
4309
|
-
if (m &&
|
|
4309
|
+
if (m && g === "" && K.length > 0) {
|
|
4310
4310
|
const R = K[K.length - 1];
|
|
4311
4311
|
Ge(R);
|
|
4312
4312
|
}
|
|
4313
4313
|
break;
|
|
4314
4314
|
}
|
|
4315
4315
|
}, vn = (O) => {
|
|
4316
|
-
|
|
4316
|
+
v(O.target.value), D(-1);
|
|
4317
4317
|
}, wn = () => {
|
|
4318
|
-
b || (m &&
|
|
4318
|
+
b || (m && P.current && P.current.focus(), C());
|
|
4319
4319
|
}, Ze = (O) => {
|
|
4320
4320
|
console.log(`Accessibility announcement: ${O}`);
|
|
4321
4321
|
};
|
|
4322
4322
|
Bt($, (O) => {
|
|
4323
|
-
!L.current || !
|
|
4323
|
+
!L.current || !M || !O.target || L.current.contains(O.target) || W();
|
|
4324
4324
|
});
|
|
4325
4325
|
const Et = p();
|
|
4326
|
-
return /* @__PURE__ */
|
|
4327
|
-
/* @__PURE__ */
|
|
4326
|
+
return /* @__PURE__ */ y("div", { className: N("relative", h), children: [
|
|
4327
|
+
/* @__PURE__ */ y("div", { className: "relative", ref: x, children: [
|
|
4328
4328
|
t === "default" && /* @__PURE__ */ d(
|
|
4329
4329
|
"label",
|
|
4330
4330
|
{
|
|
4331
|
-
className:
|
|
4331
|
+
className: N(
|
|
4332
4332
|
"top-[18px] font-medium ml-0.5 text-xs",
|
|
4333
4333
|
l && "text-red-9"
|
|
4334
4334
|
),
|
|
4335
4335
|
children: e
|
|
4336
4336
|
}
|
|
4337
4337
|
),
|
|
4338
|
-
/* @__PURE__ */
|
|
4338
|
+
/* @__PURE__ */ y(
|
|
4339
4339
|
"div",
|
|
4340
4340
|
{
|
|
4341
4341
|
ref: L,
|
|
4342
|
-
...
|
|
4343
|
-
className:
|
|
4342
|
+
...Y,
|
|
4343
|
+
className: N(
|
|
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
|
{
|
|
4347
4347
|
"py-3": t === "default",
|
|
4348
4348
|
"pt-5 pb-2": t === "floating",
|
|
4349
|
-
"ring-1 ring-brand":
|
|
4349
|
+
"ring-1 ring-brand": M || E,
|
|
4350
4350
|
"text-red-9": l,
|
|
4351
|
-
"ring-2 ring-red-6": l && (
|
|
4351
|
+
"ring-2 ring-red-6": l && (M || E),
|
|
4352
4352
|
"opacity-60 cursor-not-allowed": b
|
|
4353
4353
|
}
|
|
4354
4354
|
),
|
|
4355
4355
|
onClick: wn,
|
|
4356
4356
|
role: "combobox",
|
|
4357
|
-
"aria-expanded":
|
|
4357
|
+
"aria-expanded": M,
|
|
4358
4358
|
"aria-haspopup": "listbox",
|
|
4359
4359
|
"aria-owns": w,
|
|
4360
4360
|
"aria-labelledby": X,
|
|
4361
|
-
"aria-describedby": l ?
|
|
4361
|
+
"aria-describedby": l ? F : void 0,
|
|
4362
4362
|
onKeyDown: Je,
|
|
4363
4363
|
tabIndex: b ? -1 : 0,
|
|
4364
4364
|
children: [
|
|
4365
|
-
t === "floating" && /* @__PURE__ */
|
|
4365
|
+
t === "floating" && /* @__PURE__ */ y(
|
|
4366
4366
|
"label",
|
|
4367
4367
|
{
|
|
4368
4368
|
id: X,
|
|
4369
4369
|
htmlFor: j,
|
|
4370
|
-
className:
|
|
4370
|
+
className: N(
|
|
4371
4371
|
"absolute transition-all duration-200 pointer-events-none",
|
|
4372
4372
|
"text-base top-4 font-semibold left-3",
|
|
4373
4373
|
{
|
|
@@ -4382,17 +4382,17 @@ const ji = ({
|
|
|
4382
4382
|
]
|
|
4383
4383
|
}
|
|
4384
4384
|
),
|
|
4385
|
-
/* @__PURE__ */
|
|
4385
|
+
/* @__PURE__ */ y(
|
|
4386
4386
|
"div",
|
|
4387
4387
|
{
|
|
4388
|
-
className:
|
|
4388
|
+
className: N("flex flex-wrap gap-2 items-center", {
|
|
4389
4389
|
"mt-2.5": t === "floating"
|
|
4390
4390
|
}),
|
|
4391
4391
|
children: [
|
|
4392
|
-
K.map((O) => /* @__PURE__ */
|
|
4392
|
+
K.map((O) => /* @__PURE__ */ y(
|
|
4393
4393
|
"div",
|
|
4394
4394
|
{
|
|
4395
|
-
className:
|
|
4395
|
+
className: N(
|
|
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
|
|
@@ -4419,11 +4419,11 @@ const ji = ({
|
|
|
4419
4419
|
m && /* @__PURE__ */ d(
|
|
4420
4420
|
"input",
|
|
4421
4421
|
{
|
|
4422
|
-
ref:
|
|
4422
|
+
ref: P,
|
|
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: vn,
|
|
4428
4428
|
onKeyDown: Je,
|
|
4429
4429
|
placeholder: ie ? "" : u,
|
|
@@ -4437,14 +4437,14 @@ const ji = ({
|
|
|
4437
4437
|
]
|
|
4438
4438
|
}
|
|
4439
4439
|
),
|
|
4440
|
-
/* @__PURE__ */
|
|
4440
|
+
/* @__PURE__ */ y("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-2", children: [
|
|
4441
4441
|
c && /* @__PURE__ */ d(je, { size: 16, className: "text-green-600" }),
|
|
4442
4442
|
/* @__PURE__ */ d(
|
|
4443
4443
|
Pn,
|
|
4444
4444
|
{
|
|
4445
4445
|
size: 16,
|
|
4446
|
-
className:
|
|
4447
|
-
"rotate-180":
|
|
4446
|
+
className: N("transition-transform text-base-11", {
|
|
4447
|
+
"rotate-180": M
|
|
4448
4448
|
})
|
|
4449
4449
|
}
|
|
4450
4450
|
)
|
|
@@ -4453,7 +4453,7 @@ const ji = ({
|
|
|
4453
4453
|
}
|
|
4454
4454
|
)
|
|
4455
4455
|
] }),
|
|
4456
|
-
/* @__PURE__ */ d(gt, { children:
|
|
4456
|
+
/* @__PURE__ */ d(gt, { children: M && /* @__PURE__ */ d(kt, { children: /* @__PURE__ */ d(
|
|
4457
4457
|
be.div,
|
|
4458
4458
|
{
|
|
4459
4459
|
initial: { opacity: 0, y: -10 },
|
|
@@ -4466,9 +4466,9 @@ const ji = ({
|
|
|
4466
4466
|
left: Et.x,
|
|
4467
4467
|
top: Et.top,
|
|
4468
4468
|
bottom: Et.bottom,
|
|
4469
|
-
width:
|
|
4469
|
+
width: x.current?.offsetWidth ?? 200
|
|
4470
4470
|
},
|
|
4471
|
-
className:
|
|
4471
|
+
className: N(
|
|
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"
|
|
@@ -4476,28 +4476,28 @@ const ji = ({
|
|
|
4476
4476
|
role: "listbox",
|
|
4477
4477
|
id: w,
|
|
4478
4478
|
"aria-labelledby": X,
|
|
4479
|
-
children: Q.length === 0 ? /* @__PURE__ */ d("div", { className: "px-3 py-2 text-sm text-secondarytext", children:
|
|
4479
|
+
children: Q.length === 0 ? /* @__PURE__ */ d("div", { className: "px-3 py-2 text-sm text-secondarytext", children: g ? "No results found" : "No options available" }) : Q.map((O, R) => {
|
|
4480
4480
|
const G = oe(O);
|
|
4481
|
-
return /* @__PURE__ */
|
|
4481
|
+
return /* @__PURE__ */ y(
|
|
4482
4482
|
"div",
|
|
4483
4483
|
{
|
|
4484
4484
|
ref: (yn) => {
|
|
4485
|
-
|
|
4485
|
+
k.current[R] = yn;
|
|
4486
4486
|
},
|
|
4487
|
-
className:
|
|
4487
|
+
className: N(
|
|
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",
|
|
4491
4491
|
// !selected && "pl-9",
|
|
4492
4492
|
{
|
|
4493
|
-
"bg-base-3 dark-theme:bg-base-4": R ===
|
|
4493
|
+
"bg-base-3 dark-theme:bg-base-4": R === _,
|
|
4494
4494
|
"bg-brandfadedbg text-brand": G
|
|
4495
4495
|
}
|
|
4496
4496
|
),
|
|
4497
4497
|
onClick: () => _e(O),
|
|
4498
4498
|
role: "option",
|
|
4499
4499
|
"aria-selected": G,
|
|
4500
|
-
onMouseEnter: () =>
|
|
4500
|
+
onMouseEnter: () => D(R),
|
|
4501
4501
|
children: [
|
|
4502
4502
|
/* @__PURE__ */ d("span", { children: s(O) }),
|
|
4503
4503
|
G && /* @__PURE__ */ d(je, { size: 16 })
|
|
@@ -4511,7 +4511,7 @@ const ji = ({
|
|
|
4511
4511
|
l && /* @__PURE__ */ d(
|
|
4512
4512
|
"p",
|
|
4513
4513
|
{
|
|
4514
|
-
id:
|
|
4514
|
+
id: F,
|
|
4515
4515
|
className: "text-red-9 text-xs mt-1",
|
|
4516
4516
|
"aria-live": "assertive",
|
|
4517
4517
|
children: l
|
|
@@ -4539,7 +4539,7 @@ const ji = ({
|
|
|
4539
4539
|
}
|
|
4540
4540
|
)
|
|
4541
4541
|
}
|
|
4542
|
-
) : (console.error(`Form control is missing for field: ${e}`), /* @__PURE__ */
|
|
4542
|
+
) : (console.error(`Form control is missing for field: ${e}`), /* @__PURE__ */ y("p", { children: [
|
|
4543
4543
|
"Form control missing for field: ",
|
|
4544
4544
|
e
|
|
4545
4545
|
] }));
|
|
@@ -4557,7 +4557,7 @@ const ji = ({
|
|
|
4557
4557
|
showScrollbar: u = !0,
|
|
4558
4558
|
onScroll: f
|
|
4559
4559
|
}) => {
|
|
4560
|
-
const m = T(null), b = T(null), h = T(null),
|
|
4560
|
+
const m = T(null), b = T(null), h = T(null), g = T(null), v = T(null), [E, S] = z(!1), _ = T(null), D = T({
|
|
4561
4561
|
startY: 0,
|
|
4562
4562
|
// Track where the scroll position was when gesture started
|
|
4563
4563
|
currentY: 0,
|
|
@@ -4568,113 +4568,113 @@ const ji = ({
|
|
|
4568
4568
|
pullDistance: 0,
|
|
4569
4569
|
refreshThreshold: 50,
|
|
4570
4570
|
isPullingToRefresh: !1
|
|
4571
|
-
}),
|
|
4571
|
+
}), P = vt(), x = A(
|
|
4572
4572
|
Ue(() => {
|
|
4573
|
-
m.current && b.current && (
|
|
4573
|
+
m.current && b.current && (D.current.maxScroll = Math.max(
|
|
4574
4574
|
0,
|
|
4575
4575
|
b.current.offsetHeight - m.current.offsetHeight
|
|
4576
4576
|
));
|
|
4577
4577
|
}),
|
|
4578
4578
|
[]
|
|
4579
|
-
),
|
|
4580
|
-
const { maxScroll: w } =
|
|
4581
|
-
return
|
|
4579
|
+
), k = A((F) => {
|
|
4580
|
+
const { maxScroll: w } = D.current;
|
|
4581
|
+
return F > 0 ? Math.pow(F, 0.8) : F < -w ? -w - Math.pow(-(F + w), 0.8) : F;
|
|
4582
4582
|
}, []), L = A(() => {
|
|
4583
|
-
if (!u || !m.current || !
|
|
4583
|
+
if (!u || !m.current || !g.current)
|
|
4584
4584
|
return;
|
|
4585
|
-
const { currentY:
|
|
4585
|
+
const { currentY: F, maxScroll: w } = D.current, V = m.current.offsetHeight, K = Math.max(
|
|
4586
4586
|
30,
|
|
4587
4587
|
V / (V + w) * V
|
|
4588
4588
|
), ie = V - K;
|
|
4589
|
-
let Q = -
|
|
4590
|
-
|
|
4591
|
-
}, [u]),
|
|
4592
|
-
(
|
|
4593
|
-
if (
|
|
4589
|
+
let Q = -F / w * ie, oe = 1;
|
|
4590
|
+
F > 0 ? (Q = 0, oe = 1 - F / V, g.current.style.transformOrigin = "top") : F < -w ? (Q = ie, oe = 1 - Math.abs(F + w) / V, g.current.style.transformOrigin = "bottom") : g.current.style.transformOrigin = "top", g.current.style.transform = `translate3d(0, ${Q}px, 0) scaleY(${oe})`, g.current.style.height = `${K}px`;
|
|
4591
|
+
}, [u]), Y = A(
|
|
4592
|
+
(F) => {
|
|
4593
|
+
if (D.current.currentY = F, b.current && (b.current.style.transform = `translate3d(0, ${F}px, 0)`), h.current) {
|
|
4594
4594
|
const w = Math.max(
|
|
4595
|
-
|
|
4596
|
-
-
|
|
4595
|
+
F - D.current.refreshThreshold,
|
|
4596
|
+
-D.current.refreshThreshold
|
|
4597
4597
|
);
|
|
4598
4598
|
h.current.style.transform = `translate3d(0, ${w}px, 0)`;
|
|
4599
4599
|
}
|
|
4600
|
-
f && f(
|
|
4600
|
+
f && f(F), L();
|
|
4601
4601
|
},
|
|
4602
4602
|
[L]
|
|
4603
4603
|
), $ = A(
|
|
4604
|
-
(
|
|
4605
|
-
const w =
|
|
4604
|
+
(F) => {
|
|
4605
|
+
const w = D.current;
|
|
4606
4606
|
w.frameCallback && (te(w.frameCallback), w.frameCallback = null);
|
|
4607
|
-
const V = performance.now(), K = w.currentY, ie =
|
|
4607
|
+
const V = performance.now(), K = w.currentY, ie = F - K, Q = () => {
|
|
4608
4608
|
const oe = performance.now() - V, _e = Math.min(oe / l, 1), Ge = 1 - Math.pow(1 - _e, 3), Je = K + ie * Ge;
|
|
4609
|
-
|
|
4609
|
+
Y(Je), _e >= 1 && (w.frameCallback && (te(w.frameCallback), w.frameCallback = null), Y(F), F === 0 && h.current && (h.current.textContent = "Pull to refresh"));
|
|
4610
4610
|
};
|
|
4611
4611
|
w.frameCallback = at.render(Q, !0);
|
|
4612
4612
|
},
|
|
4613
|
-
[
|
|
4613
|
+
[Y, l]
|
|
4614
4614
|
), p = A(
|
|
4615
|
-
(
|
|
4616
|
-
const w =
|
|
4615
|
+
(F) => {
|
|
4616
|
+
const w = D.current;
|
|
4617
4617
|
w.frameCallback && (te(w.frameCallback), w.frameCallback = null);
|
|
4618
|
-
let V =
|
|
4618
|
+
let V = F, K = Date.now();
|
|
4619
4619
|
const ie = () => {
|
|
4620
4620
|
const Q = Date.now(), oe = Q - K;
|
|
4621
4621
|
if (K = Q, V *= Math.pow(0.95, oe / 16), w.currentY += V * oe, w.currentY > 0 || w.currentY < -w.maxScroll) {
|
|
4622
4622
|
w.frameCallback && (te(w.frameCallback), w.frameCallback = null), $(w.currentY > 0 ? 0 : -w.maxScroll);
|
|
4623
4623
|
return;
|
|
4624
4624
|
}
|
|
4625
|
-
|
|
4625
|
+
Y(w.currentY), Math.abs(V) < 0.01 && w.frameCallback && (te(w.frameCallback), w.frameCallback = null);
|
|
4626
4626
|
};
|
|
4627
4627
|
w.frameCallback = at.render(ie, !0);
|
|
4628
4628
|
},
|
|
4629
|
-
[
|
|
4630
|
-
),
|
|
4631
|
-
if (!u || !
|
|
4632
|
-
|
|
4633
|
-
|
|
4629
|
+
[Y, $]
|
|
4630
|
+
), M = A(() => {
|
|
4631
|
+
if (!u || !g.current) return;
|
|
4632
|
+
v.current !== null && clearTimeout(v.current), requestAnimationFrame(() => {
|
|
4633
|
+
g.current && (g.current.style.opacity = "1");
|
|
4634
4634
|
});
|
|
4635
|
-
const
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4635
|
+
const F = window.requestIdleCallback || ((w) => setTimeout(w, 1e3));
|
|
4636
|
+
v.current = window.setTimeout(() => {
|
|
4637
|
+
F(() => {
|
|
4638
|
+
g.current && (g.current.style.opacity = "0"), v.current = null;
|
|
4639
4639
|
});
|
|
4640
4640
|
}, 1e3);
|
|
4641
|
-
}, [u]),
|
|
4642
|
-
(
|
|
4643
|
-
if (
|
|
4641
|
+
}, [u]), C = A(
|
|
4642
|
+
(F) => {
|
|
4643
|
+
if (_.current !== null && Date.now() - _.current < 50)
|
|
4644
4644
|
return;
|
|
4645
|
-
|
|
4646
|
-
const w =
|
|
4647
|
-
w.isScrolling = !0, w.startY = w.currentY, w.lastTimestamp = Date.now(), w.isPullingToRefresh = w.currentY === 0, w.pullDistance = 0, w.frameCallback && (te(w.frameCallback), w.frameCallback = null),
|
|
4645
|
+
_.current = Date.now();
|
|
4646
|
+
const w = D.current;
|
|
4647
|
+
w.isScrolling = !0, w.startY = w.currentY, w.lastTimestamp = Date.now(), w.isPullingToRefresh = w.currentY === 0, w.pullDistance = 0, w.frameCallback && (te(w.frameCallback), w.frameCallback = null), M();
|
|
4648
4648
|
},
|
|
4649
|
-
[
|
|
4650
|
-
),
|
|
4651
|
-
(
|
|
4652
|
-
const w =
|
|
4649
|
+
[M]
|
|
4650
|
+
), W = A(
|
|
4651
|
+
(F) => {
|
|
4652
|
+
const w = D.current;
|
|
4653
4653
|
if (!w.isScrolling) return;
|
|
4654
|
-
const V =
|
|
4655
|
-
w.isPullingToRefresh && V < w.startY && (w.isPullingToRefresh = !1),
|
|
4654
|
+
const V = k(w.startY + F.deltaY);
|
|
4655
|
+
w.isPullingToRefresh && V < w.startY && (w.isPullingToRefresh = !1), Y(V), a && w.isPullingToRefresh && !E && V > 0 && (w.pullDistance = V, h.current && (h.current.textContent = w.pullDistance > w.refreshThreshold ? "Release to refresh" : "Pull to refresh")), M();
|
|
4656
4656
|
},
|
|
4657
4657
|
[
|
|
4658
4658
|
a,
|
|
4659
|
-
|
|
4659
|
+
Y,
|
|
4660
4660
|
E,
|
|
4661
|
-
|
|
4662
|
-
|
|
4661
|
+
M,
|
|
4662
|
+
k
|
|
4663
4663
|
]
|
|
4664
4664
|
), j = A(
|
|
4665
|
-
(
|
|
4666
|
-
const w =
|
|
4667
|
-
w.isScrolling && (w.isScrolling = !1, a && w.isPullingToRefresh && !E && w.pullDistance > w.refreshThreshold ? X() : w.currentY > 0 || w.currentY < -w.maxScroll ? $(w.currentY > 0 ? 0 : -w.maxScroll) : p(
|
|
4665
|
+
(F) => {
|
|
4666
|
+
const w = D.current;
|
|
4667
|
+
w.isScrolling && (w.isScrolling = !1, a && w.isPullingToRefresh && !E && w.pullDistance > w.refreshThreshold ? X() : w.currentY > 0 || w.currentY < -w.maxScroll ? $(w.currentY > 0 ? 0 : -w.maxScroll) : p(F.velocityY), w.isPullingToRefresh = !1);
|
|
4668
4668
|
},
|
|
4669
4669
|
[a, p, $, E]
|
|
4670
4670
|
), X = A(() => {
|
|
4671
|
-
S(!0), $(
|
|
4671
|
+
S(!0), $(D.current.refreshThreshold), h.current && (h.current.textContent = "Refreshing..."), a && a().then(() => {
|
|
4672
4672
|
S(!1), $(0);
|
|
4673
4673
|
});
|
|
4674
4674
|
}, [a, $]);
|
|
4675
4675
|
return B(() => {
|
|
4676
4676
|
if (!m.current) return;
|
|
4677
|
-
const
|
|
4677
|
+
const F = Fr(m.current, {
|
|
4678
4678
|
name: "page-scroller-gesture",
|
|
4679
4679
|
// threshold: 0, due to small miss touches
|
|
4680
4680
|
// maybe if implementing proper stop propagation
|
|
@@ -4683,42 +4683,42 @@ const ji = ({
|
|
|
4683
4683
|
priority: 10,
|
|
4684
4684
|
passive: !0,
|
|
4685
4685
|
direction: "y",
|
|
4686
|
-
onStart:
|
|
4687
|
-
onMove:
|
|
4686
|
+
onStart: C,
|
|
4687
|
+
onMove: W,
|
|
4688
4688
|
onEnd: j
|
|
4689
4689
|
});
|
|
4690
|
-
return
|
|
4691
|
-
}, [
|
|
4690
|
+
return F.init(), () => F.destroy();
|
|
4691
|
+
}, [C, W, j]), B(() => {
|
|
4692
4692
|
if (m.current)
|
|
4693
|
-
return
|
|
4694
|
-
window.removeEventListener("resize",
|
|
4693
|
+
return x(), L(), window.addEventListener("resize", x), () => {
|
|
4694
|
+
window.removeEventListener("resize", x), v.current !== null && clearTimeout(v.current);
|
|
4695
4695
|
};
|
|
4696
|
-
}, [
|
|
4696
|
+
}, [x, L]), /* @__PURE__ */ y(
|
|
4697
4697
|
be.div,
|
|
4698
4698
|
{
|
|
4699
4699
|
id: e,
|
|
4700
4700
|
ref: m,
|
|
4701
4701
|
initial: {
|
|
4702
|
-
x: t ||
|
|
4703
|
-
y:
|
|
4704
|
-
opacity:
|
|
4702
|
+
x: t || P ? 0 : window.innerWidth,
|
|
4703
|
+
y: P ? 20 : void 0,
|
|
4704
|
+
opacity: P && !t ? 0 : 1
|
|
4705
4705
|
},
|
|
4706
4706
|
animate: {
|
|
4707
|
-
x:
|
|
4708
|
-
y:
|
|
4707
|
+
x: P || t ? void 0 : 0,
|
|
4708
|
+
y: P ? 0 : void 0,
|
|
4709
4709
|
opacity: 1,
|
|
4710
4710
|
transition: {
|
|
4711
4711
|
ease: [0.32, 0.72, 0, 1],
|
|
4712
|
-
duration:
|
|
4712
|
+
duration: P ? 0.34 : 0.44,
|
|
4713
4713
|
delay: 0.2
|
|
4714
4714
|
}
|
|
4715
4715
|
},
|
|
4716
4716
|
exit: {
|
|
4717
|
-
x:
|
|
4718
|
-
y:
|
|
4719
|
-
opacity:
|
|
4717
|
+
x: P || t ? void 0 : window.innerWidth + 80,
|
|
4718
|
+
y: P ? 20 : 0,
|
|
4719
|
+
opacity: P ? 0 : 1,
|
|
4720
4720
|
transition: {
|
|
4721
|
-
duration:
|
|
4721
|
+
duration: P ? 0.34 : 0.6,
|
|
4722
4722
|
ease: [0.32, 0.72, 0, 1]
|
|
4723
4723
|
}
|
|
4724
4724
|
},
|
|
@@ -4727,7 +4727,7 @@ const ji = ({
|
|
|
4727
4727
|
position: r ? "absolute" : "relative",
|
|
4728
4728
|
...s
|
|
4729
4729
|
},
|
|
4730
|
-
className:
|
|
4730
|
+
className: N(
|
|
4731
4731
|
"top-0 right-0 h-full w-full bg-base-1 isolate will-change-transform",
|
|
4732
4732
|
i
|
|
4733
4733
|
),
|
|
@@ -4768,7 +4768,7 @@ const ji = ({
|
|
|
4768
4768
|
u && /* @__PURE__ */ d(
|
|
4769
4769
|
"div",
|
|
4770
4770
|
{
|
|
4771
|
-
ref:
|
|
4771
|
+
ref: g,
|
|
4772
4772
|
style: {
|
|
4773
4773
|
position: "absolute",
|
|
4774
4774
|
top: 2,
|
|
@@ -4806,7 +4806,7 @@ function Ui({
|
|
|
4806
4806
|
pullDistance: 0,
|
|
4807
4807
|
refreshThreshold: 50,
|
|
4808
4808
|
isPullingToRefresh: !1
|
|
4809
|
-
}),
|
|
4809
|
+
}), g = A(
|
|
4810
4810
|
Ue(() => {
|
|
4811
4811
|
s.current && i.current && (h.current.maxScroll = Math.max(
|
|
4812
4812
|
0,
|
|
@@ -4814,18 +4814,18 @@ function Ui({
|
|
|
4814
4814
|
));
|
|
4815
4815
|
}),
|
|
4816
4816
|
[]
|
|
4817
|
-
),
|
|
4817
|
+
), v = A(($) => {
|
|
4818
4818
|
const { maxScroll: p } = h.current;
|
|
4819
4819
|
return $ > 0 ? Math.pow($, 0.8) : $ < -p ? -p - Math.pow(-($ + p), 0.8) : $;
|
|
4820
4820
|
}, []), E = A(() => {
|
|
4821
4821
|
if (!t || !s.current || !l.current)
|
|
4822
4822
|
return;
|
|
4823
|
-
const { currentY: $, maxScroll: p } = h.current,
|
|
4823
|
+
const { currentY: $, maxScroll: p } = h.current, M = s.current.offsetHeight, C = Math.max(
|
|
4824
4824
|
30,
|
|
4825
|
-
|
|
4826
|
-
),
|
|
4827
|
-
let j = -$ / p *
|
|
4828
|
-
$ > 0 ? (j = 0, X = 1 - $ /
|
|
4825
|
+
M / (M + p) * M
|
|
4826
|
+
), W = M - C;
|
|
4827
|
+
let j = -$ / p * W, X = 1;
|
|
4828
|
+
$ > 0 ? (j = 0, X = 1 - $ / M, l.current.style.transformOrigin = "top") : $ < -p ? (j = W, X = 1 - Math.abs($ + p) / M, l.current.style.transformOrigin = "bottom") : l.current.style.transformOrigin = "top", l.current.style.transform = `translate3d(0, ${j}px, 0) scaleY(${X})`, l.current.style.height = `${C}px`;
|
|
4829
4829
|
}, [t]), S = A(
|
|
4830
4830
|
($) => {
|
|
4831
4831
|
if (h.current.currentY = $, i.current && (i.current.style.transform = `translate3d(0, ${$}px, 0)`), c.current) {
|
|
@@ -4838,34 +4838,34 @@ function Ui({
|
|
|
4838
4838
|
a && a($), E();
|
|
4839
4839
|
},
|
|
4840
4840
|
[E]
|
|
4841
|
-
),
|
|
4841
|
+
), _ = A(
|
|
4842
4842
|
($) => {
|
|
4843
4843
|
const p = h.current;
|
|
4844
4844
|
p.frameCallback && (te(p.frameCallback), p.frameCallback = null);
|
|
4845
|
-
const
|
|
4846
|
-
const X = performance.now() -
|
|
4847
|
-
S(V),
|
|
4845
|
+
const M = performance.now(), C = p.currentY, W = $ - C, j = () => {
|
|
4846
|
+
const X = performance.now() - M, F = Math.min(X / n, 1), w = 1 - Math.pow(1 - F, 3), V = C + W * w;
|
|
4847
|
+
S(V), F >= 1 && (p.frameCallback && (te(p.frameCallback), p.frameCallback = null), S($));
|
|
4848
4848
|
};
|
|
4849
4849
|
p.frameCallback = at.render(j, !0);
|
|
4850
4850
|
},
|
|
4851
4851
|
[S, n]
|
|
4852
|
-
),
|
|
4852
|
+
), D = A(
|
|
4853
4853
|
($) => {
|
|
4854
4854
|
const p = h.current;
|
|
4855
4855
|
p.frameCallback && (te(p.frameCallback), p.frameCallback = null);
|
|
4856
|
-
let
|
|
4857
|
-
const
|
|
4858
|
-
const j = Date.now(), X = j -
|
|
4859
|
-
if (
|
|
4860
|
-
p.frameCallback && (te(p.frameCallback), p.frameCallback = null),
|
|
4856
|
+
let M = $, C = Date.now();
|
|
4857
|
+
const W = () => {
|
|
4858
|
+
const j = Date.now(), X = j - C;
|
|
4859
|
+
if (C = j, M *= Math.pow(0.95, X / 16), p.currentY += M * X, p.currentY > 0 || p.currentY < -p.maxScroll) {
|
|
4860
|
+
p.frameCallback && (te(p.frameCallback), p.frameCallback = null), _(p.currentY > 0 ? 0 : -p.maxScroll);
|
|
4861
4861
|
return;
|
|
4862
4862
|
}
|
|
4863
|
-
S(p.currentY), Math.abs(
|
|
4863
|
+
S(p.currentY), Math.abs(M) < 0.01 && p.frameCallback && (te(p.frameCallback), p.frameCallback = null);
|
|
4864
4864
|
};
|
|
4865
|
-
p.frameCallback = at.render(
|
|
4865
|
+
p.frameCallback = at.render(W, !0);
|
|
4866
4866
|
},
|
|
4867
|
-
[S,
|
|
4868
|
-
),
|
|
4867
|
+
[S, _]
|
|
4868
|
+
), P = A(() => {
|
|
4869
4869
|
if (!t || !l.current) return;
|
|
4870
4870
|
u.current !== null && clearTimeout(u.current), requestAnimationFrame(() => {
|
|
4871
4871
|
l.current && (l.current.style.opacity = "1");
|
|
@@ -4876,39 +4876,39 @@ function Ui({
|
|
|
4876
4876
|
l.current && (l.current.style.opacity = "0"), u.current = null;
|
|
4877
4877
|
});
|
|
4878
4878
|
}, 1e3);
|
|
4879
|
-
}, [t]),
|
|
4879
|
+
}, [t]), x = A(
|
|
4880
4880
|
($) => {
|
|
4881
4881
|
if (b.current !== null && Date.now() - b.current < 50)
|
|
4882
4882
|
return;
|
|
4883
4883
|
b.current = Date.now();
|
|
4884
4884
|
const p = h.current;
|
|
4885
|
-
p.isScrolling = !0, p.startY = p.currentY, p.lastTimestamp = Date.now(), p.isPullingToRefresh = p.currentY === 0, p.pullDistance = 0, p.frameCallback && (te(p.frameCallback), p.frameCallback = null),
|
|
4885
|
+
p.isScrolling = !0, p.startY = p.currentY, p.lastTimestamp = Date.now(), p.isPullingToRefresh = p.currentY === 0, p.pullDistance = 0, p.frameCallback && (te(p.frameCallback), p.frameCallback = null), P();
|
|
4886
4886
|
},
|
|
4887
|
-
[
|
|
4888
|
-
),
|
|
4887
|
+
[P]
|
|
4888
|
+
), k = A(
|
|
4889
4889
|
($) => {
|
|
4890
4890
|
const p = h.current;
|
|
4891
4891
|
if (!p.isScrolling) return;
|
|
4892
|
-
const
|
|
4893
|
-
p.isPullingToRefresh &&
|
|
4892
|
+
const M = v(p.startY + $.deltaY);
|
|
4893
|
+
p.isPullingToRefresh && M < p.startY && (p.isPullingToRefresh = !1), S(M), r && p.isPullingToRefresh && !f && M > 0 && (p.pullDistance = M), P();
|
|
4894
4894
|
},
|
|
4895
4895
|
[
|
|
4896
4896
|
r,
|
|
4897
4897
|
S,
|
|
4898
4898
|
f,
|
|
4899
|
-
|
|
4900
|
-
|
|
4899
|
+
P,
|
|
4900
|
+
v
|
|
4901
4901
|
]
|
|
4902
4902
|
), L = A(() => {
|
|
4903
|
-
m(!0),
|
|
4904
|
-
m(!1),
|
|
4903
|
+
m(!0), _(h.current.refreshThreshold), r && r().then(() => {
|
|
4904
|
+
m(!1), _(0);
|
|
4905
4905
|
});
|
|
4906
|
-
}, [r,
|
|
4906
|
+
}, [r, _]), Y = A(
|
|
4907
4907
|
($) => {
|
|
4908
4908
|
const p = h.current;
|
|
4909
|
-
p.isScrolling && (p.isScrolling = !1, r && p.isPullingToRefresh && !f && p.pullDistance > p.refreshThreshold ? L() : p.currentY > 0 || p.currentY < -p.maxScroll ?
|
|
4909
|
+
p.isScrolling && (p.isScrolling = !1, r && p.isPullingToRefresh && !f && p.pullDistance > p.refreshThreshold ? L() : p.currentY > 0 || p.currentY < -p.maxScroll ? _(p.currentY > 0 ? 0 : -p.maxScroll) : D($.velocityY), p.isPullingToRefresh = !1);
|
|
4910
4910
|
},
|
|
4911
|
-
[r,
|
|
4911
|
+
[r, D, _, f, L]
|
|
4912
4912
|
);
|
|
4913
4913
|
return B(() => {
|
|
4914
4914
|
if (!s.current) return;
|
|
@@ -4917,17 +4917,17 @@ function Ui({
|
|
|
4917
4917
|
priority: 10,
|
|
4918
4918
|
passive: !0,
|
|
4919
4919
|
direction: "y",
|
|
4920
|
-
onStart:
|
|
4921
|
-
onMove:
|
|
4922
|
-
onEnd:
|
|
4920
|
+
onStart: x,
|
|
4921
|
+
onMove: k,
|
|
4922
|
+
onEnd: Y
|
|
4923
4923
|
});
|
|
4924
4924
|
return $.init(), () => $.destroy();
|
|
4925
|
-
}, [
|
|
4925
|
+
}, [x, k, Y]), B(() => {
|
|
4926
4926
|
if (s.current)
|
|
4927
|
-
return
|
|
4928
|
-
window.removeEventListener("resize",
|
|
4927
|
+
return g(), E(), window.addEventListener("resize", g), () => {
|
|
4928
|
+
window.removeEventListener("resize", g), u.current !== null && clearTimeout(u.current);
|
|
4929
4929
|
};
|
|
4930
|
-
}, [
|
|
4930
|
+
}, [g, E]), {
|
|
4931
4931
|
container: {
|
|
4932
4932
|
props: {
|
|
4933
4933
|
id: e,
|
|
@@ -4969,8 +4969,8 @@ function Ui({
|
|
|
4969
4969
|
}
|
|
4970
4970
|
},
|
|
4971
4971
|
refreshing: f,
|
|
4972
|
-
updateMaxScroll:
|
|
4973
|
-
rubberBandEffect:
|
|
4972
|
+
updateMaxScroll: g,
|
|
4973
|
+
rubberBandEffect: v,
|
|
4974
4974
|
updateScrollbarPosition: E,
|
|
4975
4975
|
setPosition: S
|
|
4976
4976
|
};
|
|
@@ -4986,9 +4986,9 @@ const _s = {
|
|
|
4986
4986
|
size: r = "6",
|
|
4987
4987
|
descriptionClassName: n,
|
|
4988
4988
|
className: o
|
|
4989
|
-
}) => /* @__PURE__ */
|
|
4989
|
+
}) => /* @__PURE__ */ y("div", { className: N("text-center", o), children: [
|
|
4990
4990
|
/* @__PURE__ */ d("p", { className: `${_s[r]} font-medium`, children: e }),
|
|
4991
|
-
t ? /* @__PURE__ */ d("p", { className:
|
|
4991
|
+
t ? /* @__PURE__ */ d("p", { className: N("mt-6 text-base-11", n), children: t }) : null
|
|
4992
4992
|
] }), Gi = qe(
|
|
4993
4993
|
({
|
|
4994
4994
|
placeholder: e = "Buscar",
|
|
@@ -5007,10 +5007,10 @@ const _s = {
|
|
|
5007
5007
|
i && await i(u, f);
|
|
5008
5008
|
};
|
|
5009
5009
|
b(), h();
|
|
5010
|
-
}, []), /* @__PURE__ */
|
|
5010
|
+
}, []), /* @__PURE__ */ y(
|
|
5011
5011
|
"div",
|
|
5012
5012
|
{
|
|
5013
|
-
className:
|
|
5013
|
+
className: N(
|
|
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 _s = {
|
|
|
5030
5030
|
autoCorrect: "off",
|
|
5031
5031
|
type: "search",
|
|
5032
5032
|
autoFocus: n ? n(f) : void 0,
|
|
5033
|
-
className:
|
|
5033
|
+
className: N(
|
|
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 _s = {
|
|
|
5040
5040
|
On,
|
|
5041
5041
|
{
|
|
5042
5042
|
size: 20,
|
|
5043
|
-
className:
|
|
5043
|
+
className: N("absolute left-3 text-base-11 pointer-events-none", {
|
|
5044
5044
|
"text-red-9": c
|
|
5045
5045
|
})
|
|
5046
5046
|
}
|
|
@@ -5051,7 +5051,7 @@ const _s = {
|
|
|
5051
5051
|
onClick: () => {
|
|
5052
5052
|
o(), u.current?.focus();
|
|
5053
5053
|
},
|
|
5054
|
-
className:
|
|
5054
|
+
className: N(
|
|
5055
5055
|
"absolute right-2.5 rounded-full",
|
|
5056
5056
|
c ? "text-red-9" : "text-base-11"
|
|
5057
5057
|
),
|
|
@@ -5070,13 +5070,13 @@ const _s = {
|
|
|
5070
5070
|
buttonClassName: o
|
|
5071
5071
|
}) => {
|
|
5072
5072
|
const [a, s] = z(!1), i = de(() => e.length > t, [e]), c = de(() => i ? a ? e : e.slice(0, t).trim() + "..." : e, [e, a, i]);
|
|
5073
|
-
return /* @__PURE__ */
|
|
5074
|
-
/* @__PURE__ */ d("p", { className:
|
|
5073
|
+
return /* @__PURE__ */ y("div", { children: [
|
|
5074
|
+
/* @__PURE__ */ d("p", { className: N("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: N("text-xs text-base-11", o),
|
|
5080
5080
|
children: a ? "Ver menos" : "Ver más"
|
|
5081
5081
|
}
|
|
5082
5082
|
) : null
|
|
@@ -5480,17 +5480,17 @@ const ve = {
|
|
|
5480
5480
|
// from,
|
|
5481
5481
|
className: b
|
|
5482
5482
|
}) => {
|
|
5483
|
-
const [h,
|
|
5483
|
+
const [h, g] = z({ left: !1, right: !1 }), { ref: v } = In({
|
|
5484
5484
|
onOverflow: (E) => {
|
|
5485
|
-
|
|
5485
|
+
g({ left: E.canScrollLeft, right: E.canScrollRight });
|
|
5486
5486
|
},
|
|
5487
5487
|
// enabled: inView,
|
|
5488
5488
|
trackScroll: m
|
|
5489
5489
|
});
|
|
5490
|
-
return /* @__PURE__ */
|
|
5490
|
+
return /* @__PURE__ */ y(
|
|
5491
5491
|
"div",
|
|
5492
5492
|
{
|
|
5493
|
-
className:
|
|
5493
|
+
className: N(
|
|
5494
5494
|
"relative overflow-hidden",
|
|
5495
5495
|
ve.widths[l].container,
|
|
5496
5496
|
ve.rounded[f],
|
|
@@ -5500,8 +5500,8 @@ const ve = {
|
|
|
5500
5500
|
/* @__PURE__ */ d(
|
|
5501
5501
|
"div",
|
|
5502
5502
|
{
|
|
5503
|
-
ref:
|
|
5504
|
-
className:
|
|
5503
|
+
ref: v,
|
|
5504
|
+
className: N(
|
|
5505
5505
|
"flex items-center border overflow-x-scroll scrollbar-hide",
|
|
5506
5506
|
ve.rounded[f],
|
|
5507
5507
|
ve.border[u]
|
|
@@ -5512,7 +5512,7 @@ const ve = {
|
|
|
5512
5512
|
"button",
|
|
5513
5513
|
{
|
|
5514
5514
|
onClick: () => r?.(E),
|
|
5515
|
-
className:
|
|
5515
|
+
className: N(
|
|
5516
5516
|
"border-r px-3 py-1 last:border-none text-nowrap shrink-0",
|
|
5517
5517
|
ve.widths[l].item,
|
|
5518
5518
|
!S && "lg:hover:bg-overlay-3",
|
|
@@ -5527,7 +5527,7 @@ const ve = {
|
|
|
5527
5527
|
})
|
|
5528
5528
|
}
|
|
5529
5529
|
),
|
|
5530
|
-
/* @__PURE__ */
|
|
5530
|
+
/* @__PURE__ */ y(gt, { children: [
|
|
5531
5531
|
h.left ? /* @__PURE__ */ d(
|
|
5532
5532
|
be.button,
|
|
5533
5533
|
{
|
|
@@ -5536,7 +5536,7 @@ const ve = {
|
|
|
5536
5536
|
animate: "animate",
|
|
5537
5537
|
exit: "exit",
|
|
5538
5538
|
onClick: () => {
|
|
5539
|
-
|
|
5539
|
+
v.current && yr({ el: v.current, direction: "left" });
|
|
5540
5540
|
},
|
|
5541
5541
|
className: "absolute shrink-0 left-0 px-1 h-full bg-gradient-to-r from-base-2 top-0",
|
|
5542
5542
|
children: /* @__PURE__ */ d(Sr, { className: "text-base-13" })
|
|
@@ -5551,7 +5551,7 @@ const ve = {
|
|
|
5551
5551
|
animate: "animate",
|
|
5552
5552
|
exit: "exit",
|
|
5553
5553
|
onClick: () => {
|
|
5554
|
-
|
|
5554
|
+
v.current && yr({ el: v.current, direction: "right" });
|
|
5555
5555
|
},
|
|
5556
5556
|
className: "absolute shrink-0 right-0 px-1 h-full bg-gradient-to-l from-base-2 top-0",
|
|
5557
5557
|
children: /* @__PURE__ */ d(Cr, { className: "text-base-13" })
|
|
@@ -5571,114 +5571,121 @@ function Zs({
|
|
|
5571
5571
|
onChange: o,
|
|
5572
5572
|
idExtractor: a,
|
|
5573
5573
|
labelExtractor: s,
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5574
|
+
descriptionExtractor: i,
|
|
5575
|
+
classNameExtractor: c,
|
|
5576
|
+
customGetter: l,
|
|
5577
|
+
customSetter: u,
|
|
5578
|
+
error: f,
|
|
5579
|
+
placeholder: m = "Selecciona una opción",
|
|
5580
|
+
searchable: b,
|
|
5581
|
+
className: h
|
|
5580
5582
|
}) {
|
|
5581
|
-
const [
|
|
5582
|
-
triggerRef:
|
|
5583
|
-
triggerProps:
|
|
5584
|
-
popoverRef:
|
|
5585
|
-
getPopoverPosition:
|
|
5586
|
-
open:
|
|
5587
|
-
toggle:
|
|
5588
|
-
close:
|
|
5583
|
+
const [g, v] = z(-1), E = T(null), {
|
|
5584
|
+
triggerRef: S,
|
|
5585
|
+
triggerProps: _,
|
|
5586
|
+
popoverRef: D,
|
|
5587
|
+
getPopoverPosition: P,
|
|
5588
|
+
open: x,
|
|
5589
|
+
toggle: k,
|
|
5590
|
+
close: L
|
|
5589
5591
|
} = Ht({
|
|
5590
5592
|
align: "start",
|
|
5591
5593
|
side: "bottom",
|
|
5592
5594
|
avoidCollisions: !0,
|
|
5593
5595
|
onOpen: () => {
|
|
5594
|
-
|
|
5596
|
+
b && E.current && setTimeout(() => E.current?.focus(), 10);
|
|
5595
5597
|
},
|
|
5596
5598
|
onClose: () => {
|
|
5597
|
-
|
|
5599
|
+
v(-1);
|
|
5598
5600
|
}
|
|
5599
5601
|
});
|
|
5600
|
-
Bt(
|
|
5601
|
-
!
|
|
5602
|
+
Bt(D, (p) => {
|
|
5603
|
+
!S.current || !x || !p.target || S.current.contains(p.target) || L();
|
|
5602
5604
|
});
|
|
5603
|
-
const
|
|
5604
|
-
return /* @__PURE__ */
|
|
5605
|
+
const Y = P(), $ = l && n ? l(n, r) : n;
|
|
5606
|
+
return /* @__PURE__ */ y("div", { className: N("relative", h), children: [
|
|
5605
5607
|
t === "default" && /* @__PURE__ */ d(
|
|
5606
5608
|
"label",
|
|
5607
5609
|
{
|
|
5608
|
-
className:
|
|
5610
|
+
className: N(
|
|
5609
5611
|
"top-[18px] font-medium ml-0.5 text-xs",
|
|
5610
|
-
|
|
5612
|
+
f && "text-red-9"
|
|
5611
5613
|
),
|
|
5612
5614
|
children: e
|
|
5613
5615
|
}
|
|
5614
5616
|
),
|
|
5615
|
-
/* @__PURE__ */
|
|
5617
|
+
/* @__PURE__ */ y(
|
|
5616
5618
|
J,
|
|
5617
5619
|
{
|
|
5618
|
-
ref:
|
|
5620
|
+
ref: S,
|
|
5619
5621
|
color: "solidhybrid",
|
|
5620
5622
|
className: "w-full justify-between",
|
|
5621
|
-
onClick:
|
|
5622
|
-
...
|
|
5623
|
+
onClick: k,
|
|
5624
|
+
..._,
|
|
5623
5625
|
children: [
|
|
5624
|
-
|
|
5626
|
+
$ ? s($) : m,
|
|
5625
5627
|
/* @__PURE__ */ d(
|
|
5626
5628
|
Ln,
|
|
5627
5629
|
{
|
|
5628
5630
|
size: 18,
|
|
5629
|
-
className:
|
|
5631
|
+
className: N("transition", x && "rotate-180")
|
|
5630
5632
|
}
|
|
5631
5633
|
)
|
|
5632
5634
|
]
|
|
5633
5635
|
}
|
|
5634
5636
|
),
|
|
5635
|
-
/* @__PURE__ */ d(gt, { children:
|
|
5637
|
+
/* @__PURE__ */ d(gt, { children: x && /* @__PURE__ */ d(kt, { children: /* @__PURE__ */ d(
|
|
5636
5638
|
be.div,
|
|
5637
5639
|
{
|
|
5638
5640
|
initial: { opacity: 0, y: -10 },
|
|
5639
5641
|
animate: { opacity: 1, y: 0 },
|
|
5640
5642
|
exit: { opacity: 0, y: -10 },
|
|
5641
5643
|
transition: { duration: 0.15 },
|
|
5642
|
-
ref:
|
|
5644
|
+
ref: D,
|
|
5643
5645
|
style: {
|
|
5644
5646
|
position: "fixed",
|
|
5645
|
-
left:
|
|
5646
|
-
top:
|
|
5647
|
-
bottom:
|
|
5648
|
-
width:
|
|
5647
|
+
left: Y.x,
|
|
5648
|
+
top: Y.top,
|
|
5649
|
+
bottom: Y.bottom,
|
|
5650
|
+
width: S.current?.offsetWidth ?? 200
|
|
5649
5651
|
},
|
|
5650
|
-
className:
|
|
5652
|
+
className: N(
|
|
5651
5653
|
"bg-base-1 dark-theme:bg-base-3 border border-base-4",
|
|
5652
5654
|
"rounded-6 shadow-lg max-h-[300px] overflow-y-auto z-50",
|
|
5653
5655
|
"customscrollbarnohide"
|
|
5654
5656
|
),
|
|
5655
5657
|
role: "listbox",
|
|
5656
|
-
children: r.map((
|
|
5657
|
-
const
|
|
5658
|
-
return /* @__PURE__ */
|
|
5658
|
+
children: r.map((p, M) => {
|
|
5659
|
+
const C = !!($ && a(p) === a($));
|
|
5660
|
+
return /* @__PURE__ */ y(
|
|
5659
5661
|
"div",
|
|
5660
5662
|
{
|
|
5661
|
-
className:
|
|
5662
|
-
"px-3 py-2 text-sm cursor-pointer flex items-center justify-between",
|
|
5663
|
+
className: N(
|
|
5664
|
+
"px-3 py-2 text-sm cursor-pointer flex items-center justify-between gap-x-4",
|
|
5663
5665
|
// gap-x-2
|
|
5664
|
-
"first:rounded-t-6 last:rounded-b-6",
|
|
5666
|
+
"first:rounded-t-6 last:rounded-b-6 relative",
|
|
5665
5667
|
// !selected && "pl-9",
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
}
|
|
5668
|
+
M === g && "bg-base-3 dark-theme:bg-base-4",
|
|
5669
|
+
C && "bg-brandfadedbg text-brand",
|
|
5670
|
+
c && c(C)
|
|
5670
5671
|
),
|
|
5671
5672
|
onClick: () => {
|
|
5672
|
-
o(
|
|
5673
|
+
o(u ? u(p) : p), L();
|
|
5673
5674
|
},
|
|
5674
5675
|
role: "option",
|
|
5675
|
-
onMouseEnter: () =>
|
|
5676
|
+
onMouseEnter: () => v(M),
|
|
5676
5677
|
children: [
|
|
5677
|
-
/* @__PURE__ */
|
|
5678
|
-
|
|
5678
|
+
/* @__PURE__ */ y("div", { children: [
|
|
5679
|
+
/* @__PURE__ */ y("p", { children: [
|
|
5680
|
+
s(p),
|
|
5681
|
+
" "
|
|
5682
|
+
] }),
|
|
5683
|
+
i && /* @__PURE__ */ d("p", { className: "text-xs text-base-11 mt-0.5 line-clamp-2", children: i(p) })
|
|
5684
|
+
] }),
|
|
5685
|
+
C && /* @__PURE__ */ d(je, { size: 16, className: "shrink-0" })
|
|
5679
5686
|
]
|
|
5680
5687
|
},
|
|
5681
|
-
a(
|
|
5688
|
+
a(p)
|
|
5682
5689
|
);
|
|
5683
5690
|
})
|
|
5684
5691
|
}
|
|
@@ -5702,22 +5709,22 @@ const el = ({ name: e, ...t }) => {
|
|
|
5702
5709
|
}
|
|
5703
5710
|
)
|
|
5704
5711
|
}
|
|
5705
|
-
) : (console.error(`Form control is missing for field: ${e}`), /* @__PURE__ */
|
|
5712
|
+
) : (console.error(`Form control is missing for field: ${e}`), /* @__PURE__ */ y("p", { children: [
|
|
5706
5713
|
"Form control missing for field: ",
|
|
5707
5714
|
e
|
|
5708
5715
|
] }));
|
|
5709
|
-
}, tl = ({ className: e }) => /* @__PURE__ */ d("div", { className:
|
|
5716
|
+
}, tl = ({ className: e }) => /* @__PURE__ */ d("div", { className: N("w-full h-px bg-base-4", e) }), ei = ({
|
|
5710
5717
|
loading: e = !0,
|
|
5711
5718
|
wrapperClassName: t,
|
|
5712
5719
|
spinnerClassName: r
|
|
5713
|
-
}) => /* @__PURE__ */ d("div", { className:
|
|
5720
|
+
}) => /* @__PURE__ */ d("div", { className: N("flex justify-center", t), children: /* @__PURE__ */ d(
|
|
5714
5721
|
"svg",
|
|
5715
5722
|
{
|
|
5716
5723
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5717
5724
|
width: "20",
|
|
5718
5725
|
height: "20",
|
|
5719
5726
|
viewBox: "0 0 20 20",
|
|
5720
|
-
className:
|
|
5727
|
+
className: N({ "animate-spin": e }, r),
|
|
5721
5728
|
children: /* @__PURE__ */ d(
|
|
5722
5729
|
"path",
|
|
5723
5730
|
{
|
|
@@ -5739,8 +5746,8 @@ const el = ({ name: e, ...t }) => {
|
|
|
5739
5746
|
className: l
|
|
5740
5747
|
}) => {
|
|
5741
5748
|
const [u, f] = z(!1);
|
|
5742
|
-
return /* @__PURE__ */
|
|
5743
|
-
e && t ? /* @__PURE__ */
|
|
5749
|
+
return /* @__PURE__ */ y("div", { className: `w-full grid grid-cols-2 gap-4 col-span-full ${l}`, children: [
|
|
5750
|
+
e && t ? /* @__PURE__ */ y(
|
|
5744
5751
|
J,
|
|
5745
5752
|
{
|
|
5746
5753
|
color: "dangersolid",
|
|
@@ -5754,11 +5761,11 @@ const el = ({ name: e, ...t }) => {
|
|
|
5754
5761
|
]
|
|
5755
5762
|
}
|
|
5756
5763
|
) : null,
|
|
5757
|
-
/* @__PURE__ */
|
|
5764
|
+
/* @__PURE__ */ y(
|
|
5758
5765
|
J,
|
|
5759
5766
|
{
|
|
5760
5767
|
color: "brand",
|
|
5761
|
-
className:
|
|
5768
|
+
className: N(e && t ? "" : "col-span-2"),
|
|
5762
5769
|
state: r ? "loading" : n ? "disabled" : "enabled",
|
|
5763
5770
|
type: "submit",
|
|
5764
5771
|
children: [
|
|
@@ -5845,14 +5852,14 @@ const el = ({ name: e, ...t }) => {
|
|
|
5845
5852
|
children: f
|
|
5846
5853
|
// ...others
|
|
5847
5854
|
}) => {
|
|
5848
|
-
const m = An(), b = vt(), h = T(null),
|
|
5855
|
+
const m = An(), b = vt(), h = T(null), g = ti(), v = de(() => i === "modal" || b, [i, b]);
|
|
5849
5856
|
return B(() => {
|
|
5850
|
-
|
|
5851
|
-
const E =
|
|
5857
|
+
g.add(e);
|
|
5858
|
+
const E = g.getPrevId();
|
|
5852
5859
|
if (!E || (h.current = document.getElementById(E), !h.current)) return;
|
|
5853
|
-
E &&
|
|
5860
|
+
E && g.animateParentModal(
|
|
5854
5861
|
h.current,
|
|
5855
|
-
|
|
5862
|
+
v ? "modal" : "sheet"
|
|
5856
5863
|
);
|
|
5857
5864
|
//! cleanups not running on new router system
|
|
5858
5865
|
//! IDK WHY
|
|
@@ -5860,7 +5867,7 @@ const el = ({ name: e, ...t }) => {
|
|
|
5860
5867
|
console.log("IS THIS CLEANUP RUNNING?");
|
|
5861
5868
|
};
|
|
5862
5869
|
//! NOT RUNNING...
|
|
5863
|
-
}, [b]), $r(() => () =>
|
|
5870
|
+
}, [b]), $r(() => () => g.remove(e), []), /* @__PURE__ */ y(ri, { withPortal: n, children: [
|
|
5864
5871
|
/* @__PURE__ */ d(
|
|
5865
5872
|
be.div,
|
|
5866
5873
|
{
|
|
@@ -5886,19 +5893,19 @@ const el = ({ name: e, ...t }) => {
|
|
|
5886
5893
|
className: "bg-black/40 absolute w-full h-full left-0 top-0 z-[500]"
|
|
5887
5894
|
}
|
|
5888
5895
|
),
|
|
5889
|
-
/* @__PURE__ */
|
|
5896
|
+
/* @__PURE__ */ y(
|
|
5890
5897
|
be.div,
|
|
5891
5898
|
{
|
|
5892
5899
|
id: e,
|
|
5893
5900
|
initial: {
|
|
5894
|
-
opacity:
|
|
5895
|
-
scale:
|
|
5896
|
-
y:
|
|
5901
|
+
opacity: v ? 0 : 1,
|
|
5902
|
+
scale: v ? 0.8 : void 0,
|
|
5903
|
+
y: v ? void 0 : window.innerHeight
|
|
5897
5904
|
},
|
|
5898
5905
|
animate: {
|
|
5899
5906
|
opacity: 1,
|
|
5900
5907
|
scale: 1,
|
|
5901
|
-
y:
|
|
5908
|
+
y: v ? void 0 : 0,
|
|
5902
5909
|
transition: {
|
|
5903
5910
|
ease: [0.32, 0.72, 0, 1],
|
|
5904
5911
|
duration: 0.3,
|
|
@@ -5906,9 +5913,9 @@ const el = ({ name: e, ...t }) => {
|
|
|
5906
5913
|
}
|
|
5907
5914
|
},
|
|
5908
5915
|
exit: {
|
|
5909
|
-
scale:
|
|
5910
|
-
opacity:
|
|
5911
|
-
y:
|
|
5916
|
+
scale: v ? 0.8 : void 0,
|
|
5917
|
+
opacity: v ? 0 : void 0,
|
|
5918
|
+
y: v ? void 0 : window.innerHeight,
|
|
5912
5919
|
transition: {
|
|
5913
5920
|
ease: [0.32, 0.72, 0, 1],
|
|
5914
5921
|
duration: 0.3
|
|
@@ -5917,21 +5924,21 @@ const el = ({ name: e, ...t }) => {
|
|
|
5917
5924
|
style: {
|
|
5918
5925
|
left: "50%",
|
|
5919
5926
|
translateX: "-50%",
|
|
5920
|
-
bottom:
|
|
5921
|
-
translateY:
|
|
5922
|
-
height:
|
|
5927
|
+
bottom: v ? "50%" : 0,
|
|
5928
|
+
translateY: v ? "50%" : 0,
|
|
5929
|
+
height: v ? "65%" : "95%"
|
|
5923
5930
|
},
|
|
5924
5931
|
onAnimationStart: (E) => {
|
|
5925
|
-
(E?.scale === 0.8 || E?.y > 50) && h.current &&
|
|
5932
|
+
(E?.scale === 0.8 || E?.y > 50) && h.current && g.restoreParentModal(h.current);
|
|
5926
5933
|
},
|
|
5927
|
-
className:
|
|
5934
|
+
className: N(
|
|
5928
5935
|
"bg-base-1 absolute w-full lg:max-w-[600px] h-full rounded-6 overflow-hidden z-[500] flex flex-col",
|
|
5929
|
-
!
|
|
5936
|
+
!v && "rounded-b-none",
|
|
5930
5937
|
l
|
|
5931
5938
|
),
|
|
5932
5939
|
children: [
|
|
5933
|
-
s && /* @__PURE__ */
|
|
5934
|
-
/* @__PURE__ */
|
|
5940
|
+
s && /* @__PURE__ */ y("div", { className: "flex items-start justify-between p-4 border-b border-base-3", children: [
|
|
5941
|
+
/* @__PURE__ */ y("div", { children: [
|
|
5935
5942
|
o && /* @__PURE__ */ d("p", { className: "font-medium text-lg", children: o }),
|
|
5936
5943
|
a && /* @__PURE__ */ d("p", { className: "text-base-11 text-xs", children: a })
|
|
5937
5944
|
] }),
|
|
@@ -5950,7 +5957,7 @@ const el = ({ name: e, ...t }) => {
|
|
|
5950
5957
|
"div",
|
|
5951
5958
|
{
|
|
5952
5959
|
id: `${e}-content`,
|
|
5953
|
-
className:
|
|
5960
|
+
className: N("grow customscrollbar p-4 pb-6", u),
|
|
5954
5961
|
children: f
|
|
5955
5962
|
}
|
|
5956
5963
|
)
|
|
@@ -5968,7 +5975,7 @@ function ni({
|
|
|
5968
5975
|
className: a = ""
|
|
5969
5976
|
}) {
|
|
5970
5977
|
const s = Er();
|
|
5971
|
-
return /* @__PURE__ */
|
|
5978
|
+
return /* @__PURE__ */ y(
|
|
5972
5979
|
"button",
|
|
5973
5980
|
{
|
|
5974
5981
|
id: s,
|
|
@@ -5981,7 +5988,7 @@ function ni({
|
|
|
5981
5988
|
onClick: () => {
|
|
5982
5989
|
r || t(!e);
|
|
5983
5990
|
},
|
|
5984
|
-
className:
|
|
5991
|
+
className: N(
|
|
5985
5992
|
`relative inline-flex h-[28px] w-[48px] items-center rounded-full
|
|
5986
5993
|
transition-colors duration-200 ease-in-out
|
|
5987
5994
|
focus-visible:outline-none focus-visible:ring-1
|
|
@@ -5994,7 +6001,7 @@ function ni({
|
|
|
5994
6001
|
/* @__PURE__ */ d(
|
|
5995
6002
|
"span",
|
|
5996
6003
|
{
|
|
5997
|
-
className:
|
|
6004
|
+
className: N(
|
|
5998
6005
|
`inline-block h-6 w-6 transform rounded-full
|
|
5999
6006
|
transition-transform duration-200 ease-in-out
|
|
6000
6007
|
shadow`,
|
|
@@ -6033,71 +6040,71 @@ const oi = ({
|
|
|
6033
6040
|
maxTags: c,
|
|
6034
6041
|
validateTag: l
|
|
6035
6042
|
}) => {
|
|
6036
|
-
const [u, f] = z(""), [m, b] = z(!1), [h,
|
|
6043
|
+
const [u, f] = z(""), [m, b] = z(!1), [h, g] = z(null), v = T(null), E = T(null), S = T([]), _ = n.length > 0, D = T(
|
|
6037
6044
|
`taginput-${Math.random().toString(36).substr(2, 9)}`
|
|
6038
|
-
).current,
|
|
6045
|
+
).current, P = T(
|
|
6039
6046
|
`label-${Math.random().toString(36).substr(2, 9)}`
|
|
6040
|
-
).current,
|
|
6047
|
+
).current, x = T(
|
|
6041
6048
|
`error-${Math.random().toString(36).substr(2, 9)}`
|
|
6042
6049
|
).current;
|
|
6043
6050
|
B(() => {
|
|
6044
6051
|
S.current = S.current.slice(0, n.length);
|
|
6045
6052
|
}, [n.length]);
|
|
6046
|
-
const
|
|
6047
|
-
if (
|
|
6048
|
-
|
|
6049
|
-
const
|
|
6053
|
+
const k = (C) => {
|
|
6054
|
+
if (C.key === "Enter" && u.trim()) {
|
|
6055
|
+
C.preventDefault();
|
|
6056
|
+
const W = u.trim();
|
|
6050
6057
|
if (c && n.length >= c) {
|
|
6051
|
-
|
|
6058
|
+
g(`Maximum of ${c} tags allowed`);
|
|
6052
6059
|
return;
|
|
6053
6060
|
}
|
|
6054
|
-
if (n.includes(
|
|
6055
|
-
|
|
6061
|
+
if (n.includes(W)) {
|
|
6062
|
+
g("Tag already exists");
|
|
6056
6063
|
return;
|
|
6057
6064
|
}
|
|
6058
6065
|
if (l) {
|
|
6059
|
-
const j = l(
|
|
6066
|
+
const j = l(W);
|
|
6060
6067
|
if (typeof j == "string") {
|
|
6061
|
-
|
|
6068
|
+
g(j);
|
|
6062
6069
|
return;
|
|
6063
6070
|
} else if (j === !1) {
|
|
6064
|
-
|
|
6071
|
+
g("Invalid tag");
|
|
6065
6072
|
return;
|
|
6066
6073
|
}
|
|
6067
6074
|
}
|
|
6068
|
-
o([...n,
|
|
6069
|
-
} else if (
|
|
6070
|
-
const
|
|
6071
|
-
o(n.slice(0, -1)),
|
|
6072
|
-
} else
|
|
6073
|
-
}, L = (
|
|
6074
|
-
if (
|
|
6075
|
-
|
|
6076
|
-
const j = n[
|
|
6077
|
-
X.splice(
|
|
6078
|
-
|
|
6079
|
-
}, 0),
|
|
6080
|
-
} else
|
|
6081
|
-
},
|
|
6082
|
-
o(n.filter((j) => j !==
|
|
6083
|
-
|
|
6084
|
-
}, 0),
|
|
6085
|
-
}, $ = (
|
|
6086
|
-
f(
|
|
6075
|
+
o([...n, W]), f(""), g(null), M(`Added tag ${W}`);
|
|
6076
|
+
} else if (C.key === "Backspace" && !u && n.length > 0) {
|
|
6077
|
+
const W = n[n.length - 1];
|
|
6078
|
+
o(n.slice(0, -1)), M(`Removed tag ${W}`);
|
|
6079
|
+
} else C.key === "ArrowLeft" && u === "" && n.length > 0 && S.current[n.length - 1] && S.current[n.length - 1]?.focus();
|
|
6080
|
+
}, L = (C, W) => {
|
|
6081
|
+
if (C.key === "Backspace" || C.key === "Delete") {
|
|
6082
|
+
C.preventDefault();
|
|
6083
|
+
const j = n[W], X = [...n];
|
|
6084
|
+
X.splice(W, 1), o(X), setTimeout(() => {
|
|
6085
|
+
v.current && v.current.focus();
|
|
6086
|
+
}, 0), M(`Removed tag ${j}`);
|
|
6087
|
+
} else C.key === "ArrowRight" ? (C.preventDefault(), W < n.length - 1 ? S.current[W + 1]?.focus() : v.current?.focus()) : C.key === "ArrowLeft" && (C.preventDefault(), W > 0 && S.current[W - 1]?.focus());
|
|
6088
|
+
}, Y = (C, W) => {
|
|
6089
|
+
o(n.filter((j) => j !== C)), setTimeout(() => {
|
|
6090
|
+
W < n.length - 1 ? S.current[W]?.focus() : W > 0 ? S.current[W - 1]?.focus() : v.current?.focus();
|
|
6091
|
+
}, 0), M(`Removed tag ${C}`);
|
|
6092
|
+
}, $ = (C) => {
|
|
6093
|
+
f(C.target.value), g(null);
|
|
6087
6094
|
}, p = () => {
|
|
6088
|
-
|
|
6089
|
-
},
|
|
6090
|
-
console.log(`Accessibility announcement: ${
|
|
6095
|
+
v.current && v.current.focus();
|
|
6096
|
+
}, M = (C) => {
|
|
6097
|
+
console.log(`Accessibility announcement: ${C}`);
|
|
6091
6098
|
};
|
|
6092
|
-
return /* @__PURE__ */
|
|
6093
|
-
/* @__PURE__ */
|
|
6094
|
-
t === "default" ? /* @__PURE__ */
|
|
6099
|
+
return /* @__PURE__ */ y("div", { children: [
|
|
6100
|
+
/* @__PURE__ */ y("div", { className: "relative", ref: E, children: [
|
|
6101
|
+
t === "default" ? /* @__PURE__ */ y(
|
|
6095
6102
|
"label",
|
|
6096
6103
|
{
|
|
6097
|
-
id:
|
|
6098
|
-
htmlFor:
|
|
6099
|
-
className:
|
|
6100
|
-
"text-sm top-2 left-2": m ||
|
|
6104
|
+
id: P,
|
|
6105
|
+
htmlFor: D,
|
|
6106
|
+
className: N("text-base top-4 font-semibold left-3", {
|
|
6107
|
+
"text-sm top-2 left-2": m || _ || i,
|
|
6101
6108
|
"text-red-9": !!s
|
|
6102
6109
|
}),
|
|
6103
6110
|
children: [
|
|
@@ -6107,10 +6114,10 @@ const oi = ({
|
|
|
6107
6114
|
]
|
|
6108
6115
|
}
|
|
6109
6116
|
) : null,
|
|
6110
|
-
/* @__PURE__ */
|
|
6117
|
+
/* @__PURE__ */ y(
|
|
6111
6118
|
"div",
|
|
6112
6119
|
{
|
|
6113
|
-
className:
|
|
6120
|
+
className: N("rounded-6 px-2 transition cursor-text pr-10", {
|
|
6114
6121
|
"bg-base-3": r === "solid",
|
|
6115
6122
|
"border border-uielborder focus-visible:border-transparent": r === "outline",
|
|
6116
6123
|
"py-3": t === "default",
|
|
@@ -6121,19 +6128,19 @@ const oi = ({
|
|
|
6121
6128
|
}),
|
|
6122
6129
|
onClick: p,
|
|
6123
6130
|
role: "group",
|
|
6124
|
-
"aria-labelledby":
|
|
6125
|
-
"aria-describedby": s || h ?
|
|
6131
|
+
"aria-labelledby": P,
|
|
6132
|
+
"aria-describedby": s || h ? x : void 0,
|
|
6126
6133
|
children: [
|
|
6127
|
-
t === "floating" ? /* @__PURE__ */
|
|
6134
|
+
t === "floating" ? /* @__PURE__ */ y(
|
|
6128
6135
|
"label",
|
|
6129
6136
|
{
|
|
6130
|
-
id:
|
|
6131
|
-
htmlFor:
|
|
6132
|
-
className:
|
|
6137
|
+
id: P,
|
|
6138
|
+
htmlFor: D,
|
|
6139
|
+
className: N(
|
|
6133
6140
|
"absolute transition-all duration-200 pointer-events-none",
|
|
6134
6141
|
"text-base top-4 font-semibold left-3",
|
|
6135
6142
|
{
|
|
6136
|
-
"text-sm top-2 left-2": m ||
|
|
6143
|
+
"text-sm top-2 left-2": m || _ || i,
|
|
6137
6144
|
"text-red-9": !!s
|
|
6138
6145
|
}
|
|
6139
6146
|
),
|
|
@@ -6144,20 +6151,20 @@ const oi = ({
|
|
|
6144
6151
|
]
|
|
6145
6152
|
}
|
|
6146
6153
|
) : null,
|
|
6147
|
-
/* @__PURE__ */
|
|
6154
|
+
/* @__PURE__ */ y(
|
|
6148
6155
|
"div",
|
|
6149
6156
|
{
|
|
6150
|
-
className:
|
|
6157
|
+
className: N("flex flex-wrap gap-1 items-center", {
|
|
6151
6158
|
"mt-2.5": t === "floating"
|
|
6152
6159
|
}),
|
|
6153
6160
|
children: [
|
|
6154
|
-
n.map((
|
|
6161
|
+
n.map((C, W) => /* @__PURE__ */ y(
|
|
6155
6162
|
"div",
|
|
6156
6163
|
{
|
|
6157
6164
|
ref: (j) => {
|
|
6158
|
-
S.current[
|
|
6165
|
+
S.current[W] = j;
|
|
6159
6166
|
},
|
|
6160
|
-
className:
|
|
6167
|
+
className: N(
|
|
6161
6168
|
"line-clamp-1 text-brand rounded-full px-2 text-sm flex items-center",
|
|
6162
6169
|
{
|
|
6163
6170
|
"bg-brandfadedbg text-brand": !s && !h,
|
|
@@ -6166,41 +6173,41 @@ const oi = ({
|
|
|
6166
6173
|
),
|
|
6167
6174
|
tabIndex: 0,
|
|
6168
6175
|
role: "button",
|
|
6169
|
-
"aria-label": `${
|
|
6170
|
-
onKeyDown: (j) => L(j,
|
|
6176
|
+
"aria-label": `${C}, press delete or backspace to remove`,
|
|
6177
|
+
onKeyDown: (j) => L(j, W),
|
|
6171
6178
|
children: [
|
|
6172
|
-
|
|
6179
|
+
C,
|
|
6173
6180
|
/* @__PURE__ */ d(
|
|
6174
6181
|
"button",
|
|
6175
6182
|
{
|
|
6176
6183
|
type: "button",
|
|
6177
6184
|
className: "ml-1 text-brand hover:text-brandhover shrink-0",
|
|
6178
|
-
onClick: () =>
|
|
6179
|
-
"aria-label": `Remove ${
|
|
6185
|
+
onClick: () => Y(C, W),
|
|
6186
|
+
"aria-label": `Remove ${C} tag`,
|
|
6180
6187
|
children: "x"
|
|
6181
6188
|
}
|
|
6182
6189
|
)
|
|
6183
6190
|
]
|
|
6184
6191
|
},
|
|
6185
|
-
`${
|
|
6192
|
+
`${C}-${W}`
|
|
6186
6193
|
)),
|
|
6187
6194
|
/* @__PURE__ */ d(
|
|
6188
6195
|
"input",
|
|
6189
6196
|
{
|
|
6190
|
-
id:
|
|
6191
|
-
ref:
|
|
6197
|
+
id: D,
|
|
6198
|
+
ref: v,
|
|
6192
6199
|
type: "text",
|
|
6193
6200
|
className: "flex-grow min-w-[60px] bg-transparent outline-none placeholder:text-sm placeholder:text-secondarytext",
|
|
6194
6201
|
value: u,
|
|
6195
6202
|
onChange: $,
|
|
6196
|
-
onKeyDown:
|
|
6203
|
+
onKeyDown: k,
|
|
6197
6204
|
onFocus: () => b(!0),
|
|
6198
6205
|
onBlur: () => b(!1),
|
|
6199
6206
|
enterKeyHint: "enter",
|
|
6200
6207
|
autoComplete: "off",
|
|
6201
6208
|
placeholder: n.length > 0 ? "" : i,
|
|
6202
6209
|
style: { width: `${Math.max(60, u.length * 8)}px` },
|
|
6203
|
-
"aria-describedby": s || h ?
|
|
6210
|
+
"aria-describedby": s || h ? x : void 0,
|
|
6204
6211
|
"aria-invalid": !!(s || h)
|
|
6205
6212
|
}
|
|
6206
6213
|
)
|
|
@@ -6215,7 +6222,7 @@ const oi = ({
|
|
|
6215
6222
|
(s || h) && /* @__PURE__ */ d(
|
|
6216
6223
|
"p",
|
|
6217
6224
|
{
|
|
6218
|
-
id:
|
|
6225
|
+
id: x,
|
|
6219
6226
|
className: "text-red-500 text-xs mt-1",
|
|
6220
6227
|
"aria-live": "assertive",
|
|
6221
6228
|
children: s || h
|
|
@@ -6240,7 +6247,7 @@ const oi = ({
|
|
|
6240
6247
|
}
|
|
6241
6248
|
)
|
|
6242
6249
|
}
|
|
6243
|
-
) : (console.error(`Form control is missing for field: ${e}`), /* @__PURE__ */
|
|
6250
|
+
) : (console.error(`Form control is missing for field: ${e}`), /* @__PURE__ */ y("p", { children: [
|
|
6244
6251
|
"Form control missing for field: ",
|
|
6245
6252
|
e
|
|
6246
6253
|
] }));
|
|
@@ -6260,28 +6267,28 @@ const oi = ({
|
|
|
6260
6267
|
...c
|
|
6261
6268
|
}, l) => {
|
|
6262
6269
|
const [u, f] = z(!1), m = s !== "" && s !== null && s !== void 0;
|
|
6263
|
-
return /* @__PURE__ */
|
|
6270
|
+
return /* @__PURE__ */ y("div", { className: "relative", children: [
|
|
6264
6271
|
t === "default" ? /* @__PURE__ */ d(
|
|
6265
6272
|
"label",
|
|
6266
6273
|
{
|
|
6267
|
-
className:
|
|
6274
|
+
className: N(
|
|
6268
6275
|
"top-[18px] font-medium ml-0.5 text-xs",
|
|
6269
6276
|
n && "text-red-9"
|
|
6270
6277
|
),
|
|
6271
6278
|
children: e
|
|
6272
6279
|
}
|
|
6273
6280
|
) : null,
|
|
6274
|
-
/* @__PURE__ */
|
|
6281
|
+
/* @__PURE__ */ y(
|
|
6275
6282
|
"div",
|
|
6276
6283
|
{
|
|
6277
|
-
className:
|
|
6284
|
+
className: N(t === "default" ? "p-0" : "pt-5 pb-2", {
|
|
6278
6285
|
"bg-red-4 text-red-9": !!n
|
|
6279
6286
|
}),
|
|
6280
6287
|
children: [
|
|
6281
6288
|
t === "floating" && /* @__PURE__ */ d(
|
|
6282
6289
|
"label",
|
|
6283
6290
|
{
|
|
6284
|
-
className:
|
|
6291
|
+
className: N(
|
|
6285
6292
|
"absolute transition-all duration-200 pointer-events-none",
|
|
6286
6293
|
"text-sm top-2.5 font-semibold left-2.5",
|
|
6287
6294
|
{
|
|
@@ -6296,7 +6303,7 @@ const oi = ({
|
|
|
6296
6303
|
"textarea",
|
|
6297
6304
|
{
|
|
6298
6305
|
ref: l,
|
|
6299
|
-
className:
|
|
6306
|
+
className: N(
|
|
6300
6307
|
!n && u && ai[o],
|
|
6301
6308
|
"bg-base-3 border border-base-4 light-theme:drop-shadow-sm rounded-6 w-full focus-visible:outline-none customscrollbarnohide",
|
|
6302
6309
|
"placeholder:text-base-11 text-sm",
|
|
@@ -6342,7 +6349,7 @@ const sl = ({
|
|
|
6342
6349
|
{
|
|
6343
6350
|
name: e,
|
|
6344
6351
|
control: o,
|
|
6345
|
-
render: ({ field: i, fieldState: c }) => /* @__PURE__ */
|
|
6352
|
+
render: ({ field: i, fieldState: c }) => /* @__PURE__ */ y("div", { children: [
|
|
6346
6353
|
/* @__PURE__ */ d(
|
|
6347
6354
|
gn,
|
|
6348
6355
|
{
|
|
@@ -6356,7 +6363,7 @@ const sl = ({
|
|
|
6356
6363
|
c.error ? /* @__PURE__ */ d("span", { role: "alert", className: "text-red-9 text-sm mt-1 ml-0.5", children: c.error.message }) : null
|
|
6357
6364
|
] })
|
|
6358
6365
|
}
|
|
6359
|
-
) : (console.error(`Form control is missing for field: ${e}`), /* @__PURE__ */
|
|
6366
|
+
) : (console.error(`Form control is missing for field: ${e}`), /* @__PURE__ */ y("p", { children: [
|
|
6360
6367
|
"Form control missing for field: ",
|
|
6361
6368
|
e
|
|
6362
6369
|
] }));
|
|
@@ -6372,16 +6379,16 @@ const sl = ({
|
|
|
6372
6379
|
const [t, r] = z(!1), n = T(null);
|
|
6373
6380
|
return B(() => {
|
|
6374
6381
|
n.current && bn(n.current);
|
|
6375
|
-
}, []), /* @__PURE__ */
|
|
6382
|
+
}, []), /* @__PURE__ */ y(
|
|
6376
6383
|
"div",
|
|
6377
6384
|
{
|
|
6378
6385
|
ref: n,
|
|
6379
|
-
className:
|
|
6386
|
+
className: N("p-2 rounded-xl mt-2", {
|
|
6380
6387
|
"border border-uielborder": t,
|
|
6381
6388
|
"bg-uielbg border border-transparent": !t
|
|
6382
6389
|
}),
|
|
6383
6390
|
children: [
|
|
6384
|
-
/* @__PURE__ */
|
|
6391
|
+
/* @__PURE__ */ y("div", { className: "flex items-center justify-between", children: [
|
|
6385
6392
|
/* @__PURE__ */ d("p", { children: e }),
|
|
6386
6393
|
/* @__PURE__ */ d(
|
|
6387
6394
|
ni,
|
|
@@ -6404,8 +6411,8 @@ const sl = ({
|
|
|
6404
6411
|
]), r = T(null);
|
|
6405
6412
|
return B(() => {
|
|
6406
6413
|
r.current && bn(r.current);
|
|
6407
|
-
}, []), /* @__PURE__ */
|
|
6408
|
-
e.map((n, o) => /* @__PURE__ */
|
|
6414
|
+
}, []), /* @__PURE__ */ y("div", { ref: r, children: [
|
|
6415
|
+
e.map((n, o) => /* @__PURE__ */ y(
|
|
6409
6416
|
"div",
|
|
6410
6417
|
{
|
|
6411
6418
|
className: "flex items-center justify-between mt-2",
|
|
@@ -6419,7 +6426,7 @@ const sl = ({
|
|
|
6419
6426
|
},
|
|
6420
6427
|
`${n.from}${o}`
|
|
6421
6428
|
)),
|
|
6422
|
-
/* @__PURE__ */
|
|
6429
|
+
/* @__PURE__ */ y(
|
|
6423
6430
|
J,
|
|
6424
6431
|
{
|
|
6425
6432
|
onClick: () => t((n) => [...n, { from: "19:00", to: "21:00" }]),
|
|
@@ -6480,7 +6487,7 @@ export {
|
|
|
6480
6487
|
Ai as TimePicker,
|
|
6481
6488
|
Hn as calculatePopoverPosition,
|
|
6482
6489
|
st as checkOverflow,
|
|
6483
|
-
|
|
6490
|
+
N as cn,
|
|
6484
6491
|
Ni as debounce,
|
|
6485
6492
|
$i as extractDirtyData,
|
|
6486
6493
|
_n as generateInitials,
|