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