@matthiaskrijgsman/mat-ui 0.0.35 → 0.0.36
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/components/inputs/select-item.d.ts +12 -0
- package/dist/index.js +741 -741
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as d, Fragment as
|
|
2
|
+
import { jsx as e, jsxs as d, Fragment as te } from "react/jsx-runtime";
|
|
3
3
|
import * as C from "react";
|
|
4
|
-
import { createContext as Qe, useContext as
|
|
5
|
-
import { AnimatePresence as
|
|
6
|
-
import { IconExclamationCircleFilled as
|
|
7
|
-
import { FloatingPortal as
|
|
8
|
-
import { mergeRefs as
|
|
9
|
-
import { useDropzone as
|
|
10
|
-
import { LexicalComposer as
|
|
11
|
-
import { RichTextPlugin as
|
|
12
|
-
import { ContentEditable as
|
|
13
|
-
import { HistoryPlugin as
|
|
14
|
-
import { ListPlugin as
|
|
15
|
-
import { LinkPlugin as
|
|
16
|
-
import { OnChangePlugin as
|
|
17
|
-
import { AutoFocusPlugin as
|
|
18
|
-
import { LexicalErrorBoundary as
|
|
19
|
-
import { HeadingNode as
|
|
20
|
-
import { ListNode as
|
|
21
|
-
import { LinkNode as
|
|
22
|
-
import { useLexicalComposerContext as
|
|
23
|
-
import { CAN_UNDO_COMMAND as
|
|
24
|
-
import { mergeRegister as
|
|
25
|
-
import { $setBlocksType as
|
|
26
|
-
const f = (...t) => t.filter(Boolean).join(" "),
|
|
4
|
+
import { createContext as Qe, useContext as Ze, useEffect as _, useState as W, useRef as Ce, useCallback as Le, useLayoutEffect as Rt, useMemo as ie } from "react";
|
|
5
|
+
import { AnimatePresence as De, motion as J, animate as Xt } from "motion/react";
|
|
6
|
+
import { IconExclamationCircleFilled as et, IconEyeOff as Vt, IconEye as Kt, IconPaperclip as Gt, IconCircleCheckFilled as tt, IconX as de, IconCloudUpload as Jt, IconCheck as St, IconChevronDown as ve, IconBold as Yt, IconItalic as qt, IconUnderline as Qt, IconList as Ye, IconListNumbers as Zt, IconLink as en, IconArrowBackUp as tn, IconArrowForwardUp as nn, IconDots as rn, IconSearch as Me, IconSearchOff as nt, IconInfoCircleFilled as ln, IconAlertTriangleFilled as on, IconChevronRight as sn, IconChevronUp as an, IconSettings as ft, IconPlus as ht, IconTrash as cn, IconMailFilled as dn } from "@tabler/icons-react";
|
|
7
|
+
import { FloatingPortal as Fe, FloatingOverlay as rt, flip as lt, shift as ot, size as st, useFloating as at, autoUpdate as it, offset as un, useListNavigation as mn, useInteractions as fn } from "@floating-ui/react";
|
|
8
|
+
import { mergeRefs as hn } from "react-merge-refs";
|
|
9
|
+
import { useDropzone as Dt } from "react-dropzone";
|
|
10
|
+
import { LexicalComposer as pn } from "@lexical/react/LexicalComposer";
|
|
11
|
+
import { RichTextPlugin as gn } from "@lexical/react/LexicalRichTextPlugin";
|
|
12
|
+
import { ContentEditable as bn } from "@lexical/react/LexicalContentEditable";
|
|
13
|
+
import { HistoryPlugin as vn } from "@lexical/react/LexicalHistoryPlugin";
|
|
14
|
+
import { ListPlugin as xn } from "@lexical/react/LexicalListPlugin";
|
|
15
|
+
import { LinkPlugin as wn } from "@lexical/react/LexicalLinkPlugin";
|
|
16
|
+
import { OnChangePlugin as Nn } from "@lexical/react/LexicalOnChangePlugin";
|
|
17
|
+
import { AutoFocusPlugin as kn } from "@lexical/react/LexicalAutoFocusPlugin";
|
|
18
|
+
import { LexicalErrorBoundary as yn } from "@lexical/react/LexicalErrorBoundary";
|
|
19
|
+
import { HeadingNode as Cn, QuoteNode as In, $isHeadingNode as Rn, $createHeadingNode as Sn } from "@lexical/rich-text";
|
|
20
|
+
import { ListNode as Ot, ListItemNode as Dn, $isListNode as On, REMOVE_LIST_COMMAND as pt, INSERT_UNORDERED_LIST_COMMAND as zn, INSERT_ORDERED_LIST_COMMAND as Tn } from "@lexical/list";
|
|
21
|
+
import { LinkNode as Ln, $isLinkNode as gt, TOGGLE_LINK_COMMAND as bt } from "@lexical/link";
|
|
22
|
+
import { useLexicalComposerContext as ue } from "@lexical/react/LexicalComposerContext";
|
|
23
|
+
import { CAN_UNDO_COMMAND as Pn, COMMAND_PRIORITY_LOW as Pe, CAN_REDO_COMMAND as En, $getSelection as zt, $isRangeSelection as Tt, $createParagraphNode as Mn, FORMAT_TEXT_COMMAND as je, UNDO_COMMAND as Fn, REDO_COMMAND as Bn, FOCUS_COMMAND as An, BLUR_COMMAND as Un } from "lexical";
|
|
24
|
+
import { mergeRegister as Lt, $getNearestNodeOfType as Wn } from "@lexical/utils";
|
|
25
|
+
import { $setBlocksType as vt } from "@lexical/selection";
|
|
26
|
+
const f = (...t) => t.filter(Boolean).join(" "), Hn = [
|
|
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
|
-
],
|
|
32
|
+
], Se = (t) => {
|
|
33
33
|
const {
|
|
34
34
|
speed: n = 1,
|
|
35
35
|
className: o
|
|
36
36
|
} = t, s = 1 / n, r = 2 / n;
|
|
37
|
-
return /* @__PURE__ */ e(
|
|
38
|
-
|
|
37
|
+
return /* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(
|
|
38
|
+
J.div,
|
|
39
39
|
{
|
|
40
40
|
role: "status",
|
|
41
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(
|
|
45
|
-
|
|
45
|
+
J.div,
|
|
46
46
|
{
|
|
47
47
|
className: "absolute inset-0 rounded-full",
|
|
48
48
|
style: {
|
|
@@ -50,7 +50,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
50
50
|
borderStyle: "solid",
|
|
51
51
|
borderWidth: 2
|
|
52
52
|
},
|
|
53
|
-
animate: { clipPath:
|
|
53
|
+
animate: { clipPath: Hn },
|
|
54
54
|
transition: {
|
|
55
55
|
repeat: 1 / 0,
|
|
56
56
|
ease: "linear",
|
|
@@ -61,11 +61,11 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
61
61
|
)
|
|
62
62
|
}
|
|
63
63
|
) });
|
|
64
|
-
},
|
|
64
|
+
}, ne = {
|
|
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
|
+
}, Pt = {
|
|
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)]"
|
|
@@ -73,7 +73,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
73
73
|
sm: "text-[length:var(--control-size-sm-font-size)]",
|
|
74
74
|
md: "text-[length:var(--control-size-md-font-size)]",
|
|
75
75
|
lg: "text-[length:var(--control-size-lg-font-size)]"
|
|
76
|
-
},
|
|
76
|
+
}, $n = {
|
|
77
77
|
sm: "gap-[var(--control-size-sm-gap)]",
|
|
78
78
|
md: "gap-[var(--control-size-md-gap)]",
|
|
79
79
|
lg: "gap-[var(--control-size-lg-gap)]"
|
|
@@ -81,39 +81,39 @@ const f = (...t) => t.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
|
+
}, me = {
|
|
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
|
+
}, ct = {
|
|
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
|
+
}, fe = {
|
|
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)]"
|
|
96
|
-
},
|
|
96
|
+
}, Be = {
|
|
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
|
+
}, Et = {
|
|
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
|
+
}, Mt = {
|
|
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)]"
|
|
108
|
-
},
|
|
108
|
+
}, jn = {
|
|
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
|
+
}, be = {
|
|
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
|
+
}, Ft = {
|
|
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)]"
|
|
@@ -123,14 +123,14 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
123
123
|
rounded-[var(--border-radius-input)]
|
|
124
124
|
cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-4
|
|
125
125
|
disabled:cursor-default
|
|
126
|
-
`,
|
|
126
|
+
`, Vn = {
|
|
127
127
|
primary: "border button-primary shadow-sm",
|
|
128
128
|
secondary: "border button-secondary shadow-sm",
|
|
129
129
|
tertiary: "border button-tertiary",
|
|
130
130
|
white: "border button-white shadow-sm",
|
|
131
131
|
black: "border button-black shadow-sm",
|
|
132
132
|
transparent: "border button-transparent"
|
|
133
|
-
},
|
|
133
|
+
}, Kn = C.forwardRef((t, n) => {
|
|
134
134
|
const {
|
|
135
135
|
variant: o = "white",
|
|
136
136
|
size: s = "md",
|
|
@@ -146,37 +146,37 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
146
146
|
ref: n,
|
|
147
147
|
className: f(
|
|
148
148
|
Xn,
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
Vn[o],
|
|
150
|
+
ne[s],
|
|
151
151
|
_n[s],
|
|
152
152
|
Y[s],
|
|
153
|
-
|
|
153
|
+
$n[s],
|
|
154
154
|
r
|
|
155
155
|
),
|
|
156
156
|
...c,
|
|
157
157
|
children: [
|
|
158
|
-
a && /* @__PURE__ */ e(
|
|
159
|
-
!a && /* @__PURE__ */ d(
|
|
160
|
-
i && /* @__PURE__ */ e(i, { className: f(
|
|
158
|
+
a && /* @__PURE__ */ e(Se, { className: f(be[s]) }),
|
|
159
|
+
!a && /* @__PURE__ */ d(te, { children: [
|
|
160
|
+
i && /* @__PURE__ */ e(i, { className: f(be[s], "-ml-1") }),
|
|
161
161
|
l
|
|
162
162
|
] })
|
|
163
163
|
]
|
|
164
164
|
}
|
|
165
165
|
);
|
|
166
|
-
}),
|
|
166
|
+
}), Gn = `
|
|
167
167
|
inline-flex flex-row items-center justify-center
|
|
168
168
|
button-ring font-semibold ring-0 disabled:hover:ring-0 hover:ring-4 active:ring-1
|
|
169
169
|
rounded-[var(--border-radius-input)]
|
|
170
170
|
cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-4
|
|
171
171
|
disabled:cursor-default
|
|
172
|
-
`,
|
|
172
|
+
`, Jn = {
|
|
173
173
|
primary: "border button-primary shadow-sm",
|
|
174
174
|
secondary: "border button-secondary shadow-sm",
|
|
175
175
|
tertiary: "border button-tertiary",
|
|
176
176
|
white: "border button-white shadow-sm",
|
|
177
177
|
black: "border button-black shadow-sm",
|
|
178
178
|
transparent: "border button-transparent"
|
|
179
|
-
},
|
|
179
|
+
}, qe = C.forwardRef((t, n) => {
|
|
180
180
|
const {
|
|
181
181
|
variant: o = "white",
|
|
182
182
|
size: s = "md",
|
|
@@ -189,27 +189,27 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
189
189
|
{
|
|
190
190
|
ref: n,
|
|
191
191
|
className: f(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
Gn,
|
|
193
|
+
Jn[o],
|
|
194
|
+
Ft[s],
|
|
195
195
|
r
|
|
196
196
|
),
|
|
197
197
|
...a,
|
|
198
|
-
children: /* @__PURE__ */ e(l, { className:
|
|
198
|
+
children: /* @__PURE__ */ e(l, { className: be[s] })
|
|
199
199
|
}
|
|
200
200
|
);
|
|
201
201
|
}), Yn = `
|
|
202
202
|
inline-flex flex-row items-center justify-center
|
|
203
203
|
button-ring font-semibold ring-0 disabled:hover:ring-0 hover:ring-4 active:ring-1 rounded-full cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-4
|
|
204
204
|
disabled:cursor-default
|
|
205
|
-
`,
|
|
205
|
+
`, qn = {
|
|
206
206
|
primary: "border button-primary shadow-sm",
|
|
207
207
|
secondary: "border button-secondary shadow-sm",
|
|
208
208
|
tertiary: "border button-tertiary",
|
|
209
209
|
white: "border button-white shadow-sm",
|
|
210
210
|
black: "border button-black shadow-sm",
|
|
211
211
|
transparent: "border button-transparent"
|
|
212
|
-
},
|
|
212
|
+
}, Bt = C.forwardRef((t, n) => {
|
|
213
213
|
const {
|
|
214
214
|
variant: o = "white",
|
|
215
215
|
size: s = "md",
|
|
@@ -223,20 +223,20 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
223
223
|
ref: n,
|
|
224
224
|
className: f(
|
|
225
225
|
Yn,
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
qn[o],
|
|
227
|
+
Ft[s],
|
|
228
228
|
r
|
|
229
229
|
),
|
|
230
230
|
...a,
|
|
231
|
-
children: /* @__PURE__ */ e(l, { className:
|
|
231
|
+
children: /* @__PURE__ */ e(l, { className: be[s] })
|
|
232
232
|
}
|
|
233
233
|
);
|
|
234
|
-
}),
|
|
234
|
+
}), q = (t) => {
|
|
235
235
|
const {
|
|
236
236
|
children: n
|
|
237
237
|
} = t;
|
|
238
238
|
return n ? /* @__PURE__ */ e("label", { className: "input-label font-medium mb-1", children: n }) : null;
|
|
239
|
-
},
|
|
239
|
+
}, re = () => /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(et, { className: "h-5 w-5 input-error-icon" }) }), Q = Qe("md"), Qn = () => Ze(Q), he = C.forwardRef((t, n) => {
|
|
240
240
|
const {
|
|
241
241
|
children: o,
|
|
242
242
|
className: s
|
|
@@ -247,7 +247,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
247
247
|
ref: n,
|
|
248
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
|
+
jn[r],
|
|
251
251
|
s
|
|
252
252
|
),
|
|
253
253
|
children: o
|
|
@@ -263,7 +263,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
263
263
|
children: n
|
|
264
264
|
} = t;
|
|
265
265
|
return n ? /* @__PURE__ */ e("div", { className: "input-error-text text-sm font-medium mt-2", children: n }) : null;
|
|
266
|
-
},
|
|
266
|
+
}, At = (t) => {
|
|
267
267
|
const {
|
|
268
268
|
className: n,
|
|
269
269
|
label: o,
|
|
@@ -282,29 +282,29 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
282
282
|
n
|
|
283
283
|
),
|
|
284
284
|
children: [
|
|
285
|
-
/* @__PURE__ */ e(
|
|
285
|
+
/* @__PURE__ */ e(q, { children: o }),
|
|
286
286
|
/* @__PURE__ */ d("div", { className: "flex flex-col relative", children: [
|
|
287
287
|
r && /* @__PURE__ */ e(r, { className: f(
|
|
288
288
|
"input-icon absolute top-1/2 -translate-y-1/2",
|
|
289
|
-
|
|
290
|
-
|
|
289
|
+
be[i],
|
|
290
|
+
Mt[i]
|
|
291
291
|
) }),
|
|
292
292
|
/* @__PURE__ */ e(
|
|
293
293
|
"input",
|
|
294
294
|
{
|
|
295
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
|
+
ne[i],
|
|
298
298
|
Y[i],
|
|
299
|
-
r ?
|
|
300
|
-
g ?
|
|
299
|
+
r ? Et[i] : me[i],
|
|
300
|
+
g ? fe[i] : ct[i],
|
|
301
301
|
l && "input-error"
|
|
302
302
|
),
|
|
303
303
|
...c
|
|
304
304
|
}
|
|
305
305
|
),
|
|
306
|
-
/* @__PURE__ */ d(
|
|
307
|
-
l && /* @__PURE__ */ e(
|
|
306
|
+
/* @__PURE__ */ d(he, { children: [
|
|
307
|
+
l && /* @__PURE__ */ e(re, {}),
|
|
308
308
|
a
|
|
309
309
|
] })
|
|
310
310
|
] }),
|
|
@@ -313,31 +313,31 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
313
313
|
]
|
|
314
314
|
}
|
|
315
315
|
) });
|
|
316
|
-
},
|
|
316
|
+
}, Zn = (t) => {
|
|
317
317
|
const n = t.match(/^#?([0-9a-fA-F]{6})$/);
|
|
318
318
|
if (!n) return null;
|
|
319
319
|
const o = parseInt(n[1], 16);
|
|
320
320
|
return [(o >> 16 & 255) / 255, (o >> 8 & 255) / 255, (o & 255) / 255];
|
|
321
|
-
},
|
|
321
|
+
}, er = (t, n, o) => {
|
|
322
322
|
const s = (r) => Math.round(r * 255).toString(16).padStart(2, "0").toUpperCase();
|
|
323
323
|
return "#" + s(t) + s(n) + s(o);
|
|
324
|
-
},
|
|
324
|
+
}, tr = (t, n, o) => {
|
|
325
325
|
const s = Math.max(t, n, o), r = Math.min(t, n, o), l = s - r;
|
|
326
326
|
let a = 0;
|
|
327
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
|
-
},
|
|
328
|
+
}, nr = (t, n, o) => {
|
|
329
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
|
-
},
|
|
335
|
-
const [s, r, l] =
|
|
336
|
-
return
|
|
337
|
-
},
|
|
338
|
-
const n =
|
|
339
|
-
return n ?
|
|
340
|
-
},
|
|
334
|
+
}, Re = (t, n, o) => {
|
|
335
|
+
const [s, r, l] = nr(t, n, o);
|
|
336
|
+
return er(s, r, l);
|
|
337
|
+
}, xt = (t) => {
|
|
338
|
+
const n = Zn(t);
|
|
339
|
+
return n ? tr(n[0], n[1], n[2]) : null;
|
|
340
|
+
}, rr = (t) => {
|
|
341
341
|
const n = t.trim();
|
|
342
342
|
if (!n) return null;
|
|
343
343
|
const o = n.match(/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);
|
|
@@ -371,11 +371,11 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
371
371
|
onPointerCancel: r
|
|
372
372
|
}
|
|
373
373
|
};
|
|
374
|
-
},
|
|
374
|
+
}, lr = "flex flex-col dropdown-panel border mt-1 rounded-xl shadow-lg overflow-y-auto relative space-y-1", or = {
|
|
375
375
|
sm: "p-2",
|
|
376
376
|
md: "p-3",
|
|
377
377
|
lg: "p-4"
|
|
378
|
-
},
|
|
378
|
+
}, xe = (t) => {
|
|
379
379
|
const {
|
|
380
380
|
className: n,
|
|
381
381
|
children: o,
|
|
@@ -385,12 +385,12 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
385
385
|
return /* @__PURE__ */ e(
|
|
386
386
|
"div",
|
|
387
387
|
{
|
|
388
|
-
className: f(
|
|
388
|
+
className: f(lr, or[s], n),
|
|
389
389
|
...r,
|
|
390
390
|
children: o
|
|
391
391
|
}
|
|
392
392
|
);
|
|
393
|
-
},
|
|
393
|
+
}, sr = {
|
|
394
394
|
top: "bottom center",
|
|
395
395
|
"top-start": "bottom left",
|
|
396
396
|
"top-end": "bottom right",
|
|
@@ -403,14 +403,14 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
403
403
|
left: "right center",
|
|
404
404
|
"left-start": "top right",
|
|
405
405
|
"left-end": "bottom right"
|
|
406
|
-
},
|
|
407
|
-
({ open: t, children: n, className: o, onOutsideClick: s, floatingStyles: r, setFloating: l, placement: a, floatingProps: i }) => /* @__PURE__ */ e(
|
|
408
|
-
s && /* @__PURE__ */ e(
|
|
406
|
+
}, Ut = C.memo(
|
|
407
|
+
({ open: t, children: n, className: o, onOutsideClick: s, floatingStyles: r, setFloating: l, placement: a, floatingProps: i }) => /* @__PURE__ */ e(Fe, { children: /* @__PURE__ */ e(De, { children: t && /* @__PURE__ */ d(te, { children: [
|
|
408
|
+
s && /* @__PURE__ */ e(rt, { onClick: s }),
|
|
409
409
|
/* @__PURE__ */ e("div", { ref: l, style: r, className: "z-50", ...i, children: /* @__PURE__ */ e(
|
|
410
|
-
|
|
410
|
+
J.div,
|
|
411
411
|
{
|
|
412
412
|
className: o,
|
|
413
|
-
style: { transformOrigin:
|
|
413
|
+
style: { transformOrigin: sr[a] },
|
|
414
414
|
initial: { opacity: 0, scale: 0.95 },
|
|
415
415
|
animate: { opacity: 1, scale: 1 },
|
|
416
416
|
exit: { opacity: 0, scale: 0.95 },
|
|
@@ -419,19 +419,19 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
419
419
|
}
|
|
420
420
|
) })
|
|
421
421
|
] }) }) })
|
|
422
|
-
),
|
|
422
|
+
), dt = (t) => {
|
|
423
423
|
const { placement: n = "bottom", onOutsideClick: o, fullWidth: s, minWidth: r, maxWidth: l } = t, a = C.useMemo(() => [
|
|
424
|
-
rt({ padding: 8 }),
|
|
425
424
|
lt({ padding: 8 }),
|
|
426
|
-
ot({
|
|
425
|
+
ot({ padding: 8 }),
|
|
426
|
+
st({
|
|
427
427
|
apply({ rects: h, elements: b }) {
|
|
428
428
|
s && (b.floating.style.width = `${h.reference.width}px`), r && (b.floating.style.minWidth = `${r}px`), l && (b.floating.style.maxWidth = `${l}px`);
|
|
429
429
|
}
|
|
430
430
|
})
|
|
431
|
-
], [s, l, r]), { refs: i, floatingStyles: c, placement: g } =
|
|
431
|
+
], [s, l, r]), { refs: i, floatingStyles: c, placement: g } = at({
|
|
432
432
|
placement: n,
|
|
433
433
|
middleware: a,
|
|
434
|
-
whileElementsMounted:
|
|
434
|
+
whileElementsMounted: it
|
|
435
435
|
}), x = C.useRef({
|
|
436
436
|
onOutsideClick: o,
|
|
437
437
|
floatingStyles: c,
|
|
@@ -448,7 +448,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
448
448
|
const h = (b) => {
|
|
449
449
|
const { floatingStyles: p, setFloating: m, onOutsideClick: v, placement: u } = x.current, { className: I, open: R, children: y } = b;
|
|
450
450
|
return /* @__PURE__ */ e(
|
|
451
|
-
|
|
451
|
+
Ut,
|
|
452
452
|
{
|
|
453
453
|
open: R,
|
|
454
454
|
className: I,
|
|
@@ -466,8 +466,8 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
466
466
|
anchorRef: i.setReference,
|
|
467
467
|
Popover: w
|
|
468
468
|
};
|
|
469
|
-
},
|
|
470
|
-
|
|
469
|
+
}, we = (t, n) => {
|
|
470
|
+
_(() => {
|
|
471
471
|
if (!t) return;
|
|
472
472
|
const o = (s) => {
|
|
473
473
|
s.key === "Escape" && n();
|
|
@@ -476,34 +476,34 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
476
476
|
document.removeEventListener("keydown", o);
|
|
477
477
|
};
|
|
478
478
|
}, [t, n]);
|
|
479
|
-
},
|
|
480
|
-
const n = t ?
|
|
479
|
+
}, ar = "linear-gradient(to right, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%)", ir = "linear-gradient(to right, #fff, rgba(255,255,255,0))", cr = "linear-gradient(to top, #000, rgba(0,0,0,0))", Ve = "0 0 0 1px rgba(0,0,0,0.15)", dr = 14, ur = 28, mr = 6, fr = 8, Ke = { type: "spring", stiffness: 500, damping: 18, mass: 0.6 }, ke = (t) => {
|
|
480
|
+
const n = t ? ur : dr, o = n / 2;
|
|
481
481
|
return {
|
|
482
482
|
width: n,
|
|
483
483
|
height: n,
|
|
484
484
|
marginLeft: -o,
|
|
485
485
|
marginTop: -o,
|
|
486
|
-
borderRadius: t ?
|
|
486
|
+
borderRadius: t ? fr : mr
|
|
487
487
|
};
|
|
488
|
-
},
|
|
488
|
+
}, Te = (t) => Math.max(0, Math.min(1, t)), wt = (t, n) => {
|
|
489
489
|
Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(t, n), t.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
490
|
-
},
|
|
491
|
-
const [o, s] =
|
|
492
|
-
|
|
490
|
+
}, hr = ({ value: t, onChange: n }) => {
|
|
491
|
+
const [o, s] = W(() => xt(t) ?? [0, 0, 1]), r = Ce(Re(o[0], o[1], o[2]));
|
|
492
|
+
_(() => {
|
|
493
493
|
if ((t || "").toUpperCase() === r.current) return;
|
|
494
|
-
const m =
|
|
494
|
+
const m = xt(t);
|
|
495
495
|
m && s(m);
|
|
496
496
|
}, [t]);
|
|
497
497
|
const l = (m) => {
|
|
498
498
|
s(m);
|
|
499
|
-
const v =
|
|
499
|
+
const v = Re(m[0], m[1], m[2]);
|
|
500
500
|
r.current = v, n(v);
|
|
501
|
-
}, [a, i, c] = o, g =
|
|
502
|
-
l([a,
|
|
501
|
+
}, [a, i, c] = o, g = Re(a, 1, 1), x = Re(a, i, 1), w = Re(a, i, c), h = Xe((m, v, u) => {
|
|
502
|
+
l([a, Te((m - u.left) / u.width), 1 - Te((v - u.top) / u.height)]);
|
|
503
503
|
}), b = Xe((m, v, u) => {
|
|
504
|
-
l([
|
|
504
|
+
l([Te((m - u.left) / u.width) * 360, i, c]);
|
|
505
505
|
}), p = Xe((m, v, u) => {
|
|
506
|
-
l([a, i,
|
|
506
|
+
l([a, i, Te((m - u.left) / u.width)]);
|
|
507
507
|
});
|
|
508
508
|
return /* @__PURE__ */ d(
|
|
509
509
|
"div",
|
|
@@ -533,32 +533,32 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
533
533
|
"div",
|
|
534
534
|
{
|
|
535
535
|
className: "absolute inset-0 pointer-events-none",
|
|
536
|
-
style: { background:
|
|
536
|
+
style: { background: ir }
|
|
537
537
|
}
|
|
538
538
|
),
|
|
539
539
|
/* @__PURE__ */ e(
|
|
540
540
|
"div",
|
|
541
541
|
{
|
|
542
542
|
className: "absolute inset-0 pointer-events-none",
|
|
543
|
-
style: { background:
|
|
543
|
+
style: { background: cr }
|
|
544
544
|
}
|
|
545
545
|
)
|
|
546
546
|
]
|
|
547
547
|
}
|
|
548
548
|
),
|
|
549
549
|
/* @__PURE__ */ e(
|
|
550
|
-
|
|
550
|
+
J.div,
|
|
551
551
|
{
|
|
552
552
|
className: "absolute pointer-events-none border-1 border-white",
|
|
553
553
|
style: {
|
|
554
554
|
left: `${i * 100}%`,
|
|
555
555
|
top: `${(1 - c) * 100}%`,
|
|
556
|
-
boxShadow:
|
|
556
|
+
boxShadow: Ve,
|
|
557
557
|
backgroundColor: w
|
|
558
558
|
},
|
|
559
|
-
initial:
|
|
560
|
-
animate:
|
|
561
|
-
transition:
|
|
559
|
+
initial: ke(!1),
|
|
560
|
+
animate: ke(h.isDragging),
|
|
561
|
+
transition: Ke
|
|
562
562
|
}
|
|
563
563
|
)
|
|
564
564
|
]
|
|
@@ -570,24 +570,24 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
570
570
|
className: "relative w-full rounded-md",
|
|
571
571
|
style: {
|
|
572
572
|
height: 12,
|
|
573
|
-
background:
|
|
573
|
+
background: ar,
|
|
574
574
|
touchAction: "none",
|
|
575
575
|
cursor: "ew-resize"
|
|
576
576
|
},
|
|
577
577
|
...b.bind,
|
|
578
578
|
children: /* @__PURE__ */ e(
|
|
579
|
-
|
|
579
|
+
J.div,
|
|
580
580
|
{
|
|
581
581
|
className: "absolute pointer-events-none border-1 border-white",
|
|
582
582
|
style: {
|
|
583
583
|
top: "50%",
|
|
584
584
|
left: `${a / 360 * 100}%`,
|
|
585
585
|
backgroundColor: g,
|
|
586
|
-
boxShadow:
|
|
586
|
+
boxShadow: Ve
|
|
587
587
|
},
|
|
588
|
-
initial:
|
|
589
|
-
animate:
|
|
590
|
-
transition:
|
|
588
|
+
initial: ke(!1),
|
|
589
|
+
animate: ke(b.isDragging),
|
|
590
|
+
transition: Ke
|
|
591
591
|
}
|
|
592
592
|
)
|
|
593
593
|
}
|
|
@@ -604,18 +604,18 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
604
604
|
},
|
|
605
605
|
...p.bind,
|
|
606
606
|
children: /* @__PURE__ */ e(
|
|
607
|
-
|
|
607
|
+
J.div,
|
|
608
608
|
{
|
|
609
609
|
className: "absolute pointer-events-none border-1 border-white",
|
|
610
610
|
style: {
|
|
611
611
|
top: "50%",
|
|
612
612
|
left: `${c * 100}%`,
|
|
613
613
|
backgroundColor: w,
|
|
614
|
-
boxShadow:
|
|
614
|
+
boxShadow: Ve
|
|
615
615
|
},
|
|
616
|
-
initial:
|
|
617
|
-
animate:
|
|
618
|
-
transition:
|
|
616
|
+
initial: ke(!1),
|
|
617
|
+
animate: ke(p.isDragging),
|
|
618
|
+
transition: Ke
|
|
619
619
|
}
|
|
620
620
|
)
|
|
621
621
|
}
|
|
@@ -623,7 +623,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
623
623
|
]
|
|
624
624
|
}
|
|
625
625
|
);
|
|
626
|
-
},
|
|
626
|
+
}, vl = (t) => {
|
|
627
627
|
const {
|
|
628
628
|
className: n,
|
|
629
629
|
label: o,
|
|
@@ -637,22 +637,22 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
637
637
|
onBlur: x,
|
|
638
638
|
onFocus: w,
|
|
639
639
|
...h
|
|
640
|
-
} = t, [b, p] =
|
|
640
|
+
} = t, [b, p] = W(
|
|
641
641
|
i != null ? String(i) : c != null ? String(c) : ""
|
|
642
|
-
), [m, v] =
|
|
643
|
-
|
|
644
|
-
const { anchorRef: y, Popover: D } =
|
|
642
|
+
), [m, v] = W(!1), u = Ce(null), I = i != null ? String(i) : b, R = I || "white";
|
|
643
|
+
we(m, () => v(!1));
|
|
644
|
+
const { anchorRef: y, Popover: D } = dt({
|
|
645
645
|
placement: "bottom-start",
|
|
646
646
|
onOutsideClick: () => v(!1)
|
|
647
647
|
}), T = (k) => {
|
|
648
648
|
p(k.target.value), g?.(k);
|
|
649
|
-
},
|
|
649
|
+
}, B = (k) => {
|
|
650
650
|
v(!0), w?.(k);
|
|
651
651
|
}, P = (k) => {
|
|
652
|
-
const
|
|
653
|
-
O && O !==
|
|
652
|
+
const A = k.target.value, O = rr(A);
|
|
653
|
+
O && O !== A && u.current && wt(u.current, O), v(!1), x?.(k);
|
|
654
654
|
}, z = (k) => {
|
|
655
|
-
u.current &&
|
|
655
|
+
u.current && wt(u.current, k);
|
|
656
656
|
}, N = !!r || !!l;
|
|
657
657
|
return /* @__PURE__ */ e(Q.Provider, { value: a, children: /* @__PURE__ */ d(
|
|
658
658
|
"div",
|
|
@@ -662,15 +662,15 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
662
662
|
n
|
|
663
663
|
),
|
|
664
664
|
children: [
|
|
665
|
-
/* @__PURE__ */ e(
|
|
665
|
+
/* @__PURE__ */ e(q, { children: o }),
|
|
666
666
|
/* @__PURE__ */ d("div", { className: "flex flex-col relative", ref: y, children: [
|
|
667
667
|
/* @__PURE__ */ e(
|
|
668
668
|
"div",
|
|
669
669
|
{
|
|
670
670
|
className: f(
|
|
671
671
|
"absolute top-1/2 -translate-y-1/2 rounded-md border color-swatch",
|
|
672
|
-
|
|
673
|
-
|
|
672
|
+
be[a],
|
|
673
|
+
Mt[a]
|
|
674
674
|
),
|
|
675
675
|
style: { backgroundColor: R }
|
|
676
676
|
}
|
|
@@ -681,32 +681,32 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
681
681
|
ref: u,
|
|
682
682
|
className: f(
|
|
683
683
|
"border input-base transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none",
|
|
684
|
-
|
|
684
|
+
ne[a],
|
|
685
685
|
Y[a],
|
|
686
|
-
|
|
687
|
-
N ?
|
|
686
|
+
Et[a],
|
|
687
|
+
N ? fe[a] : ct[a],
|
|
688
688
|
r && "input-error"
|
|
689
689
|
),
|
|
690
690
|
value: i ?? b,
|
|
691
691
|
onChange: T,
|
|
692
|
-
onFocus:
|
|
692
|
+
onFocus: B,
|
|
693
693
|
onBlur: P,
|
|
694
694
|
onClick: () => v(!0),
|
|
695
695
|
...h
|
|
696
696
|
}
|
|
697
697
|
),
|
|
698
|
-
/* @__PURE__ */ d(
|
|
699
|
-
r && /* @__PURE__ */ e(
|
|
698
|
+
/* @__PURE__ */ d(he, { children: [
|
|
699
|
+
r && /* @__PURE__ */ e(re, {}),
|
|
700
700
|
l
|
|
701
701
|
] }),
|
|
702
|
-
/* @__PURE__ */ e(D, { open: m, children: /* @__PURE__ */ e(
|
|
702
|
+
/* @__PURE__ */ e(D, { open: m, children: /* @__PURE__ */ e(xe, { padding: "md", children: /* @__PURE__ */ e(hr, { value: I, onChange: z }) }) })
|
|
703
703
|
] }),
|
|
704
704
|
/* @__PURE__ */ e(V, { children: s }),
|
|
705
705
|
/* @__PURE__ */ e(K, { children: r })
|
|
706
706
|
]
|
|
707
707
|
}
|
|
708
708
|
) });
|
|
709
|
-
},
|
|
709
|
+
}, Z = (t) => {
|
|
710
710
|
const {
|
|
711
711
|
onClick: n,
|
|
712
712
|
Icon: o
|
|
@@ -722,23 +722,23 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
722
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") })
|
|
723
723
|
}
|
|
724
724
|
);
|
|
725
|
-
},
|
|
725
|
+
}, xl = (t) => {
|
|
726
726
|
const {
|
|
727
727
|
type: n = "password",
|
|
728
728
|
enableShowPasswordToggle: o = !0,
|
|
729
729
|
...s
|
|
730
|
-
} = t, [r, l] =
|
|
730
|
+
} = t, [r, l] = W(!1);
|
|
731
731
|
return /* @__PURE__ */ e(
|
|
732
|
-
|
|
732
|
+
At,
|
|
733
733
|
{
|
|
734
734
|
type: r ? "text" : n,
|
|
735
|
-
buttonTray: o ? /* @__PURE__ */ e(
|
|
735
|
+
buttonTray: o ? /* @__PURE__ */ e(Z, { Icon: r ? Vt : Kt, onClick: () => {
|
|
736
736
|
l(!r);
|
|
737
737
|
} }) : void 0,
|
|
738
738
|
...s
|
|
739
739
|
}
|
|
740
740
|
);
|
|
741
|
-
},
|
|
741
|
+
}, wl = (t) => {
|
|
742
742
|
const {
|
|
743
743
|
className: n,
|
|
744
744
|
label: o,
|
|
@@ -779,33 +779,33 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
779
779
|
n
|
|
780
780
|
),
|
|
781
781
|
children: [
|
|
782
|
-
/* @__PURE__ */ e(
|
|
782
|
+
/* @__PURE__ */ e(q, { children: o }),
|
|
783
783
|
/* @__PURE__ */ d("div", { className: "flex flex-col relative", children: [
|
|
784
784
|
/* @__PURE__ */ e(
|
|
785
785
|
"textarea",
|
|
786
786
|
{
|
|
787
|
-
ref: c ?
|
|
787
|
+
ref: c ? hn([c, w]) : w,
|
|
788
788
|
onChange: b,
|
|
789
789
|
className: f(
|
|
790
790
|
"py-2.5 border input-base transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none",
|
|
791
|
-
|
|
791
|
+
Pt[l],
|
|
792
792
|
Y[l],
|
|
793
|
-
|
|
794
|
-
r ?
|
|
793
|
+
me[l],
|
|
794
|
+
r ? fe[l] : ct[l],
|
|
795
795
|
r && "input-error",
|
|
796
796
|
a && (i ? "resize-none overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden" : "resize-none overflow-hidden")
|
|
797
797
|
),
|
|
798
798
|
...x
|
|
799
799
|
}
|
|
800
800
|
),
|
|
801
|
-
/* @__PURE__ */ e(
|
|
801
|
+
/* @__PURE__ */ e(he, { className: "top-3.5 translate-y-0", children: r && /* @__PURE__ */ e(re, {}) })
|
|
802
802
|
] }),
|
|
803
803
|
/* @__PURE__ */ e(V, { children: s }),
|
|
804
804
|
/* @__PURE__ */ e(K, { children: r })
|
|
805
805
|
]
|
|
806
806
|
}
|
|
807
807
|
) });
|
|
808
|
-
},
|
|
808
|
+
}, Nl = (t) => {
|
|
809
809
|
const {
|
|
810
810
|
className: n,
|
|
811
811
|
label: o,
|
|
@@ -840,7 +840,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
840
840
|
]
|
|
841
841
|
}
|
|
842
842
|
);
|
|
843
|
-
},
|
|
843
|
+
}, kl = (t) => {
|
|
844
844
|
const {
|
|
845
845
|
className: n,
|
|
846
846
|
label: o,
|
|
@@ -884,7 +884,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
884
884
|
]
|
|
885
885
|
}
|
|
886
886
|
);
|
|
887
|
-
},
|
|
887
|
+
}, yl = (t) => {
|
|
888
888
|
const {
|
|
889
889
|
className: n,
|
|
890
890
|
label: o,
|
|
@@ -919,26 +919,26 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
919
919
|
]
|
|
920
920
|
}
|
|
921
921
|
);
|
|
922
|
-
},
|
|
922
|
+
}, pr = {
|
|
923
923
|
sm: "h-7",
|
|
924
924
|
md: "h-8",
|
|
925
925
|
lg: "h-10"
|
|
926
|
-
},
|
|
926
|
+
}, gr = {
|
|
927
927
|
sm: "px-2.5",
|
|
928
928
|
md: "px-3",
|
|
929
929
|
lg: "px-4"
|
|
930
|
-
},
|
|
930
|
+
}, br = {
|
|
931
931
|
sm: "text-xs",
|
|
932
932
|
md: "text-sm",
|
|
933
933
|
lg: "text-sm"
|
|
934
|
-
},
|
|
934
|
+
}, Cl = (t) => {
|
|
935
935
|
const {
|
|
936
936
|
label: n,
|
|
937
937
|
description: o,
|
|
938
938
|
error: s,
|
|
939
939
|
placeholder: r = "No file chosen",
|
|
940
940
|
buttonText: l = "Choose",
|
|
941
|
-
Icon: a =
|
|
941
|
+
Icon: a = Gt,
|
|
942
942
|
size: i = "md",
|
|
943
943
|
value: c,
|
|
944
944
|
isUploaded: g = !1,
|
|
@@ -958,8 +958,8 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
958
958
|
getInputProps: y,
|
|
959
959
|
open: D,
|
|
960
960
|
isDragActive: T,
|
|
961
|
-
isFocused:
|
|
962
|
-
} =
|
|
961
|
+
isFocused: B
|
|
962
|
+
} = Dt({
|
|
963
963
|
multiple: !1,
|
|
964
964
|
accept: b,
|
|
965
965
|
maxSize: p,
|
|
@@ -969,7 +969,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
969
969
|
onDropRejected: h
|
|
970
970
|
}), P = c?.name;
|
|
971
971
|
return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className: f("flex flex-col", u), children: [
|
|
972
|
-
/* @__PURE__ */ e(
|
|
972
|
+
/* @__PURE__ */ e(q, { children: n }),
|
|
973
973
|
/* @__PURE__ */ d(
|
|
974
974
|
"div",
|
|
975
975
|
{
|
|
@@ -978,17 +978,17 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
978
978
|
"flex flex-row items-center",
|
|
979
979
|
"border input-base rounded-xl shadow-sm transition-all duration-150",
|
|
980
980
|
"ring-0 focus:outline-none",
|
|
981
|
-
(
|
|
981
|
+
(B || T) && "ring-4",
|
|
982
982
|
s && "input-error",
|
|
983
983
|
v && "opacity-60 cursor-not-allowed",
|
|
984
|
-
|
|
985
|
-
|
|
984
|
+
ne[i],
|
|
985
|
+
me[i],
|
|
986
986
|
"gap-3"
|
|
987
987
|
)
|
|
988
988
|
}),
|
|
989
989
|
children: [
|
|
990
990
|
/* @__PURE__ */ e("input", { ...y() }),
|
|
991
|
-
/* @__PURE__ */ e(a, { className: f("input-icon shrink-0",
|
|
991
|
+
/* @__PURE__ */ e(a, { className: f("input-icon shrink-0", be[i]) }),
|
|
992
992
|
/* @__PURE__ */ e(
|
|
993
993
|
"span",
|
|
994
994
|
{
|
|
@@ -1000,9 +1000,9 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1000
1000
|
children: P ?? r
|
|
1001
1001
|
}
|
|
1002
1002
|
),
|
|
1003
|
-
s && /* @__PURE__ */ e(
|
|
1004
|
-
x && !s && /* @__PURE__ */ e("div", { className: "h-5 w-5 flex items-center justify-center", children: /* @__PURE__ */ e(
|
|
1005
|
-
g && !x && !s && /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(
|
|
1003
|
+
s && /* @__PURE__ */ e(re, {}),
|
|
1004
|
+
x && !s && /* @__PURE__ */ e("div", { className: "h-5 w-5 flex items-center justify-center", children: /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-icon)]" }) }),
|
|
1005
|
+
g && !x && !s && /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(tt, { className: "h-5 w-5 text-[var(--color-status-success)]" }) }),
|
|
1006
1006
|
/* @__PURE__ */ e(
|
|
1007
1007
|
"button",
|
|
1008
1008
|
{
|
|
@@ -1018,9 +1018,9 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1018
1018
|
"button-ring ring-0 hover:ring-4 active:ring-1 focus:outline-none focus:ring-4",
|
|
1019
1019
|
"disabled:cursor-default",
|
|
1020
1020
|
"mr-1.5",
|
|
1021
|
-
hr[i],
|
|
1022
1021
|
pr[i],
|
|
1023
|
-
gr[i]
|
|
1022
|
+
gr[i],
|
|
1023
|
+
br[i]
|
|
1024
1024
|
),
|
|
1025
1025
|
children: l
|
|
1026
1026
|
}
|
|
@@ -1031,7 +1031,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1031
1031
|
/* @__PURE__ */ e(V, { children: o }),
|
|
1032
1032
|
/* @__PURE__ */ e(K, { children: s })
|
|
1033
1033
|
] }) });
|
|
1034
|
-
},
|
|
1034
|
+
}, vr = (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`, xr = (t) => {
|
|
1035
1035
|
const {
|
|
1036
1036
|
file: n,
|
|
1037
1037
|
isUploaded: o = !1,
|
|
@@ -1051,15 +1051,15 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1051
1051
|
a
|
|
1052
1052
|
),
|
|
1053
1053
|
children: [
|
|
1054
|
-
i && /* @__PURE__ */ e("div", { className: "shrink-0 h-5 w-5 flex items-center justify-center", children: r ? /* @__PURE__ */ e(
|
|
1054
|
+
i && /* @__PURE__ */ e("div", { className: "shrink-0 h-5 w-5 flex items-center justify-center", children: r ? /* @__PURE__ */ e(et, { className: "h-5 w-5 input-error-icon" }) : s ? /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-icon)]" }) : /* @__PURE__ */ e(tt, { className: "h-5 w-5 text-[var(--color-status-success)]" }) }),
|
|
1055
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:
|
|
1056
|
+
/* @__PURE__ */ e("div", { className: "shrink-0 text-sm text-[var(--color-input-description-text)]", children: vr(n.size) }),
|
|
1057
1057
|
l && /* @__PURE__ */ e(
|
|
1058
|
-
|
|
1058
|
+
qe,
|
|
1059
1059
|
{
|
|
1060
1060
|
variant: "transparent",
|
|
1061
1061
|
size: "sm",
|
|
1062
|
-
Icon:
|
|
1062
|
+
Icon: de,
|
|
1063
1063
|
onClick: l,
|
|
1064
1064
|
"aria-label": "Remove file",
|
|
1065
1065
|
className: "shrink-0"
|
|
@@ -1068,14 +1068,14 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1068
1068
|
]
|
|
1069
1069
|
}
|
|
1070
1070
|
);
|
|
1071
|
-
},
|
|
1071
|
+
}, Il = (t) => {
|
|
1072
1072
|
const {
|
|
1073
1073
|
label: n,
|
|
1074
1074
|
description: o,
|
|
1075
1075
|
error: s,
|
|
1076
1076
|
title: r = "Drop files here",
|
|
1077
1077
|
hint: l,
|
|
1078
|
-
Icon: a =
|
|
1078
|
+
Icon: a = Jt,
|
|
1079
1079
|
onUpload: i,
|
|
1080
1080
|
onFileRemoved: c,
|
|
1081
1081
|
onDropRejected: g,
|
|
@@ -1086,32 +1086,32 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1086
1086
|
maxFiles: p,
|
|
1087
1087
|
disabled: m = !1,
|
|
1088
1088
|
className: v
|
|
1089
|
-
} = t, [u, I] =
|
|
1090
|
-
I((O) => O.map((
|
|
1089
|
+
} = t, [u, I] = W([]), R = Ce(0), y = (k, A) => {
|
|
1090
|
+
I((O) => O.map(($) => $.id === k ? { ...$, ...A } : $));
|
|
1091
1091
|
}, D = (k) => {
|
|
1092
1092
|
if (k.length === 0) return;
|
|
1093
|
-
const
|
|
1093
|
+
const A = k.map((O) => ({
|
|
1094
1094
|
id: String(++R.current),
|
|
1095
1095
|
file: O,
|
|
1096
1096
|
status: i ? "uploading" : "idle"
|
|
1097
1097
|
}));
|
|
1098
|
-
if (I((O) => [...O, ...
|
|
1099
|
-
for (const O of
|
|
1100
|
-
Promise.resolve().then(() => i(O.file)).then(() => y(O.id, { status: "uploaded" })).catch((
|
|
1098
|
+
if (I((O) => [...O, ...A]), !!i)
|
|
1099
|
+
for (const O of A)
|
|
1100
|
+
Promise.resolve().then(() => i(O.file)).then(() => y(O.id, { status: "uploaded" })).catch(($) => {
|
|
1101
1101
|
y(O.id, {
|
|
1102
1102
|
status: "error",
|
|
1103
|
-
error:
|
|
1103
|
+
error: $ instanceof Error ? $ : new Error(String($))
|
|
1104
1104
|
});
|
|
1105
1105
|
});
|
|
1106
1106
|
}, T = (k) => {
|
|
1107
|
-
const
|
|
1108
|
-
I((O) => O.filter((
|
|
1107
|
+
const A = u.find((O) => O.id === k);
|
|
1108
|
+
I((O) => O.filter(($) => $.id !== k)), A && c?.(A.file);
|
|
1109
1109
|
}, {
|
|
1110
|
-
getRootProps:
|
|
1110
|
+
getRootProps: B,
|
|
1111
1111
|
getInputProps: P,
|
|
1112
1112
|
isDragActive: z,
|
|
1113
1113
|
isFocused: N
|
|
1114
|
-
} =
|
|
1114
|
+
} = Dt({
|
|
1115
1115
|
multiple: !0,
|
|
1116
1116
|
accept: w,
|
|
1117
1117
|
maxSize: h,
|
|
@@ -1122,11 +1122,11 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1122
1122
|
onDropRejected: g
|
|
1123
1123
|
});
|
|
1124
1124
|
return /* @__PURE__ */ d("div", { className: f("flex flex-col", v), children: [
|
|
1125
|
-
/* @__PURE__ */ e(
|
|
1125
|
+
/* @__PURE__ */ e(q, { children: n }),
|
|
1126
1126
|
/* @__PURE__ */ d(
|
|
1127
1127
|
"div",
|
|
1128
1128
|
{
|
|
1129
|
-
...
|
|
1129
|
+
...B({
|
|
1130
1130
|
className: f(
|
|
1131
1131
|
"flex flex-col items-center justify-center gap-1",
|
|
1132
1132
|
"border-2 border-dashed input-base rounded-xl bg-transparent!",
|
|
@@ -1146,25 +1146,25 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1146
1146
|
}
|
|
1147
1147
|
),
|
|
1148
1148
|
u.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-col gap-2 mt-3", children: u.map((k) => {
|
|
1149
|
-
const
|
|
1149
|
+
const A = {
|
|
1150
1150
|
file: k.file,
|
|
1151
1151
|
isUploading: k.status === "uploading",
|
|
1152
1152
|
isUploaded: k.status === "uploaded",
|
|
1153
1153
|
error: k.status === "error" ? k.error?.message : void 0,
|
|
1154
1154
|
onRemove: () => T(k.id)
|
|
1155
1155
|
};
|
|
1156
|
-
return /* @__PURE__ */ e(C.Fragment, { children: x ? x(k.file,
|
|
1156
|
+
return /* @__PURE__ */ e(C.Fragment, { children: x ? x(k.file, A) : /* @__PURE__ */ e(xr, { ...A }) }, k.id);
|
|
1157
1157
|
}) }),
|
|
1158
1158
|
/* @__PURE__ */ e(V, { children: o }),
|
|
1159
1159
|
/* @__PURE__ */ e(K, { children: s })
|
|
1160
1160
|
] });
|
|
1161
|
-
},
|
|
1162
|
-
yn,
|
|
1161
|
+
}, wr = [
|
|
1163
1162
|
Cn,
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1163
|
+
In,
|
|
1164
|
+
Ot,
|
|
1165
|
+
Dn,
|
|
1166
|
+
Ln
|
|
1167
|
+
], Nt = {
|
|
1168
1168
|
paragraph: "lexical-paragraph",
|
|
1169
1169
|
heading: {
|
|
1170
1170
|
h1: "lexical-h1",
|
|
@@ -1187,7 +1187,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1187
1187
|
italic: "lexical-italic",
|
|
1188
1188
|
underline: "lexical-underline"
|
|
1189
1189
|
}
|
|
1190
|
-
},
|
|
1190
|
+
}, Wt = {
|
|
1191
1191
|
isBold: !1,
|
|
1192
1192
|
isItalic: !1,
|
|
1193
1193
|
isUnderline: !1,
|
|
@@ -1197,25 +1197,25 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1197
1197
|
blockType: "paragraph",
|
|
1198
1198
|
canUndo: !1,
|
|
1199
1199
|
canRedo: !1
|
|
1200
|
-
},
|
|
1201
|
-
state:
|
|
1200
|
+
}, Ae = Qe({
|
|
1201
|
+
state: Wt,
|
|
1202
1202
|
tone: "light",
|
|
1203
1203
|
orientation: "horizontal"
|
|
1204
|
-
}),
|
|
1205
|
-
const [t] =
|
|
1206
|
-
return
|
|
1204
|
+
}), Ne = () => Ze(Ae), Ht = () => {
|
|
1205
|
+
const [t] = ue(), [n, o] = W(Wt);
|
|
1206
|
+
return _(() => {
|
|
1207
1207
|
const s = () => {
|
|
1208
1208
|
t.getEditorState().read(() => {
|
|
1209
|
-
const r =
|
|
1210
|
-
if (!
|
|
1209
|
+
const r = zt();
|
|
1210
|
+
if (!Tt(r))
|
|
1211
1211
|
return;
|
|
1212
|
-
const l = r.anchor.getNode(), a =
|
|
1212
|
+
const l = r.anchor.getNode(), a = Wn(l, Ot), i = a && On(a) ? a.getListType() : null;
|
|
1213
1213
|
let c = "paragraph";
|
|
1214
1214
|
if (!i) {
|
|
1215
1215
|
const b = l.getKey() === "root" ? l : l.getTopLevelElementOrThrow();
|
|
1216
|
-
|
|
1216
|
+
Rn(b) && (c = b.getTag());
|
|
1217
1217
|
}
|
|
1218
|
-
const g = r.hasFormat("bold"), x = r.hasFormat("italic"), w = r.hasFormat("underline"), h =
|
|
1218
|
+
const g = r.hasFormat("bold"), x = r.hasFormat("italic"), w = r.hasFormat("underline"), h = gt(l.getParent()) || gt(l);
|
|
1219
1219
|
o((b) => ({
|
|
1220
1220
|
...b,
|
|
1221
1221
|
isBold: g,
|
|
@@ -1228,34 +1228,34 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1228
1228
|
}));
|
|
1229
1229
|
});
|
|
1230
1230
|
};
|
|
1231
|
-
return
|
|
1231
|
+
return Lt(
|
|
1232
1232
|
t.registerUpdateListener(() => s()),
|
|
1233
1233
|
t.registerCommand(
|
|
1234
|
-
|
|
1234
|
+
Pn,
|
|
1235
1235
|
(r) => (o((l) => ({ ...l, canUndo: r })), !1),
|
|
1236
|
-
|
|
1236
|
+
Pe
|
|
1237
1237
|
),
|
|
1238
1238
|
t.registerCommand(
|
|
1239
|
-
|
|
1239
|
+
En,
|
|
1240
1240
|
(r) => (o((l) => ({ ...l, canRedo: r })), !1),
|
|
1241
|
-
|
|
1241
|
+
Pe
|
|
1242
1242
|
)
|
|
1243
1243
|
);
|
|
1244
1244
|
}, [t]), n;
|
|
1245
|
-
},
|
|
1246
|
-
dismiss:
|
|
1245
|
+
}, $t = Qe(void 0), Nr = () => ({
|
|
1246
|
+
dismiss: Ze($t) || (() => {
|
|
1247
1247
|
})
|
|
1248
|
-
}),
|
|
1249
|
-
const { trigger: n, children: o, placement: s = "bottom-end", minWidth: r = 200, className: l } = t, [a, i] =
|
|
1248
|
+
}), Ue = (t) => {
|
|
1249
|
+
const { trigger: n, children: o, placement: s = "bottom-end", minWidth: r = 200, className: l } = t, [a, i] = W(!1), { Popover: c, anchorRef: g } = dt({
|
|
1250
1250
|
placement: s,
|
|
1251
1251
|
onOutsideClick: () => i(!1),
|
|
1252
1252
|
minWidth: r
|
|
1253
1253
|
});
|
|
1254
|
-
return /* @__PURE__ */ d(
|
|
1254
|
+
return /* @__PURE__ */ d(te, { children: [
|
|
1255
1255
|
/* @__PURE__ */ e("div", { ref: g, className: l, onClick: () => i(!a), children: n }),
|
|
1256
|
-
/* @__PURE__ */ e(c, { open: a, children: /* @__PURE__ */ e(
|
|
1256
|
+
/* @__PURE__ */ e(c, { open: a, children: /* @__PURE__ */ e(xe, { padding: "sm", children: /* @__PURE__ */ e($t.Provider, { value: () => i(!1), children: o }) }) })
|
|
1257
1257
|
] });
|
|
1258
|
-
},
|
|
1258
|
+
}, kr = "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", X = C.forwardRef((t, n) => {
|
|
1259
1259
|
const {
|
|
1260
1260
|
className: o,
|
|
1261
1261
|
children: s,
|
|
@@ -1263,7 +1263,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1263
1263
|
onClick: l,
|
|
1264
1264
|
dismissOnClick: a = !0,
|
|
1265
1265
|
...i
|
|
1266
|
-
} = t, { dismiss: c } =
|
|
1266
|
+
} = t, { dismiss: c } = Nr(), g = (x) => {
|
|
1267
1267
|
l && l(x), a && c();
|
|
1268
1268
|
};
|
|
1269
1269
|
return /* @__PURE__ */ d(
|
|
@@ -1271,7 +1271,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1271
1271
|
{
|
|
1272
1272
|
ref: n,
|
|
1273
1273
|
className: f(
|
|
1274
|
-
|
|
1274
|
+
kr,
|
|
1275
1275
|
o
|
|
1276
1276
|
),
|
|
1277
1277
|
onClick: g,
|
|
@@ -1282,21 +1282,21 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1282
1282
|
]
|
|
1283
1283
|
}
|
|
1284
1284
|
);
|
|
1285
|
-
}),
|
|
1285
|
+
}), Ge = [
|
|
1286
1286
|
{ value: "paragraph", label: "Paragraph" },
|
|
1287
1287
|
{ value: "h1", label: "Heading 1" },
|
|
1288
1288
|
{ value: "h2", label: "Heading 2" },
|
|
1289
1289
|
{ value: "h3", label: "Heading 3" },
|
|
1290
1290
|
{ value: "h4", label: "Heading 4" }
|
|
1291
|
-
],
|
|
1292
|
-
const [t] =
|
|
1291
|
+
], yr = () => {
|
|
1292
|
+
const [t] = ue(), { state: n, tone: o } = Ne(), s = (l) => {
|
|
1293
1293
|
t.update(() => {
|
|
1294
|
-
const a =
|
|
1295
|
-
|
|
1294
|
+
const a = zt();
|
|
1295
|
+
Tt(a) && (l === "paragraph" ? vt(a, () => Mn()) : vt(a, () => Sn(l)));
|
|
1296
1296
|
});
|
|
1297
|
-
}, r =
|
|
1297
|
+
}, r = Ge.find((l) => l.value === n.blockType) ?? Ge[0];
|
|
1298
1298
|
return /* @__PURE__ */ e(
|
|
1299
|
-
|
|
1299
|
+
Ue,
|
|
1300
1300
|
{
|
|
1301
1301
|
placement: "bottom-start",
|
|
1302
1302
|
minWidth: 180,
|
|
@@ -1311,14 +1311,14 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1311
1311
|
),
|
|
1312
1312
|
children: [
|
|
1313
1313
|
r.label,
|
|
1314
|
-
/* @__PURE__ */ e(
|
|
1314
|
+
/* @__PURE__ */ e(ve, { className: "h-4 w-4" })
|
|
1315
1315
|
]
|
|
1316
1316
|
}
|
|
1317
1317
|
),
|
|
1318
|
-
children:
|
|
1319
|
-
|
|
1318
|
+
children: Ge.map((l) => /* @__PURE__ */ e(
|
|
1319
|
+
X,
|
|
1320
1320
|
{
|
|
1321
|
-
Icon: l.value === n.blockType ?
|
|
1321
|
+
Icon: l.value === n.blockType ? St : void 0,
|
|
1322
1322
|
onClick: () => s(l.value),
|
|
1323
1323
|
className: l.value === n.blockType ? void 0 : "pl-11",
|
|
1324
1324
|
children: l.label
|
|
@@ -1327,10 +1327,10 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1327
1327
|
))
|
|
1328
1328
|
}
|
|
1329
1329
|
);
|
|
1330
|
-
},
|
|
1330
|
+
}, Cr = {
|
|
1331
1331
|
light: "lexical-tb-btn-light",
|
|
1332
1332
|
dark: "lexical-tb-btn-dark"
|
|
1333
|
-
},
|
|
1333
|
+
}, ce = C.forwardRef(
|
|
1334
1334
|
(t, n) => {
|
|
1335
1335
|
const { Icon: o, active: s = !1, tone: r = "light", className: l, onMouseDown: a, ...i } = t;
|
|
1336
1336
|
return /* @__PURE__ */ e(
|
|
@@ -1343,7 +1343,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1343
1343
|
},
|
|
1344
1344
|
className: f(
|
|
1345
1345
|
"lexical-tb-btn h-8 w-8",
|
|
1346
|
-
|
|
1346
|
+
Cr[r],
|
|
1347
1347
|
s && "lexical-tb-btn-active",
|
|
1348
1348
|
l
|
|
1349
1349
|
),
|
|
@@ -1352,55 +1352,55 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1352
1352
|
}
|
|
1353
1353
|
);
|
|
1354
1354
|
}
|
|
1355
|
-
),
|
|
1356
|
-
const [t] =
|
|
1357
|
-
return /* @__PURE__ */ d(
|
|
1355
|
+
), Ir = () => {
|
|
1356
|
+
const [t] = ue(), { state: n, tone: o } = Ne();
|
|
1357
|
+
return /* @__PURE__ */ d(te, { children: [
|
|
1358
1358
|
/* @__PURE__ */ e(
|
|
1359
|
-
|
|
1359
|
+
ce,
|
|
1360
1360
|
{
|
|
1361
1361
|
Icon: Yt,
|
|
1362
1362
|
tone: o,
|
|
1363
1363
|
active: n.isBold,
|
|
1364
1364
|
"aria-label": "Bold",
|
|
1365
|
-
onClick: () => t.dispatchCommand(
|
|
1365
|
+
onClick: () => t.dispatchCommand(je, "bold")
|
|
1366
1366
|
}
|
|
1367
1367
|
),
|
|
1368
1368
|
/* @__PURE__ */ e(
|
|
1369
|
-
|
|
1369
|
+
ce,
|
|
1370
1370
|
{
|
|
1371
|
-
Icon:
|
|
1371
|
+
Icon: qt,
|
|
1372
1372
|
tone: o,
|
|
1373
1373
|
active: n.isItalic,
|
|
1374
1374
|
"aria-label": "Italic",
|
|
1375
|
-
onClick: () => t.dispatchCommand(
|
|
1375
|
+
onClick: () => t.dispatchCommand(je, "italic")
|
|
1376
1376
|
}
|
|
1377
1377
|
),
|
|
1378
1378
|
/* @__PURE__ */ e(
|
|
1379
|
-
|
|
1379
|
+
ce,
|
|
1380
1380
|
{
|
|
1381
1381
|
Icon: Qt,
|
|
1382
1382
|
tone: o,
|
|
1383
1383
|
active: n.isUnderline,
|
|
1384
1384
|
"aria-label": "Underline",
|
|
1385
|
-
onClick: () => t.dispatchCommand(
|
|
1385
|
+
onClick: () => t.dispatchCommand(je, "underline")
|
|
1386
1386
|
}
|
|
1387
1387
|
)
|
|
1388
1388
|
] });
|
|
1389
|
-
},
|
|
1390
|
-
const [t] =
|
|
1389
|
+
}, Rr = () => {
|
|
1390
|
+
const [t] = ue(), { state: n, tone: o } = Ne(), s = () => {
|
|
1391
1391
|
t.dispatchCommand(
|
|
1392
|
-
n.isUnorderedList ?
|
|
1392
|
+
n.isUnorderedList ? pt : zn,
|
|
1393
1393
|
void 0
|
|
1394
1394
|
);
|
|
1395
1395
|
}, r = () => {
|
|
1396
1396
|
t.dispatchCommand(
|
|
1397
|
-
n.isOrderedList ?
|
|
1397
|
+
n.isOrderedList ? pt : Tn,
|
|
1398
1398
|
void 0
|
|
1399
1399
|
);
|
|
1400
1400
|
};
|
|
1401
|
-
return /* @__PURE__ */ d(
|
|
1401
|
+
return /* @__PURE__ */ d(te, { children: [
|
|
1402
1402
|
/* @__PURE__ */ e(
|
|
1403
|
-
|
|
1403
|
+
ce,
|
|
1404
1404
|
{
|
|
1405
1405
|
Icon: Ye,
|
|
1406
1406
|
tone: o,
|
|
@@ -1410,9 +1410,9 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1410
1410
|
}
|
|
1411
1411
|
),
|
|
1412
1412
|
/* @__PURE__ */ e(
|
|
1413
|
-
|
|
1413
|
+
ce,
|
|
1414
1414
|
{
|
|
1415
|
-
Icon:
|
|
1415
|
+
Icon: Zt,
|
|
1416
1416
|
tone: o,
|
|
1417
1417
|
active: n.isOrderedList,
|
|
1418
1418
|
"aria-label": "Numbered list",
|
|
@@ -1420,90 +1420,90 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1420
1420
|
}
|
|
1421
1421
|
)
|
|
1422
1422
|
] });
|
|
1423
|
-
},
|
|
1424
|
-
const [t] =
|
|
1423
|
+
}, Sr = () => {
|
|
1424
|
+
const [t] = ue(), { state: n, tone: o } = Ne(), s = () => {
|
|
1425
1425
|
if (n.isLink) {
|
|
1426
|
-
t.dispatchCommand(
|
|
1426
|
+
t.dispatchCommand(bt, null);
|
|
1427
1427
|
return;
|
|
1428
1428
|
}
|
|
1429
1429
|
const r = window.prompt("Enter URL");
|
|
1430
|
-
r && t.dispatchCommand(
|
|
1430
|
+
r && t.dispatchCommand(bt, r);
|
|
1431
1431
|
};
|
|
1432
1432
|
return /* @__PURE__ */ e(
|
|
1433
|
-
|
|
1433
|
+
ce,
|
|
1434
1434
|
{
|
|
1435
|
-
Icon:
|
|
1435
|
+
Icon: en,
|
|
1436
1436
|
tone: o,
|
|
1437
1437
|
active: n.isLink,
|
|
1438
1438
|
"aria-label": "Link",
|
|
1439
1439
|
onClick: s
|
|
1440
1440
|
}
|
|
1441
1441
|
);
|
|
1442
|
-
},
|
|
1443
|
-
const [t] =
|
|
1444
|
-
return /* @__PURE__ */ d(
|
|
1442
|
+
}, Dr = () => {
|
|
1443
|
+
const [t] = ue(), { state: n, tone: o } = Ne();
|
|
1444
|
+
return /* @__PURE__ */ d(te, { children: [
|
|
1445
1445
|
/* @__PURE__ */ e(
|
|
1446
|
-
|
|
1446
|
+
ce,
|
|
1447
1447
|
{
|
|
1448
|
-
Icon:
|
|
1448
|
+
Icon: tn,
|
|
1449
1449
|
tone: o,
|
|
1450
1450
|
disabled: !n.canUndo,
|
|
1451
1451
|
"aria-label": "Undo",
|
|
1452
|
-
onClick: () => t.dispatchCommand(
|
|
1452
|
+
onClick: () => t.dispatchCommand(Fn, void 0)
|
|
1453
1453
|
}
|
|
1454
1454
|
),
|
|
1455
1455
|
/* @__PURE__ */ e(
|
|
1456
|
-
|
|
1456
|
+
ce,
|
|
1457
1457
|
{
|
|
1458
|
-
Icon:
|
|
1458
|
+
Icon: nn,
|
|
1459
1459
|
tone: o,
|
|
1460
1460
|
disabled: !n.canRedo,
|
|
1461
1461
|
"aria-label": "Redo",
|
|
1462
|
-
onClick: () => t.dispatchCommand(
|
|
1462
|
+
onClick: () => t.dispatchCommand(Bn, void 0)
|
|
1463
1463
|
}
|
|
1464
1464
|
)
|
|
1465
1465
|
] });
|
|
1466
|
-
},
|
|
1466
|
+
}, Or = {
|
|
1467
1467
|
light: "lexical-tb-divider-light",
|
|
1468
1468
|
dark: "lexical-tb-divider-dark"
|
|
1469
|
-
},
|
|
1470
|
-
const { tone: n, className: o } = t, { tone: s, orientation: r } =
|
|
1469
|
+
}, Je = (t) => {
|
|
1470
|
+
const { tone: n, className: o } = t, { tone: s, orientation: r } = Ne();
|
|
1471
1471
|
return /* @__PURE__ */ e(
|
|
1472
1472
|
"div",
|
|
1473
1473
|
{
|
|
1474
1474
|
className: f(
|
|
1475
1475
|
r === "vertical" ? "h-px w-full my-1" : "w-px h-5 my-auto mx-1",
|
|
1476
1476
|
"shrink-0",
|
|
1477
|
-
|
|
1477
|
+
Or[n ?? s],
|
|
1478
1478
|
o
|
|
1479
1479
|
)
|
|
1480
1480
|
}
|
|
1481
1481
|
);
|
|
1482
|
-
},
|
|
1482
|
+
}, kt = 4, zr = 36, _t = (t) => {
|
|
1483
1483
|
const n = [];
|
|
1484
1484
|
return C.Children.forEach(t, (o) => {
|
|
1485
1485
|
C.isValidElement(o) && o.type === C.Fragment ? n.push(..._t(o.props.children)) : n.push(o);
|
|
1486
1486
|
}), n;
|
|
1487
|
-
},
|
|
1488
|
-
const { children: n } = t, { state: o, tone: s } =
|
|
1487
|
+
}, jt = (t) => {
|
|
1488
|
+
const { children: n } = t, { state: o, tone: s } = Ne(), r = _t(n), l = Ce(null), a = Ce(null), [i, c] = W(r.length), g = Le(() => {
|
|
1489
1489
|
const h = l.current, b = a.current;
|
|
1490
1490
|
if (!h || !b) return;
|
|
1491
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 ?
|
|
1492
|
+
if (m.reduce((R, y, D) => R + y + (D > 0 ? kt : 0), 0) <= p) {
|
|
1493
1493
|
c(m.length);
|
|
1494
1494
|
return;
|
|
1495
1495
|
}
|
|
1496
1496
|
let u = 0, I = 0;
|
|
1497
1497
|
for (let R = 0; R < m.length; R++) {
|
|
1498
|
-
const y = m[R] + (R > 0 ?
|
|
1499
|
-
if (u + y +
|
|
1498
|
+
const y = m[R] + (R > 0 ? kt : 0);
|
|
1499
|
+
if (u + y + zr > p) break;
|
|
1500
1500
|
u += y, I++;
|
|
1501
1501
|
}
|
|
1502
1502
|
c(I);
|
|
1503
1503
|
}, []);
|
|
1504
|
-
|
|
1504
|
+
Rt(() => {
|
|
1505
1505
|
g();
|
|
1506
|
-
}),
|
|
1506
|
+
}), _(() => {
|
|
1507
1507
|
const h = l.current, b = a.current;
|
|
1508
1508
|
if (!h) return;
|
|
1509
1509
|
const p = new ResizeObserver(() => g());
|
|
@@ -1527,7 +1527,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1527
1527
|
),
|
|
1528
1528
|
x.map((h, b) => /* @__PURE__ */ e(C.Fragment, { children: h }, b)),
|
|
1529
1529
|
w.length > 0 && /* @__PURE__ */ e(
|
|
1530
|
-
|
|
1530
|
+
Ue,
|
|
1531
1531
|
{
|
|
1532
1532
|
placement: "bottom-end",
|
|
1533
1533
|
minWidth: 0,
|
|
@@ -1541,10 +1541,10 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1541
1541
|
"lexical-tb-btn h-8 w-8 shrink-0",
|
|
1542
1542
|
s === "dark" ? "lexical-tb-btn-dark" : "lexical-tb-btn-light"
|
|
1543
1543
|
),
|
|
1544
|
-
children: /* @__PURE__ */ e(
|
|
1544
|
+
children: /* @__PURE__ */ e(rn, { className: "h-[18px] w-[18px]" })
|
|
1545
1545
|
}
|
|
1546
1546
|
),
|
|
1547
|
-
children: /* @__PURE__ */ e(
|
|
1547
|
+
children: /* @__PURE__ */ e(Ae.Provider, { value: { state: o, tone: "light", orientation: "vertical" }, children: /* @__PURE__ */ e(
|
|
1548
1548
|
"div",
|
|
1549
1549
|
{
|
|
1550
1550
|
className: "flex flex-col items-stretch gap-1",
|
|
@@ -1557,66 +1557,66 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1557
1557
|
]
|
|
1558
1558
|
}
|
|
1559
1559
|
);
|
|
1560
|
-
},
|
|
1561
|
-
/* @__PURE__ */ e(
|
|
1562
|
-
/* @__PURE__ */ e(
|
|
1563
|
-
/* @__PURE__ */ e(Cr, {}),
|
|
1564
|
-
/* @__PURE__ */ e(Ge, {}),
|
|
1560
|
+
}, ut = () => /* @__PURE__ */ d(te, { children: [
|
|
1561
|
+
/* @__PURE__ */ e(yr, {}),
|
|
1562
|
+
/* @__PURE__ */ e(Je, {}),
|
|
1565
1563
|
/* @__PURE__ */ e(Ir, {}),
|
|
1564
|
+
/* @__PURE__ */ e(Je, {}),
|
|
1566
1565
|
/* @__PURE__ */ e(Rr, {}),
|
|
1567
|
-
/* @__PURE__ */ e(
|
|
1568
|
-
/* @__PURE__ */ e(
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1566
|
+
/* @__PURE__ */ e(Sr, {}),
|
|
1567
|
+
/* @__PURE__ */ e(Je, {}),
|
|
1568
|
+
/* @__PURE__ */ e(Dr, {})
|
|
1569
|
+
] }), Rl = () => ut(), Tr = (t) => {
|
|
1570
|
+
const { render: n, className: o } = t, [s] = ue(), r = Ht();
|
|
1571
|
+
return /* @__PURE__ */ e(Ae.Provider, { value: { state: r, tone: "light" }, children: /* @__PURE__ */ e(
|
|
1572
1572
|
"div",
|
|
1573
1573
|
{
|
|
1574
1574
|
className: f(
|
|
1575
1575
|
"lexical-toolbar flex flex-row items-center p-1.5",
|
|
1576
1576
|
o
|
|
1577
1577
|
),
|
|
1578
|
-
children: /* @__PURE__ */ e(
|
|
1578
|
+
children: /* @__PURE__ */ e(jt, { children: n ? n({ editor: s, state: r, tone: "light" }) : ut() })
|
|
1579
1579
|
}
|
|
1580
1580
|
) });
|
|
1581
|
-
},
|
|
1582
|
-
const { render: n } = t, [o] =
|
|
1581
|
+
}, Lr = (t) => {
|
|
1582
|
+
const { render: n } = t, [o] = ue(), s = Ht(), [r, l] = W(!1), { refs: a, floatingStyles: i } = at({
|
|
1583
1583
|
placement: "top-start",
|
|
1584
1584
|
strategy: "fixed",
|
|
1585
1585
|
middleware: [
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1586
|
+
un(8),
|
|
1587
|
+
lt(),
|
|
1588
|
+
ot({ padding: 8 }),
|
|
1589
|
+
st({
|
|
1590
1590
|
apply({ rects: c, elements: g }) {
|
|
1591
1591
|
g.floating.style.width = `${c.reference.width}px`;
|
|
1592
1592
|
}
|
|
1593
1593
|
})
|
|
1594
1594
|
],
|
|
1595
|
-
whileElementsMounted:
|
|
1595
|
+
whileElementsMounted: it
|
|
1596
1596
|
});
|
|
1597
|
-
return
|
|
1597
|
+
return _(() => o.registerRootListener((c) => a.setReference(c ?? null)), [o, a]), _(() => Lt(
|
|
1598
1598
|
o.registerCommand(
|
|
1599
|
-
|
|
1599
|
+
An,
|
|
1600
1600
|
() => (l(!0), !1),
|
|
1601
|
-
|
|
1601
|
+
Pe
|
|
1602
1602
|
),
|
|
1603
1603
|
o.registerCommand(
|
|
1604
|
-
|
|
1604
|
+
Un,
|
|
1605
1605
|
() => (l(!1), !1),
|
|
1606
|
-
|
|
1606
|
+
Pe
|
|
1607
1607
|
)
|
|
1608
|
-
), [o]), /* @__PURE__ */ e(
|
|
1609
|
-
|
|
1608
|
+
), [o]), /* @__PURE__ */ e(Ae.Provider, { value: { state: s, tone: "dark" }, children: /* @__PURE__ */ e(Fe, { children: /* @__PURE__ */ e(De, { children: r && /* @__PURE__ */ e("div", { ref: a.setFloating, style: i, className: "z-50", children: /* @__PURE__ */ e(
|
|
1609
|
+
J.div,
|
|
1610
1610
|
{
|
|
1611
1611
|
className: "lexical-floating-toolbar flex w-full flex-row items-center p-1 rounded-xl",
|
|
1612
1612
|
initial: { opacity: 0, y: 4 },
|
|
1613
1613
|
animate: { opacity: 1, y: 0 },
|
|
1614
1614
|
exit: { opacity: 0, y: 4 },
|
|
1615
1615
|
transition: { duration: 0.1, ease: "easeInOut" },
|
|
1616
|
-
children: /* @__PURE__ */ e(
|
|
1616
|
+
children: /* @__PURE__ */ e(jt, { children: n ? n({ editor: o, state: s, tone: "dark" }) : ut() })
|
|
1617
1617
|
}
|
|
1618
1618
|
) }) }) }) });
|
|
1619
|
-
},
|
|
1619
|
+
}, Sl = (t) => {
|
|
1620
1620
|
const {
|
|
1621
1621
|
label: n,
|
|
1622
1622
|
description: o,
|
|
@@ -1636,11 +1636,11 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1636
1636
|
autoFocus: v = !1,
|
|
1637
1637
|
children: u,
|
|
1638
1638
|
className: I
|
|
1639
|
-
} = t, R =
|
|
1639
|
+
} = t, R = ie(
|
|
1640
1640
|
() => ({
|
|
1641
1641
|
namespace: b,
|
|
1642
|
-
theme: m ? { ...
|
|
1643
|
-
nodes: [...
|
|
1642
|
+
theme: m ? { ...Nt, ...m } : Nt,
|
|
1643
|
+
nodes: [...wr, ...p ?? []],
|
|
1644
1644
|
editorState: l ?? null,
|
|
1645
1645
|
onError: (z) => {
|
|
1646
1646
|
throw z;
|
|
@@ -1649,15 +1649,15 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1649
1649
|
// Lexical reads initialConfig once on mount; later prop changes are ignored by design.
|
|
1650
1650
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1651
1651
|
[]
|
|
1652
|
-
), y =
|
|
1652
|
+
), y = Le(
|
|
1653
1653
|
(z) => {
|
|
1654
1654
|
a?.(JSON.stringify(z.toJSON()));
|
|
1655
1655
|
},
|
|
1656
1656
|
[a]
|
|
1657
|
-
), D = Y[i], T = !!s,
|
|
1657
|
+
), D = Y[i], T = !!s, B = (z) => `calc(${z} * 1lh + 1.5rem)`, P = h ? { minHeight: B(x), maxHeight: w ? B(w) : void 0 } : { height: B(x) };
|
|
1658
1658
|
return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className: f("flex flex-col", I), children: [
|
|
1659
|
-
/* @__PURE__ */ e(
|
|
1660
|
-
/* @__PURE__ */ e(
|
|
1659
|
+
/* @__PURE__ */ e(q, { children: n }),
|
|
1660
|
+
/* @__PURE__ */ e(pn, { initialConfig: R, children: /* @__PURE__ */ d(
|
|
1661
1661
|
"div",
|
|
1662
1662
|
{
|
|
1663
1663
|
className: f(
|
|
@@ -1665,12 +1665,12 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1665
1665
|
T && "input-error"
|
|
1666
1666
|
),
|
|
1667
1667
|
children: [
|
|
1668
|
-
c === "static" && /* @__PURE__ */ e(
|
|
1668
|
+
c === "static" && /* @__PURE__ */ e(Tr, { render: g }),
|
|
1669
1669
|
/* @__PURE__ */ e("div", { className: "relative flex-1 min-h-0", children: /* @__PURE__ */ e(
|
|
1670
|
-
|
|
1670
|
+
gn,
|
|
1671
1671
|
{
|
|
1672
1672
|
contentEditable: /* @__PURE__ */ e(
|
|
1673
|
-
|
|
1673
|
+
bn,
|
|
1674
1674
|
{
|
|
1675
1675
|
className: f(
|
|
1676
1676
|
"lexical-content w-full outline-none px-3 py-3 leading-[1.55] overflow-y-auto mat-ui-hide-scrollbars",
|
|
@@ -1690,23 +1690,23 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1690
1690
|
)
|
|
1691
1691
|
}
|
|
1692
1692
|
),
|
|
1693
|
-
ErrorBoundary:
|
|
1693
|
+
ErrorBoundary: yn
|
|
1694
1694
|
}
|
|
1695
1695
|
) }),
|
|
1696
|
-
/* @__PURE__ */ e(bn, {}),
|
|
1697
1696
|
/* @__PURE__ */ e(vn, {}),
|
|
1698
1697
|
/* @__PURE__ */ e(xn, {}),
|
|
1699
|
-
|
|
1700
|
-
|
|
1698
|
+
/* @__PURE__ */ e(wn, {}),
|
|
1699
|
+
v && /* @__PURE__ */ e(kn, {}),
|
|
1700
|
+
a && /* @__PURE__ */ e(Nn, { onChange: y }),
|
|
1701
1701
|
u,
|
|
1702
|
-
c === "floating" && /* @__PURE__ */ e(
|
|
1702
|
+
c === "floating" && /* @__PURE__ */ e(Lr, { render: g })
|
|
1703
1703
|
]
|
|
1704
1704
|
}
|
|
1705
1705
|
) }),
|
|
1706
1706
|
/* @__PURE__ */ e(V, { children: o }),
|
|
1707
1707
|
/* @__PURE__ */ e(K, { children: s })
|
|
1708
1708
|
] }) });
|
|
1709
|
-
},
|
|
1709
|
+
}, Dl = (t) => {
|
|
1710
1710
|
const {
|
|
1711
1711
|
className: n,
|
|
1712
1712
|
label: o,
|
|
@@ -1724,17 +1724,17 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1724
1724
|
n
|
|
1725
1725
|
),
|
|
1726
1726
|
children: [
|
|
1727
|
-
/* @__PURE__ */ e(
|
|
1727
|
+
/* @__PURE__ */ e(q, { children: o }),
|
|
1728
1728
|
/* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", children: [
|
|
1729
1729
|
/* @__PURE__ */ e(
|
|
1730
1730
|
"select",
|
|
1731
1731
|
{
|
|
1732
1732
|
className: f(
|
|
1733
1733
|
"appearance-none border input-base bg-none transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none",
|
|
1734
|
-
|
|
1734
|
+
ne[a],
|
|
1735
1735
|
Y[a],
|
|
1736
|
-
|
|
1737
|
-
|
|
1736
|
+
me[a],
|
|
1737
|
+
fe[a]
|
|
1738
1738
|
),
|
|
1739
1739
|
...i,
|
|
1740
1740
|
children: r && r.map((c, g) => /* @__PURE__ */ e(
|
|
@@ -1748,9 +1748,9 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1748
1748
|
))
|
|
1749
1749
|
}
|
|
1750
1750
|
),
|
|
1751
|
-
/* @__PURE__ */ d(
|
|
1752
|
-
l && /* @__PURE__ */ e(
|
|
1753
|
-
/* @__PURE__ */ e(
|
|
1751
|
+
/* @__PURE__ */ d(he, { children: [
|
|
1752
|
+
l && /* @__PURE__ */ e(re, {}),
|
|
1753
|
+
/* @__PURE__ */ e(Z, { Icon: ve })
|
|
1754
1754
|
] })
|
|
1755
1755
|
] }),
|
|
1756
1756
|
/* @__PURE__ */ e(V, { children: s }),
|
|
@@ -1758,7 +1758,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1758
1758
|
]
|
|
1759
1759
|
}
|
|
1760
1760
|
) });
|
|
1761
|
-
},
|
|
1761
|
+
}, We = C.forwardRef((t, n) => {
|
|
1762
1762
|
const {
|
|
1763
1763
|
children: o,
|
|
1764
1764
|
onClick: s,
|
|
@@ -1783,11 +1783,11 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1783
1783
|
),
|
|
1784
1784
|
children: [
|
|
1785
1785
|
/* @__PURE__ */ e("div", { className: "flex-1 min-w-0 break-all line-clamp-1", children: o }),
|
|
1786
|
-
r && !l && /* @__PURE__ */ e("div", { className: "shrink-0", children: /* @__PURE__ */ e(
|
|
1786
|
+
r && !l && /* @__PURE__ */ e("div", { className: "shrink-0", children: /* @__PURE__ */ e(St, { className: "h-5 w-5" }) })
|
|
1787
1787
|
]
|
|
1788
1788
|
}
|
|
1789
1789
|
);
|
|
1790
|
-
}),
|
|
1790
|
+
}), He = C.forwardRef((t, n) => {
|
|
1791
1791
|
const { children: o, className: s, ...r } = t;
|
|
1792
1792
|
return /* @__PURE__ */ e(
|
|
1793
1793
|
"div",
|
|
@@ -1801,7 +1801,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1801
1801
|
children: o
|
|
1802
1802
|
}
|
|
1803
1803
|
);
|
|
1804
|
-
}),
|
|
1804
|
+
}), $e = C.forwardRef((t, n) => {
|
|
1805
1805
|
const { className: o, ...s } = t;
|
|
1806
1806
|
return /* @__PURE__ */ e(
|
|
1807
1807
|
"div",
|
|
@@ -1814,7 +1814,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1814
1814
|
)
|
|
1815
1815
|
}
|
|
1816
1816
|
);
|
|
1817
|
-
}), H = (t) => !("kind" in t), _e = (t) => {
|
|
1817
|
+
}), H = (t) => !("kind" in t), G = (t, n) => t === n ? !0 : t == null || n == null || typeof t != "object" || typeof n != "object" ? !1 : JSON.stringify(t) === JSON.stringify(n), _e = (t) => {
|
|
1818
1818
|
const {
|
|
1819
1819
|
placement: n = "bottom",
|
|
1820
1820
|
onOutsideClick: o,
|
|
@@ -1829,20 +1829,20 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1829
1829
|
loop: w = !0,
|
|
1830
1830
|
disabledIndices: h
|
|
1831
1831
|
} = t, b = C.useMemo(() => [
|
|
1832
|
-
rt({ padding: 8 }),
|
|
1833
1832
|
lt({ padding: 8 }),
|
|
1834
|
-
ot({
|
|
1833
|
+
ot({ padding: 8 }),
|
|
1834
|
+
st({
|
|
1835
1835
|
apply({ rects: P, elements: z }) {
|
|
1836
1836
|
s && (z.floating.style.width = `${P.reference.width}px`), r && (z.floating.style.minWidth = `${r}px`), l && (z.floating.style.maxWidth = `${l}px`);
|
|
1837
1837
|
}
|
|
1838
1838
|
})
|
|
1839
|
-
], [s, l, r]), { refs: p, floatingStyles: m, context: v, placement: u } =
|
|
1839
|
+
], [s, l, r]), { refs: p, floatingStyles: m, context: v, placement: u } = at({
|
|
1840
1840
|
placement: n,
|
|
1841
1841
|
open: a,
|
|
1842
1842
|
onOpenChange: i,
|
|
1843
1843
|
middleware: b,
|
|
1844
|
-
whileElementsMounted:
|
|
1845
|
-
}), I =
|
|
1844
|
+
whileElementsMounted: it
|
|
1845
|
+
}), I = mn(v, {
|
|
1846
1846
|
listRef: c,
|
|
1847
1847
|
activeIndex: g,
|
|
1848
1848
|
onNavigate: x,
|
|
@@ -1850,7 +1850,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1850
1850
|
virtual: !0,
|
|
1851
1851
|
focusItemOnOpen: !1,
|
|
1852
1852
|
disabledIndices: h
|
|
1853
|
-
}), { getReferenceProps: R, getFloatingProps: y, getItemProps: D } =
|
|
1853
|
+
}), { getReferenceProps: R, getFloatingProps: y, getItemProps: D } = fn([I]), T = C.useRef({
|
|
1854
1854
|
onOutsideClick: o,
|
|
1855
1855
|
floatingStyles: m,
|
|
1856
1856
|
setFloating: p.setFloating,
|
|
@@ -1864,20 +1864,20 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1864
1864
|
placement: u,
|
|
1865
1865
|
getFloatingProps: y
|
|
1866
1866
|
};
|
|
1867
|
-
const
|
|
1867
|
+
const B = C.useMemo(() => {
|
|
1868
1868
|
const P = (z) => {
|
|
1869
|
-
const { floatingStyles: N, setFloating: k, onOutsideClick:
|
|
1869
|
+
const { floatingStyles: N, setFloating: k, onOutsideClick: A, placement: O, getFloatingProps: $ } = T.current, { className: j, open: le, children: oe } = z;
|
|
1870
1870
|
return /* @__PURE__ */ e(
|
|
1871
|
-
|
|
1871
|
+
Ut,
|
|
1872
1872
|
{
|
|
1873
|
-
open:
|
|
1874
|
-
className:
|
|
1875
|
-
onOutsideClick:
|
|
1873
|
+
open: le,
|
|
1874
|
+
className: j,
|
|
1875
|
+
onOutsideClick: A,
|
|
1876
1876
|
floatingStyles: N,
|
|
1877
1877
|
setFloating: k,
|
|
1878
1878
|
placement: O,
|
|
1879
|
-
floatingProps:
|
|
1880
|
-
children:
|
|
1879
|
+
floatingProps: $(),
|
|
1880
|
+
children: oe
|
|
1881
1881
|
}
|
|
1882
1882
|
);
|
|
1883
1883
|
};
|
|
@@ -1885,11 +1885,11 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1885
1885
|
}, []);
|
|
1886
1886
|
return {
|
|
1887
1887
|
anchorRef: p.setReference,
|
|
1888
|
-
Popover:
|
|
1888
|
+
Popover: B,
|
|
1889
1889
|
getReferenceProps: R,
|
|
1890
1890
|
getItemProps: D
|
|
1891
1891
|
};
|
|
1892
|
-
},
|
|
1892
|
+
}, Pr = (t) => {
|
|
1893
1893
|
const {
|
|
1894
1894
|
className: n,
|
|
1895
1895
|
label: o,
|
|
@@ -1903,24 +1903,24 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1903
1903
|
size: x = "md",
|
|
1904
1904
|
disabled: w = !1,
|
|
1905
1905
|
clearable: h = !0
|
|
1906
|
-
} = t, [b, p] =
|
|
1906
|
+
} = t, [b, p] = W(!1), [m, v] = W(null), u = C.useRef(null), I = C.useRef([]), R = r?.find((N) => H(N) && G(N.value, a)), y = ie(
|
|
1907
1907
|
() => r.map((N, k) => !H(N) || N.disabled ? k : -1).filter((N) => N !== -1),
|
|
1908
1908
|
[r]
|
|
1909
1909
|
);
|
|
1910
|
-
|
|
1910
|
+
we(b, () => p(!1)), _(() => {
|
|
1911
1911
|
if (b) {
|
|
1912
1912
|
u.current?.focus({ preventScroll: !0 });
|
|
1913
|
-
const N = r.findIndex((k) => H(k) && k.value
|
|
1913
|
+
const N = r.findIndex((k) => H(k) && G(k.value, a));
|
|
1914
1914
|
if (N >= 0)
|
|
1915
1915
|
v(N);
|
|
1916
1916
|
else {
|
|
1917
|
-
const k = r.findIndex((
|
|
1917
|
+
const k = r.findIndex((A) => H(A) && !A.disabled);
|
|
1918
1918
|
v(k >= 0 ? k : null);
|
|
1919
1919
|
}
|
|
1920
1920
|
} else
|
|
1921
1921
|
v(null);
|
|
1922
1922
|
}, [b]);
|
|
1923
|
-
const { anchorRef: D, Popover: T, getReferenceProps:
|
|
1923
|
+
const { anchorRef: D, Popover: T, getReferenceProps: B, getItemProps: P } = _e({
|
|
1924
1924
|
placement: "bottom",
|
|
1925
1925
|
fullWidth: !0,
|
|
1926
1926
|
minWidth: 200,
|
|
@@ -1943,12 +1943,12 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1943
1943
|
n
|
|
1944
1944
|
),
|
|
1945
1945
|
children: [
|
|
1946
|
-
/* @__PURE__ */ e(
|
|
1946
|
+
/* @__PURE__ */ e(q, { children: o }),
|
|
1947
1947
|
/* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: D, children: [
|
|
1948
1948
|
/* @__PURE__ */ d(
|
|
1949
1949
|
"div",
|
|
1950
1950
|
{
|
|
1951
|
-
...
|
|
1951
|
+
...B({
|
|
1952
1952
|
ref: u,
|
|
1953
1953
|
role: "button",
|
|
1954
1954
|
tabIndex: w ? -1 : 0,
|
|
@@ -1962,10 +1962,10 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1962
1962
|
}),
|
|
1963
1963
|
className: f(
|
|
1964
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",
|
|
1965
|
-
|
|
1965
|
+
ne[x],
|
|
1966
1966
|
Y[x],
|
|
1967
|
-
|
|
1968
|
-
h && a ?
|
|
1967
|
+
me[x],
|
|
1968
|
+
h && a ? Be[x] : fe[x],
|
|
1969
1969
|
w ? "select-trigger-disabled" : g && "select-trigger-error",
|
|
1970
1970
|
!w && b && "ring-4"
|
|
1971
1971
|
),
|
|
@@ -1975,15 +1975,15 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1975
1975
|
]
|
|
1976
1976
|
}
|
|
1977
1977
|
),
|
|
1978
|
-
/* @__PURE__ */ d(
|
|
1979
|
-
!w && g && /* @__PURE__ */ e(
|
|
1980
|
-
h && !!a && !w && /* @__PURE__ */ e(
|
|
1981
|
-
/* @__PURE__ */ e(
|
|
1978
|
+
/* @__PURE__ */ d(he, { children: [
|
|
1979
|
+
!w && g && /* @__PURE__ */ e(re, {}),
|
|
1980
|
+
h && !!a && !w && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => l(null) }),
|
|
1981
|
+
/* @__PURE__ */ e(Z, { Icon: ve })
|
|
1982
1982
|
] }),
|
|
1983
|
-
/* @__PURE__ */ e(T, { open: b, children: /* @__PURE__ */ e(
|
|
1983
|
+
/* @__PURE__ */ e(T, { open: b, children: /* @__PURE__ */ e(xe, { className: "!p-0", style: { maxHeight: c }, children: /* @__PURE__ */ e("div", { className: "flex flex-col p-2 gap-1", children: r.map((N, k) => {
|
|
1984
1984
|
if (!H(N))
|
|
1985
1985
|
return N.kind === "header" ? /* @__PURE__ */ e(
|
|
1986
|
-
|
|
1986
|
+
He,
|
|
1987
1987
|
{
|
|
1988
1988
|
ref: (O) => {
|
|
1989
1989
|
I.current[k] = O;
|
|
@@ -1992,7 +1992,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
1992
1992
|
},
|
|
1993
1993
|
`header-${k}`
|
|
1994
1994
|
) : /* @__PURE__ */ e(
|
|
1995
|
-
|
|
1995
|
+
$e,
|
|
1996
1996
|
{
|
|
1997
1997
|
ref: (O) => {
|
|
1998
1998
|
I.current[k] = O;
|
|
@@ -2000,9 +2000,9 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
2000
2000
|
},
|
|
2001
2001
|
`divider-${k}`
|
|
2002
2002
|
);
|
|
2003
|
-
const
|
|
2003
|
+
const A = G(N.value, a);
|
|
2004
2004
|
return /* @__PURE__ */ e(
|
|
2005
|
-
|
|
2005
|
+
We,
|
|
2006
2006
|
{
|
|
2007
2007
|
...P({
|
|
2008
2008
|
ref(O) {
|
|
@@ -2010,12 +2010,12 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
2010
2010
|
}
|
|
2011
2011
|
}),
|
|
2012
2012
|
onClick: () => z(k),
|
|
2013
|
-
selected:
|
|
2013
|
+
selected: A,
|
|
2014
2014
|
active: m === k,
|
|
2015
2015
|
disabled: N.disabled,
|
|
2016
2016
|
children: N.label
|
|
2017
2017
|
},
|
|
2018
|
-
|
|
2018
|
+
`option-${k}`
|
|
2019
2019
|
);
|
|
2020
2020
|
}) }) }) })
|
|
2021
2021
|
] }),
|
|
@@ -2024,7 +2024,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
2024
2024
|
]
|
|
2025
2025
|
}
|
|
2026
2026
|
) });
|
|
2027
|
-
},
|
|
2027
|
+
}, Ol = (t) => {
|
|
2028
2028
|
const {
|
|
2029
2029
|
className: n,
|
|
2030
2030
|
label: o,
|
|
@@ -2039,30 +2039,30 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
2039
2039
|
size: w = "md",
|
|
2040
2040
|
disabled: h = !1,
|
|
2041
2041
|
clearable: b = !0
|
|
2042
|
-
} = t, [p, m] =
|
|
2042
|
+
} = t, [p, m] = W(!1), [v, u] = W(r), [I, R] = W(""), [y, D] = W(null), T = C.useRef(null), B = C.useRef(null), P = C.useRef([]), z = r?.find((L) => H(L) && G(L.value, i)), N = ie(() => I !== "" ? v : r, [I, v, r]), k = ie(
|
|
2043
2043
|
() => N.map((L, U) => !H(L) || L.disabled ? U : -1).filter((L) => L !== -1),
|
|
2044
2044
|
[N]
|
|
2045
2045
|
);
|
|
2046
|
-
|
|
2046
|
+
we(p, () => m(!1)), _(() => {
|
|
2047
2047
|
u(a(I));
|
|
2048
|
-
}, [I, r, a]),
|
|
2048
|
+
}, [I, r, a]), _(() => {
|
|
2049
2049
|
if (p) {
|
|
2050
|
-
setTimeout(() =>
|
|
2051
|
-
const L = r.findIndex((U) => H(U) && U.value
|
|
2050
|
+
setTimeout(() => B.current?.focus(), 100);
|
|
2051
|
+
const L = r.findIndex((U) => H(U) && G(U.value, i));
|
|
2052
2052
|
if (L >= 0)
|
|
2053
2053
|
D(L);
|
|
2054
2054
|
else {
|
|
2055
|
-
const U = r.findIndex((
|
|
2055
|
+
const U = r.findIndex((se) => H(se) && !se.disabled);
|
|
2056
2056
|
D(U >= 0 ? U : null);
|
|
2057
2057
|
}
|
|
2058
2058
|
} else
|
|
2059
2059
|
D(null), R("");
|
|
2060
|
-
}, [p]),
|
|
2060
|
+
}, [p]), _(() => {
|
|
2061
2061
|
if (!p) return;
|
|
2062
2062
|
const L = N.findIndex((U) => H(U) && !U.disabled);
|
|
2063
2063
|
D(L >= 0 ? L : null);
|
|
2064
2064
|
}, [I, p, N]);
|
|
2065
|
-
const { anchorRef:
|
|
2065
|
+
const { anchorRef: A, Popover: O, getReferenceProps: $, getItemProps: j } = _e({
|
|
2066
2066
|
placement: "bottom",
|
|
2067
2067
|
fullWidth: !0,
|
|
2068
2068
|
minWidth: 200,
|
|
@@ -2073,10 +2073,10 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
2073
2073
|
activeIndex: y,
|
|
2074
2074
|
onNavigate: D,
|
|
2075
2075
|
disabledIndices: k
|
|
2076
|
-
}),
|
|
2076
|
+
}), le = (L) => {
|
|
2077
2077
|
const U = N[L];
|
|
2078
2078
|
U && H(U) && !U.disabled && (l(U.value), m(!1));
|
|
2079
|
-
},
|
|
2079
|
+
}, oe = N.some((L) => H(L));
|
|
2080
2080
|
return /* @__PURE__ */ e(Q.Provider, { value: w, children: /* @__PURE__ */ d(
|
|
2081
2081
|
"div",
|
|
2082
2082
|
{
|
|
@@ -2085,12 +2085,12 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
2085
2085
|
n
|
|
2086
2086
|
),
|
|
2087
2087
|
children: [
|
|
2088
|
-
/* @__PURE__ */ e(
|
|
2089
|
-
/* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref:
|
|
2088
|
+
/* @__PURE__ */ e(q, { children: o }),
|
|
2089
|
+
/* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: A, children: [
|
|
2090
2090
|
/* @__PURE__ */ d(
|
|
2091
2091
|
"div",
|
|
2092
2092
|
{
|
|
2093
|
-
|
|
2093
|
+
...$({
|
|
2094
2094
|
ref: T,
|
|
2095
2095
|
role: "button",
|
|
2096
2096
|
tabIndex: h ? -1 : 0,
|
|
@@ -2104,10 +2104,10 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
2104
2104
|
}),
|
|
2105
2105
|
className: f(
|
|
2106
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",
|
|
2107
|
-
|
|
2107
|
+
ne[w],
|
|
2108
2108
|
Y[w],
|
|
2109
|
-
|
|
2110
|
-
b && i ?
|
|
2109
|
+
me[w],
|
|
2110
|
+
b && i ? Be[w] : fe[w],
|
|
2111
2111
|
h ? "select-trigger-disabled" : x && "select-trigger-error",
|
|
2112
2112
|
!h && p && "ring-4"
|
|
2113
2113
|
),
|
|
@@ -2117,67 +2117,67 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
2117
2117
|
]
|
|
2118
2118
|
}
|
|
2119
2119
|
),
|
|
2120
|
-
/* @__PURE__ */ d(
|
|
2121
|
-
!h && x && /* @__PURE__ */ e(
|
|
2122
|
-
b && !!i && !h && /* @__PURE__ */ e(
|
|
2123
|
-
/* @__PURE__ */ e(
|
|
2120
|
+
/* @__PURE__ */ d(he, { children: [
|
|
2121
|
+
!h && x && /* @__PURE__ */ e(re, {}),
|
|
2122
|
+
b && !!i && !h && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => l(null) }),
|
|
2123
|
+
/* @__PURE__ */ e(Z, { Icon: ve })
|
|
2124
2124
|
] }),
|
|
2125
|
-
/* @__PURE__ */ e(O, { open: p, children: /* @__PURE__ */ d(
|
|
2125
|
+
/* @__PURE__ */ e(O, { open: p, children: /* @__PURE__ */ d(xe, { className: "gap-0 !p-0", style: { maxHeight: g }, children: [
|
|
2126
2126
|
/* @__PURE__ */ d("div", { className: "sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm", children: [
|
|
2127
2127
|
/* @__PURE__ */ e(
|
|
2128
2128
|
"input",
|
|
2129
2129
|
{
|
|
2130
|
-
ref:
|
|
2130
|
+
ref: B,
|
|
2131
2131
|
type: "text",
|
|
2132
2132
|
placeholder: "Search",
|
|
2133
2133
|
value: I,
|
|
2134
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)]",
|
|
2135
2135
|
onChange: (L) => R(L.target.value),
|
|
2136
2136
|
onKeyDown: (L) => {
|
|
2137
|
-
L.key === "Enter" && y != null && (L.preventDefault(),
|
|
2137
|
+
L.key === "Enter" && y != null && (L.preventDefault(), le(y));
|
|
2138
2138
|
}
|
|
2139
2139
|
}
|
|
2140
2140
|
),
|
|
2141
|
-
/* @__PURE__ */ e(
|
|
2141
|
+
/* @__PURE__ */ e(Me, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
|
|
2142
2142
|
] }),
|
|
2143
2143
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1 p-2", children: [
|
|
2144
|
-
I !== "" && !
|
|
2144
|
+
I !== "" && !oe && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
|
|
2145
2145
|
N.map((L, U) => {
|
|
2146
2146
|
if (!H(L))
|
|
2147
2147
|
return L.kind === "header" ? /* @__PURE__ */ e(
|
|
2148
|
-
|
|
2148
|
+
He,
|
|
2149
2149
|
{
|
|
2150
|
-
ref: (
|
|
2151
|
-
P.current[U] =
|
|
2150
|
+
ref: (ee) => {
|
|
2151
|
+
P.current[U] = ee;
|
|
2152
2152
|
},
|
|
2153
2153
|
children: L.label
|
|
2154
2154
|
},
|
|
2155
2155
|
`header-${U}`
|
|
2156
2156
|
) : /* @__PURE__ */ e(
|
|
2157
|
-
|
|
2157
|
+
$e,
|
|
2158
2158
|
{
|
|
2159
|
-
ref: (
|
|
2160
|
-
P.current[U] =
|
|
2159
|
+
ref: (ee) => {
|
|
2160
|
+
P.current[U] = ee;
|
|
2161
2161
|
}
|
|
2162
2162
|
},
|
|
2163
2163
|
`divider-${U}`
|
|
2164
2164
|
);
|
|
2165
|
-
const
|
|
2165
|
+
const se = G(L.value, i);
|
|
2166
2166
|
return /* @__PURE__ */ e(
|
|
2167
|
-
|
|
2167
|
+
We,
|
|
2168
2168
|
{
|
|
2169
|
-
...
|
|
2170
|
-
ref(
|
|
2171
|
-
P.current[U] =
|
|
2169
|
+
...j({
|
|
2170
|
+
ref(ee) {
|
|
2171
|
+
P.current[U] = ee;
|
|
2172
2172
|
}
|
|
2173
2173
|
}),
|
|
2174
|
-
onClick: () =>
|
|
2175
|
-
selected:
|
|
2174
|
+
onClick: () => le(U),
|
|
2175
|
+
selected: se,
|
|
2176
2176
|
active: y === U,
|
|
2177
2177
|
disabled: L.disabled,
|
|
2178
2178
|
children: L.label
|
|
2179
2179
|
},
|
|
2180
|
-
|
|
2180
|
+
`option-${U}`
|
|
2181
2181
|
);
|
|
2182
2182
|
})
|
|
2183
2183
|
] })
|
|
@@ -2188,9 +2188,9 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
2188
2188
|
]
|
|
2189
2189
|
}
|
|
2190
2190
|
) });
|
|
2191
|
-
},
|
|
2192
|
-
const [o, s] =
|
|
2193
|
-
return
|
|
2191
|
+
}, Er = (t, n) => {
|
|
2192
|
+
const [o, s] = W(t);
|
|
2193
|
+
return _(() => {
|
|
2194
2194
|
const r = setTimeout(() => {
|
|
2195
2195
|
s(t);
|
|
2196
2196
|
}, n);
|
|
@@ -2198,7 +2198,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
2198
2198
|
clearTimeout(r);
|
|
2199
2199
|
};
|
|
2200
2200
|
}, [t, n]), o;
|
|
2201
|
-
},
|
|
2201
|
+
}, zl = (t) => {
|
|
2202
2202
|
const {
|
|
2203
2203
|
className: n,
|
|
2204
2204
|
label: o,
|
|
@@ -2214,51 +2214,51 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
2214
2214
|
size: h = "md",
|
|
2215
2215
|
disabled: b = !1,
|
|
2216
2216
|
clearable: p = !0
|
|
2217
|
-
} = t, [m, v] =
|
|
2218
|
-
() => y.map((
|
|
2217
|
+
} = t, [m, v] = W(!1), u = C.useRef(null), [I, R] = W(""), [y, D] = W([]), [T, B] = W(null), P = C.useRef(null), [z, N] = W(!1), [k, A] = W(!1), [O, $] = W(null), j = C.useRef([]), le = ie(
|
|
2218
|
+
() => y.map((M, F) => !H(M) || M.disabled ? F : -1).filter((M) => M !== -1),
|
|
2219
2219
|
[y]
|
|
2220
2220
|
);
|
|
2221
|
-
|
|
2222
|
-
const
|
|
2223
|
-
|
|
2221
|
+
we(m, () => v(!1));
|
|
2222
|
+
const oe = Er(I, i);
|
|
2223
|
+
_(() => {
|
|
2224
2224
|
(async () => {
|
|
2225
2225
|
N(!0);
|
|
2226
|
-
const F = await l(
|
|
2226
|
+
const F = await l(oe);
|
|
2227
2227
|
D(F), N(!1);
|
|
2228
2228
|
})();
|
|
2229
|
-
}, [
|
|
2229
|
+
}, [oe, l]), _(() => {
|
|
2230
2230
|
if (c == null) {
|
|
2231
|
-
|
|
2231
|
+
B(null);
|
|
2232
2232
|
return;
|
|
2233
2233
|
}
|
|
2234
|
-
const
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
const
|
|
2238
|
-
|
|
2234
|
+
const M = y?.find((F) => H(F) && G(F.value, c));
|
|
2235
|
+
M ? B(M) : (async () => {
|
|
2236
|
+
A(!0);
|
|
2237
|
+
const ae = await a(c);
|
|
2238
|
+
B(ae), A(!1);
|
|
2239
2239
|
})();
|
|
2240
|
-
}, [a, y, c]),
|
|
2241
|
-
m ? setTimeout(() => P.current?.focus(), 100) : (
|
|
2242
|
-
}, [m]),
|
|
2240
|
+
}, [a, y, c]), _(() => {
|
|
2241
|
+
m ? setTimeout(() => P.current?.focus(), 100) : ($(null), R(""));
|
|
2242
|
+
}, [m]), _(() => {
|
|
2243
2243
|
if (!m) return;
|
|
2244
|
-
const
|
|
2245
|
-
|
|
2244
|
+
const M = y.findIndex((F) => H(F) && !F.disabled);
|
|
2245
|
+
$(M >= 0 ? M : null);
|
|
2246
2246
|
}, [y, m]);
|
|
2247
|
-
const { anchorRef: L, Popover: U, getReferenceProps:
|
|
2247
|
+
const { anchorRef: L, Popover: U, getReferenceProps: se, getItemProps: ee } = _e({
|
|
2248
2248
|
placement: "bottom",
|
|
2249
2249
|
fullWidth: !0,
|
|
2250
2250
|
minWidth: 200,
|
|
2251
2251
|
onOutsideClick: () => v(!1),
|
|
2252
2252
|
open: m,
|
|
2253
2253
|
onOpenChange: v,
|
|
2254
|
-
listRef:
|
|
2254
|
+
listRef: j,
|
|
2255
2255
|
activeIndex: O,
|
|
2256
|
-
onNavigate:
|
|
2257
|
-
disabledIndices:
|
|
2258
|
-
}),
|
|
2259
|
-
const F = y[
|
|
2256
|
+
onNavigate: $,
|
|
2257
|
+
disabledIndices: le
|
|
2258
|
+
}), Oe = (M) => {
|
|
2259
|
+
const F = y[M];
|
|
2260
2260
|
F && H(F) && !F.disabled && (r(F.value), v(!1));
|
|
2261
|
-
},
|
|
2261
|
+
}, ze = y.some((M) => H(M));
|
|
2262
2262
|
return /* @__PURE__ */ e(Q.Provider, { value: h, children: /* @__PURE__ */ d(
|
|
2263
2263
|
"div",
|
|
2264
2264
|
{
|
|
@@ -2267,12 +2267,12 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
2267
2267
|
n
|
|
2268
2268
|
),
|
|
2269
2269
|
children: [
|
|
2270
|
-
/* @__PURE__ */ e(
|
|
2270
|
+
/* @__PURE__ */ e(q, { children: o }),
|
|
2271
2271
|
/* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: L, children: [
|
|
2272
2272
|
/* @__PURE__ */ d(
|
|
2273
2273
|
"div",
|
|
2274
2274
|
{
|
|
2275
|
-
...
|
|
2275
|
+
...se({
|
|
2276
2276
|
ref: u,
|
|
2277
2277
|
role: "button",
|
|
2278
2278
|
tabIndex: b ? -1 : 0,
|
|
@@ -2280,32 +2280,32 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
2280
2280
|
onClick: () => {
|
|
2281
2281
|
b || v(!m);
|
|
2282
2282
|
},
|
|
2283
|
-
onKeyDown: (
|
|
2284
|
-
b || (
|
|
2283
|
+
onKeyDown: (M) => {
|
|
2284
|
+
b || (M.key === " " ? (M.preventDefault(), v((F) => !F)) : M.key === "Enter" && !m && (M.preventDefault(), v(!0)));
|
|
2285
2285
|
}
|
|
2286
2286
|
}),
|
|
2287
2287
|
className: f(
|
|
2288
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",
|
|
2289
|
-
|
|
2289
|
+
ne[h],
|
|
2290
2290
|
Y[h],
|
|
2291
|
-
|
|
2292
|
-
p && c ?
|
|
2291
|
+
me[h],
|
|
2292
|
+
p && c ? Be[h] : fe[h],
|
|
2293
2293
|
b ? "select-trigger-disabled" : w && "select-trigger-error",
|
|
2294
2294
|
!b && m && "ring-4"
|
|
2295
2295
|
),
|
|
2296
2296
|
children: [
|
|
2297
2297
|
!k && T && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: T.label }),
|
|
2298
2298
|
!k && !T && g && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: g }),
|
|
2299
|
-
k && /* @__PURE__ */ e(
|
|
2299
|
+
k && /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-text)]" })
|
|
2300
2300
|
]
|
|
2301
2301
|
}
|
|
2302
2302
|
),
|
|
2303
|
-
/* @__PURE__ */ d(
|
|
2304
|
-
!b && w && /* @__PURE__ */ e(
|
|
2305
|
-
p && !!c && !b && /* @__PURE__ */ e(
|
|
2306
|
-
/* @__PURE__ */ e(
|
|
2303
|
+
/* @__PURE__ */ d(he, { children: [
|
|
2304
|
+
!b && w && /* @__PURE__ */ e(re, {}),
|
|
2305
|
+
p && !!c && !b && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => r(null) }),
|
|
2306
|
+
/* @__PURE__ */ e(Z, { Icon: ve })
|
|
2307
2307
|
] }),
|
|
2308
|
-
/* @__PURE__ */ e(U, { open: m, children: /* @__PURE__ */ d(
|
|
2308
|
+
/* @__PURE__ */ e(U, { open: m, children: /* @__PURE__ */ d(xe, { className: "gap-0 !p-0", style: { maxHeight: x }, children: [
|
|
2309
2309
|
/* @__PURE__ */ d("div", { className: "sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm", children: [
|
|
2310
2310
|
/* @__PURE__ */ e(
|
|
2311
2311
|
"input",
|
|
@@ -2315,53 +2315,53 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
2315
2315
|
placeholder: "Search",
|
|
2316
2316
|
value: I,
|
|
2317
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)]",
|
|
2318
|
-
onChange: (
|
|
2319
|
-
onKeyDown: (
|
|
2320
|
-
|
|
2318
|
+
onChange: (M) => R(M.target.value),
|
|
2319
|
+
onKeyDown: (M) => {
|
|
2320
|
+
M.key === "Enter" && O != null && (M.preventDefault(), Oe(O));
|
|
2321
2321
|
}
|
|
2322
2322
|
}
|
|
2323
2323
|
),
|
|
2324
|
-
/* @__PURE__ */ e(
|
|
2324
|
+
/* @__PURE__ */ e(Me, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
|
|
2325
2325
|
] }),
|
|
2326
2326
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1 p-2", children: [
|
|
2327
|
-
!z && !
|
|
2328
|
-
z && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(
|
|
2329
|
-
!z && y.map((
|
|
2330
|
-
if (!H(
|
|
2331
|
-
return
|
|
2332
|
-
|
|
2327
|
+
!z && !ze && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
|
|
2328
|
+
z && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(Se, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
|
|
2329
|
+
!z && y.map((M, F) => {
|
|
2330
|
+
if (!H(M))
|
|
2331
|
+
return M.kind === "header" ? /* @__PURE__ */ e(
|
|
2332
|
+
He,
|
|
2333
2333
|
{
|
|
2334
|
-
ref: (
|
|
2335
|
-
|
|
2334
|
+
ref: (pe) => {
|
|
2335
|
+
j.current[F] = pe;
|
|
2336
2336
|
},
|
|
2337
|
-
children:
|
|
2337
|
+
children: M.label
|
|
2338
2338
|
},
|
|
2339
2339
|
`header-${F}`
|
|
2340
2340
|
) : /* @__PURE__ */ e(
|
|
2341
|
-
|
|
2341
|
+
$e,
|
|
2342
2342
|
{
|
|
2343
|
-
ref: (
|
|
2344
|
-
|
|
2343
|
+
ref: (pe) => {
|
|
2344
|
+
j.current[F] = pe;
|
|
2345
2345
|
}
|
|
2346
2346
|
},
|
|
2347
2347
|
`divider-${F}`
|
|
2348
2348
|
);
|
|
2349
|
-
const
|
|
2349
|
+
const ae = G(M.value, c);
|
|
2350
2350
|
return /* @__PURE__ */ e(
|
|
2351
|
-
|
|
2351
|
+
We,
|
|
2352
2352
|
{
|
|
2353
|
-
...
|
|
2354
|
-
ref(
|
|
2355
|
-
|
|
2353
|
+
...ee({
|
|
2354
|
+
ref(pe) {
|
|
2355
|
+
j.current[F] = pe;
|
|
2356
2356
|
}
|
|
2357
2357
|
}),
|
|
2358
|
-
onClick: () =>
|
|
2359
|
-
selected:
|
|
2358
|
+
onClick: () => Oe(F),
|
|
2359
|
+
selected: ae,
|
|
2360
2360
|
active: O === F,
|
|
2361
|
-
disabled:
|
|
2362
|
-
children:
|
|
2361
|
+
disabled: M.disabled,
|
|
2362
|
+
children: M.label
|
|
2363
2363
|
},
|
|
2364
|
-
|
|
2364
|
+
`option-${F}`
|
|
2365
2365
|
);
|
|
2366
2366
|
})
|
|
2367
2367
|
] })
|
|
@@ -2372,7 +2372,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
2372
2372
|
]
|
|
2373
2373
|
}
|
|
2374
2374
|
) });
|
|
2375
|
-
},
|
|
2375
|
+
}, Mr = {
|
|
2376
2376
|
red: "bg-red-100 text-red-700 ring-red-200 dark:bg-red-950 dark:text-red-300 dark:ring-red-800",
|
|
2377
2377
|
orange: "bg-orange-100 text-orange-700 ring-orange-200 dark:bg-orange-950 dark:text-orange-300 dark:ring-orange-800",
|
|
2378
2378
|
amber: "bg-amber-100 text-amber-700 ring-amber-200 dark:bg-amber-950 dark:text-amber-300 dark:ring-amber-800",
|
|
@@ -2397,7 +2397,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
2397
2397
|
stone: "bg-stone-100 text-stone-700 ring-stone-200 dark:bg-stone-950 dark:text-stone-300 dark:ring-stone-800",
|
|
2398
2398
|
white: "bg-[var(--color-badge-white-bg)] text-[var(--color-badge-white-text)] ring-[var(--color-badge-white-ring)]",
|
|
2399
2399
|
black: "bg-[var(--color-badge-black-bg)] text-[var(--color-badge-black-text)] ring-[var(--color-badge-black-ring)]"
|
|
2400
|
-
},
|
|
2400
|
+
}, Ee = C.forwardRef((t, n) => {
|
|
2401
2401
|
const {
|
|
2402
2402
|
className: o,
|
|
2403
2403
|
children: s,
|
|
@@ -2407,7 +2407,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
2407
2407
|
color: i = "gray"
|
|
2408
2408
|
} = t, c = f(
|
|
2409
2409
|
"inline-flex align-top items-center gap-2 px-3 h-7 rounded-lg font-semibold",
|
|
2410
|
-
|
|
2410
|
+
Mr[i],
|
|
2411
2411
|
o
|
|
2412
2412
|
);
|
|
2413
2413
|
return r ? /* @__PURE__ */ e("div", { ref: n, children: /* @__PURE__ */ d(
|
|
@@ -2419,7 +2419,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
2419
2419
|
a && /* @__PURE__ */ e(a, { className: "h-4 w-4 shrink-0" }),
|
|
2420
2420
|
/* @__PURE__ */ e("div", { className: "break-all line-clamp-1 text-left", children: s }),
|
|
2421
2421
|
l && /* @__PURE__ */ e(
|
|
2422
|
-
|
|
2422
|
+
de,
|
|
2423
2423
|
{
|
|
2424
2424
|
className: "h-4 w-4 shrink-0"
|
|
2425
2425
|
}
|
|
@@ -2431,7 +2431,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Wn = [
|
|
|
2431
2431
|
/* @__PURE__ */ e("div", { className: "break-all line-clamp-1 text-left", children: s })
|
|
2432
2432
|
] });
|
|
2433
2433
|
});
|
|
2434
|
-
function
|
|
2434
|
+
function Fr(t) {
|
|
2435
2435
|
const {
|
|
2436
2436
|
enabled: n,
|
|
2437
2437
|
triggerRef: o,
|
|
@@ -2440,8 +2440,8 @@ function Mr(t) {
|
|
|
2440
2440
|
itemCount: l,
|
|
2441
2441
|
deps: a = [],
|
|
2442
2442
|
gap: i = 4
|
|
2443
|
-
} = t, [c, g] =
|
|
2444
|
-
return
|
|
2443
|
+
} = t, [c, g] = W(0);
|
|
2444
|
+
return Rt(() => {
|
|
2445
2445
|
if (!n) return;
|
|
2446
2446
|
const x = o.current, w = s.current;
|
|
2447
2447
|
if (!x || !w) return;
|
|
@@ -2470,19 +2470,19 @@ function Mr(t) {
|
|
|
2470
2470
|
g(l);
|
|
2471
2471
|
return;
|
|
2472
2472
|
}
|
|
2473
|
-
const
|
|
2473
|
+
const B = D[l].offsetWidth;
|
|
2474
2474
|
let P = 0, z = 0;
|
|
2475
2475
|
for (let N = 0; N < l; N++) {
|
|
2476
|
-
const k = D[N].offsetWidth,
|
|
2477
|
-
if (
|
|
2478
|
-
P =
|
|
2476
|
+
const k = D[N].offsetWidth, A = P + k + (N > 0 ? i : 0);
|
|
2477
|
+
if (A + B + i > y) break;
|
|
2478
|
+
P = A, z++;
|
|
2479
2479
|
}
|
|
2480
2480
|
g(Math.max(1, z));
|
|
2481
2481
|
}, b = new ResizeObserver(h);
|
|
2482
2482
|
return b.observe(x), r?.current && b.observe(r.current), h(), () => b.disconnect();
|
|
2483
2483
|
}, [n, l, ...a]), c;
|
|
2484
2484
|
}
|
|
2485
|
-
const
|
|
2485
|
+
const Tl = (t) => {
|
|
2486
2486
|
const {
|
|
2487
2487
|
className: n,
|
|
2488
2488
|
label: o,
|
|
@@ -2499,42 +2499,42 @@ const zl = (t) => {
|
|
|
2499
2499
|
color: b = "blue",
|
|
2500
2500
|
disabled: p = !1,
|
|
2501
2501
|
clearable: m = !0
|
|
2502
|
-
} = t, [v, u] =
|
|
2503
|
-
() => i.map((S) => r.find((
|
|
2502
|
+
} = t, [v, u] = W(!1), [I, R] = W(r), [y, D] = W(""), [T, B] = W(null), P = C.useRef(null), z = C.useRef(null), N = C.useRef([]), k = C.useRef(null), A = C.useRef(null), O = ie(
|
|
2503
|
+
() => i.map((S) => r.find((E) => H(E) && G(E.value, S))).filter((S) => S !== void 0),
|
|
2504
2504
|
[i, r]
|
|
2505
|
-
),
|
|
2505
|
+
), $ = (S) => {
|
|
2506
2506
|
if (S === "") return r;
|
|
2507
|
-
const
|
|
2508
|
-
return r.filter((
|
|
2509
|
-
},
|
|
2507
|
+
const E = S.toLowerCase();
|
|
2508
|
+
return r.filter((Ie) => H(Ie) && typeof Ie.label == "string" ? Ie.label.toLowerCase().includes(E) : !0);
|
|
2509
|
+
}, j = ie(
|
|
2510
2510
|
() => y !== "" ? I : r,
|
|
2511
2511
|
[y, I, r]
|
|
2512
|
-
),
|
|
2513
|
-
() =>
|
|
2514
|
-
[
|
|
2512
|
+
), le = ie(
|
|
2513
|
+
() => j.map((S, E) => !H(S) || S.disabled ? E : -1).filter((S) => S !== -1),
|
|
2514
|
+
[j]
|
|
2515
2515
|
);
|
|
2516
|
-
|
|
2517
|
-
R((a ??
|
|
2518
|
-
}, [y, r, a]),
|
|
2516
|
+
we(v, () => u(!1)), _(() => {
|
|
2517
|
+
R((a ?? $)(y));
|
|
2518
|
+
}, [y, r, a]), _(() => {
|
|
2519
2519
|
if (v) {
|
|
2520
2520
|
setTimeout(() => z.current?.focus(), 100);
|
|
2521
|
-
const S = r.findIndex((
|
|
2522
|
-
|
|
2521
|
+
const S = r.findIndex((E) => H(E) && !E.disabled);
|
|
2522
|
+
B(S >= 0 ? S : null);
|
|
2523
2523
|
} else
|
|
2524
|
-
|
|
2525
|
-
}, [v]),
|
|
2524
|
+
B(null), D("");
|
|
2525
|
+
}, [v]), _(() => {
|
|
2526
2526
|
if (!v) return;
|
|
2527
|
-
const S =
|
|
2528
|
-
|
|
2529
|
-
}, [y, v,
|
|
2530
|
-
const
|
|
2527
|
+
const S = j.findIndex((E) => H(E) && !E.disabled);
|
|
2528
|
+
B(S >= 0 ? S : null);
|
|
2529
|
+
}, [y, v, j]);
|
|
2530
|
+
const oe = Fr({
|
|
2531
2531
|
enabled: h,
|
|
2532
2532
|
triggerRef: P,
|
|
2533
2533
|
measureRef: k,
|
|
2534
|
-
trayRef:
|
|
2534
|
+
trayRef: A,
|
|
2535
2535
|
itemCount: O.length,
|
|
2536
2536
|
deps: [O, x]
|
|
2537
|
-
}), { anchorRef: L, Popover: U, getReferenceProps:
|
|
2537
|
+
}), { anchorRef: L, Popover: U, getReferenceProps: se, getItemProps: ee } = _e({
|
|
2538
2538
|
placement: "bottom",
|
|
2539
2539
|
fullWidth: !0,
|
|
2540
2540
|
minWidth: 200,
|
|
@@ -2543,14 +2543,14 @@ const zl = (t) => {
|
|
|
2543
2543
|
onOpenChange: u,
|
|
2544
2544
|
listRef: N,
|
|
2545
2545
|
activeIndex: T,
|
|
2546
|
-
onNavigate:
|
|
2547
|
-
disabledIndices:
|
|
2548
|
-
}),
|
|
2549
|
-
i.
|
|
2550
|
-
},
|
|
2551
|
-
const
|
|
2552
|
-
|
|
2553
|
-
},
|
|
2546
|
+
onNavigate: B,
|
|
2547
|
+
disabledIndices: le
|
|
2548
|
+
}), Oe = (S) => {
|
|
2549
|
+
i.some((E) => G(E, S)) ? l(i.filter((E) => !G(E, S))) : l([...i, S]);
|
|
2550
|
+
}, ze = (S) => {
|
|
2551
|
+
const E = j[S];
|
|
2552
|
+
E && H(E) && !E.disabled && Oe(E.value);
|
|
2553
|
+
}, M = j.some((S) => H(S)), F = i.length > 0, ae = h ? oe : O.length, pe = O.slice(0, ae), mt = O.length - ae;
|
|
2554
2554
|
return /* @__PURE__ */ e(Q.Provider, { value: w, children: /* @__PURE__ */ d(
|
|
2555
2555
|
"div",
|
|
2556
2556
|
{
|
|
@@ -2559,12 +2559,12 @@ const zl = (t) => {
|
|
|
2559
2559
|
n
|
|
2560
2560
|
),
|
|
2561
2561
|
children: [
|
|
2562
|
-
/* @__PURE__ */ e(
|
|
2562
|
+
/* @__PURE__ */ e(q, { children: o }),
|
|
2563
2563
|
/* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: L, children: [
|
|
2564
2564
|
/* @__PURE__ */ d(
|
|
2565
2565
|
"div",
|
|
2566
2566
|
{
|
|
2567
|
-
...
|
|
2567
|
+
...se({
|
|
2568
2568
|
ref: P,
|
|
2569
2569
|
role: "button",
|
|
2570
2570
|
tabIndex: p ? -1 : 0,
|
|
@@ -2573,35 +2573,35 @@ const zl = (t) => {
|
|
|
2573
2573
|
p || u(!v);
|
|
2574
2574
|
},
|
|
2575
2575
|
onKeyDown: (S) => {
|
|
2576
|
-
p || (S.key === " " ? (S.preventDefault(), u((
|
|
2576
|
+
p || (S.key === " " ? (S.preventDefault(), u((E) => !E)) : S.key === "Enter" && !v ? (S.preventDefault(), u(!0)) : S.key === "Backspace" && !v && F && (S.preventDefault(), l(i.slice(0, -1))));
|
|
2577
2577
|
}
|
|
2578
2578
|
}),
|
|
2579
2579
|
className: f(
|
|
2580
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",
|
|
2581
|
-
h && f("flex-nowrap overflow-hidden",
|
|
2582
|
-
!h && f("flex-wrap py-1.5",
|
|
2581
|
+
h && f("flex-nowrap overflow-hidden", ne[w]),
|
|
2582
|
+
!h && f("flex-wrap py-1.5", Pt[w]),
|
|
2583
2583
|
Y[w],
|
|
2584
|
-
|
|
2585
|
-
m && F ?
|
|
2584
|
+
me[w],
|
|
2585
|
+
m && F ? Be[w] : fe[w],
|
|
2586
2586
|
p ? "select-trigger-disabled" : x && "select-trigger-error",
|
|
2587
2587
|
!p && v && "ring-4"
|
|
2588
2588
|
),
|
|
2589
2589
|
children: [
|
|
2590
|
-
F &&
|
|
2591
|
-
|
|
2590
|
+
F && pe.map((S, E) => /* @__PURE__ */ e(
|
|
2591
|
+
Ee,
|
|
2592
2592
|
{
|
|
2593
2593
|
color: b,
|
|
2594
2594
|
className: f(
|
|
2595
|
-
h &&
|
|
2596
|
-
(!h ||
|
|
2595
|
+
h && ae > 1 && "shrink-0",
|
|
2596
|
+
(!h || ae === 1) && "max-w-full min-w-0"
|
|
2597
2597
|
),
|
|
2598
2598
|
children: S.label
|
|
2599
2599
|
},
|
|
2600
|
-
|
|
2600
|
+
`badge-${E}`
|
|
2601
2601
|
)),
|
|
2602
|
-
F &&
|
|
2602
|
+
F && mt > 0 && /* @__PURE__ */ d("span", { className: "shrink-0 text-sm font-medium select-placeholder px-1", children: [
|
|
2603
2603
|
"+",
|
|
2604
|
-
|
|
2604
|
+
mt,
|
|
2605
2605
|
" more"
|
|
2606
2606
|
] }),
|
|
2607
2607
|
!F && c && /* @__PURE__ */ e("span", { className: "select-placeholder", children: c })
|
|
@@ -2615,7 +2615,7 @@ const zl = (t) => {
|
|
|
2615
2615
|
"aria-hidden": !0,
|
|
2616
2616
|
className: "absolute top-0 left-0 invisible pointer-events-none flex flex-row flex-nowrap items-center gap-1 w-max",
|
|
2617
2617
|
children: [
|
|
2618
|
-
O.map((S) => /* @__PURE__ */ e(
|
|
2618
|
+
O.map((S, E) => /* @__PURE__ */ e(Ee, { color: b, children: S.label }, `measure-${E}`)),
|
|
2619
2619
|
O.length > 0 && /* @__PURE__ */ d("span", { className: "text-sm font-medium px-1", children: [
|
|
2620
2620
|
"+",
|
|
2621
2621
|
O.length,
|
|
@@ -2624,12 +2624,12 @@ const zl = (t) => {
|
|
|
2624
2624
|
]
|
|
2625
2625
|
}
|
|
2626
2626
|
),
|
|
2627
|
-
/* @__PURE__ */ d(
|
|
2628
|
-
!p && x && /* @__PURE__ */ e(
|
|
2629
|
-
m && F && !p && /* @__PURE__ */ e(
|
|
2630
|
-
/* @__PURE__ */ e(
|
|
2627
|
+
/* @__PURE__ */ d(he, { ref: A, children: [
|
|
2628
|
+
!p && x && /* @__PURE__ */ e(re, {}),
|
|
2629
|
+
m && F && !p && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => l([]) }),
|
|
2630
|
+
/* @__PURE__ */ e(Z, { Icon: ve })
|
|
2631
2631
|
] }),
|
|
2632
|
-
/* @__PURE__ */ e(U, { open: v, children: /* @__PURE__ */ d(
|
|
2632
|
+
/* @__PURE__ */ e(U, { open: v, children: /* @__PURE__ */ d(xe, { className: "gap-0 !p-0", style: { maxHeight: g }, children: [
|
|
2633
2633
|
/* @__PURE__ */ d("div", { className: "sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm", children: [
|
|
2634
2634
|
/* @__PURE__ */ e(
|
|
2635
2635
|
"input",
|
|
@@ -2641,50 +2641,50 @@ const zl = (t) => {
|
|
|
2641
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)]",
|
|
2642
2642
|
onChange: (S) => D(S.target.value),
|
|
2643
2643
|
onKeyDown: (S) => {
|
|
2644
|
-
S.key === "Enter" && T != null ? (S.preventDefault(),
|
|
2644
|
+
S.key === "Enter" && T != null ? (S.preventDefault(), ze(T)) : S.key === "Backspace" && y === "" && F && (S.preventDefault(), l(i.slice(0, -1)));
|
|
2645
2645
|
}
|
|
2646
2646
|
}
|
|
2647
2647
|
),
|
|
2648
|
-
/* @__PURE__ */ e(
|
|
2648
|
+
/* @__PURE__ */ e(Me, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
|
|
2649
2649
|
] }),
|
|
2650
2650
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1 p-2", children: [
|
|
2651
|
-
y !== "" && !
|
|
2652
|
-
|
|
2651
|
+
y !== "" && !M && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
|
|
2652
|
+
j.map((S, E) => {
|
|
2653
2653
|
if (!H(S))
|
|
2654
2654
|
return S.kind === "header" ? /* @__PURE__ */ e(
|
|
2655
|
-
|
|
2655
|
+
He,
|
|
2656
2656
|
{
|
|
2657
|
-
ref: (
|
|
2658
|
-
N.current[
|
|
2657
|
+
ref: (ge) => {
|
|
2658
|
+
N.current[E] = ge;
|
|
2659
2659
|
},
|
|
2660
2660
|
children: S.label
|
|
2661
2661
|
},
|
|
2662
|
-
`header-${
|
|
2662
|
+
`header-${E}`
|
|
2663
2663
|
) : /* @__PURE__ */ e(
|
|
2664
|
-
|
|
2664
|
+
$e,
|
|
2665
2665
|
{
|
|
2666
|
-
ref: (
|
|
2667
|
-
N.current[
|
|
2666
|
+
ref: (ge) => {
|
|
2667
|
+
N.current[E] = ge;
|
|
2668
2668
|
}
|
|
2669
2669
|
},
|
|
2670
|
-
`divider-${
|
|
2670
|
+
`divider-${E}`
|
|
2671
2671
|
);
|
|
2672
|
-
const
|
|
2672
|
+
const Ie = i.some((ge) => G(ge, S.value));
|
|
2673
2673
|
return /* @__PURE__ */ e(
|
|
2674
|
-
|
|
2674
|
+
We,
|
|
2675
2675
|
{
|
|
2676
|
-
...
|
|
2677
|
-
ref(
|
|
2678
|
-
N.current[
|
|
2676
|
+
...ee({
|
|
2677
|
+
ref(ge) {
|
|
2678
|
+
N.current[E] = ge;
|
|
2679
2679
|
}
|
|
2680
2680
|
}),
|
|
2681
|
-
onClick: () =>
|
|
2682
|
-
selected:
|
|
2683
|
-
active: T ===
|
|
2681
|
+
onClick: () => ze(E),
|
|
2682
|
+
selected: Ie,
|
|
2683
|
+
active: T === E,
|
|
2684
2684
|
disabled: S.disabled,
|
|
2685
2685
|
children: S.label
|
|
2686
2686
|
},
|
|
2687
|
-
|
|
2687
|
+
`option-${E}`
|
|
2688
2688
|
);
|
|
2689
2689
|
})
|
|
2690
2690
|
] })
|
|
@@ -2695,7 +2695,7 @@ const zl = (t) => {
|
|
|
2695
2695
|
]
|
|
2696
2696
|
}
|
|
2697
2697
|
) });
|
|
2698
|
-
},
|
|
2698
|
+
}, Ll = C.forwardRef((t, n) => {
|
|
2699
2699
|
const {
|
|
2700
2700
|
className: o,
|
|
2701
2701
|
children: s,
|
|
@@ -2713,7 +2713,7 @@ const zl = (t) => {
|
|
|
2713
2713
|
children: s
|
|
2714
2714
|
}
|
|
2715
2715
|
);
|
|
2716
|
-
}),
|
|
2716
|
+
}), Pl = C.forwardRef((t, n) => {
|
|
2717
2717
|
const {
|
|
2718
2718
|
className: o,
|
|
2719
2719
|
children: s,
|
|
@@ -2731,7 +2731,7 @@ const zl = (t) => {
|
|
|
2731
2731
|
children: s
|
|
2732
2732
|
}
|
|
2733
2733
|
);
|
|
2734
|
-
}),
|
|
2734
|
+
}), yt = "input-description text-sm font-medium", El = (t) => {
|
|
2735
2735
|
const {
|
|
2736
2736
|
className: n,
|
|
2737
2737
|
label: o,
|
|
@@ -2748,7 +2748,7 @@ const zl = (t) => {
|
|
|
2748
2748
|
),
|
|
2749
2749
|
...l,
|
|
2750
2750
|
children: [
|
|
2751
|
-
/* @__PURE__ */ e("div", { className: f(
|
|
2751
|
+
/* @__PURE__ */ e("div", { className: f(yt, "w-1/2 line-clamp-1 break-all"), children: o }),
|
|
2752
2752
|
/* @__PURE__ */ e("div", { className: "w-1/2 line-clamp-1 break-all", children: s })
|
|
2753
2753
|
]
|
|
2754
2754
|
}
|
|
@@ -2761,36 +2761,36 @@ const zl = (t) => {
|
|
|
2761
2761
|
),
|
|
2762
2762
|
...l,
|
|
2763
2763
|
children: [
|
|
2764
|
-
o && /* @__PURE__ */ e("div", { className:
|
|
2764
|
+
o && /* @__PURE__ */ e("div", { className: yt, children: o }),
|
|
2765
2765
|
/* @__PURE__ */ e("div", { children: s })
|
|
2766
2766
|
]
|
|
2767
2767
|
}
|
|
2768
2768
|
);
|
|
2769
|
-
}, Fr = {
|
|
2770
|
-
error: Ze,
|
|
2771
|
-
warning: ln,
|
|
2772
|
-
success: et,
|
|
2773
|
-
info: rn
|
|
2774
2769
|
}, Br = {
|
|
2770
|
+
error: et,
|
|
2771
|
+
warning: on,
|
|
2772
|
+
success: tt,
|
|
2773
|
+
info: ln
|
|
2774
|
+
}, Ar = {
|
|
2775
2775
|
error: "text-[var(--color-status-error)]",
|
|
2776
2776
|
warning: "text-[var(--color-status-warning)]",
|
|
2777
2777
|
success: "text-[var(--color-status-success)]",
|
|
2778
2778
|
info: "text-[var(--color-status-info)]"
|
|
2779
|
-
},
|
|
2779
|
+
}, Ct = "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", Ml = (t) => {
|
|
2780
2780
|
const {
|
|
2781
2781
|
className: n,
|
|
2782
2782
|
children: o,
|
|
2783
2783
|
Icon: s,
|
|
2784
2784
|
status: r,
|
|
2785
2785
|
...l
|
|
2786
|
-
} = t, a = r ?
|
|
2786
|
+
} = t, a = r ? Br[r] : null, i = /* @__PURE__ */ d(te, { children: [
|
|
2787
2787
|
/* @__PURE__ */ d("span", { className: "inline-flex flex-row items-center gap-3 min-w-0", children: [
|
|
2788
2788
|
s && /* @__PURE__ */ e(s, { className: "h-5 w-5 shrink-0" }),
|
|
2789
2789
|
/* @__PURE__ */ e("span", { className: "truncate", children: o })
|
|
2790
2790
|
] }),
|
|
2791
2791
|
/* @__PURE__ */ d("span", { className: "inline-flex flex-row items-center gap-2 shrink-0", children: [
|
|
2792
|
-
a && r && /* @__PURE__ */ e(a, { className: f("h-5 w-5",
|
|
2793
|
-
/* @__PURE__ */ e(
|
|
2792
|
+
a && r && /* @__PURE__ */ e(a, { className: f("h-5 w-5", Ar[r]) }),
|
|
2793
|
+
/* @__PURE__ */ e(sn, { className: "h-5 w-5 text-[var(--color-input-icon-button-icon)]" })
|
|
2794
2794
|
] })
|
|
2795
2795
|
] });
|
|
2796
2796
|
if (l.href !== void 0) {
|
|
@@ -2799,7 +2799,7 @@ const zl = (t) => {
|
|
|
2799
2799
|
"a",
|
|
2800
2800
|
{
|
|
2801
2801
|
href: c,
|
|
2802
|
-
className: f(
|
|
2802
|
+
className: f(Ct, n),
|
|
2803
2803
|
...g,
|
|
2804
2804
|
children: i
|
|
2805
2805
|
}
|
|
@@ -2808,12 +2808,12 @@ const zl = (t) => {
|
|
|
2808
2808
|
return /* @__PURE__ */ e(
|
|
2809
2809
|
"button",
|
|
2810
2810
|
{
|
|
2811
|
-
className: f(
|
|
2811
|
+
className: f(Ct, n),
|
|
2812
2812
|
...l,
|
|
2813
2813
|
children: i
|
|
2814
2814
|
}
|
|
2815
2815
|
);
|
|
2816
|
-
},
|
|
2816
|
+
}, Fl = (t) => {
|
|
2817
2817
|
const {
|
|
2818
2818
|
className: n,
|
|
2819
2819
|
vertical: o = !1,
|
|
@@ -2829,7 +2829,7 @@ const zl = (t) => {
|
|
|
2829
2829
|
...s
|
|
2830
2830
|
}
|
|
2831
2831
|
);
|
|
2832
|
-
},
|
|
2832
|
+
}, Bl = (t) => {
|
|
2833
2833
|
const {
|
|
2834
2834
|
children: n,
|
|
2835
2835
|
content: o,
|
|
@@ -2837,7 +2837,7 @@ const zl = (t) => {
|
|
|
2837
2837
|
placement: r = "top",
|
|
2838
2838
|
minWidth: l = 100,
|
|
2839
2839
|
maxWidth: a = 200
|
|
2840
|
-
} = t, [i, c] =
|
|
2840
|
+
} = t, [i, c] = W(!1), { anchorRef: g, Popover: x } = dt({
|
|
2841
2841
|
placement: r,
|
|
2842
2842
|
minWidth: l,
|
|
2843
2843
|
maxWidth: a
|
|
@@ -2851,11 +2851,11 @@ const zl = (t) => {
|
|
|
2851
2851
|
onMouseLeave: () => c(!1),
|
|
2852
2852
|
children: [
|
|
2853
2853
|
n,
|
|
2854
|
-
/* @__PURE__ */ e(x, { open: i, children: /* @__PURE__ */ e(
|
|
2854
|
+
/* @__PURE__ */ e(x, { open: i, children: /* @__PURE__ */ e(xe, { children: o }) })
|
|
2855
2855
|
]
|
|
2856
2856
|
}
|
|
2857
2857
|
);
|
|
2858
|
-
},
|
|
2858
|
+
}, Al = (t) => {
|
|
2859
2859
|
const {
|
|
2860
2860
|
open: n,
|
|
2861
2861
|
onDismiss: o,
|
|
@@ -2866,10 +2866,10 @@ const zl = (t) => {
|
|
|
2866
2866
|
children: i,
|
|
2867
2867
|
maxWidth: c = 600
|
|
2868
2868
|
} = t;
|
|
2869
|
-
return
|
|
2870
|
-
})), /* @__PURE__ */ e(
|
|
2869
|
+
return we(!!r && n, o || (() => {
|
|
2870
|
+
})), /* @__PURE__ */ e(De, { children: n && /* @__PURE__ */ d(Fe, { children: [
|
|
2871
2871
|
/* @__PURE__ */ e(
|
|
2872
|
-
|
|
2872
|
+
J.div,
|
|
2873
2873
|
{
|
|
2874
2874
|
className: "z-40",
|
|
2875
2875
|
style: { transformOrigin: "center" },
|
|
@@ -2878,7 +2878,7 @@ const zl = (t) => {
|
|
|
2878
2878
|
exit: { opacity: 0 },
|
|
2879
2879
|
transition: { duration: 0.15, ease: "easeInOut" },
|
|
2880
2880
|
children: /* @__PURE__ */ e(
|
|
2881
|
-
|
|
2881
|
+
rt,
|
|
2882
2882
|
{
|
|
2883
2883
|
className: "modal-overlay backdrop-blur-[1px]",
|
|
2884
2884
|
onClick: s ? o : void 0,
|
|
@@ -2888,7 +2888,7 @@ const zl = (t) => {
|
|
|
2888
2888
|
}
|
|
2889
2889
|
),
|
|
2890
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(
|
|
2891
|
-
|
|
2891
|
+
J.div,
|
|
2892
2892
|
{
|
|
2893
2893
|
className: f(
|
|
2894
2894
|
"flex flex-col modal-content rounded-2xl shadow-xl p-6 lg:p-12 pointer-events-auto w-full relative",
|
|
@@ -2901,9 +2901,9 @@ const zl = (t) => {
|
|
|
2901
2901
|
transition: { duration: 0.15, ease: "easeInOut" },
|
|
2902
2902
|
children: [
|
|
2903
2903
|
l && /* @__PURE__ */ e(
|
|
2904
|
-
|
|
2904
|
+
Bt,
|
|
2905
2905
|
{
|
|
2906
|
-
Icon:
|
|
2906
|
+
Icon: de,
|
|
2907
2907
|
className: "absolute top-4 right-4",
|
|
2908
2908
|
variant: "transparent",
|
|
2909
2909
|
size: "sm",
|
|
@@ -2915,7 +2915,7 @@ const zl = (t) => {
|
|
|
2915
2915
|
}
|
|
2916
2916
|
) })
|
|
2917
2917
|
] }) });
|
|
2918
|
-
},
|
|
2918
|
+
}, Ul = (t) => {
|
|
2919
2919
|
const {
|
|
2920
2920
|
open: n,
|
|
2921
2921
|
onDismiss: o,
|
|
@@ -2926,10 +2926,10 @@ const zl = (t) => {
|
|
|
2926
2926
|
children: i,
|
|
2927
2927
|
maxWidth: c = 480
|
|
2928
2928
|
} = t;
|
|
2929
|
-
return
|
|
2930
|
-
})), /* @__PURE__ */ e(
|
|
2929
|
+
return we(!!r && n, o || (() => {
|
|
2930
|
+
})), /* @__PURE__ */ e(De, { children: n && /* @__PURE__ */ d(Fe, { children: [
|
|
2931
2931
|
/* @__PURE__ */ e(
|
|
2932
|
-
|
|
2932
|
+
J.div,
|
|
2933
2933
|
{
|
|
2934
2934
|
className: "z-40",
|
|
2935
2935
|
style: { transformOrigin: "center" },
|
|
@@ -2938,7 +2938,7 @@ const zl = (t) => {
|
|
|
2938
2938
|
exit: { opacity: 0 },
|
|
2939
2939
|
transition: { duration: 0.15, ease: "easeInOut" },
|
|
2940
2940
|
children: /* @__PURE__ */ e(
|
|
2941
|
-
|
|
2941
|
+
rt,
|
|
2942
2942
|
{
|
|
2943
2943
|
className: "modal-overlay backdrop-blur-[1px]",
|
|
2944
2944
|
onClick: s ? o : void 0,
|
|
@@ -2948,7 +2948,7 @@ const zl = (t) => {
|
|
|
2948
2948
|
}
|
|
2949
2949
|
),
|
|
2950
2950
|
/* @__PURE__ */ e("div", { className: "fixed inset-0 flex flex-row justify-end pointer-events-none z-50", children: /* @__PURE__ */ d(
|
|
2951
|
-
|
|
2951
|
+
J.div,
|
|
2952
2952
|
{
|
|
2953
2953
|
className: f(
|
|
2954
2954
|
"flex flex-col modal-content shadow-xl p-6 lg:p-12 pointer-events-auto h-full w-full overflow-y-auto relative",
|
|
@@ -2961,9 +2961,9 @@ const zl = (t) => {
|
|
|
2961
2961
|
transition: { duration: 0.25, ease: [0.32, 0.72, 0, 1] },
|
|
2962
2962
|
children: [
|
|
2963
2963
|
l && /* @__PURE__ */ e(
|
|
2964
|
-
|
|
2964
|
+
Bt,
|
|
2965
2965
|
{
|
|
2966
|
-
Icon:
|
|
2966
|
+
Icon: de,
|
|
2967
2967
|
className: "absolute top-4 right-4",
|
|
2968
2968
|
variant: "transparent",
|
|
2969
2969
|
size: "sm",
|
|
@@ -2975,7 +2975,7 @@ const zl = (t) => {
|
|
|
2975
2975
|
}
|
|
2976
2976
|
) })
|
|
2977
2977
|
] }) });
|
|
2978
|
-
},
|
|
2978
|
+
}, Ur = (t) => {
|
|
2979
2979
|
const {
|
|
2980
2980
|
className: n,
|
|
2981
2981
|
tabs: o
|
|
@@ -3012,7 +3012,7 @@ const zl = (t) => {
|
|
|
3012
3012
|
r
|
|
3013
3013
|
);
|
|
3014
3014
|
}) });
|
|
3015
|
-
},
|
|
3015
|
+
}, Wl = (t) => {
|
|
3016
3016
|
const {
|
|
3017
3017
|
duration: n = 0.3,
|
|
3018
3018
|
ease: o = "easeInOut",
|
|
@@ -3058,7 +3058,7 @@ const zl = (t) => {
|
|
|
3058
3058
|
}
|
|
3059
3059
|
);
|
|
3060
3060
|
};
|
|
3061
|
-
function
|
|
3061
|
+
function Wr(t) {
|
|
3062
3062
|
const {
|
|
3063
3063
|
onDelta: n,
|
|
3064
3064
|
onDragStart: o,
|
|
@@ -3079,8 +3079,8 @@ function Ur(t) {
|
|
|
3079
3079
|
target: b.current
|
|
3080
3080
|
};
|
|
3081
3081
|
g.current = !1, c(!1);
|
|
3082
|
-
const { move: D, up: T, keydown:
|
|
3083
|
-
D && window.removeEventListener("pointermove", D, !0), T && (window.removeEventListener("pointerup", T, !0), window.removeEventListener("pointercancel", T, !0)),
|
|
3082
|
+
const { move: D, up: T, keydown: B } = v.current;
|
|
3083
|
+
D && window.removeEventListener("pointermove", D, !0), T && (window.removeEventListener("pointerup", T, !0), window.removeEventListener("pointercancel", T, !0)), B && window.removeEventListener("keydown", B, !0), v.current = {}, p.current != null && (cancelAnimationFrame(p.current), p.current = null), m.current.onDragEnd?.(y), b.current = null, h.current = 0;
|
|
3084
3084
|
}, []), I = C.useCallback((R) => {
|
|
3085
3085
|
if (r || l && R.button !== 0) return;
|
|
3086
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);
|
|
@@ -3107,13 +3107,13 @@ function Ur(t) {
|
|
|
3107
3107
|
}));
|
|
3108
3108
|
}, T = (P) => {
|
|
3109
3109
|
u(P.clientX);
|
|
3110
|
-
},
|
|
3110
|
+
}, B = (P) => {
|
|
3111
3111
|
P.key === "Escape" && (P.preventDefault(), u());
|
|
3112
3112
|
};
|
|
3113
|
-
v.current = { move: D, up: T, keydown:
|
|
3113
|
+
v.current = { move: D, up: T, keydown: B }, window.addEventListener("pointermove", D, {
|
|
3114
3114
|
passive: !a,
|
|
3115
3115
|
capture: !0
|
|
3116
|
-
}), 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", B, !0);
|
|
3117
3117
|
}, [u, r, a, l]);
|
|
3118
3118
|
return C.useEffect(() => () => {
|
|
3119
3119
|
g.current && u();
|
|
@@ -3126,7 +3126,7 @@ function Ur(t) {
|
|
|
3126
3126
|
}
|
|
3127
3127
|
};
|
|
3128
3128
|
}
|
|
3129
|
-
const
|
|
3129
|
+
const Hr = (t) => {
|
|
3130
3130
|
const {
|
|
3131
3131
|
column: n,
|
|
3132
3132
|
width: o,
|
|
@@ -3134,7 +3134,7 @@ const Wr = (t) => {
|
|
|
3134
3134
|
onResize: r,
|
|
3135
3135
|
sortDirection: l,
|
|
3136
3136
|
onSortClick: a
|
|
3137
|
-
} = t, i = !!n.sortable, { bind: c } =
|
|
3137
|
+
} = t, i = !!n.sortable, { bind: c } = Wr({
|
|
3138
3138
|
onDelta: (g) => r(g)
|
|
3139
3139
|
});
|
|
3140
3140
|
return /* @__PURE__ */ d(
|
|
@@ -3153,8 +3153,8 @@ const Wr = (t) => {
|
|
|
3153
3153
|
onClick: i ? a : void 0,
|
|
3154
3154
|
children: [
|
|
3155
3155
|
/* @__PURE__ */ e("span", { className: "truncate", children: n.header }),
|
|
3156
|
-
i && l === "asc" && /* @__PURE__ */ e(
|
|
3157
|
-
i && l === "desc" && /* @__PURE__ */ e(
|
|
3156
|
+
i && l === "asc" && /* @__PURE__ */ e(an, { className: "h-4 w-4 shrink-0" }),
|
|
3157
|
+
i && l === "desc" && /* @__PURE__ */ e(ve, { className: "h-4 w-4 shrink-0" })
|
|
3158
3158
|
]
|
|
3159
3159
|
}
|
|
3160
3160
|
),
|
|
@@ -3174,12 +3174,12 @@ const Wr = (t) => {
|
|
|
3174
3174
|
]
|
|
3175
3175
|
}
|
|
3176
3176
|
);
|
|
3177
|
-
},
|
|
3177
|
+
}, ye = 200, $r = 60, _r = (t) => {
|
|
3178
3178
|
const n = {};
|
|
3179
3179
|
for (const o of t)
|
|
3180
|
-
n[o.id] = o.defaultWidth ??
|
|
3180
|
+
n[o.id] = o.defaultWidth ?? ye;
|
|
3181
3181
|
return n;
|
|
3182
|
-
},
|
|
3182
|
+
}, jr = (t) => {
|
|
3183
3183
|
const {
|
|
3184
3184
|
columns: n,
|
|
3185
3185
|
rows: o,
|
|
@@ -3190,22 +3190,22 @@ const Wr = (t) => {
|
|
|
3190
3190
|
className: i,
|
|
3191
3191
|
rowHeight: c = 44,
|
|
3192
3192
|
headerHeight: g = 44
|
|
3193
|
-
} = t, [x, w] =
|
|
3194
|
-
|
|
3193
|
+
} = t, [x, w] = W(() => _r(n));
|
|
3194
|
+
_(() => {
|
|
3195
3195
|
w((u) => {
|
|
3196
3196
|
const I = {};
|
|
3197
3197
|
let R = Object.keys(u).length !== n.length;
|
|
3198
3198
|
for (const y of n)
|
|
3199
|
-
y.id in u ? I[y.id] = u[y.id] : (I[y.id] = y.defaultWidth ??
|
|
3199
|
+
y.id in u ? I[y.id] = u[y.id] : (I[y.id] = y.defaultWidth ?? ye, R = !0);
|
|
3200
3200
|
return R ? I : u;
|
|
3201
3201
|
});
|
|
3202
3202
|
}, [n]);
|
|
3203
|
-
const h =
|
|
3203
|
+
const h = Le((u, I, R) => {
|
|
3204
3204
|
w((y) => {
|
|
3205
|
-
const D = y[u] ??
|
|
3205
|
+
const D = y[u] ?? ye, T = Math.max(R, D + I);
|
|
3206
3206
|
return T === D ? y : { ...y, [u]: T };
|
|
3207
3207
|
});
|
|
3208
|
-
}, []), b =
|
|
3208
|
+
}, []), b = Le((u) => {
|
|
3209
3209
|
if (a) {
|
|
3210
3210
|
if (!l || l.columnId !== u) {
|
|
3211
3211
|
a({ columnId: u, direction: "asc" });
|
|
@@ -3218,9 +3218,9 @@ const Wr = (t) => {
|
|
|
3218
3218
|
a(null);
|
|
3219
3219
|
}
|
|
3220
3220
|
}, [l, a]), p = n.reduce(
|
|
3221
|
-
(u, I) => u + (x[I.id] ?? I.defaultWidth ??
|
|
3221
|
+
(u, I) => u + (x[I.id] ?? I.defaultWidth ?? ye),
|
|
3222
3222
|
0
|
|
3223
|
-
), m =
|
|
3223
|
+
), m = Ce(null), v = (u) => {
|
|
3224
3224
|
m.current && (m.current.scrollLeft = u.currentTarget.scrollLeft);
|
|
3225
3225
|
};
|
|
3226
3226
|
return /* @__PURE__ */ d("div", { className: f("flex flex-col h-full w-full", i), children: [
|
|
@@ -3236,12 +3236,12 @@ const Wr = (t) => {
|
|
|
3236
3236
|
className: "flex flex-row table-header font-medium",
|
|
3237
3237
|
style: { width: p, minWidth: "100%" },
|
|
3238
3238
|
children: n.map((u) => /* @__PURE__ */ e(
|
|
3239
|
-
|
|
3239
|
+
Hr,
|
|
3240
3240
|
{
|
|
3241
3241
|
column: u,
|
|
3242
|
-
width: x[u.id] ?? u.defaultWidth ??
|
|
3242
|
+
width: x[u.id] ?? u.defaultWidth ?? ye,
|
|
3243
3243
|
height: g,
|
|
3244
|
-
onResize: (I) => h(u.id, I, u.minWidth ??
|
|
3244
|
+
onResize: (I) => h(u.id, I, u.minWidth ?? $r),
|
|
3245
3245
|
sortDirection: l?.columnId === u.id ? l.direction : null,
|
|
3246
3246
|
onSortClick: () => b(u.id)
|
|
3247
3247
|
},
|
|
@@ -3274,7 +3274,7 @@ const Wr = (t) => {
|
|
|
3274
3274
|
{
|
|
3275
3275
|
className: "shrink-0 content-center px-4 relative",
|
|
3276
3276
|
style: {
|
|
3277
|
-
width: x[R.id] ?? R.defaultWidth ??
|
|
3277
|
+
width: x[R.id] ?? R.defaultWidth ?? ye,
|
|
3278
3278
|
height: c
|
|
3279
3279
|
},
|
|
3280
3280
|
children: /* @__PURE__ */ e("div", { className: "break-all line-clamp-1", children: R.renderCell(u, I) })
|
|
@@ -3289,13 +3289,13 @@ const Wr = (t) => {
|
|
|
3289
3289
|
}
|
|
3290
3290
|
)
|
|
3291
3291
|
] });
|
|
3292
|
-
},
|
|
3292
|
+
}, It = (t) => {
|
|
3293
3293
|
const { label: n, children: o, className: s } = t;
|
|
3294
3294
|
return /* @__PURE__ */ d("div", { className: f("flex flex-col dropdown-button-group", s), children: [
|
|
3295
3295
|
n && /* @__PURE__ */ e("div", { className: "mb-2 text-sm dropdown-group-label font-semibold px-3", children: n }),
|
|
3296
3296
|
o
|
|
3297
3297
|
] });
|
|
3298
|
-
}, Xr = () => /* @__PURE__ */ e("div", {}),
|
|
3298
|
+
}, Xr = () => /* @__PURE__ */ e("div", {}), Vr = [
|
|
3299
3299
|
{ id: 1, email: "sarah.jennings@example.com", firstname: "Sarah", lastname: "Jennings", status: "active" },
|
|
3300
3300
|
{ id: 2, email: "liam.patel@outlook.com", firstname: "Liam", lastname: "Patel", status: "inactive" },
|
|
3301
3301
|
{ id: 3, email: "emily.wong@gmail.com", firstname: "Emily", lastname: "Wong", status: "active" },
|
|
@@ -3308,12 +3308,12 @@ const Wr = (t) => {
|
|
|
3308
3308
|
{ id: 10, email: "jackson.rivera@outlook.com", firstname: "Jackson", lastname: "Rivera", status: "active" },
|
|
3309
3309
|
{ id: 11, email: "ava.sanders@example.com", firstname: "Ava", lastname: "Sanders", status: "active" },
|
|
3310
3310
|
{ id: 12, email: "logan.bennett@company.io", firstname: "Logan", lastname: "Bennett", status: "inactive" }
|
|
3311
|
-
],
|
|
3311
|
+
], Kr = [
|
|
3312
3312
|
{ id: "id", header: "ID", renderCell: (t) => t.id },
|
|
3313
3313
|
{
|
|
3314
3314
|
id: "email",
|
|
3315
3315
|
header: "Email",
|
|
3316
|
-
renderCell: (t) => /* @__PURE__ */ e(
|
|
3316
|
+
renderCell: (t) => /* @__PURE__ */ e(Ee, { Icon: dn, onClick: () => {
|
|
3317
3317
|
}, children: t.email })
|
|
3318
3318
|
},
|
|
3319
3319
|
{ id: "firstname", header: "First Name", renderCell: (t) => t.firstname },
|
|
@@ -3321,36 +3321,36 @@ const Wr = (t) => {
|
|
|
3321
3321
|
{
|
|
3322
3322
|
id: "status",
|
|
3323
3323
|
header: "Status",
|
|
3324
|
-
renderCell: () => /* @__PURE__ */ e(
|
|
3324
|
+
renderCell: () => /* @__PURE__ */ e(Gr, {})
|
|
3325
3325
|
}
|
|
3326
|
-
],
|
|
3326
|
+
], Hl = () => /* @__PURE__ */ d("div", { className: "flex flex-col gap-6", children: [
|
|
3327
3327
|
/* @__PURE__ */ d("div", { className: "flex flex-row items-center justify-start gap-3", children: [
|
|
3328
|
-
/* @__PURE__ */ e(
|
|
3329
|
-
/* @__PURE__ */ e(
|
|
3330
|
-
/* @__PURE__ */ e(
|
|
3328
|
+
/* @__PURE__ */ e(At, { Icon: Me, placeholder: "Search..." }),
|
|
3329
|
+
/* @__PURE__ */ e(qe, { Icon: ft }),
|
|
3330
|
+
/* @__PURE__ */ e(Kn, { Icon: ht, children: "New" }),
|
|
3331
3331
|
/* @__PURE__ */ d(
|
|
3332
|
-
|
|
3332
|
+
Ue,
|
|
3333
3333
|
{
|
|
3334
|
-
trigger: /* @__PURE__ */ e(
|
|
3334
|
+
trigger: /* @__PURE__ */ e(qe, { Icon: ft }),
|
|
3335
3335
|
children: [
|
|
3336
|
-
/* @__PURE__ */ e(
|
|
3337
|
-
/* @__PURE__ */ e(
|
|
3338
|
-
/* @__PURE__ */ d(
|
|
3339
|
-
/* @__PURE__ */ e(
|
|
3340
|
-
/* @__PURE__ */ e(
|
|
3341
|
-
/* @__PURE__ */ e(
|
|
3342
|
-
/* @__PURE__ */ e(
|
|
3336
|
+
/* @__PURE__ */ e(X, { dismissOnClick: !1, Icon: ht, children: "Add new" }),
|
|
3337
|
+
/* @__PURE__ */ e(X, { Icon: cn, children: "Remove" }),
|
|
3338
|
+
/* @__PURE__ */ d(It, { label: "Test", className: "mt-2", children: [
|
|
3339
|
+
/* @__PURE__ */ e(X, { children: "Item 1" }),
|
|
3340
|
+
/* @__PURE__ */ e(X, { children: "Item 2" }),
|
|
3341
|
+
/* @__PURE__ */ e(X, { children: "Item 3" }),
|
|
3342
|
+
/* @__PURE__ */ e(X, { children: "Item 4" })
|
|
3343
3343
|
] }),
|
|
3344
|
-
/* @__PURE__ */ d(
|
|
3345
|
-
/* @__PURE__ */ e(
|
|
3346
|
-
/* @__PURE__ */ e(
|
|
3347
|
-
/* @__PURE__ */ e(
|
|
3348
|
-
/* @__PURE__ */ e(
|
|
3344
|
+
/* @__PURE__ */ d(It, { label: "Test", className: "mt-2", children: [
|
|
3345
|
+
/* @__PURE__ */ e(X, { children: "Item 1" }),
|
|
3346
|
+
/* @__PURE__ */ e(X, { children: "Item 2" }),
|
|
3347
|
+
/* @__PURE__ */ e(X, { children: "Item 3" }),
|
|
3348
|
+
/* @__PURE__ */ e(X, { children: "Item 4" })
|
|
3349
3349
|
] })
|
|
3350
3350
|
]
|
|
3351
3351
|
}
|
|
3352
3352
|
),
|
|
3353
|
-
/* @__PURE__ */ e(
|
|
3353
|
+
/* @__PURE__ */ e(Ur, { tabs: [
|
|
3354
3354
|
{
|
|
3355
3355
|
label: "Tab 1",
|
|
3356
3356
|
Icon: Ye,
|
|
@@ -3373,103 +3373,103 @@ const Wr = (t) => {
|
|
|
3373
3373
|
}
|
|
3374
3374
|
] })
|
|
3375
3375
|
] }),
|
|
3376
|
-
/* @__PURE__ */ e(
|
|
3376
|
+
/* @__PURE__ */ e(Pr, { options: [
|
|
3377
3377
|
{ label: "Option 1", value: 1 },
|
|
3378
3378
|
{ label: "Option 2", value: 2 },
|
|
3379
3379
|
{ label: "Option 3", value: 3 }
|
|
3380
3380
|
], value: null, onChange: () => {
|
|
3381
3381
|
} }),
|
|
3382
3382
|
/* @__PURE__ */ e(
|
|
3383
|
-
|
|
3383
|
+
jr,
|
|
3384
3384
|
{
|
|
3385
3385
|
className: "h-[300px] w-[300px]",
|
|
3386
|
-
columns:
|
|
3387
|
-
rows:
|
|
3386
|
+
columns: Kr,
|
|
3387
|
+
rows: Vr,
|
|
3388
3388
|
getRowId: (t) => t.id
|
|
3389
3389
|
}
|
|
3390
3390
|
),
|
|
3391
3391
|
/* @__PURE__ */ e(Xr, {})
|
|
3392
|
-
] }),
|
|
3393
|
-
|
|
3392
|
+
] }), Gr = () => /* @__PURE__ */ e(te, { children: /* @__PURE__ */ d(
|
|
3393
|
+
Ue,
|
|
3394
3394
|
{
|
|
3395
3395
|
placement: "bottom-end",
|
|
3396
3396
|
className: "inline-block",
|
|
3397
|
-
trigger: /* @__PURE__ */ e(
|
|
3397
|
+
trigger: /* @__PURE__ */ e(Ee, { onClick: () => {
|
|
3398
3398
|
}, children: "Test" }),
|
|
3399
3399
|
children: [
|
|
3400
|
-
/* @__PURE__ */ e(
|
|
3401
|
-
/* @__PURE__ */ e(
|
|
3402
|
-
/* @__PURE__ */ e(
|
|
3400
|
+
/* @__PURE__ */ e(X, { children: "Option 1" }),
|
|
3401
|
+
/* @__PURE__ */ e(X, { children: "Option 2" }),
|
|
3402
|
+
/* @__PURE__ */ e(X, { children: "Option 3" })
|
|
3403
3403
|
]
|
|
3404
3404
|
}
|
|
3405
3405
|
) });
|
|
3406
3406
|
export {
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3407
|
+
Wl as AutoScroll,
|
|
3408
|
+
Ee as Badge,
|
|
3409
|
+
Mr as BadgeColor,
|
|
3410
|
+
Kn as Button,
|
|
3411
|
+
Bt as ButtonIconRound,
|
|
3412
|
+
qe as ButtonIconSquare,
|
|
3413
|
+
Fl as Divider,
|
|
3414
|
+
X as DropdownButton,
|
|
3415
|
+
It as DropdownButtonGroup,
|
|
3416
|
+
Ue as DropdownMenu,
|
|
3417
|
+
xe as DropdownPanel,
|
|
3418
|
+
At as Input,
|
|
3419
|
+
yl as InputCheck,
|
|
3420
|
+
vl as InputColor,
|
|
3421
3421
|
V as InputDescription,
|
|
3422
3422
|
K as InputError,
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3423
|
+
re as InputErrorIcon,
|
|
3424
|
+
Il as InputFileMultiple,
|
|
3425
|
+
Cl as InputFileSingle,
|
|
3426
|
+
Z as InputIconButton,
|
|
3427
|
+
he as InputIconButtonTray,
|
|
3428
|
+
q as InputLabel,
|
|
3429
|
+
Sl as InputLexical,
|
|
3430
|
+
xl as InputPassword,
|
|
3431
|
+
Nl as InputRadio,
|
|
3432
|
+
Pr as InputSelect,
|
|
3433
|
+
$e as InputSelectDivider,
|
|
3434
|
+
He as InputSelectGroupHeader,
|
|
3435
|
+
Tl as InputSelectMultiple,
|
|
3436
|
+
Dl as InputSelectNative,
|
|
3437
|
+
We as InputSelectOption,
|
|
3438
|
+
Ol as InputSelectSearchable,
|
|
3439
|
+
zl as InputSelectSearchableAsync,
|
|
3440
|
+
wl as InputTextArea,
|
|
3441
|
+
kl as InputToggle,
|
|
3442
|
+
wr as LEXICAL_NODES,
|
|
3443
|
+
yr as LexicalBlockTypeSelect,
|
|
3444
|
+
Rl as LexicalDefaultToolbarContent,
|
|
3445
|
+
Lr as LexicalFloatingToolbar,
|
|
3446
|
+
Ir as LexicalFormatButtons,
|
|
3447
|
+
Dr as LexicalHistoryButtons,
|
|
3448
|
+
Sr as LexicalLinkButton,
|
|
3449
|
+
Rr as LexicalListButtons,
|
|
3450
|
+
Tr as LexicalToolbar,
|
|
3451
|
+
ce as LexicalToolbarButton,
|
|
3452
|
+
Je as LexicalToolbarDivider,
|
|
3453
|
+
jt as LexicalToolbarItems,
|
|
3454
|
+
Al as Modal,
|
|
3455
|
+
Ll as Panel,
|
|
3456
|
+
El as PanelField,
|
|
3457
|
+
Ml as PanelLink,
|
|
3458
|
+
Pl as PanelStack,
|
|
3459
|
+
Ut as PopoverBase,
|
|
3460
|
+
Ul as SidebarModal,
|
|
3461
|
+
Se as Spinner,
|
|
3462
|
+
Ur as TabButtons,
|
|
3463
|
+
jr as Table,
|
|
3464
|
+
Hr as TableColumnHead,
|
|
3465
|
+
Hl as Test,
|
|
3466
|
+
Bl as Tooltip,
|
|
3467
|
+
xr as UploadFileTile,
|
|
3468
3468
|
H as isSelectOption,
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3469
|
+
Nt as lexicalTheme,
|
|
3470
|
+
Ne as useLexicalToolbar,
|
|
3471
|
+
Ht as useLexicalToolbarState,
|
|
3472
|
+
dt as usePopover,
|
|
3473
3473
|
_e as useSelectPopover
|
|
3474
3474
|
};
|
|
3475
3475
|
//# sourceMappingURL=index.js.map
|