@matthiaskrijgsman/mat-ui 0.0.45 → 0.0.47
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.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e, jsxs as d, Fragment as ne } from "react/jsx-runtime";
|
|
3
|
-
import * as
|
|
4
|
-
import { createContext as Qe, useContext as Ze, useEffect as
|
|
3
|
+
import * as k from "react";
|
|
4
|
+
import { createContext as Qe, useContext as Ze, useEffect as j, useState as W, useRef as Ce, useCallback as Pe, useLayoutEffect as St, useMemo as se } from "react";
|
|
5
5
|
import { AnimatePresence as De, motion as Y, animate as qt } from "motion/react";
|
|
6
6
|
import { IconExclamationCircleFilled as et, IconEyeOff as Jt, IconEye as Yt, IconPaperclip as Qt, IconCircleCheckFilled as tt, IconX as de, IconCloudUpload as Zt, IconCheck as Dt, IconChevronDown as ve, IconBold as en, IconItalic as tn, IconUnderline as nn, IconList as Je, IconListNumbers as rn, IconLink as on, IconArrowBackUp as an, IconArrowForwardUp as ln, IconDots as sn, IconSearch as Fe, IconSearchOff as nt, IconInfoCircleFilled as cn, IconAlertTriangleFilled as dn, IconChevronRight as un, IconChevronUp as hn, IconSettings as mt, IconPlus as pt, IconTrash as fn, IconMailFilled as mn } from "@tabler/icons-react";
|
|
7
7
|
import { FloatingPortal as Me, flip as rt, shift as ot, size as at, useFloating as lt, autoUpdate as it, useDismiss as zt, useInteractions as Ot, offset as pn, useListNavigation as gn, FloatingOverlay as Tt } from "@floating-ui/react";
|
|
@@ -10,8 +10,8 @@ import { useDropzone as Pt } from "react-dropzone";
|
|
|
10
10
|
import { LexicalComposer as bn } from "@lexical/react/LexicalComposer";
|
|
11
11
|
import { RichTextPlugin as xn } from "@lexical/react/LexicalRichTextPlugin";
|
|
12
12
|
import { ContentEditable as wn } from "@lexical/react/LexicalContentEditable";
|
|
13
|
-
import { HistoryPlugin as
|
|
14
|
-
import { ListPlugin as
|
|
13
|
+
import { HistoryPlugin as Nn } from "@lexical/react/LexicalHistoryPlugin";
|
|
14
|
+
import { ListPlugin as yn } from "@lexical/react/LexicalListPlugin";
|
|
15
15
|
import { LinkPlugin as kn } from "@lexical/react/LexicalLinkPlugin";
|
|
16
16
|
import { OnChangePlugin as Cn } from "@lexical/react/LexicalOnChangePlugin";
|
|
17
17
|
import { AutoFocusPlugin as In } from "@lexical/react/LexicalAutoFocusPlugin";
|
|
@@ -23,7 +23,7 @@ import { useLexicalComposerContext as ue } from "@lexical/react/LexicalComposerC
|
|
|
23
23
|
import { CAN_UNDO_COMMAND as Mn, COMMAND_PRIORITY_LOW as Le, CAN_REDO_COMMAND as Bn, $getSelection as Et, $isRangeSelection as Ft, $createParagraphNode as An, FORMAT_TEXT_COMMAND as je, UNDO_COMMAND as Un, REDO_COMMAND as Wn, FOCUS_COMMAND as Hn, BLUR_COMMAND as $n } from "lexical";
|
|
24
24
|
import { mergeRegister as Mt, $getNearestNodeOfType as _n } from "@lexical/utils";
|
|
25
25
|
import { $setBlocksType as xt } from "@lexical/selection";
|
|
26
|
-
const
|
|
26
|
+
const h = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
27
27
|
"polygon(50% 50%,0 0,0 0,0 0,0 0,0 0)",
|
|
28
28
|
"polygon(50% 50%,0 0,100% 0,100% 0,100% 0,100% 0)",
|
|
29
29
|
"polygon(50% 50%,0 0,100% 0,100% 100%,100% 100%,100% 100%)",
|
|
@@ -38,7 +38,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
38
38
|
Y.div,
|
|
39
39
|
{
|
|
40
40
|
role: "status",
|
|
41
|
-
className:
|
|
41
|
+
className: h("relative rounded-full", l),
|
|
42
42
|
animate: { rotate: 360 },
|
|
43
43
|
transition: { repeat: 1 / 0, ease: "linear", duration: a },
|
|
44
44
|
children: /* @__PURE__ */ e(
|
|
@@ -130,7 +130,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
130
130
|
white: "border-[length:var(--border-width-input)] button-white shadow-[var(--shadow-control)]",
|
|
131
131
|
black: "border-[length:var(--border-width-input)] button-black shadow-[var(--shadow-control)]",
|
|
132
132
|
transparent: "border-[length:var(--border-width-input)] button-transparent"
|
|
133
|
-
}, Gn =
|
|
133
|
+
}, Gn = k.forwardRef((n, t) => {
|
|
134
134
|
const {
|
|
135
135
|
variant: l = "white",
|
|
136
136
|
size: a = "md",
|
|
@@ -139,13 +139,13 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
139
139
|
loading: i = !1,
|
|
140
140
|
Icon: s,
|
|
141
141
|
IconRight: c,
|
|
142
|
-
...
|
|
142
|
+
...g
|
|
143
143
|
} = n;
|
|
144
144
|
return /* @__PURE__ */ d(
|
|
145
145
|
"button",
|
|
146
146
|
{
|
|
147
147
|
ref: t,
|
|
148
|
-
className:
|
|
148
|
+
className: h(
|
|
149
149
|
Vn,
|
|
150
150
|
Kn[l],
|
|
151
151
|
Q[a],
|
|
@@ -154,13 +154,13 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
154
154
|
st[a],
|
|
155
155
|
r
|
|
156
156
|
),
|
|
157
|
-
...
|
|
157
|
+
...g,
|
|
158
158
|
children: [
|
|
159
|
-
i && /* @__PURE__ */ e(Se, { className:
|
|
159
|
+
i && /* @__PURE__ */ e(Se, { className: h(ee[a]) }),
|
|
160
160
|
!i && /* @__PURE__ */ d(ne, { children: [
|
|
161
|
-
s && /* @__PURE__ */ e(s, { className:
|
|
161
|
+
s && /* @__PURE__ */ e(s, { className: h(ee[a], "-ml-1") }),
|
|
162
162
|
o,
|
|
163
|
-
c && /* @__PURE__ */ e(c, { className:
|
|
163
|
+
c && /* @__PURE__ */ e(c, { className: h(ee[a], "-mr-1") })
|
|
164
164
|
] })
|
|
165
165
|
]
|
|
166
166
|
}
|
|
@@ -178,7 +178,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
178
178
|
white: "border-[length:var(--border-width-input)] button-white shadow-[var(--shadow-control)]",
|
|
179
179
|
black: "border-[length:var(--border-width-input)] button-black shadow-[var(--shadow-control)]",
|
|
180
180
|
transparent: "border-[length:var(--border-width-input)] button-transparent"
|
|
181
|
-
}, Ye =
|
|
181
|
+
}, Ye = k.forwardRef((n, t) => {
|
|
182
182
|
const {
|
|
183
183
|
variant: l = "white",
|
|
184
184
|
size: a = "md",
|
|
@@ -190,7 +190,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
190
190
|
"button",
|
|
191
191
|
{
|
|
192
192
|
ref: t,
|
|
193
|
-
className:
|
|
193
|
+
className: h(
|
|
194
194
|
qn,
|
|
195
195
|
Jn[l],
|
|
196
196
|
Wt[a],
|
|
@@ -211,7 +211,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
211
211
|
white: "border-[length:var(--border-width-input)] button-white shadow-[var(--shadow-control)]",
|
|
212
212
|
black: "border-[length:var(--border-width-input)] button-black shadow-[var(--shadow-control)]",
|
|
213
213
|
transparent: "border-[length:var(--border-width-input)] button-transparent"
|
|
214
|
-
}, Ht =
|
|
214
|
+
}, Ht = k.forwardRef((n, t) => {
|
|
215
215
|
const {
|
|
216
216
|
variant: l = "white",
|
|
217
217
|
size: a = "md",
|
|
@@ -223,7 +223,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
223
223
|
"button",
|
|
224
224
|
{
|
|
225
225
|
ref: t,
|
|
226
|
-
className:
|
|
226
|
+
className: h(
|
|
227
227
|
Yn,
|
|
228
228
|
Qn[l],
|
|
229
229
|
Wt[a],
|
|
@@ -238,7 +238,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
238
238
|
children: t
|
|
239
239
|
} = n;
|
|
240
240
|
return t ? /* @__PURE__ */ e("label", { className: "input-label font-[number:var(--font-weight-input-label)] mb-1", children: t }) : null;
|
|
241
|
-
}, oe = () => /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(et, { className: "h-5 w-5 input-error-icon" }) }), q = Qe("md"), Zn = () => Ze(q), me =
|
|
241
|
+
}, oe = () => /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(et, { className: "h-5 w-5 input-error-icon" }) }), q = Qe("md"), Zn = () => Ze(q), me = k.forwardRef((n, t) => {
|
|
242
242
|
const {
|
|
243
243
|
children: l,
|
|
244
244
|
className: a
|
|
@@ -247,7 +247,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
247
247
|
"div",
|
|
248
248
|
{
|
|
249
249
|
ref: t,
|
|
250
|
-
className:
|
|
250
|
+
className: h(
|
|
251
251
|
"absolute top-1/2 -translate-y-1/2 flex flex-row items-center gap-1 pointer-events-none",
|
|
252
252
|
Xn[r],
|
|
253
253
|
a
|
|
@@ -275,18 +275,18 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
275
275
|
buttonTray: i,
|
|
276
276
|
size: s = "md",
|
|
277
277
|
...c
|
|
278
|
-
} = n,
|
|
278
|
+
} = n, g = !!o || !!i;
|
|
279
279
|
return /* @__PURE__ */ e(q.Provider, { value: s, children: /* @__PURE__ */ d(
|
|
280
280
|
"div",
|
|
281
281
|
{
|
|
282
|
-
className:
|
|
282
|
+
className: h(
|
|
283
283
|
"flex flex-col",
|
|
284
284
|
t
|
|
285
285
|
),
|
|
286
286
|
children: [
|
|
287
287
|
/* @__PURE__ */ e(Z, { children: l }),
|
|
288
288
|
/* @__PURE__ */ d("div", { className: "flex flex-col relative", children: [
|
|
289
|
-
r && /* @__PURE__ */ e(r, { className:
|
|
289
|
+
r && /* @__PURE__ */ e(r, { className: h(
|
|
290
290
|
"input-icon absolute top-1/2 -translate-y-1/2",
|
|
291
291
|
ee[s],
|
|
292
292
|
Ut[s]
|
|
@@ -294,12 +294,12 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
294
294
|
/* @__PURE__ */ e(
|
|
295
295
|
"input",
|
|
296
296
|
{
|
|
297
|
-
className:
|
|
297
|
+
className: h(
|
|
298
298
|
"border-[length:var(--border-width-input)] input-base transition-all duration-[var(--control-transition-duration)] rounded-[var(--border-radius-input)] shadow-[var(--shadow-control)] ring-0 focus:ring-[length:var(--control-ring-width)] focus:outline-none font-[number:var(--font-weight-input-text)] font-[family-name:var(--font-family-base)]",
|
|
299
299
|
Q[s],
|
|
300
300
|
G[s],
|
|
301
301
|
r ? At[s] : he[s],
|
|
302
|
-
|
|
302
|
+
g ? fe[s] : dt[s],
|
|
303
303
|
o && "input-error"
|
|
304
304
|
),
|
|
305
305
|
...c
|
|
@@ -331,8 +331,8 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
331
331
|
const a = l * t, r = n / 60, o = a * (1 - Math.abs(r % 2 - 1));
|
|
332
332
|
let i = 0, s = 0, c = 0;
|
|
333
333
|
r < 1 ? (i = a, s = o) : r < 2 ? (i = o, s = a) : r < 3 ? (s = a, c = o) : r < 4 ? (s = o, c = a) : r < 5 ? (i = o, c = a) : (i = a, c = o);
|
|
334
|
-
const
|
|
335
|
-
return [i +
|
|
334
|
+
const g = l - a;
|
|
335
|
+
return [i + g, s + g, c + g];
|
|
336
336
|
}, Re = (n, t, l) => {
|
|
337
337
|
const [a, r, o] = rr(n, t, l);
|
|
338
338
|
return tr(a, r, o);
|
|
@@ -356,7 +356,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
356
356
|
const o = r.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
|
|
357
357
|
return o ? "#" + [o[1], o[2], o[3]].map((i) => parseInt(i, 10).toString(16).padStart(2, "0")).join("").toUpperCase() : null;
|
|
358
358
|
}, Xe = (n) => {
|
|
359
|
-
const t =
|
|
359
|
+
const t = k.useRef(null), [l, a] = k.useState(!1), r = (o) => {
|
|
360
360
|
t.current = null, a(!1), o.currentTarget.releasePointerCapture?.(o.pointerId);
|
|
361
361
|
};
|
|
362
362
|
return {
|
|
@@ -387,7 +387,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
387
387
|
return /* @__PURE__ */ e(
|
|
388
388
|
"div",
|
|
389
389
|
{
|
|
390
|
-
className:
|
|
390
|
+
className: h(ar, lr[a], t),
|
|
391
391
|
...r,
|
|
392
392
|
children: l
|
|
393
393
|
}
|
|
@@ -405,7 +405,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
405
405
|
left: "right center",
|
|
406
406
|
"left-start": "top right",
|
|
407
407
|
"left-end": "bottom right"
|
|
408
|
-
}, _t =
|
|
408
|
+
}, _t = k.memo(
|
|
409
409
|
({ open: n, children: t, className: l, floatingStyles: a, setFloating: r, placement: o, floatingProps: i }) => /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ e(De, { children: n && /* @__PURE__ */ e("div", { ref: r, style: a, className: "z-50", ...i, children: /* @__PURE__ */ e(
|
|
410
410
|
Y.div,
|
|
411
411
|
{
|
|
@@ -419,15 +419,15 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
419
419
|
}
|
|
420
420
|
) }) }) })
|
|
421
421
|
), ut = (n) => {
|
|
422
|
-
const { placement: t = "bottom", open: l, onOpenChange: a, fullWidth: r, minWidth: o, maxWidth: i } = n, s =
|
|
422
|
+
const { placement: t = "bottom", open: l, onOpenChange: a, fullWidth: r, minWidth: o, maxWidth: i } = n, s = k.useMemo(() => [
|
|
423
423
|
rt({ padding: 8 }),
|
|
424
424
|
ot({ padding: 8 }),
|
|
425
425
|
at({
|
|
426
|
-
apply({ rects:
|
|
427
|
-
r && (I.floating.style.width = `${
|
|
426
|
+
apply({ rects: u, elements: I }) {
|
|
427
|
+
r && (I.floating.style.width = `${u.reference.width}px`), o && (I.floating.style.minWidth = `${o}px`), i && (I.floating.style.maxWidth = `${i}px`);
|
|
428
428
|
}
|
|
429
429
|
})
|
|
430
|
-
], [r, i, o]), { refs: c, floatingStyles:
|
|
430
|
+
], [r, i, o]), { refs: c, floatingStyles: g, context: R, placement: w } = lt({
|
|
431
431
|
placement: t,
|
|
432
432
|
open: l,
|
|
433
433
|
onOpenChange: a,
|
|
@@ -437,42 +437,42 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
437
437
|
enabled: !!a,
|
|
438
438
|
outsidePress: !0,
|
|
439
439
|
escapeKey: !1
|
|
440
|
-
}), { getFloatingProps:
|
|
441
|
-
floatingStyles:
|
|
440
|
+
}), { getFloatingProps: v } = Ot([m]), f = k.useRef({
|
|
441
|
+
floatingStyles: g,
|
|
442
442
|
setFloating: c.setFloating,
|
|
443
443
|
placement: t,
|
|
444
|
-
getFloatingProps:
|
|
444
|
+
getFloatingProps: v
|
|
445
445
|
});
|
|
446
446
|
f.current = {
|
|
447
|
-
floatingStyles:
|
|
447
|
+
floatingStyles: g,
|
|
448
448
|
setFloating: c.setFloating,
|
|
449
|
-
placement:
|
|
450
|
-
getFloatingProps:
|
|
449
|
+
placement: w,
|
|
450
|
+
getFloatingProps: v
|
|
451
451
|
};
|
|
452
|
-
const p =
|
|
453
|
-
const
|
|
454
|
-
const { floatingStyles:
|
|
452
|
+
const p = k.useMemo(() => {
|
|
453
|
+
const u = (I) => {
|
|
454
|
+
const { floatingStyles: b, setFloating: N, placement: y, getFloatingProps: S } = f.current, { className: z, open: L, children: P } = I;
|
|
455
455
|
return /* @__PURE__ */ e(
|
|
456
456
|
_t,
|
|
457
457
|
{
|
|
458
458
|
open: L,
|
|
459
459
|
className: z,
|
|
460
|
-
floatingStyles:
|
|
460
|
+
floatingStyles: b,
|
|
461
461
|
setFloating: N,
|
|
462
|
-
placement:
|
|
462
|
+
placement: y,
|
|
463
463
|
floatingProps: S(),
|
|
464
|
-
children:
|
|
464
|
+
children: P
|
|
465
465
|
}
|
|
466
466
|
);
|
|
467
467
|
};
|
|
468
|
-
return
|
|
468
|
+
return k.memo(u);
|
|
469
469
|
}, []);
|
|
470
470
|
return {
|
|
471
471
|
anchorRef: c.setReference,
|
|
472
472
|
Popover: p
|
|
473
473
|
};
|
|
474
474
|
}, xe = (n, t) => {
|
|
475
|
-
|
|
475
|
+
j(() => {
|
|
476
476
|
if (!n) return;
|
|
477
477
|
const l = (a) => {
|
|
478
478
|
a.key === "Escape" && t();
|
|
@@ -481,7 +481,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
481
481
|
document.removeEventListener("keydown", l);
|
|
482
482
|
};
|
|
483
483
|
}, [n, t]);
|
|
484
|
-
}, sr = "linear-gradient(to right, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%)", cr = "linear-gradient(to right, #fff, rgba(255,255,255,0))", dr = "linear-gradient(to top, #000, rgba(0,0,0,0))", Ve = "0 0 0 1px rgba(0,0,0,0.15)", ur = 14, hr = 28, fr = 6, mr = 8, Ke = { type: "spring", stiffness: 500, damping: 18, mass: 0.6 },
|
|
484
|
+
}, sr = "linear-gradient(to right, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%)", cr = "linear-gradient(to right, #fff, rgba(255,255,255,0))", dr = "linear-gradient(to top, #000, rgba(0,0,0,0))", Ve = "0 0 0 1px rgba(0,0,0,0.15)", ur = 14, hr = 28, fr = 6, mr = 8, Ke = { type: "spring", stiffness: 500, damping: 18, mass: 0.6 }, ye = (n) => {
|
|
485
485
|
const t = n ? hr : ur, l = t / 2;
|
|
486
486
|
return {
|
|
487
487
|
width: t,
|
|
@@ -490,24 +490,24 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
490
490
|
marginTop: -l,
|
|
491
491
|
borderRadius: n ? mr : fr
|
|
492
492
|
};
|
|
493
|
-
}, Te = (n) => Math.max(0, Math.min(1, n)),
|
|
493
|
+
}, Te = (n) => Math.max(0, Math.min(1, n)), Nt = (n, t) => {
|
|
494
494
|
Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(n, t), n.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
495
495
|
}, pr = ({ value: n, onChange: t }) => {
|
|
496
496
|
const [l, a] = W(() => wt(n) ?? [0, 0, 1]), r = Ce(Re(l[0], l[1], l[2]));
|
|
497
|
-
|
|
497
|
+
j(() => {
|
|
498
498
|
if ((n || "").toUpperCase() === r.current) return;
|
|
499
499
|
const p = wt(n);
|
|
500
500
|
p && a(p);
|
|
501
501
|
}, [n]);
|
|
502
502
|
const o = (p) => {
|
|
503
503
|
a(p);
|
|
504
|
-
const
|
|
505
|
-
r.current =
|
|
506
|
-
}, [i, s, c] = l,
|
|
507
|
-
o([i, Te((p - I.left) / I.width), 1 - Te((
|
|
508
|
-
}),
|
|
504
|
+
const u = Re(p[0], p[1], p[2]);
|
|
505
|
+
r.current = u, t(u);
|
|
506
|
+
}, [i, s, c] = l, g = Re(i, 1, 1), R = Re(i, s, 1), w = Re(i, s, c), m = Xe((p, u, I) => {
|
|
507
|
+
o([i, Te((p - I.left) / I.width), 1 - Te((u - I.top) / I.height)]);
|
|
508
|
+
}), v = Xe((p, u, I) => {
|
|
509
509
|
o([Te((p - I.left) / I.width) * 360, s, c]);
|
|
510
|
-
}), f = Xe((p,
|
|
510
|
+
}), f = Xe((p, u, I) => {
|
|
511
511
|
o([i, s, Te((p - I.left) / I.width)]);
|
|
512
512
|
});
|
|
513
513
|
return /* @__PURE__ */ d(
|
|
@@ -532,7 +532,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
532
532
|
"div",
|
|
533
533
|
{
|
|
534
534
|
className: "absolute inset-0 rounded-[var(--border-radius-control-inner)] overflow-hidden border-[length:var(--border-width-input)] color-picker-surface",
|
|
535
|
-
style: { backgroundColor:
|
|
535
|
+
style: { backgroundColor: g },
|
|
536
536
|
children: [
|
|
537
537
|
/* @__PURE__ */ e(
|
|
538
538
|
"div",
|
|
@@ -559,10 +559,10 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
559
559
|
left: `${s * 100}%`,
|
|
560
560
|
top: `${(1 - c) * 100}%`,
|
|
561
561
|
boxShadow: Ve,
|
|
562
|
-
backgroundColor:
|
|
562
|
+
backgroundColor: w
|
|
563
563
|
},
|
|
564
|
-
initial:
|
|
565
|
-
animate:
|
|
564
|
+
initial: ye(!1),
|
|
565
|
+
animate: ye(m.isDragging),
|
|
566
566
|
transition: Ke
|
|
567
567
|
}
|
|
568
568
|
)
|
|
@@ -579,7 +579,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
579
579
|
touchAction: "none",
|
|
580
580
|
cursor: "ew-resize"
|
|
581
581
|
},
|
|
582
|
-
...
|
|
582
|
+
...v.bind,
|
|
583
583
|
children: /* @__PURE__ */ e(
|
|
584
584
|
Y.div,
|
|
585
585
|
{
|
|
@@ -587,11 +587,11 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
587
587
|
style: {
|
|
588
588
|
top: "50%",
|
|
589
589
|
left: `${i / 360 * 100}%`,
|
|
590
|
-
backgroundColor:
|
|
590
|
+
backgroundColor: g,
|
|
591
591
|
boxShadow: Ve
|
|
592
592
|
},
|
|
593
|
-
initial:
|
|
594
|
-
animate:
|
|
593
|
+
initial: ye(!1),
|
|
594
|
+
animate: ye(v.isDragging),
|
|
595
595
|
transition: Ke
|
|
596
596
|
}
|
|
597
597
|
)
|
|
@@ -615,11 +615,11 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
615
615
|
style: {
|
|
616
616
|
top: "50%",
|
|
617
617
|
left: `${c * 100}%`,
|
|
618
|
-
backgroundColor:
|
|
618
|
+
backgroundColor: w,
|
|
619
619
|
boxShadow: Ve
|
|
620
620
|
},
|
|
621
|
-
initial:
|
|
622
|
-
animate:
|
|
621
|
+
initial: ye(!1),
|
|
622
|
+
animate: ye(f.isDragging),
|
|
623
623
|
transition: Ke
|
|
624
624
|
}
|
|
625
625
|
)
|
|
@@ -638,42 +638,42 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
638
638
|
size: i = "md",
|
|
639
639
|
value: s,
|
|
640
640
|
defaultValue: c,
|
|
641
|
-
onChange:
|
|
641
|
+
onChange: g,
|
|
642
642
|
onBlur: R,
|
|
643
|
-
onFocus:
|
|
643
|
+
onFocus: w,
|
|
644
644
|
...m
|
|
645
|
-
} = n, [
|
|
645
|
+
} = n, [v, f] = W(
|
|
646
646
|
s != null ? String(s) : c != null ? String(c) : ""
|
|
647
|
-
), [p,
|
|
648
|
-
xe(p, () =>
|
|
649
|
-
const { anchorRef:
|
|
647
|
+
), [p, u] = W(!1), I = Ce(null), b = s != null ? String(s) : v, N = b || "white";
|
|
648
|
+
xe(p, () => u(!1));
|
|
649
|
+
const { anchorRef: y, Popover: S } = ut({
|
|
650
650
|
placement: "bottom-start",
|
|
651
651
|
open: p,
|
|
652
|
-
onOpenChange:
|
|
653
|
-
}), z = (
|
|
654
|
-
f(
|
|
655
|
-
}, L = (
|
|
656
|
-
|
|
657
|
-
},
|
|
658
|
-
const
|
|
659
|
-
|
|
660
|
-
}, O = (
|
|
661
|
-
I.current &&
|
|
662
|
-
},
|
|
652
|
+
onOpenChange: u
|
|
653
|
+
}), z = (C) => {
|
|
654
|
+
f(C.target.value), g?.(C);
|
|
655
|
+
}, L = (C) => {
|
|
656
|
+
u(!0), w?.(C);
|
|
657
|
+
}, P = (C) => {
|
|
658
|
+
const T = C.target.value, E = or(T);
|
|
659
|
+
E && E !== T && I.current && Nt(I.current, E), u(!1), R?.(C);
|
|
660
|
+
}, O = (C) => {
|
|
661
|
+
I.current && Nt(I.current, C);
|
|
662
|
+
}, x = !!r || !!o;
|
|
663
663
|
return /* @__PURE__ */ e(q.Provider, { value: i, children: /* @__PURE__ */ d(
|
|
664
664
|
"div",
|
|
665
665
|
{
|
|
666
|
-
className:
|
|
666
|
+
className: h(
|
|
667
667
|
"flex flex-col",
|
|
668
668
|
t
|
|
669
669
|
),
|
|
670
670
|
children: [
|
|
671
671
|
/* @__PURE__ */ e(Z, { children: l }),
|
|
672
|
-
/* @__PURE__ */ d("div", { className: "flex flex-col relative", ref:
|
|
672
|
+
/* @__PURE__ */ d("div", { className: "flex flex-col relative", ref: y, children: [
|
|
673
673
|
/* @__PURE__ */ e(
|
|
674
674
|
"div",
|
|
675
675
|
{
|
|
676
|
-
className:
|
|
676
|
+
className: h(
|
|
677
677
|
"absolute top-1/2 -translate-y-1/2 rounded-[var(--border-radius-control-inner)] border-[length:var(--border-width-input)] color-swatch",
|
|
678
678
|
ee[i],
|
|
679
679
|
Ut[i]
|
|
@@ -685,19 +685,19 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
685
685
|
"input",
|
|
686
686
|
{
|
|
687
687
|
ref: I,
|
|
688
|
-
className:
|
|
688
|
+
className: h(
|
|
689
689
|
"border-[length:var(--border-width-input)] input-base transition-all duration-[var(--control-transition-duration)] rounded-[var(--border-radius-input)] shadow-[var(--shadow-control)] ring-0 focus:ring-[length:var(--control-ring-width)] focus:outline-none font-[number:var(--font-weight-input-text)] font-[family-name:var(--font-family-base)]",
|
|
690
690
|
Q[i],
|
|
691
691
|
G[i],
|
|
692
692
|
At[i],
|
|
693
|
-
|
|
693
|
+
x ? fe[i] : dt[i],
|
|
694
694
|
r && "input-error"
|
|
695
695
|
),
|
|
696
|
-
value: s ??
|
|
696
|
+
value: s ?? v,
|
|
697
697
|
onChange: z,
|
|
698
698
|
onFocus: L,
|
|
699
|
-
onBlur:
|
|
700
|
-
onClick: () =>
|
|
699
|
+
onBlur: P,
|
|
700
|
+
onClick: () => u(!0),
|
|
701
701
|
...m
|
|
702
702
|
}
|
|
703
703
|
),
|
|
@@ -705,7 +705,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
705
705
|
r && /* @__PURE__ */ e(oe, {}),
|
|
706
706
|
o
|
|
707
707
|
] }),
|
|
708
|
-
/* @__PURE__ */ e(S, { open: p, children: /* @__PURE__ */ e(be, { padding: "md", children: /* @__PURE__ */ e(pr, { value:
|
|
708
|
+
/* @__PURE__ */ e(S, { open: p, children: /* @__PURE__ */ e(be, { padding: "md", children: /* @__PURE__ */ e(pr, { value: b, onChange: O }) }) })
|
|
709
709
|
] }),
|
|
710
710
|
/* @__PURE__ */ e(V, { children: a }),
|
|
711
711
|
/* @__PURE__ */ e(K, { children: r })
|
|
@@ -721,14 +721,14 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
721
721
|
"div",
|
|
722
722
|
{
|
|
723
723
|
onClick: t,
|
|
724
|
-
className:
|
|
724
|
+
className: h(
|
|
725
725
|
"h-6 w-6 select-none rounded-full p-0.5",
|
|
726
726
|
t && "ring-0 transition-all duration-[var(--control-transition-duration)] input-icon-button-interactive active:ring-[length:var(--control-ring-width-active)] cursor-pointer hover:ring-[length:var(--control-ring-width)] group pointer-events-auto"
|
|
727
727
|
),
|
|
728
|
-
children: /* @__PURE__ */ e(l, { className:
|
|
728
|
+
children: /* @__PURE__ */ e(l, { className: h("h-5 w-5 input-icon-button-icon", t && "group-active:scale-[0.8] transition-transform duration-[var(--control-transition-duration)] origin-center") })
|
|
729
729
|
}
|
|
730
730
|
);
|
|
731
|
-
},
|
|
731
|
+
}, No = (n) => {
|
|
732
732
|
const {
|
|
733
733
|
type: t = "password",
|
|
734
734
|
enableShowPasswordToggle: l = !0,
|
|
@@ -744,7 +744,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
744
744
|
...a
|
|
745
745
|
}
|
|
746
746
|
);
|
|
747
|
-
},
|
|
747
|
+
}, yo = (n) => {
|
|
748
748
|
const {
|
|
749
749
|
className: t,
|
|
750
750
|
label: l,
|
|
@@ -754,33 +754,33 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
754
754
|
autogrow: i = !1,
|
|
755
755
|
maxRows: s,
|
|
756
756
|
ref: c,
|
|
757
|
-
onChange:
|
|
757
|
+
onChange: g,
|
|
758
758
|
...R
|
|
759
|
-
} = n,
|
|
760
|
-
const f =
|
|
759
|
+
} = n, w = k.useRef(null), m = k.useCallback(() => {
|
|
760
|
+
const f = w.current;
|
|
761
761
|
if (!f) return;
|
|
762
762
|
f.style.height = "auto";
|
|
763
763
|
let p = f.scrollHeight;
|
|
764
764
|
if (s) {
|
|
765
|
-
const
|
|
765
|
+
const u = window.getComputedStyle(f), I = parseFloat(u.lineHeight), b = parseFloat(u.paddingTop), N = parseFloat(u.paddingBottom), y = parseFloat(u.borderTopWidth), S = parseFloat(u.borderBottomWidth), z = I * s + b + N + y + S;
|
|
766
766
|
p = Math.min(f.scrollHeight, z);
|
|
767
767
|
}
|
|
768
768
|
f.style.height = `${p}px`;
|
|
769
769
|
}, [s]);
|
|
770
|
-
|
|
770
|
+
k.useLayoutEffect(() => {
|
|
771
771
|
if (!i) {
|
|
772
|
-
|
|
772
|
+
w.current && (w.current.style.height = "");
|
|
773
773
|
return;
|
|
774
774
|
}
|
|
775
775
|
m();
|
|
776
776
|
}, [i, m, n.value, n.defaultValue, o]);
|
|
777
|
-
const
|
|
778
|
-
|
|
777
|
+
const v = (f) => {
|
|
778
|
+
g?.(f), i && m();
|
|
779
779
|
};
|
|
780
780
|
return /* @__PURE__ */ e(q.Provider, { value: o, children: /* @__PURE__ */ d(
|
|
781
781
|
"div",
|
|
782
782
|
{
|
|
783
|
-
className:
|
|
783
|
+
className: h(
|
|
784
784
|
"flex flex-col",
|
|
785
785
|
t
|
|
786
786
|
),
|
|
@@ -790,9 +790,9 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
790
790
|
/* @__PURE__ */ e(
|
|
791
791
|
"textarea",
|
|
792
792
|
{
|
|
793
|
-
ref: c ? vn([c,
|
|
794
|
-
onChange:
|
|
795
|
-
className:
|
|
793
|
+
ref: c ? vn([c, w]) : w,
|
|
794
|
+
onChange: v,
|
|
795
|
+
className: h(
|
|
796
796
|
"py-2.5 border-[length:var(--border-width-input)] input-base transition-all duration-[var(--control-transition-duration)] rounded-[var(--border-radius-input)] shadow-[var(--shadow-control)] ring-0 focus:ring-[length:var(--control-ring-width)] focus:outline-none font-[number:var(--font-weight-input-text)] font-[family-name:var(--font-family-base)]",
|
|
797
797
|
Bt[o],
|
|
798
798
|
G[o],
|
|
@@ -822,7 +822,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
822
822
|
return /* @__PURE__ */ d(
|
|
823
823
|
"div",
|
|
824
824
|
{
|
|
825
|
-
className:
|
|
825
|
+
className: h(
|
|
826
826
|
"flex flex-col",
|
|
827
827
|
t
|
|
828
828
|
),
|
|
@@ -836,7 +836,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
836
836
|
...o
|
|
837
837
|
}
|
|
838
838
|
),
|
|
839
|
-
l && /* @__PURE__ */ e("label", { htmlFor: n.id, className:
|
|
839
|
+
l && /* @__PURE__ */ e("label", { htmlFor: n.id, className: h(
|
|
840
840
|
"input-label font-[number:var(--font-weight-input-option-label)] mb-1",
|
|
841
841
|
n.id && "cursor-pointer"
|
|
842
842
|
), children: l })
|
|
@@ -857,7 +857,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
857
857
|
return /* @__PURE__ */ d(
|
|
858
858
|
"div",
|
|
859
859
|
{
|
|
860
|
-
className:
|
|
860
|
+
className: h(
|
|
861
861
|
"flex flex-col",
|
|
862
862
|
t
|
|
863
863
|
),
|
|
@@ -872,15 +872,15 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
872
872
|
...o
|
|
873
873
|
}
|
|
874
874
|
),
|
|
875
|
-
/* @__PURE__ */ e("div", { className:
|
|
875
|
+
/* @__PURE__ */ e("div", { className: h(
|
|
876
876
|
"rounded-full absolute border inset-0 pointer-events-none transition-colors duration-[var(--control-transition-duration)] ",
|
|
877
877
|
n.checked ? "toggle-track-on" : "toggle-track-off"
|
|
878
|
-
), children: /* @__PURE__ */ e("div", { className:
|
|
878
|
+
), children: /* @__PURE__ */ e("div", { className: h(
|
|
879
879
|
"absolute top-1/2 -translate-y-1/2 left-1 h-4 w-4 rounded-full toggle-thumb shadow-md transition-all duration-[var(--control-transition-duration)]",
|
|
880
880
|
n.checked && "translate-x-3.5 "
|
|
881
881
|
) }) })
|
|
882
882
|
] }),
|
|
883
|
-
l && /* @__PURE__ */ e("label", { htmlFor: n.id, className:
|
|
883
|
+
l && /* @__PURE__ */ e("label", { htmlFor: n.id, className: h(
|
|
884
884
|
"input-label font-[number:var(--font-weight-input-option-label)] mb-1",
|
|
885
885
|
n.id && "cursor-pointer"
|
|
886
886
|
), children: l })
|
|
@@ -901,7 +901,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
901
901
|
return /* @__PURE__ */ d(
|
|
902
902
|
"div",
|
|
903
903
|
{
|
|
904
|
-
className:
|
|
904
|
+
className: h(
|
|
905
905
|
"flex flex-col",
|
|
906
906
|
t
|
|
907
907
|
),
|
|
@@ -915,7 +915,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
915
915
|
...o
|
|
916
916
|
}
|
|
917
917
|
),
|
|
918
|
-
l && /* @__PURE__ */ e("label", { htmlFor: n.id, className:
|
|
918
|
+
l && /* @__PURE__ */ e("label", { htmlFor: n.id, className: h(
|
|
919
919
|
"input-label font-[number:var(--font-weight-input-option-label)] mb-1",
|
|
920
920
|
n.id && "cursor-pointer"
|
|
921
921
|
), children: l })
|
|
@@ -947,77 +947,77 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
947
947
|
Icon: i = Qt,
|
|
948
948
|
size: s = "md",
|
|
949
949
|
value: c,
|
|
950
|
-
isUploaded:
|
|
950
|
+
isUploaded: g = !1,
|
|
951
951
|
isUploading: R = !1,
|
|
952
|
-
onChange:
|
|
952
|
+
onChange: w,
|
|
953
953
|
onDropRejected: m,
|
|
954
|
-
accept:
|
|
954
|
+
accept: v,
|
|
955
955
|
maxSize: f,
|
|
956
956
|
minSize: p,
|
|
957
|
-
disabled:
|
|
957
|
+
disabled: u = !1,
|
|
958
958
|
className: I
|
|
959
|
-
} = n,
|
|
960
|
-
const [
|
|
961
|
-
|
|
959
|
+
} = n, b = async (O) => {
|
|
960
|
+
const [x] = O;
|
|
961
|
+
x && await w?.(x);
|
|
962
962
|
}, {
|
|
963
963
|
getRootProps: N,
|
|
964
|
-
getInputProps:
|
|
964
|
+
getInputProps: y,
|
|
965
965
|
open: S,
|
|
966
966
|
isDragActive: z,
|
|
967
967
|
isFocused: L
|
|
968
968
|
} = Pt({
|
|
969
969
|
multiple: !1,
|
|
970
|
-
accept:
|
|
970
|
+
accept: v,
|
|
971
971
|
maxSize: f,
|
|
972
972
|
minSize: p,
|
|
973
|
-
disabled:
|
|
974
|
-
onDrop:
|
|
973
|
+
disabled: u,
|
|
974
|
+
onDrop: b,
|
|
975
975
|
onDropRejected: m
|
|
976
|
-
}),
|
|
977
|
-
return /* @__PURE__ */ e(q.Provider, { value: s, children: /* @__PURE__ */ d("div", { className:
|
|
976
|
+
}), P = c?.name;
|
|
977
|
+
return /* @__PURE__ */ e(q.Provider, { value: s, children: /* @__PURE__ */ d("div", { className: h("flex flex-col", I), children: [
|
|
978
978
|
/* @__PURE__ */ e(Z, { children: t }),
|
|
979
979
|
/* @__PURE__ */ d(
|
|
980
980
|
"div",
|
|
981
981
|
{
|
|
982
982
|
...N({
|
|
983
|
-
className:
|
|
983
|
+
className: h(
|
|
984
984
|
"flex flex-row items-center",
|
|
985
985
|
"border-[length:var(--border-width-input)] input-base rounded-[var(--border-radius-input)] shadow-[var(--shadow-control)] transition-all duration-[var(--control-transition-duration)]",
|
|
986
986
|
"ring-0 focus:outline-none",
|
|
987
987
|
(L || z) && "ring-[length:var(--control-ring-width)]",
|
|
988
988
|
a && "input-error",
|
|
989
|
-
|
|
989
|
+
u && "opacity-60 cursor-not-allowed",
|
|
990
990
|
Q[s],
|
|
991
991
|
he[s],
|
|
992
992
|
"gap-3"
|
|
993
993
|
)
|
|
994
994
|
}),
|
|
995
995
|
children: [
|
|
996
|
-
/* @__PURE__ */ e("input", { ...
|
|
997
|
-
/* @__PURE__ */ e(i, { className:
|
|
996
|
+
/* @__PURE__ */ e("input", { ...y() }),
|
|
997
|
+
/* @__PURE__ */ e(i, { className: h("input-icon shrink-0", ee[s]) }),
|
|
998
998
|
/* @__PURE__ */ e(
|
|
999
999
|
"span",
|
|
1000
1000
|
{
|
|
1001
|
-
className:
|
|
1001
|
+
className: h(
|
|
1002
1002
|
"flex-1 truncate",
|
|
1003
1003
|
G[s],
|
|
1004
|
-
!
|
|
1004
|
+
!P && "text-[var(--color-input-placeholder)]"
|
|
1005
1005
|
),
|
|
1006
|
-
children:
|
|
1006
|
+
children: P ?? r
|
|
1007
1007
|
}
|
|
1008
1008
|
),
|
|
1009
1009
|
a && /* @__PURE__ */ e(oe, {}),
|
|
1010
1010
|
R && !a && /* @__PURE__ */ e("div", { className: "h-5 w-5 flex items-center justify-center", children: /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-icon)]" }) }),
|
|
1011
|
-
|
|
1011
|
+
g && !R && !a && /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(tt, { className: "h-5 w-5 text-[var(--color-status-success)]" }) }),
|
|
1012
1012
|
/* @__PURE__ */ e(
|
|
1013
1013
|
"button",
|
|
1014
1014
|
{
|
|
1015
1015
|
type: "button",
|
|
1016
|
-
disabled:
|
|
1016
|
+
disabled: u,
|
|
1017
1017
|
onClick: (O) => {
|
|
1018
1018
|
O.stopPropagation(), S();
|
|
1019
1019
|
},
|
|
1020
|
-
className:
|
|
1020
|
+
className: h(
|
|
1021
1021
|
"inline-flex flex-row items-center justify-center shrink-0",
|
|
1022
1022
|
"border-[length:var(--border-width-input)] button-white shadow-[var(--shadow-control)] rounded-[calc(var(--border-radius-button)-0.25rem)]",
|
|
1023
1023
|
"font-[number:var(--font-weight-button)] font-[family-name:var(--font-family-base)] cursor-pointer select-none transition-all duration-[var(--control-transition-duration)]",
|
|
@@ -1049,7 +1049,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1049
1049
|
return /* @__PURE__ */ d(
|
|
1050
1050
|
"div",
|
|
1051
1051
|
{
|
|
1052
|
-
className:
|
|
1052
|
+
className: h(
|
|
1053
1053
|
"flex flex-row items-center gap-3",
|
|
1054
1054
|
"border-[length:var(--border-width-input)] input-base rounded-[var(--border-radius-input)] shadow-[var(--shadow-control)]",
|
|
1055
1055
|
"pl-4 pr-1 py-1",
|
|
@@ -1082,95 +1082,102 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1082
1082
|
title: r = "Drop files here",
|
|
1083
1083
|
hint: o,
|
|
1084
1084
|
Icon: i = Zt,
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1085
|
+
defaultFiles: s,
|
|
1086
|
+
onUpload: c,
|
|
1087
|
+
onFileRemoved: g,
|
|
1088
|
+
onDropRejected: R,
|
|
1089
|
+
renderFileTile: w,
|
|
1090
|
+
accept: m,
|
|
1091
|
+
maxSize: v,
|
|
1092
|
+
minSize: f,
|
|
1093
|
+
maxFiles: p,
|
|
1094
|
+
disabled: u = !1,
|
|
1095
|
+
className: I
|
|
1096
|
+
} = n, b = Ce(0), [N, y] = W(
|
|
1097
|
+
() => (s ?? []).map((T) => ({
|
|
1098
|
+
id: String(++b.current),
|
|
1099
|
+
file: T,
|
|
1100
|
+
status: "uploaded"
|
|
1101
|
+
}))
|
|
1102
|
+
), S = (T, E) => {
|
|
1103
|
+
y((_) => _.map(($) => $.id === T ? { ...$, ...E } : $));
|
|
1104
|
+
}, z = (T) => {
|
|
1105
|
+
if (T.length === 0) return;
|
|
1106
|
+
const E = T.map((_) => ({
|
|
1107
|
+
id: String(++b.current),
|
|
1108
|
+
file: _,
|
|
1109
|
+
status: c ? "uploading" : "idle"
|
|
1103
1110
|
}));
|
|
1104
|
-
if (
|
|
1105
|
-
for (const
|
|
1106
|
-
Promise.resolve().then(() =>
|
|
1107
|
-
|
|
1111
|
+
if (y((_) => [..._, ...E]), !!c)
|
|
1112
|
+
for (const _ of E)
|
|
1113
|
+
Promise.resolve().then(() => c(_.file)).then(() => S(_.id, { status: "uploaded" })).catch(($) => {
|
|
1114
|
+
S(_.id, {
|
|
1108
1115
|
status: "error",
|
|
1109
1116
|
error: $ instanceof Error ? $ : new Error(String($))
|
|
1110
1117
|
});
|
|
1111
1118
|
});
|
|
1112
|
-
},
|
|
1113
|
-
const
|
|
1114
|
-
|
|
1119
|
+
}, L = (T) => {
|
|
1120
|
+
const E = N.find((_) => _.id === T);
|
|
1121
|
+
y((_) => _.filter(($) => $.id !== T)), E && g?.(E.file);
|
|
1115
1122
|
}, {
|
|
1116
|
-
getRootProps:
|
|
1117
|
-
getInputProps:
|
|
1118
|
-
isDragActive:
|
|
1119
|
-
isFocused:
|
|
1123
|
+
getRootProps: P,
|
|
1124
|
+
getInputProps: O,
|
|
1125
|
+
isDragActive: x,
|
|
1126
|
+
isFocused: C
|
|
1120
1127
|
} = Pt({
|
|
1121
1128
|
multiple: !0,
|
|
1122
|
-
accept:
|
|
1123
|
-
maxSize:
|
|
1124
|
-
minSize:
|
|
1125
|
-
maxFiles:
|
|
1126
|
-
disabled:
|
|
1127
|
-
onDrop:
|
|
1128
|
-
onDropRejected:
|
|
1129
|
+
accept: m,
|
|
1130
|
+
maxSize: v,
|
|
1131
|
+
minSize: f,
|
|
1132
|
+
maxFiles: p,
|
|
1133
|
+
disabled: u,
|
|
1134
|
+
onDrop: z,
|
|
1135
|
+
onDropRejected: R
|
|
1129
1136
|
});
|
|
1130
|
-
return /* @__PURE__ */ d("div", { className:
|
|
1137
|
+
return /* @__PURE__ */ d("div", { className: h("flex flex-col", I), children: [
|
|
1131
1138
|
/* @__PURE__ */ e(Z, { children: t }),
|
|
1132
1139
|
/* @__PURE__ */ d(
|
|
1133
1140
|
"div",
|
|
1134
1141
|
{
|
|
1135
|
-
...
|
|
1136
|
-
className:
|
|
1142
|
+
...P({
|
|
1143
|
+
className: h(
|
|
1137
1144
|
"flex flex-col items-center justify-center gap-1",
|
|
1138
1145
|
"border-2 border-dashed input-base rounded-[var(--border-radius-input)] bg-transparent!",
|
|
1139
1146
|
"py-10 px-6 cursor-pointer transition-all duration-[var(--control-transition-duration)]",
|
|
1140
1147
|
"ring-0 focus:outline-none",
|
|
1141
|
-
(
|
|
1148
|
+
(C || x) && "ring-[length:var(--control-ring-width)]",
|
|
1142
1149
|
a && "input-error",
|
|
1143
|
-
|
|
1150
|
+
u && "opacity-60 cursor-not-allowed"
|
|
1144
1151
|
)
|
|
1145
1152
|
}),
|
|
1146
1153
|
children: [
|
|
1147
|
-
/* @__PURE__ */ e("input", { ...
|
|
1154
|
+
/* @__PURE__ */ e("input", { ...O() }),
|
|
1148
1155
|
/* @__PURE__ */ e("div", { className: "h-14 w-14 rounded-[var(--border-radius-input)] flex items-center justify-center bg-[var(--color-input-file-icon-bg)] mb-2", children: /* @__PURE__ */ e(i, { className: "h-7 w-7 input-icon" }) }),
|
|
1149
1156
|
/* @__PURE__ */ e("div", { className: "text-base font-[number:var(--font-weight-button)]", children: r }),
|
|
1150
1157
|
o && /* @__PURE__ */ e("div", { className: "text-sm text-[var(--color-input-description-text)] ", children: o })
|
|
1151
1158
|
]
|
|
1152
1159
|
}
|
|
1153
1160
|
),
|
|
1154
|
-
|
|
1155
|
-
const
|
|
1156
|
-
file:
|
|
1157
|
-
isUploading:
|
|
1158
|
-
isUploaded:
|
|
1159
|
-
error:
|
|
1160
|
-
onRemove: () =>
|
|
1161
|
+
N.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-col gap-2 mt-3", children: N.map((T) => {
|
|
1162
|
+
const E = {
|
|
1163
|
+
file: T.file,
|
|
1164
|
+
isUploading: T.status === "uploading",
|
|
1165
|
+
isUploaded: T.status === "uploaded",
|
|
1166
|
+
error: T.status === "error" ? T.error?.message : void 0,
|
|
1167
|
+
onRemove: () => L(T.id)
|
|
1161
1168
|
};
|
|
1162
|
-
return /* @__PURE__ */ e(
|
|
1169
|
+
return /* @__PURE__ */ e(k.Fragment, { children: w ? w(T.file, E) : /* @__PURE__ */ e(wr, { ...E }) }, T.id);
|
|
1163
1170
|
}) }),
|
|
1164
1171
|
/* @__PURE__ */ e(V, { children: l }),
|
|
1165
1172
|
/* @__PURE__ */ e(K, { children: a })
|
|
1166
1173
|
] });
|
|
1167
|
-
},
|
|
1174
|
+
}, Nr = [
|
|
1168
1175
|
Sn,
|
|
1169
1176
|
Dn,
|
|
1170
1177
|
Lt,
|
|
1171
1178
|
Tn,
|
|
1172
1179
|
Fn
|
|
1173
|
-
],
|
|
1180
|
+
], yt = {
|
|
1174
1181
|
paragraph: "lexical-paragraph",
|
|
1175
1182
|
heading: {
|
|
1176
1183
|
h1: "lexical-h1",
|
|
@@ -1209,7 +1216,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1209
1216
|
orientation: "horizontal"
|
|
1210
1217
|
}), we = () => Ze(Ae), Xt = () => {
|
|
1211
1218
|
const [n] = ue(), [t, l] = W(jt);
|
|
1212
|
-
return
|
|
1219
|
+
return j(() => {
|
|
1213
1220
|
const a = () => {
|
|
1214
1221
|
n.getEditorState().read(() => {
|
|
1215
1222
|
const r = Et();
|
|
@@ -1218,15 +1225,15 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1218
1225
|
const o = r.anchor.getNode(), i = _n(o, Lt), s = i && Pn(i) ? i.getListType() : null;
|
|
1219
1226
|
let c = "paragraph";
|
|
1220
1227
|
if (!s) {
|
|
1221
|
-
const
|
|
1222
|
-
zn(
|
|
1228
|
+
const v = o.getKey() === "root" ? o : o.getTopLevelElementOrThrow();
|
|
1229
|
+
zn(v) && (c = v.getTag());
|
|
1223
1230
|
}
|
|
1224
|
-
const
|
|
1225
|
-
l((
|
|
1226
|
-
...
|
|
1227
|
-
isBold:
|
|
1231
|
+
const g = r.hasFormat("bold"), R = r.hasFormat("italic"), w = r.hasFormat("underline"), m = vt(o.getParent()) || vt(o);
|
|
1232
|
+
l((v) => ({
|
|
1233
|
+
...v,
|
|
1234
|
+
isBold: g,
|
|
1228
1235
|
isItalic: R,
|
|
1229
|
-
isUnderline:
|
|
1236
|
+
isUnderline: w,
|
|
1230
1237
|
isLink: m,
|
|
1231
1238
|
isUnorderedList: s === "bullet",
|
|
1232
1239
|
isOrderedList: s === "number",
|
|
@@ -1248,21 +1255,21 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1248
1255
|
)
|
|
1249
1256
|
);
|
|
1250
1257
|
}, [n]), t;
|
|
1251
|
-
}, Vt = Qe(void 0),
|
|
1258
|
+
}, Vt = Qe(void 0), yr = () => ({
|
|
1252
1259
|
dismiss: Ze(Vt) || (() => {
|
|
1253
1260
|
})
|
|
1254
1261
|
}), Ue = (n) => {
|
|
1255
|
-
const { trigger: t, children: l, placement: a = "bottom-end", minWidth: r = 200, className: o } = n, [i, s] = W(!1), { Popover: c, anchorRef:
|
|
1262
|
+
const { trigger: t, children: l, placement: a = "bottom-end", minWidth: r = 200, className: o } = n, [i, s] = W(!1), { Popover: c, anchorRef: g } = ut({
|
|
1256
1263
|
placement: a,
|
|
1257
1264
|
open: i,
|
|
1258
1265
|
onOpenChange: s,
|
|
1259
1266
|
minWidth: r
|
|
1260
1267
|
});
|
|
1261
1268
|
return /* @__PURE__ */ d(ne, { children: [
|
|
1262
|
-
/* @__PURE__ */ e("div", { ref:
|
|
1269
|
+
/* @__PURE__ */ e("div", { ref: g, className: o, onClick: () => s(!i), children: t }),
|
|
1263
1270
|
/* @__PURE__ */ e(c, { open: i, children: /* @__PURE__ */ e(be, { padding: "sm", children: /* @__PURE__ */ e(Vt.Provider, { value: () => s(!1), children: l }) }) })
|
|
1264
1271
|
] });
|
|
1265
|
-
}, kr = "inline-flex flex-row items-center gap-3 h-10 px-3 font-[number:var(--font-weight-dropdown-item)] font-[family-name:var(--font-family-base)] ring-0 dropdown-item rounded-[var(--border-radius-menu-item)] cursor-pointer transition-all duration-[var(--control-transition-duration)] select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent", X =
|
|
1272
|
+
}, kr = "inline-flex flex-row items-center gap-3 h-10 px-3 font-[number:var(--font-weight-dropdown-item)] font-[family-name:var(--font-family-base)] ring-0 dropdown-item rounded-[var(--border-radius-menu-item)] cursor-pointer transition-all duration-[var(--control-transition-duration)] select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent", X = k.forwardRef((n, t) => {
|
|
1266
1273
|
const {
|
|
1267
1274
|
className: l,
|
|
1268
1275
|
children: a,
|
|
@@ -1270,18 +1277,18 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1270
1277
|
onClick: o,
|
|
1271
1278
|
dismissOnClick: i = !0,
|
|
1272
1279
|
...s
|
|
1273
|
-
} = n, { dismiss: c } =
|
|
1280
|
+
} = n, { dismiss: c } = yr(), g = (R) => {
|
|
1274
1281
|
o && o(R), i && c();
|
|
1275
1282
|
};
|
|
1276
1283
|
return /* @__PURE__ */ d(
|
|
1277
1284
|
"button",
|
|
1278
1285
|
{
|
|
1279
1286
|
ref: t,
|
|
1280
|
-
className:
|
|
1287
|
+
className: h(
|
|
1281
1288
|
kr,
|
|
1282
1289
|
l
|
|
1283
1290
|
),
|
|
1284
|
-
onClick:
|
|
1291
|
+
onClick: g,
|
|
1285
1292
|
...s,
|
|
1286
1293
|
children: [
|
|
1287
1294
|
r && /* @__PURE__ */ e(r, { className: "h-5 w-5 shrink-0" }),
|
|
@@ -1312,13 +1319,13 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1312
1319
|
{
|
|
1313
1320
|
type: "button",
|
|
1314
1321
|
onMouseDown: (o) => o.preventDefault(),
|
|
1315
|
-
className:
|
|
1322
|
+
className: h(
|
|
1316
1323
|
"lexical-tb-btn h-8 px-2 gap-1 text-sm font-[number:var(--font-weight-input-option-label)]",
|
|
1317
1324
|
l === "dark" ? "lexical-tb-btn-dark" : "lexical-tb-btn-light"
|
|
1318
1325
|
),
|
|
1319
1326
|
children: [
|
|
1320
|
-
r.label,
|
|
1321
|
-
/* @__PURE__ */ e(ve, { className: "h-4 w-4" })
|
|
1327
|
+
/* @__PURE__ */ e("span", { className: "break-all line-clamp-1", children: r.label }),
|
|
1328
|
+
/* @__PURE__ */ e(ve, { className: "h-4 w-4 shrink-0" })
|
|
1322
1329
|
]
|
|
1323
1330
|
}
|
|
1324
1331
|
),
|
|
@@ -1337,7 +1344,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1337
1344
|
}, Ir = {
|
|
1338
1345
|
light: "lexical-tb-btn-light",
|
|
1339
1346
|
dark: "lexical-tb-btn-dark"
|
|
1340
|
-
}, ce =
|
|
1347
|
+
}, ce = k.forwardRef(
|
|
1341
1348
|
(n, t) => {
|
|
1342
1349
|
const { Icon: l, active: a = !1, tone: r = "light", className: o, onMouseDown: i, ...s } = n;
|
|
1343
1350
|
return /* @__PURE__ */ e(
|
|
@@ -1345,10 +1352,10 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1345
1352
|
{
|
|
1346
1353
|
ref: t,
|
|
1347
1354
|
type: "button",
|
|
1348
|
-
onMouseDown: (
|
|
1349
|
-
|
|
1355
|
+
onMouseDown: (g) => {
|
|
1356
|
+
g.preventDefault(), i?.(g);
|
|
1350
1357
|
},
|
|
1351
|
-
className:
|
|
1358
|
+
className: h(
|
|
1352
1359
|
"lexical-tb-btn h-8 w-8",
|
|
1353
1360
|
Ir[r],
|
|
1354
1361
|
a && "lexical-tb-btn-active",
|
|
@@ -1478,7 +1485,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1478
1485
|
return /* @__PURE__ */ e(
|
|
1479
1486
|
"div",
|
|
1480
1487
|
{
|
|
1481
|
-
className:
|
|
1488
|
+
className: h(
|
|
1482
1489
|
r === "vertical" ? "h-px w-full my-1" : "w-px h-5 my-auto mx-1",
|
|
1483
1490
|
"shrink-0",
|
|
1484
1491
|
Or[t ?? a],
|
|
@@ -1488,35 +1495,35 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1488
1495
|
);
|
|
1489
1496
|
}, kt = 4, Tr = 36, Kt = (n) => {
|
|
1490
1497
|
const t = [];
|
|
1491
|
-
return
|
|
1492
|
-
|
|
1498
|
+
return k.Children.forEach(n, (l) => {
|
|
1499
|
+
k.isValidElement(l) && l.type === k.Fragment ? t.push(...Kt(l.props.children)) : t.push(l);
|
|
1493
1500
|
}), t;
|
|
1494
1501
|
}, Gt = (n) => {
|
|
1495
|
-
const { children: t } = n, { state: l, tone: a } = we(), r = Kt(t), o = Ce(null), i = Ce(null), [s, c] = W(r.length),
|
|
1496
|
-
const m = o.current,
|
|
1497
|
-
if (!m || !
|
|
1498
|
-
const f = m.clientWidth, p = Array.from(
|
|
1499
|
-
if (p.reduce((N,
|
|
1502
|
+
const { children: t } = n, { state: l, tone: a } = we(), r = Kt(t), o = Ce(null), i = Ce(null), [s, c] = W(r.length), g = Pe(() => {
|
|
1503
|
+
const m = o.current, v = i.current;
|
|
1504
|
+
if (!m || !v) return;
|
|
1505
|
+
const f = m.clientWidth, p = Array.from(v.children).map((N) => N.offsetWidth);
|
|
1506
|
+
if (p.reduce((N, y, S) => N + y + (S > 0 ? kt : 0), 0) <= f) {
|
|
1500
1507
|
c(p.length);
|
|
1501
1508
|
return;
|
|
1502
1509
|
}
|
|
1503
|
-
let I = 0,
|
|
1510
|
+
let I = 0, b = 0;
|
|
1504
1511
|
for (let N = 0; N < p.length; N++) {
|
|
1505
|
-
const
|
|
1506
|
-
if (I +
|
|
1507
|
-
I +=
|
|
1512
|
+
const y = p[N] + (N > 0 ? kt : 0);
|
|
1513
|
+
if (I + y + Tr > f) break;
|
|
1514
|
+
I += y, b++;
|
|
1508
1515
|
}
|
|
1509
|
-
c(
|
|
1516
|
+
c(b);
|
|
1510
1517
|
}, []);
|
|
1511
1518
|
St(() => {
|
|
1512
|
-
|
|
1513
|
-
}),
|
|
1514
|
-
const m = o.current,
|
|
1519
|
+
g();
|
|
1520
|
+
}), j(() => {
|
|
1521
|
+
const m = o.current, v = i.current;
|
|
1515
1522
|
if (!m) return;
|
|
1516
|
-
const f = new ResizeObserver(() =>
|
|
1517
|
-
return f.observe(m),
|
|
1518
|
-
}, [
|
|
1519
|
-
const R = r.slice(0, s),
|
|
1523
|
+
const f = new ResizeObserver(() => g());
|
|
1524
|
+
return f.observe(m), v && f.observe(v), () => f.disconnect();
|
|
1525
|
+
}, [g]);
|
|
1526
|
+
const R = r.slice(0, s), w = r.slice(s);
|
|
1520
1527
|
return /* @__PURE__ */ d(
|
|
1521
1528
|
"div",
|
|
1522
1529
|
{
|
|
@@ -1529,11 +1536,11 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1529
1536
|
ref: i,
|
|
1530
1537
|
"aria-hidden": !0,
|
|
1531
1538
|
className: "pointer-events-none invisible absolute left-0 top-0 flex flex-row items-center gap-1 w-max",
|
|
1532
|
-
children: r.map((m,
|
|
1539
|
+
children: r.map((m, v) => /* @__PURE__ */ e("div", { className: "flex flex-row items-center", children: m }, v))
|
|
1533
1540
|
}
|
|
1534
1541
|
),
|
|
1535
|
-
R.map((m,
|
|
1536
|
-
|
|
1542
|
+
R.map((m, v) => /* @__PURE__ */ e(k.Fragment, { children: m }, v)),
|
|
1543
|
+
w.length > 0 && /* @__PURE__ */ e(
|
|
1537
1544
|
Ue,
|
|
1538
1545
|
{
|
|
1539
1546
|
placement: "bottom-end",
|
|
@@ -1544,7 +1551,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1544
1551
|
type: "button",
|
|
1545
1552
|
"aria-label": "More",
|
|
1546
1553
|
onMouseDown: (m) => m.preventDefault(),
|
|
1547
|
-
className:
|
|
1554
|
+
className: h(
|
|
1548
1555
|
"lexical-tb-btn h-8 w-8 shrink-0",
|
|
1549
1556
|
a === "dark" ? "lexical-tb-btn-dark" : "lexical-tb-btn-light"
|
|
1550
1557
|
),
|
|
@@ -1556,7 +1563,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1556
1563
|
{
|
|
1557
1564
|
className: "flex flex-col items-stretch gap-1",
|
|
1558
1565
|
onMouseDown: (m) => m.preventDefault(),
|
|
1559
|
-
children:
|
|
1566
|
+
children: w.map((m, v) => /* @__PURE__ */ e(k.Fragment, { children: m }, v))
|
|
1560
1567
|
}
|
|
1561
1568
|
) })
|
|
1562
1569
|
}
|
|
@@ -1578,7 +1585,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1578
1585
|
return /* @__PURE__ */ e(Ae.Provider, { value: { state: r, tone: "light" }, children: /* @__PURE__ */ e(
|
|
1579
1586
|
"div",
|
|
1580
1587
|
{
|
|
1581
|
-
className:
|
|
1588
|
+
className: h(
|
|
1582
1589
|
"lexical-toolbar flex flex-row items-center p-1.5",
|
|
1583
1590
|
l
|
|
1584
1591
|
),
|
|
@@ -1594,14 +1601,14 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1594
1601
|
rt(),
|
|
1595
1602
|
ot({ padding: 8 }),
|
|
1596
1603
|
at({
|
|
1597
|
-
apply({ rects: c, elements:
|
|
1598
|
-
|
|
1604
|
+
apply({ rects: c, elements: g }) {
|
|
1605
|
+
g.floating.style.width = `${c.reference.width}px`;
|
|
1599
1606
|
}
|
|
1600
1607
|
})
|
|
1601
1608
|
],
|
|
1602
1609
|
whileElementsMounted: it
|
|
1603
1610
|
});
|
|
1604
|
-
return
|
|
1611
|
+
return j(() => l.registerRootListener((c) => i.setReference(c ?? null)), [l, i]), j(() => Mt(
|
|
1605
1612
|
l.registerCommand(
|
|
1606
1613
|
Hn,
|
|
1607
1614
|
() => (o(!0), !1),
|
|
@@ -1633,21 +1640,21 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1633
1640
|
onChange: i,
|
|
1634
1641
|
size: s = "md",
|
|
1635
1642
|
toolbar: c = "static",
|
|
1636
|
-
renderToolbar:
|
|
1643
|
+
renderToolbar: g,
|
|
1637
1644
|
minRows: R = 4,
|
|
1638
|
-
maxRows:
|
|
1645
|
+
maxRows: w,
|
|
1639
1646
|
autogrow: m = !1,
|
|
1640
|
-
namespace:
|
|
1647
|
+
namespace: v = "InputLexical",
|
|
1641
1648
|
nodes: f,
|
|
1642
1649
|
theme: p,
|
|
1643
|
-
autoFocus:
|
|
1650
|
+
autoFocus: u = !1,
|
|
1644
1651
|
children: I,
|
|
1645
|
-
className:
|
|
1652
|
+
className: b
|
|
1646
1653
|
} = n, N = se(
|
|
1647
1654
|
() => ({
|
|
1648
|
-
namespace:
|
|
1649
|
-
theme: p ? { ...
|
|
1650
|
-
nodes: [...
|
|
1655
|
+
namespace: v,
|
|
1656
|
+
theme: p ? { ...yt, ...p } : yt,
|
|
1657
|
+
nodes: [...Nr, ...f ?? []],
|
|
1651
1658
|
editorState: o ?? null,
|
|
1652
1659
|
onError: (O) => {
|
|
1653
1660
|
throw O;
|
|
@@ -1656,39 +1663,39 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1656
1663
|
// Lexical reads initialConfig once on mount; later prop changes are ignored by design.
|
|
1657
1664
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1658
1665
|
[]
|
|
1659
|
-
),
|
|
1666
|
+
), y = Pe(
|
|
1660
1667
|
(O) => {
|
|
1661
1668
|
i?.(JSON.stringify(O.toJSON()));
|
|
1662
1669
|
},
|
|
1663
1670
|
[i]
|
|
1664
|
-
), S = G[s], z = !!a, L = (O) => `calc(${O} * 1lh + 1.5rem)`,
|
|
1665
|
-
return /* @__PURE__ */ e(q.Provider, { value: s, children: /* @__PURE__ */ d("div", { className:
|
|
1671
|
+
), S = G[s], z = !!a, L = (O) => `calc(${O} * 1lh + 1.5rem)`, P = m ? { minHeight: L(R), maxHeight: w ? L(w) : void 0 } : { height: L(R) };
|
|
1672
|
+
return /* @__PURE__ */ e(q.Provider, { value: s, children: /* @__PURE__ */ d("div", { className: h("flex flex-col", b), children: [
|
|
1666
1673
|
/* @__PURE__ */ e(Z, { children: t }),
|
|
1667
1674
|
/* @__PURE__ */ e(bn, { initialConfig: N, children: /* @__PURE__ */ d(
|
|
1668
1675
|
"div",
|
|
1669
1676
|
{
|
|
1670
|
-
className:
|
|
1677
|
+
className: h(
|
|
1671
1678
|
"relative flex flex-col border-[length:var(--border-width-input)] input-base rounded-[var(--border-radius-input)] shadow-[var(--shadow-control)] overflow-hidden transition-all duration-[var(--control-transition-duration)] ring-0 focus-within:ring-[length:var(--control-ring-width)] focus-within:outline-none font-[family-name:var(--font-family-base)]",
|
|
1672
1679
|
z && "input-error"
|
|
1673
1680
|
),
|
|
1674
1681
|
children: [
|
|
1675
|
-
c === "static" && /* @__PURE__ */ e(Pr, { render:
|
|
1682
|
+
c === "static" && /* @__PURE__ */ e(Pr, { render: g }),
|
|
1676
1683
|
/* @__PURE__ */ e("div", { className: "relative flex-1 min-h-0", children: /* @__PURE__ */ e(
|
|
1677
1684
|
xn,
|
|
1678
1685
|
{
|
|
1679
1686
|
contentEditable: /* @__PURE__ */ e(
|
|
1680
1687
|
wn,
|
|
1681
1688
|
{
|
|
1682
|
-
className:
|
|
1689
|
+
className: h(
|
|
1683
1690
|
"lexical-content w-full outline-none px-3 py-3 leading-[1.55] overflow-y-auto mat-ui-hide-scrollbars",
|
|
1684
1691
|
S
|
|
1685
1692
|
),
|
|
1686
|
-
style:
|
|
1693
|
+
style: P,
|
|
1687
1694
|
"aria-placeholder": r ?? "",
|
|
1688
1695
|
placeholder: /* @__PURE__ */ e(
|
|
1689
1696
|
"div",
|
|
1690
1697
|
{
|
|
1691
|
-
className:
|
|
1698
|
+
className: h(
|
|
1692
1699
|
"lexical-placeholder pointer-events-none absolute left-3 top-3",
|
|
1693
1700
|
S
|
|
1694
1701
|
),
|
|
@@ -1700,13 +1707,13 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1700
1707
|
ErrorBoundary: Rn
|
|
1701
1708
|
}
|
|
1702
1709
|
) }),
|
|
1703
|
-
/* @__PURE__ */ e(yn, {}),
|
|
1704
1710
|
/* @__PURE__ */ e(Nn, {}),
|
|
1711
|
+
/* @__PURE__ */ e(yn, {}),
|
|
1705
1712
|
/* @__PURE__ */ e(kn, {}),
|
|
1706
|
-
|
|
1707
|
-
i && /* @__PURE__ */ e(Cn, { onChange:
|
|
1713
|
+
u && /* @__PURE__ */ e(In, {}),
|
|
1714
|
+
i && /* @__PURE__ */ e(Cn, { onChange: y }),
|
|
1708
1715
|
I,
|
|
1709
|
-
c === "floating" && /* @__PURE__ */ e(Lr, { render:
|
|
1716
|
+
c === "floating" && /* @__PURE__ */ e(Lr, { render: g })
|
|
1710
1717
|
]
|
|
1711
1718
|
}
|
|
1712
1719
|
) }),
|
|
@@ -1726,7 +1733,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1726
1733
|
return /* @__PURE__ */ e(q.Provider, { value: i, children: /* @__PURE__ */ d(
|
|
1727
1734
|
"div",
|
|
1728
1735
|
{
|
|
1729
|
-
className:
|
|
1736
|
+
className: h(
|
|
1730
1737
|
"flex flex-col",
|
|
1731
1738
|
t
|
|
1732
1739
|
),
|
|
@@ -1736,7 +1743,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1736
1743
|
/* @__PURE__ */ e(
|
|
1737
1744
|
"select",
|
|
1738
1745
|
{
|
|
1739
|
-
className:
|
|
1746
|
+
className: h(
|
|
1740
1747
|
"appearance-none border-[length:var(--border-width-input)] input-base bg-none transition-all duration-[var(--control-transition-duration)] rounded-[var(--border-radius-input)] shadow-[var(--shadow-control)] ring-0 focus:ring-[length:var(--control-ring-width)] focus:outline-none font-[number:var(--font-weight-input-text)] font-[family-name:var(--font-family-base)]",
|
|
1741
1748
|
Q[i],
|
|
1742
1749
|
G[i],
|
|
@@ -1744,14 +1751,14 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1744
1751
|
fe[i]
|
|
1745
1752
|
),
|
|
1746
1753
|
...s,
|
|
1747
|
-
children: r && r.map((c,
|
|
1754
|
+
children: r && r.map((c, g) => /* @__PURE__ */ e(
|
|
1748
1755
|
"option",
|
|
1749
1756
|
{
|
|
1750
1757
|
value: c.value,
|
|
1751
1758
|
disabled: c.disabled,
|
|
1752
1759
|
children: c.label
|
|
1753
1760
|
},
|
|
1754
|
-
|
|
1761
|
+
g
|
|
1755
1762
|
))
|
|
1756
1763
|
}
|
|
1757
1764
|
),
|
|
@@ -1765,7 +1772,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1765
1772
|
]
|
|
1766
1773
|
}
|
|
1767
1774
|
) });
|
|
1768
|
-
}, We =
|
|
1775
|
+
}, We = k.forwardRef((n, t) => {
|
|
1769
1776
|
const {
|
|
1770
1777
|
children: l,
|
|
1771
1778
|
onClick: a,
|
|
@@ -1781,7 +1788,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1781
1788
|
ref: t,
|
|
1782
1789
|
...c,
|
|
1783
1790
|
onClick: () => !o && a && a(),
|
|
1784
|
-
className:
|
|
1791
|
+
className: h(
|
|
1785
1792
|
"option-base px-4 py-2 rounded-[var(--border-radius-option)] cursor-pointer transition-all duration-[var(--control-transition-duration)] select-none flex flex-row gap-3 items-center",
|
|
1786
1793
|
r && !o && "option-selected",
|
|
1787
1794
|
i && !o && "option-active",
|
|
@@ -1794,28 +1801,28 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1794
1801
|
]
|
|
1795
1802
|
}
|
|
1796
1803
|
);
|
|
1797
|
-
}), He =
|
|
1804
|
+
}), He = k.forwardRef((n, t) => {
|
|
1798
1805
|
const { children: l, className: a, ...r } = n;
|
|
1799
1806
|
return /* @__PURE__ */ e(
|
|
1800
1807
|
"div",
|
|
1801
1808
|
{
|
|
1802
1809
|
ref: t,
|
|
1803
1810
|
...r,
|
|
1804
|
-
className:
|
|
1811
|
+
className: h(
|
|
1805
1812
|
"option-group-header px-4 pt-3 pb-1 text-xs font-[number:var(--font-weight-group-header)] uppercase tracking-wide select-none",
|
|
1806
1813
|
a
|
|
1807
1814
|
),
|
|
1808
1815
|
children: l
|
|
1809
1816
|
}
|
|
1810
1817
|
);
|
|
1811
|
-
}), $e =
|
|
1818
|
+
}), $e = k.forwardRef((n, t) => {
|
|
1812
1819
|
const { className: l, ...a } = n;
|
|
1813
1820
|
return /* @__PURE__ */ e(
|
|
1814
1821
|
"div",
|
|
1815
1822
|
{
|
|
1816
1823
|
ref: t,
|
|
1817
1824
|
...a,
|
|
1818
|
-
className:
|
|
1825
|
+
className: h(
|
|
1819
1826
|
"option-divider my-1 h-px",
|
|
1820
1827
|
l
|
|
1821
1828
|
)
|
|
@@ -1831,18 +1838,18 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1831
1838
|
onOpenChange: i,
|
|
1832
1839
|
listRef: s,
|
|
1833
1840
|
activeIndex: c,
|
|
1834
|
-
onNavigate:
|
|
1841
|
+
onNavigate: g,
|
|
1835
1842
|
loop: R = !0,
|
|
1836
|
-
disabledIndices:
|
|
1837
|
-
} = n, m =
|
|
1843
|
+
disabledIndices: w
|
|
1844
|
+
} = n, m = k.useMemo(() => [
|
|
1838
1845
|
rt({ padding: 8 }),
|
|
1839
1846
|
ot({ padding: 8 }),
|
|
1840
1847
|
at({
|
|
1841
|
-
apply({ rects:
|
|
1842
|
-
l && (O.floating.style.width = `${
|
|
1848
|
+
apply({ rects: P, elements: O }) {
|
|
1849
|
+
l && (O.floating.style.width = `${P.reference.width}px`), a && (O.floating.style.minWidth = `${a}px`), r && (O.floating.style.maxWidth = `${r}px`);
|
|
1843
1850
|
}
|
|
1844
1851
|
})
|
|
1845
|
-
], [l, r, a]), { refs:
|
|
1852
|
+
], [l, r, a]), { refs: v, floatingStyles: f, context: p, placement: u } = lt({
|
|
1846
1853
|
placement: t,
|
|
1847
1854
|
open: o,
|
|
1848
1855
|
onOpenChange: i,
|
|
@@ -1851,46 +1858,46 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1851
1858
|
}), I = gn(p, {
|
|
1852
1859
|
listRef: s,
|
|
1853
1860
|
activeIndex: c,
|
|
1854
|
-
onNavigate:
|
|
1861
|
+
onNavigate: g,
|
|
1855
1862
|
loop: R,
|
|
1856
1863
|
virtual: !0,
|
|
1857
1864
|
focusItemOnOpen: !1,
|
|
1858
|
-
disabledIndices:
|
|
1859
|
-
}),
|
|
1865
|
+
disabledIndices: w
|
|
1866
|
+
}), b = zt(p, {
|
|
1860
1867
|
outsidePress: !0,
|
|
1861
1868
|
escapeKey: !1
|
|
1862
|
-
}), { getReferenceProps: N, getFloatingProps:
|
|
1869
|
+
}), { getReferenceProps: N, getFloatingProps: y, getItemProps: S } = Ot([I, b]), z = k.useRef({
|
|
1863
1870
|
floatingStyles: f,
|
|
1864
|
-
setFloating:
|
|
1871
|
+
setFloating: v.setFloating,
|
|
1865
1872
|
placement: t,
|
|
1866
|
-
getFloatingProps:
|
|
1873
|
+
getFloatingProps: y
|
|
1867
1874
|
});
|
|
1868
1875
|
z.current = {
|
|
1869
1876
|
floatingStyles: f,
|
|
1870
|
-
setFloating:
|
|
1871
|
-
placement:
|
|
1872
|
-
getFloatingProps:
|
|
1877
|
+
setFloating: v.setFloating,
|
|
1878
|
+
placement: u,
|
|
1879
|
+
getFloatingProps: y
|
|
1873
1880
|
};
|
|
1874
|
-
const L =
|
|
1875
|
-
const
|
|
1876
|
-
const { floatingStyles:
|
|
1881
|
+
const L = k.useMemo(() => {
|
|
1882
|
+
const P = (O) => {
|
|
1883
|
+
const { floatingStyles: x, setFloating: C, placement: T, getFloatingProps: E } = z.current, { className: _, open: $, children: ae } = O;
|
|
1877
1884
|
return /* @__PURE__ */ e(
|
|
1878
1885
|
_t,
|
|
1879
1886
|
{
|
|
1880
|
-
open:
|
|
1881
|
-
className:
|
|
1882
|
-
floatingStyles:
|
|
1883
|
-
setFloating:
|
|
1884
|
-
placement:
|
|
1885
|
-
floatingProps:
|
|
1887
|
+
open: $,
|
|
1888
|
+
className: _,
|
|
1889
|
+
floatingStyles: x,
|
|
1890
|
+
setFloating: C,
|
|
1891
|
+
placement: T,
|
|
1892
|
+
floatingProps: E(),
|
|
1886
1893
|
children: ae
|
|
1887
1894
|
}
|
|
1888
1895
|
);
|
|
1889
1896
|
};
|
|
1890
|
-
return
|
|
1897
|
+
return k.memo(P);
|
|
1891
1898
|
}, []);
|
|
1892
1899
|
return {
|
|
1893
|
-
anchorRef:
|
|
1900
|
+
anchorRef: v.setReference,
|
|
1894
1901
|
Popover: L,
|
|
1895
1902
|
getReferenceProps: N,
|
|
1896
1903
|
getItemProps: S
|
|
@@ -1905,45 +1912,45 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1905
1912
|
value: i,
|
|
1906
1913
|
placeholder: s,
|
|
1907
1914
|
maxHeight: c = 300,
|
|
1908
|
-
error:
|
|
1915
|
+
error: g,
|
|
1909
1916
|
size: R = "md",
|
|
1910
|
-
disabled:
|
|
1917
|
+
disabled: w = !1,
|
|
1911
1918
|
clearable: m = !1
|
|
1912
|
-
} = n, [
|
|
1913
|
-
() => r.map((
|
|
1919
|
+
} = n, [v, f] = W(!1), [p, u] = W(null), I = k.useRef(null), b = k.useRef([]), N = r?.find((x) => H(x) && J(x.value, i)), y = se(
|
|
1920
|
+
() => r.map((x, C) => !H(x) || x.disabled ? C : -1).filter((x) => x !== -1),
|
|
1914
1921
|
[r]
|
|
1915
1922
|
);
|
|
1916
|
-
xe(
|
|
1917
|
-
if (
|
|
1923
|
+
xe(v, () => f(!1)), j(() => {
|
|
1924
|
+
if (v) {
|
|
1918
1925
|
I.current?.focus({ preventScroll: !0 });
|
|
1919
|
-
const
|
|
1920
|
-
if (
|
|
1921
|
-
|
|
1926
|
+
const x = r.findIndex((C) => H(C) && J(C.value, i));
|
|
1927
|
+
if (x >= 0)
|
|
1928
|
+
u(x);
|
|
1922
1929
|
else {
|
|
1923
|
-
const
|
|
1924
|
-
|
|
1930
|
+
const C = r.findIndex((T) => H(T) && !T.disabled);
|
|
1931
|
+
u(C >= 0 ? C : null);
|
|
1925
1932
|
}
|
|
1926
1933
|
} else
|
|
1927
|
-
|
|
1928
|
-
}, [
|
|
1929
|
-
const { anchorRef: S, Popover: z, getReferenceProps: L, getItemProps:
|
|
1934
|
+
u(null);
|
|
1935
|
+
}, [v]);
|
|
1936
|
+
const { anchorRef: S, Popover: z, getReferenceProps: L, getItemProps: P } = _e({
|
|
1930
1937
|
placement: "bottom",
|
|
1931
1938
|
fullWidth: !0,
|
|
1932
1939
|
minWidth: 200,
|
|
1933
|
-
open:
|
|
1940
|
+
open: v,
|
|
1934
1941
|
onOpenChange: f,
|
|
1935
|
-
listRef:
|
|
1942
|
+
listRef: b,
|
|
1936
1943
|
activeIndex: p,
|
|
1937
|
-
onNavigate:
|
|
1938
|
-
disabledIndices:
|
|
1939
|
-
}), O = (
|
|
1940
|
-
const
|
|
1941
|
-
|
|
1944
|
+
onNavigate: u,
|
|
1945
|
+
disabledIndices: y
|
|
1946
|
+
}), O = (x) => {
|
|
1947
|
+
const C = r[x];
|
|
1948
|
+
C && H(C) && !C.disabled && (o(C.value), f(!1));
|
|
1942
1949
|
};
|
|
1943
1950
|
return /* @__PURE__ */ e(q.Provider, { value: R, children: /* @__PURE__ */ d(
|
|
1944
1951
|
"div",
|
|
1945
1952
|
{
|
|
1946
|
-
className:
|
|
1953
|
+
className: h(
|
|
1947
1954
|
"flex flex-col",
|
|
1948
1955
|
t
|
|
1949
1956
|
),
|
|
@@ -1956,23 +1963,23 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1956
1963
|
...L({
|
|
1957
1964
|
ref: I,
|
|
1958
1965
|
role: "button",
|
|
1959
|
-
tabIndex:
|
|
1960
|
-
"aria-disabled":
|
|
1966
|
+
tabIndex: w ? -1 : 0,
|
|
1967
|
+
"aria-disabled": w,
|
|
1961
1968
|
onClick: () => {
|
|
1962
|
-
|
|
1969
|
+
w || f(!v);
|
|
1963
1970
|
},
|
|
1964
|
-
onKeyDown: (
|
|
1965
|
-
|
|
1971
|
+
onKeyDown: (x) => {
|
|
1972
|
+
w || (x.key === " " ? (x.preventDefault(), f((C) => !C)) : x.key === "Enter" && (x.preventDefault(), v && p != null ? O(p) : f(!0)));
|
|
1966
1973
|
}
|
|
1967
1974
|
}),
|
|
1968
|
-
className:
|
|
1975
|
+
className: h(
|
|
1969
1976
|
"flex flex-row items-center border-[length:var(--border-width-input)] select-trigger transition-all duration-[var(--control-transition-duration)] rounded-[var(--border-radius-input)] shadow-[var(--shadow-control)] ring-0 focus:ring-[length:var(--control-ring-width)] focus:outline-none select-none font-[number:var(--font-weight-input-text)] font-[family-name:var(--font-family-base)]",
|
|
1970
1977
|
Q[R],
|
|
1971
1978
|
G[R],
|
|
1972
1979
|
he[R],
|
|
1973
1980
|
m && i ? Be[R] : fe[R],
|
|
1974
|
-
|
|
1975
|
-
!
|
|
1981
|
+
w ? "select-trigger-disabled" : g && "select-trigger-error",
|
|
1982
|
+
!w && v && "ring-[length:var(--control-ring-width)]"
|
|
1976
1983
|
),
|
|
1977
1984
|
children: [
|
|
1978
1985
|
N && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: N.label }),
|
|
@@ -1981,51 +1988,51 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
1981
1988
|
}
|
|
1982
1989
|
),
|
|
1983
1990
|
/* @__PURE__ */ d(me, { children: [
|
|
1984
|
-
!
|
|
1985
|
-
m && !!i && !
|
|
1991
|
+
!w && g && /* @__PURE__ */ e(oe, {}),
|
|
1992
|
+
m && !!i && !w && /* @__PURE__ */ e(te, { Icon: de, onClick: () => o(null) }),
|
|
1986
1993
|
/* @__PURE__ */ e(te, { Icon: ve })
|
|
1987
1994
|
] }),
|
|
1988
|
-
/* @__PURE__ */ e(z, { open:
|
|
1989
|
-
if (!H(
|
|
1990
|
-
return
|
|
1995
|
+
/* @__PURE__ */ e(z, { open: v, children: /* @__PURE__ */ e(be, { className: "!p-0", style: { maxHeight: c }, children: /* @__PURE__ */ e("div", { className: "flex flex-col p-2 gap-1", children: r.map((x, C) => {
|
|
1996
|
+
if (!H(x))
|
|
1997
|
+
return x.kind === "header" ? /* @__PURE__ */ e(
|
|
1991
1998
|
He,
|
|
1992
1999
|
{
|
|
1993
|
-
ref: (
|
|
1994
|
-
|
|
2000
|
+
ref: (E) => {
|
|
2001
|
+
b.current[C] = E;
|
|
1995
2002
|
},
|
|
1996
|
-
children:
|
|
2003
|
+
children: x.label
|
|
1997
2004
|
},
|
|
1998
|
-
`header-${
|
|
2005
|
+
`header-${C}`
|
|
1999
2006
|
) : /* @__PURE__ */ e(
|
|
2000
2007
|
$e,
|
|
2001
2008
|
{
|
|
2002
|
-
ref: (
|
|
2003
|
-
|
|
2009
|
+
ref: (E) => {
|
|
2010
|
+
b.current[C] = E;
|
|
2004
2011
|
}
|
|
2005
2012
|
},
|
|
2006
|
-
`divider-${
|
|
2013
|
+
`divider-${C}`
|
|
2007
2014
|
);
|
|
2008
|
-
const
|
|
2015
|
+
const T = J(x.value, i);
|
|
2009
2016
|
return /* @__PURE__ */ e(
|
|
2010
2017
|
We,
|
|
2011
2018
|
{
|
|
2012
|
-
...
|
|
2013
|
-
ref(
|
|
2014
|
-
|
|
2019
|
+
...P({
|
|
2020
|
+
ref(E) {
|
|
2021
|
+
b.current[C] = E;
|
|
2015
2022
|
}
|
|
2016
2023
|
}),
|
|
2017
|
-
onClick: () => O(
|
|
2018
|
-
selected:
|
|
2019
|
-
active: p ===
|
|
2020
|
-
disabled:
|
|
2021
|
-
children:
|
|
2024
|
+
onClick: () => O(C),
|
|
2025
|
+
selected: T,
|
|
2026
|
+
active: p === C,
|
|
2027
|
+
disabled: x.disabled,
|
|
2028
|
+
children: x.label
|
|
2022
2029
|
},
|
|
2023
|
-
`option-${
|
|
2030
|
+
`option-${C}`
|
|
2024
2031
|
);
|
|
2025
2032
|
}) }) }) })
|
|
2026
2033
|
] }),
|
|
2027
2034
|
/* @__PURE__ */ e(V, { children: a }),
|
|
2028
|
-
/* @__PURE__ */ e(K, { children:
|
|
2035
|
+
/* @__PURE__ */ e(K, { children: g })
|
|
2029
2036
|
]
|
|
2030
2037
|
}
|
|
2031
2038
|
) });
|
|
@@ -2039,62 +2046,62 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
2039
2046
|
onSearch: i,
|
|
2040
2047
|
value: s,
|
|
2041
2048
|
placeholder: c,
|
|
2042
|
-
maxHeight:
|
|
2049
|
+
maxHeight: g = 300,
|
|
2043
2050
|
error: R,
|
|
2044
|
-
size:
|
|
2051
|
+
size: w = "md",
|
|
2045
2052
|
disabled: m = !1,
|
|
2046
|
-
clearable:
|
|
2047
|
-
} = n, [f, p] = W(!1), [
|
|
2048
|
-
() =>
|
|
2049
|
-
[
|
|
2053
|
+
clearable: v = !1
|
|
2054
|
+
} = n, [f, p] = W(!1), [u, I] = W(r), [b, N] = W(""), [y, S] = W(null), z = k.useRef(null), L = k.useRef(null), P = k.useRef([]), O = r?.find((F) => H(F) && J(F.value, s)), x = se(() => b !== "" ? u : r, [b, u, r]), C = se(
|
|
2055
|
+
() => x.map((F, U) => !H(F) || F.disabled ? U : -1).filter((F) => F !== -1),
|
|
2056
|
+
[x]
|
|
2050
2057
|
);
|
|
2051
|
-
xe(f, () => p(!1)),
|
|
2052
|
-
I(i(
|
|
2053
|
-
}, [
|
|
2058
|
+
xe(f, () => p(!1)), j(() => {
|
|
2059
|
+
I(i(b));
|
|
2060
|
+
}, [b, r, i]), j(() => {
|
|
2054
2061
|
if (f) {
|
|
2055
2062
|
setTimeout(() => L.current?.focus(), 100);
|
|
2056
|
-
const
|
|
2057
|
-
if (
|
|
2058
|
-
S(
|
|
2063
|
+
const F = r.findIndex((U) => H(U) && J(U.value, s));
|
|
2064
|
+
if (F >= 0)
|
|
2065
|
+
S(F);
|
|
2059
2066
|
else {
|
|
2060
2067
|
const U = r.findIndex((le) => H(le) && !le.disabled);
|
|
2061
2068
|
S(U >= 0 ? U : null);
|
|
2062
2069
|
}
|
|
2063
2070
|
} else
|
|
2064
2071
|
S(null), N("");
|
|
2065
|
-
}, [f]),
|
|
2072
|
+
}, [f]), j(() => {
|
|
2066
2073
|
if (!f) return;
|
|
2067
|
-
const
|
|
2068
|
-
S(
|
|
2069
|
-
}, [
|
|
2070
|
-
const { anchorRef:
|
|
2074
|
+
const F = x.findIndex((U) => H(U) && !U.disabled);
|
|
2075
|
+
S(F >= 0 ? F : null);
|
|
2076
|
+
}, [b, f, x]);
|
|
2077
|
+
const { anchorRef: T, Popover: E, getReferenceProps: _, getItemProps: $ } = _e({
|
|
2071
2078
|
placement: "bottom",
|
|
2072
2079
|
fullWidth: !0,
|
|
2073
2080
|
minWidth: 200,
|
|
2074
2081
|
open: f,
|
|
2075
2082
|
onOpenChange: p,
|
|
2076
|
-
listRef:
|
|
2077
|
-
activeIndex:
|
|
2083
|
+
listRef: P,
|
|
2084
|
+
activeIndex: y,
|
|
2078
2085
|
onNavigate: S,
|
|
2079
|
-
disabledIndices:
|
|
2080
|
-
}), ae = (
|
|
2081
|
-
const U =
|
|
2086
|
+
disabledIndices: C
|
|
2087
|
+
}), ae = (F) => {
|
|
2088
|
+
const U = x[F];
|
|
2082
2089
|
U && H(U) && !U.disabled && (o(U.value), p(!1));
|
|
2083
|
-
},
|
|
2084
|
-
return /* @__PURE__ */ e(q.Provider, { value:
|
|
2090
|
+
}, Ne = x.some((F) => H(F));
|
|
2091
|
+
return /* @__PURE__ */ e(q.Provider, { value: w, children: /* @__PURE__ */ d(
|
|
2085
2092
|
"div",
|
|
2086
2093
|
{
|
|
2087
|
-
className:
|
|
2094
|
+
className: h(
|
|
2088
2095
|
"flex flex-col",
|
|
2089
2096
|
t
|
|
2090
2097
|
),
|
|
2091
2098
|
children: [
|
|
2092
2099
|
/* @__PURE__ */ e(Z, { children: l }),
|
|
2093
|
-
/* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref:
|
|
2100
|
+
/* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: T, children: [
|
|
2094
2101
|
/* @__PURE__ */ d(
|
|
2095
2102
|
"div",
|
|
2096
2103
|
{
|
|
2097
|
-
|
|
2104
|
+
..._({
|
|
2098
2105
|
ref: z,
|
|
2099
2106
|
role: "button",
|
|
2100
2107
|
tabIndex: m ? -1 : 0,
|
|
@@ -2102,16 +2109,16 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
2102
2109
|
onClick: () => {
|
|
2103
2110
|
m || p(!f);
|
|
2104
2111
|
},
|
|
2105
|
-
onKeyDown: (
|
|
2106
|
-
m || (
|
|
2112
|
+
onKeyDown: (F) => {
|
|
2113
|
+
m || (F.key === " " ? (F.preventDefault(), p((U) => !U)) : F.key === "Enter" && !f && (F.preventDefault(), p(!0)));
|
|
2107
2114
|
}
|
|
2108
2115
|
}),
|
|
2109
|
-
className:
|
|
2116
|
+
className: h(
|
|
2110
2117
|
"flex flex-row items-center border-[length:var(--border-width-input)] select-trigger transition-all duration-[var(--control-transition-duration)] rounded-[var(--border-radius-input)] shadow-[var(--shadow-control)] ring-0 focus:ring-[length:var(--control-ring-width)] focus:outline-none select-none font-[number:var(--font-weight-input-text)] font-[family-name:var(--font-family-base)]",
|
|
2111
|
-
Q[
|
|
2112
|
-
G[
|
|
2113
|
-
he[
|
|
2114
|
-
|
|
2118
|
+
Q[w],
|
|
2119
|
+
G[w],
|
|
2120
|
+
he[w],
|
|
2121
|
+
v && s ? Be[w] : fe[w],
|
|
2115
2122
|
m ? "select-trigger-disabled" : R && "select-trigger-error",
|
|
2116
2123
|
!m && f && "ring-[length:var(--control-ring-width)]"
|
|
2117
2124
|
),
|
|
@@ -2123,10 +2130,10 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
2123
2130
|
),
|
|
2124
2131
|
/* @__PURE__ */ d(me, { children: [
|
|
2125
2132
|
!m && R && /* @__PURE__ */ e(oe, {}),
|
|
2126
|
-
|
|
2133
|
+
v && !!s && !m && /* @__PURE__ */ e(te, { Icon: de, onClick: () => o(null) }),
|
|
2127
2134
|
/* @__PURE__ */ e(te, { Icon: ve })
|
|
2128
2135
|
] }),
|
|
2129
|
-
/* @__PURE__ */ e(
|
|
2136
|
+
/* @__PURE__ */ e(E, { open: f, children: /* @__PURE__ */ d(be, { className: "gap-0 !p-0", style: { maxHeight: g }, children: [
|
|
2130
2137
|
/* @__PURE__ */ d("div", { className: "sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm", children: [
|
|
2131
2138
|
/* @__PURE__ */ e(
|
|
2132
2139
|
"input",
|
|
@@ -2134,52 +2141,52 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
2134
2141
|
ref: L,
|
|
2135
2142
|
type: "text",
|
|
2136
2143
|
placeholder: "Search",
|
|
2137
|
-
value:
|
|
2144
|
+
value: b,
|
|
2138
2145
|
className: "appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-[var(--control-transition-duration)] focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",
|
|
2139
|
-
onChange: (
|
|
2140
|
-
onKeyDown: (
|
|
2141
|
-
|
|
2146
|
+
onChange: (F) => N(F.target.value),
|
|
2147
|
+
onKeyDown: (F) => {
|
|
2148
|
+
F.key === "Enter" && y != null && (F.preventDefault(), ae(y));
|
|
2142
2149
|
}
|
|
2143
2150
|
}
|
|
2144
2151
|
),
|
|
2145
2152
|
/* @__PURE__ */ e(Fe, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
|
|
2146
2153
|
] }),
|
|
2147
2154
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1 p-2", children: [
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
if (!H(
|
|
2151
|
-
return
|
|
2155
|
+
b !== "" && !Ne && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
|
|
2156
|
+
x.map((F, U) => {
|
|
2157
|
+
if (!H(F))
|
|
2158
|
+
return F.kind === "header" ? /* @__PURE__ */ e(
|
|
2152
2159
|
He,
|
|
2153
2160
|
{
|
|
2154
2161
|
ref: (re) => {
|
|
2155
|
-
|
|
2162
|
+
P.current[U] = re;
|
|
2156
2163
|
},
|
|
2157
|
-
children:
|
|
2164
|
+
children: F.label
|
|
2158
2165
|
},
|
|
2159
2166
|
`header-${U}`
|
|
2160
2167
|
) : /* @__PURE__ */ e(
|
|
2161
2168
|
$e,
|
|
2162
2169
|
{
|
|
2163
2170
|
ref: (re) => {
|
|
2164
|
-
|
|
2171
|
+
P.current[U] = re;
|
|
2165
2172
|
}
|
|
2166
2173
|
},
|
|
2167
2174
|
`divider-${U}`
|
|
2168
2175
|
);
|
|
2169
|
-
const le = J(
|
|
2176
|
+
const le = J(F.value, s);
|
|
2170
2177
|
return /* @__PURE__ */ e(
|
|
2171
2178
|
We,
|
|
2172
2179
|
{
|
|
2173
|
-
|
|
2180
|
+
...$({
|
|
2174
2181
|
ref(re) {
|
|
2175
|
-
|
|
2182
|
+
P.current[U] = re;
|
|
2176
2183
|
}
|
|
2177
2184
|
}),
|
|
2178
2185
|
onClick: () => ae(U),
|
|
2179
2186
|
selected: le,
|
|
2180
|
-
active:
|
|
2181
|
-
disabled:
|
|
2182
|
-
children:
|
|
2187
|
+
active: y === U,
|
|
2188
|
+
disabled: F.disabled,
|
|
2189
|
+
children: F.label
|
|
2183
2190
|
},
|
|
2184
2191
|
`option-${U}`
|
|
2185
2192
|
);
|
|
@@ -2194,7 +2201,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
2194
2201
|
) });
|
|
2195
2202
|
}, Fr = (n, t) => {
|
|
2196
2203
|
const [l, a] = W(n);
|
|
2197
|
-
return
|
|
2204
|
+
return j(() => {
|
|
2198
2205
|
const r = setTimeout(() => {
|
|
2199
2206
|
a(n);
|
|
2200
2207
|
}, t);
|
|
@@ -2212,100 +2219,100 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
2212
2219
|
fetchOptionByValue: i,
|
|
2213
2220
|
onSearchDebounceMs: s = 300,
|
|
2214
2221
|
value: c,
|
|
2215
|
-
placeholder:
|
|
2222
|
+
placeholder: g,
|
|
2216
2223
|
maxHeight: R = 300,
|
|
2217
|
-
error:
|
|
2224
|
+
error: w,
|
|
2218
2225
|
size: m = "md",
|
|
2219
|
-
disabled:
|
|
2226
|
+
disabled: v = !1,
|
|
2220
2227
|
clearable: f = !1
|
|
2221
|
-
} = n, [p,
|
|
2222
|
-
() =>
|
|
2223
|
-
[
|
|
2228
|
+
} = n, [p, u] = W(!1), I = k.useRef(null), [b, N] = W(""), [y, S] = W([]), [z, L] = W(null), P = k.useRef(null), [O, x] = W(!1), [C, T] = W(!1), [E, _] = W(null), $ = k.useRef([]), ae = se(
|
|
2229
|
+
() => y.map((B, A) => !H(B) || B.disabled ? A : -1).filter((B) => B !== -1),
|
|
2230
|
+
[y]
|
|
2224
2231
|
);
|
|
2225
|
-
xe(p, () =>
|
|
2226
|
-
const
|
|
2227
|
-
|
|
2232
|
+
xe(p, () => u(!1));
|
|
2233
|
+
const Ne = Fr(b, s);
|
|
2234
|
+
j(() => {
|
|
2228
2235
|
(async () => {
|
|
2229
|
-
|
|
2230
|
-
const A = await o(
|
|
2231
|
-
S(A),
|
|
2236
|
+
x(!0);
|
|
2237
|
+
const A = await o(Ne);
|
|
2238
|
+
S(A), x(!1);
|
|
2232
2239
|
})();
|
|
2233
|
-
}, [
|
|
2240
|
+
}, [Ne, o]), j(() => {
|
|
2234
2241
|
if (c == null) {
|
|
2235
2242
|
L(null);
|
|
2236
2243
|
return;
|
|
2237
2244
|
}
|
|
2238
|
-
const B =
|
|
2245
|
+
const B = y?.find((A) => H(A) && J(A.value, c));
|
|
2239
2246
|
B ? L(B) : (async () => {
|
|
2240
|
-
|
|
2247
|
+
T(!0);
|
|
2241
2248
|
const ie = await i(c);
|
|
2242
|
-
L(ie),
|
|
2249
|
+
L(ie), T(!1);
|
|
2243
2250
|
})();
|
|
2244
|
-
}, [i,
|
|
2245
|
-
p ? setTimeout(() =>
|
|
2246
|
-
}, [p]),
|
|
2251
|
+
}, [i, y, c]), j(() => {
|
|
2252
|
+
p ? setTimeout(() => P.current?.focus(), 100) : (_(null), N(""));
|
|
2253
|
+
}, [p]), j(() => {
|
|
2247
2254
|
if (!p) return;
|
|
2248
|
-
const B =
|
|
2249
|
-
|
|
2250
|
-
}, [
|
|
2251
|
-
const { anchorRef:
|
|
2255
|
+
const B = y.findIndex((A) => H(A) && !A.disabled);
|
|
2256
|
+
_(B >= 0 ? B : null);
|
|
2257
|
+
}, [y, p]);
|
|
2258
|
+
const { anchorRef: F, Popover: U, getReferenceProps: le, getItemProps: re } = _e({
|
|
2252
2259
|
placement: "bottom",
|
|
2253
2260
|
fullWidth: !0,
|
|
2254
2261
|
minWidth: 200,
|
|
2255
2262
|
open: p,
|
|
2256
|
-
onOpenChange:
|
|
2257
|
-
listRef:
|
|
2258
|
-
activeIndex:
|
|
2259
|
-
onNavigate:
|
|
2263
|
+
onOpenChange: u,
|
|
2264
|
+
listRef: $,
|
|
2265
|
+
activeIndex: E,
|
|
2266
|
+
onNavigate: _,
|
|
2260
2267
|
disabledIndices: ae
|
|
2261
2268
|
}), ze = (B) => {
|
|
2262
|
-
const A =
|
|
2263
|
-
A && H(A) && !A.disabled && (r(A.value),
|
|
2264
|
-
}, Oe =
|
|
2269
|
+
const A = y[B];
|
|
2270
|
+
A && H(A) && !A.disabled && (r(A.value), u(!1));
|
|
2271
|
+
}, Oe = y.some((B) => H(B));
|
|
2265
2272
|
return /* @__PURE__ */ e(q.Provider, { value: m, children: /* @__PURE__ */ d(
|
|
2266
2273
|
"div",
|
|
2267
2274
|
{
|
|
2268
|
-
className:
|
|
2275
|
+
className: h(
|
|
2269
2276
|
"flex flex-col",
|
|
2270
2277
|
t
|
|
2271
2278
|
),
|
|
2272
2279
|
children: [
|
|
2273
2280
|
/* @__PURE__ */ e(Z, { children: l }),
|
|
2274
|
-
/* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref:
|
|
2281
|
+
/* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: F, children: [
|
|
2275
2282
|
/* @__PURE__ */ d(
|
|
2276
2283
|
"div",
|
|
2277
2284
|
{
|
|
2278
2285
|
...le({
|
|
2279
2286
|
ref: I,
|
|
2280
2287
|
role: "button",
|
|
2281
|
-
tabIndex:
|
|
2282
|
-
"aria-disabled":
|
|
2288
|
+
tabIndex: v ? -1 : 0,
|
|
2289
|
+
"aria-disabled": v,
|
|
2283
2290
|
onClick: () => {
|
|
2284
|
-
|
|
2291
|
+
v || u(!p);
|
|
2285
2292
|
},
|
|
2286
2293
|
onKeyDown: (B) => {
|
|
2287
|
-
|
|
2294
|
+
v || (B.key === " " ? (B.preventDefault(), u((A) => !A)) : B.key === "Enter" && !p && (B.preventDefault(), u(!0)));
|
|
2288
2295
|
}
|
|
2289
2296
|
}),
|
|
2290
|
-
className:
|
|
2297
|
+
className: h(
|
|
2291
2298
|
"flex flex-row items-center border-[length:var(--border-width-input)] select-trigger transition-all duration-[var(--control-transition-duration)] rounded-[var(--border-radius-input)] shadow-[var(--shadow-control)] ring-0 focus:ring-[length:var(--control-ring-width)] focus:outline-none select-none font-[number:var(--font-weight-input-text)] font-[family-name:var(--font-family-base)]",
|
|
2292
2299
|
Q[m],
|
|
2293
2300
|
G[m],
|
|
2294
2301
|
he[m],
|
|
2295
2302
|
f && c ? Be[m] : fe[m],
|
|
2296
|
-
|
|
2297
|
-
!
|
|
2303
|
+
v ? "select-trigger-disabled" : w && "select-trigger-error",
|
|
2304
|
+
!v && p && "ring-[length:var(--control-ring-width)]"
|
|
2298
2305
|
),
|
|
2299
2306
|
children: [
|
|
2300
|
-
!
|
|
2301
|
-
!
|
|
2302
|
-
|
|
2307
|
+
!C && z && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: z.label }),
|
|
2308
|
+
!C && !z && g && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: g }),
|
|
2309
|
+
C && /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-text)]" })
|
|
2303
2310
|
]
|
|
2304
2311
|
}
|
|
2305
2312
|
),
|
|
2306
2313
|
/* @__PURE__ */ d(me, { children: [
|
|
2307
|
-
!
|
|
2308
|
-
f && !!c && !
|
|
2314
|
+
!v && w && /* @__PURE__ */ e(oe, {}),
|
|
2315
|
+
f && !!c && !v && /* @__PURE__ */ e(te, { Icon: de, onClick: () => r(null) }),
|
|
2309
2316
|
/* @__PURE__ */ e(te, { Icon: ve })
|
|
2310
2317
|
] }),
|
|
2311
2318
|
/* @__PURE__ */ e(U, { open: p, children: /* @__PURE__ */ d(be, { className: "gap-0 !p-0", style: { maxHeight: R }, children: [
|
|
@@ -2313,14 +2320,14 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
2313
2320
|
/* @__PURE__ */ e(
|
|
2314
2321
|
"input",
|
|
2315
2322
|
{
|
|
2316
|
-
ref:
|
|
2323
|
+
ref: P,
|
|
2317
2324
|
type: "text",
|
|
2318
2325
|
placeholder: "Search",
|
|
2319
|
-
value:
|
|
2326
|
+
value: b,
|
|
2320
2327
|
className: "appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-[var(--control-transition-duration)] focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",
|
|
2321
2328
|
onChange: (B) => N(B.target.value),
|
|
2322
2329
|
onKeyDown: (B) => {
|
|
2323
|
-
B.key === "Enter" &&
|
|
2330
|
+
B.key === "Enter" && E != null && (B.preventDefault(), ze(E));
|
|
2324
2331
|
}
|
|
2325
2332
|
}
|
|
2326
2333
|
),
|
|
@@ -2329,13 +2336,13 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
2329
2336
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1 p-2", children: [
|
|
2330
2337
|
!O && !Oe && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
|
|
2331
2338
|
O && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(Se, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
|
|
2332
|
-
!O &&
|
|
2339
|
+
!O && y.map((B, A) => {
|
|
2333
2340
|
if (!H(B))
|
|
2334
2341
|
return B.kind === "header" ? /* @__PURE__ */ e(
|
|
2335
2342
|
He,
|
|
2336
2343
|
{
|
|
2337
2344
|
ref: (pe) => {
|
|
2338
|
-
|
|
2345
|
+
$.current[A] = pe;
|
|
2339
2346
|
},
|
|
2340
2347
|
children: B.label
|
|
2341
2348
|
},
|
|
@@ -2344,7 +2351,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
2344
2351
|
$e,
|
|
2345
2352
|
{
|
|
2346
2353
|
ref: (pe) => {
|
|
2347
|
-
|
|
2354
|
+
$.current[A] = pe;
|
|
2348
2355
|
}
|
|
2349
2356
|
},
|
|
2350
2357
|
`divider-${A}`
|
|
@@ -2355,12 +2362,12 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
2355
2362
|
{
|
|
2356
2363
|
...re({
|
|
2357
2364
|
ref(pe) {
|
|
2358
|
-
|
|
2365
|
+
$.current[A] = pe;
|
|
2359
2366
|
}
|
|
2360
2367
|
}),
|
|
2361
2368
|
onClick: () => ze(A),
|
|
2362
2369
|
selected: ie,
|
|
2363
|
-
active:
|
|
2370
|
+
active: E === A,
|
|
2364
2371
|
disabled: B.disabled,
|
|
2365
2372
|
children: B.label
|
|
2366
2373
|
},
|
|
@@ -2371,7 +2378,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
2371
2378
|
] }) })
|
|
2372
2379
|
] }),
|
|
2373
2380
|
/* @__PURE__ */ e(V, { children: a }),
|
|
2374
|
-
/* @__PURE__ */ e(K, { children:
|
|
2381
|
+
/* @__PURE__ */ e(K, { children: w })
|
|
2375
2382
|
]
|
|
2376
2383
|
}
|
|
2377
2384
|
) });
|
|
@@ -2400,7 +2407,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
2400
2407
|
stone: "bg-stone-100 text-stone-700 ring-stone-200 dark:bg-stone-950 dark:text-stone-300 dark:ring-stone-800",
|
|
2401
2408
|
white: "bg-[var(--color-badge-white-bg)] text-[var(--color-badge-white-text)] ring-[var(--color-badge-white-ring)]",
|
|
2402
2409
|
black: "bg-[var(--color-badge-black-bg)] text-[var(--color-badge-black-text)] ring-[var(--color-badge-black-ring)]"
|
|
2403
|
-
}, Ee =
|
|
2410
|
+
}, Ee = k.forwardRef((n, t) => {
|
|
2404
2411
|
const {
|
|
2405
2412
|
className: l,
|
|
2406
2413
|
children: a,
|
|
@@ -2408,7 +2415,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
2408
2415
|
showCloseIcon: o,
|
|
2409
2416
|
Icon: i,
|
|
2410
2417
|
color: s = "gray"
|
|
2411
|
-
} = n, c =
|
|
2418
|
+
} = n, c = h(
|
|
2412
2419
|
"inline-flex align-top items-center gap-2 px-3 h-7 rounded-[var(--border-radius-badge)] font-[number:var(--font-weight-badge)] font-[family-name:var(--font-family-base)]",
|
|
2413
2420
|
Mr[s],
|
|
2414
2421
|
l
|
|
@@ -2416,7 +2423,7 @@ const u = (...n) => n.filter(Boolean).join(" "), jn = [
|
|
|
2416
2423
|
return r ? /* @__PURE__ */ e("div", { ref: t, children: /* @__PURE__ */ d(
|
|
2417
2424
|
"button",
|
|
2418
2425
|
{
|
|
2419
|
-
className:
|
|
2426
|
+
className: h("cursor-pointer ring-0 hover:ring-[length:var(--control-ring-width)] active:ring-[length:var(--control-ring-width-active)] transition-all duration-[var(--control-transition-duration-fast)] select-none focus:outline-none focus:ring-[length:var(--control-ring-width)]", c),
|
|
2420
2427
|
onClick: r,
|
|
2421
2428
|
children: [
|
|
2422
2429
|
i && /* @__PURE__ */ e(i, { className: "h-4 w-4 shrink-0" }),
|
|
@@ -2443,46 +2450,46 @@ function Br(n) {
|
|
|
2443
2450
|
itemCount: o,
|
|
2444
2451
|
deps: i = [],
|
|
2445
2452
|
gap: s = 4
|
|
2446
|
-
} = n, [c,
|
|
2453
|
+
} = n, [c, g] = W(0);
|
|
2447
2454
|
return St(() => {
|
|
2448
2455
|
if (!t) return;
|
|
2449
|
-
const R = l.current,
|
|
2450
|
-
if (!R || !
|
|
2456
|
+
const R = l.current, w = a.current;
|
|
2457
|
+
if (!R || !w) return;
|
|
2451
2458
|
const m = () => {
|
|
2452
2459
|
if (o === 0) {
|
|
2453
|
-
|
|
2460
|
+
g(0);
|
|
2454
2461
|
return;
|
|
2455
2462
|
}
|
|
2456
2463
|
if (o === 1) {
|
|
2457
|
-
|
|
2464
|
+
g(1);
|
|
2458
2465
|
return;
|
|
2459
2466
|
}
|
|
2460
|
-
const f = window.getComputedStyle(R), p = parseFloat(f.paddingLeft || "0"),
|
|
2461
|
-
let
|
|
2467
|
+
const f = window.getComputedStyle(R), p = parseFloat(f.paddingLeft || "0"), u = R.getBoundingClientRect(), I = u.left + p;
|
|
2468
|
+
let b = u.right - parseFloat(f.paddingRight || "0");
|
|
2462
2469
|
const N = r?.current;
|
|
2463
2470
|
if (N) {
|
|
2464
|
-
const
|
|
2465
|
-
|
|
2471
|
+
const x = N.getBoundingClientRect();
|
|
2472
|
+
x.width > 0 && (b = Math.min(b, x.left - s));
|
|
2466
2473
|
}
|
|
2467
|
-
const
|
|
2474
|
+
const y = Math.max(0, b - I), S = Array.from(w.children);
|
|
2468
2475
|
if (S.length < o + 1) return;
|
|
2469
2476
|
let z = 0;
|
|
2470
|
-
for (let
|
|
2471
|
-
z += S[
|
|
2472
|
-
if (z <=
|
|
2473
|
-
|
|
2477
|
+
for (let x = 0; x < o; x++)
|
|
2478
|
+
z += S[x].offsetWidth + (x > 0 ? s : 0);
|
|
2479
|
+
if (z <= y) {
|
|
2480
|
+
g(o);
|
|
2474
2481
|
return;
|
|
2475
2482
|
}
|
|
2476
2483
|
const L = S[o].offsetWidth;
|
|
2477
|
-
let
|
|
2478
|
-
for (let
|
|
2479
|
-
const
|
|
2480
|
-
if (
|
|
2481
|
-
|
|
2484
|
+
let P = 0, O = 0;
|
|
2485
|
+
for (let x = 0; x < o; x++) {
|
|
2486
|
+
const C = S[x].offsetWidth, T = P + C + (x > 0 ? s : 0);
|
|
2487
|
+
if (T + L + s > y) break;
|
|
2488
|
+
P = T, O++;
|
|
2482
2489
|
}
|
|
2483
|
-
|
|
2484
|
-
},
|
|
2485
|
-
return
|
|
2490
|
+
g(Math.max(1, O));
|
|
2491
|
+
}, v = new ResizeObserver(m);
|
|
2492
|
+
return v.observe(R), r?.current && v.observe(r.current), m(), () => v.disconnect();
|
|
2486
2493
|
}, [t, o, ...i]), c;
|
|
2487
2494
|
}
|
|
2488
2495
|
const Lo = (n) => {
|
|
@@ -2495,111 +2502,111 @@ const Lo = (n) => {
|
|
|
2495
2502
|
onSearch: i,
|
|
2496
2503
|
value: s,
|
|
2497
2504
|
placeholder: c,
|
|
2498
|
-
maxHeight:
|
|
2505
|
+
maxHeight: g = 300,
|
|
2499
2506
|
error: R,
|
|
2500
|
-
size:
|
|
2507
|
+
size: w = "md",
|
|
2501
2508
|
singleLine: m = !1,
|
|
2502
|
-
color:
|
|
2509
|
+
color: v = "blue",
|
|
2503
2510
|
disabled: f = !1,
|
|
2504
2511
|
clearable: p = !1
|
|
2505
|
-
} = n, [
|
|
2506
|
-
() => s.map((D) => r.find((
|
|
2512
|
+
} = n, [u, I] = W(!1), [b, N] = W(r), [y, S] = W(""), [z, L] = W(null), P = k.useRef(null), O = k.useRef(null), x = k.useRef([]), C = k.useRef(null), T = k.useRef(null), E = se(
|
|
2513
|
+
() => s.map((D) => r.find((M) => H(M) && J(M.value, D))).filter((D) => D !== void 0),
|
|
2507
2514
|
[s, r]
|
|
2508
|
-
),
|
|
2515
|
+
), _ = (D) => {
|
|
2509
2516
|
if (D === "") return r;
|
|
2510
|
-
const
|
|
2511
|
-
return r.filter((Ie) => H(Ie) && typeof Ie.label == "string" ? Ie.label.toLowerCase().includes(
|
|
2512
|
-
},
|
|
2513
|
-
() =>
|
|
2514
|
-
[
|
|
2517
|
+
const M = D.toLowerCase();
|
|
2518
|
+
return r.filter((Ie) => H(Ie) && typeof Ie.label == "string" ? Ie.label.toLowerCase().includes(M) : !0);
|
|
2519
|
+
}, $ = se(
|
|
2520
|
+
() => y !== "" ? b : r,
|
|
2521
|
+
[y, b, r]
|
|
2515
2522
|
), ae = se(
|
|
2516
|
-
() =>
|
|
2517
|
-
[
|
|
2523
|
+
() => $.map((D, M) => !H(D) || D.disabled ? M : -1).filter((D) => D !== -1),
|
|
2524
|
+
[$]
|
|
2518
2525
|
);
|
|
2519
|
-
xe(
|
|
2520
|
-
N((i ??
|
|
2521
|
-
}, [
|
|
2522
|
-
if (
|
|
2526
|
+
xe(u, () => I(!1)), j(() => {
|
|
2527
|
+
N((i ?? _)(y));
|
|
2528
|
+
}, [y, r, i]), j(() => {
|
|
2529
|
+
if (u) {
|
|
2523
2530
|
setTimeout(() => O.current?.focus(), 100);
|
|
2524
|
-
const D = r.findIndex((
|
|
2531
|
+
const D = r.findIndex((M) => H(M) && !M.disabled);
|
|
2525
2532
|
L(D >= 0 ? D : null);
|
|
2526
2533
|
} else
|
|
2527
2534
|
L(null), S("");
|
|
2528
|
-
}, [
|
|
2529
|
-
if (!
|
|
2530
|
-
const D =
|
|
2535
|
+
}, [u]), j(() => {
|
|
2536
|
+
if (!u) return;
|
|
2537
|
+
const D = $.findIndex((M) => H(M) && !M.disabled);
|
|
2531
2538
|
L(D >= 0 ? D : null);
|
|
2532
|
-
}, [
|
|
2533
|
-
const
|
|
2539
|
+
}, [y, u, $]);
|
|
2540
|
+
const Ne = Br({
|
|
2534
2541
|
enabled: m,
|
|
2535
|
-
triggerRef:
|
|
2536
|
-
measureRef:
|
|
2537
|
-
trayRef:
|
|
2538
|
-
itemCount:
|
|
2539
|
-
deps: [
|
|
2540
|
-
}), { anchorRef:
|
|
2542
|
+
triggerRef: P,
|
|
2543
|
+
measureRef: C,
|
|
2544
|
+
trayRef: T,
|
|
2545
|
+
itemCount: E.length,
|
|
2546
|
+
deps: [E, R]
|
|
2547
|
+
}), { anchorRef: F, Popover: U, getReferenceProps: le, getItemProps: re } = _e({
|
|
2541
2548
|
placement: "bottom",
|
|
2542
2549
|
fullWidth: !0,
|
|
2543
2550
|
minWidth: 200,
|
|
2544
|
-
open:
|
|
2551
|
+
open: u,
|
|
2545
2552
|
onOpenChange: I,
|
|
2546
|
-
listRef:
|
|
2553
|
+
listRef: x,
|
|
2547
2554
|
activeIndex: z,
|
|
2548
2555
|
onNavigate: L,
|
|
2549
2556
|
disabledIndices: ae
|
|
2550
2557
|
}), ze = (D) => {
|
|
2551
|
-
s.some((
|
|
2558
|
+
s.some((M) => J(M, D)) ? o(s.filter((M) => !J(M, D))) : o([...s, D]);
|
|
2552
2559
|
}, Oe = (D) => {
|
|
2553
|
-
const
|
|
2554
|
-
|
|
2555
|
-
}, B =
|
|
2556
|
-
return /* @__PURE__ */ e(q.Provider, { value:
|
|
2560
|
+
const M = $[D];
|
|
2561
|
+
M && H(M) && !M.disabled && ze(M.value);
|
|
2562
|
+
}, B = $.some((D) => H(D)), A = s.length > 0, ie = m ? Ne : E.length, pe = E.slice(0, ie), ft = E.length - ie;
|
|
2563
|
+
return /* @__PURE__ */ e(q.Provider, { value: w, children: /* @__PURE__ */ d(
|
|
2557
2564
|
"div",
|
|
2558
2565
|
{
|
|
2559
|
-
className:
|
|
2566
|
+
className: h(
|
|
2560
2567
|
"flex flex-col",
|
|
2561
2568
|
t
|
|
2562
2569
|
),
|
|
2563
2570
|
children: [
|
|
2564
2571
|
/* @__PURE__ */ e(Z, { children: l }),
|
|
2565
|
-
/* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref:
|
|
2572
|
+
/* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: F, children: [
|
|
2566
2573
|
/* @__PURE__ */ d(
|
|
2567
2574
|
"div",
|
|
2568
2575
|
{
|
|
2569
2576
|
...le({
|
|
2570
|
-
ref:
|
|
2577
|
+
ref: P,
|
|
2571
2578
|
role: "button",
|
|
2572
2579
|
tabIndex: f ? -1 : 0,
|
|
2573
2580
|
"aria-disabled": f,
|
|
2574
2581
|
onClick: () => {
|
|
2575
|
-
f || I(!
|
|
2582
|
+
f || I(!u);
|
|
2576
2583
|
},
|
|
2577
2584
|
onKeyDown: (D) => {
|
|
2578
|
-
f || (D.key === " " ? (D.preventDefault(), I((
|
|
2585
|
+
f || (D.key === " " ? (D.preventDefault(), I((M) => !M)) : D.key === "Enter" && !u ? (D.preventDefault(), I(!0)) : D.key === "Backspace" && !u && A && (D.preventDefault(), o(s.slice(0, -1))));
|
|
2579
2586
|
}
|
|
2580
2587
|
}),
|
|
2581
|
-
className:
|
|
2588
|
+
className: h(
|
|
2582
2589
|
"flex flex-row items-center gap-1 border-[length:var(--border-width-input)] select-trigger transition-all duration-[var(--control-transition-duration)] rounded-[var(--border-radius-input)] shadow-[var(--shadow-control)] ring-0 focus:ring-[length:var(--control-ring-width)] focus:outline-none select-none font-[number:var(--font-weight-input-text)] font-[family-name:var(--font-family-base)]",
|
|
2583
|
-
m &&
|
|
2584
|
-
!m &&
|
|
2585
|
-
G[
|
|
2586
|
-
he[
|
|
2587
|
-
p && A ? Be[
|
|
2590
|
+
m && h("flex-nowrap overflow-hidden", Q[w]),
|
|
2591
|
+
!m && h("flex-wrap py-1.5", Bt[w]),
|
|
2592
|
+
G[w],
|
|
2593
|
+
he[w],
|
|
2594
|
+
p && A ? Be[w] : fe[w],
|
|
2588
2595
|
f ? "select-trigger-disabled" : R && "select-trigger-error",
|
|
2589
|
-
!f &&
|
|
2596
|
+
!f && u && "ring-[length:var(--control-ring-width)]"
|
|
2590
2597
|
),
|
|
2591
2598
|
children: [
|
|
2592
|
-
A && pe.map((D,
|
|
2599
|
+
A && pe.map((D, M) => /* @__PURE__ */ e(
|
|
2593
2600
|
Ee,
|
|
2594
2601
|
{
|
|
2595
|
-
color:
|
|
2596
|
-
className:
|
|
2602
|
+
color: v,
|
|
2603
|
+
className: h(
|
|
2597
2604
|
m && ie > 1 && "shrink-0",
|
|
2598
2605
|
(!m || ie === 1) && "max-w-full min-w-0"
|
|
2599
2606
|
),
|
|
2600
2607
|
children: D.label
|
|
2601
2608
|
},
|
|
2602
|
-
`badge-${
|
|
2609
|
+
`badge-${M}`
|
|
2603
2610
|
)),
|
|
2604
2611
|
A && ft > 0 && /* @__PURE__ */ d("span", { className: "shrink-0 text-sm font-[number:var(--font-weight-input-option-label)] select-placeholder px-1", children: [
|
|
2605
2612
|
"+",
|
|
@@ -2613,25 +2620,25 @@ const Lo = (n) => {
|
|
|
2613
2620
|
m && /* @__PURE__ */ d(
|
|
2614
2621
|
"div",
|
|
2615
2622
|
{
|
|
2616
|
-
ref:
|
|
2623
|
+
ref: C,
|
|
2617
2624
|
"aria-hidden": !0,
|
|
2618
2625
|
className: "absolute top-0 left-0 invisible pointer-events-none flex flex-row flex-nowrap items-center gap-1 w-max",
|
|
2619
2626
|
children: [
|
|
2620
|
-
|
|
2621
|
-
|
|
2627
|
+
E.map((D, M) => /* @__PURE__ */ e(Ee, { color: v, children: D.label }, `measure-${M}`)),
|
|
2628
|
+
E.length > 0 && /* @__PURE__ */ d("span", { className: "text-sm font-[number:var(--font-weight-input-option-label)] px-1", children: [
|
|
2622
2629
|
"+",
|
|
2623
|
-
|
|
2630
|
+
E.length,
|
|
2624
2631
|
" more"
|
|
2625
2632
|
] })
|
|
2626
2633
|
]
|
|
2627
2634
|
}
|
|
2628
2635
|
),
|
|
2629
|
-
/* @__PURE__ */ d(me, { ref:
|
|
2636
|
+
/* @__PURE__ */ d(me, { ref: T, children: [
|
|
2630
2637
|
!f && R && /* @__PURE__ */ e(oe, {}),
|
|
2631
2638
|
p && A && !f && /* @__PURE__ */ e(te, { Icon: de, onClick: () => o([]) }),
|
|
2632
2639
|
/* @__PURE__ */ e(te, { Icon: ve })
|
|
2633
2640
|
] }),
|
|
2634
|
-
/* @__PURE__ */ e(U, { open:
|
|
2641
|
+
/* @__PURE__ */ e(U, { open: u, children: /* @__PURE__ */ d(be, { className: "gap-0 !p-0", style: { maxHeight: g }, children: [
|
|
2635
2642
|
/* @__PURE__ */ d("div", { className: "sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm", children: [
|
|
2636
2643
|
/* @__PURE__ */ e(
|
|
2637
2644
|
"input",
|
|
@@ -2639,37 +2646,37 @@ const Lo = (n) => {
|
|
|
2639
2646
|
ref: O,
|
|
2640
2647
|
type: "text",
|
|
2641
2648
|
placeholder: "Search",
|
|
2642
|
-
value:
|
|
2649
|
+
value: y,
|
|
2643
2650
|
className: "appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-[var(--control-transition-duration)] focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",
|
|
2644
2651
|
onChange: (D) => S(D.target.value),
|
|
2645
2652
|
onKeyDown: (D) => {
|
|
2646
|
-
D.key === "Enter" && z != null ? (D.preventDefault(), Oe(z)) : D.key === "Backspace" &&
|
|
2653
|
+
D.key === "Enter" && z != null ? (D.preventDefault(), Oe(z)) : D.key === "Backspace" && y === "" && A && (D.preventDefault(), o(s.slice(0, -1)));
|
|
2647
2654
|
}
|
|
2648
2655
|
}
|
|
2649
2656
|
),
|
|
2650
2657
|
/* @__PURE__ */ e(Fe, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
|
|
2651
2658
|
] }),
|
|
2652
2659
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1 p-2", children: [
|
|
2653
|
-
|
|
2654
|
-
|
|
2660
|
+
y !== "" && !B && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
|
|
2661
|
+
$.map((D, M) => {
|
|
2655
2662
|
if (!H(D))
|
|
2656
2663
|
return D.kind === "header" ? /* @__PURE__ */ e(
|
|
2657
2664
|
He,
|
|
2658
2665
|
{
|
|
2659
2666
|
ref: (ge) => {
|
|
2660
|
-
|
|
2667
|
+
x.current[M] = ge;
|
|
2661
2668
|
},
|
|
2662
2669
|
children: D.label
|
|
2663
2670
|
},
|
|
2664
|
-
`header-${
|
|
2671
|
+
`header-${M}`
|
|
2665
2672
|
) : /* @__PURE__ */ e(
|
|
2666
2673
|
$e,
|
|
2667
2674
|
{
|
|
2668
2675
|
ref: (ge) => {
|
|
2669
|
-
|
|
2676
|
+
x.current[M] = ge;
|
|
2670
2677
|
}
|
|
2671
2678
|
},
|
|
2672
|
-
`divider-${
|
|
2679
|
+
`divider-${M}`
|
|
2673
2680
|
);
|
|
2674
2681
|
const Ie = s.some((ge) => J(ge, D.value));
|
|
2675
2682
|
return /* @__PURE__ */ e(
|
|
@@ -2677,16 +2684,16 @@ const Lo = (n) => {
|
|
|
2677
2684
|
{
|
|
2678
2685
|
...re({
|
|
2679
2686
|
ref(ge) {
|
|
2680
|
-
|
|
2687
|
+
x.current[M] = ge;
|
|
2681
2688
|
}
|
|
2682
2689
|
}),
|
|
2683
|
-
onClick: () => Oe(
|
|
2690
|
+
onClick: () => Oe(M),
|
|
2684
2691
|
selected: Ie,
|
|
2685
|
-
active: z ===
|
|
2692
|
+
active: z === M,
|
|
2686
2693
|
disabled: D.disabled,
|
|
2687
2694
|
children: D.label
|
|
2688
2695
|
},
|
|
2689
|
-
`option-${
|
|
2696
|
+
`option-${M}`
|
|
2690
2697
|
);
|
|
2691
2698
|
})
|
|
2692
2699
|
] })
|
|
@@ -2697,7 +2704,7 @@ const Lo = (n) => {
|
|
|
2697
2704
|
]
|
|
2698
2705
|
}
|
|
2699
2706
|
) });
|
|
2700
|
-
}, Eo =
|
|
2707
|
+
}, Eo = k.forwardRef((n, t) => {
|
|
2701
2708
|
const {
|
|
2702
2709
|
className: l,
|
|
2703
2710
|
children: a,
|
|
@@ -2707,7 +2714,7 @@ const Lo = (n) => {
|
|
|
2707
2714
|
"div",
|
|
2708
2715
|
{
|
|
2709
2716
|
ref: t,
|
|
2710
|
-
className:
|
|
2717
|
+
className: h(
|
|
2711
2718
|
"flex flex-col gap-6 border-[length:var(--border-width-input)] panel-base rounded-[var(--border-radius-panel)] shadow-[var(--shadow-control)] px-6 py-6",
|
|
2712
2719
|
l
|
|
2713
2720
|
),
|
|
@@ -2715,7 +2722,7 @@ const Lo = (n) => {
|
|
|
2715
2722
|
children: a
|
|
2716
2723
|
}
|
|
2717
2724
|
);
|
|
2718
|
-
}), Fo =
|
|
2725
|
+
}), Fo = k.forwardRef((n, t) => {
|
|
2719
2726
|
const {
|
|
2720
2727
|
className: l,
|
|
2721
2728
|
children: a,
|
|
@@ -2725,7 +2732,7 @@ const Lo = (n) => {
|
|
|
2725
2732
|
"div",
|
|
2726
2733
|
{
|
|
2727
2734
|
ref: t,
|
|
2728
|
-
className:
|
|
2735
|
+
className: h(
|
|
2729
2736
|
"flex flex-col gap-1 border-[length:var(--border-width-input)] panel-base rounded-[var(--border-radius-panel)] shadow-[var(--shadow-control)] p-2",
|
|
2730
2737
|
l
|
|
2731
2738
|
),
|
|
@@ -2744,20 +2751,20 @@ const Lo = (n) => {
|
|
|
2744
2751
|
return r === "horizontal" ? /* @__PURE__ */ d(
|
|
2745
2752
|
"div",
|
|
2746
2753
|
{
|
|
2747
|
-
className:
|
|
2754
|
+
className: h(
|
|
2748
2755
|
"flex flex-row items-center gap-3 px-3 py-2",
|
|
2749
2756
|
t
|
|
2750
2757
|
),
|
|
2751
2758
|
...o,
|
|
2752
2759
|
children: [
|
|
2753
|
-
/* @__PURE__ */ e("div", { className:
|
|
2760
|
+
/* @__PURE__ */ e("div", { className: h(Ct, "w-1/2 line-clamp-1 break-all"), children: l }),
|
|
2754
2761
|
/* @__PURE__ */ e("div", { className: "w-1/2 line-clamp-1 break-all", children: a })
|
|
2755
2762
|
]
|
|
2756
2763
|
}
|
|
2757
2764
|
) : /* @__PURE__ */ d(
|
|
2758
2765
|
"div",
|
|
2759
2766
|
{
|
|
2760
|
-
className:
|
|
2767
|
+
className: h(
|
|
2761
2768
|
"flex flex-col gap-1 px-3 py-2",
|
|
2762
2769
|
t
|
|
2763
2770
|
),
|
|
@@ -2791,18 +2798,18 @@ const Lo = (n) => {
|
|
|
2791
2798
|
/* @__PURE__ */ e("span", { className: "truncate", children: l })
|
|
2792
2799
|
] }),
|
|
2793
2800
|
/* @__PURE__ */ d("span", { className: "inline-flex flex-row items-center gap-2 shrink-0", children: [
|
|
2794
|
-
i && r && /* @__PURE__ */ e(i, { className:
|
|
2801
|
+
i && r && /* @__PURE__ */ e(i, { className: h("h-5 w-5", Ur[r]) }),
|
|
2795
2802
|
/* @__PURE__ */ e(un, { className: "h-5 w-5 text-[var(--color-input-icon-button-icon)]" })
|
|
2796
2803
|
] })
|
|
2797
2804
|
] });
|
|
2798
2805
|
if (o.href !== void 0) {
|
|
2799
|
-
const { href: c, ...
|
|
2806
|
+
const { href: c, ...g } = o;
|
|
2800
2807
|
return /* @__PURE__ */ e(
|
|
2801
2808
|
"a",
|
|
2802
2809
|
{
|
|
2803
2810
|
href: c,
|
|
2804
|
-
className:
|
|
2805
|
-
...
|
|
2811
|
+
className: h(It, t),
|
|
2812
|
+
...g,
|
|
2806
2813
|
children: s
|
|
2807
2814
|
}
|
|
2808
2815
|
);
|
|
@@ -2810,7 +2817,7 @@ const Lo = (n) => {
|
|
|
2810
2817
|
return /* @__PURE__ */ e(
|
|
2811
2818
|
"button",
|
|
2812
2819
|
{
|
|
2813
|
-
className:
|
|
2820
|
+
className: h(It, t),
|
|
2814
2821
|
...o,
|
|
2815
2822
|
children: s
|
|
2816
2823
|
}
|
|
@@ -2824,7 +2831,7 @@ const Lo = (n) => {
|
|
|
2824
2831
|
return /* @__PURE__ */ e(
|
|
2825
2832
|
"div",
|
|
2826
2833
|
{
|
|
2827
|
-
className:
|
|
2834
|
+
className: h(
|
|
2828
2835
|
l ? "w-px h-full bg-[var(--color-divider)]" : "w-full h-px bg-[var(--color-divider)]",
|
|
2829
2836
|
t
|
|
2830
2837
|
),
|
|
@@ -2839,7 +2846,7 @@ const Lo = (n) => {
|
|
|
2839
2846
|
placement: r = "top",
|
|
2840
2847
|
minWidth: o = 100,
|
|
2841
2848
|
maxWidth: i = 200
|
|
2842
|
-
} = n, [s, c] = W(!1), { anchorRef:
|
|
2849
|
+
} = n, [s, c] = W(!1), { anchorRef: g, Popover: R } = ut({
|
|
2843
2850
|
placement: r,
|
|
2844
2851
|
minWidth: o,
|
|
2845
2852
|
maxWidth: i
|
|
@@ -2847,7 +2854,7 @@ const Lo = (n) => {
|
|
|
2847
2854
|
return /* @__PURE__ */ d(
|
|
2848
2855
|
"span",
|
|
2849
2856
|
{
|
|
2850
|
-
ref:
|
|
2857
|
+
ref: g,
|
|
2851
2858
|
className: a,
|
|
2852
2859
|
onMouseEnter: () => c(!0),
|
|
2853
2860
|
onMouseLeave: () => c(!1),
|
|
@@ -2892,7 +2899,7 @@ const Lo = (n) => {
|
|
|
2892
2899
|
/* @__PURE__ */ e("div", { className: "fixed inset-0 flex flex-col items-center pointer-events-none p-4 lg:p-12 overflow-y-auto z-50", children: /* @__PURE__ */ d(
|
|
2893
2900
|
Y.div,
|
|
2894
2901
|
{
|
|
2895
|
-
className:
|
|
2902
|
+
className: h(
|
|
2896
2903
|
"flex flex-col modal-content rounded-[var(--border-radius-panel)] shadow-[var(--shadow-overlay)] p-6 lg:p-12 pointer-events-auto w-full relative",
|
|
2897
2904
|
i
|
|
2898
2905
|
),
|
|
@@ -2952,7 +2959,7 @@ const Lo = (n) => {
|
|
|
2952
2959
|
/* @__PURE__ */ e("div", { className: "fixed inset-0 flex flex-row justify-end pointer-events-none z-50", children: /* @__PURE__ */ d(
|
|
2953
2960
|
Y.div,
|
|
2954
2961
|
{
|
|
2955
|
-
className:
|
|
2962
|
+
className: h(
|
|
2956
2963
|
"flex flex-col modal-content shadow-[var(--shadow-overlay)] p-6 lg:p-12 pointer-events-auto h-full w-full overflow-y-auto relative",
|
|
2957
2964
|
i
|
|
2958
2965
|
),
|
|
@@ -2983,21 +2990,21 @@ const Lo = (n) => {
|
|
|
2983
2990
|
tabs: l,
|
|
2984
2991
|
size: a = "md"
|
|
2985
2992
|
} = n;
|
|
2986
|
-
return /* @__PURE__ */ e(q.Provider, { value: a, children: /* @__PURE__ */ e("div", { className:
|
|
2993
|
+
return /* @__PURE__ */ e(q.Provider, { value: a, children: /* @__PURE__ */ e("div", { className: h(
|
|
2987
2994
|
"tab-container p-1 rounded-[var(--border-radius-tab)] inline-flex flex-row space-x-1 overflow-x-auto mat-ui-hide-scrollbars",
|
|
2988
2995
|
Q[a],
|
|
2989
2996
|
t
|
|
2990
2997
|
), children: l.map((r, o) => {
|
|
2991
|
-
const i =
|
|
2998
|
+
const i = h(
|
|
2992
2999
|
"shrink-0 h-full inline-flex flex-row items-center font-[number:var(--font-weight-tab)] font-[family-name:var(--font-family-base)] rounded-[var(--border-radius-tab)] cursor-pointer border border-transparent ring-0 tab-button transition-all duration-[var(--control-transition-duration)] select-none focus:outline-none focus:ring-0",
|
|
2993
3000
|
ct[a],
|
|
2994
3001
|
G[a],
|
|
2995
3002
|
st[a],
|
|
2996
3003
|
r.active && "tab-button-active shadow-[var(--shadow-control)]"
|
|
2997
3004
|
), s = /* @__PURE__ */ d(ne, { children: [
|
|
2998
|
-
r.Icon && /* @__PURE__ */ e(r.Icon, { className:
|
|
3005
|
+
r.Icon && /* @__PURE__ */ e(r.Icon, { className: h(ee[a], "shrink-0 -ml-1") }),
|
|
2999
3006
|
r.label,
|
|
3000
|
-
r.count != null && /* @__PURE__ */ e("span", { className:
|
|
3007
|
+
r.count != null && /* @__PURE__ */ e("span", { className: h(
|
|
3001
3008
|
"shrink-0 inline-flex items-center justify-center h-5 min-w-5 px-1.5 rounded-full font-[number:var(--font-weight-tab-count)] font-[family-name:var(--font-family-base)] text-[length:var(--font-size-tab-count)]",
|
|
3002
3009
|
r.active ? "tab-button-count-active" : "tab-button-count"
|
|
3003
3010
|
), children: r.count })
|
|
@@ -3026,11 +3033,11 @@ const Lo = (n) => {
|
|
|
3026
3033
|
tabs: l,
|
|
3027
3034
|
size: a = "md"
|
|
3028
3035
|
} = n;
|
|
3029
|
-
return /* @__PURE__ */ e(q.Provider, { value: a, children: /* @__PURE__ */ e("div", { className:
|
|
3036
|
+
return /* @__PURE__ */ e(q.Provider, { value: a, children: /* @__PURE__ */ e("div", { className: h(
|
|
3030
3037
|
"tabs-container w-full flex flex-row border-b-[length:var(--border-width-input)] overflow-x-auto mat-ui-hide-scrollbars",
|
|
3031
3038
|
t
|
|
3032
3039
|
), children: l.map((r, o) => {
|
|
3033
|
-
const i =
|
|
3040
|
+
const i = h(
|
|
3034
3041
|
"tabs-tab shrink-0 -mb-[var(--border-width-input)] inline-flex flex-row items-center font-[number:var(--font-weight-tabs)] font-[family-name:var(--font-family-base)] cursor-pointer border-b-[length:var(--border-width-tabs-indicator)] ring-0 transition-colors duration-[var(--control-transition-duration)] select-none focus:outline-none focus:ring-0",
|
|
3035
3042
|
Q[a],
|
|
3036
3043
|
ct[a],
|
|
@@ -3038,9 +3045,9 @@ const Lo = (n) => {
|
|
|
3038
3045
|
st[a],
|
|
3039
3046
|
r.active ? "tabs-tab-active" : "border-transparent"
|
|
3040
3047
|
), s = /* @__PURE__ */ d(ne, { children: [
|
|
3041
|
-
r.Icon && /* @__PURE__ */ e(r.Icon, { className:
|
|
3048
|
+
r.Icon && /* @__PURE__ */ e(r.Icon, { className: h(ee[a], "shrink-0") }),
|
|
3042
3049
|
r.label,
|
|
3043
|
-
r.count != null && /* @__PURE__ */ e("span", { className:
|
|
3050
|
+
r.count != null && /* @__PURE__ */ e("span", { className: h(
|
|
3044
3051
|
"shrink-0 inline-flex items-center justify-center h-5 min-w-5 px-1.5 rounded-full font-[number:var(--font-weight-tab-count)] font-[family-name:var(--font-family-base)] text-[length:var(--font-size-tab-count)]",
|
|
3045
3052
|
r.active ? "tabs-tab-count-active" : "tabs-tab-count"
|
|
3046
3053
|
), children: r.count })
|
|
@@ -3073,27 +3080,27 @@ const Lo = (n) => {
|
|
|
3073
3080
|
onPinnedChange: i,
|
|
3074
3081
|
children: s,
|
|
3075
3082
|
className: c,
|
|
3076
|
-
...
|
|
3077
|
-
} = n, R =
|
|
3078
|
-
return p.current = i,
|
|
3079
|
-
const
|
|
3080
|
-
if (!
|
|
3081
|
-
let
|
|
3082
|
-
const N = () => a ?
|
|
3083
|
-
a ?
|
|
3084
|
-
}, z = (
|
|
3085
|
-
|
|
3083
|
+
...g
|
|
3084
|
+
} = n, R = k.useRef(null), w = k.useRef(null), m = k.useRef(null), v = k.useRef(!0), f = k.useRef(!1), p = k.useRef(i);
|
|
3085
|
+
return p.current = i, k.useEffect(() => {
|
|
3086
|
+
const u = R.current, I = w.current;
|
|
3087
|
+
if (!u || !I) return;
|
|
3088
|
+
let b = !0;
|
|
3089
|
+
const N = () => a ? u.scrollWidth - u.clientWidth : u.scrollHeight - u.clientHeight, y = () => a ? u.scrollLeft : u.scrollTop, S = (C) => {
|
|
3090
|
+
a ? u.scrollLeft = C : u.scrollTop = C;
|
|
3091
|
+
}, z = (C) => {
|
|
3092
|
+
v.current !== C && (v.current = C, p.current?.(C));
|
|
3086
3093
|
}, L = () => {
|
|
3087
|
-
if (r && !
|
|
3088
|
-
const
|
|
3089
|
-
if (!(
|
|
3090
|
-
if (
|
|
3091
|
-
|
|
3094
|
+
if (r && !v.current) return;
|
|
3095
|
+
const C = N(), T = y();
|
|
3096
|
+
if (!(C <= 0 || Math.abs(C - T) < 1)) {
|
|
3097
|
+
if (b) {
|
|
3098
|
+
b = !1, f.current = !0, S(C), requestAnimationFrame(() => {
|
|
3092
3099
|
f.current = !1;
|
|
3093
3100
|
});
|
|
3094
3101
|
return;
|
|
3095
3102
|
}
|
|
3096
|
-
m.current?.stop(), f.current = !0, m.current = qt(
|
|
3103
|
+
m.current?.stop(), f.current = !0, m.current = qt(T, C, {
|
|
3097
3104
|
duration: t,
|
|
3098
3105
|
ease: l,
|
|
3099
3106
|
onUpdate: S,
|
|
@@ -3104,27 +3111,27 @@ const Lo = (n) => {
|
|
|
3104
3111
|
}
|
|
3105
3112
|
});
|
|
3106
3113
|
}
|
|
3107
|
-
},
|
|
3108
|
-
|
|
3114
|
+
}, P = new ResizeObserver(L);
|
|
3115
|
+
P.observe(I);
|
|
3109
3116
|
const O = () => {
|
|
3110
|
-
f.current || z(N() -
|
|
3111
|
-
},
|
|
3117
|
+
f.current || z(N() - y() <= o);
|
|
3118
|
+
}, x = () => {
|
|
3112
3119
|
m.current?.stop(), f.current = !1;
|
|
3113
3120
|
};
|
|
3114
|
-
return r && (
|
|
3115
|
-
|
|
3121
|
+
return r && (u.addEventListener("scroll", O, { passive: !0 }), u.addEventListener("wheel", x, { passive: !0 }), u.addEventListener("touchstart", x, { passive: !0 })), () => {
|
|
3122
|
+
P.disconnect(), m.current?.stop(), r && (u.removeEventListener("scroll", O), u.removeEventListener("wheel", x), u.removeEventListener("touchstart", x));
|
|
3116
3123
|
};
|
|
3117
3124
|
}, [t, l, a, r, o]), /* @__PURE__ */ e(
|
|
3118
3125
|
"div",
|
|
3119
3126
|
{
|
|
3120
3127
|
ref: R,
|
|
3121
|
-
className:
|
|
3128
|
+
className: h(
|
|
3122
3129
|
"min-h-0 min-w-0",
|
|
3123
3130
|
a ? "overflow-x-auto" : "overflow-y-auto",
|
|
3124
3131
|
c
|
|
3125
3132
|
),
|
|
3126
|
-
...
|
|
3127
|
-
children: /* @__PURE__ */ e("div", { ref:
|
|
3133
|
+
...g,
|
|
3134
|
+
children: /* @__PURE__ */ e("div", { ref: w, children: s })
|
|
3128
3135
|
}
|
|
3129
3136
|
);
|
|
3130
3137
|
};
|
|
@@ -3136,61 +3143,61 @@ function Hr(n) {
|
|
|
3136
3143
|
disabled: r = !1,
|
|
3137
3144
|
primaryButtonOnly: o = !0,
|
|
3138
3145
|
preventScrollOnMove: i = !0
|
|
3139
|
-
} = n, [s, c] =
|
|
3140
|
-
|
|
3146
|
+
} = n, [s, c] = k.useState(!1), g = k.useRef(!1), R = k.useRef(0), w = k.useRef(0), m = k.useRef(0), v = k.useRef(null), f = k.useRef(null), p = k.useRef({ onDelta: t, onDragStart: l, onDragEnd: a, preventScrollOnMove: i });
|
|
3147
|
+
k.useEffect(() => {
|
|
3141
3148
|
p.current = { onDelta: t, onDragStart: l, onDragEnd: a, preventScrollOnMove: i };
|
|
3142
3149
|
});
|
|
3143
|
-
const
|
|
3144
|
-
if (!
|
|
3145
|
-
const
|
|
3146
|
-
clientX: N ??
|
|
3150
|
+
const u = k.useRef({}), I = k.useCallback((N) => {
|
|
3151
|
+
if (!g.current) return;
|
|
3152
|
+
const y = {
|
|
3153
|
+
clientX: N ?? w.current,
|
|
3147
3154
|
startX: R.current,
|
|
3148
3155
|
totalDeltaX: m.current,
|
|
3149
|
-
target:
|
|
3156
|
+
target: v.current
|
|
3150
3157
|
};
|
|
3151
|
-
|
|
3152
|
-
const { move: S, up: z, keydown: L } =
|
|
3153
|
-
S && window.removeEventListener("pointermove", S, !0), z && (window.removeEventListener("pointerup", z, !0), window.removeEventListener("pointercancel", z, !0)), L && window.removeEventListener("keydown", L, !0),
|
|
3154
|
-
}, []),
|
|
3158
|
+
g.current = !1, c(!1);
|
|
3159
|
+
const { move: S, up: z, keydown: L } = u.current;
|
|
3160
|
+
S && window.removeEventListener("pointermove", S, !0), z && (window.removeEventListener("pointerup", z, !0), window.removeEventListener("pointercancel", z, !0)), L && window.removeEventListener("keydown", L, !0), u.current = {}, f.current != null && (cancelAnimationFrame(f.current), f.current = null), p.current.onDragEnd?.(y), v.current = null, m.current = 0;
|
|
3161
|
+
}, []), b = k.useCallback((N) => {
|
|
3155
3162
|
if (r || o && N.button !== 0) return;
|
|
3156
|
-
N.target.setPointerCapture?.(N.pointerId), R.current = N.clientX,
|
|
3157
|
-
const
|
|
3163
|
+
N.target.setPointerCapture?.(N.pointerId), R.current = N.clientX, w.current = N.clientX, m.current = 0, v.current = N.target, g.current = !0, c(!0);
|
|
3164
|
+
const y = {
|
|
3158
3165
|
clientX: N.clientX,
|
|
3159
3166
|
startX: N.clientX,
|
|
3160
3167
|
totalDeltaX: 0,
|
|
3161
3168
|
target: N.target
|
|
3162
3169
|
};
|
|
3163
|
-
p.current.onDragStart?.(
|
|
3164
|
-
const S = (
|
|
3165
|
-
|
|
3170
|
+
p.current.onDragStart?.(y);
|
|
3171
|
+
const S = (P) => {
|
|
3172
|
+
g.current && f.current == null && (f.current = requestAnimationFrame(() => {
|
|
3166
3173
|
f.current = null;
|
|
3167
|
-
const O =
|
|
3168
|
-
if (
|
|
3169
|
-
|
|
3170
|
-
const
|
|
3174
|
+
const O = P.clientX, x = O - w.current;
|
|
3175
|
+
if (x === 0) return;
|
|
3176
|
+
w.current = O, m.current += x;
|
|
3177
|
+
const C = {
|
|
3171
3178
|
clientX: O,
|
|
3172
3179
|
startX: R.current,
|
|
3173
3180
|
totalDeltaX: m.current,
|
|
3174
|
-
target:
|
|
3181
|
+
target: v.current
|
|
3175
3182
|
};
|
|
3176
|
-
p.current.preventScrollOnMove &&
|
|
3183
|
+
p.current.preventScrollOnMove && P.preventDefault(), p.current.onDelta(x, C);
|
|
3177
3184
|
}));
|
|
3178
|
-
}, z = (
|
|
3179
|
-
I(
|
|
3180
|
-
}, L = (
|
|
3181
|
-
|
|
3185
|
+
}, z = (P) => {
|
|
3186
|
+
I(P.clientX);
|
|
3187
|
+
}, L = (P) => {
|
|
3188
|
+
P.key === "Escape" && (P.preventDefault(), I());
|
|
3182
3189
|
};
|
|
3183
|
-
|
|
3190
|
+
u.current = { move: S, up: z, keydown: L }, window.addEventListener("pointermove", S, {
|
|
3184
3191
|
passive: !i,
|
|
3185
3192
|
capture: !0
|
|
3186
3193
|
}), window.addEventListener("pointerup", z, { capture: !0 }), window.addEventListener("pointercancel", z, { capture: !0 }), window.addEventListener("keydown", L, !0);
|
|
3187
3194
|
}, [I, r, i, o]);
|
|
3188
|
-
return
|
|
3189
|
-
|
|
3195
|
+
return k.useEffect(() => () => {
|
|
3196
|
+
g.current && I();
|
|
3190
3197
|
}, [I]), {
|
|
3191
3198
|
isDragging: s,
|
|
3192
3199
|
bind: {
|
|
3193
|
-
onPointerDown:
|
|
3200
|
+
onPointerDown: b,
|
|
3194
3201
|
role: "separator",
|
|
3195
3202
|
style: { touchAction: "none", cursor: "col-resize", userSelect: "none" }
|
|
3196
3203
|
}
|
|
@@ -3205,7 +3212,7 @@ const $r = (n) => {
|
|
|
3205
3212
|
sortDirection: o,
|
|
3206
3213
|
onSortClick: i
|
|
3207
3214
|
} = n, s = !!t.sortable, { bind: c } = Hr({
|
|
3208
|
-
onDelta: (
|
|
3215
|
+
onDelta: (g) => r(g)
|
|
3209
3216
|
});
|
|
3210
3217
|
return /* @__PURE__ */ d(
|
|
3211
3218
|
"div",
|
|
@@ -3216,7 +3223,7 @@ const $r = (n) => {
|
|
|
3216
3223
|
/* @__PURE__ */ d(
|
|
3217
3224
|
"div",
|
|
3218
3225
|
{
|
|
3219
|
-
className:
|
|
3226
|
+
className: h(
|
|
3220
3227
|
"flex-1 min-w-0 px-4 table-header-cell transition-colors duration-[var(--control-transition-duration-fast)] flex flex-row items-center gap-2",
|
|
3221
3228
|
s && "cursor-pointer"
|
|
3222
3229
|
),
|
|
@@ -3259,64 +3266,64 @@ const $r = (n) => {
|
|
|
3259
3266
|
onSortChange: i,
|
|
3260
3267
|
className: s,
|
|
3261
3268
|
rowHeight: c = 44,
|
|
3262
|
-
headerHeight:
|
|
3269
|
+
headerHeight: g = 44,
|
|
3263
3270
|
emptyState: R
|
|
3264
|
-
} = n, [
|
|
3265
|
-
|
|
3266
|
-
m((
|
|
3271
|
+
} = n, [w, m] = W(() => jr(t));
|
|
3272
|
+
j(() => {
|
|
3273
|
+
m((b) => {
|
|
3267
3274
|
const N = {};
|
|
3268
|
-
let
|
|
3275
|
+
let y = Object.keys(b).length !== t.length;
|
|
3269
3276
|
for (const S of t)
|
|
3270
|
-
S.id in
|
|
3271
|
-
return
|
|
3277
|
+
S.id in b ? N[S.id] = b[S.id] : (N[S.id] = S.defaultWidth ?? ke, y = !0);
|
|
3278
|
+
return y ? N : b;
|
|
3272
3279
|
});
|
|
3273
3280
|
}, [t]);
|
|
3274
|
-
const
|
|
3281
|
+
const v = Pe((b, N, y) => {
|
|
3275
3282
|
m((S) => {
|
|
3276
|
-
const z = S[
|
|
3277
|
-
return L === z ? S : { ...S, [
|
|
3283
|
+
const z = S[b] ?? ke, L = Math.max(y, z + N);
|
|
3284
|
+
return L === z ? S : { ...S, [b]: L };
|
|
3278
3285
|
});
|
|
3279
|
-
}, []), f = Pe((
|
|
3286
|
+
}, []), f = Pe((b) => {
|
|
3280
3287
|
if (i) {
|
|
3281
|
-
if (!o || o.columnId !==
|
|
3282
|
-
i({ columnId:
|
|
3288
|
+
if (!o || o.columnId !== b) {
|
|
3289
|
+
i({ columnId: b, direction: "asc" });
|
|
3283
3290
|
return;
|
|
3284
3291
|
}
|
|
3285
3292
|
if (o.direction === "asc") {
|
|
3286
|
-
i({ columnId:
|
|
3293
|
+
i({ columnId: b, direction: "desc" });
|
|
3287
3294
|
return;
|
|
3288
3295
|
}
|
|
3289
3296
|
i(null);
|
|
3290
3297
|
}
|
|
3291
3298
|
}, [o, i]), p = t.reduce(
|
|
3292
|
-
(
|
|
3299
|
+
(b, N) => b + (w[N.id] ?? N.defaultWidth ?? ke),
|
|
3293
3300
|
0
|
|
3294
|
-
),
|
|
3295
|
-
|
|
3301
|
+
), u = Ce(null), I = (b) => {
|
|
3302
|
+
u.current && (u.current.scrollLeft = b.currentTarget.scrollLeft);
|
|
3296
3303
|
};
|
|
3297
|
-
return /* @__PURE__ */ d("div", { className:
|
|
3304
|
+
return /* @__PURE__ */ d("div", { className: h("flex flex-col h-full w-full", s), children: [
|
|
3298
3305
|
/* @__PURE__ */ e(
|
|
3299
3306
|
"div",
|
|
3300
3307
|
{
|
|
3301
|
-
ref:
|
|
3308
|
+
ref: u,
|
|
3302
3309
|
className: "overflow-hidden shrink-0 table-header-strip",
|
|
3303
|
-
style: { height:
|
|
3310
|
+
style: { height: g },
|
|
3304
3311
|
children: /* @__PURE__ */ e(
|
|
3305
3312
|
"div",
|
|
3306
3313
|
{
|
|
3307
3314
|
className: "flex flex-row table-header font-[number:var(--font-weight-table-header)]",
|
|
3308
3315
|
style: { width: p, minWidth: "100%" },
|
|
3309
|
-
children: t.map((
|
|
3316
|
+
children: t.map((b) => /* @__PURE__ */ e(
|
|
3310
3317
|
$r,
|
|
3311
3318
|
{
|
|
3312
|
-
column:
|
|
3313
|
-
width:
|
|
3314
|
-
height:
|
|
3315
|
-
onResize: (N) => b
|
|
3316
|
-
sortDirection: o?.columnId ===
|
|
3317
|
-
onSortClick: () => f(
|
|
3319
|
+
column: b,
|
|
3320
|
+
width: w[b.id] ?? b.defaultWidth ?? ke,
|
|
3321
|
+
height: g,
|
|
3322
|
+
onResize: (N) => v(b.id, N, b.minWidth ?? _r),
|
|
3323
|
+
sortDirection: o?.columnId === b.id ? o.direction : null,
|
|
3324
|
+
onSortClick: () => f(b.id)
|
|
3318
3325
|
},
|
|
3319
|
-
|
|
3326
|
+
b.id
|
|
3320
3327
|
))
|
|
3321
3328
|
}
|
|
3322
3329
|
)
|
|
@@ -3332,28 +3339,28 @@ const $r = (n) => {
|
|
|
3332
3339
|
{
|
|
3333
3340
|
className: "flex flex-col",
|
|
3334
3341
|
style: { width: p, minWidth: "100%" },
|
|
3335
|
-
children: l.map((
|
|
3342
|
+
children: l.map((b, N) => /* @__PURE__ */ e(
|
|
3336
3343
|
"div",
|
|
3337
3344
|
{
|
|
3338
|
-
className:
|
|
3345
|
+
className: h(
|
|
3339
3346
|
"flex flex-row table-body-row transition-colors duration-[var(--control-transition-duration-fast)]",
|
|
3340
3347
|
r && "cursor-pointer"
|
|
3341
3348
|
),
|
|
3342
|
-
onClick: r ? () => r(
|
|
3343
|
-
children: t.map((
|
|
3349
|
+
onClick: r ? () => r(b, N) : void 0,
|
|
3350
|
+
children: t.map((y) => /* @__PURE__ */ e(
|
|
3344
3351
|
"div",
|
|
3345
3352
|
{
|
|
3346
3353
|
className: "shrink-0 content-center px-4 relative",
|
|
3347
3354
|
style: {
|
|
3348
|
-
width: y
|
|
3355
|
+
width: w[y.id] ?? y.defaultWidth ?? ke,
|
|
3349
3356
|
height: c
|
|
3350
3357
|
},
|
|
3351
|
-
children: /* @__PURE__ */ e("div", { className: "break-all line-clamp-1 font-[number:var(--font-weight-table-cell)]", children:
|
|
3358
|
+
children: /* @__PURE__ */ e("div", { className: "break-all line-clamp-1 font-[number:var(--font-weight-table-cell)]", children: y.renderCell(b, N) })
|
|
3352
3359
|
},
|
|
3353
|
-
|
|
3360
|
+
y.id
|
|
3354
3361
|
))
|
|
3355
3362
|
},
|
|
3356
|
-
a(
|
|
3363
|
+
a(b, N)
|
|
3357
3364
|
))
|
|
3358
3365
|
}
|
|
3359
3366
|
)
|
|
@@ -3362,7 +3369,7 @@ const $r = (n) => {
|
|
|
3362
3369
|
] });
|
|
3363
3370
|
}, jo = (n) => {
|
|
3364
3371
|
const { Icon: t, title: l, description: a, children: r, className: o } = n;
|
|
3365
|
-
return /* @__PURE__ */ d("div", { className:
|
|
3372
|
+
return /* @__PURE__ */ d("div", { className: h("flex flex-col items-center gap-3 text-center", o), children: [
|
|
3366
3373
|
t && /* @__PURE__ */ e("div", { className: "flex h-14 w-14 items-center justify-center rounded-[var(--border-radius-panel)] bg-[var(--color-table-header-bg)]", children: /* @__PURE__ */ e(t, { className: "h-6 w-6 text-[var(--color-input-icon)]" }) }),
|
|
3367
3374
|
(l || a) && /* @__PURE__ */ d("div", { className: "flex flex-col gap-1", children: [
|
|
3368
3375
|
l && /* @__PURE__ */ e("div", { className: "font-[number:var(--font-weight-table-header)] text-[var(--color-input-text)]", children: l }),
|
|
@@ -3372,7 +3379,7 @@ const $r = (n) => {
|
|
|
3372
3379
|
] });
|
|
3373
3380
|
}, Rt = (n) => {
|
|
3374
3381
|
const { label: t, children: l, className: a } = n;
|
|
3375
|
-
return /* @__PURE__ */ d("div", { className:
|
|
3382
|
+
return /* @__PURE__ */ d("div", { className: h("flex flex-col dropdown-button-group", a), children: [
|
|
3376
3383
|
t && /* @__PURE__ */ e("div", { className: "mb-2 text-[length:var(--font-size-label)] dropdown-group-label font-[number:var(--font-weight-group-header)] px-3", children: t }),
|
|
3377
3384
|
l
|
|
3378
3385
|
] });
|
|
@@ -3509,7 +3516,7 @@ export {
|
|
|
3509
3516
|
me as InputIconButtonTray,
|
|
3510
3517
|
Z as InputLabel,
|
|
3511
3518
|
zo as InputLexical,
|
|
3512
|
-
|
|
3519
|
+
No as InputPassword,
|
|
3513
3520
|
ko as InputRadio,
|
|
3514
3521
|
Er as InputSelect,
|
|
3515
3522
|
$e as InputSelectDivider,
|
|
@@ -3519,9 +3526,9 @@ export {
|
|
|
3519
3526
|
We as InputSelectOption,
|
|
3520
3527
|
To as InputSelectSearchable,
|
|
3521
3528
|
Po as InputSelectSearchableAsync,
|
|
3522
|
-
|
|
3529
|
+
yo as InputTextArea,
|
|
3523
3530
|
Co as InputToggle,
|
|
3524
|
-
|
|
3531
|
+
Nr as LEXICAL_NODES,
|
|
3525
3532
|
Cr as LexicalBlockTypeSelect,
|
|
3526
3533
|
Do as LexicalDefaultToolbarContent,
|
|
3527
3534
|
Lr as LexicalFloatingToolbar,
|
|
@@ -3550,8 +3557,8 @@ export {
|
|
|
3550
3557
|
Uo as Tooltip,
|
|
3551
3558
|
wr as UploadFileTile,
|
|
3552
3559
|
H as isSelectOption,
|
|
3553
|
-
|
|
3554
|
-
|
|
3560
|
+
yt as lexicalTheme,
|
|
3561
|
+
yr as useDropdownDismiss,
|
|
3555
3562
|
we as useLexicalToolbar,
|
|
3556
3563
|
Xt as useLexicalToolbarState,
|
|
3557
3564
|
ut as usePopover,
|