@matthiaskrijgsman/mat-ui 0.0.34 → 0.0.35
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 +994 -986
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e, jsxs as d, Fragment as ee } from "react/jsx-runtime";
|
|
3
|
-
import * as
|
|
4
|
-
import { createContext as Qe, useContext as qe, useEffect as $, useState as A, useRef as ke, useCallback as Te, useLayoutEffect as
|
|
5
|
-
import { AnimatePresence as Se, motion as G, animate as
|
|
6
|
-
import { IconExclamationCircleFilled as Ze, IconEyeOff as
|
|
7
|
-
import { FloatingPortal as Me, FloatingOverlay as nt,
|
|
8
|
-
import { mergeRefs as
|
|
9
|
-
import { useDropzone as
|
|
3
|
+
import * as C from "react";
|
|
4
|
+
import { createContext as Qe, useContext as qe, useEffect as $, useState as A, useRef as ke, useCallback as Te, useLayoutEffect as It, useMemo as ae } from "react";
|
|
5
|
+
import { AnimatePresence as Se, motion as G, animate as Xt } from "motion/react";
|
|
6
|
+
import { IconExclamationCircleFilled as Ze, IconEyeOff as jt, IconEye as Vt, IconPaperclip as Kt, IconCircleCheckFilled as et, IconX as ce, IconCloudUpload as Gt, IconCheck as Rt, IconChevronDown as ge, IconBold as Yt, IconItalic as Jt, IconUnderline as Qt, IconList as Ye, IconListNumbers as qt, IconLink as Zt, IconArrowBackUp as en, IconArrowForwardUp as tn, IconDots as nn, IconSearch as Ee, IconSearchOff as tt, IconInfoCircleFilled as rn, IconAlertTriangleFilled as ln, IconChevronRight as on, IconChevronUp as sn, IconSettings as mt, IconPlus as ft, IconTrash as an, IconMailFilled as cn } from "@tabler/icons-react";
|
|
7
|
+
import { FloatingPortal as Me, FloatingOverlay as nt, flip as rt, shift as lt, size as ot, useFloating as st, autoUpdate as at, offset as dn, useListNavigation as un, useInteractions as mn } from "@floating-ui/react";
|
|
8
|
+
import { mergeRefs as fn } from "react-merge-refs";
|
|
9
|
+
import { useDropzone as St } from "react-dropzone";
|
|
10
10
|
import { LexicalComposer as hn } from "@lexical/react/LexicalComposer";
|
|
11
11
|
import { RichTextPlugin as pn } from "@lexical/react/LexicalRichTextPlugin";
|
|
12
12
|
import { ContentEditable as gn } from "@lexical/react/LexicalContentEditable";
|
|
@@ -17,28 +17,28 @@ import { OnChangePlugin as wn } from "@lexical/react/LexicalOnChangePlugin";
|
|
|
17
17
|
import { AutoFocusPlugin as Nn } from "@lexical/react/LexicalAutoFocusPlugin";
|
|
18
18
|
import { LexicalErrorBoundary as kn } from "@lexical/react/LexicalErrorBoundary";
|
|
19
19
|
import { HeadingNode as yn, QuoteNode as Cn, $isHeadingNode as In, $createHeadingNode as Rn } from "@lexical/rich-text";
|
|
20
|
-
import { ListNode as
|
|
21
|
-
import { LinkNode as Tn, $isLinkNode as
|
|
22
|
-
import { useLexicalComposerContext as
|
|
23
|
-
import { CAN_UNDO_COMMAND as Ln, COMMAND_PRIORITY_LOW as Le, CAN_REDO_COMMAND as Pn, $getSelection as
|
|
24
|
-
import { mergeRegister as
|
|
25
|
-
import { $setBlocksType as
|
|
26
|
-
const
|
|
20
|
+
import { ListNode as Dt, ListItemNode as Sn, $isListNode as Dn, REMOVE_LIST_COMMAND as ht, INSERT_UNORDERED_LIST_COMMAND as On, INSERT_ORDERED_LIST_COMMAND as zn } from "@lexical/list";
|
|
21
|
+
import { LinkNode as Tn, $isLinkNode as pt, TOGGLE_LINK_COMMAND as gt } from "@lexical/link";
|
|
22
|
+
import { useLexicalComposerContext as de } from "@lexical/react/LexicalComposerContext";
|
|
23
|
+
import { CAN_UNDO_COMMAND as Ln, COMMAND_PRIORITY_LOW as Le, CAN_REDO_COMMAND as Pn, $getSelection as Ot, $isRangeSelection as zt, $createParagraphNode as En, FORMAT_TEXT_COMMAND as $e, UNDO_COMMAND as Mn, REDO_COMMAND as Fn, FOCUS_COMMAND as Bn, BLUR_COMMAND as An } from "lexical";
|
|
24
|
+
import { mergeRegister as Tt, $getNearestNodeOfType as Un } from "@lexical/utils";
|
|
25
|
+
import { $setBlocksType as bt } from "@lexical/selection";
|
|
26
|
+
const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
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%)",
|
|
30
30
|
"polygon(50% 50%,0 0,100% 0,100% 100%,0 100%,0 100%)",
|
|
31
31
|
"polygon(50% 50%,0 0,100% 0,100% 100%,0 100%,0 0)"
|
|
32
|
-
], Re = (
|
|
32
|
+
], Re = (t) => {
|
|
33
33
|
const {
|
|
34
|
-
speed:
|
|
34
|
+
speed: n = 1,
|
|
35
35
|
className: o
|
|
36
|
-
} =
|
|
36
|
+
} = t, s = 1 / n, r = 2 / n;
|
|
37
37
|
return /* @__PURE__ */ e(Se, { children: /* @__PURE__ */ e(
|
|
38
38
|
G.div,
|
|
39
39
|
{
|
|
40
40
|
role: "status",
|
|
41
|
-
className:
|
|
41
|
+
className: f("relative rounded-full", o),
|
|
42
42
|
animate: { rotate: 360 },
|
|
43
43
|
transition: { repeat: 1 / 0, ease: "linear", duration: s },
|
|
44
44
|
children: /* @__PURE__ */ e(
|
|
@@ -65,7 +65,7 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
65
65
|
sm: "h-[var(--control-size-sm-height)]",
|
|
66
66
|
md: "h-[var(--control-size-md-height)]",
|
|
67
67
|
lg: "h-[var(--control-size-lg-height)]"
|
|
68
|
-
},
|
|
68
|
+
}, Lt = {
|
|
69
69
|
sm: "min-h-[var(--control-size-sm-height)]",
|
|
70
70
|
md: "min-h-[var(--control-size-md-height)]",
|
|
71
71
|
lg: "min-h-[var(--control-size-lg-height)]"
|
|
@@ -81,15 +81,15 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
81
81
|
sm: "px-[var(--control-size-sm-px)]",
|
|
82
82
|
md: "px-[var(--control-size-md-px)]",
|
|
83
83
|
lg: "px-[var(--control-size-lg-px)]"
|
|
84
|
-
},
|
|
84
|
+
}, ue = {
|
|
85
85
|
sm: "pl-[var(--control-size-sm-px)]",
|
|
86
86
|
md: "pl-[var(--control-size-md-px)]",
|
|
87
87
|
lg: "pl-[var(--control-size-lg-px)]"
|
|
88
|
-
},
|
|
88
|
+
}, it = {
|
|
89
89
|
sm: "pr-[var(--control-size-sm-px)]",
|
|
90
90
|
md: "pr-[var(--control-size-md-px)]",
|
|
91
91
|
lg: "pr-[var(--control-size-lg-px)]"
|
|
92
|
-
},
|
|
92
|
+
}, me = {
|
|
93
93
|
sm: "pr-[calc(var(--control-size-sm-px)+2rem)]",
|
|
94
94
|
md: "pr-[calc(var(--control-size-md-px)+2rem)]",
|
|
95
95
|
lg: "pr-[calc(var(--control-size-lg-px)+2rem)]"
|
|
@@ -97,11 +97,11 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
97
97
|
sm: "pr-[calc(var(--control-size-sm-px)+3.75rem)]",
|
|
98
98
|
md: "pr-[calc(var(--control-size-md-px)+3.75rem)]",
|
|
99
99
|
lg: "pr-[calc(var(--control-size-lg-px)+3.75rem)]"
|
|
100
|
-
},
|
|
100
|
+
}, Pt = {
|
|
101
101
|
sm: "pl-[calc(var(--control-size-sm-icon-offset)+var(--control-size-sm-icon)+0.75rem)]",
|
|
102
102
|
md: "pl-[calc(var(--control-size-md-icon-offset)+var(--control-size-md-icon)+0.75rem)]",
|
|
103
103
|
lg: "pl-[calc(var(--control-size-lg-icon-offset)+var(--control-size-lg-icon)+0.75rem)]"
|
|
104
|
-
},
|
|
104
|
+
}, Et = {
|
|
105
105
|
sm: "left-[var(--control-size-sm-icon-offset)]",
|
|
106
106
|
md: "left-[var(--control-size-md-icon-offset)]",
|
|
107
107
|
lg: "left-[var(--control-size-lg-icon-offset)]"
|
|
@@ -109,11 +109,11 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
109
109
|
sm: "right-[var(--control-size-sm-px)]",
|
|
110
110
|
md: "right-[var(--control-size-md-px)]",
|
|
111
111
|
lg: "right-[var(--control-size-lg-px)]"
|
|
112
|
-
},
|
|
112
|
+
}, pe = {
|
|
113
113
|
sm: "h-[var(--control-size-sm-icon)] w-[var(--control-size-sm-icon)]",
|
|
114
114
|
md: "h-[var(--control-size-md-icon)] w-[var(--control-size-md-icon)]",
|
|
115
115
|
lg: "h-[var(--control-size-lg-icon)] w-[var(--control-size-lg-icon)]"
|
|
116
|
-
},
|
|
116
|
+
}, Mt = {
|
|
117
117
|
sm: "h-[var(--control-size-sm-height)] w-[var(--control-size-sm-height)]",
|
|
118
118
|
md: "h-[var(--control-size-md-height)] w-[var(--control-size-md-height)]",
|
|
119
119
|
lg: "h-[var(--control-size-lg-height)] w-[var(--control-size-lg-height)]"
|
|
@@ -130,7 +130,7 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
130
130
|
white: "border button-white shadow-sm",
|
|
131
131
|
black: "border button-black shadow-sm",
|
|
132
132
|
transparent: "border button-transparent"
|
|
133
|
-
}, Vn =
|
|
133
|
+
}, Vn = C.forwardRef((t, n) => {
|
|
134
134
|
const {
|
|
135
135
|
variant: o = "white",
|
|
136
136
|
size: s = "md",
|
|
@@ -139,12 +139,12 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
139
139
|
loading: a = !1,
|
|
140
140
|
Icon: i,
|
|
141
141
|
...c
|
|
142
|
-
} =
|
|
142
|
+
} = t;
|
|
143
143
|
return /* @__PURE__ */ d(
|
|
144
144
|
"button",
|
|
145
145
|
{
|
|
146
|
-
ref:
|
|
147
|
-
className:
|
|
146
|
+
ref: n,
|
|
147
|
+
className: f(
|
|
148
148
|
Xn,
|
|
149
149
|
jn[o],
|
|
150
150
|
te[s],
|
|
@@ -155,9 +155,9 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
155
155
|
),
|
|
156
156
|
...c,
|
|
157
157
|
children: [
|
|
158
|
-
a && /* @__PURE__ */ e(Re, { className:
|
|
158
|
+
a && /* @__PURE__ */ e(Re, { className: f(pe[s]) }),
|
|
159
159
|
!a && /* @__PURE__ */ d(ee, { children: [
|
|
160
|
-
i && /* @__PURE__ */ e(i, { className:
|
|
160
|
+
i && /* @__PURE__ */ e(i, { className: f(pe[s], "-ml-1") }),
|
|
161
161
|
l
|
|
162
162
|
] })
|
|
163
163
|
]
|
|
@@ -176,26 +176,26 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
176
176
|
white: "border button-white shadow-sm",
|
|
177
177
|
black: "border button-black shadow-sm",
|
|
178
178
|
transparent: "border button-transparent"
|
|
179
|
-
}, Je =
|
|
179
|
+
}, Je = C.forwardRef((t, n) => {
|
|
180
180
|
const {
|
|
181
181
|
variant: o = "white",
|
|
182
182
|
size: s = "md",
|
|
183
183
|
className: r,
|
|
184
184
|
Icon: l,
|
|
185
185
|
...a
|
|
186
|
-
} =
|
|
186
|
+
} = t;
|
|
187
187
|
return /* @__PURE__ */ e(
|
|
188
188
|
"button",
|
|
189
189
|
{
|
|
190
|
-
ref:
|
|
191
|
-
className:
|
|
190
|
+
ref: n,
|
|
191
|
+
className: f(
|
|
192
192
|
Kn,
|
|
193
193
|
Gn[o],
|
|
194
|
-
|
|
194
|
+
Mt[s],
|
|
195
195
|
r
|
|
196
196
|
),
|
|
197
197
|
...a,
|
|
198
|
-
children: /* @__PURE__ */ e(l, { className:
|
|
198
|
+
children: /* @__PURE__ */ e(l, { className: pe[s] })
|
|
199
199
|
}
|
|
200
200
|
);
|
|
201
201
|
}), Yn = `
|
|
@@ -209,43 +209,43 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
209
209
|
white: "border button-white shadow-sm",
|
|
210
210
|
black: "border button-black shadow-sm",
|
|
211
211
|
transparent: "border button-transparent"
|
|
212
|
-
},
|
|
212
|
+
}, Ft = C.forwardRef((t, n) => {
|
|
213
213
|
const {
|
|
214
214
|
variant: o = "white",
|
|
215
215
|
size: s = "md",
|
|
216
216
|
className: r,
|
|
217
217
|
Icon: l,
|
|
218
218
|
...a
|
|
219
|
-
} =
|
|
219
|
+
} = t;
|
|
220
220
|
return /* @__PURE__ */ e(
|
|
221
221
|
"button",
|
|
222
222
|
{
|
|
223
|
-
ref:
|
|
224
|
-
className:
|
|
223
|
+
ref: n,
|
|
224
|
+
className: f(
|
|
225
225
|
Yn,
|
|
226
226
|
Jn[o],
|
|
227
|
-
|
|
227
|
+
Mt[s],
|
|
228
228
|
r
|
|
229
229
|
),
|
|
230
230
|
...a,
|
|
231
|
-
children: /* @__PURE__ */ e(l, { className:
|
|
231
|
+
children: /* @__PURE__ */ e(l, { className: pe[s] })
|
|
232
232
|
}
|
|
233
233
|
);
|
|
234
|
-
}), J = (
|
|
234
|
+
}), J = (t) => {
|
|
235
235
|
const {
|
|
236
|
-
children:
|
|
237
|
-
} =
|
|
238
|
-
return
|
|
239
|
-
}, ne = () => /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(Ze, { className: "h-5 w-5 input-error-icon" }) }), Q = Qe("md"), Qn = () => qe(Q), fe =
|
|
236
|
+
children: n
|
|
237
|
+
} = t;
|
|
238
|
+
return n ? /* @__PURE__ */ e("label", { className: "input-label font-medium mb-1", children: n }) : null;
|
|
239
|
+
}, ne = () => /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(Ze, { className: "h-5 w-5 input-error-icon" }) }), Q = Qe("md"), Qn = () => qe(Q), fe = C.forwardRef((t, n) => {
|
|
240
240
|
const {
|
|
241
241
|
children: o,
|
|
242
242
|
className: s
|
|
243
|
-
} =
|
|
243
|
+
} = t, r = Qn();
|
|
244
244
|
return /* @__PURE__ */ e(
|
|
245
245
|
"div",
|
|
246
246
|
{
|
|
247
|
-
ref:
|
|
248
|
-
className:
|
|
247
|
+
ref: n,
|
|
248
|
+
className: f(
|
|
249
249
|
"absolute top-1/2 -translate-y-1/2 flex flex-row items-center gap-1 pointer-events-none",
|
|
250
250
|
$n[r],
|
|
251
251
|
s
|
|
@@ -253,19 +253,19 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
253
253
|
children: o
|
|
254
254
|
}
|
|
255
255
|
);
|
|
256
|
-
}), V = (
|
|
256
|
+
}), V = (t) => {
|
|
257
257
|
const {
|
|
258
|
-
children:
|
|
259
|
-
} =
|
|
260
|
-
return
|
|
261
|
-
}, K = (
|
|
258
|
+
children: n
|
|
259
|
+
} = t;
|
|
260
|
+
return n ? /* @__PURE__ */ e("div", { className: "input-description text-sm font-medium mt-2", children: n }) : null;
|
|
261
|
+
}, K = (t) => {
|
|
262
262
|
const {
|
|
263
|
-
children:
|
|
264
|
-
} =
|
|
265
|
-
return
|
|
266
|
-
},
|
|
263
|
+
children: n
|
|
264
|
+
} = t;
|
|
265
|
+
return n ? /* @__PURE__ */ e("div", { className: "input-error-text text-sm font-medium mt-2", children: n }) : null;
|
|
266
|
+
}, Bt = (t) => {
|
|
267
267
|
const {
|
|
268
|
-
className:
|
|
268
|
+
className: n,
|
|
269
269
|
label: o,
|
|
270
270
|
description: s,
|
|
271
271
|
Icon: r,
|
|
@@ -273,31 +273,31 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
273
273
|
buttonTray: a,
|
|
274
274
|
size: i = "md",
|
|
275
275
|
...c
|
|
276
|
-
} =
|
|
276
|
+
} = t, g = !!l || !!a;
|
|
277
277
|
return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d(
|
|
278
278
|
"div",
|
|
279
279
|
{
|
|
280
|
-
className:
|
|
280
|
+
className: f(
|
|
281
281
|
"flex flex-col",
|
|
282
|
-
|
|
282
|
+
n
|
|
283
283
|
),
|
|
284
284
|
children: [
|
|
285
285
|
/* @__PURE__ */ e(J, { children: o }),
|
|
286
286
|
/* @__PURE__ */ d("div", { className: "flex flex-col relative", children: [
|
|
287
|
-
r && /* @__PURE__ */ e(r, { className:
|
|
287
|
+
r && /* @__PURE__ */ e(r, { className: f(
|
|
288
288
|
"input-icon absolute top-1/2 -translate-y-1/2",
|
|
289
|
-
|
|
290
|
-
|
|
289
|
+
pe[i],
|
|
290
|
+
Et[i]
|
|
291
291
|
) }),
|
|
292
292
|
/* @__PURE__ */ e(
|
|
293
293
|
"input",
|
|
294
294
|
{
|
|
295
|
-
className:
|
|
295
|
+
className: f(
|
|
296
296
|
"border input-base transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none",
|
|
297
297
|
te[i],
|
|
298
298
|
Y[i],
|
|
299
|
-
r ?
|
|
300
|
-
g ?
|
|
299
|
+
r ? Pt[i] : ue[i],
|
|
300
|
+
g ? me[i] : it[i],
|
|
301
301
|
l && "input-error"
|
|
302
302
|
),
|
|
303
303
|
...c
|
|
@@ -313,59 +313,59 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
313
313
|
]
|
|
314
314
|
}
|
|
315
315
|
) });
|
|
316
|
-
}, qn = (
|
|
317
|
-
const
|
|
318
|
-
if (!
|
|
319
|
-
const o = parseInt(
|
|
316
|
+
}, qn = (t) => {
|
|
317
|
+
const n = t.match(/^#?([0-9a-fA-F]{6})$/);
|
|
318
|
+
if (!n) return null;
|
|
319
|
+
const o = parseInt(n[1], 16);
|
|
320
320
|
return [(o >> 16 & 255) / 255, (o >> 8 & 255) / 255, (o & 255) / 255];
|
|
321
|
-
}, Zn = (
|
|
321
|
+
}, Zn = (t, n, o) => {
|
|
322
322
|
const s = (r) => Math.round(r * 255).toString(16).padStart(2, "0").toUpperCase();
|
|
323
|
-
return "#" + s(
|
|
324
|
-
}, er = (
|
|
325
|
-
const s = Math.max(
|
|
323
|
+
return "#" + s(t) + s(n) + s(o);
|
|
324
|
+
}, er = (t, n, o) => {
|
|
325
|
+
const s = Math.max(t, n, o), r = Math.min(t, n, o), l = s - r;
|
|
326
326
|
let a = 0;
|
|
327
|
-
return l !== 0 && (s ===
|
|
328
|
-
}, tr = (
|
|
329
|
-
const s = o *
|
|
327
|
+
return l !== 0 && (s === t ? a = ((n - o) / l + 6) % 6 : s === n ? a = (o - t) / l + 2 : a = (t - n) / l + 4, a *= 60), [a, s === 0 ? 0 : l / s, s];
|
|
328
|
+
}, tr = (t, n, o) => {
|
|
329
|
+
const s = o * n, r = t / 60, l = s * (1 - Math.abs(r % 2 - 1));
|
|
330
330
|
let a = 0, i = 0, c = 0;
|
|
331
331
|
r < 1 ? (a = s, i = l) : r < 2 ? (a = l, i = s) : r < 3 ? (i = s, c = l) : r < 4 ? (i = l, c = s) : r < 5 ? (a = l, c = s) : (a = s, c = l);
|
|
332
332
|
const g = o - s;
|
|
333
333
|
return [a + g, i + g, c + g];
|
|
334
|
-
}, Ie = (
|
|
335
|
-
const [s, r, l] = tr(
|
|
334
|
+
}, Ie = (t, n, o) => {
|
|
335
|
+
const [s, r, l] = tr(t, n, o);
|
|
336
336
|
return Zn(s, r, l);
|
|
337
|
-
},
|
|
338
|
-
const
|
|
339
|
-
return
|
|
340
|
-
}, nr = (
|
|
341
|
-
const
|
|
342
|
-
if (!
|
|
343
|
-
const o =
|
|
337
|
+
}, vt = (t) => {
|
|
338
|
+
const n = qn(t);
|
|
339
|
+
return n ? er(n[0], n[1], n[2]) : null;
|
|
340
|
+
}, nr = (t) => {
|
|
341
|
+
const n = t.trim();
|
|
342
|
+
if (!n) return null;
|
|
343
|
+
const o = n.match(/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);
|
|
344
344
|
if (o) {
|
|
345
345
|
let a = o[1];
|
|
346
346
|
return a.length === 3 && (a = a.split("").map((i) => i + i).join("")), "#" + a.toUpperCase();
|
|
347
347
|
}
|
|
348
348
|
if (typeof document > "u") return null;
|
|
349
349
|
const s = document.createElement("div");
|
|
350
|
-
if (s.style.color =
|
|
350
|
+
if (s.style.color = n, !s.style.color) return null;
|
|
351
351
|
document.body.appendChild(s);
|
|
352
352
|
const r = getComputedStyle(s).color;
|
|
353
353
|
document.body.removeChild(s);
|
|
354
354
|
const l = r.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
|
|
355
355
|
return l ? "#" + [l[1], l[2], l[3]].map((a) => parseInt(a, 10).toString(16).padStart(2, "0")).join("").toUpperCase() : null;
|
|
356
|
-
}, Xe = (
|
|
357
|
-
const
|
|
358
|
-
|
|
356
|
+
}, Xe = (t) => {
|
|
357
|
+
const n = C.useRef(null), [o, s] = C.useState(!1), r = (l) => {
|
|
358
|
+
n.current = null, s(!1), l.currentTarget.releasePointerCapture?.(l.pointerId);
|
|
359
359
|
};
|
|
360
360
|
return {
|
|
361
361
|
isDragging: o,
|
|
362
362
|
bind: {
|
|
363
363
|
onPointerDown: (l) => {
|
|
364
364
|
const a = l.currentTarget;
|
|
365
|
-
|
|
365
|
+
n.current = a.getBoundingClientRect(), a.setPointerCapture?.(l.pointerId), s(!0), t(l.clientX, l.clientY, n.current);
|
|
366
366
|
},
|
|
367
367
|
onPointerMove: (l) => {
|
|
368
|
-
|
|
368
|
+
n.current && t(l.clientX, l.clientY, n.current);
|
|
369
369
|
},
|
|
370
370
|
onPointerUp: r,
|
|
371
371
|
onPointerCancel: r
|
|
@@ -375,17 +375,17 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
375
375
|
sm: "p-2",
|
|
376
376
|
md: "p-3",
|
|
377
377
|
lg: "p-4"
|
|
378
|
-
},
|
|
378
|
+
}, be = (t) => {
|
|
379
379
|
const {
|
|
380
|
-
className:
|
|
380
|
+
className: n,
|
|
381
381
|
children: o,
|
|
382
382
|
padding: s = "md",
|
|
383
383
|
...r
|
|
384
|
-
} =
|
|
384
|
+
} = t;
|
|
385
385
|
return /* @__PURE__ */ e(
|
|
386
386
|
"div",
|
|
387
387
|
{
|
|
388
|
-
className:
|
|
388
|
+
className: f(rr, lr[s], n),
|
|
389
389
|
...r,
|
|
390
390
|
children: o
|
|
391
391
|
}
|
|
@@ -403,8 +403,8 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
403
403
|
left: "right center",
|
|
404
404
|
"left-start": "top right",
|
|
405
405
|
"left-end": "bottom right"
|
|
406
|
-
},
|
|
407
|
-
({ open:
|
|
406
|
+
}, At = C.memo(
|
|
407
|
+
({ open: t, children: n, className: o, onOutsideClick: s, floatingStyles: r, setFloating: l, placement: a, floatingProps: i }) => /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ e(Se, { children: t && /* @__PURE__ */ d(ee, { children: [
|
|
408
408
|
s && /* @__PURE__ */ e(nt, { onClick: s }),
|
|
409
409
|
/* @__PURE__ */ e("div", { ref: l, style: r, className: "z-50", ...i, children: /* @__PURE__ */ e(
|
|
410
410
|
G.div,
|
|
@@ -415,100 +415,102 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
415
415
|
animate: { opacity: 1, scale: 1 },
|
|
416
416
|
exit: { opacity: 0, scale: 0.95 },
|
|
417
417
|
transition: { duration: 0.1, ease: "easeInOut" },
|
|
418
|
-
children:
|
|
418
|
+
children: n
|
|
419
419
|
}
|
|
420
420
|
) })
|
|
421
421
|
] }) }) })
|
|
422
|
-
),
|
|
423
|
-
const { placement:
|
|
424
|
-
rt({
|
|
425
|
-
|
|
426
|
-
|
|
422
|
+
), ct = (t) => {
|
|
423
|
+
const { placement: n = "bottom", onOutsideClick: o, fullWidth: s, minWidth: r, maxWidth: l } = t, a = C.useMemo(() => [
|
|
424
|
+
rt({ padding: 8 }),
|
|
425
|
+
lt({ padding: 8 }),
|
|
426
|
+
ot({
|
|
427
|
+
apply({ rects: h, elements: b }) {
|
|
428
|
+
s && (b.floating.style.width = `${h.reference.width}px`), r && (b.floating.style.minWidth = `${r}px`), l && (b.floating.style.maxWidth = `${l}px`);
|
|
427
429
|
}
|
|
428
430
|
})
|
|
429
|
-
], [s, l, r]), { refs: i, floatingStyles: c } =
|
|
430
|
-
placement:
|
|
431
|
+
], [s, l, r]), { refs: i, floatingStyles: c, placement: g } = st({
|
|
432
|
+
placement: n,
|
|
431
433
|
middleware: a,
|
|
432
|
-
whileElementsMounted:
|
|
433
|
-
}),
|
|
434
|
+
whileElementsMounted: at
|
|
435
|
+
}), x = C.useRef({
|
|
434
436
|
onOutsideClick: o,
|
|
435
437
|
floatingStyles: c,
|
|
436
438
|
setFloating: i.setFloating,
|
|
437
|
-
placement:
|
|
439
|
+
placement: n
|
|
438
440
|
});
|
|
439
|
-
|
|
441
|
+
x.current = {
|
|
440
442
|
onOutsideClick: o,
|
|
441
443
|
floatingStyles: c,
|
|
442
444
|
setFloating: i.setFloating,
|
|
443
|
-
placement:
|
|
445
|
+
placement: g
|
|
444
446
|
};
|
|
445
|
-
const w =
|
|
446
|
-
const
|
|
447
|
-
const { floatingStyles:
|
|
447
|
+
const w = C.useMemo(() => {
|
|
448
|
+
const h = (b) => {
|
|
449
|
+
const { floatingStyles: p, setFloating: m, onOutsideClick: v, placement: u } = x.current, { className: I, open: R, children: y } = b;
|
|
448
450
|
return /* @__PURE__ */ e(
|
|
449
|
-
|
|
451
|
+
At,
|
|
450
452
|
{
|
|
451
453
|
open: R,
|
|
452
|
-
className:
|
|
453
|
-
onOutsideClick:
|
|
454
|
-
floatingStyles:
|
|
455
|
-
setFloating:
|
|
456
|
-
placement:
|
|
457
|
-
children:
|
|
454
|
+
className: I,
|
|
455
|
+
onOutsideClick: v,
|
|
456
|
+
floatingStyles: p,
|
|
457
|
+
setFloating: m,
|
|
458
|
+
placement: u,
|
|
459
|
+
children: y
|
|
458
460
|
}
|
|
459
461
|
);
|
|
460
462
|
};
|
|
461
|
-
return
|
|
463
|
+
return C.memo(h);
|
|
462
464
|
}, []);
|
|
463
465
|
return {
|
|
464
466
|
anchorRef: i.setReference,
|
|
465
467
|
Popover: w
|
|
466
468
|
};
|
|
467
|
-
},
|
|
469
|
+
}, ve = (t, n) => {
|
|
468
470
|
$(() => {
|
|
469
|
-
if (!
|
|
471
|
+
if (!t) return;
|
|
470
472
|
const o = (s) => {
|
|
471
|
-
s.key === "Escape" &&
|
|
473
|
+
s.key === "Escape" && n();
|
|
472
474
|
};
|
|
473
475
|
return document.addEventListener("keydown", o), () => {
|
|
474
476
|
document.removeEventListener("keydown", o);
|
|
475
477
|
};
|
|
476
|
-
}, [
|
|
477
|
-
}, sr = "linear-gradient(to right, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%)", ar = "linear-gradient(to right, #fff, rgba(255,255,255,0))", ir = "linear-gradient(to top, #000, rgba(0,0,0,0))", je = "0 0 0 1px rgba(0,0,0,0.15)", cr = 14, dr = 28, ur = 6,
|
|
478
|
-
const
|
|
478
|
+
}, [t, n]);
|
|
479
|
+
}, sr = "linear-gradient(to right, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%)", ar = "linear-gradient(to right, #fff, rgba(255,255,255,0))", ir = "linear-gradient(to top, #000, rgba(0,0,0,0))", je = "0 0 0 1px rgba(0,0,0,0.15)", cr = 14, dr = 28, ur = 6, mr = 8, Ve = { type: "spring", stiffness: 500, damping: 18, mass: 0.6 }, we = (t) => {
|
|
480
|
+
const n = t ? dr : cr, o = n / 2;
|
|
479
481
|
return {
|
|
480
|
-
width:
|
|
481
|
-
height:
|
|
482
|
+
width: n,
|
|
483
|
+
height: n,
|
|
482
484
|
marginLeft: -o,
|
|
483
485
|
marginTop: -o,
|
|
484
|
-
borderRadius:
|
|
486
|
+
borderRadius: t ? mr : ur
|
|
485
487
|
};
|
|
486
|
-
}, ze = (
|
|
487
|
-
Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(
|
|
488
|
-
},
|
|
489
|
-
const [o, s] = A(() =>
|
|
488
|
+
}, ze = (t) => Math.max(0, Math.min(1, t)), xt = (t, n) => {
|
|
489
|
+
Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(t, n), t.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
490
|
+
}, fr = ({ value: t, onChange: n }) => {
|
|
491
|
+
const [o, s] = A(() => vt(t) ?? [0, 0, 1]), r = ke(Ie(o[0], o[1], o[2]));
|
|
490
492
|
$(() => {
|
|
491
|
-
if ((
|
|
492
|
-
const
|
|
493
|
-
|
|
494
|
-
}, [
|
|
495
|
-
const l = (
|
|
496
|
-
s(
|
|
497
|
-
const v = Ie(
|
|
498
|
-
r.current = v,
|
|
499
|
-
}, [a, i, c] = o, g = Ie(a, 1, 1),
|
|
500
|
-
l([a, ze((
|
|
501
|
-
}), b = Xe((
|
|
502
|
-
l([ze((
|
|
503
|
-
}), p = Xe((
|
|
504
|
-
l([a, i, ze((
|
|
493
|
+
if ((t || "").toUpperCase() === r.current) return;
|
|
494
|
+
const m = vt(t);
|
|
495
|
+
m && s(m);
|
|
496
|
+
}, [t]);
|
|
497
|
+
const l = (m) => {
|
|
498
|
+
s(m);
|
|
499
|
+
const v = Ie(m[0], m[1], m[2]);
|
|
500
|
+
r.current = v, n(v);
|
|
501
|
+
}, [a, i, c] = o, g = Ie(a, 1, 1), x = Ie(a, i, 1), w = Ie(a, i, c), h = Xe((m, v, u) => {
|
|
502
|
+
l([a, ze((m - u.left) / u.width), 1 - ze((v - u.top) / u.height)]);
|
|
503
|
+
}), b = Xe((m, v, u) => {
|
|
504
|
+
l([ze((m - u.left) / u.width) * 360, i, c]);
|
|
505
|
+
}), p = Xe((m, v, u) => {
|
|
506
|
+
l([a, i, ze((m - u.left) / u.width)]);
|
|
505
507
|
});
|
|
506
508
|
return /* @__PURE__ */ d(
|
|
507
509
|
"div",
|
|
508
510
|
{
|
|
509
511
|
className: "flex flex-col gap-3",
|
|
510
512
|
style: { width: 220, userSelect: "none" },
|
|
511
|
-
onMouseDown: (
|
|
513
|
+
onMouseDown: (m) => m.preventDefault(),
|
|
512
514
|
children: [
|
|
513
515
|
/* @__PURE__ */ d(
|
|
514
516
|
"div",
|
|
@@ -519,7 +521,7 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
519
521
|
touchAction: "none",
|
|
520
522
|
cursor: "crosshair"
|
|
521
523
|
},
|
|
522
|
-
...
|
|
524
|
+
...h.bind,
|
|
523
525
|
children: [
|
|
524
526
|
/* @__PURE__ */ d(
|
|
525
527
|
"div",
|
|
@@ -552,10 +554,10 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
552
554
|
left: `${i * 100}%`,
|
|
553
555
|
top: `${(1 - c) * 100}%`,
|
|
554
556
|
boxShadow: je,
|
|
555
|
-
backgroundColor:
|
|
557
|
+
backgroundColor: w
|
|
556
558
|
},
|
|
557
559
|
initial: we(!1),
|
|
558
|
-
animate: we(
|
|
560
|
+
animate: we(h.isDragging),
|
|
559
561
|
transition: Ve
|
|
560
562
|
}
|
|
561
563
|
)
|
|
@@ -596,7 +598,7 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
596
598
|
className: "relative w-full rounded-md",
|
|
597
599
|
style: {
|
|
598
600
|
height: 12,
|
|
599
|
-
background: `linear-gradient(to right, #000, ${
|
|
601
|
+
background: `linear-gradient(to right, #000, ${x})`,
|
|
600
602
|
touchAction: "none",
|
|
601
603
|
cursor: "ew-resize"
|
|
602
604
|
},
|
|
@@ -608,7 +610,7 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
608
610
|
style: {
|
|
609
611
|
top: "50%",
|
|
610
612
|
left: `${c * 100}%`,
|
|
611
|
-
backgroundColor:
|
|
613
|
+
backgroundColor: w,
|
|
612
614
|
boxShadow: je
|
|
613
615
|
},
|
|
614
616
|
initial: we(!1),
|
|
@@ -621,9 +623,9 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
621
623
|
]
|
|
622
624
|
}
|
|
623
625
|
);
|
|
624
|
-
}, bl = (
|
|
626
|
+
}, bl = (t) => {
|
|
625
627
|
const {
|
|
626
|
-
className:
|
|
628
|
+
className: n,
|
|
627
629
|
label: o,
|
|
628
630
|
description: s,
|
|
629
631
|
error: r,
|
|
@@ -632,113 +634,113 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
632
634
|
value: i,
|
|
633
635
|
defaultValue: c,
|
|
634
636
|
onChange: g,
|
|
635
|
-
onBlur:
|
|
636
|
-
onFocus:
|
|
637
|
-
...
|
|
638
|
-
} =
|
|
637
|
+
onBlur: x,
|
|
638
|
+
onFocus: w,
|
|
639
|
+
...h
|
|
640
|
+
} = t, [b, p] = A(
|
|
639
641
|
i != null ? String(i) : c != null ? String(c) : ""
|
|
640
|
-
), [
|
|
641
|
-
|
|
642
|
-
const { anchorRef:
|
|
642
|
+
), [m, v] = A(!1), u = ke(null), I = i != null ? String(i) : b, R = I || "white";
|
|
643
|
+
ve(m, () => v(!1));
|
|
644
|
+
const { anchorRef: y, Popover: D } = ct({
|
|
643
645
|
placement: "bottom-start",
|
|
644
646
|
onOutsideClick: () => v(!1)
|
|
645
647
|
}), T = (k) => {
|
|
646
648
|
p(k.target.value), g?.(k);
|
|
647
|
-
},
|
|
648
|
-
v(!0),
|
|
649
|
-
}, L = (k) => {
|
|
650
|
-
const B = k.target.value, O = nr(B);
|
|
651
|
-
O && O !== B && u.current && bt(u.current, O), v(!1), w?.(k);
|
|
649
|
+
}, M = (k) => {
|
|
650
|
+
v(!0), w?.(k);
|
|
652
651
|
}, P = (k) => {
|
|
653
|
-
|
|
652
|
+
const B = k.target.value, O = nr(B);
|
|
653
|
+
O && O !== B && u.current && xt(u.current, O), v(!1), x?.(k);
|
|
654
|
+
}, z = (k) => {
|
|
655
|
+
u.current && xt(u.current, k);
|
|
654
656
|
}, N = !!r || !!l;
|
|
655
657
|
return /* @__PURE__ */ e(Q.Provider, { value: a, children: /* @__PURE__ */ d(
|
|
656
658
|
"div",
|
|
657
659
|
{
|
|
658
|
-
className:
|
|
660
|
+
className: f(
|
|
659
661
|
"flex flex-col",
|
|
660
|
-
|
|
662
|
+
n
|
|
661
663
|
),
|
|
662
664
|
children: [
|
|
663
665
|
/* @__PURE__ */ e(J, { children: o }),
|
|
664
|
-
/* @__PURE__ */ d("div", { className: "flex flex-col relative", ref:
|
|
666
|
+
/* @__PURE__ */ d("div", { className: "flex flex-col relative", ref: y, children: [
|
|
665
667
|
/* @__PURE__ */ e(
|
|
666
668
|
"div",
|
|
667
669
|
{
|
|
668
|
-
className:
|
|
670
|
+
className: f(
|
|
669
671
|
"absolute top-1/2 -translate-y-1/2 rounded-md border color-swatch",
|
|
670
|
-
|
|
671
|
-
|
|
672
|
+
pe[a],
|
|
673
|
+
Et[a]
|
|
672
674
|
),
|
|
673
|
-
style: { backgroundColor:
|
|
675
|
+
style: { backgroundColor: R }
|
|
674
676
|
}
|
|
675
677
|
),
|
|
676
678
|
/* @__PURE__ */ e(
|
|
677
679
|
"input",
|
|
678
680
|
{
|
|
679
681
|
ref: u,
|
|
680
|
-
className:
|
|
682
|
+
className: f(
|
|
681
683
|
"border input-base transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none",
|
|
682
684
|
te[a],
|
|
683
685
|
Y[a],
|
|
684
|
-
|
|
685
|
-
N ?
|
|
686
|
+
Pt[a],
|
|
687
|
+
N ? me[a] : it[a],
|
|
686
688
|
r && "input-error"
|
|
687
689
|
),
|
|
688
690
|
value: i ?? b,
|
|
689
691
|
onChange: T,
|
|
690
|
-
onFocus:
|
|
691
|
-
onBlur:
|
|
692
|
+
onFocus: M,
|
|
693
|
+
onBlur: P,
|
|
692
694
|
onClick: () => v(!0),
|
|
693
|
-
...
|
|
695
|
+
...h
|
|
694
696
|
}
|
|
695
697
|
),
|
|
696
698
|
/* @__PURE__ */ d(fe, { children: [
|
|
697
699
|
r && /* @__PURE__ */ e(ne, {}),
|
|
698
700
|
l
|
|
699
701
|
] }),
|
|
700
|
-
/* @__PURE__ */ e(D, { open:
|
|
702
|
+
/* @__PURE__ */ e(D, { open: m, children: /* @__PURE__ */ e(be, { padding: "md", children: /* @__PURE__ */ e(fr, { value: I, onChange: z }) }) })
|
|
701
703
|
] }),
|
|
702
704
|
/* @__PURE__ */ e(V, { children: s }),
|
|
703
705
|
/* @__PURE__ */ e(K, { children: r })
|
|
704
706
|
]
|
|
705
707
|
}
|
|
706
708
|
) });
|
|
707
|
-
}, q = (
|
|
709
|
+
}, q = (t) => {
|
|
708
710
|
const {
|
|
709
|
-
onClick:
|
|
711
|
+
onClick: n,
|
|
710
712
|
Icon: o
|
|
711
|
-
} =
|
|
713
|
+
} = t;
|
|
712
714
|
return /* @__PURE__ */ e(
|
|
713
715
|
"div",
|
|
714
716
|
{
|
|
715
|
-
onClick:
|
|
716
|
-
className:
|
|
717
|
+
onClick: n,
|
|
718
|
+
className: f(
|
|
717
719
|
"h-6 w-6 select-none rounded-full p-0.5",
|
|
718
|
-
|
|
720
|
+
n && "ring-0 transition-all duration-150 input-icon-button-interactive active:ring-2 cursor-pointer hover:ring-4 group pointer-events-auto"
|
|
719
721
|
),
|
|
720
|
-
children: /* @__PURE__ */ e(o, { className:
|
|
722
|
+
children: /* @__PURE__ */ e(o, { className: f("h-5 w-5 input-icon-button-icon", n && "group-active:scale-[0.8] transition-transform origin-center") })
|
|
721
723
|
}
|
|
722
724
|
);
|
|
723
|
-
}, vl = (
|
|
725
|
+
}, vl = (t) => {
|
|
724
726
|
const {
|
|
725
|
-
type:
|
|
727
|
+
type: n = "password",
|
|
726
728
|
enableShowPasswordToggle: o = !0,
|
|
727
729
|
...s
|
|
728
|
-
} =
|
|
730
|
+
} = t, [r, l] = A(!1);
|
|
729
731
|
return /* @__PURE__ */ e(
|
|
730
|
-
|
|
732
|
+
Bt,
|
|
731
733
|
{
|
|
732
|
-
type: r ? "text" :
|
|
733
|
-
buttonTray: o ? /* @__PURE__ */ e(q, { Icon: r ?
|
|
734
|
+
type: r ? "text" : n,
|
|
735
|
+
buttonTray: o ? /* @__PURE__ */ e(q, { Icon: r ? jt : Vt, onClick: () => {
|
|
734
736
|
l(!r);
|
|
735
737
|
} }) : void 0,
|
|
736
738
|
...s
|
|
737
739
|
}
|
|
738
740
|
);
|
|
739
|
-
}, xl = (
|
|
741
|
+
}, xl = (t) => {
|
|
740
742
|
const {
|
|
741
|
-
className:
|
|
743
|
+
className: n,
|
|
742
744
|
label: o,
|
|
743
745
|
description: s,
|
|
744
746
|
error: r,
|
|
@@ -747,34 +749,34 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
747
749
|
maxRows: i,
|
|
748
750
|
ref: c,
|
|
749
751
|
onChange: g,
|
|
750
|
-
...
|
|
751
|
-
} =
|
|
752
|
-
const p =
|
|
752
|
+
...x
|
|
753
|
+
} = t, w = C.useRef(null), h = C.useCallback(() => {
|
|
754
|
+
const p = w.current;
|
|
753
755
|
if (!p) return;
|
|
754
756
|
p.style.height = "auto";
|
|
755
|
-
let
|
|
757
|
+
let m = p.scrollHeight;
|
|
756
758
|
if (i) {
|
|
757
|
-
const v = window.getComputedStyle(p), u = parseFloat(v.lineHeight),
|
|
758
|
-
|
|
759
|
+
const v = window.getComputedStyle(p), u = parseFloat(v.lineHeight), I = parseFloat(v.paddingTop), R = parseFloat(v.paddingBottom), y = parseFloat(v.borderTopWidth), D = parseFloat(v.borderBottomWidth), T = u * i + I + R + y + D;
|
|
760
|
+
m = Math.min(p.scrollHeight, T);
|
|
759
761
|
}
|
|
760
|
-
p.style.height = `${
|
|
762
|
+
p.style.height = `${m}px`;
|
|
761
763
|
}, [i]);
|
|
762
|
-
|
|
764
|
+
C.useLayoutEffect(() => {
|
|
763
765
|
if (!a) {
|
|
764
|
-
|
|
766
|
+
w.current && (w.current.style.height = "");
|
|
765
767
|
return;
|
|
766
768
|
}
|
|
767
|
-
|
|
768
|
-
}, [a,
|
|
769
|
+
h();
|
|
770
|
+
}, [a, h, t.value, t.defaultValue, l]);
|
|
769
771
|
const b = (p) => {
|
|
770
|
-
g?.(p), a &&
|
|
772
|
+
g?.(p), a && h();
|
|
771
773
|
};
|
|
772
774
|
return /* @__PURE__ */ e(Q.Provider, { value: l, children: /* @__PURE__ */ d(
|
|
773
775
|
"div",
|
|
774
776
|
{
|
|
775
|
-
className:
|
|
777
|
+
className: f(
|
|
776
778
|
"flex flex-col",
|
|
777
|
-
|
|
779
|
+
n
|
|
778
780
|
),
|
|
779
781
|
children: [
|
|
780
782
|
/* @__PURE__ */ e(J, { children: o }),
|
|
@@ -782,18 +784,18 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
782
784
|
/* @__PURE__ */ e(
|
|
783
785
|
"textarea",
|
|
784
786
|
{
|
|
785
|
-
ref: c ?
|
|
787
|
+
ref: c ? fn([c, w]) : w,
|
|
786
788
|
onChange: b,
|
|
787
|
-
className:
|
|
789
|
+
className: f(
|
|
788
790
|
"py-2.5 border input-base transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none",
|
|
789
|
-
|
|
791
|
+
Lt[l],
|
|
790
792
|
Y[l],
|
|
791
|
-
|
|
792
|
-
r ?
|
|
793
|
+
ue[l],
|
|
794
|
+
r ? me[l] : it[l],
|
|
793
795
|
r && "input-error",
|
|
794
796
|
a && (i ? "resize-none overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden" : "resize-none overflow-hidden")
|
|
795
797
|
),
|
|
796
|
-
...
|
|
798
|
+
...x
|
|
797
799
|
}
|
|
798
800
|
),
|
|
799
801
|
/* @__PURE__ */ e(fe, { className: "top-3.5 translate-y-0", children: r && /* @__PURE__ */ e(ne, {}) })
|
|
@@ -803,20 +805,20 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
803
805
|
]
|
|
804
806
|
}
|
|
805
807
|
) });
|
|
806
|
-
}, wl = (
|
|
808
|
+
}, wl = (t) => {
|
|
807
809
|
const {
|
|
808
|
-
className:
|
|
810
|
+
className: n,
|
|
809
811
|
label: o,
|
|
810
812
|
description: s,
|
|
811
813
|
error: r,
|
|
812
814
|
...l
|
|
813
|
-
} =
|
|
815
|
+
} = t;
|
|
814
816
|
return /* @__PURE__ */ d(
|
|
815
817
|
"div",
|
|
816
818
|
{
|
|
817
|
-
className:
|
|
819
|
+
className: f(
|
|
818
820
|
"flex flex-col",
|
|
819
|
-
|
|
821
|
+
n
|
|
820
822
|
),
|
|
821
823
|
children: [
|
|
822
824
|
/* @__PURE__ */ d("div", { className: "flex flex-row gap-3", children: [
|
|
@@ -828,9 +830,9 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
828
830
|
...l
|
|
829
831
|
}
|
|
830
832
|
),
|
|
831
|
-
o && /* @__PURE__ */ e("label", { htmlFor:
|
|
833
|
+
o && /* @__PURE__ */ e("label", { htmlFor: t.id, className: f(
|
|
832
834
|
"input-label font-medium mb-1",
|
|
833
|
-
|
|
835
|
+
t.id && "cursor-pointer"
|
|
834
836
|
), children: o })
|
|
835
837
|
] }),
|
|
836
838
|
/* @__PURE__ */ e(V, { children: s }),
|
|
@@ -838,20 +840,20 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
838
840
|
]
|
|
839
841
|
}
|
|
840
842
|
);
|
|
841
|
-
}, Nl = (
|
|
843
|
+
}, Nl = (t) => {
|
|
842
844
|
const {
|
|
843
|
-
className:
|
|
845
|
+
className: n,
|
|
844
846
|
label: o,
|
|
845
847
|
description: s,
|
|
846
848
|
error: r,
|
|
847
849
|
...l
|
|
848
|
-
} =
|
|
850
|
+
} = t;
|
|
849
851
|
return /* @__PURE__ */ d(
|
|
850
852
|
"div",
|
|
851
853
|
{
|
|
852
|
-
className:
|
|
854
|
+
className: f(
|
|
853
855
|
"flex flex-col",
|
|
854
|
-
|
|
856
|
+
n
|
|
855
857
|
),
|
|
856
858
|
children: [
|
|
857
859
|
/* @__PURE__ */ d("div", { className: "flex flex-row gap-3", children: [
|
|
@@ -864,17 +866,17 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
864
866
|
...l
|
|
865
867
|
}
|
|
866
868
|
),
|
|
867
|
-
/* @__PURE__ */ e("div", { className:
|
|
869
|
+
/* @__PURE__ */ e("div", { className: f(
|
|
868
870
|
"rounded-full absolute border inset-0 mt-[2px] pointer-events-none transition-colors duration-150 ",
|
|
869
|
-
|
|
870
|
-
), children: /* @__PURE__ */ e("div", { className:
|
|
871
|
+
t.checked ? "toggle-track-on" : "toggle-track-off"
|
|
872
|
+
), children: /* @__PURE__ */ e("div", { className: f(
|
|
871
873
|
"absolute top-1/2 -translate-y-1/2 left-1 h-4 w-4 rounded-full toggle-thumb shadow-md transition-all duration-150",
|
|
872
|
-
|
|
874
|
+
t.checked && "translate-x-3.5 "
|
|
873
875
|
) }) })
|
|
874
876
|
] }),
|
|
875
|
-
o && /* @__PURE__ */ e("label", { htmlFor:
|
|
877
|
+
o && /* @__PURE__ */ e("label", { htmlFor: t.id, className: f(
|
|
876
878
|
"input-label font-medium mb-1",
|
|
877
|
-
|
|
879
|
+
t.id && "cursor-pointer"
|
|
878
880
|
), children: o })
|
|
879
881
|
] }),
|
|
880
882
|
/* @__PURE__ */ e(V, { children: s }),
|
|
@@ -882,20 +884,20 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
882
884
|
]
|
|
883
885
|
}
|
|
884
886
|
);
|
|
885
|
-
}, kl = (
|
|
887
|
+
}, kl = (t) => {
|
|
886
888
|
const {
|
|
887
|
-
className:
|
|
889
|
+
className: n,
|
|
888
890
|
label: o,
|
|
889
891
|
description: s,
|
|
890
892
|
error: r,
|
|
891
893
|
...l
|
|
892
|
-
} =
|
|
894
|
+
} = t;
|
|
893
895
|
return /* @__PURE__ */ d(
|
|
894
896
|
"div",
|
|
895
897
|
{
|
|
896
|
-
className:
|
|
898
|
+
className: f(
|
|
897
899
|
"flex flex-col",
|
|
898
|
-
|
|
900
|
+
n
|
|
899
901
|
),
|
|
900
902
|
children: [
|
|
901
903
|
/* @__PURE__ */ d("div", { className: "flex flex-row gap-3", children: [
|
|
@@ -907,9 +909,9 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
907
909
|
...l
|
|
908
910
|
}
|
|
909
911
|
),
|
|
910
|
-
o && /* @__PURE__ */ e("label", { htmlFor:
|
|
912
|
+
o && /* @__PURE__ */ e("label", { htmlFor: t.id, className: f(
|
|
911
913
|
"input-label font-medium mb-1",
|
|
912
|
-
|
|
914
|
+
t.id && "cursor-pointer"
|
|
913
915
|
), children: o })
|
|
914
916
|
] }),
|
|
915
917
|
/* @__PURE__ */ e(V, { children: s }),
|
|
@@ -929,87 +931,87 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
929
931
|
sm: "text-xs",
|
|
930
932
|
md: "text-sm",
|
|
931
933
|
lg: "text-sm"
|
|
932
|
-
}, yl = (
|
|
934
|
+
}, yl = (t) => {
|
|
933
935
|
const {
|
|
934
|
-
label:
|
|
936
|
+
label: n,
|
|
935
937
|
description: o,
|
|
936
938
|
error: s,
|
|
937
939
|
placeholder: r = "No file chosen",
|
|
938
940
|
buttonText: l = "Choose",
|
|
939
|
-
Icon: a =
|
|
941
|
+
Icon: a = Kt,
|
|
940
942
|
size: i = "md",
|
|
941
943
|
value: c,
|
|
942
944
|
isUploaded: g = !1,
|
|
943
|
-
isUploading:
|
|
944
|
-
onChange:
|
|
945
|
-
onDropRejected:
|
|
945
|
+
isUploading: x = !1,
|
|
946
|
+
onChange: w,
|
|
947
|
+
onDropRejected: h,
|
|
946
948
|
accept: b,
|
|
947
949
|
maxSize: p,
|
|
948
|
-
minSize:
|
|
950
|
+
minSize: m,
|
|
949
951
|
disabled: v = !1,
|
|
950
952
|
className: u
|
|
951
|
-
} =
|
|
952
|
-
const [N] =
|
|
953
|
-
N && await
|
|
953
|
+
} = t, I = async (z) => {
|
|
954
|
+
const [N] = z;
|
|
955
|
+
N && await w?.(N);
|
|
954
956
|
}, {
|
|
955
|
-
getRootProps:
|
|
956
|
-
getInputProps:
|
|
957
|
+
getRootProps: R,
|
|
958
|
+
getInputProps: y,
|
|
957
959
|
open: D,
|
|
958
960
|
isDragActive: T,
|
|
959
|
-
isFocused:
|
|
960
|
-
} =
|
|
961
|
+
isFocused: M
|
|
962
|
+
} = St({
|
|
961
963
|
multiple: !1,
|
|
962
964
|
accept: b,
|
|
963
965
|
maxSize: p,
|
|
964
|
-
minSize:
|
|
966
|
+
minSize: m,
|
|
965
967
|
disabled: v,
|
|
966
|
-
onDrop:
|
|
967
|
-
onDropRejected:
|
|
968
|
-
}),
|
|
969
|
-
return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className:
|
|
970
|
-
/* @__PURE__ */ e(J, { children:
|
|
968
|
+
onDrop: I,
|
|
969
|
+
onDropRejected: h
|
|
970
|
+
}), P = c?.name;
|
|
971
|
+
return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className: f("flex flex-col", u), children: [
|
|
972
|
+
/* @__PURE__ */ e(J, { children: n }),
|
|
971
973
|
/* @__PURE__ */ d(
|
|
972
974
|
"div",
|
|
973
975
|
{
|
|
974
|
-
...
|
|
975
|
-
className:
|
|
976
|
+
...R({
|
|
977
|
+
className: f(
|
|
976
978
|
"flex flex-row items-center",
|
|
977
979
|
"border input-base rounded-xl shadow-sm transition-all duration-150",
|
|
978
980
|
"ring-0 focus:outline-none",
|
|
979
|
-
(
|
|
981
|
+
(M || T) && "ring-4",
|
|
980
982
|
s && "input-error",
|
|
981
983
|
v && "opacity-60 cursor-not-allowed",
|
|
982
984
|
te[i],
|
|
983
|
-
|
|
985
|
+
ue[i],
|
|
984
986
|
"gap-3"
|
|
985
987
|
)
|
|
986
988
|
}),
|
|
987
989
|
children: [
|
|
988
|
-
/* @__PURE__ */ e("input", { ...
|
|
989
|
-
/* @__PURE__ */ e(a, { className:
|
|
990
|
+
/* @__PURE__ */ e("input", { ...y() }),
|
|
991
|
+
/* @__PURE__ */ e(a, { className: f("input-icon shrink-0", pe[i]) }),
|
|
990
992
|
/* @__PURE__ */ e(
|
|
991
993
|
"span",
|
|
992
994
|
{
|
|
993
|
-
className:
|
|
995
|
+
className: f(
|
|
994
996
|
"flex-1 truncate",
|
|
995
997
|
Y[i],
|
|
996
|
-
!
|
|
998
|
+
!P && "text-[var(--color-input-placeholder)]"
|
|
997
999
|
),
|
|
998
|
-
children:
|
|
1000
|
+
children: P ?? r
|
|
999
1001
|
}
|
|
1000
1002
|
),
|
|
1001
1003
|
s && /* @__PURE__ */ e(ne, {}),
|
|
1002
|
-
|
|
1003
|
-
g && !
|
|
1004
|
+
x && !s && /* @__PURE__ */ e("div", { className: "h-5 w-5 flex items-center justify-center", children: /* @__PURE__ */ e(Re, { className: "h-4 w-4 text-[var(--color-input-icon)]" }) }),
|
|
1005
|
+
g && !x && !s && /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(et, { className: "h-5 w-5 text-[var(--color-status-success)]" }) }),
|
|
1004
1006
|
/* @__PURE__ */ e(
|
|
1005
1007
|
"button",
|
|
1006
1008
|
{
|
|
1007
1009
|
type: "button",
|
|
1008
1010
|
disabled: v,
|
|
1009
|
-
onClick: (
|
|
1010
|
-
|
|
1011
|
+
onClick: (z) => {
|
|
1012
|
+
z.stopPropagation(), D();
|
|
1011
1013
|
},
|
|
1012
|
-
className:
|
|
1014
|
+
className: f(
|
|
1013
1015
|
"inline-flex flex-row items-center justify-center shrink-0",
|
|
1014
1016
|
"border button-white shadow-sm rounded-[calc(var(--border-radius-input)-0.25rem)]",
|
|
1015
1017
|
"font-semibold cursor-pointer select-none transition-all duration-150",
|
|
@@ -1029,19 +1031,19 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1029
1031
|
/* @__PURE__ */ e(V, { children: o }),
|
|
1030
1032
|
/* @__PURE__ */ e(K, { children: s })
|
|
1031
1033
|
] }) });
|
|
1032
|
-
}, br = (
|
|
1034
|
+
}, br = (t) => t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : t < 1024 * 1024 * 1024 ? `${(t / (1024 * 1024)).toFixed(1)} MB` : `${(t / (1024 * 1024 * 1024)).toFixed(1)} GB`, vr = (t) => {
|
|
1033
1035
|
const {
|
|
1034
|
-
file:
|
|
1036
|
+
file: n,
|
|
1035
1037
|
isUploaded: o = !1,
|
|
1036
1038
|
isUploading: s = !1,
|
|
1037
1039
|
error: r,
|
|
1038
1040
|
onRemove: l,
|
|
1039
1041
|
className: a
|
|
1040
|
-
} =
|
|
1042
|
+
} = t, i = s || o || !!r;
|
|
1041
1043
|
return /* @__PURE__ */ d(
|
|
1042
1044
|
"div",
|
|
1043
1045
|
{
|
|
1044
|
-
className:
|
|
1046
|
+
className: f(
|
|
1045
1047
|
"flex flex-row items-center gap-3",
|
|
1046
1048
|
"border input-base rounded-xl shadow-sm",
|
|
1047
1049
|
"pl-4 pr-1 py-1",
|
|
@@ -1050,14 +1052,14 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1050
1052
|
),
|
|
1051
1053
|
children: [
|
|
1052
1054
|
i && /* @__PURE__ */ e("div", { className: "shrink-0 h-5 w-5 flex items-center justify-center", children: r ? /* @__PURE__ */ e(Ze, { className: "h-5 w-5 input-error-icon" }) : s ? /* @__PURE__ */ e(Re, { className: "h-4 w-4 text-[var(--color-input-icon)]" }) : /* @__PURE__ */ e(et, { className: "h-5 w-5 text-[var(--color-status-success)]" }) }),
|
|
1053
|
-
/* @__PURE__ */ e("div", { className: "flex-1 min-w-0 font-medium truncate", children:
|
|
1054
|
-
/* @__PURE__ */ e("div", { className: "shrink-0 text-sm text-[var(--color-input-description-text)]", children: br(
|
|
1055
|
+
/* @__PURE__ */ e("div", { className: "flex-1 min-w-0 font-medium truncate", children: n.name }),
|
|
1056
|
+
/* @__PURE__ */ e("div", { className: "shrink-0 text-sm text-[var(--color-input-description-text)]", children: br(n.size) }),
|
|
1055
1057
|
l && /* @__PURE__ */ e(
|
|
1056
1058
|
Je,
|
|
1057
1059
|
{
|
|
1058
1060
|
variant: "transparent",
|
|
1059
1061
|
size: "sm",
|
|
1060
|
-
Icon:
|
|
1062
|
+
Icon: ce,
|
|
1061
1063
|
onClick: l,
|
|
1062
1064
|
"aria-label": "Remove file",
|
|
1063
1065
|
className: "shrink-0"
|
|
@@ -1066,77 +1068,77 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1066
1068
|
]
|
|
1067
1069
|
}
|
|
1068
1070
|
);
|
|
1069
|
-
}, Cl = (
|
|
1071
|
+
}, Cl = (t) => {
|
|
1070
1072
|
const {
|
|
1071
|
-
label:
|
|
1073
|
+
label: n,
|
|
1072
1074
|
description: o,
|
|
1073
1075
|
error: s,
|
|
1074
1076
|
title: r = "Drop files here",
|
|
1075
1077
|
hint: l,
|
|
1076
|
-
Icon: a =
|
|
1078
|
+
Icon: a = Gt,
|
|
1077
1079
|
onUpload: i,
|
|
1078
1080
|
onFileRemoved: c,
|
|
1079
1081
|
onDropRejected: g,
|
|
1080
|
-
renderFileTile:
|
|
1081
|
-
accept:
|
|
1082
|
-
maxSize:
|
|
1082
|
+
renderFileTile: x,
|
|
1083
|
+
accept: w,
|
|
1084
|
+
maxSize: h,
|
|
1083
1085
|
minSize: b,
|
|
1084
1086
|
maxFiles: p,
|
|
1085
|
-
disabled:
|
|
1087
|
+
disabled: m = !1,
|
|
1086
1088
|
className: v
|
|
1087
|
-
} =
|
|
1088
|
-
|
|
1089
|
+
} = t, [u, I] = A([]), R = ke(0), y = (k, B) => {
|
|
1090
|
+
I((O) => O.map((_) => _.id === k ? { ..._, ...B } : _));
|
|
1089
1091
|
}, D = (k) => {
|
|
1090
1092
|
if (k.length === 0) return;
|
|
1091
1093
|
const B = k.map((O) => ({
|
|
1092
|
-
id: String(++
|
|
1094
|
+
id: String(++R.current),
|
|
1093
1095
|
file: O,
|
|
1094
1096
|
status: i ? "uploading" : "idle"
|
|
1095
1097
|
}));
|
|
1096
|
-
if (
|
|
1098
|
+
if (I((O) => [...O, ...B]), !!i)
|
|
1097
1099
|
for (const O of B)
|
|
1098
|
-
Promise.resolve().then(() => i(O.file)).then(() =>
|
|
1099
|
-
|
|
1100
|
+
Promise.resolve().then(() => i(O.file)).then(() => y(O.id, { status: "uploaded" })).catch((_) => {
|
|
1101
|
+
y(O.id, {
|
|
1100
1102
|
status: "error",
|
|
1101
1103
|
error: _ instanceof Error ? _ : new Error(String(_))
|
|
1102
1104
|
});
|
|
1103
1105
|
});
|
|
1104
1106
|
}, T = (k) => {
|
|
1105
1107
|
const B = u.find((O) => O.id === k);
|
|
1106
|
-
|
|
1108
|
+
I((O) => O.filter((_) => _.id !== k)), B && c?.(B.file);
|
|
1107
1109
|
}, {
|
|
1108
|
-
getRootProps:
|
|
1109
|
-
getInputProps:
|
|
1110
|
-
isDragActive:
|
|
1110
|
+
getRootProps: M,
|
|
1111
|
+
getInputProps: P,
|
|
1112
|
+
isDragActive: z,
|
|
1111
1113
|
isFocused: N
|
|
1112
|
-
} =
|
|
1114
|
+
} = St({
|
|
1113
1115
|
multiple: !0,
|
|
1114
|
-
accept:
|
|
1115
|
-
maxSize:
|
|
1116
|
+
accept: w,
|
|
1117
|
+
maxSize: h,
|
|
1116
1118
|
minSize: b,
|
|
1117
1119
|
maxFiles: p,
|
|
1118
|
-
disabled:
|
|
1120
|
+
disabled: m,
|
|
1119
1121
|
onDrop: D,
|
|
1120
1122
|
onDropRejected: g
|
|
1121
1123
|
});
|
|
1122
|
-
return /* @__PURE__ */ d("div", { className:
|
|
1123
|
-
/* @__PURE__ */ e(J, { children:
|
|
1124
|
+
return /* @__PURE__ */ d("div", { className: f("flex flex-col", v), children: [
|
|
1125
|
+
/* @__PURE__ */ e(J, { children: n }),
|
|
1124
1126
|
/* @__PURE__ */ d(
|
|
1125
1127
|
"div",
|
|
1126
1128
|
{
|
|
1127
|
-
...
|
|
1128
|
-
className:
|
|
1129
|
+
...M({
|
|
1130
|
+
className: f(
|
|
1129
1131
|
"flex flex-col items-center justify-center gap-1",
|
|
1130
1132
|
"border-2 border-dashed input-base rounded-xl bg-transparent!",
|
|
1131
1133
|
"py-10 px-6 cursor-pointer transition-all duration-150",
|
|
1132
1134
|
"ring-0 focus:outline-none",
|
|
1133
|
-
(N ||
|
|
1135
|
+
(N || z) && "ring-4",
|
|
1134
1136
|
s && "input-error",
|
|
1135
|
-
|
|
1137
|
+
m && "opacity-60 cursor-not-allowed"
|
|
1136
1138
|
)
|
|
1137
1139
|
}),
|
|
1138
1140
|
children: [
|
|
1139
|
-
/* @__PURE__ */ e("input", { ...
|
|
1141
|
+
/* @__PURE__ */ e("input", { ...P() }),
|
|
1140
1142
|
/* @__PURE__ */ e("div", { className: "h-14 w-14 rounded-xl flex items-center justify-center bg-[var(--color-input-file-icon-bg)] mb-2", children: /* @__PURE__ */ e(a, { className: "h-7 w-7 input-icon" }) }),
|
|
1141
1143
|
/* @__PURE__ */ e("div", { className: "text-base font-semibold", children: r }),
|
|
1142
1144
|
l && /* @__PURE__ */ e("div", { className: "text-sm text-[var(--color-input-description-text)] ", children: l })
|
|
@@ -1151,7 +1153,7 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1151
1153
|
error: k.status === "error" ? k.error?.message : void 0,
|
|
1152
1154
|
onRemove: () => T(k.id)
|
|
1153
1155
|
};
|
|
1154
|
-
return /* @__PURE__ */ e(
|
|
1156
|
+
return /* @__PURE__ */ e(C.Fragment, { children: x ? x(k.file, B) : /* @__PURE__ */ e(vr, { ...B }) }, k.id);
|
|
1155
1157
|
}) }),
|
|
1156
1158
|
/* @__PURE__ */ e(V, { children: o }),
|
|
1157
1159
|
/* @__PURE__ */ e(K, { children: s })
|
|
@@ -1159,10 +1161,10 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1159
1161
|
}, xr = [
|
|
1160
1162
|
yn,
|
|
1161
1163
|
Cn,
|
|
1162
|
-
|
|
1164
|
+
Dt,
|
|
1163
1165
|
Sn,
|
|
1164
1166
|
Tn
|
|
1165
|
-
],
|
|
1167
|
+
], wt = {
|
|
1166
1168
|
paragraph: "lexical-paragraph",
|
|
1167
1169
|
heading: {
|
|
1168
1170
|
h1: "lexical-h1",
|
|
@@ -1185,7 +1187,7 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1185
1187
|
italic: "lexical-italic",
|
|
1186
1188
|
underline: "lexical-underline"
|
|
1187
1189
|
}
|
|
1188
|
-
},
|
|
1190
|
+
}, Ut = {
|
|
1189
1191
|
isBold: !1,
|
|
1190
1192
|
isItalic: !1,
|
|
1191
1193
|
isUnderline: !1,
|
|
@@ -1196,64 +1198,64 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1196
1198
|
canUndo: !1,
|
|
1197
1199
|
canRedo: !1
|
|
1198
1200
|
}, Be = Qe({
|
|
1199
|
-
state:
|
|
1201
|
+
state: Ut,
|
|
1200
1202
|
tone: "light",
|
|
1201
1203
|
orientation: "horizontal"
|
|
1202
|
-
}),
|
|
1203
|
-
const [
|
|
1204
|
+
}), xe = () => qe(Be), Wt = () => {
|
|
1205
|
+
const [t] = de(), [n, o] = A(Ut);
|
|
1204
1206
|
return $(() => {
|
|
1205
1207
|
const s = () => {
|
|
1206
|
-
|
|
1207
|
-
const r =
|
|
1208
|
-
if (!
|
|
1208
|
+
t.getEditorState().read(() => {
|
|
1209
|
+
const r = Ot();
|
|
1210
|
+
if (!zt(r))
|
|
1209
1211
|
return;
|
|
1210
|
-
const l = r.anchor.getNode(), a = Un(l,
|
|
1212
|
+
const l = r.anchor.getNode(), a = Un(l, Dt), i = a && Dn(a) ? a.getListType() : null;
|
|
1211
1213
|
let c = "paragraph";
|
|
1212
1214
|
if (!i) {
|
|
1213
1215
|
const b = l.getKey() === "root" ? l : l.getTopLevelElementOrThrow();
|
|
1214
1216
|
In(b) && (c = b.getTag());
|
|
1215
1217
|
}
|
|
1216
|
-
const g = r.hasFormat("bold"),
|
|
1218
|
+
const g = r.hasFormat("bold"), x = r.hasFormat("italic"), w = r.hasFormat("underline"), h = pt(l.getParent()) || pt(l);
|
|
1217
1219
|
o((b) => ({
|
|
1218
1220
|
...b,
|
|
1219
1221
|
isBold: g,
|
|
1220
|
-
isItalic:
|
|
1221
|
-
isUnderline:
|
|
1222
|
-
isLink:
|
|
1222
|
+
isItalic: x,
|
|
1223
|
+
isUnderline: w,
|
|
1224
|
+
isLink: h,
|
|
1223
1225
|
isUnorderedList: i === "bullet",
|
|
1224
1226
|
isOrderedList: i === "number",
|
|
1225
1227
|
blockType: c
|
|
1226
1228
|
}));
|
|
1227
1229
|
});
|
|
1228
1230
|
};
|
|
1229
|
-
return
|
|
1230
|
-
|
|
1231
|
-
|
|
1231
|
+
return Tt(
|
|
1232
|
+
t.registerUpdateListener(() => s()),
|
|
1233
|
+
t.registerCommand(
|
|
1232
1234
|
Ln,
|
|
1233
1235
|
(r) => (o((l) => ({ ...l, canUndo: r })), !1),
|
|
1234
1236
|
Le
|
|
1235
1237
|
),
|
|
1236
|
-
|
|
1238
|
+
t.registerCommand(
|
|
1237
1239
|
Pn,
|
|
1238
1240
|
(r) => (o((l) => ({ ...l, canRedo: r })), !1),
|
|
1239
1241
|
Le
|
|
1240
1242
|
)
|
|
1241
1243
|
);
|
|
1242
|
-
}, [
|
|
1243
|
-
},
|
|
1244
|
-
dismiss: qe(
|
|
1244
|
+
}, [t]), n;
|
|
1245
|
+
}, Ht = Qe(void 0), wr = () => ({
|
|
1246
|
+
dismiss: qe(Ht) || (() => {
|
|
1245
1247
|
})
|
|
1246
|
-
}), Ae = (
|
|
1247
|
-
const { trigger:
|
|
1248
|
+
}), Ae = (t) => {
|
|
1249
|
+
const { trigger: n, children: o, placement: s = "bottom-end", minWidth: r = 200, className: l } = t, [a, i] = A(!1), { Popover: c, anchorRef: g } = ct({
|
|
1248
1250
|
placement: s,
|
|
1249
1251
|
onOutsideClick: () => i(!1),
|
|
1250
1252
|
minWidth: r
|
|
1251
1253
|
});
|
|
1252
1254
|
return /* @__PURE__ */ d(ee, { children: [
|
|
1253
|
-
/* @__PURE__ */ e("div", { ref: g, className: l, onClick: () => i(!a), children:
|
|
1254
|
-
/* @__PURE__ */ e(c, { open: a, children: /* @__PURE__ */ e(
|
|
1255
|
+
/* @__PURE__ */ e("div", { ref: g, className: l, onClick: () => i(!a), children: n }),
|
|
1256
|
+
/* @__PURE__ */ e(c, { open: a, children: /* @__PURE__ */ e(be, { padding: "sm", children: /* @__PURE__ */ e(Ht.Provider, { value: () => i(!1), children: o }) }) })
|
|
1255
1257
|
] });
|
|
1256
|
-
}, Nr = "inline-flex flex-row items-center gap-3 h-10 px-3 font-semibold ring-0 dropdown-item rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent", j =
|
|
1258
|
+
}, Nr = "inline-flex flex-row items-center gap-3 h-10 px-3 font-semibold ring-0 dropdown-item rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent", j = C.forwardRef((t, n) => {
|
|
1257
1259
|
const {
|
|
1258
1260
|
className: o,
|
|
1259
1261
|
children: s,
|
|
@@ -1261,14 +1263,14 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1261
1263
|
onClick: l,
|
|
1262
1264
|
dismissOnClick: a = !0,
|
|
1263
1265
|
...i
|
|
1264
|
-
} =
|
|
1265
|
-
l && l(
|
|
1266
|
+
} = t, { dismiss: c } = wr(), g = (x) => {
|
|
1267
|
+
l && l(x), a && c();
|
|
1266
1268
|
};
|
|
1267
1269
|
return /* @__PURE__ */ d(
|
|
1268
1270
|
"button",
|
|
1269
1271
|
{
|
|
1270
|
-
ref:
|
|
1271
|
-
className:
|
|
1272
|
+
ref: n,
|
|
1273
|
+
className: f(
|
|
1272
1274
|
Nr,
|
|
1273
1275
|
o
|
|
1274
1276
|
),
|
|
@@ -1287,12 +1289,12 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1287
1289
|
{ value: "h3", label: "Heading 3" },
|
|
1288
1290
|
{ value: "h4", label: "Heading 4" }
|
|
1289
1291
|
], kr = () => {
|
|
1290
|
-
const [
|
|
1291
|
-
|
|
1292
|
-
const a =
|
|
1293
|
-
|
|
1292
|
+
const [t] = de(), { state: n, tone: o } = xe(), s = (l) => {
|
|
1293
|
+
t.update(() => {
|
|
1294
|
+
const a = Ot();
|
|
1295
|
+
zt(a) && (l === "paragraph" ? bt(a, () => En()) : bt(a, () => Rn(l)));
|
|
1294
1296
|
});
|
|
1295
|
-
}, r = Ke.find((l) => l.value ===
|
|
1297
|
+
}, r = Ke.find((l) => l.value === n.blockType) ?? Ke[0];
|
|
1296
1298
|
return /* @__PURE__ */ e(
|
|
1297
1299
|
Ae,
|
|
1298
1300
|
{
|
|
@@ -1303,22 +1305,22 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1303
1305
|
{
|
|
1304
1306
|
type: "button",
|
|
1305
1307
|
onMouseDown: (l) => l.preventDefault(),
|
|
1306
|
-
className:
|
|
1308
|
+
className: f(
|
|
1307
1309
|
"lexical-tb-btn h-8 px-2 gap-1 text-sm font-medium",
|
|
1308
1310
|
o === "dark" ? "lexical-tb-btn-dark" : "lexical-tb-btn-light"
|
|
1309
1311
|
),
|
|
1310
1312
|
children: [
|
|
1311
1313
|
r.label,
|
|
1312
|
-
/* @__PURE__ */ e(
|
|
1314
|
+
/* @__PURE__ */ e(ge, { className: "h-4 w-4" })
|
|
1313
1315
|
]
|
|
1314
1316
|
}
|
|
1315
1317
|
),
|
|
1316
1318
|
children: Ke.map((l) => /* @__PURE__ */ e(
|
|
1317
1319
|
j,
|
|
1318
1320
|
{
|
|
1319
|
-
Icon: l.value ===
|
|
1321
|
+
Icon: l.value === n.blockType ? Rt : void 0,
|
|
1320
1322
|
onClick: () => s(l.value),
|
|
1321
|
-
className: l.value ===
|
|
1323
|
+
className: l.value === n.blockType ? void 0 : "pl-11",
|
|
1322
1324
|
children: l.label
|
|
1323
1325
|
},
|
|
1324
1326
|
l.value
|
|
@@ -1328,18 +1330,18 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1328
1330
|
}, yr = {
|
|
1329
1331
|
light: "lexical-tb-btn-light",
|
|
1330
1332
|
dark: "lexical-tb-btn-dark"
|
|
1331
|
-
},
|
|
1332
|
-
(
|
|
1333
|
-
const { Icon: o, active: s = !1, tone: r = "light", className: l, onMouseDown: a, ...i } =
|
|
1333
|
+
}, ie = C.forwardRef(
|
|
1334
|
+
(t, n) => {
|
|
1335
|
+
const { Icon: o, active: s = !1, tone: r = "light", className: l, onMouseDown: a, ...i } = t;
|
|
1334
1336
|
return /* @__PURE__ */ e(
|
|
1335
1337
|
"button",
|
|
1336
1338
|
{
|
|
1337
|
-
ref:
|
|
1339
|
+
ref: n,
|
|
1338
1340
|
type: "button",
|
|
1339
1341
|
onMouseDown: (g) => {
|
|
1340
1342
|
g.preventDefault(), a?.(g);
|
|
1341
1343
|
},
|
|
1342
|
-
className:
|
|
1344
|
+
className: f(
|
|
1343
1345
|
"lexical-tb-btn h-8 w-8",
|
|
1344
1346
|
yr[r],
|
|
1345
1347
|
s && "lexical-tb-btn-active",
|
|
@@ -1351,163 +1353,163 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1351
1353
|
);
|
|
1352
1354
|
}
|
|
1353
1355
|
), Cr = () => {
|
|
1354
|
-
const [
|
|
1356
|
+
const [t] = de(), { state: n, tone: o } = xe();
|
|
1355
1357
|
return /* @__PURE__ */ d(ee, { children: [
|
|
1356
1358
|
/* @__PURE__ */ e(
|
|
1357
|
-
|
|
1359
|
+
ie,
|
|
1358
1360
|
{
|
|
1359
|
-
Icon:
|
|
1361
|
+
Icon: Yt,
|
|
1360
1362
|
tone: o,
|
|
1361
|
-
active:
|
|
1363
|
+
active: n.isBold,
|
|
1362
1364
|
"aria-label": "Bold",
|
|
1363
|
-
onClick: () =>
|
|
1365
|
+
onClick: () => t.dispatchCommand($e, "bold")
|
|
1364
1366
|
}
|
|
1365
1367
|
),
|
|
1366
1368
|
/* @__PURE__ */ e(
|
|
1367
|
-
|
|
1369
|
+
ie,
|
|
1368
1370
|
{
|
|
1369
|
-
Icon:
|
|
1371
|
+
Icon: Jt,
|
|
1370
1372
|
tone: o,
|
|
1371
|
-
active:
|
|
1373
|
+
active: n.isItalic,
|
|
1372
1374
|
"aria-label": "Italic",
|
|
1373
|
-
onClick: () =>
|
|
1375
|
+
onClick: () => t.dispatchCommand($e, "italic")
|
|
1374
1376
|
}
|
|
1375
1377
|
),
|
|
1376
1378
|
/* @__PURE__ */ e(
|
|
1377
|
-
|
|
1379
|
+
ie,
|
|
1378
1380
|
{
|
|
1379
|
-
Icon:
|
|
1381
|
+
Icon: Qt,
|
|
1380
1382
|
tone: o,
|
|
1381
|
-
active:
|
|
1383
|
+
active: n.isUnderline,
|
|
1382
1384
|
"aria-label": "Underline",
|
|
1383
|
-
onClick: () =>
|
|
1385
|
+
onClick: () => t.dispatchCommand($e, "underline")
|
|
1384
1386
|
}
|
|
1385
1387
|
)
|
|
1386
1388
|
] });
|
|
1387
1389
|
}, Ir = () => {
|
|
1388
|
-
const [
|
|
1389
|
-
|
|
1390
|
-
|
|
1390
|
+
const [t] = de(), { state: n, tone: o } = xe(), s = () => {
|
|
1391
|
+
t.dispatchCommand(
|
|
1392
|
+
n.isUnorderedList ? ht : On,
|
|
1391
1393
|
void 0
|
|
1392
1394
|
);
|
|
1393
1395
|
}, r = () => {
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
+
t.dispatchCommand(
|
|
1397
|
+
n.isOrderedList ? ht : zn,
|
|
1396
1398
|
void 0
|
|
1397
1399
|
);
|
|
1398
1400
|
};
|
|
1399
1401
|
return /* @__PURE__ */ d(ee, { children: [
|
|
1400
1402
|
/* @__PURE__ */ e(
|
|
1401
|
-
|
|
1403
|
+
ie,
|
|
1402
1404
|
{
|
|
1403
1405
|
Icon: Ye,
|
|
1404
1406
|
tone: o,
|
|
1405
|
-
active:
|
|
1407
|
+
active: n.isUnorderedList,
|
|
1406
1408
|
"aria-label": "Bullet list",
|
|
1407
1409
|
onClick: s
|
|
1408
1410
|
}
|
|
1409
1411
|
),
|
|
1410
1412
|
/* @__PURE__ */ e(
|
|
1411
|
-
|
|
1413
|
+
ie,
|
|
1412
1414
|
{
|
|
1413
|
-
Icon:
|
|
1415
|
+
Icon: qt,
|
|
1414
1416
|
tone: o,
|
|
1415
|
-
active:
|
|
1417
|
+
active: n.isOrderedList,
|
|
1416
1418
|
"aria-label": "Numbered list",
|
|
1417
1419
|
onClick: r
|
|
1418
1420
|
}
|
|
1419
1421
|
)
|
|
1420
1422
|
] });
|
|
1421
1423
|
}, Rr = () => {
|
|
1422
|
-
const [
|
|
1423
|
-
if (
|
|
1424
|
-
|
|
1424
|
+
const [t] = de(), { state: n, tone: o } = xe(), s = () => {
|
|
1425
|
+
if (n.isLink) {
|
|
1426
|
+
t.dispatchCommand(gt, null);
|
|
1425
1427
|
return;
|
|
1426
1428
|
}
|
|
1427
1429
|
const r = window.prompt("Enter URL");
|
|
1428
|
-
r &&
|
|
1430
|
+
r && t.dispatchCommand(gt, r);
|
|
1429
1431
|
};
|
|
1430
1432
|
return /* @__PURE__ */ e(
|
|
1431
|
-
|
|
1433
|
+
ie,
|
|
1432
1434
|
{
|
|
1433
|
-
Icon:
|
|
1435
|
+
Icon: Zt,
|
|
1434
1436
|
tone: o,
|
|
1435
|
-
active:
|
|
1437
|
+
active: n.isLink,
|
|
1436
1438
|
"aria-label": "Link",
|
|
1437
1439
|
onClick: s
|
|
1438
1440
|
}
|
|
1439
1441
|
);
|
|
1440
1442
|
}, Sr = () => {
|
|
1441
|
-
const [
|
|
1443
|
+
const [t] = de(), { state: n, tone: o } = xe();
|
|
1442
1444
|
return /* @__PURE__ */ d(ee, { children: [
|
|
1443
1445
|
/* @__PURE__ */ e(
|
|
1444
|
-
|
|
1446
|
+
ie,
|
|
1445
1447
|
{
|
|
1446
|
-
Icon:
|
|
1448
|
+
Icon: en,
|
|
1447
1449
|
tone: o,
|
|
1448
|
-
disabled: !
|
|
1450
|
+
disabled: !n.canUndo,
|
|
1449
1451
|
"aria-label": "Undo",
|
|
1450
|
-
onClick: () =>
|
|
1452
|
+
onClick: () => t.dispatchCommand(Mn, void 0)
|
|
1451
1453
|
}
|
|
1452
1454
|
),
|
|
1453
1455
|
/* @__PURE__ */ e(
|
|
1454
|
-
|
|
1456
|
+
ie,
|
|
1455
1457
|
{
|
|
1456
|
-
Icon:
|
|
1458
|
+
Icon: tn,
|
|
1457
1459
|
tone: o,
|
|
1458
|
-
disabled: !
|
|
1460
|
+
disabled: !n.canRedo,
|
|
1459
1461
|
"aria-label": "Redo",
|
|
1460
|
-
onClick: () =>
|
|
1462
|
+
onClick: () => t.dispatchCommand(Fn, void 0)
|
|
1461
1463
|
}
|
|
1462
1464
|
)
|
|
1463
1465
|
] });
|
|
1464
1466
|
}, Dr = {
|
|
1465
1467
|
light: "lexical-tb-divider-light",
|
|
1466
1468
|
dark: "lexical-tb-divider-dark"
|
|
1467
|
-
}, Ge = (
|
|
1468
|
-
const { tone:
|
|
1469
|
+
}, Ge = (t) => {
|
|
1470
|
+
const { tone: n, className: o } = t, { tone: s, orientation: r } = xe();
|
|
1469
1471
|
return /* @__PURE__ */ e(
|
|
1470
1472
|
"div",
|
|
1471
1473
|
{
|
|
1472
|
-
className:
|
|
1474
|
+
className: f(
|
|
1473
1475
|
r === "vertical" ? "h-px w-full my-1" : "w-px h-5 my-auto mx-1",
|
|
1474
1476
|
"shrink-0",
|
|
1475
|
-
Dr[
|
|
1477
|
+
Dr[n ?? s],
|
|
1476
1478
|
o
|
|
1477
1479
|
)
|
|
1478
1480
|
}
|
|
1479
1481
|
);
|
|
1480
|
-
},
|
|
1481
|
-
const
|
|
1482
|
-
return
|
|
1483
|
-
|
|
1484
|
-
}),
|
|
1485
|
-
},
|
|
1486
|
-
const { children:
|
|
1487
|
-
const
|
|
1488
|
-
if (!
|
|
1489
|
-
const p =
|
|
1490
|
-
if (
|
|
1491
|
-
c(
|
|
1482
|
+
}, Nt = 4, Or = 36, _t = (t) => {
|
|
1483
|
+
const n = [];
|
|
1484
|
+
return C.Children.forEach(t, (o) => {
|
|
1485
|
+
C.isValidElement(o) && o.type === C.Fragment ? n.push(..._t(o.props.children)) : n.push(o);
|
|
1486
|
+
}), n;
|
|
1487
|
+
}, $t = (t) => {
|
|
1488
|
+
const { children: n } = t, { state: o, tone: s } = xe(), r = _t(n), l = ke(null), a = ke(null), [i, c] = A(r.length), g = Te(() => {
|
|
1489
|
+
const h = l.current, b = a.current;
|
|
1490
|
+
if (!h || !b) return;
|
|
1491
|
+
const p = h.clientWidth, m = Array.from(b.children).map((R) => R.offsetWidth);
|
|
1492
|
+
if (m.reduce((R, y, D) => R + y + (D > 0 ? Nt : 0), 0) <= p) {
|
|
1493
|
+
c(m.length);
|
|
1492
1494
|
return;
|
|
1493
1495
|
}
|
|
1494
|
-
let u = 0,
|
|
1495
|
-
for (let
|
|
1496
|
-
const
|
|
1497
|
-
if (u +
|
|
1498
|
-
u +=
|
|
1496
|
+
let u = 0, I = 0;
|
|
1497
|
+
for (let R = 0; R < m.length; R++) {
|
|
1498
|
+
const y = m[R] + (R > 0 ? Nt : 0);
|
|
1499
|
+
if (u + y + Or > p) break;
|
|
1500
|
+
u += y, I++;
|
|
1499
1501
|
}
|
|
1500
|
-
c(
|
|
1502
|
+
c(I);
|
|
1501
1503
|
}, []);
|
|
1502
|
-
|
|
1504
|
+
It(() => {
|
|
1503
1505
|
g();
|
|
1504
1506
|
}), $(() => {
|
|
1505
|
-
const
|
|
1506
|
-
if (!
|
|
1507
|
+
const h = l.current, b = a.current;
|
|
1508
|
+
if (!h) return;
|
|
1507
1509
|
const p = new ResizeObserver(() => g());
|
|
1508
|
-
return p.observe(
|
|
1510
|
+
return p.observe(h), b && p.observe(b), () => p.disconnect();
|
|
1509
1511
|
}, [g]);
|
|
1510
|
-
const
|
|
1512
|
+
const x = r.slice(0, i), w = r.slice(i);
|
|
1511
1513
|
return /* @__PURE__ */ d(
|
|
1512
1514
|
"div",
|
|
1513
1515
|
{
|
|
@@ -1520,11 +1522,11 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1520
1522
|
ref: a,
|
|
1521
1523
|
"aria-hidden": !0,
|
|
1522
1524
|
className: "pointer-events-none invisible absolute left-0 top-0 flex flex-row items-center gap-1 w-max",
|
|
1523
|
-
children: r.map((
|
|
1525
|
+
children: r.map((h, b) => /* @__PURE__ */ e("div", { className: "flex flex-row items-center", children: h }, b))
|
|
1524
1526
|
}
|
|
1525
1527
|
),
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
+
x.map((h, b) => /* @__PURE__ */ e(C.Fragment, { children: h }, b)),
|
|
1529
|
+
w.length > 0 && /* @__PURE__ */ e(
|
|
1528
1530
|
Ae,
|
|
1529
1531
|
{
|
|
1530
1532
|
placement: "bottom-end",
|
|
@@ -1534,20 +1536,20 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1534
1536
|
{
|
|
1535
1537
|
type: "button",
|
|
1536
1538
|
"aria-label": "More",
|
|
1537
|
-
onMouseDown: (
|
|
1538
|
-
className:
|
|
1539
|
+
onMouseDown: (h) => h.preventDefault(),
|
|
1540
|
+
className: f(
|
|
1539
1541
|
"lexical-tb-btn h-8 w-8 shrink-0",
|
|
1540
1542
|
s === "dark" ? "lexical-tb-btn-dark" : "lexical-tb-btn-light"
|
|
1541
1543
|
),
|
|
1542
|
-
children: /* @__PURE__ */ e(
|
|
1544
|
+
children: /* @__PURE__ */ e(nn, { className: "h-[18px] w-[18px]" })
|
|
1543
1545
|
}
|
|
1544
1546
|
),
|
|
1545
1547
|
children: /* @__PURE__ */ e(Be.Provider, { value: { state: o, tone: "light", orientation: "vertical" }, children: /* @__PURE__ */ e(
|
|
1546
1548
|
"div",
|
|
1547
1549
|
{
|
|
1548
1550
|
className: "flex flex-col items-stretch gap-1",
|
|
1549
|
-
onMouseDown: (
|
|
1550
|
-
children:
|
|
1551
|
+
onMouseDown: (h) => h.preventDefault(),
|
|
1552
|
+
children: w.map((h, b) => /* @__PURE__ */ e(C.Fragment, { children: h }, b))
|
|
1551
1553
|
}
|
|
1552
1554
|
) })
|
|
1553
1555
|
}
|
|
@@ -1555,7 +1557,7 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1555
1557
|
]
|
|
1556
1558
|
}
|
|
1557
1559
|
);
|
|
1558
|
-
},
|
|
1560
|
+
}, dt = () => /* @__PURE__ */ d(ee, { children: [
|
|
1559
1561
|
/* @__PURE__ */ e(kr, {}),
|
|
1560
1562
|
/* @__PURE__ */ e(Ge, {}),
|
|
1561
1563
|
/* @__PURE__ */ e(Cr, {}),
|
|
@@ -1564,35 +1566,35 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1564
1566
|
/* @__PURE__ */ e(Rr, {}),
|
|
1565
1567
|
/* @__PURE__ */ e(Ge, {}),
|
|
1566
1568
|
/* @__PURE__ */ e(Sr, {})
|
|
1567
|
-
] }), Il = () =>
|
|
1568
|
-
const { render:
|
|
1569
|
+
] }), Il = () => dt(), zr = (t) => {
|
|
1570
|
+
const { render: n, className: o } = t, [s] = de(), r = Wt();
|
|
1569
1571
|
return /* @__PURE__ */ e(Be.Provider, { value: { state: r, tone: "light" }, children: /* @__PURE__ */ e(
|
|
1570
1572
|
"div",
|
|
1571
1573
|
{
|
|
1572
|
-
className:
|
|
1574
|
+
className: f(
|
|
1573
1575
|
"lexical-toolbar flex flex-row items-center p-1.5",
|
|
1574
1576
|
o
|
|
1575
1577
|
),
|
|
1576
|
-
children: /* @__PURE__ */ e(
|
|
1578
|
+
children: /* @__PURE__ */ e($t, { children: n ? n({ editor: s, state: r, tone: "light" }) : dt() })
|
|
1577
1579
|
}
|
|
1578
1580
|
) });
|
|
1579
|
-
}, Tr = (
|
|
1580
|
-
const { render:
|
|
1581
|
+
}, Tr = (t) => {
|
|
1582
|
+
const { render: n } = t, [o] = de(), s = Wt(), [r, l] = A(!1), { refs: a, floatingStyles: i } = st({
|
|
1581
1583
|
placement: "top-start",
|
|
1582
1584
|
strategy: "fixed",
|
|
1583
1585
|
middleware: [
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1586
|
+
dn(8),
|
|
1587
|
+
rt(),
|
|
1588
|
+
lt({ padding: 8 }),
|
|
1589
|
+
ot({
|
|
1588
1590
|
apply({ rects: c, elements: g }) {
|
|
1589
1591
|
g.floating.style.width = `${c.reference.width}px`;
|
|
1590
1592
|
}
|
|
1591
1593
|
})
|
|
1592
1594
|
],
|
|
1593
|
-
whileElementsMounted:
|
|
1595
|
+
whileElementsMounted: at
|
|
1594
1596
|
});
|
|
1595
|
-
return $(() => o.registerRootListener((c) => a.setReference(c ?? null)), [o, a]), $(() =>
|
|
1597
|
+
return $(() => o.registerRootListener((c) => a.setReference(c ?? null)), [o, a]), $(() => Tt(
|
|
1596
1598
|
o.registerCommand(
|
|
1597
1599
|
Bn,
|
|
1598
1600
|
() => (l(!0), !1),
|
|
@@ -1611,12 +1613,12 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1611
1613
|
animate: { opacity: 1, y: 0 },
|
|
1612
1614
|
exit: { opacity: 0, y: 4 },
|
|
1613
1615
|
transition: { duration: 0.1, ease: "easeInOut" },
|
|
1614
|
-
children: /* @__PURE__ */ e(
|
|
1616
|
+
children: /* @__PURE__ */ e($t, { children: n ? n({ editor: o, state: s, tone: "dark" }) : dt() })
|
|
1615
1617
|
}
|
|
1616
1618
|
) }) }) }) });
|
|
1617
|
-
}, Rl = (
|
|
1619
|
+
}, Rl = (t) => {
|
|
1618
1620
|
const {
|
|
1619
|
-
label:
|
|
1621
|
+
label: n,
|
|
1620
1622
|
description: o,
|
|
1621
1623
|
error: s,
|
|
1622
1624
|
placeholder: r,
|
|
@@ -1625,40 +1627,40 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1625
1627
|
size: i = "md",
|
|
1626
1628
|
toolbar: c = "static",
|
|
1627
1629
|
renderToolbar: g,
|
|
1628
|
-
minRows:
|
|
1629
|
-
maxRows:
|
|
1630
|
-
autogrow:
|
|
1630
|
+
minRows: x = 4,
|
|
1631
|
+
maxRows: w,
|
|
1632
|
+
autogrow: h = !1,
|
|
1631
1633
|
namespace: b = "InputLexical",
|
|
1632
1634
|
nodes: p,
|
|
1633
|
-
theme:
|
|
1635
|
+
theme: m,
|
|
1634
1636
|
autoFocus: v = !1,
|
|
1635
1637
|
children: u,
|
|
1636
|
-
className:
|
|
1637
|
-
} =
|
|
1638
|
+
className: I
|
|
1639
|
+
} = t, R = ae(
|
|
1638
1640
|
() => ({
|
|
1639
1641
|
namespace: b,
|
|
1640
|
-
theme:
|
|
1642
|
+
theme: m ? { ...wt, ...m } : wt,
|
|
1641
1643
|
nodes: [...xr, ...p ?? []],
|
|
1642
1644
|
editorState: l ?? null,
|
|
1643
|
-
onError: (
|
|
1644
|
-
throw
|
|
1645
|
+
onError: (z) => {
|
|
1646
|
+
throw z;
|
|
1645
1647
|
}
|
|
1646
1648
|
}),
|
|
1647
1649
|
// Lexical reads initialConfig once on mount; later prop changes are ignored by design.
|
|
1648
1650
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1649
1651
|
[]
|
|
1650
|
-
),
|
|
1651
|
-
(
|
|
1652
|
-
a?.(JSON.stringify(
|
|
1652
|
+
), y = Te(
|
|
1653
|
+
(z) => {
|
|
1654
|
+
a?.(JSON.stringify(z.toJSON()));
|
|
1653
1655
|
},
|
|
1654
1656
|
[a]
|
|
1655
|
-
), D = Y[i], T = !!s,
|
|
1656
|
-
return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className:
|
|
1657
|
-
/* @__PURE__ */ e(J, { children:
|
|
1658
|
-
/* @__PURE__ */ e(hn, { initialConfig:
|
|
1657
|
+
), D = Y[i], T = !!s, M = (z) => `calc(${z} * 1lh + 1.5rem)`, P = h ? { minHeight: M(x), maxHeight: w ? M(w) : void 0 } : { height: M(x) };
|
|
1658
|
+
return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className: f("flex flex-col", I), children: [
|
|
1659
|
+
/* @__PURE__ */ e(J, { children: n }),
|
|
1660
|
+
/* @__PURE__ */ e(hn, { initialConfig: R, children: /* @__PURE__ */ d(
|
|
1659
1661
|
"div",
|
|
1660
1662
|
{
|
|
1661
|
-
className:
|
|
1663
|
+
className: f(
|
|
1662
1664
|
"relative flex flex-col border input-base rounded-xl shadow-sm overflow-hidden transition-all duration-150 ring-0 focus-within:ring-4 focus-within:outline-none",
|
|
1663
1665
|
T && "input-error"
|
|
1664
1666
|
),
|
|
@@ -1670,16 +1672,16 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1670
1672
|
contentEditable: /* @__PURE__ */ e(
|
|
1671
1673
|
gn,
|
|
1672
1674
|
{
|
|
1673
|
-
className:
|
|
1675
|
+
className: f(
|
|
1674
1676
|
"lexical-content w-full outline-none px-3 py-3 leading-[1.55] overflow-y-auto mat-ui-hide-scrollbars",
|
|
1675
1677
|
D
|
|
1676
1678
|
),
|
|
1677
|
-
style:
|
|
1679
|
+
style: P,
|
|
1678
1680
|
"aria-placeholder": r ?? "",
|
|
1679
1681
|
placeholder: /* @__PURE__ */ e(
|
|
1680
1682
|
"div",
|
|
1681
1683
|
{
|
|
1682
|
-
className:
|
|
1684
|
+
className: f(
|
|
1683
1685
|
"lexical-placeholder pointer-events-none absolute left-3 top-3",
|
|
1684
1686
|
D
|
|
1685
1687
|
),
|
|
@@ -1695,7 +1697,7 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1695
1697
|
/* @__PURE__ */ e(vn, {}),
|
|
1696
1698
|
/* @__PURE__ */ e(xn, {}),
|
|
1697
1699
|
v && /* @__PURE__ */ e(Nn, {}),
|
|
1698
|
-
a && /* @__PURE__ */ e(wn, { onChange:
|
|
1700
|
+
a && /* @__PURE__ */ e(wn, { onChange: y }),
|
|
1699
1701
|
u,
|
|
1700
1702
|
c === "floating" && /* @__PURE__ */ e(Tr, { render: g })
|
|
1701
1703
|
]
|
|
@@ -1704,22 +1706,22 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1704
1706
|
/* @__PURE__ */ e(V, { children: o }),
|
|
1705
1707
|
/* @__PURE__ */ e(K, { children: s })
|
|
1706
1708
|
] }) });
|
|
1707
|
-
}, Sl = (
|
|
1709
|
+
}, Sl = (t) => {
|
|
1708
1710
|
const {
|
|
1709
|
-
className:
|
|
1711
|
+
className: n,
|
|
1710
1712
|
label: o,
|
|
1711
1713
|
description: s,
|
|
1712
1714
|
options: r,
|
|
1713
1715
|
error: l,
|
|
1714
1716
|
size: a = "md",
|
|
1715
1717
|
...i
|
|
1716
|
-
} =
|
|
1718
|
+
} = t;
|
|
1717
1719
|
return /* @__PURE__ */ e(Q.Provider, { value: a, children: /* @__PURE__ */ d(
|
|
1718
1720
|
"div",
|
|
1719
1721
|
{
|
|
1720
|
-
className:
|
|
1722
|
+
className: f(
|
|
1721
1723
|
"flex flex-col",
|
|
1722
|
-
|
|
1724
|
+
n
|
|
1723
1725
|
),
|
|
1724
1726
|
children: [
|
|
1725
1727
|
/* @__PURE__ */ e(J, { children: o }),
|
|
@@ -1727,12 +1729,12 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1727
1729
|
/* @__PURE__ */ e(
|
|
1728
1730
|
"select",
|
|
1729
1731
|
{
|
|
1730
|
-
className:
|
|
1732
|
+
className: f(
|
|
1731
1733
|
"appearance-none border input-base bg-none transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none",
|
|
1732
1734
|
te[a],
|
|
1733
1735
|
Y[a],
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
+
ue[a],
|
|
1737
|
+
me[a]
|
|
1736
1738
|
),
|
|
1737
1739
|
...i,
|
|
1738
1740
|
children: r && r.map((c, g) => /* @__PURE__ */ e(
|
|
@@ -1748,7 +1750,7 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1748
1750
|
),
|
|
1749
1751
|
/* @__PURE__ */ d(fe, { children: [
|
|
1750
1752
|
l && /* @__PURE__ */ e(ne, {}),
|
|
1751
|
-
/* @__PURE__ */ e(q, { Icon:
|
|
1753
|
+
/* @__PURE__ */ e(q, { Icon: ge })
|
|
1752
1754
|
] })
|
|
1753
1755
|
] }),
|
|
1754
1756
|
/* @__PURE__ */ e(V, { children: s }),
|
|
@@ -1756,7 +1758,7 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1756
1758
|
]
|
|
1757
1759
|
}
|
|
1758
1760
|
) });
|
|
1759
|
-
}, Ue =
|
|
1761
|
+
}, Ue = C.forwardRef((t, n) => {
|
|
1760
1762
|
const {
|
|
1761
1763
|
children: o,
|
|
1762
1764
|
onClick: s,
|
|
@@ -1765,14 +1767,14 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1765
1767
|
active: a = !1,
|
|
1766
1768
|
className: i,
|
|
1767
1769
|
...c
|
|
1768
|
-
} =
|
|
1770
|
+
} = t;
|
|
1769
1771
|
return /* @__PURE__ */ d(
|
|
1770
1772
|
"div",
|
|
1771
1773
|
{
|
|
1772
|
-
ref:
|
|
1774
|
+
ref: n,
|
|
1773
1775
|
...c,
|
|
1774
1776
|
onClick: () => !l && s && s(),
|
|
1775
|
-
className:
|
|
1777
|
+
className: f(
|
|
1776
1778
|
"option-base px-4 py-2 rounded-xl cursor-pointer transition-all duration-150 select-none flex flex-row gap-3 items-center",
|
|
1777
1779
|
r && !l && "option-selected",
|
|
1778
1780
|
a && !l && "option-active",
|
|
@@ -1781,40 +1783,40 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1781
1783
|
),
|
|
1782
1784
|
children: [
|
|
1783
1785
|
/* @__PURE__ */ e("div", { className: "flex-1 min-w-0 break-all line-clamp-1", children: o }),
|
|
1784
|
-
r && !l && /* @__PURE__ */ e("div", { className: "shrink-0", children: /* @__PURE__ */ e(
|
|
1786
|
+
r && !l && /* @__PURE__ */ e("div", { className: "shrink-0", children: /* @__PURE__ */ e(Rt, { className: "h-5 w-5" }) })
|
|
1785
1787
|
]
|
|
1786
1788
|
}
|
|
1787
1789
|
);
|
|
1788
|
-
}), We =
|
|
1789
|
-
const { children: o, className: s, ...r } =
|
|
1790
|
+
}), We = C.forwardRef((t, n) => {
|
|
1791
|
+
const { children: o, className: s, ...r } = t;
|
|
1790
1792
|
return /* @__PURE__ */ e(
|
|
1791
1793
|
"div",
|
|
1792
1794
|
{
|
|
1793
|
-
ref:
|
|
1795
|
+
ref: n,
|
|
1794
1796
|
...r,
|
|
1795
|
-
className:
|
|
1797
|
+
className: f(
|
|
1796
1798
|
"option-group-header px-4 pt-3 pb-1 text-xs font-semibold uppercase tracking-wide select-none",
|
|
1797
1799
|
s
|
|
1798
1800
|
),
|
|
1799
1801
|
children: o
|
|
1800
1802
|
}
|
|
1801
1803
|
);
|
|
1802
|
-
}), He =
|
|
1803
|
-
const { className: o, ...s } =
|
|
1804
|
+
}), He = C.forwardRef((t, n) => {
|
|
1805
|
+
const { className: o, ...s } = t;
|
|
1804
1806
|
return /* @__PURE__ */ e(
|
|
1805
1807
|
"div",
|
|
1806
1808
|
{
|
|
1807
|
-
ref:
|
|
1809
|
+
ref: n,
|
|
1808
1810
|
...s,
|
|
1809
|
-
className:
|
|
1811
|
+
className: f(
|
|
1810
1812
|
"option-divider my-1 h-px",
|
|
1811
1813
|
o
|
|
1812
1814
|
)
|
|
1813
1815
|
}
|
|
1814
1816
|
);
|
|
1815
|
-
}), H = (
|
|
1817
|
+
}), H = (t) => !("kind" in t), _e = (t) => {
|
|
1816
1818
|
const {
|
|
1817
|
-
placement:
|
|
1819
|
+
placement: n = "bottom",
|
|
1818
1820
|
onOutsideClick: o,
|
|
1819
1821
|
fullWidth: s,
|
|
1820
1822
|
minWidth: r,
|
|
@@ -1823,71 +1825,73 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1823
1825
|
onOpenChange: i,
|
|
1824
1826
|
listRef: c,
|
|
1825
1827
|
activeIndex: g,
|
|
1826
|
-
onNavigate:
|
|
1827
|
-
loop:
|
|
1828
|
-
disabledIndices:
|
|
1829
|
-
} =
|
|
1830
|
-
rt({
|
|
1831
|
-
|
|
1832
|
-
|
|
1828
|
+
onNavigate: x,
|
|
1829
|
+
loop: w = !0,
|
|
1830
|
+
disabledIndices: h
|
|
1831
|
+
} = t, b = C.useMemo(() => [
|
|
1832
|
+
rt({ padding: 8 }),
|
|
1833
|
+
lt({ padding: 8 }),
|
|
1834
|
+
ot({
|
|
1835
|
+
apply({ rects: P, elements: z }) {
|
|
1836
|
+
s && (z.floating.style.width = `${P.reference.width}px`), r && (z.floating.style.minWidth = `${r}px`), l && (z.floating.style.maxWidth = `${l}px`);
|
|
1833
1837
|
}
|
|
1834
1838
|
})
|
|
1835
|
-
], [s, l, r]), { refs: p, floatingStyles:
|
|
1836
|
-
placement:
|
|
1839
|
+
], [s, l, r]), { refs: p, floatingStyles: m, context: v, placement: u } = st({
|
|
1840
|
+
placement: n,
|
|
1837
1841
|
open: a,
|
|
1838
1842
|
onOpenChange: i,
|
|
1839
1843
|
middleware: b,
|
|
1840
|
-
whileElementsMounted:
|
|
1841
|
-
}),
|
|
1844
|
+
whileElementsMounted: at
|
|
1845
|
+
}), I = un(v, {
|
|
1842
1846
|
listRef: c,
|
|
1843
1847
|
activeIndex: g,
|
|
1844
|
-
onNavigate:
|
|
1845
|
-
loop:
|
|
1848
|
+
onNavigate: x,
|
|
1849
|
+
loop: w,
|
|
1846
1850
|
virtual: !0,
|
|
1847
1851
|
focusItemOnOpen: !1,
|
|
1848
|
-
disabledIndices:
|
|
1849
|
-
}), { getReferenceProps: R, getFloatingProps:
|
|
1852
|
+
disabledIndices: h
|
|
1853
|
+
}), { getReferenceProps: R, getFloatingProps: y, getItemProps: D } = mn([I]), T = C.useRef({
|
|
1850
1854
|
onOutsideClick: o,
|
|
1851
|
-
floatingStyles:
|
|
1855
|
+
floatingStyles: m,
|
|
1852
1856
|
setFloating: p.setFloating,
|
|
1853
|
-
placement:
|
|
1854
|
-
getFloatingProps:
|
|
1857
|
+
placement: n,
|
|
1858
|
+
getFloatingProps: y
|
|
1855
1859
|
});
|
|
1856
|
-
|
|
1860
|
+
T.current = {
|
|
1857
1861
|
onOutsideClick: o,
|
|
1858
|
-
floatingStyles:
|
|
1862
|
+
floatingStyles: m,
|
|
1859
1863
|
setFloating: p.setFloating,
|
|
1860
|
-
placement:
|
|
1861
|
-
getFloatingProps:
|
|
1864
|
+
placement: u,
|
|
1865
|
+
getFloatingProps: y
|
|
1862
1866
|
};
|
|
1863
|
-
const
|
|
1864
|
-
const
|
|
1865
|
-
const { floatingStyles:
|
|
1867
|
+
const M = C.useMemo(() => {
|
|
1868
|
+
const P = (z) => {
|
|
1869
|
+
const { floatingStyles: N, setFloating: k, onOutsideClick: B, placement: O, getFloatingProps: _ } = T.current, { className: X, open: re, children: le } = z;
|
|
1866
1870
|
return /* @__PURE__ */ e(
|
|
1867
|
-
|
|
1871
|
+
At,
|
|
1868
1872
|
{
|
|
1869
|
-
open:
|
|
1870
|
-
className:
|
|
1871
|
-
onOutsideClick:
|
|
1872
|
-
floatingStyles:
|
|
1873
|
-
setFloating:
|
|
1874
|
-
placement:
|
|
1875
|
-
floatingProps:
|
|
1876
|
-
children:
|
|
1873
|
+
open: re,
|
|
1874
|
+
className: X,
|
|
1875
|
+
onOutsideClick: B,
|
|
1876
|
+
floatingStyles: N,
|
|
1877
|
+
setFloating: k,
|
|
1878
|
+
placement: O,
|
|
1879
|
+
floatingProps: _(),
|
|
1880
|
+
children: le
|
|
1877
1881
|
}
|
|
1878
1882
|
);
|
|
1879
1883
|
};
|
|
1880
|
-
return
|
|
1884
|
+
return C.memo(P);
|
|
1881
1885
|
}, []);
|
|
1882
1886
|
return {
|
|
1883
1887
|
anchorRef: p.setReference,
|
|
1884
|
-
Popover:
|
|
1888
|
+
Popover: M,
|
|
1885
1889
|
getReferenceProps: R,
|
|
1886
|
-
getItemProps:
|
|
1890
|
+
getItemProps: D
|
|
1887
1891
|
};
|
|
1888
|
-
}, Lr = (
|
|
1892
|
+
}, Lr = (t) => {
|
|
1889
1893
|
const {
|
|
1890
|
-
className:
|
|
1894
|
+
className: n,
|
|
1891
1895
|
label: o,
|
|
1892
1896
|
description: s,
|
|
1893
1897
|
options: r,
|
|
@@ -1896,14 +1900,14 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1896
1900
|
placeholder: i,
|
|
1897
1901
|
maxHeight: c = 300,
|
|
1898
1902
|
error: g,
|
|
1899
|
-
size:
|
|
1900
|
-
disabled:
|
|
1901
|
-
clearable:
|
|
1902
|
-
} =
|
|
1903
|
+
size: x = "md",
|
|
1904
|
+
disabled: w = !1,
|
|
1905
|
+
clearable: h = !0
|
|
1906
|
+
} = t, [b, p] = A(!1), [m, v] = A(null), u = C.useRef(null), I = C.useRef([]), R = r?.find((N) => H(N) && N.value === a), y = ae(
|
|
1903
1907
|
() => r.map((N, k) => !H(N) || N.disabled ? k : -1).filter((N) => N !== -1),
|
|
1904
1908
|
[r]
|
|
1905
1909
|
);
|
|
1906
|
-
|
|
1910
|
+
ve(b, () => p(!1)), $(() => {
|
|
1907
1911
|
if (b) {
|
|
1908
1912
|
u.current?.focus({ preventScroll: !0 });
|
|
1909
1913
|
const N = r.findIndex((k) => H(k) && k.value === a);
|
|
@@ -1916,26 +1920,27 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1916
1920
|
} else
|
|
1917
1921
|
v(null);
|
|
1918
1922
|
}, [b]);
|
|
1919
|
-
const { anchorRef: D, Popover: T, getReferenceProps:
|
|
1923
|
+
const { anchorRef: D, Popover: T, getReferenceProps: M, getItemProps: P } = _e({
|
|
1920
1924
|
placement: "bottom",
|
|
1921
1925
|
fullWidth: !0,
|
|
1926
|
+
minWidth: 200,
|
|
1922
1927
|
onOutsideClick: () => p(!1),
|
|
1923
1928
|
open: b,
|
|
1924
1929
|
onOpenChange: p,
|
|
1925
|
-
listRef:
|
|
1926
|
-
activeIndex:
|
|
1930
|
+
listRef: I,
|
|
1931
|
+
activeIndex: m,
|
|
1927
1932
|
onNavigate: v,
|
|
1928
|
-
disabledIndices:
|
|
1929
|
-
}),
|
|
1933
|
+
disabledIndices: y
|
|
1934
|
+
}), z = (N) => {
|
|
1930
1935
|
const k = r[N];
|
|
1931
1936
|
k && H(k) && !k.disabled && (l(k.value), p(!1));
|
|
1932
1937
|
};
|
|
1933
|
-
return /* @__PURE__ */ e(Q.Provider, { value:
|
|
1938
|
+
return /* @__PURE__ */ e(Q.Provider, { value: x, children: /* @__PURE__ */ d(
|
|
1934
1939
|
"div",
|
|
1935
1940
|
{
|
|
1936
|
-
className:
|
|
1941
|
+
className: f(
|
|
1937
1942
|
"flex flex-col",
|
|
1938
|
-
|
|
1943
|
+
n
|
|
1939
1944
|
),
|
|
1940
1945
|
children: [
|
|
1941
1946
|
/* @__PURE__ */ e(J, { children: o }),
|
|
@@ -1943,45 +1948,45 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1943
1948
|
/* @__PURE__ */ d(
|
|
1944
1949
|
"div",
|
|
1945
1950
|
{
|
|
1946
|
-
...
|
|
1951
|
+
...M({
|
|
1947
1952
|
ref: u,
|
|
1948
1953
|
role: "button",
|
|
1949
|
-
tabIndex:
|
|
1950
|
-
"aria-disabled":
|
|
1954
|
+
tabIndex: w ? -1 : 0,
|
|
1955
|
+
"aria-disabled": w,
|
|
1951
1956
|
onClick: () => {
|
|
1952
|
-
|
|
1957
|
+
w || p(!b);
|
|
1953
1958
|
},
|
|
1954
1959
|
onKeyDown: (N) => {
|
|
1955
|
-
|
|
1960
|
+
w || (N.key === " " ? (N.preventDefault(), p((k) => !k)) : N.key === "Enter" && (N.preventDefault(), b && m != null ? z(m) : p(!0)));
|
|
1956
1961
|
}
|
|
1957
1962
|
}),
|
|
1958
|
-
className:
|
|
1963
|
+
className: f(
|
|
1959
1964
|
"flex flex-row items-center border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",
|
|
1960
|
-
te[
|
|
1961
|
-
Y[
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
!
|
|
1965
|
+
te[x],
|
|
1966
|
+
Y[x],
|
|
1967
|
+
ue[x],
|
|
1968
|
+
h && a ? Fe[x] : me[x],
|
|
1969
|
+
w ? "select-trigger-disabled" : g && "select-trigger-error",
|
|
1970
|
+
!w && b && "ring-4"
|
|
1966
1971
|
),
|
|
1967
1972
|
children: [
|
|
1968
|
-
|
|
1969
|
-
!
|
|
1973
|
+
R && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: R.label }),
|
|
1974
|
+
!R && i && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: i })
|
|
1970
1975
|
]
|
|
1971
1976
|
}
|
|
1972
1977
|
),
|
|
1973
1978
|
/* @__PURE__ */ d(fe, { children: [
|
|
1974
|
-
!
|
|
1975
|
-
|
|
1976
|
-
/* @__PURE__ */ e(q, { Icon:
|
|
1979
|
+
!w && g && /* @__PURE__ */ e(ne, {}),
|
|
1980
|
+
h && !!a && !w && /* @__PURE__ */ e(q, { Icon: ce, onClick: () => l(null) }),
|
|
1981
|
+
/* @__PURE__ */ e(q, { Icon: ge })
|
|
1977
1982
|
] }),
|
|
1978
|
-
/* @__PURE__ */ e(T, { open: b, children: /* @__PURE__ */ e(
|
|
1983
|
+
/* @__PURE__ */ e(T, { open: b, 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((N, k) => {
|
|
1979
1984
|
if (!H(N))
|
|
1980
1985
|
return N.kind === "header" ? /* @__PURE__ */ e(
|
|
1981
1986
|
We,
|
|
1982
1987
|
{
|
|
1983
1988
|
ref: (O) => {
|
|
1984
|
-
|
|
1989
|
+
I.current[k] = O;
|
|
1985
1990
|
},
|
|
1986
1991
|
children: N.label
|
|
1987
1992
|
},
|
|
@@ -1990,7 +1995,7 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1990
1995
|
He,
|
|
1991
1996
|
{
|
|
1992
1997
|
ref: (O) => {
|
|
1993
|
-
|
|
1998
|
+
I.current[k] = O;
|
|
1994
1999
|
}
|
|
1995
2000
|
},
|
|
1996
2001
|
`divider-${k}`
|
|
@@ -1999,14 +2004,14 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
1999
2004
|
return /* @__PURE__ */ e(
|
|
2000
2005
|
Ue,
|
|
2001
2006
|
{
|
|
2002
|
-
...
|
|
2007
|
+
...P({
|
|
2003
2008
|
ref(O) {
|
|
2004
|
-
|
|
2009
|
+
I.current[k] = O;
|
|
2005
2010
|
}
|
|
2006
2011
|
}),
|
|
2007
|
-
onClick: () =>
|
|
2012
|
+
onClick: () => z(k),
|
|
2008
2013
|
selected: B,
|
|
2009
|
-
active:
|
|
2014
|
+
active: m === k,
|
|
2010
2015
|
disabled: N.disabled,
|
|
2011
2016
|
children: N.label
|
|
2012
2017
|
},
|
|
@@ -2019,9 +2024,9 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
2019
2024
|
]
|
|
2020
2025
|
}
|
|
2021
2026
|
) });
|
|
2022
|
-
}, Dl = (
|
|
2027
|
+
}, Dl = (t) => {
|
|
2023
2028
|
const {
|
|
2024
|
-
className:
|
|
2029
|
+
className: n,
|
|
2025
2030
|
label: o,
|
|
2026
2031
|
description: s,
|
|
2027
2032
|
options: r,
|
|
@@ -2030,53 +2035,54 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
2030
2035
|
value: i,
|
|
2031
2036
|
placeholder: c,
|
|
2032
2037
|
maxHeight: g = 300,
|
|
2033
|
-
error:
|
|
2034
|
-
size:
|
|
2035
|
-
disabled:
|
|
2038
|
+
error: x,
|
|
2039
|
+
size: w = "md",
|
|
2040
|
+
disabled: h = !1,
|
|
2036
2041
|
clearable: b = !0
|
|
2037
|
-
} =
|
|
2038
|
-
() => N.map((
|
|
2042
|
+
} = t, [p, m] = A(!1), [v, u] = A(r), [I, R] = A(""), [y, D] = A(null), T = C.useRef(null), M = C.useRef(null), P = C.useRef([]), z = r?.find((L) => H(L) && L.value === i), N = ae(() => I !== "" ? v : r, [I, v, r]), k = ae(
|
|
2043
|
+
() => N.map((L, U) => !H(L) || L.disabled ? U : -1).filter((L) => L !== -1),
|
|
2039
2044
|
[N]
|
|
2040
2045
|
);
|
|
2041
|
-
|
|
2042
|
-
u(a(
|
|
2043
|
-
}, [
|
|
2046
|
+
ve(p, () => m(!1)), $(() => {
|
|
2047
|
+
u(a(I));
|
|
2048
|
+
}, [I, r, a]), $(() => {
|
|
2044
2049
|
if (p) {
|
|
2045
|
-
setTimeout(() =>
|
|
2046
|
-
const
|
|
2047
|
-
if (
|
|
2048
|
-
D(
|
|
2050
|
+
setTimeout(() => M.current?.focus(), 100);
|
|
2051
|
+
const L = r.findIndex((U) => H(U) && U.value === i);
|
|
2052
|
+
if (L >= 0)
|
|
2053
|
+
D(L);
|
|
2049
2054
|
else {
|
|
2050
|
-
const U = r.findIndex((
|
|
2055
|
+
const U = r.findIndex((oe) => H(oe) && !oe.disabled);
|
|
2051
2056
|
D(U >= 0 ? U : null);
|
|
2052
2057
|
}
|
|
2053
2058
|
} else
|
|
2054
|
-
D(null),
|
|
2059
|
+
D(null), R("");
|
|
2055
2060
|
}, [p]), $(() => {
|
|
2056
2061
|
if (!p) return;
|
|
2057
|
-
const
|
|
2058
|
-
D(
|
|
2059
|
-
}, [
|
|
2062
|
+
const L = N.findIndex((U) => H(U) && !U.disabled);
|
|
2063
|
+
D(L >= 0 ? L : null);
|
|
2064
|
+
}, [I, p, N]);
|
|
2060
2065
|
const { anchorRef: B, Popover: O, getReferenceProps: _, getItemProps: X } = _e({
|
|
2061
2066
|
placement: "bottom",
|
|
2062
2067
|
fullWidth: !0,
|
|
2063
|
-
|
|
2068
|
+
minWidth: 200,
|
|
2069
|
+
onOutsideClick: () => m(!1),
|
|
2064
2070
|
open: p,
|
|
2065
|
-
onOpenChange:
|
|
2066
|
-
listRef:
|
|
2067
|
-
activeIndex:
|
|
2071
|
+
onOpenChange: m,
|
|
2072
|
+
listRef: P,
|
|
2073
|
+
activeIndex: y,
|
|
2068
2074
|
onNavigate: D,
|
|
2069
2075
|
disabledIndices: k
|
|
2070
|
-
}), re = (
|
|
2071
|
-
const U = N[
|
|
2072
|
-
U && H(U) && !U.disabled && (l(U.value),
|
|
2073
|
-
},
|
|
2074
|
-
return /* @__PURE__ */ e(Q.Provider, { value:
|
|
2076
|
+
}), re = (L) => {
|
|
2077
|
+
const U = N[L];
|
|
2078
|
+
U && H(U) && !U.disabled && (l(U.value), m(!1));
|
|
2079
|
+
}, le = N.some((L) => H(L));
|
|
2080
|
+
return /* @__PURE__ */ e(Q.Provider, { value: w, children: /* @__PURE__ */ d(
|
|
2075
2081
|
"div",
|
|
2076
2082
|
{
|
|
2077
|
-
className:
|
|
2083
|
+
className: f(
|
|
2078
2084
|
"flex flex-col",
|
|
2079
|
-
|
|
2085
|
+
n
|
|
2080
2086
|
),
|
|
2081
2087
|
children: [
|
|
2082
2088
|
/* @__PURE__ */ e(J, { children: o }),
|
|
@@ -2087,114 +2093,114 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
2087
2093
|
..._({
|
|
2088
2094
|
ref: T,
|
|
2089
2095
|
role: "button",
|
|
2090
|
-
tabIndex:
|
|
2091
|
-
"aria-disabled":
|
|
2096
|
+
tabIndex: h ? -1 : 0,
|
|
2097
|
+
"aria-disabled": h,
|
|
2092
2098
|
onClick: () => {
|
|
2093
|
-
|
|
2099
|
+
h || m(!p);
|
|
2094
2100
|
},
|
|
2095
|
-
onKeyDown: (
|
|
2096
|
-
|
|
2101
|
+
onKeyDown: (L) => {
|
|
2102
|
+
h || (L.key === " " ? (L.preventDefault(), m((U) => !U)) : L.key === "Enter" && !p && (L.preventDefault(), m(!0)));
|
|
2097
2103
|
}
|
|
2098
2104
|
}),
|
|
2099
|
-
className:
|
|
2105
|
+
className: f(
|
|
2100
2106
|
"flex flex-row items-center border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",
|
|
2101
|
-
te[
|
|
2102
|
-
Y[
|
|
2103
|
-
|
|
2104
|
-
b && i ? Fe[
|
|
2105
|
-
|
|
2106
|
-
!
|
|
2107
|
+
te[w],
|
|
2108
|
+
Y[w],
|
|
2109
|
+
ue[w],
|
|
2110
|
+
b && i ? Fe[w] : me[w],
|
|
2111
|
+
h ? "select-trigger-disabled" : x && "select-trigger-error",
|
|
2112
|
+
!h && p && "ring-4"
|
|
2107
2113
|
),
|
|
2108
2114
|
children: [
|
|
2109
|
-
|
|
2110
|
-
!
|
|
2115
|
+
z && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: z.label }),
|
|
2116
|
+
!z && c && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: c })
|
|
2111
2117
|
]
|
|
2112
2118
|
}
|
|
2113
2119
|
),
|
|
2114
2120
|
/* @__PURE__ */ d(fe, { children: [
|
|
2115
|
-
!
|
|
2116
|
-
b && !!i && !
|
|
2117
|
-
/* @__PURE__ */ e(q, { Icon:
|
|
2121
|
+
!h && x && /* @__PURE__ */ e(ne, {}),
|
|
2122
|
+
b && !!i && !h && /* @__PURE__ */ e(q, { Icon: ce, onClick: () => l(null) }),
|
|
2123
|
+
/* @__PURE__ */ e(q, { Icon: ge })
|
|
2118
2124
|
] }),
|
|
2119
|
-
/* @__PURE__ */ e(O, { open: p, children: /* @__PURE__ */ d(
|
|
2125
|
+
/* @__PURE__ */ e(O, { open: p, children: /* @__PURE__ */ d(be, { className: "gap-0 !p-0", style: { maxHeight: g }, children: [
|
|
2120
2126
|
/* @__PURE__ */ d("div", { className: "sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm", children: [
|
|
2121
2127
|
/* @__PURE__ */ e(
|
|
2122
2128
|
"input",
|
|
2123
2129
|
{
|
|
2124
|
-
ref:
|
|
2130
|
+
ref: M,
|
|
2125
2131
|
type: "text",
|
|
2126
2132
|
placeholder: "Search",
|
|
2127
|
-
value:
|
|
2133
|
+
value: I,
|
|
2128
2134
|
className: "appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",
|
|
2129
|
-
onChange: (
|
|
2130
|
-
onKeyDown: (
|
|
2131
|
-
|
|
2135
|
+
onChange: (L) => R(L.target.value),
|
|
2136
|
+
onKeyDown: (L) => {
|
|
2137
|
+
L.key === "Enter" && y != null && (L.preventDefault(), re(y));
|
|
2132
2138
|
}
|
|
2133
2139
|
}
|
|
2134
2140
|
),
|
|
2135
2141
|
/* @__PURE__ */ e(Ee, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
|
|
2136
2142
|
] }),
|
|
2137
2143
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1 p-2", children: [
|
|
2138
|
-
|
|
2139
|
-
N.map((
|
|
2140
|
-
if (!H(
|
|
2141
|
-
return
|
|
2144
|
+
I !== "" && !le && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(tt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
|
|
2145
|
+
N.map((L, U) => {
|
|
2146
|
+
if (!H(L))
|
|
2147
|
+
return L.kind === "header" ? /* @__PURE__ */ e(
|
|
2142
2148
|
We,
|
|
2143
2149
|
{
|
|
2144
2150
|
ref: (Z) => {
|
|
2145
|
-
|
|
2151
|
+
P.current[U] = Z;
|
|
2146
2152
|
},
|
|
2147
|
-
children:
|
|
2153
|
+
children: L.label
|
|
2148
2154
|
},
|
|
2149
2155
|
`header-${U}`
|
|
2150
2156
|
) : /* @__PURE__ */ e(
|
|
2151
2157
|
He,
|
|
2152
2158
|
{
|
|
2153
2159
|
ref: (Z) => {
|
|
2154
|
-
|
|
2160
|
+
P.current[U] = Z;
|
|
2155
2161
|
}
|
|
2156
2162
|
},
|
|
2157
2163
|
`divider-${U}`
|
|
2158
2164
|
);
|
|
2159
|
-
const
|
|
2165
|
+
const oe = L.value === i;
|
|
2160
2166
|
return /* @__PURE__ */ e(
|
|
2161
2167
|
Ue,
|
|
2162
2168
|
{
|
|
2163
2169
|
...X({
|
|
2164
2170
|
ref(Z) {
|
|
2165
|
-
|
|
2171
|
+
P.current[U] = Z;
|
|
2166
2172
|
}
|
|
2167
2173
|
}),
|
|
2168
2174
|
onClick: () => re(U),
|
|
2169
|
-
selected:
|
|
2170
|
-
active:
|
|
2171
|
-
disabled:
|
|
2172
|
-
children:
|
|
2175
|
+
selected: oe,
|
|
2176
|
+
active: y === U,
|
|
2177
|
+
disabled: L.disabled,
|
|
2178
|
+
children: L.label
|
|
2173
2179
|
},
|
|
2174
|
-
String(
|
|
2180
|
+
String(L.value)
|
|
2175
2181
|
);
|
|
2176
2182
|
})
|
|
2177
2183
|
] })
|
|
2178
2184
|
] }) })
|
|
2179
2185
|
] }),
|
|
2180
2186
|
/* @__PURE__ */ e(V, { children: s }),
|
|
2181
|
-
/* @__PURE__ */ e(K, { children:
|
|
2187
|
+
/* @__PURE__ */ e(K, { children: x })
|
|
2182
2188
|
]
|
|
2183
2189
|
}
|
|
2184
2190
|
) });
|
|
2185
|
-
}, Pr = (
|
|
2186
|
-
const [o, s] = A(
|
|
2191
|
+
}, Pr = (t, n) => {
|
|
2192
|
+
const [o, s] = A(t);
|
|
2187
2193
|
return $(() => {
|
|
2188
2194
|
const r = setTimeout(() => {
|
|
2189
|
-
s(
|
|
2190
|
-
},
|
|
2195
|
+
s(t);
|
|
2196
|
+
}, n);
|
|
2191
2197
|
return () => {
|
|
2192
2198
|
clearTimeout(r);
|
|
2193
2199
|
};
|
|
2194
|
-
}, [
|
|
2195
|
-
}, Ol = (
|
|
2200
|
+
}, [t, n]), o;
|
|
2201
|
+
}, Ol = (t) => {
|
|
2196
2202
|
const {
|
|
2197
|
-
className:
|
|
2203
|
+
className: n,
|
|
2198
2204
|
label: o,
|
|
2199
2205
|
description: s,
|
|
2200
2206
|
onChange: r,
|
|
@@ -2203,88 +2209,89 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
2203
2209
|
onSearchDebounceMs: i = 300,
|
|
2204
2210
|
value: c,
|
|
2205
2211
|
placeholder: g,
|
|
2206
|
-
maxHeight:
|
|
2207
|
-
error:
|
|
2208
|
-
size:
|
|
2212
|
+
maxHeight: x = 300,
|
|
2213
|
+
error: w,
|
|
2214
|
+
size: h = "md",
|
|
2209
2215
|
disabled: b = !1,
|
|
2210
2216
|
clearable: p = !0
|
|
2211
|
-
} =
|
|
2212
|
-
() =>
|
|
2213
|
-
[
|
|
2217
|
+
} = t, [m, v] = A(!1), u = C.useRef(null), [I, R] = A(""), [y, D] = A([]), [T, M] = A(null), P = C.useRef(null), [z, N] = A(!1), [k, B] = A(!1), [O, _] = A(null), X = C.useRef([]), re = ae(
|
|
2218
|
+
() => y.map((E, F) => !H(E) || E.disabled ? F : -1).filter((E) => E !== -1),
|
|
2219
|
+
[y]
|
|
2214
2220
|
);
|
|
2215
|
-
|
|
2216
|
-
const
|
|
2221
|
+
ve(m, () => v(!1));
|
|
2222
|
+
const le = Pr(I, i);
|
|
2217
2223
|
$(() => {
|
|
2218
2224
|
(async () => {
|
|
2219
2225
|
N(!0);
|
|
2220
|
-
const F = await l(
|
|
2226
|
+
const F = await l(le);
|
|
2221
2227
|
D(F), N(!1);
|
|
2222
2228
|
})();
|
|
2223
|
-
}, [
|
|
2229
|
+
}, [le, l]), $(() => {
|
|
2224
2230
|
if (c == null) {
|
|
2225
|
-
|
|
2231
|
+
M(null);
|
|
2226
2232
|
return;
|
|
2227
2233
|
}
|
|
2228
|
-
const
|
|
2229
|
-
|
|
2234
|
+
const E = y?.find((F) => H(F) && F.value === c);
|
|
2235
|
+
E ? M(E) : (async () => {
|
|
2230
2236
|
B(!0);
|
|
2231
|
-
const
|
|
2232
|
-
|
|
2237
|
+
const se = await a(c);
|
|
2238
|
+
M(se), B(!1);
|
|
2233
2239
|
})();
|
|
2234
|
-
}, [a,
|
|
2235
|
-
|
|
2236
|
-
}, [
|
|
2237
|
-
if (!
|
|
2238
|
-
const
|
|
2239
|
-
_(
|
|
2240
|
-
}, [
|
|
2241
|
-
const { anchorRef:
|
|
2240
|
+
}, [a, y, c]), $(() => {
|
|
2241
|
+
m ? setTimeout(() => P.current?.focus(), 100) : (_(null), R(""));
|
|
2242
|
+
}, [m]), $(() => {
|
|
2243
|
+
if (!m) return;
|
|
2244
|
+
const E = y.findIndex((F) => H(F) && !F.disabled);
|
|
2245
|
+
_(E >= 0 ? E : null);
|
|
2246
|
+
}, [y, m]);
|
|
2247
|
+
const { anchorRef: L, Popover: U, getReferenceProps: oe, getItemProps: Z } = _e({
|
|
2242
2248
|
placement: "bottom",
|
|
2243
2249
|
fullWidth: !0,
|
|
2250
|
+
minWidth: 200,
|
|
2244
2251
|
onOutsideClick: () => v(!1),
|
|
2245
|
-
open:
|
|
2252
|
+
open: m,
|
|
2246
2253
|
onOpenChange: v,
|
|
2247
2254
|
listRef: X,
|
|
2248
2255
|
activeIndex: O,
|
|
2249
2256
|
onNavigate: _,
|
|
2250
2257
|
disabledIndices: re
|
|
2251
|
-
}), De = (
|
|
2252
|
-
const F =
|
|
2258
|
+
}), De = (E) => {
|
|
2259
|
+
const F = y[E];
|
|
2253
2260
|
F && H(F) && !F.disabled && (r(F.value), v(!1));
|
|
2254
|
-
}, Oe =
|
|
2255
|
-
return /* @__PURE__ */ e(Q.Provider, { value:
|
|
2261
|
+
}, Oe = y.some((E) => H(E));
|
|
2262
|
+
return /* @__PURE__ */ e(Q.Provider, { value: h, children: /* @__PURE__ */ d(
|
|
2256
2263
|
"div",
|
|
2257
2264
|
{
|
|
2258
|
-
className:
|
|
2265
|
+
className: f(
|
|
2259
2266
|
"flex flex-col",
|
|
2260
|
-
|
|
2267
|
+
n
|
|
2261
2268
|
),
|
|
2262
2269
|
children: [
|
|
2263
2270
|
/* @__PURE__ */ e(J, { children: o }),
|
|
2264
|
-
/* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref:
|
|
2271
|
+
/* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: L, children: [
|
|
2265
2272
|
/* @__PURE__ */ d(
|
|
2266
2273
|
"div",
|
|
2267
2274
|
{
|
|
2268
|
-
...
|
|
2275
|
+
...oe({
|
|
2269
2276
|
ref: u,
|
|
2270
2277
|
role: "button",
|
|
2271
2278
|
tabIndex: b ? -1 : 0,
|
|
2272
2279
|
"aria-disabled": b,
|
|
2273
2280
|
onClick: () => {
|
|
2274
|
-
b || v(!
|
|
2281
|
+
b || v(!m);
|
|
2275
2282
|
},
|
|
2276
|
-
onKeyDown: (
|
|
2277
|
-
b || (
|
|
2283
|
+
onKeyDown: (E) => {
|
|
2284
|
+
b || (E.key === " " ? (E.preventDefault(), v((F) => !F)) : E.key === "Enter" && !m && (E.preventDefault(), v(!0)));
|
|
2278
2285
|
}
|
|
2279
2286
|
}),
|
|
2280
|
-
className:
|
|
2287
|
+
className: f(
|
|
2281
2288
|
"flex flex-row items-center border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",
|
|
2282
|
-
te[
|
|
2283
|
-
Y[
|
|
2284
|
-
|
|
2285
|
-
p && c ? Fe[
|
|
2286
|
-
b ? "select-trigger-disabled" :
|
|
2287
|
-
!b &&
|
|
2289
|
+
te[h],
|
|
2290
|
+
Y[h],
|
|
2291
|
+
ue[h],
|
|
2292
|
+
p && c ? Fe[h] : me[h],
|
|
2293
|
+
b ? "select-trigger-disabled" : w && "select-trigger-error",
|
|
2294
|
+
!b && m && "ring-4"
|
|
2288
2295
|
),
|
|
2289
2296
|
children: [
|
|
2290
2297
|
!k && T && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: T.label }),
|
|
@@ -2294,74 +2301,74 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
2294
2301
|
}
|
|
2295
2302
|
),
|
|
2296
2303
|
/* @__PURE__ */ d(fe, { children: [
|
|
2297
|
-
!b &&
|
|
2298
|
-
p && !!c && !b && /* @__PURE__ */ e(q, { Icon:
|
|
2299
|
-
/* @__PURE__ */ e(q, { Icon:
|
|
2304
|
+
!b && w && /* @__PURE__ */ e(ne, {}),
|
|
2305
|
+
p && !!c && !b && /* @__PURE__ */ e(q, { Icon: ce, onClick: () => r(null) }),
|
|
2306
|
+
/* @__PURE__ */ e(q, { Icon: ge })
|
|
2300
2307
|
] }),
|
|
2301
|
-
/* @__PURE__ */ e(U, { open:
|
|
2308
|
+
/* @__PURE__ */ e(U, { open: m, children: /* @__PURE__ */ d(be, { className: "gap-0 !p-0", style: { maxHeight: x }, children: [
|
|
2302
2309
|
/* @__PURE__ */ d("div", { className: "sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm", children: [
|
|
2303
2310
|
/* @__PURE__ */ e(
|
|
2304
2311
|
"input",
|
|
2305
2312
|
{
|
|
2306
|
-
ref:
|
|
2313
|
+
ref: P,
|
|
2307
2314
|
type: "text",
|
|
2308
2315
|
placeholder: "Search",
|
|
2309
|
-
value:
|
|
2316
|
+
value: I,
|
|
2310
2317
|
className: "appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",
|
|
2311
|
-
onChange: (
|
|
2312
|
-
onKeyDown: (
|
|
2313
|
-
|
|
2318
|
+
onChange: (E) => R(E.target.value),
|
|
2319
|
+
onKeyDown: (E) => {
|
|
2320
|
+
E.key === "Enter" && O != null && (E.preventDefault(), De(O));
|
|
2314
2321
|
}
|
|
2315
2322
|
}
|
|
2316
2323
|
),
|
|
2317
2324
|
/* @__PURE__ */ e(Ee, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
|
|
2318
2325
|
] }),
|
|
2319
2326
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1 p-2", children: [
|
|
2320
|
-
!
|
|
2321
|
-
|
|
2322
|
-
!
|
|
2323
|
-
if (!H(
|
|
2324
|
-
return
|
|
2327
|
+
!z && !Oe && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(tt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
|
|
2328
|
+
z && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(Re, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
|
|
2329
|
+
!z && y.map((E, F) => {
|
|
2330
|
+
if (!H(E))
|
|
2331
|
+
return E.kind === "header" ? /* @__PURE__ */ e(
|
|
2325
2332
|
We,
|
|
2326
2333
|
{
|
|
2327
|
-
ref: (
|
|
2328
|
-
X.current[F] =
|
|
2334
|
+
ref: (he) => {
|
|
2335
|
+
X.current[F] = he;
|
|
2329
2336
|
},
|
|
2330
|
-
children:
|
|
2337
|
+
children: E.label
|
|
2331
2338
|
},
|
|
2332
2339
|
`header-${F}`
|
|
2333
2340
|
) : /* @__PURE__ */ e(
|
|
2334
2341
|
He,
|
|
2335
2342
|
{
|
|
2336
|
-
ref: (
|
|
2337
|
-
X.current[F] =
|
|
2343
|
+
ref: (he) => {
|
|
2344
|
+
X.current[F] = he;
|
|
2338
2345
|
}
|
|
2339
2346
|
},
|
|
2340
2347
|
`divider-${F}`
|
|
2341
2348
|
);
|
|
2342
|
-
const
|
|
2349
|
+
const se = E.value === c;
|
|
2343
2350
|
return /* @__PURE__ */ e(
|
|
2344
2351
|
Ue,
|
|
2345
2352
|
{
|
|
2346
2353
|
...Z({
|
|
2347
|
-
ref(
|
|
2348
|
-
X.current[F] =
|
|
2354
|
+
ref(he) {
|
|
2355
|
+
X.current[F] = he;
|
|
2349
2356
|
}
|
|
2350
2357
|
}),
|
|
2351
2358
|
onClick: () => De(F),
|
|
2352
|
-
selected:
|
|
2359
|
+
selected: se,
|
|
2353
2360
|
active: O === F,
|
|
2354
|
-
disabled:
|
|
2355
|
-
children:
|
|
2361
|
+
disabled: E.disabled,
|
|
2362
|
+
children: E.label
|
|
2356
2363
|
},
|
|
2357
|
-
String(
|
|
2364
|
+
String(E.value)
|
|
2358
2365
|
);
|
|
2359
2366
|
})
|
|
2360
2367
|
] })
|
|
2361
2368
|
] }) })
|
|
2362
2369
|
] }),
|
|
2363
2370
|
/* @__PURE__ */ e(V, { children: s }),
|
|
2364
|
-
/* @__PURE__ */ e(K, { children:
|
|
2371
|
+
/* @__PURE__ */ e(K, { children: w })
|
|
2365
2372
|
]
|
|
2366
2373
|
}
|
|
2367
2374
|
) });
|
|
@@ -2390,7 +2397,7 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
2390
2397
|
stone: "bg-stone-100 text-stone-700 ring-stone-200 dark:bg-stone-950 dark:text-stone-300 dark:ring-stone-800",
|
|
2391
2398
|
white: "bg-[var(--color-badge-white-bg)] text-[var(--color-badge-white-text)] ring-[var(--color-badge-white-ring)]",
|
|
2392
2399
|
black: "bg-[var(--color-badge-black-bg)] text-[var(--color-badge-black-text)] ring-[var(--color-badge-black-ring)]"
|
|
2393
|
-
}, Pe =
|
|
2400
|
+
}, Pe = C.forwardRef((t, n) => {
|
|
2394
2401
|
const {
|
|
2395
2402
|
className: o,
|
|
2396
2403
|
children: s,
|
|
@@ -2398,47 +2405,47 @@ const h = (...n) => n.filter(Boolean).join(" "), Wn = [
|
|
|
2398
2405
|
showCloseIcon: l,
|
|
2399
2406
|
Icon: a,
|
|
2400
2407
|
color: i = "gray"
|
|
2401
|
-
} =
|
|
2408
|
+
} = t, c = f(
|
|
2402
2409
|
"inline-flex align-top items-center gap-2 px-3 h-7 rounded-lg font-semibold",
|
|
2403
2410
|
Er[i],
|
|
2404
2411
|
o
|
|
2405
2412
|
);
|
|
2406
|
-
return r ? /* @__PURE__ */ e("div", { ref:
|
|
2413
|
+
return r ? /* @__PURE__ */ e("div", { ref: n, children: /* @__PURE__ */ d(
|
|
2407
2414
|
"button",
|
|
2408
2415
|
{
|
|
2409
|
-
className:
|
|
2416
|
+
className: f("cursor-pointer ring-0 hover:ring-4 active:ring-1 transition-all duration-100 select-none focus:outline-none focus:ring-4", c),
|
|
2410
2417
|
onClick: r,
|
|
2411
2418
|
children: [
|
|
2412
2419
|
a && /* @__PURE__ */ e(a, { className: "h-4 w-4 shrink-0" }),
|
|
2413
2420
|
/* @__PURE__ */ e("div", { className: "break-all line-clamp-1 text-left", children: s }),
|
|
2414
2421
|
l && /* @__PURE__ */ e(
|
|
2415
|
-
|
|
2422
|
+
ce,
|
|
2416
2423
|
{
|
|
2417
2424
|
className: "h-4 w-4 shrink-0"
|
|
2418
2425
|
}
|
|
2419
2426
|
)
|
|
2420
2427
|
]
|
|
2421
2428
|
}
|
|
2422
|
-
) }) : /* @__PURE__ */ d("div", { className: c, ref:
|
|
2429
|
+
) }) : /* @__PURE__ */ d("div", { className: c, ref: n, children: [
|
|
2423
2430
|
a && /* @__PURE__ */ e(a, { className: "h-4 w-4 shrink-0" }),
|
|
2424
2431
|
/* @__PURE__ */ e("div", { className: "break-all line-clamp-1 text-left", children: s })
|
|
2425
2432
|
] });
|
|
2426
2433
|
});
|
|
2427
|
-
function Mr(
|
|
2434
|
+
function Mr(t) {
|
|
2428
2435
|
const {
|
|
2429
|
-
enabled:
|
|
2436
|
+
enabled: n,
|
|
2430
2437
|
triggerRef: o,
|
|
2431
2438
|
measureRef: s,
|
|
2432
2439
|
trayRef: r,
|
|
2433
2440
|
itemCount: l,
|
|
2434
2441
|
deps: a = [],
|
|
2435
2442
|
gap: i = 4
|
|
2436
|
-
} =
|
|
2437
|
-
return
|
|
2438
|
-
if (!
|
|
2439
|
-
const
|
|
2440
|
-
if (!
|
|
2441
|
-
const
|
|
2443
|
+
} = t, [c, g] = A(0);
|
|
2444
|
+
return It(() => {
|
|
2445
|
+
if (!n) return;
|
|
2446
|
+
const x = o.current, w = s.current;
|
|
2447
|
+
if (!x || !w) return;
|
|
2448
|
+
const h = () => {
|
|
2442
2449
|
if (l === 0) {
|
|
2443
2450
|
g(0);
|
|
2444
2451
|
return;
|
|
@@ -2447,37 +2454,37 @@ function Mr(n) {
|
|
|
2447
2454
|
g(1);
|
|
2448
2455
|
return;
|
|
2449
2456
|
}
|
|
2450
|
-
const p = window.getComputedStyle(
|
|
2451
|
-
let
|
|
2452
|
-
const
|
|
2453
|
-
if (
|
|
2454
|
-
const N =
|
|
2455
|
-
N.width > 0 && (
|
|
2457
|
+
const p = window.getComputedStyle(x), m = parseFloat(p.paddingLeft || "0"), v = x.getBoundingClientRect(), u = v.left + m;
|
|
2458
|
+
let I = v.right - parseFloat(p.paddingRight || "0");
|
|
2459
|
+
const R = r?.current;
|
|
2460
|
+
if (R) {
|
|
2461
|
+
const N = R.getBoundingClientRect();
|
|
2462
|
+
N.width > 0 && (I = Math.min(I, N.left - i));
|
|
2456
2463
|
}
|
|
2457
|
-
const
|
|
2464
|
+
const y = Math.max(0, I - u), D = Array.from(w.children);
|
|
2458
2465
|
if (D.length < l + 1) return;
|
|
2459
2466
|
let T = 0;
|
|
2460
2467
|
for (let N = 0; N < l; N++)
|
|
2461
2468
|
T += D[N].offsetWidth + (N > 0 ? i : 0);
|
|
2462
|
-
if (T <=
|
|
2469
|
+
if (T <= y) {
|
|
2463
2470
|
g(l);
|
|
2464
2471
|
return;
|
|
2465
2472
|
}
|
|
2466
|
-
const
|
|
2467
|
-
let
|
|
2473
|
+
const M = D[l].offsetWidth;
|
|
2474
|
+
let P = 0, z = 0;
|
|
2468
2475
|
for (let N = 0; N < l; N++) {
|
|
2469
|
-
const k = D[N].offsetWidth, B =
|
|
2470
|
-
if (B +
|
|
2471
|
-
|
|
2476
|
+
const k = D[N].offsetWidth, B = P + k + (N > 0 ? i : 0);
|
|
2477
|
+
if (B + M + i > y) break;
|
|
2478
|
+
P = B, z++;
|
|
2472
2479
|
}
|
|
2473
|
-
g(Math.max(1,
|
|
2474
|
-
}, b = new ResizeObserver(
|
|
2475
|
-
return b.observe(
|
|
2476
|
-
}, [
|
|
2480
|
+
g(Math.max(1, z));
|
|
2481
|
+
}, b = new ResizeObserver(h);
|
|
2482
|
+
return b.observe(x), r?.current && b.observe(r.current), h(), () => b.disconnect();
|
|
2483
|
+
}, [n, l, ...a]), c;
|
|
2477
2484
|
}
|
|
2478
|
-
const zl = (
|
|
2485
|
+
const zl = (t) => {
|
|
2479
2486
|
const {
|
|
2480
|
-
className:
|
|
2487
|
+
className: n,
|
|
2481
2488
|
label: o,
|
|
2482
2489
|
description: s,
|
|
2483
2490
|
options: r,
|
|
@@ -2486,78 +2493,79 @@ const zl = (n) => {
|
|
|
2486
2493
|
value: i,
|
|
2487
2494
|
placeholder: c,
|
|
2488
2495
|
maxHeight: g = 300,
|
|
2489
|
-
error:
|
|
2490
|
-
size:
|
|
2491
|
-
singleLine:
|
|
2496
|
+
error: x,
|
|
2497
|
+
size: w = "md",
|
|
2498
|
+
singleLine: h = !1,
|
|
2492
2499
|
color: b = "blue",
|
|
2493
2500
|
disabled: p = !1,
|
|
2494
|
-
clearable:
|
|
2495
|
-
} =
|
|
2501
|
+
clearable: m = !0
|
|
2502
|
+
} = t, [v, u] = A(!1), [I, R] = A(r), [y, D] = A(""), [T, M] = A(null), P = C.useRef(null), z = C.useRef(null), N = C.useRef([]), k = C.useRef(null), B = C.useRef(null), O = ae(
|
|
2496
2503
|
() => i.map((S) => r.find((W) => H(W) && W.value === S)).filter((S) => S !== void 0),
|
|
2497
2504
|
[i, r]
|
|
2498
2505
|
), _ = (S) => {
|
|
2499
2506
|
if (S === "") return r;
|
|
2500
2507
|
const W = S.toLowerCase();
|
|
2501
2508
|
return r.filter((ye) => H(ye) && typeof ye.label == "string" ? ye.label.toLowerCase().includes(W) : !0);
|
|
2502
|
-
}, X =
|
|
2503
|
-
() =>
|
|
2504
|
-
[
|
|
2505
|
-
), re =
|
|
2509
|
+
}, X = ae(
|
|
2510
|
+
() => y !== "" ? I : r,
|
|
2511
|
+
[y, I, r]
|
|
2512
|
+
), re = ae(
|
|
2506
2513
|
() => X.map((S, W) => !H(S) || S.disabled ? W : -1).filter((S) => S !== -1),
|
|
2507
2514
|
[X]
|
|
2508
2515
|
);
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
}, [
|
|
2516
|
+
ve(v, () => u(!1)), $(() => {
|
|
2517
|
+
R((a ?? _)(y));
|
|
2518
|
+
}, [y, r, a]), $(() => {
|
|
2512
2519
|
if (v) {
|
|
2513
|
-
setTimeout(() =>
|
|
2520
|
+
setTimeout(() => z.current?.focus(), 100);
|
|
2514
2521
|
const S = r.findIndex((W) => H(W) && !W.disabled);
|
|
2515
|
-
|
|
2522
|
+
M(S >= 0 ? S : null);
|
|
2516
2523
|
} else
|
|
2517
|
-
|
|
2524
|
+
M(null), D("");
|
|
2518
2525
|
}, [v]), $(() => {
|
|
2519
2526
|
if (!v) return;
|
|
2520
2527
|
const S = X.findIndex((W) => H(W) && !W.disabled);
|
|
2521
|
-
|
|
2522
|
-
}, [
|
|
2523
|
-
const
|
|
2524
|
-
enabled:
|
|
2525
|
-
triggerRef:
|
|
2528
|
+
M(S >= 0 ? S : null);
|
|
2529
|
+
}, [y, v, X]);
|
|
2530
|
+
const le = Mr({
|
|
2531
|
+
enabled: h,
|
|
2532
|
+
triggerRef: P,
|
|
2526
2533
|
measureRef: k,
|
|
2527
2534
|
trayRef: B,
|
|
2528
2535
|
itemCount: O.length,
|
|
2529
|
-
deps: [O,
|
|
2530
|
-
}), { anchorRef:
|
|
2536
|
+
deps: [O, x]
|
|
2537
|
+
}), { anchorRef: L, Popover: U, getReferenceProps: oe, getItemProps: Z } = _e({
|
|
2531
2538
|
placement: "bottom",
|
|
2532
2539
|
fullWidth: !0,
|
|
2540
|
+
minWidth: 200,
|
|
2533
2541
|
onOutsideClick: () => u(!1),
|
|
2534
2542
|
open: v,
|
|
2535
2543
|
onOpenChange: u,
|
|
2536
2544
|
listRef: N,
|
|
2537
2545
|
activeIndex: T,
|
|
2538
|
-
onNavigate:
|
|
2546
|
+
onNavigate: M,
|
|
2539
2547
|
disabledIndices: re
|
|
2540
2548
|
}), De = (S) => {
|
|
2541
2549
|
i.includes(S) ? l(i.filter((W) => W !== S)) : l([...i, S]);
|
|
2542
2550
|
}, Oe = (S) => {
|
|
2543
2551
|
const W = X[S];
|
|
2544
2552
|
W && H(W) && !W.disabled && De(W.value);
|
|
2545
|
-
},
|
|
2546
|
-
return /* @__PURE__ */ e(Q.Provider, { value:
|
|
2553
|
+
}, E = X.some((S) => H(S)), F = i.length > 0, se = h ? le : O.length, he = O.slice(0, se), ut = O.length - se;
|
|
2554
|
+
return /* @__PURE__ */ e(Q.Provider, { value: w, children: /* @__PURE__ */ d(
|
|
2547
2555
|
"div",
|
|
2548
2556
|
{
|
|
2549
|
-
className:
|
|
2557
|
+
className: f(
|
|
2550
2558
|
"flex flex-col",
|
|
2551
|
-
|
|
2559
|
+
n
|
|
2552
2560
|
),
|
|
2553
2561
|
children: [
|
|
2554
2562
|
/* @__PURE__ */ e(J, { children: o }),
|
|
2555
|
-
/* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref:
|
|
2563
|
+
/* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: L, children: [
|
|
2556
2564
|
/* @__PURE__ */ d(
|
|
2557
2565
|
"div",
|
|
2558
2566
|
{
|
|
2559
|
-
...
|
|
2560
|
-
ref:
|
|
2567
|
+
...oe({
|
|
2568
|
+
ref: P,
|
|
2561
2569
|
role: "button",
|
|
2562
2570
|
tabIndex: p ? -1 : 0,
|
|
2563
2571
|
"aria-disabled": p,
|
|
@@ -2568,39 +2576,39 @@ const zl = (n) => {
|
|
|
2568
2576
|
p || (S.key === " " ? (S.preventDefault(), u((W) => !W)) : S.key === "Enter" && !v ? (S.preventDefault(), u(!0)) : S.key === "Backspace" && !v && F && (S.preventDefault(), l(i.slice(0, -1))));
|
|
2569
2577
|
}
|
|
2570
2578
|
}),
|
|
2571
|
-
className:
|
|
2579
|
+
className: f(
|
|
2572
2580
|
"flex flex-row items-center gap-1 border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",
|
|
2573
|
-
|
|
2574
|
-
!
|
|
2575
|
-
Y[
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
p ? "select-trigger-disabled" :
|
|
2581
|
+
h && f("flex-nowrap overflow-hidden", te[w]),
|
|
2582
|
+
!h && f("flex-wrap py-1.5", Lt[w]),
|
|
2583
|
+
Y[w],
|
|
2584
|
+
ue[w],
|
|
2585
|
+
m && F ? Fe[w] : me[w],
|
|
2586
|
+
p ? "select-trigger-disabled" : x && "select-trigger-error",
|
|
2579
2587
|
!p && v && "ring-4"
|
|
2580
2588
|
),
|
|
2581
2589
|
children: [
|
|
2582
|
-
F &&
|
|
2590
|
+
F && he.map((S) => /* @__PURE__ */ e(
|
|
2583
2591
|
Pe,
|
|
2584
2592
|
{
|
|
2585
2593
|
color: b,
|
|
2586
|
-
className:
|
|
2587
|
-
|
|
2588
|
-
(!
|
|
2594
|
+
className: f(
|
|
2595
|
+
h && se > 1 && "shrink-0",
|
|
2596
|
+
(!h || se === 1) && "max-w-full min-w-0"
|
|
2589
2597
|
),
|
|
2590
2598
|
children: S.label
|
|
2591
2599
|
},
|
|
2592
2600
|
String(S.value)
|
|
2593
2601
|
)),
|
|
2594
|
-
F &&
|
|
2602
|
+
F && ut > 0 && /* @__PURE__ */ d("span", { className: "shrink-0 text-sm font-medium select-placeholder px-1", children: [
|
|
2595
2603
|
"+",
|
|
2596
|
-
|
|
2604
|
+
ut,
|
|
2597
2605
|
" more"
|
|
2598
2606
|
] }),
|
|
2599
2607
|
!F && c && /* @__PURE__ */ e("span", { className: "select-placeholder", children: c })
|
|
2600
2608
|
]
|
|
2601
2609
|
}
|
|
2602
2610
|
),
|
|
2603
|
-
|
|
2611
|
+
h && /* @__PURE__ */ d(
|
|
2604
2612
|
"div",
|
|
2605
2613
|
{
|
|
2606
2614
|
ref: k,
|
|
@@ -2617,30 +2625,30 @@ const zl = (n) => {
|
|
|
2617
2625
|
}
|
|
2618
2626
|
),
|
|
2619
2627
|
/* @__PURE__ */ d(fe, { ref: B, children: [
|
|
2620
|
-
!p &&
|
|
2621
|
-
|
|
2622
|
-
/* @__PURE__ */ e(q, { Icon:
|
|
2628
|
+
!p && x && /* @__PURE__ */ e(ne, {}),
|
|
2629
|
+
m && F && !p && /* @__PURE__ */ e(q, { Icon: ce, onClick: () => l([]) }),
|
|
2630
|
+
/* @__PURE__ */ e(q, { Icon: ge })
|
|
2623
2631
|
] }),
|
|
2624
|
-
/* @__PURE__ */ e(U, { open: v, children: /* @__PURE__ */ d(
|
|
2632
|
+
/* @__PURE__ */ e(U, { open: v, children: /* @__PURE__ */ d(be, { className: "gap-0 !p-0", style: { maxHeight: g }, children: [
|
|
2625
2633
|
/* @__PURE__ */ d("div", { className: "sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm", children: [
|
|
2626
2634
|
/* @__PURE__ */ e(
|
|
2627
2635
|
"input",
|
|
2628
2636
|
{
|
|
2629
|
-
ref:
|
|
2637
|
+
ref: z,
|
|
2630
2638
|
type: "text",
|
|
2631
2639
|
placeholder: "Search",
|
|
2632
|
-
value:
|
|
2640
|
+
value: y,
|
|
2633
2641
|
className: "appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",
|
|
2634
2642
|
onChange: (S) => D(S.target.value),
|
|
2635
2643
|
onKeyDown: (S) => {
|
|
2636
|
-
S.key === "Enter" && T != null ? (S.preventDefault(), Oe(T)) : S.key === "Backspace" &&
|
|
2644
|
+
S.key === "Enter" && T != null ? (S.preventDefault(), Oe(T)) : S.key === "Backspace" && y === "" && F && (S.preventDefault(), l(i.slice(0, -1)));
|
|
2637
2645
|
}
|
|
2638
2646
|
}
|
|
2639
2647
|
),
|
|
2640
2648
|
/* @__PURE__ */ e(Ee, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
|
|
2641
2649
|
] }),
|
|
2642
2650
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1 p-2", children: [
|
|
2643
|
-
|
|
2651
|
+
y !== "" && !E && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(tt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
|
|
2644
2652
|
X.map((S, W) => {
|
|
2645
2653
|
if (!H(S))
|
|
2646
2654
|
return S.kind === "header" ? /* @__PURE__ */ e(
|
|
@@ -2683,21 +2691,21 @@ const zl = (n) => {
|
|
|
2683
2691
|
] }) })
|
|
2684
2692
|
] }),
|
|
2685
2693
|
/* @__PURE__ */ e(V, { children: s }),
|
|
2686
|
-
/* @__PURE__ */ e(K, { children:
|
|
2694
|
+
/* @__PURE__ */ e(K, { children: x })
|
|
2687
2695
|
]
|
|
2688
2696
|
}
|
|
2689
2697
|
) });
|
|
2690
|
-
}, Tl =
|
|
2698
|
+
}, Tl = C.forwardRef((t, n) => {
|
|
2691
2699
|
const {
|
|
2692
2700
|
className: o,
|
|
2693
2701
|
children: s,
|
|
2694
2702
|
...r
|
|
2695
|
-
} =
|
|
2703
|
+
} = t;
|
|
2696
2704
|
return /* @__PURE__ */ e(
|
|
2697
2705
|
"div",
|
|
2698
2706
|
{
|
|
2699
|
-
ref:
|
|
2700
|
-
className:
|
|
2707
|
+
ref: n,
|
|
2708
|
+
className: f(
|
|
2701
2709
|
"flex flex-col gap-6 border panel-base rounded-2xl shadow-sm px-6 py-6",
|
|
2702
2710
|
o
|
|
2703
2711
|
),
|
|
@@ -2705,17 +2713,17 @@ const zl = (n) => {
|
|
|
2705
2713
|
children: s
|
|
2706
2714
|
}
|
|
2707
2715
|
);
|
|
2708
|
-
}), Ll =
|
|
2716
|
+
}), Ll = C.forwardRef((t, n) => {
|
|
2709
2717
|
const {
|
|
2710
2718
|
className: o,
|
|
2711
2719
|
children: s,
|
|
2712
2720
|
...r
|
|
2713
|
-
} =
|
|
2721
|
+
} = t;
|
|
2714
2722
|
return /* @__PURE__ */ e(
|
|
2715
2723
|
"div",
|
|
2716
2724
|
{
|
|
2717
|
-
ref:
|
|
2718
|
-
className:
|
|
2725
|
+
ref: n,
|
|
2726
|
+
className: f(
|
|
2719
2727
|
"flex flex-col gap-1 border panel-base rounded-2xl shadow-sm p-2",
|
|
2720
2728
|
o
|
|
2721
2729
|
),
|
|
@@ -2723,66 +2731,66 @@ const zl = (n) => {
|
|
|
2723
2731
|
children: s
|
|
2724
2732
|
}
|
|
2725
2733
|
);
|
|
2726
|
-
}),
|
|
2734
|
+
}), kt = "input-description text-sm font-medium", Pl = (t) => {
|
|
2727
2735
|
const {
|
|
2728
|
-
className:
|
|
2736
|
+
className: n,
|
|
2729
2737
|
label: o,
|
|
2730
2738
|
children: s,
|
|
2731
2739
|
orientation: r = "vertical",
|
|
2732
2740
|
...l
|
|
2733
|
-
} =
|
|
2741
|
+
} = t;
|
|
2734
2742
|
return r === "horizontal" ? /* @__PURE__ */ d(
|
|
2735
2743
|
"div",
|
|
2736
2744
|
{
|
|
2737
|
-
className:
|
|
2745
|
+
className: f(
|
|
2738
2746
|
"flex flex-row items-center gap-3 px-3 py-2",
|
|
2739
|
-
|
|
2747
|
+
n
|
|
2740
2748
|
),
|
|
2741
2749
|
...l,
|
|
2742
2750
|
children: [
|
|
2743
|
-
/* @__PURE__ */ e("div", { className:
|
|
2751
|
+
/* @__PURE__ */ e("div", { className: f(kt, "w-1/2 line-clamp-1 break-all"), children: o }),
|
|
2744
2752
|
/* @__PURE__ */ e("div", { className: "w-1/2 line-clamp-1 break-all", children: s })
|
|
2745
2753
|
]
|
|
2746
2754
|
}
|
|
2747
2755
|
) : /* @__PURE__ */ d(
|
|
2748
2756
|
"div",
|
|
2749
2757
|
{
|
|
2750
|
-
className:
|
|
2758
|
+
className: f(
|
|
2751
2759
|
"flex flex-col gap-1 px-3 py-2",
|
|
2752
|
-
|
|
2760
|
+
n
|
|
2753
2761
|
),
|
|
2754
2762
|
...l,
|
|
2755
2763
|
children: [
|
|
2756
|
-
o && /* @__PURE__ */ e("div", { className:
|
|
2764
|
+
o && /* @__PURE__ */ e("div", { className: kt, children: o }),
|
|
2757
2765
|
/* @__PURE__ */ e("div", { children: s })
|
|
2758
2766
|
]
|
|
2759
2767
|
}
|
|
2760
2768
|
);
|
|
2761
2769
|
}, Fr = {
|
|
2762
2770
|
error: Ze,
|
|
2763
|
-
warning:
|
|
2771
|
+
warning: ln,
|
|
2764
2772
|
success: et,
|
|
2765
|
-
info:
|
|
2773
|
+
info: rn
|
|
2766
2774
|
}, Br = {
|
|
2767
2775
|
error: "text-[var(--color-status-error)]",
|
|
2768
2776
|
warning: "text-[var(--color-status-warning)]",
|
|
2769
2777
|
success: "text-[var(--color-status-success)]",
|
|
2770
2778
|
info: "text-[var(--color-status-info)]"
|
|
2771
|
-
},
|
|
2779
|
+
}, yt = "inline-flex flex-row gap-3 items-center justify-between h-10 px-3 font-semibold ring-0 dropdown-item rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent", El = (t) => {
|
|
2772
2780
|
const {
|
|
2773
|
-
className:
|
|
2781
|
+
className: n,
|
|
2774
2782
|
children: o,
|
|
2775
2783
|
Icon: s,
|
|
2776
2784
|
status: r,
|
|
2777
2785
|
...l
|
|
2778
|
-
} =
|
|
2786
|
+
} = t, a = r ? Fr[r] : null, i = /* @__PURE__ */ d(ee, { children: [
|
|
2779
2787
|
/* @__PURE__ */ d("span", { className: "inline-flex flex-row items-center gap-3 min-w-0", children: [
|
|
2780
2788
|
s && /* @__PURE__ */ e(s, { className: "h-5 w-5 shrink-0" }),
|
|
2781
2789
|
/* @__PURE__ */ e("span", { className: "truncate", children: o })
|
|
2782
2790
|
] }),
|
|
2783
2791
|
/* @__PURE__ */ d("span", { className: "inline-flex flex-row items-center gap-2 shrink-0", children: [
|
|
2784
|
-
a && r && /* @__PURE__ */ e(a, { className:
|
|
2785
|
-
/* @__PURE__ */ e(
|
|
2792
|
+
a && r && /* @__PURE__ */ e(a, { className: f("h-5 w-5", Br[r]) }),
|
|
2793
|
+
/* @__PURE__ */ e(on, { className: "h-5 w-5 text-[var(--color-input-icon-button-icon)]" })
|
|
2786
2794
|
] })
|
|
2787
2795
|
] });
|
|
2788
2796
|
if (l.href !== void 0) {
|
|
@@ -2791,7 +2799,7 @@ const zl = (n) => {
|
|
|
2791
2799
|
"a",
|
|
2792
2800
|
{
|
|
2793
2801
|
href: c,
|
|
2794
|
-
className:
|
|
2802
|
+
className: f(yt, n),
|
|
2795
2803
|
...g,
|
|
2796
2804
|
children: i
|
|
2797
2805
|
}
|
|
@@ -2800,36 +2808,36 @@ const zl = (n) => {
|
|
|
2800
2808
|
return /* @__PURE__ */ e(
|
|
2801
2809
|
"button",
|
|
2802
2810
|
{
|
|
2803
|
-
className:
|
|
2811
|
+
className: f(yt, n),
|
|
2804
2812
|
...l,
|
|
2805
2813
|
children: i
|
|
2806
2814
|
}
|
|
2807
2815
|
);
|
|
2808
|
-
}, Ml = (
|
|
2816
|
+
}, Ml = (t) => {
|
|
2809
2817
|
const {
|
|
2810
|
-
className:
|
|
2818
|
+
className: n,
|
|
2811
2819
|
vertical: o = !1,
|
|
2812
2820
|
...s
|
|
2813
|
-
} =
|
|
2821
|
+
} = t;
|
|
2814
2822
|
return /* @__PURE__ */ e(
|
|
2815
2823
|
"div",
|
|
2816
2824
|
{
|
|
2817
|
-
className:
|
|
2825
|
+
className: f(
|
|
2818
2826
|
o ? "w-px h-full bg-[var(--color-divider)]" : "w-full h-px bg-[var(--color-divider)]",
|
|
2819
|
-
|
|
2827
|
+
n
|
|
2820
2828
|
),
|
|
2821
2829
|
...s
|
|
2822
2830
|
}
|
|
2823
2831
|
);
|
|
2824
|
-
}, Fl = (
|
|
2832
|
+
}, Fl = (t) => {
|
|
2825
2833
|
const {
|
|
2826
|
-
children:
|
|
2834
|
+
children: n,
|
|
2827
2835
|
content: o,
|
|
2828
2836
|
className: s,
|
|
2829
2837
|
placement: r = "top",
|
|
2830
2838
|
minWidth: l = 100,
|
|
2831
2839
|
maxWidth: a = 200
|
|
2832
|
-
} =
|
|
2840
|
+
} = t, [i, c] = A(!1), { anchorRef: g, Popover: x } = ct({
|
|
2833
2841
|
placement: r,
|
|
2834
2842
|
minWidth: l,
|
|
2835
2843
|
maxWidth: a
|
|
@@ -2842,14 +2850,14 @@ const zl = (n) => {
|
|
|
2842
2850
|
onMouseEnter: () => c(!0),
|
|
2843
2851
|
onMouseLeave: () => c(!1),
|
|
2844
2852
|
children: [
|
|
2845
|
-
|
|
2846
|
-
/* @__PURE__ */ e(
|
|
2853
|
+
n,
|
|
2854
|
+
/* @__PURE__ */ e(x, { open: i, children: /* @__PURE__ */ e(be, { children: o }) })
|
|
2847
2855
|
]
|
|
2848
2856
|
}
|
|
2849
2857
|
);
|
|
2850
|
-
}, Bl = (
|
|
2858
|
+
}, Bl = (t) => {
|
|
2851
2859
|
const {
|
|
2852
|
-
open:
|
|
2860
|
+
open: n,
|
|
2853
2861
|
onDismiss: o,
|
|
2854
2862
|
enableDismissOnOutsideClick: s,
|
|
2855
2863
|
enableDismissOnEscKey: r,
|
|
@@ -2857,9 +2865,9 @@ const zl = (n) => {
|
|
|
2857
2865
|
className: a,
|
|
2858
2866
|
children: i,
|
|
2859
2867
|
maxWidth: c = 600
|
|
2860
|
-
} =
|
|
2861
|
-
return
|
|
2862
|
-
})), /* @__PURE__ */ e(Se, { children:
|
|
2868
|
+
} = t;
|
|
2869
|
+
return ve(!!r && n, o || (() => {
|
|
2870
|
+
})), /* @__PURE__ */ e(Se, { children: n && /* @__PURE__ */ d(Me, { children: [
|
|
2863
2871
|
/* @__PURE__ */ e(
|
|
2864
2872
|
G.div,
|
|
2865
2873
|
{
|
|
@@ -2882,7 +2890,7 @@ const zl = (n) => {
|
|
|
2882
2890
|
/* @__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(
|
|
2883
2891
|
G.div,
|
|
2884
2892
|
{
|
|
2885
|
-
className:
|
|
2893
|
+
className: f(
|
|
2886
2894
|
"flex flex-col modal-content rounded-2xl shadow-xl p-6 lg:p-12 pointer-events-auto w-full relative",
|
|
2887
2895
|
a
|
|
2888
2896
|
),
|
|
@@ -2893,9 +2901,9 @@ const zl = (n) => {
|
|
|
2893
2901
|
transition: { duration: 0.15, ease: "easeInOut" },
|
|
2894
2902
|
children: [
|
|
2895
2903
|
l && /* @__PURE__ */ e(
|
|
2896
|
-
|
|
2904
|
+
Ft,
|
|
2897
2905
|
{
|
|
2898
|
-
Icon:
|
|
2906
|
+
Icon: ce,
|
|
2899
2907
|
className: "absolute top-4 right-4",
|
|
2900
2908
|
variant: "transparent",
|
|
2901
2909
|
size: "sm",
|
|
@@ -2907,9 +2915,9 @@ const zl = (n) => {
|
|
|
2907
2915
|
}
|
|
2908
2916
|
) })
|
|
2909
2917
|
] }) });
|
|
2910
|
-
}, Al = (
|
|
2918
|
+
}, Al = (t) => {
|
|
2911
2919
|
const {
|
|
2912
|
-
open:
|
|
2920
|
+
open: n,
|
|
2913
2921
|
onDismiss: o,
|
|
2914
2922
|
enableDismissOnOutsideClick: s,
|
|
2915
2923
|
enableDismissOnEscKey: r,
|
|
@@ -2917,9 +2925,9 @@ const zl = (n) => {
|
|
|
2917
2925
|
className: a,
|
|
2918
2926
|
children: i,
|
|
2919
2927
|
maxWidth: c = 480
|
|
2920
|
-
} =
|
|
2921
|
-
return
|
|
2922
|
-
})), /* @__PURE__ */ e(Se, { children:
|
|
2928
|
+
} = t;
|
|
2929
|
+
return ve(!!r && n, o || (() => {
|
|
2930
|
+
})), /* @__PURE__ */ e(Se, { children: n && /* @__PURE__ */ d(Me, { children: [
|
|
2923
2931
|
/* @__PURE__ */ e(
|
|
2924
2932
|
G.div,
|
|
2925
2933
|
{
|
|
@@ -2942,7 +2950,7 @@ const zl = (n) => {
|
|
|
2942
2950
|
/* @__PURE__ */ e("div", { className: "fixed inset-0 flex flex-row justify-end pointer-events-none z-50", children: /* @__PURE__ */ d(
|
|
2943
2951
|
G.div,
|
|
2944
2952
|
{
|
|
2945
|
-
className:
|
|
2953
|
+
className: f(
|
|
2946
2954
|
"flex flex-col modal-content shadow-xl p-6 lg:p-12 pointer-events-auto h-full w-full overflow-y-auto relative",
|
|
2947
2955
|
a
|
|
2948
2956
|
),
|
|
@@ -2953,9 +2961,9 @@ const zl = (n) => {
|
|
|
2953
2961
|
transition: { duration: 0.25, ease: [0.32, 0.72, 0, 1] },
|
|
2954
2962
|
children: [
|
|
2955
2963
|
l && /* @__PURE__ */ e(
|
|
2956
|
-
|
|
2964
|
+
Ft,
|
|
2957
2965
|
{
|
|
2958
|
-
Icon:
|
|
2966
|
+
Icon: ce,
|
|
2959
2967
|
className: "absolute top-4 right-4",
|
|
2960
2968
|
variant: "transparent",
|
|
2961
2969
|
size: "sm",
|
|
@@ -2967,16 +2975,16 @@ const zl = (n) => {
|
|
|
2967
2975
|
}
|
|
2968
2976
|
) })
|
|
2969
2977
|
] }) });
|
|
2970
|
-
}, Ar = (
|
|
2978
|
+
}, Ar = (t) => {
|
|
2971
2979
|
const {
|
|
2972
|
-
className:
|
|
2980
|
+
className: n,
|
|
2973
2981
|
tabs: o
|
|
2974
|
-
} =
|
|
2975
|
-
return /* @__PURE__ */ e("div", { className:
|
|
2982
|
+
} = t;
|
|
2983
|
+
return /* @__PURE__ */ e("div", { className: f(
|
|
2976
2984
|
"h-12 tab-container p-1 rounded-xl inline-flex flex-row space-x-1 overflow-x-auto mat-ui-hide-scrollbars",
|
|
2977
|
-
|
|
2985
|
+
n
|
|
2978
2986
|
), children: o.map((s, r) => {
|
|
2979
|
-
const l =
|
|
2987
|
+
const l = f(
|
|
2980
2988
|
"shrink-0 px-4 h-full inline-flex flex-row items-center font-semibold rounded-xl cursor-pointer border border-transparent ing-0 tab-button transition-all duration-150 select-none focus:outline-none focus:ring-0",
|
|
2981
2989
|
s.active && "tab-button-active shadow-sm"
|
|
2982
2990
|
);
|
|
@@ -3004,43 +3012,43 @@ const zl = (n) => {
|
|
|
3004
3012
|
r
|
|
3005
3013
|
);
|
|
3006
3014
|
}) });
|
|
3007
|
-
}, Ul = (
|
|
3015
|
+
}, Ul = (t) => {
|
|
3008
3016
|
const {
|
|
3009
|
-
duration:
|
|
3017
|
+
duration: n = 0.3,
|
|
3010
3018
|
ease: o = "easeInOut",
|
|
3011
3019
|
horizontal: s = !1,
|
|
3012
3020
|
children: r,
|
|
3013
3021
|
className: l,
|
|
3014
3022
|
...a
|
|
3015
|
-
} =
|
|
3016
|
-
return
|
|
3017
|
-
const
|
|
3018
|
-
if (!
|
|
3019
|
-
let
|
|
3023
|
+
} = t, i = C.useRef(null), c = C.useRef(null), g = C.useRef(null);
|
|
3024
|
+
return C.useEffect(() => {
|
|
3025
|
+
const x = i.current, w = c.current;
|
|
3026
|
+
if (!x || !w) return;
|
|
3027
|
+
let h = !0;
|
|
3020
3028
|
const b = () => {
|
|
3021
|
-
const
|
|
3022
|
-
if (!(
|
|
3023
|
-
if (
|
|
3024
|
-
|
|
3029
|
+
const m = s ? x.scrollWidth - x.clientWidth : x.scrollHeight - x.clientHeight, v = s ? x.scrollLeft : x.scrollTop;
|
|
3030
|
+
if (!(m <= 0 || Math.abs(m - v) < 1)) {
|
|
3031
|
+
if (h) {
|
|
3032
|
+
h = !1, s ? x.scrollLeft = m : x.scrollTop = m;
|
|
3025
3033
|
return;
|
|
3026
3034
|
}
|
|
3027
|
-
g.current?.stop(), g.current =
|
|
3028
|
-
duration:
|
|
3035
|
+
g.current?.stop(), g.current = Xt(v, m, {
|
|
3036
|
+
duration: n,
|
|
3029
3037
|
ease: o,
|
|
3030
3038
|
onUpdate: (u) => {
|
|
3031
|
-
s ?
|
|
3039
|
+
s ? x.scrollLeft = u : x.scrollTop = u;
|
|
3032
3040
|
}
|
|
3033
3041
|
});
|
|
3034
3042
|
}
|
|
3035
3043
|
}, p = new ResizeObserver(b);
|
|
3036
|
-
return p.observe(
|
|
3044
|
+
return p.observe(w), () => {
|
|
3037
3045
|
p.disconnect(), g.current?.stop();
|
|
3038
3046
|
};
|
|
3039
|
-
}, [
|
|
3047
|
+
}, [n, o, s]), /* @__PURE__ */ e(
|
|
3040
3048
|
"div",
|
|
3041
3049
|
{
|
|
3042
3050
|
ref: i,
|
|
3043
|
-
className:
|
|
3051
|
+
className: f(
|
|
3044
3052
|
"min-h-0 min-w-0",
|
|
3045
3053
|
s ? "overflow-x-auto" : "overflow-y-auto",
|
|
3046
3054
|
l
|
|
@@ -3050,83 +3058,83 @@ const zl = (n) => {
|
|
|
3050
3058
|
}
|
|
3051
3059
|
);
|
|
3052
3060
|
};
|
|
3053
|
-
function Ur(
|
|
3061
|
+
function Ur(t) {
|
|
3054
3062
|
const {
|
|
3055
|
-
onDelta:
|
|
3063
|
+
onDelta: n,
|
|
3056
3064
|
onDragStart: o,
|
|
3057
3065
|
onDragEnd: s,
|
|
3058
3066
|
disabled: r = !1,
|
|
3059
3067
|
primaryButtonOnly: l = !0,
|
|
3060
3068
|
preventScrollOnMove: a = !0
|
|
3061
|
-
} =
|
|
3062
|
-
|
|
3063
|
-
|
|
3069
|
+
} = t, [i, c] = C.useState(!1), g = C.useRef(!1), x = C.useRef(0), w = C.useRef(0), h = C.useRef(0), b = C.useRef(null), p = C.useRef(null), m = C.useRef({ onDelta: n, onDragStart: o, onDragEnd: s, preventScrollOnMove: a });
|
|
3070
|
+
C.useEffect(() => {
|
|
3071
|
+
m.current = { onDelta: n, onDragStart: o, onDragEnd: s, preventScrollOnMove: a };
|
|
3064
3072
|
});
|
|
3065
|
-
const v =
|
|
3073
|
+
const v = C.useRef({}), u = C.useCallback((R) => {
|
|
3066
3074
|
if (!g.current) return;
|
|
3067
|
-
const
|
|
3068
|
-
clientX:
|
|
3069
|
-
startX:
|
|
3070
|
-
totalDeltaX:
|
|
3075
|
+
const y = {
|
|
3076
|
+
clientX: R ?? w.current,
|
|
3077
|
+
startX: x.current,
|
|
3078
|
+
totalDeltaX: h.current,
|
|
3071
3079
|
target: b.current
|
|
3072
3080
|
};
|
|
3073
3081
|
g.current = !1, c(!1);
|
|
3074
|
-
const { move: D, up: T, keydown:
|
|
3075
|
-
D && window.removeEventListener("pointermove", D, !0), T && (window.removeEventListener("pointerup", T, !0), window.removeEventListener("pointercancel", T, !0)),
|
|
3076
|
-
}, []),
|
|
3077
|
-
if (r || l &&
|
|
3078
|
-
|
|
3079
|
-
const
|
|
3080
|
-
clientX:
|
|
3081
|
-
startX:
|
|
3082
|
+
const { move: D, up: T, keydown: M } = v.current;
|
|
3083
|
+
D && window.removeEventListener("pointermove", D, !0), T && (window.removeEventListener("pointerup", T, !0), window.removeEventListener("pointercancel", T, !0)), M && window.removeEventListener("keydown", M, !0), v.current = {}, p.current != null && (cancelAnimationFrame(p.current), p.current = null), m.current.onDragEnd?.(y), b.current = null, h.current = 0;
|
|
3084
|
+
}, []), I = C.useCallback((R) => {
|
|
3085
|
+
if (r || l && R.button !== 0) return;
|
|
3086
|
+
R.target.setPointerCapture?.(R.pointerId), x.current = R.clientX, w.current = R.clientX, h.current = 0, b.current = R.target, g.current = !0, c(!0);
|
|
3087
|
+
const y = {
|
|
3088
|
+
clientX: R.clientX,
|
|
3089
|
+
startX: R.clientX,
|
|
3082
3090
|
totalDeltaX: 0,
|
|
3083
|
-
target:
|
|
3091
|
+
target: R.target
|
|
3084
3092
|
};
|
|
3085
|
-
|
|
3086
|
-
const D = (
|
|
3093
|
+
m.current.onDragStart?.(y);
|
|
3094
|
+
const D = (P) => {
|
|
3087
3095
|
g.current && p.current == null && (p.current = requestAnimationFrame(() => {
|
|
3088
3096
|
p.current = null;
|
|
3089
|
-
const
|
|
3097
|
+
const z = P.clientX, N = z - w.current;
|
|
3090
3098
|
if (N === 0) return;
|
|
3091
|
-
|
|
3099
|
+
w.current = z, h.current += N;
|
|
3092
3100
|
const k = {
|
|
3093
|
-
clientX:
|
|
3094
|
-
startX:
|
|
3095
|
-
totalDeltaX:
|
|
3101
|
+
clientX: z,
|
|
3102
|
+
startX: x.current,
|
|
3103
|
+
totalDeltaX: h.current,
|
|
3096
3104
|
target: b.current
|
|
3097
3105
|
};
|
|
3098
|
-
|
|
3106
|
+
m.current.preventScrollOnMove && P.preventDefault(), m.current.onDelta(N, k);
|
|
3099
3107
|
}));
|
|
3100
|
-
}, T = (
|
|
3101
|
-
u(
|
|
3102
|
-
},
|
|
3103
|
-
|
|
3108
|
+
}, T = (P) => {
|
|
3109
|
+
u(P.clientX);
|
|
3110
|
+
}, M = (P) => {
|
|
3111
|
+
P.key === "Escape" && (P.preventDefault(), u());
|
|
3104
3112
|
};
|
|
3105
|
-
v.current = { move: D, up: T, keydown:
|
|
3113
|
+
v.current = { move: D, up: T, keydown: M }, window.addEventListener("pointermove", D, {
|
|
3106
3114
|
passive: !a,
|
|
3107
3115
|
capture: !0
|
|
3108
|
-
}), window.addEventListener("pointerup", T, { capture: !0 }), window.addEventListener("pointercancel", T, { capture: !0 }), window.addEventListener("keydown",
|
|
3116
|
+
}), window.addEventListener("pointerup", T, { capture: !0 }), window.addEventListener("pointercancel", T, { capture: !0 }), window.addEventListener("keydown", M, !0);
|
|
3109
3117
|
}, [u, r, a, l]);
|
|
3110
|
-
return
|
|
3118
|
+
return C.useEffect(() => () => {
|
|
3111
3119
|
g.current && u();
|
|
3112
3120
|
}, [u]), {
|
|
3113
3121
|
isDragging: i,
|
|
3114
3122
|
bind: {
|
|
3115
|
-
onPointerDown:
|
|
3123
|
+
onPointerDown: I,
|
|
3116
3124
|
role: "separator",
|
|
3117
3125
|
style: { touchAction: "none", cursor: "col-resize", userSelect: "none" }
|
|
3118
3126
|
}
|
|
3119
3127
|
};
|
|
3120
3128
|
}
|
|
3121
|
-
const Wr = (
|
|
3129
|
+
const Wr = (t) => {
|
|
3122
3130
|
const {
|
|
3123
|
-
column:
|
|
3131
|
+
column: n,
|
|
3124
3132
|
width: o,
|
|
3125
3133
|
height: s,
|
|
3126
3134
|
onResize: r,
|
|
3127
3135
|
sortDirection: l,
|
|
3128
3136
|
onSortClick: a
|
|
3129
|
-
} =
|
|
3137
|
+
} = t, i = !!n.sortable, { bind: c } = Ur({
|
|
3130
3138
|
onDelta: (g) => r(g)
|
|
3131
3139
|
});
|
|
3132
3140
|
return /* @__PURE__ */ d(
|
|
@@ -3138,15 +3146,15 @@ const Wr = (n) => {
|
|
|
3138
3146
|
/* @__PURE__ */ d(
|
|
3139
3147
|
"div",
|
|
3140
3148
|
{
|
|
3141
|
-
className:
|
|
3149
|
+
className: f(
|
|
3142
3150
|
"flex-1 min-w-0 px-4 table-header-cell transition-colors duration-100 flex flex-row items-center gap-2",
|
|
3143
3151
|
i && "cursor-pointer"
|
|
3144
3152
|
),
|
|
3145
3153
|
onClick: i ? a : void 0,
|
|
3146
3154
|
children: [
|
|
3147
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
3148
|
-
i && l === "asc" && /* @__PURE__ */ e(
|
|
3149
|
-
i && l === "desc" && /* @__PURE__ */ e(
|
|
3155
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: n.header }),
|
|
3156
|
+
i && l === "asc" && /* @__PURE__ */ e(sn, { className: "h-4 w-4 shrink-0" }),
|
|
3157
|
+
i && l === "desc" && /* @__PURE__ */ e(ge, { className: "h-4 w-4 shrink-0" })
|
|
3150
3158
|
]
|
|
3151
3159
|
}
|
|
3152
3160
|
),
|
|
@@ -3166,14 +3174,14 @@ const Wr = (n) => {
|
|
|
3166
3174
|
]
|
|
3167
3175
|
}
|
|
3168
3176
|
);
|
|
3169
|
-
}, Ne = 200, Hr = 60, _r = (
|
|
3170
|
-
const
|
|
3171
|
-
for (const o of
|
|
3172
|
-
|
|
3173
|
-
return
|
|
3174
|
-
}, $r = (
|
|
3177
|
+
}, Ne = 200, Hr = 60, _r = (t) => {
|
|
3178
|
+
const n = {};
|
|
3179
|
+
for (const o of t)
|
|
3180
|
+
n[o.id] = o.defaultWidth ?? Ne;
|
|
3181
|
+
return n;
|
|
3182
|
+
}, $r = (t) => {
|
|
3175
3183
|
const {
|
|
3176
|
-
columns:
|
|
3184
|
+
columns: n,
|
|
3177
3185
|
rows: o,
|
|
3178
3186
|
getRowId: s,
|
|
3179
3187
|
onRowClick: r,
|
|
@@ -3182,20 +3190,20 @@ const Wr = (n) => {
|
|
|
3182
3190
|
className: i,
|
|
3183
3191
|
rowHeight: c = 44,
|
|
3184
3192
|
headerHeight: g = 44
|
|
3185
|
-
} =
|
|
3193
|
+
} = t, [x, w] = A(() => _r(n));
|
|
3186
3194
|
$(() => {
|
|
3187
|
-
|
|
3188
|
-
const
|
|
3189
|
-
let
|
|
3190
|
-
for (const
|
|
3191
|
-
|
|
3192
|
-
return
|
|
3195
|
+
w((u) => {
|
|
3196
|
+
const I = {};
|
|
3197
|
+
let R = Object.keys(u).length !== n.length;
|
|
3198
|
+
for (const y of n)
|
|
3199
|
+
y.id in u ? I[y.id] = u[y.id] : (I[y.id] = y.defaultWidth ?? Ne, R = !0);
|
|
3200
|
+
return R ? I : u;
|
|
3193
3201
|
});
|
|
3194
|
-
}, [
|
|
3195
|
-
const
|
|
3196
|
-
|
|
3197
|
-
const D =
|
|
3198
|
-
return T === D ?
|
|
3202
|
+
}, [n]);
|
|
3203
|
+
const h = Te((u, I, R) => {
|
|
3204
|
+
w((y) => {
|
|
3205
|
+
const D = y[u] ?? Ne, T = Math.max(R, D + I);
|
|
3206
|
+
return T === D ? y : { ...y, [u]: T };
|
|
3199
3207
|
});
|
|
3200
3208
|
}, []), b = Te((u) => {
|
|
3201
3209
|
if (a) {
|
|
@@ -3209,17 +3217,17 @@ const Wr = (n) => {
|
|
|
3209
3217
|
}
|
|
3210
3218
|
a(null);
|
|
3211
3219
|
}
|
|
3212
|
-
}, [l, a]), p =
|
|
3213
|
-
(u,
|
|
3220
|
+
}, [l, a]), p = n.reduce(
|
|
3221
|
+
(u, I) => u + (x[I.id] ?? I.defaultWidth ?? Ne),
|
|
3214
3222
|
0
|
|
3215
|
-
),
|
|
3216
|
-
|
|
3223
|
+
), m = ke(null), v = (u) => {
|
|
3224
|
+
m.current && (m.current.scrollLeft = u.currentTarget.scrollLeft);
|
|
3217
3225
|
};
|
|
3218
|
-
return /* @__PURE__ */ d("div", { className:
|
|
3226
|
+
return /* @__PURE__ */ d("div", { className: f("flex flex-col h-full w-full", i), children: [
|
|
3219
3227
|
/* @__PURE__ */ e(
|
|
3220
3228
|
"div",
|
|
3221
3229
|
{
|
|
3222
|
-
ref:
|
|
3230
|
+
ref: m,
|
|
3223
3231
|
className: "overflow-hidden shrink-0 table-header-strip",
|
|
3224
3232
|
style: { height: g },
|
|
3225
3233
|
children: /* @__PURE__ */ e(
|
|
@@ -3227,13 +3235,13 @@ const Wr = (n) => {
|
|
|
3227
3235
|
{
|
|
3228
3236
|
className: "flex flex-row table-header font-medium",
|
|
3229
3237
|
style: { width: p, minWidth: "100%" },
|
|
3230
|
-
children:
|
|
3238
|
+
children: n.map((u) => /* @__PURE__ */ e(
|
|
3231
3239
|
Wr,
|
|
3232
3240
|
{
|
|
3233
3241
|
column: u,
|
|
3234
|
-
width:
|
|
3242
|
+
width: x[u.id] ?? u.defaultWidth ?? Ne,
|
|
3235
3243
|
height: g,
|
|
3236
|
-
onResize: (
|
|
3244
|
+
onResize: (I) => h(u.id, I, u.minWidth ?? Hr),
|
|
3237
3245
|
sortDirection: l?.columnId === u.id ? l.direction : null,
|
|
3238
3246
|
onSortClick: () => b(u.id)
|
|
3239
3247
|
},
|
|
@@ -3253,38 +3261,38 @@ const Wr = (n) => {
|
|
|
3253
3261
|
{
|
|
3254
3262
|
className: "flex flex-col",
|
|
3255
3263
|
style: { width: p, minWidth: "100%" },
|
|
3256
|
-
children: o.map((u,
|
|
3264
|
+
children: o.map((u, I) => /* @__PURE__ */ e(
|
|
3257
3265
|
"div",
|
|
3258
3266
|
{
|
|
3259
|
-
className:
|
|
3267
|
+
className: f(
|
|
3260
3268
|
"flex flex-row table-body-row transition-colors duration-100",
|
|
3261
3269
|
r && "cursor-pointer"
|
|
3262
3270
|
),
|
|
3263
|
-
onClick: r ? () => r(u,
|
|
3264
|
-
children:
|
|
3271
|
+
onClick: r ? () => r(u, I) : void 0,
|
|
3272
|
+
children: n.map((R) => /* @__PURE__ */ e(
|
|
3265
3273
|
"div",
|
|
3266
3274
|
{
|
|
3267
3275
|
className: "shrink-0 content-center px-4 relative",
|
|
3268
3276
|
style: {
|
|
3269
|
-
width:
|
|
3277
|
+
width: x[R.id] ?? R.defaultWidth ?? Ne,
|
|
3270
3278
|
height: c
|
|
3271
3279
|
},
|
|
3272
|
-
children: /* @__PURE__ */ e("div", { className: "break-all line-clamp-1", children:
|
|
3280
|
+
children: /* @__PURE__ */ e("div", { className: "break-all line-clamp-1", children: R.renderCell(u, I) })
|
|
3273
3281
|
},
|
|
3274
|
-
|
|
3282
|
+
R.id
|
|
3275
3283
|
))
|
|
3276
3284
|
},
|
|
3277
|
-
s(u,
|
|
3285
|
+
s(u, I)
|
|
3278
3286
|
))
|
|
3279
3287
|
}
|
|
3280
3288
|
)
|
|
3281
3289
|
}
|
|
3282
3290
|
)
|
|
3283
3291
|
] });
|
|
3284
|
-
},
|
|
3285
|
-
const { label:
|
|
3286
|
-
return /* @__PURE__ */ d("div", { className:
|
|
3287
|
-
|
|
3292
|
+
}, Ct = (t) => {
|
|
3293
|
+
const { label: n, children: o, className: s } = t;
|
|
3294
|
+
return /* @__PURE__ */ d("div", { className: f("flex flex-col dropdown-button-group", s), children: [
|
|
3295
|
+
n && /* @__PURE__ */ e("div", { className: "mb-2 text-sm dropdown-group-label font-semibold px-3", children: n }),
|
|
3288
3296
|
o
|
|
3289
3297
|
] });
|
|
3290
3298
|
}, Xr = () => /* @__PURE__ */ e("div", {}), jr = [
|
|
@@ -3301,15 +3309,15 @@ const Wr = (n) => {
|
|
|
3301
3309
|
{ id: 11, email: "ava.sanders@example.com", firstname: "Ava", lastname: "Sanders", status: "active" },
|
|
3302
3310
|
{ id: 12, email: "logan.bennett@company.io", firstname: "Logan", lastname: "Bennett", status: "inactive" }
|
|
3303
3311
|
], Vr = [
|
|
3304
|
-
{ id: "id", header: "ID", renderCell: (
|
|
3312
|
+
{ id: "id", header: "ID", renderCell: (t) => t.id },
|
|
3305
3313
|
{
|
|
3306
3314
|
id: "email",
|
|
3307
3315
|
header: "Email",
|
|
3308
|
-
renderCell: (
|
|
3309
|
-
}, children:
|
|
3316
|
+
renderCell: (t) => /* @__PURE__ */ e(Pe, { Icon: cn, onClick: () => {
|
|
3317
|
+
}, children: t.email })
|
|
3310
3318
|
},
|
|
3311
|
-
{ id: "firstname", header: "First Name", renderCell: (
|
|
3312
|
-
{ id: "lastname", header: "Last Name", renderCell: (
|
|
3319
|
+
{ id: "firstname", header: "First Name", renderCell: (t) => t.firstname },
|
|
3320
|
+
{ id: "lastname", header: "Last Name", renderCell: (t) => t.lastname },
|
|
3313
3321
|
{
|
|
3314
3322
|
id: "status",
|
|
3315
3323
|
header: "Status",
|
|
@@ -3317,23 +3325,23 @@ const Wr = (n) => {
|
|
|
3317
3325
|
}
|
|
3318
3326
|
], Wl = () => /* @__PURE__ */ d("div", { className: "flex flex-col gap-6", children: [
|
|
3319
3327
|
/* @__PURE__ */ d("div", { className: "flex flex-row items-center justify-start gap-3", children: [
|
|
3320
|
-
/* @__PURE__ */ e(
|
|
3321
|
-
/* @__PURE__ */ e(Je, { Icon:
|
|
3322
|
-
/* @__PURE__ */ e(Vn, { Icon:
|
|
3328
|
+
/* @__PURE__ */ e(Bt, { Icon: Ee, placeholder: "Search..." }),
|
|
3329
|
+
/* @__PURE__ */ e(Je, { Icon: mt }),
|
|
3330
|
+
/* @__PURE__ */ e(Vn, { Icon: ft, children: "New" }),
|
|
3323
3331
|
/* @__PURE__ */ d(
|
|
3324
3332
|
Ae,
|
|
3325
3333
|
{
|
|
3326
|
-
trigger: /* @__PURE__ */ e(Je, { Icon:
|
|
3334
|
+
trigger: /* @__PURE__ */ e(Je, { Icon: mt }),
|
|
3327
3335
|
children: [
|
|
3328
|
-
/* @__PURE__ */ e(j, { dismissOnClick: !1, Icon:
|
|
3329
|
-
/* @__PURE__ */ e(j, { Icon:
|
|
3330
|
-
/* @__PURE__ */ d(
|
|
3336
|
+
/* @__PURE__ */ e(j, { dismissOnClick: !1, Icon: ft, children: "Add new" }),
|
|
3337
|
+
/* @__PURE__ */ e(j, { Icon: an, children: "Remove" }),
|
|
3338
|
+
/* @__PURE__ */ d(Ct, { label: "Test", className: "mt-2", children: [
|
|
3331
3339
|
/* @__PURE__ */ e(j, { children: "Item 1" }),
|
|
3332
3340
|
/* @__PURE__ */ e(j, { children: "Item 2" }),
|
|
3333
3341
|
/* @__PURE__ */ e(j, { children: "Item 3" }),
|
|
3334
3342
|
/* @__PURE__ */ e(j, { children: "Item 4" })
|
|
3335
3343
|
] }),
|
|
3336
|
-
/* @__PURE__ */ d(
|
|
3344
|
+
/* @__PURE__ */ d(Ct, { label: "Test", className: "mt-2", children: [
|
|
3337
3345
|
/* @__PURE__ */ e(j, { children: "Item 1" }),
|
|
3338
3346
|
/* @__PURE__ */ e(j, { children: "Item 2" }),
|
|
3339
3347
|
/* @__PURE__ */ e(j, { children: "Item 3" }),
|
|
@@ -3377,7 +3385,7 @@ const Wr = (n) => {
|
|
|
3377
3385
|
className: "h-[300px] w-[300px]",
|
|
3378
3386
|
columns: Vr,
|
|
3379
3387
|
rows: jr,
|
|
3380
|
-
getRowId: (
|
|
3388
|
+
getRowId: (t) => t.id
|
|
3381
3389
|
}
|
|
3382
3390
|
),
|
|
3383
3391
|
/* @__PURE__ */ e(Xr, {})
|
|
@@ -3400,14 +3408,14 @@ export {
|
|
|
3400
3408
|
Pe as Badge,
|
|
3401
3409
|
Er as BadgeColor,
|
|
3402
3410
|
Vn as Button,
|
|
3403
|
-
|
|
3411
|
+
Ft as ButtonIconRound,
|
|
3404
3412
|
Je as ButtonIconSquare,
|
|
3405
3413
|
Ml as Divider,
|
|
3406
3414
|
j as DropdownButton,
|
|
3407
|
-
|
|
3415
|
+
Ct as DropdownButtonGroup,
|
|
3408
3416
|
Ae as DropdownMenu,
|
|
3409
|
-
|
|
3410
|
-
|
|
3417
|
+
be as DropdownPanel,
|
|
3418
|
+
Bt as Input,
|
|
3411
3419
|
kl as InputCheck,
|
|
3412
3420
|
bl as InputColor,
|
|
3413
3421
|
V as InputDescription,
|
|
@@ -3440,15 +3448,15 @@ export {
|
|
|
3440
3448
|
Rr as LexicalLinkButton,
|
|
3441
3449
|
Ir as LexicalListButtons,
|
|
3442
3450
|
zr as LexicalToolbar,
|
|
3443
|
-
|
|
3451
|
+
ie as LexicalToolbarButton,
|
|
3444
3452
|
Ge as LexicalToolbarDivider,
|
|
3445
|
-
|
|
3453
|
+
$t as LexicalToolbarItems,
|
|
3446
3454
|
Bl as Modal,
|
|
3447
3455
|
Tl as Panel,
|
|
3448
3456
|
Pl as PanelField,
|
|
3449
3457
|
El as PanelLink,
|
|
3450
3458
|
Ll as PanelStack,
|
|
3451
|
-
|
|
3459
|
+
At as PopoverBase,
|
|
3452
3460
|
Al as SidebarModal,
|
|
3453
3461
|
Re as Spinner,
|
|
3454
3462
|
Ar as TabButtons,
|
|
@@ -3458,10 +3466,10 @@ export {
|
|
|
3458
3466
|
Fl as Tooltip,
|
|
3459
3467
|
vr as UploadFileTile,
|
|
3460
3468
|
H as isSelectOption,
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3469
|
+
wt as lexicalTheme,
|
|
3470
|
+
xe as useLexicalToolbar,
|
|
3471
|
+
Wt as useLexicalToolbarState,
|
|
3472
|
+
ct as usePopover,
|
|
3465
3473
|
_e as useSelectPopover
|
|
3466
3474
|
};
|
|
3467
3475
|
//# sourceMappingURL=index.js.map
|