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