@matthiaskrijgsman/mat-ui 0.0.38 → 0.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1532 -1520
- 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,46 +1,46 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as d, Fragment as
|
|
3
|
-
import * as
|
|
4
|
-
import { createContext as Qe, useContext as Ze, useEffect as _, useState as W, useRef as Ce, useCallback as
|
|
5
|
-
import { AnimatePresence as De, motion as J, animate 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
|
|
2
|
+
import { jsx as e, jsxs as d, Fragment as ce } from "react/jsx-runtime";
|
|
3
|
+
import * as R from "react";
|
|
4
|
+
import { createContext as Qe, useContext as Ze, useEffect as _, useState as W, useRef as Ce, useCallback as Pe, useLayoutEffect as It, useMemo as se } from "react";
|
|
5
|
+
import { AnimatePresence as De, motion as J, animate as Kt } from "motion/react";
|
|
6
|
+
import { IconExclamationCircleFilled as et, IconEyeOff as Gt, IconEye as Jt, IconPaperclip as Yt, IconCircleCheckFilled as tt, IconX as de, IconCloudUpload as qt, IconCheck as Rt, IconChevronDown as be, IconBold as Qt, IconItalic as Zt, IconUnderline as en, IconList as Ye, 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 Ln, $isLinkNode 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 Pn } from "@lexical/list";
|
|
21
|
+
import { LinkNode as Ln, $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 Le, CAN_REDO_COMMAND as Fn, $getSelection as Pt, $isRangeSelection as Lt, $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:
|
|
34
|
+
speed: t = 1,
|
|
35
35
|
className: s
|
|
36
|
-
} =
|
|
36
|
+
} = n, l = 1 / t, r = 2 / t;
|
|
37
37
|
return /* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(
|
|
38
38
|
J.div,
|
|
39
39
|
{
|
|
40
40
|
role: "status",
|
|
41
|
-
className:
|
|
41
|
+
className: m("relative rounded-full", s),
|
|
42
42
|
animate: { rotate: 360 },
|
|
43
|
-
transition: { repeat: 1 / 0, ease: "linear", duration:
|
|
43
|
+
transition: { repeat: 1 / 0, ease: "linear", duration: l },
|
|
44
44
|
children: /* @__PURE__ */ e(
|
|
45
45
|
J.div,
|
|
46
46
|
{
|
|
@@ -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,11 +61,11 @@ 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)]"
|
|
@@ -73,23 +73,23 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
|
|
|
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,302 +97,302 @@ 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 = R.forwardRef((n, t) => {
|
|
134
134
|
const {
|
|
135
135
|
variant: s = "white",
|
|
136
|
-
size:
|
|
136
|
+
size: l = "md",
|
|
137
137
|
className: r,
|
|
138
|
-
children:
|
|
138
|
+
children: o,
|
|
139
139
|
loading: a = !1,
|
|
140
140
|
Icon: i,
|
|
141
141
|
IconRight: c,
|
|
142
|
-
...
|
|
143
|
-
} =
|
|
142
|
+
...f
|
|
143
|
+
} = n;
|
|
144
144
|
return /* @__PURE__ */ d(
|
|
145
145
|
"button",
|
|
146
146
|
{
|
|
147
|
-
ref:
|
|
148
|
-
className:
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
Y[
|
|
154
|
-
|
|
147
|
+
ref: t,
|
|
148
|
+
className: m(
|
|
149
|
+
Vn,
|
|
150
|
+
Kn[s],
|
|
151
|
+
te[l],
|
|
152
|
+
jn[l],
|
|
153
|
+
Y[l],
|
|
154
|
+
_n[l],
|
|
155
155
|
r
|
|
156
156
|
),
|
|
157
|
-
...
|
|
157
|
+
...f,
|
|
158
158
|
children: [
|
|
159
|
-
a && /* @__PURE__ */ e(Se, { className:
|
|
160
|
-
!a && /* @__PURE__ */ d(
|
|
161
|
-
i && /* @__PURE__ */ e(i, { className:
|
|
162
|
-
|
|
163
|
-
c && /* @__PURE__ */ e(c, { className:
|
|
159
|
+
a && /* @__PURE__ */ e(Se, { className: m(ae[l]) }),
|
|
160
|
+
!a && /* @__PURE__ */ d(ce, { children: [
|
|
161
|
+
i && /* @__PURE__ */ e(i, { className: m(ae[l], "-ml-1") }),
|
|
162
|
+
o,
|
|
163
|
+
c && /* @__PURE__ */ e(c, { className: m(ae[l], "-mr-1") })
|
|
164
164
|
] })
|
|
165
165
|
]
|
|
166
166
|
}
|
|
167
167
|
);
|
|
168
|
-
}),
|
|
168
|
+
}), Jn = `
|
|
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)]
|
|
172
172
|
cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-4
|
|
173
173
|
disabled:cursor-default
|
|
174
|
-
`,
|
|
174
|
+
`, Yn = {
|
|
175
175
|
primary: "border button-primary shadow-sm",
|
|
176
176
|
secondary: "border button-secondary shadow-sm",
|
|
177
177
|
tertiary: "border button-tertiary",
|
|
178
178
|
white: "border button-white shadow-sm",
|
|
179
179
|
black: "border button-black shadow-sm",
|
|
180
180
|
transparent: "border button-transparent"
|
|
181
|
-
}, qe =
|
|
181
|
+
}, qe = R.forwardRef((n, t) => {
|
|
182
182
|
const {
|
|
183
183
|
variant: s = "white",
|
|
184
|
-
size:
|
|
184
|
+
size: l = "md",
|
|
185
185
|
className: r,
|
|
186
|
-
Icon:
|
|
186
|
+
Icon: o,
|
|
187
187
|
...a
|
|
188
|
-
} =
|
|
188
|
+
} = n;
|
|
189
189
|
return /* @__PURE__ */ e(
|
|
190
190
|
"button",
|
|
191
191
|
{
|
|
192
|
-
ref:
|
|
193
|
-
className:
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
192
|
+
ref: t,
|
|
193
|
+
className: m(
|
|
194
|
+
Jn,
|
|
195
|
+
Yn[s],
|
|
196
|
+
At[l],
|
|
197
197
|
r
|
|
198
198
|
),
|
|
199
199
|
...a,
|
|
200
|
-
children: /* @__PURE__ */ e(
|
|
200
|
+
children: /* @__PURE__ */ e(o, { className: ae[l] })
|
|
201
201
|
}
|
|
202
202
|
);
|
|
203
|
-
}),
|
|
203
|
+
}), qn = `
|
|
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 = R.forwardRef((n, t) => {
|
|
215
215
|
const {
|
|
216
216
|
variant: s = "white",
|
|
217
|
-
size:
|
|
217
|
+
size: l = "md",
|
|
218
218
|
className: r,
|
|
219
|
-
Icon:
|
|
219
|
+
Icon: o,
|
|
220
220
|
...a
|
|
221
|
-
} =
|
|
221
|
+
} = n;
|
|
222
222
|
return /* @__PURE__ */ e(
|
|
223
223
|
"button",
|
|
224
224
|
{
|
|
225
|
-
ref:
|
|
226
|
-
className:
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
225
|
+
ref: t,
|
|
226
|
+
className: m(
|
|
227
|
+
qn,
|
|
228
|
+
Qn[s],
|
|
229
|
+
At[l],
|
|
230
230
|
r
|
|
231
231
|
),
|
|
232
232
|
...a,
|
|
233
|
-
children: /* @__PURE__ */ e(
|
|
233
|
+
children: /* @__PURE__ */ e(o, { className: ae[l] })
|
|
234
234
|
}
|
|
235
235
|
);
|
|
236
|
-
}), q = (
|
|
236
|
+
}), q = (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 = R.forwardRef((n, t) => {
|
|
242
242
|
const {
|
|
243
243
|
children: s,
|
|
244
|
-
className:
|
|
245
|
-
} =
|
|
244
|
+
className: l
|
|
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
|
+
l
|
|
254
254
|
),
|
|
255
255
|
children: s
|
|
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:
|
|
270
|
+
className: t,
|
|
271
271
|
label: s,
|
|
272
|
-
description:
|
|
272
|
+
description: l,
|
|
273
273
|
Icon: r,
|
|
274
|
-
error:
|
|
274
|
+
error: o,
|
|
275
275
|
buttonTray: a,
|
|
276
276
|
size: i = "md",
|
|
277
277
|
...c
|
|
278
|
-
} =
|
|
278
|
+
} = n, f = !!o || !!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
287
|
/* @__PURE__ */ e(q, { children: s }),
|
|
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
|
-
|
|
299
|
+
te[i],
|
|
300
300
|
Y[i],
|
|
301
|
-
r ?
|
|
302
|
-
|
|
303
|
-
|
|
301
|
+
r ? Mt[i] : me[i],
|
|
302
|
+
f ? fe[i] : it[i],
|
|
303
|
+
o && "input-error"
|
|
304
304
|
),
|
|
305
305
|
...c
|
|
306
306
|
}
|
|
307
307
|
),
|
|
308
|
-
/* @__PURE__ */ d(
|
|
309
|
-
|
|
308
|
+
/* @__PURE__ */ d(he, { children: [
|
|
309
|
+
o && /* @__PURE__ */ e(ne, {}),
|
|
310
310
|
a
|
|
311
311
|
] })
|
|
312
312
|
] }),
|
|
313
|
-
/* @__PURE__ */ e(V, { children:
|
|
314
|
-
/* @__PURE__ */ e(K, { children:
|
|
313
|
+
/* @__PURE__ */ e(V, { children: l }),
|
|
314
|
+
/* @__PURE__ */ e(K, { children: o })
|
|
315
315
|
]
|
|
316
316
|
}
|
|
317
317
|
) });
|
|
318
|
-
},
|
|
319
|
-
const
|
|
320
|
-
if (!
|
|
321
|
-
const s = parseInt(
|
|
318
|
+
}, er = (n) => {
|
|
319
|
+
const t = n.match(/^#?([0-9a-fA-F]{6})$/);
|
|
320
|
+
if (!t) return null;
|
|
321
|
+
const s = parseInt(t[1], 16);
|
|
322
322
|
return [(s >> 16 & 255) / 255, (s >> 8 & 255) / 255, (s & 255) / 255];
|
|
323
|
-
},
|
|
324
|
-
const
|
|
325
|
-
return "#" +
|
|
326
|
-
},
|
|
327
|
-
const
|
|
323
|
+
}, tr = (n, t, s) => {
|
|
324
|
+
const l = (r) => Math.round(r * 255).toString(16).padStart(2, "0").toUpperCase();
|
|
325
|
+
return "#" + l(n) + l(t) + l(s);
|
|
326
|
+
}, nr = (n, t, s) => {
|
|
327
|
+
const l = Math.max(n, t, s), r = Math.min(n, t, s), o = l - r;
|
|
328
328
|
let a = 0;
|
|
329
|
-
return
|
|
330
|
-
},
|
|
331
|
-
const
|
|
329
|
+
return o !== 0 && (l === n ? a = ((t - s) / o + 6) % 6 : l === t ? a = (s - n) / o + 2 : a = (n - t) / o + 4, a *= 60), [a, l === 0 ? 0 : o / l, l];
|
|
330
|
+
}, rr = (n, t, s) => {
|
|
331
|
+
const l = s * t, r = n / 60, o = l * (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 s =
|
|
333
|
+
r < 1 ? (a = l, i = o) : r < 2 ? (a = o, i = l) : r < 3 ? (i = l, c = o) : r < 4 ? (i = o, c = l) : r < 5 ? (a = o, c = l) : (a = l, c = o);
|
|
334
|
+
const f = s - l;
|
|
335
|
+
return [a + f, i + f, c + f];
|
|
336
|
+
}, Re = (n, t, s) => {
|
|
337
|
+
const [l, r, o] = rr(n, t, s);
|
|
338
|
+
return tr(l, r, o);
|
|
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 s = t.match(/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);
|
|
346
346
|
if (s) {
|
|
347
347
|
let a = s[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(
|
|
356
|
-
const
|
|
357
|
-
return
|
|
358
|
-
}, Xe = (
|
|
359
|
-
const
|
|
360
|
-
|
|
351
|
+
const l = document.createElement("div");
|
|
352
|
+
if (l.style.color = t, !l.style.color) return null;
|
|
353
|
+
document.body.appendChild(l);
|
|
354
|
+
const r = getComputedStyle(l).color;
|
|
355
|
+
document.body.removeChild(l);
|
|
356
|
+
const o = r.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
|
|
357
|
+
return o ? "#" + [o[1], o[2], o[3]].map((a) => parseInt(a, 10).toString(16).padStart(2, "0")).join("").toUpperCase() : null;
|
|
358
|
+
}, Xe = (n) => {
|
|
359
|
+
const t = R.useRef(null), [s, l] = R.useState(!1), r = (o) => {
|
|
360
|
+
t.current = null, l(!1), o.currentTarget.releasePointerCapture?.(o.pointerId);
|
|
361
361
|
};
|
|
362
362
|
return {
|
|
363
363
|
isDragging: s,
|
|
364
364
|
bind: {
|
|
365
|
-
onPointerDown: (
|
|
366
|
-
const a =
|
|
367
|
-
|
|
365
|
+
onPointerDown: (o) => {
|
|
366
|
+
const a = o.currentTarget;
|
|
367
|
+
t.current = a.getBoundingClientRect(), a.setPointerCapture?.(o.pointerId), l(!0), n(o.clientX, o.clientY, t.current);
|
|
368
368
|
},
|
|
369
|
-
onPointerMove: (
|
|
370
|
-
|
|
369
|
+
onPointerMove: (o) => {
|
|
370
|
+
t.current && n(o.clientX, o.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:
|
|
382
|
+
className: t,
|
|
383
383
|
children: s,
|
|
384
|
-
padding:
|
|
384
|
+
padding: l = "md",
|
|
385
385
|
...r
|
|
386
|
-
} =
|
|
386
|
+
} = n;
|
|
387
387
|
return /* @__PURE__ */ e(
|
|
388
388
|
"div",
|
|
389
389
|
{
|
|
390
|
-
className:
|
|
390
|
+
className: m(or, sr[l], t),
|
|
391
391
|
...r,
|
|
392
392
|
children: s
|
|
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 = R.memo(
|
|
409
|
+
({ open: n, children: t, className: s, floatingStyles: l, setFloating: r, placement: o, floatingProps: a }) => /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ e(De, { children: n && /* @__PURE__ */ e("div", { ref: r, style: l, className: "z-50", ...a, children: /* @__PURE__ */ e(
|
|
410
|
+
J.div,
|
|
411
|
+
{
|
|
412
|
+
className: s,
|
|
413
|
+
style: { transformOrigin: ar[o] },
|
|
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: s, onOpenChange: l, fullWidth: r, minWidth: o, maxWidth: a } = n, i = R.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: b, elements: C }) {
|
|
427
|
+
r && (C.floating.style.width = `${b.reference.width}px`), o && (C.floating.style.minWidth = `${o}px`), a && (C.floating.style.maxWidth = `${a}px`);
|
|
431
428
|
}
|
|
432
429
|
})
|
|
433
|
-
], [
|
|
434
|
-
placement:
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
430
|
+
], [r, a, o]), { refs: c, floatingStyles: f, context: w, placement: x } = st({
|
|
431
|
+
placement: t,
|
|
432
|
+
open: s,
|
|
433
|
+
onOpenChange: l,
|
|
434
|
+
middleware: i,
|
|
435
|
+
whileElementsMounted: at
|
|
436
|
+
}), h = St(w, {
|
|
437
|
+
enabled: !!l,
|
|
438
|
+
outsidePress: !0,
|
|
439
|
+
escapeKey: !1
|
|
440
|
+
}), { getFloatingProps: g } = Dt([h]), p = R.useRef({
|
|
441
|
+
floatingStyles: f,
|
|
442
|
+
setFloating: c.setFloating,
|
|
443
|
+
placement: t,
|
|
444
|
+
getFloatingProps: g
|
|
442
445
|
});
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
446
|
+
p.current = {
|
|
447
|
+
floatingStyles: f,
|
|
448
|
+
setFloating: c.setFloating,
|
|
449
|
+
placement: x,
|
|
450
|
+
getFloatingProps: g
|
|
448
451
|
};
|
|
449
|
-
const
|
|
450
|
-
const
|
|
451
|
-
const { floatingStyles:
|
|
452
|
+
const u = R.useMemo(() => {
|
|
453
|
+
const b = (C) => {
|
|
454
|
+
const { floatingStyles: v, setFloating: k, placement: I, getFloatingProps: D } = p.current, { className: O, open: P, children: L } = C;
|
|
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: v,
|
|
461
|
+
setFloating: k,
|
|
462
|
+
placement: I,
|
|
463
|
+
floatingProps: D(),
|
|
464
|
+
children: L
|
|
462
465
|
}
|
|
463
466
|
);
|
|
464
467
|
};
|
|
465
|
-
return
|
|
468
|
+
return R.memo(b);
|
|
466
469
|
}, []);
|
|
467
470
|
return {
|
|
468
|
-
anchorRef:
|
|
469
|
-
Popover:
|
|
471
|
+
anchorRef: c.setReference,
|
|
472
|
+
Popover: u
|
|
470
473
|
};
|
|
471
|
-
},
|
|
474
|
+
}, xe = (n, t) => {
|
|
472
475
|
_(() => {
|
|
473
|
-
if (!
|
|
474
|
-
const s = (
|
|
475
|
-
|
|
476
|
+
if (!n) return;
|
|
477
|
+
const s = (l) => {
|
|
478
|
+
l.key === "Escape" && t();
|
|
476
479
|
};
|
|
477
480
|
return document.addEventListener("keydown", s), () => {
|
|
478
481
|
document.removeEventListener("keydown", s);
|
|
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, s = t / 2;
|
|
483
486
|
return {
|
|
484
|
-
width:
|
|
485
|
-
height:
|
|
487
|
+
width: t,
|
|
488
|
+
height: t,
|
|
486
489
|
marginLeft: -s,
|
|
487
490
|
marginTop: -s,
|
|
488
|
-
borderRadius:
|
|
491
|
+
borderRadius: n ? hr : fr
|
|
489
492
|
};
|
|
490
|
-
}, Te = (
|
|
491
|
-
Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(
|
|
492
|
-
},
|
|
493
|
-
const [s,
|
|
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 [s, l] = W(() => vt(n) ?? [0, 0, 1]), r = Ce(Re(s[0], s[1], s[2]));
|
|
494
497
|
_(() => {
|
|
495
|
-
if ((
|
|
496
|
-
const
|
|
497
|
-
|
|
498
|
-
}, [
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
const
|
|
502
|
-
r.current =
|
|
503
|
-
}, [a, i, c] = s,
|
|
504
|
-
|
|
505
|
-
}),
|
|
506
|
-
|
|
507
|
-
}), p = Xe((
|
|
508
|
-
|
|
498
|
+
if ((n || "").toUpperCase() === r.current) return;
|
|
499
|
+
const u = vt(n);
|
|
500
|
+
u && l(u);
|
|
501
|
+
}, [n]);
|
|
502
|
+
const o = (u) => {
|
|
503
|
+
l(u);
|
|
504
|
+
const b = Re(u[0], u[1], u[2]);
|
|
505
|
+
r.current = b, t(b);
|
|
506
|
+
}, [a, i, c] = s, f = Re(a, 1, 1), w = Re(a, i, 1), x = Re(a, i, c), h = Xe((u, b, C) => {
|
|
507
|
+
o([a, Te((u - C.left) / C.width), 1 - Te((b - C.top) / C.height)]);
|
|
508
|
+
}), g = Xe((u, b, C) => {
|
|
509
|
+
o([Te((u - C.left) / C.width) * 360, i, c]);
|
|
510
|
+
}), p = Xe((u, b, C) => {
|
|
511
|
+
o([a, i, Te((u - C.left) / C.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: (u) => u.preventDefault(),
|
|
516
519
|
children: [
|
|
517
520
|
/* @__PURE__ */ d(
|
|
518
521
|
"div",
|
|
@@ -529,20 +532,20 @@ 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: f },
|
|
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
|
]
|
|
@@ -556,10 +559,10 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
|
|
|
556
559
|
left: `${i * 100}%`,
|
|
557
560
|
top: `${(1 - c) * 100}%`,
|
|
558
561
|
boxShadow: Ve,
|
|
559
|
-
backgroundColor:
|
|
562
|
+
backgroundColor: x
|
|
560
563
|
},
|
|
561
|
-
initial:
|
|
562
|
-
animate:
|
|
564
|
+
initial: ye(!1),
|
|
565
|
+
animate: ye(h.isDragging),
|
|
563
566
|
transition: Ke
|
|
564
567
|
}
|
|
565
568
|
)
|
|
@@ -572,11 +575,11 @@ 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
|
+
...g.bind,
|
|
580
583
|
children: /* @__PURE__ */ e(
|
|
581
584
|
J.div,
|
|
582
585
|
{
|
|
@@ -584,11 +587,11 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
|
|
|
584
587
|
style: {
|
|
585
588
|
top: "50%",
|
|
586
589
|
left: `${a / 360 * 100}%`,
|
|
587
|
-
backgroundColor:
|
|
590
|
+
backgroundColor: f,
|
|
588
591
|
boxShadow: Ve
|
|
589
592
|
},
|
|
590
|
-
initial:
|
|
591
|
-
animate:
|
|
593
|
+
initial: ye(!1),
|
|
594
|
+
animate: ye(g.isDragging),
|
|
592
595
|
transition: Ke
|
|
593
596
|
}
|
|
594
597
|
)
|
|
@@ -600,7 +603,7 @@ 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, ${w})`,
|
|
604
607
|
touchAction: "none",
|
|
605
608
|
cursor: "ew-resize"
|
|
606
609
|
},
|
|
@@ -612,11 +615,11 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
|
|
|
612
615
|
style: {
|
|
613
616
|
top: "50%",
|
|
614
617
|
left: `${c * 100}%`,
|
|
615
|
-
backgroundColor:
|
|
618
|
+
backgroundColor: x,
|
|
616
619
|
boxShadow: Ve
|
|
617
620
|
},
|
|
618
|
-
initial:
|
|
619
|
-
animate:
|
|
621
|
+
initial: ye(!1),
|
|
622
|
+
animate: ye(p.isDragging),
|
|
620
623
|
transition: Ke
|
|
621
624
|
}
|
|
622
625
|
)
|
|
@@ -625,160 +628,161 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
|
|
|
625
628
|
]
|
|
626
629
|
}
|
|
627
630
|
);
|
|
628
|
-
},
|
|
631
|
+
}, xl = (n) => {
|
|
629
632
|
const {
|
|
630
|
-
className:
|
|
633
|
+
className: t,
|
|
631
634
|
label: s,
|
|
632
|
-
description:
|
|
635
|
+
description: l,
|
|
633
636
|
error: r,
|
|
634
|
-
buttonTray:
|
|
637
|
+
buttonTray: o,
|
|
635
638
|
size: a = "md",
|
|
636
639
|
value: i,
|
|
637
640
|
defaultValue: c,
|
|
638
|
-
onChange:
|
|
639
|
-
onBlur:
|
|
640
|
-
onFocus:
|
|
641
|
+
onChange: f,
|
|
642
|
+
onBlur: w,
|
|
643
|
+
onFocus: x,
|
|
641
644
|
...h
|
|
642
|
-
} =
|
|
645
|
+
} = n, [g, p] = W(
|
|
643
646
|
i != null ? String(i) : c != null ? String(c) : ""
|
|
644
|
-
), [
|
|
645
|
-
|
|
646
|
-
const { anchorRef:
|
|
647
|
+
), [u, b] = W(!1), C = Ce(null), v = i != null ? String(i) : g, k = v || "white";
|
|
648
|
+
xe(u, () => b(!1));
|
|
649
|
+
const { anchorRef: I, Popover: D } = ct({
|
|
647
650
|
placement: "bottom-start",
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
651
|
+
open: u,
|
|
652
|
+
onOpenChange: b
|
|
653
|
+
}), O = (y) => {
|
|
654
|
+
p(y.target.value), f?.(y);
|
|
655
|
+
}, P = (y) => {
|
|
656
|
+
b(!0), x?.(y);
|
|
657
|
+
}, L = (y) => {
|
|
658
|
+
const A = y.target.value, z = lr(A);
|
|
659
|
+
z && z !== A && C.current && xt(C.current, z), b(!1), w?.(y);
|
|
660
|
+
}, T = (y) => {
|
|
661
|
+
C.current && xt(C.current, y);
|
|
662
|
+
}, N = !!r || !!o;
|
|
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
671
|
/* @__PURE__ */ e(q, { children: s }),
|
|
668
|
-
/* @__PURE__ */ d("div", { className: "flex flex-col relative", ref:
|
|
672
|
+
/* @__PURE__ */ d("div", { className: "flex flex-col relative", ref: I, 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: k }
|
|
678
682
|
}
|
|
679
683
|
),
|
|
680
684
|
/* @__PURE__ */ e(
|
|
681
685
|
"input",
|
|
682
686
|
{
|
|
683
|
-
ref:
|
|
684
|
-
className:
|
|
687
|
+
ref: C,
|
|
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
|
-
|
|
690
|
+
te[a],
|
|
687
691
|
Y[a],
|
|
688
|
-
|
|
689
|
-
N ?
|
|
692
|
+
Mt[a],
|
|
693
|
+
N ? 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 ?? g,
|
|
697
|
+
onChange: O,
|
|
698
|
+
onFocus: P,
|
|
699
|
+
onBlur: L,
|
|
700
|
+
onClick: () => b(!0),
|
|
697
701
|
...h
|
|
698
702
|
}
|
|
699
703
|
),
|
|
700
|
-
/* @__PURE__ */ d(
|
|
701
|
-
r && /* @__PURE__ */ e(
|
|
702
|
-
|
|
704
|
+
/* @__PURE__ */ d(he, { children: [
|
|
705
|
+
r && /* @__PURE__ */ e(ne, {}),
|
|
706
|
+
o
|
|
703
707
|
] }),
|
|
704
|
-
/* @__PURE__ */ e(D, { open:
|
|
708
|
+
/* @__PURE__ */ e(D, { open: u, children: /* @__PURE__ */ e(ve, { padding: "md", children: /* @__PURE__ */ e(pr, { value: v, onChange: T }) }) })
|
|
705
709
|
] }),
|
|
706
|
-
/* @__PURE__ */ e(V, { children:
|
|
710
|
+
/* @__PURE__ */ e(V, { children: l }),
|
|
707
711
|
/* @__PURE__ */ e(K, { children: r })
|
|
708
712
|
]
|
|
709
713
|
}
|
|
710
714
|
) });
|
|
711
|
-
}, Z = (
|
|
715
|
+
}, Z = (n) => {
|
|
712
716
|
const {
|
|
713
|
-
onClick:
|
|
717
|
+
onClick: t,
|
|
714
718
|
Icon: s
|
|
715
|
-
} =
|
|
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(s, { className:
|
|
728
|
+
children: /* @__PURE__ */ e(s, { 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:
|
|
733
|
+
type: t = "password",
|
|
730
734
|
enableShowPasswordToggle: s = !0,
|
|
731
|
-
...
|
|
732
|
-
} =
|
|
735
|
+
...l
|
|
736
|
+
} = n, [r, o] = W(!1);
|
|
733
737
|
return /* @__PURE__ */ e(
|
|
734
|
-
|
|
738
|
+
Wt,
|
|
735
739
|
{
|
|
736
|
-
type: r ? "text" :
|
|
737
|
-
buttonTray: s ? /* @__PURE__ */ e(Z, { Icon: r ?
|
|
738
|
-
|
|
740
|
+
type: r ? "text" : t,
|
|
741
|
+
buttonTray: s ? /* @__PURE__ */ e(Z, { Icon: r ? Gt : Jt, onClick: () => {
|
|
742
|
+
o(!r);
|
|
739
743
|
} }) : void 0,
|
|
740
|
-
...
|
|
744
|
+
...l
|
|
741
745
|
}
|
|
742
746
|
);
|
|
743
|
-
},
|
|
747
|
+
}, Nl = (n) => {
|
|
744
748
|
const {
|
|
745
|
-
className:
|
|
749
|
+
className: t,
|
|
746
750
|
label: s,
|
|
747
|
-
description:
|
|
751
|
+
description: l,
|
|
748
752
|
error: r,
|
|
749
|
-
size:
|
|
753
|
+
size: o = "md",
|
|
750
754
|
autogrow: a = !1,
|
|
751
755
|
maxRows: i,
|
|
752
756
|
ref: c,
|
|
753
|
-
onChange:
|
|
754
|
-
...
|
|
755
|
-
} =
|
|
756
|
-
const p =
|
|
757
|
+
onChange: f,
|
|
758
|
+
...w
|
|
759
|
+
} = n, x = R.useRef(null), h = R.useCallback(() => {
|
|
760
|
+
const p = x.current;
|
|
757
761
|
if (!p) return;
|
|
758
762
|
p.style.height = "auto";
|
|
759
|
-
let
|
|
763
|
+
let u = p.scrollHeight;
|
|
760
764
|
if (i) {
|
|
761
|
-
const
|
|
762
|
-
|
|
765
|
+
const b = window.getComputedStyle(p), C = parseFloat(b.lineHeight), v = parseFloat(b.paddingTop), k = parseFloat(b.paddingBottom), I = parseFloat(b.borderTopWidth), D = parseFloat(b.borderBottomWidth), O = C * i + v + k + I + D;
|
|
766
|
+
u = Math.min(p.scrollHeight, O);
|
|
763
767
|
}
|
|
764
|
-
p.style.height = `${
|
|
768
|
+
p.style.height = `${u}px`;
|
|
765
769
|
}, [i]);
|
|
766
|
-
|
|
770
|
+
R.useLayoutEffect(() => {
|
|
767
771
|
if (!a) {
|
|
768
|
-
|
|
772
|
+
x.current && (x.current.style.height = "");
|
|
769
773
|
return;
|
|
770
774
|
}
|
|
771
775
|
h();
|
|
772
|
-
}, [a, h,
|
|
773
|
-
const
|
|
774
|
-
|
|
776
|
+
}, [a, h, n.value, n.defaultValue, o]);
|
|
777
|
+
const g = (p) => {
|
|
778
|
+
f?.(p), a && h();
|
|
775
779
|
};
|
|
776
|
-
return /* @__PURE__ */ e(Q.Provider, { value:
|
|
780
|
+
return /* @__PURE__ */ e(Q.Provider, { value: o, 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
788
|
/* @__PURE__ */ e(q, { children: s }),
|
|
@@ -786,41 +790,41 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
|
|
|
786
790
|
/* @__PURE__ */ e(
|
|
787
791
|
"textarea",
|
|
788
792
|
{
|
|
789
|
-
ref: c ?
|
|
790
|
-
onChange:
|
|
791
|
-
className:
|
|
793
|
+
ref: c ? pn([c, x]) : x,
|
|
794
|
+
onChange: g,
|
|
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
|
-
Y[
|
|
795
|
-
|
|
796
|
-
r ?
|
|
797
|
+
Ft[o],
|
|
798
|
+
Y[o],
|
|
799
|
+
me[o],
|
|
800
|
+
r ? fe[o] : it[o],
|
|
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
|
+
...w
|
|
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: l }),
|
|
806
810
|
/* @__PURE__ */ e(K, { children: r })
|
|
807
811
|
]
|
|
808
812
|
}
|
|
809
813
|
) });
|
|
810
|
-
},
|
|
814
|
+
}, yl = (n) => {
|
|
811
815
|
const {
|
|
812
|
-
className:
|
|
816
|
+
className: t,
|
|
813
817
|
label: s,
|
|
814
|
-
description:
|
|
818
|
+
description: l,
|
|
815
819
|
error: r,
|
|
816
|
-
...
|
|
817
|
-
} =
|
|
820
|
+
...o
|
|
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: [
|
|
@@ -829,33 +833,33 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
|
|
|
829
833
|
{
|
|
830
834
|
type: "radio",
|
|
831
835
|
className: "h-6 w-6 shrink-0 rounded-full border check-base shadow-sm ring-0 hover:ring-4 focus:ring-4 ring-offset-0 focus:outline-0 transition-all duration-150",
|
|
832
|
-
...
|
|
836
|
+
...o
|
|
833
837
|
}
|
|
834
838
|
),
|
|
835
|
-
s && /* @__PURE__ */ e("label", { htmlFor:
|
|
839
|
+
s && /* @__PURE__ */ e("label", { htmlFor: n.id, className: m(
|
|
836
840
|
"input-label font-medium mb-1",
|
|
837
|
-
|
|
841
|
+
n.id && "cursor-pointer"
|
|
838
842
|
), children: s })
|
|
839
843
|
] }),
|
|
840
|
-
/* @__PURE__ */ e(V, { children:
|
|
844
|
+
/* @__PURE__ */ e(V, { children: l }),
|
|
841
845
|
/* @__PURE__ */ e(K, { children: r })
|
|
842
846
|
]
|
|
843
847
|
}
|
|
844
848
|
);
|
|
845
|
-
}, kl = (
|
|
849
|
+
}, kl = (n) => {
|
|
846
850
|
const {
|
|
847
|
-
className:
|
|
851
|
+
className: t,
|
|
848
852
|
label: s,
|
|
849
|
-
description:
|
|
853
|
+
description: l,
|
|
850
854
|
error: r,
|
|
851
|
-
...
|
|
852
|
-
} =
|
|
855
|
+
...o
|
|
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: [
|
|
@@ -865,41 +869,41 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
|
|
|
865
869
|
{
|
|
866
870
|
type: "checkbox",
|
|
867
871
|
className: "appearance-none absolute inset-0 h-6 w-10 rounded-full checked:bg-transparent border-0 toggle-input ring-0 hover:ring-4 focus:ring-4 ring-offset-0 focus:outline-0 transition-all duration-150",
|
|
868
|
-
...
|
|
872
|
+
...o
|
|
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
|
-
s && /* @__PURE__ */ e("label", { htmlFor:
|
|
883
|
+
s && /* @__PURE__ */ e("label", { htmlFor: n.id, className: m(
|
|
880
884
|
"input-label font-medium mb-1",
|
|
881
|
-
|
|
885
|
+
n.id && "cursor-pointer"
|
|
882
886
|
), children: s })
|
|
883
887
|
] }),
|
|
884
|
-
/* @__PURE__ */ e(V, { children:
|
|
888
|
+
/* @__PURE__ */ e(V, { children: l }),
|
|
885
889
|
/* @__PURE__ */ e(K, { children: r })
|
|
886
890
|
]
|
|
887
891
|
}
|
|
888
892
|
);
|
|
889
|
-
},
|
|
893
|
+
}, Cl = (n) => {
|
|
890
894
|
const {
|
|
891
|
-
className:
|
|
895
|
+
className: t,
|
|
892
896
|
label: s,
|
|
893
|
-
description:
|
|
897
|
+
description: l,
|
|
894
898
|
error: r,
|
|
895
|
-
...
|
|
896
|
-
} =
|
|
899
|
+
...o
|
|
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: [
|
|
@@ -908,144 +912,144 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
|
|
|
908
912
|
{
|
|
909
913
|
type: "checkbox",
|
|
910
914
|
className: "h-6 w-6 shrink-0 rounded-lg border check-base shadow-sm ring-0 hover:ring-4 focus:ring-4 ring-offset-0 focus:outline-0 transition-all duration-150",
|
|
911
|
-
...
|
|
915
|
+
...o
|
|
912
916
|
}
|
|
913
917
|
),
|
|
914
|
-
s && /* @__PURE__ */ e("label", { htmlFor:
|
|
918
|
+
s && /* @__PURE__ */ e("label", { htmlFor: n.id, className: m(
|
|
915
919
|
"input-label font-medium mb-1",
|
|
916
|
-
|
|
920
|
+
n.id && "cursor-pointer"
|
|
917
921
|
), children: s })
|
|
918
922
|
] }),
|
|
919
|
-
/* @__PURE__ */ e(V, { children:
|
|
923
|
+
/* @__PURE__ */ e(V, { children: l }),
|
|
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:
|
|
942
|
+
label: t,
|
|
939
943
|
description: s,
|
|
940
|
-
error:
|
|
944
|
+
error: l,
|
|
941
945
|
placeholder: r = "No file chosen",
|
|
942
|
-
buttonText:
|
|
943
|
-
Icon: a =
|
|
946
|
+
buttonText: o = "Choose",
|
|
947
|
+
Icon: a = Yt,
|
|
944
948
|
size: i = "md",
|
|
945
949
|
value: c,
|
|
946
|
-
isUploaded:
|
|
947
|
-
isUploading:
|
|
948
|
-
onChange:
|
|
950
|
+
isUploaded: f = !1,
|
|
951
|
+
isUploading: w = !1,
|
|
952
|
+
onChange: x,
|
|
949
953
|
onDropRejected: h,
|
|
950
|
-
accept:
|
|
954
|
+
accept: g,
|
|
951
955
|
maxSize: p,
|
|
952
|
-
minSize:
|
|
953
|
-
disabled:
|
|
954
|
-
className:
|
|
955
|
-
} =
|
|
956
|
-
const [N] =
|
|
957
|
-
N && await
|
|
956
|
+
minSize: u,
|
|
957
|
+
disabled: b = !1,
|
|
958
|
+
className: C
|
|
959
|
+
} = n, v = async (T) => {
|
|
960
|
+
const [N] = T;
|
|
961
|
+
N && await x?.(N);
|
|
958
962
|
}, {
|
|
959
|
-
getRootProps:
|
|
960
|
-
getInputProps:
|
|
963
|
+
getRootProps: k,
|
|
964
|
+
getInputProps: I,
|
|
961
965
|
open: D,
|
|
962
|
-
isDragActive:
|
|
963
|
-
isFocused:
|
|
964
|
-
} =
|
|
966
|
+
isDragActive: O,
|
|
967
|
+
isFocused: P
|
|
968
|
+
} = zt({
|
|
965
969
|
multiple: !1,
|
|
966
|
-
accept:
|
|
970
|
+
accept: g,
|
|
967
971
|
maxSize: p,
|
|
968
|
-
minSize:
|
|
969
|
-
disabled:
|
|
970
|
-
onDrop:
|
|
972
|
+
minSize: u,
|
|
973
|
+
disabled: b,
|
|
974
|
+
onDrop: v,
|
|
971
975
|
onDropRejected: h
|
|
972
|
-
}),
|
|
973
|
-
return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className:
|
|
974
|
-
/* @__PURE__ */ e(q, { children:
|
|
976
|
+
}), L = c?.name;
|
|
977
|
+
return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className: m("flex flex-col", C), children: [
|
|
978
|
+
/* @__PURE__ */ e(q, { children: t }),
|
|
975
979
|
/* @__PURE__ */ d(
|
|
976
980
|
"div",
|
|
977
981
|
{
|
|
978
|
-
...
|
|
979
|
-
className:
|
|
982
|
+
...k({
|
|
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
|
+
l && "input-error",
|
|
989
|
+
b && "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", { ...I() }),
|
|
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
1003
|
Y[i],
|
|
1000
|
-
!
|
|
1004
|
+
!L && "text-[var(--color-input-placeholder)]"
|
|
1001
1005
|
),
|
|
1002
|
-
children:
|
|
1006
|
+
children: L ?? r
|
|
1003
1007
|
}
|
|
1004
1008
|
),
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1009
|
+
l && /* @__PURE__ */ e(ne, {}),
|
|
1010
|
+
w && !l && /* @__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
|
+
f && !w && !l && /* @__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:
|
|
1013
|
-
onClick: (
|
|
1014
|
-
|
|
1016
|
+
disabled: b,
|
|
1017
|
+
onClick: (T) => {
|
|
1018
|
+
T.stopPropagation(), D();
|
|
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
|
-
children:
|
|
1031
|
+
children: o
|
|
1028
1032
|
}
|
|
1029
1033
|
)
|
|
1030
1034
|
]
|
|
1031
1035
|
}
|
|
1032
1036
|
),
|
|
1033
1037
|
/* @__PURE__ */ e(V, { children: s }),
|
|
1034
|
-
/* @__PURE__ */ e(K, { children:
|
|
1038
|
+
/* @__PURE__ */ e(K, { children: l })
|
|
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:
|
|
1042
|
+
file: t,
|
|
1039
1043
|
isUploaded: s = !1,
|
|
1040
|
-
isUploading:
|
|
1044
|
+
isUploading: l = !1,
|
|
1041
1045
|
error: r,
|
|
1042
|
-
onRemove:
|
|
1046
|
+
onRemove: o,
|
|
1043
1047
|
className: a
|
|
1044
|
-
} =
|
|
1048
|
+
} = n, i = l || s || !!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,16 +1057,16 @@ 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:
|
|
1059
|
-
|
|
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" }) : l ? /* @__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) }),
|
|
1063
|
+
o && /* @__PURE__ */ e(
|
|
1060
1064
|
qe,
|
|
1061
1065
|
{
|
|
1062
1066
|
variant: "transparent",
|
|
1063
1067
|
size: "sm",
|
|
1064
|
-
Icon:
|
|
1065
|
-
onClick:
|
|
1068
|
+
Icon: de,
|
|
1069
|
+
onClick: o,
|
|
1066
1070
|
"aria-label": "Remove file",
|
|
1067
1071
|
className: "shrink-0"
|
|
1068
1072
|
}
|
|
@@ -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:
|
|
1079
|
+
label: t,
|
|
1076
1080
|
description: s,
|
|
1077
|
-
error:
|
|
1081
|
+
error: l,
|
|
1078
1082
|
title: r = "Drop files here",
|
|
1079
|
-
hint:
|
|
1080
|
-
Icon: a =
|
|
1083
|
+
hint: o,
|
|
1084
|
+
Icon: a = qt,
|
|
1081
1085
|
onUpload: i,
|
|
1082
1086
|
onFileRemoved: c,
|
|
1083
|
-
onDropRejected:
|
|
1084
|
-
renderFileTile:
|
|
1085
|
-
accept:
|
|
1087
|
+
onDropRejected: f,
|
|
1088
|
+
renderFileTile: w,
|
|
1089
|
+
accept: x,
|
|
1086
1090
|
maxSize: h,
|
|
1087
|
-
minSize:
|
|
1091
|
+
minSize: g,
|
|
1088
1092
|
maxFiles: p,
|
|
1089
|
-
disabled:
|
|
1090
|
-
className:
|
|
1091
|
-
} =
|
|
1092
|
-
|
|
1093
|
-
}, D = (
|
|
1094
|
-
if (
|
|
1095
|
-
const A =
|
|
1096
|
-
id: String(++
|
|
1097
|
-
file:
|
|
1093
|
+
disabled: u = !1,
|
|
1094
|
+
className: b
|
|
1095
|
+
} = n, [C, v] = W([]), k = Ce(0), I = (y, A) => {
|
|
1096
|
+
v((z) => z.map(($) => $.id === y ? { ...$, ...A } : $));
|
|
1097
|
+
}, D = (y) => {
|
|
1098
|
+
if (y.length === 0) return;
|
|
1099
|
+
const A = y.map((z) => ({
|
|
1100
|
+
id: String(++k.current),
|
|
1101
|
+
file: z,
|
|
1098
1102
|
status: i ? "uploading" : "idle"
|
|
1099
1103
|
}));
|
|
1100
|
-
if (
|
|
1101
|
-
for (const
|
|
1102
|
-
Promise.resolve().then(() => i(
|
|
1103
|
-
|
|
1104
|
+
if (v((z) => [...z, ...A]), !!i)
|
|
1105
|
+
for (const z of A)
|
|
1106
|
+
Promise.resolve().then(() => i(z.file)).then(() => I(z.id, { status: "uploaded" })).catch(($) => {
|
|
1107
|
+
I(z.id, {
|
|
1104
1108
|
status: "error",
|
|
1105
1109
|
error: $ instanceof Error ? $ : new Error(String($))
|
|
1106
1110
|
});
|
|
1107
1111
|
});
|
|
1108
|
-
},
|
|
1109
|
-
const A =
|
|
1110
|
-
|
|
1112
|
+
}, O = (y) => {
|
|
1113
|
+
const A = C.find((z) => z.id === y);
|
|
1114
|
+
v((z) => z.filter(($) => $.id !== y)), A && c?.(A.file);
|
|
1111
1115
|
}, {
|
|
1112
|
-
getRootProps:
|
|
1113
|
-
getInputProps:
|
|
1114
|
-
isDragActive:
|
|
1116
|
+
getRootProps: P,
|
|
1117
|
+
getInputProps: L,
|
|
1118
|
+
isDragActive: T,
|
|
1115
1119
|
isFocused: N
|
|
1116
|
-
} =
|
|
1120
|
+
} = zt({
|
|
1117
1121
|
multiple: !0,
|
|
1118
|
-
accept:
|
|
1122
|
+
accept: x,
|
|
1119
1123
|
maxSize: h,
|
|
1120
|
-
minSize:
|
|
1124
|
+
minSize: g,
|
|
1121
1125
|
maxFiles: p,
|
|
1122
|
-
disabled:
|
|
1126
|
+
disabled: u,
|
|
1123
1127
|
onDrop: D,
|
|
1124
|
-
onDropRejected:
|
|
1128
|
+
onDropRejected: f
|
|
1125
1129
|
});
|
|
1126
|
-
return /* @__PURE__ */ d("div", { className:
|
|
1127
|
-
/* @__PURE__ */ e(q, { children:
|
|
1130
|
+
return /* @__PURE__ */ d("div", { className: m("flex flex-col", b), children: [
|
|
1131
|
+
/* @__PURE__ */ e(q, { 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
|
-
(N ||
|
|
1138
|
-
|
|
1139
|
-
|
|
1141
|
+
(N || T) && "ring-4",
|
|
1142
|
+
l && "input-error",
|
|
1143
|
+
u && "opacity-60 cursor-not-allowed"
|
|
1140
1144
|
)
|
|
1141
1145
|
}),
|
|
1142
1146
|
children: [
|
|
1143
|
-
/* @__PURE__ */ e("input", { ...
|
|
1147
|
+
/* @__PURE__ */ e("input", { ...L() }),
|
|
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
|
+
o && /* @__PURE__ */ e("div", { className: "text-sm text-[var(--color-input-description-text)] ", children: o })
|
|
1147
1151
|
]
|
|
1148
1152
|
}
|
|
1149
1153
|
),
|
|
1150
|
-
|
|
1154
|
+
C.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-col gap-2 mt-3", children: C.map((y) => {
|
|
1151
1155
|
const A = {
|
|
1152
|
-
file:
|
|
1153
|
-
isUploading:
|
|
1154
|
-
isUploaded:
|
|
1155
|
-
error:
|
|
1156
|
-
onRemove: () =>
|
|
1156
|
+
file: y.file,
|
|
1157
|
+
isUploading: y.status === "uploading",
|
|
1158
|
+
isUploaded: y.status === "uploaded",
|
|
1159
|
+
error: y.status === "error" ? y.error?.message : void 0,
|
|
1160
|
+
onRemove: () => O(y.id)
|
|
1157
1161
|
};
|
|
1158
|
-
return /* @__PURE__ */ e(
|
|
1162
|
+
return /* @__PURE__ */ e(R.Fragment, { children: w ? w(y.file, A) : /* @__PURE__ */ e(wr, { ...A }) }, y.id);
|
|
1159
1163
|
}) }),
|
|
1160
1164
|
/* @__PURE__ */ e(V, { children: s }),
|
|
1161
|
-
/* @__PURE__ */ e(K, { children:
|
|
1165
|
+
/* @__PURE__ */ e(K, { children: l })
|
|
1162
1166
|
] });
|
|
1163
|
-
},
|
|
1164
|
-
Cn,
|
|
1167
|
+
}, Nr = [
|
|
1165
1168
|
In,
|
|
1166
|
-
|
|
1167
|
-
|
|
1169
|
+
Rn,
|
|
1170
|
+
Tt,
|
|
1171
|
+
On,
|
|
1168
1172
|
Ln
|
|
1169
|
-
],
|
|
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, s] = W($t);
|
|
1208
1212
|
return _(() => {
|
|
1209
|
-
const
|
|
1210
|
-
|
|
1211
|
-
const r =
|
|
1212
|
-
if (!
|
|
1213
|
+
const l = () => {
|
|
1214
|
+
n.getEditorState().read(() => {
|
|
1215
|
+
const r = Pt();
|
|
1216
|
+
if (!Lt(r))
|
|
1213
1217
|
return;
|
|
1214
|
-
const
|
|
1218
|
+
const o = r.anchor.getNode(), a = Hn(o, Tt), i = a && zn(a) ? a.getListType() : null;
|
|
1215
1219
|
let c = "paragraph";
|
|
1216
1220
|
if (!i) {
|
|
1217
|
-
const
|
|
1218
|
-
|
|
1221
|
+
const g = o.getKey() === "root" ? o : o.getTopLevelElementOrThrow();
|
|
1222
|
+
Sn(g) && (c = g.getTag());
|
|
1219
1223
|
}
|
|
1220
|
-
const
|
|
1221
|
-
s((
|
|
1222
|
-
...
|
|
1223
|
-
isBold:
|
|
1224
|
-
isItalic:
|
|
1225
|
-
isUnderline:
|
|
1224
|
+
const f = r.hasFormat("bold"), w = r.hasFormat("italic"), x = r.hasFormat("underline"), h = pt(o.getParent()) || pt(o);
|
|
1225
|
+
s((g) => ({
|
|
1226
|
+
...g,
|
|
1227
|
+
isBold: f,
|
|
1228
|
+
isItalic: w,
|
|
1229
|
+
isUnderline: x,
|
|
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
|
-
Pn,
|
|
1237
|
-
(r) => (s((l) => ({ ...l, canUndo: r })), !1),
|
|
1238
|
-
Pe
|
|
1239
|
-
),
|
|
1240
|
-
t.registerCommand(
|
|
1237
|
+
return Et(
|
|
1238
|
+
n.registerUpdateListener(() => l()),
|
|
1239
|
+
n.registerCommand(
|
|
1241
1240
|
En,
|
|
1242
|
-
(r) => (s((
|
|
1243
|
-
|
|
1241
|
+
(r) => (s((o) => ({ ...o, canUndo: r })), !1),
|
|
1242
|
+
Le
|
|
1243
|
+
),
|
|
1244
|
+
n.registerCommand(
|
|
1245
|
+
Fn,
|
|
1246
|
+
(r) => (s((o) => ({ ...o, canRedo: r })), !1),
|
|
1247
|
+
Le
|
|
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: s, placement: l = "bottom-end", minWidth: r = 200, className: o } = n, [a, i] = W(!1), { Popover: c, anchorRef: f } = ct({
|
|
1256
|
+
placement: l,
|
|
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: f, className: o, 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: s }) }) })
|
|
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 =
|
|
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 = R.forwardRef((n, t) => {
|
|
1261
1266
|
const {
|
|
1262
1267
|
className: s,
|
|
1263
|
-
children:
|
|
1268
|
+
children: l,
|
|
1264
1269
|
Icon: r,
|
|
1265
|
-
onClick:
|
|
1270
|
+
onClick: o,
|
|
1266
1271
|
dismissOnClick: a = !0,
|
|
1267
1272
|
...i
|
|
1268
|
-
} =
|
|
1269
|
-
|
|
1273
|
+
} = n, { dismiss: c } = yr(), f = (w) => {
|
|
1274
|
+
o && o(w), 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
|
s
|
|
1278
1283
|
),
|
|
1279
|
-
onClick:
|
|
1284
|
+
onClick: f,
|
|
1280
1285
|
...i,
|
|
1281
1286
|
children: [
|
|
1282
1287
|
r && /* @__PURE__ */ e(r, { className: "h-5 w-5" }),
|
|
1283
|
-
|
|
1288
|
+
l
|
|
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: s } = we(), l = (o) => {
|
|
1300
|
+
n.update(() => {
|
|
1301
|
+
const a = Pt();
|
|
1302
|
+
Lt(a) && (o === "paragraph" ? bt(a, () => Mn()) : bt(a, () => Dn(o)));
|
|
1298
1303
|
});
|
|
1299
|
-
}, r = Ge.find((
|
|
1304
|
+
}, r = Ge.find((o) => o.value === t.blockType) ?? Ge[0];
|
|
1300
1305
|
return /* @__PURE__ */ e(
|
|
1301
1306
|
Ue,
|
|
1302
1307
|
{
|
|
@@ -1306,216 +1311,216 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
|
|
|
1306
1311
|
"button",
|
|
1307
1312
|
{
|
|
1308
1313
|
type: "button",
|
|
1309
|
-
onMouseDown: (
|
|
1310
|
-
className:
|
|
1314
|
+
onMouseDown: (o) => o.preventDefault(),
|
|
1315
|
+
className: m(
|
|
1311
1316
|
"lexical-tb-btn h-8 px-2 gap-1 text-sm font-medium",
|
|
1312
1317
|
s === "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
|
-
children: Ge.map((
|
|
1325
|
+
children: Ge.map((o) => /* @__PURE__ */ e(
|
|
1321
1326
|
X,
|
|
1322
1327
|
{
|
|
1323
|
-
Icon:
|
|
1324
|
-
onClick: () => o
|
|
1325
|
-
className:
|
|
1326
|
-
children:
|
|
1328
|
+
Icon: o.value === t.blockType ? Rt : void 0,
|
|
1329
|
+
onClick: () => l(o.value),
|
|
1330
|
+
className: o.value === t.blockType ? void 0 : "pl-11",
|
|
1331
|
+
children: o.label
|
|
1327
1332
|
},
|
|
1328
|
-
|
|
1333
|
+
o.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: s, active:
|
|
1340
|
+
}, ie = R.forwardRef(
|
|
1341
|
+
(n, t) => {
|
|
1342
|
+
const { Icon: s, active: l = !1, tone: r = "light", className: o, 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: (f) => {
|
|
1349
|
+
f.preventDefault(), a?.(f);
|
|
1345
1350
|
},
|
|
1346
|
-
className:
|
|
1351
|
+
className: m(
|
|
1347
1352
|
"lexical-tb-btn h-8 w-8",
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1353
|
+
Ir[r],
|
|
1354
|
+
l && "lexical-tb-btn-active",
|
|
1355
|
+
o
|
|
1351
1356
|
),
|
|
1352
1357
|
...i,
|
|
1353
1358
|
children: /* @__PURE__ */ e(s, { 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: s } = we();
|
|
1364
|
+
return /* @__PURE__ */ d(ce, { children: [
|
|
1360
1365
|
/* @__PURE__ */ e(
|
|
1361
|
-
|
|
1366
|
+
ie,
|
|
1362
1367
|
{
|
|
1363
|
-
Icon:
|
|
1368
|
+
Icon: Qt,
|
|
1364
1369
|
tone: s,
|
|
1365
|
-
active:
|
|
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:
|
|
1378
|
+
Icon: Zt,
|
|
1374
1379
|
tone: s,
|
|
1375
|
-
active:
|
|
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:
|
|
1388
|
+
Icon: en,
|
|
1384
1389
|
tone: s,
|
|
1385
|
-
active:
|
|
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: s } = we(), l = () => {
|
|
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 : Pn,
|
|
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
1412
|
Icon: Ye,
|
|
1408
1413
|
tone: s,
|
|
1409
|
-
active:
|
|
1414
|
+
active: t.isUnorderedList,
|
|
1410
1415
|
"aria-label": "Bullet list",
|
|
1411
|
-
onClick:
|
|
1416
|
+
onClick: l
|
|
1412
1417
|
}
|
|
1413
1418
|
),
|
|
1414
1419
|
/* @__PURE__ */ e(
|
|
1415
|
-
|
|
1420
|
+
ie,
|
|
1416
1421
|
{
|
|
1417
|
-
Icon:
|
|
1422
|
+
Icon: tn,
|
|
1418
1423
|
tone: s,
|
|
1419
|
-
active:
|
|
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: s } = we(), l = () => {
|
|
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:
|
|
1442
|
+
Icon: nn,
|
|
1438
1443
|
tone: s,
|
|
1439
|
-
active:
|
|
1444
|
+
active: t.isLink,
|
|
1440
1445
|
"aria-label": "Link",
|
|
1441
|
-
onClick:
|
|
1446
|
+
onClick: l
|
|
1442
1447
|
}
|
|
1443
1448
|
);
|
|
1444
|
-
},
|
|
1445
|
-
const [
|
|
1446
|
-
return /* @__PURE__ */ d(
|
|
1449
|
+
}, Or = () => {
|
|
1450
|
+
const [n] = ue(), { state: t, tone: s } = we();
|
|
1451
|
+
return /* @__PURE__ */ d(ce, { children: [
|
|
1447
1452
|
/* @__PURE__ */ e(
|
|
1448
|
-
|
|
1453
|
+
ie,
|
|
1449
1454
|
{
|
|
1450
|
-
Icon:
|
|
1455
|
+
Icon: rn,
|
|
1451
1456
|
tone: s,
|
|
1452
|
-
disabled: !
|
|
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:
|
|
1465
|
+
Icon: ln,
|
|
1461
1466
|
tone: s,
|
|
1462
|
-
disabled: !
|
|
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
|
-
}, Je = (
|
|
1472
|
-
const { tone:
|
|
1476
|
+
}, Je = (n) => {
|
|
1477
|
+
const { tone: t, className: s } = n, { tone: l, 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
|
-
|
|
1484
|
+
zr[t ?? l],
|
|
1480
1485
|
s
|
|
1481
1486
|
)
|
|
1482
1487
|
}
|
|
1483
1488
|
);
|
|
1484
|
-
},
|
|
1485
|
-
const
|
|
1486
|
-
return
|
|
1487
|
-
|
|
1488
|
-
}),
|
|
1489
|
-
},
|
|
1490
|
-
const { children:
|
|
1491
|
-
const h =
|
|
1492
|
-
if (!h || !
|
|
1493
|
-
const p = h.clientWidth,
|
|
1494
|
-
if (
|
|
1495
|
-
c(
|
|
1489
|
+
}, Nt = 4, Tr = 36, Xt = (n) => {
|
|
1490
|
+
const t = [];
|
|
1491
|
+
return R.Children.forEach(n, (s) => {
|
|
1492
|
+
R.isValidElement(s) && s.type === R.Fragment ? t.push(...Xt(s.props.children)) : t.push(s);
|
|
1493
|
+
}), t;
|
|
1494
|
+
}, Vt = (n) => {
|
|
1495
|
+
const { children: t } = n, { state: s, tone: l } = we(), r = Xt(t), o = Ce(null), a = Ce(null), [i, c] = W(r.length), f = Pe(() => {
|
|
1496
|
+
const h = o.current, g = a.current;
|
|
1497
|
+
if (!h || !g) return;
|
|
1498
|
+
const p = h.clientWidth, u = Array.from(g.children).map((k) => k.offsetWidth);
|
|
1499
|
+
if (u.reduce((k, I, D) => k + I + (D > 0 ? Nt : 0), 0) <= p) {
|
|
1500
|
+
c(u.length);
|
|
1496
1501
|
return;
|
|
1497
1502
|
}
|
|
1498
|
-
let
|
|
1499
|
-
for (let
|
|
1500
|
-
const
|
|
1501
|
-
if (
|
|
1502
|
-
|
|
1503
|
+
let C = 0, v = 0;
|
|
1504
|
+
for (let k = 0; k < u.length; k++) {
|
|
1505
|
+
const I = u[k] + (k > 0 ? Nt : 0);
|
|
1506
|
+
if (C + I + Tr > p) break;
|
|
1507
|
+
C += I, v++;
|
|
1503
1508
|
}
|
|
1504
|
-
c(
|
|
1509
|
+
c(v);
|
|
1505
1510
|
}, []);
|
|
1506
|
-
|
|
1507
|
-
|
|
1511
|
+
It(() => {
|
|
1512
|
+
f();
|
|
1508
1513
|
}), _(() => {
|
|
1509
|
-
const h =
|
|
1514
|
+
const h = o.current, g = a.current;
|
|
1510
1515
|
if (!h) return;
|
|
1511
|
-
const p = new ResizeObserver(() =>
|
|
1512
|
-
return p.observe(h),
|
|
1513
|
-
}, [
|
|
1514
|
-
const
|
|
1516
|
+
const p = new ResizeObserver(() => f());
|
|
1517
|
+
return p.observe(h), g && p.observe(g), () => p.disconnect();
|
|
1518
|
+
}, [f]);
|
|
1519
|
+
const w = r.slice(0, i), x = r.slice(i);
|
|
1515
1520
|
return /* @__PURE__ */ d(
|
|
1516
1521
|
"div",
|
|
1517
1522
|
{
|
|
1518
|
-
ref:
|
|
1523
|
+
ref: o,
|
|
1519
1524
|
className: "relative flex flex-row items-center gap-1 min-w-0 flex-1",
|
|
1520
1525
|
children: [
|
|
1521
1526
|
/* @__PURE__ */ e(
|
|
@@ -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, g) => /* @__PURE__ */ e("div", { className: "flex flex-row items-center", children: h }, g))
|
|
1528
1533
|
}
|
|
1529
1534
|
),
|
|
1530
|
-
|
|
1531
|
-
|
|
1535
|
+
w.map((h, g) => /* @__PURE__ */ e(R.Fragment, { children: h }, g)),
|
|
1536
|
+
x.length > 0 && /* @__PURE__ */ e(
|
|
1532
1537
|
Ue,
|
|
1533
1538
|
{
|
|
1534
1539
|
placement: "bottom-end",
|
|
@@ -1539,11 +1544,11 @@ 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
|
+
l === "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
1554
|
children: /* @__PURE__ */ e(Ae.Provider, { value: { state: s, tone: "light", orientation: "vertical" }, children: /* @__PURE__ */ e(
|
|
@@ -1551,7 +1556,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
|
|
|
1551
1556
|
{
|
|
1552
1557
|
className: "flex flex-col items-stretch gap-1",
|
|
1553
1558
|
onMouseDown: (h) => h.preventDefault(),
|
|
1554
|
-
children:
|
|
1559
|
+
children: x.map((h, g) => /* @__PURE__ */ e(R.Fragment, { children: h }, g))
|
|
1555
1560
|
}
|
|
1556
1561
|
) })
|
|
1557
1562
|
}
|
|
@@ -1559,55 +1564,55 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
|
|
|
1559
1564
|
]
|
|
1560
1565
|
}
|
|
1561
1566
|
);
|
|
1562
|
-
},
|
|
1563
|
-
/* @__PURE__ */ e(
|
|
1564
|
-
/* @__PURE__ */ e(Je, {}),
|
|
1565
|
-
/* @__PURE__ */ e(Ir, {}),
|
|
1567
|
+
}, dt = () => /* @__PURE__ */ d(ce, { children: [
|
|
1568
|
+
/* @__PURE__ */ e(Cr, {}),
|
|
1566
1569
|
/* @__PURE__ */ e(Je, {}),
|
|
1567
1570
|
/* @__PURE__ */ e(Rr, {}),
|
|
1571
|
+
/* @__PURE__ */ e(Je, {}),
|
|
1568
1572
|
/* @__PURE__ */ e(Sr, {}),
|
|
1573
|
+
/* @__PURE__ */ e(Dr, {}),
|
|
1569
1574
|
/* @__PURE__ */ e(Je, {}),
|
|
1570
|
-
/* @__PURE__ */ e(
|
|
1571
|
-
] }),
|
|
1572
|
-
const { render:
|
|
1575
|
+
/* @__PURE__ */ e(Or, {})
|
|
1576
|
+
] }), Sl = () => dt(), Pr = (n) => {
|
|
1577
|
+
const { render: t, className: s } = n, [l] = 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
|
s
|
|
1579
1584
|
),
|
|
1580
|
-
children: /* @__PURE__ */ e(
|
|
1585
|
+
children: /* @__PURE__ */ e(Vt, { children: t ? t({ editor: l, state: r, tone: "light" }) : dt() })
|
|
1581
1586
|
}
|
|
1582
1587
|
) });
|
|
1583
|
-
}, Lr = (
|
|
1584
|
-
const { render:
|
|
1588
|
+
}, Lr = (n) => {
|
|
1589
|
+
const { render: t } = n, [s] = ue(), l = _t(), [r, o] = 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: f }) {
|
|
1598
|
+
f.floating.style.width = `${c.reference.width}px`;
|
|
1594
1599
|
}
|
|
1595
1600
|
})
|
|
1596
1601
|
],
|
|
1597
|
-
whileElementsMounted:
|
|
1602
|
+
whileElementsMounted: at
|
|
1598
1603
|
});
|
|
1599
|
-
return _(() => s.registerRootListener((c) => a.setReference(c ?? null)), [s, a]), _(() =>
|
|
1604
|
+
return _(() => s.registerRootListener((c) => a.setReference(c ?? null)), [s, a]), _(() => Et(
|
|
1600
1605
|
s.registerCommand(
|
|
1601
|
-
|
|
1602
|
-
() => (
|
|
1603
|
-
|
|
1606
|
+
Un,
|
|
1607
|
+
() => (o(!0), !1),
|
|
1608
|
+
Le
|
|
1604
1609
|
),
|
|
1605
1610
|
s.registerCommand(
|
|
1606
|
-
|
|
1607
|
-
() => (
|
|
1608
|
-
|
|
1611
|
+
Wn,
|
|
1612
|
+
() => (o(!1), !1),
|
|
1613
|
+
Le
|
|
1609
1614
|
)
|
|
1610
|
-
), [s]), /* @__PURE__ */ e(Ae.Provider, { value: { state:
|
|
1615
|
+
), [s]), /* @__PURE__ */ e(Ae.Provider, { value: { state: l, 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(
|
|
1611
1616
|
J.div,
|
|
1612
1617
|
{
|
|
1613
1618
|
className: "lexical-floating-toolbar flex w-full flex-row items-center p-1 rounded-xl",
|
|
@@ -1615,75 +1620,75 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
|
|
|
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: s, state: l, tone: "dark" }) : dt() })
|
|
1619
1624
|
}
|
|
1620
1625
|
) }) }) }) });
|
|
1621
|
-
},
|
|
1626
|
+
}, Dl = (n) => {
|
|
1622
1627
|
const {
|
|
1623
|
-
label:
|
|
1628
|
+
label: t,
|
|
1624
1629
|
description: s,
|
|
1625
|
-
error:
|
|
1630
|
+
error: l,
|
|
1626
1631
|
placeholder: r,
|
|
1627
|
-
value:
|
|
1632
|
+
value: o,
|
|
1628
1633
|
onChange: a,
|
|
1629
1634
|
size: i = "md",
|
|
1630
1635
|
toolbar: c = "static",
|
|
1631
|
-
renderToolbar:
|
|
1632
|
-
minRows:
|
|
1633
|
-
maxRows:
|
|
1636
|
+
renderToolbar: f,
|
|
1637
|
+
minRows: w = 4,
|
|
1638
|
+
maxRows: x,
|
|
1634
1639
|
autogrow: h = !1,
|
|
1635
|
-
namespace:
|
|
1640
|
+
namespace: g = "InputLexical",
|
|
1636
1641
|
nodes: p,
|
|
1637
|
-
theme:
|
|
1638
|
-
autoFocus:
|
|
1639
|
-
children:
|
|
1640
|
-
className:
|
|
1641
|
-
} =
|
|
1642
|
+
theme: u,
|
|
1643
|
+
autoFocus: b = !1,
|
|
1644
|
+
children: C,
|
|
1645
|
+
className: v
|
|
1646
|
+
} = n, k = se(
|
|
1642
1647
|
() => ({
|
|
1643
|
-
namespace:
|
|
1644
|
-
theme:
|
|
1645
|
-
nodes: [...
|
|
1646
|
-
editorState:
|
|
1647
|
-
onError: (
|
|
1648
|
-
throw
|
|
1648
|
+
namespace: g,
|
|
1649
|
+
theme: u ? { ...wt, ...u } : wt,
|
|
1650
|
+
nodes: [...Nr, ...p ?? []],
|
|
1651
|
+
editorState: o ?? null,
|
|
1652
|
+
onError: (T) => {
|
|
1653
|
+
throw T;
|
|
1649
1654
|
}
|
|
1650
1655
|
}),
|
|
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
|
-
),
|
|
1655
|
-
(
|
|
1656
|
-
a?.(JSON.stringify(
|
|
1659
|
+
), I = Pe(
|
|
1660
|
+
(T) => {
|
|
1661
|
+
a?.(JSON.stringify(T.toJSON()));
|
|
1657
1662
|
},
|
|
1658
1663
|
[a]
|
|
1659
|
-
), D = Y[i],
|
|
1660
|
-
return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className:
|
|
1661
|
-
/* @__PURE__ */ e(q, { children:
|
|
1662
|
-
/* @__PURE__ */ e(
|
|
1664
|
+
), D = Y[i], O = !!l, P = (T) => `calc(${T} * 1lh + 1.5rem)`, L = h ? { minHeight: P(w), maxHeight: x ? P(x) : void 0 } : { height: P(w) };
|
|
1665
|
+
return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className: m("flex flex-col", v), children: [
|
|
1666
|
+
/* @__PURE__ */ e(q, { children: t }),
|
|
1667
|
+
/* @__PURE__ */ e(gn, { initialConfig: k, 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(Pr, { render: f }),
|
|
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
|
D
|
|
1680
1685
|
),
|
|
1681
|
-
style:
|
|
1686
|
+
style: L,
|
|
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
|
D
|
|
1689
1694
|
),
|
|
@@ -1692,38 +1697,38 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
|
|
|
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
|
+
b && /* @__PURE__ */ e(kn, {}),
|
|
1707
|
+
a && /* @__PURE__ */ e(yn, { onChange: I }),
|
|
1708
|
+
C,
|
|
1709
|
+
c === "floating" && /* @__PURE__ */ e(Lr, { render: f })
|
|
1705
1710
|
]
|
|
1706
1711
|
}
|
|
1707
1712
|
) }),
|
|
1708
1713
|
/* @__PURE__ */ e(V, { children: s }),
|
|
1709
|
-
/* @__PURE__ */ e(K, { children:
|
|
1714
|
+
/* @__PURE__ */ e(K, { children: l })
|
|
1710
1715
|
] }) });
|
|
1711
|
-
},
|
|
1716
|
+
}, Ol = (n) => {
|
|
1712
1717
|
const {
|
|
1713
|
-
className:
|
|
1718
|
+
className: t,
|
|
1714
1719
|
label: s,
|
|
1715
|
-
description:
|
|
1720
|
+
description: l,
|
|
1716
1721
|
options: r,
|
|
1717
|
-
error:
|
|
1722
|
+
error: o,
|
|
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
1734
|
/* @__PURE__ */ e(q, { children: s }),
|
|
@@ -1731,218 +1736,216 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
|
|
|
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
|
-
|
|
1741
|
+
te[a],
|
|
1737
1742
|
Y[a],
|
|
1738
|
-
|
|
1739
|
-
|
|
1743
|
+
me[a],
|
|
1744
|
+
fe[a]
|
|
1740
1745
|
),
|
|
1741
1746
|
...i,
|
|
1742
|
-
children: r && r.map((c,
|
|
1747
|
+
children: r && r.map((c, f) => /* @__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
|
+
f
|
|
1750
1755
|
))
|
|
1751
1756
|
}
|
|
1752
1757
|
),
|
|
1753
|
-
/* @__PURE__ */ d(
|
|
1754
|
-
|
|
1755
|
-
/* @__PURE__ */ e(Z, { Icon:
|
|
1758
|
+
/* @__PURE__ */ d(he, { children: [
|
|
1759
|
+
o && /* @__PURE__ */ e(ne, {}),
|
|
1760
|
+
/* @__PURE__ */ e(Z, { Icon: be })
|
|
1756
1761
|
] })
|
|
1757
1762
|
] }),
|
|
1758
|
-
/* @__PURE__ */ e(V, { children:
|
|
1759
|
-
/* @__PURE__ */ e(K, { children:
|
|
1763
|
+
/* @__PURE__ */ e(V, { children: l }),
|
|
1764
|
+
/* @__PURE__ */ e(K, { children: o })
|
|
1760
1765
|
]
|
|
1761
1766
|
}
|
|
1762
1767
|
) });
|
|
1763
|
-
}, We =
|
|
1768
|
+
}, We = R.forwardRef((n, t) => {
|
|
1764
1769
|
const {
|
|
1765
1770
|
children: s,
|
|
1766
|
-
onClick:
|
|
1771
|
+
onClick: l,
|
|
1767
1772
|
selected: r,
|
|
1768
|
-
disabled:
|
|
1773
|
+
disabled: o = !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: () => !
|
|
1779
|
-
className:
|
|
1783
|
+
onClick: () => !o && l && l(),
|
|
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
|
-
r && !
|
|
1782
|
-
a && !
|
|
1783
|
-
|
|
1786
|
+
r && !o && "option-selected",
|
|
1787
|
+
a && !o && "option-active",
|
|
1788
|
+
o && "option-disabled cursor-not-allowed hover:bg-transparent active:bg-transparent",
|
|
1784
1789
|
i
|
|
1785
1790
|
),
|
|
1786
1791
|
children: [
|
|
1787
1792
|
/* @__PURE__ */ e("div", { className: "flex-1 min-w-0 break-all line-clamp-1", children: s }),
|
|
1788
|
-
r && !
|
|
1793
|
+
r && !o && /* @__PURE__ */ e("div", { className: "shrink-0", children: /* @__PURE__ */ e(Rt, { className: "h-5 w-5" }) })
|
|
1789
1794
|
]
|
|
1790
1795
|
}
|
|
1791
1796
|
);
|
|
1792
|
-
}), He =
|
|
1793
|
-
const { children: s, className:
|
|
1797
|
+
}), He = R.forwardRef((n, t) => {
|
|
1798
|
+
const { children: s, className: l, ...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
|
+
l
|
|
1802
1807
|
),
|
|
1803
1808
|
children: s
|
|
1804
1809
|
}
|
|
1805
1810
|
);
|
|
1806
|
-
}), $e =
|
|
1807
|
-
const { className: s, ...
|
|
1811
|
+
}), $e = R.forwardRef((n, t) => {
|
|
1812
|
+
const { className: s, ...l } = n;
|
|
1808
1813
|
return /* @__PURE__ */ e(
|
|
1809
1814
|
"div",
|
|
1810
1815
|
{
|
|
1811
|
-
ref:
|
|
1812
|
-
...
|
|
1813
|
-
className:
|
|
1816
|
+
ref: t,
|
|
1817
|
+
...l,
|
|
1818
|
+
className: m(
|
|
1814
1819
|
"option-divider my-1 h-px",
|
|
1815
1820
|
s
|
|
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
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
onNavigate: x,
|
|
1826
|
+
placement: t = "bottom",
|
|
1827
|
+
fullWidth: s,
|
|
1828
|
+
minWidth: l,
|
|
1829
|
+
maxWidth: r,
|
|
1830
|
+
open: o,
|
|
1831
|
+
onOpenChange: a,
|
|
1832
|
+
listRef: i,
|
|
1833
|
+
activeIndex: c,
|
|
1834
|
+
onNavigate: f,
|
|
1831
1835
|
loop: w = !0,
|
|
1832
|
-
disabledIndices:
|
|
1833
|
-
} =
|
|
1836
|
+
disabledIndices: x
|
|
1837
|
+
} = n, h = R.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: L, elements: T }) {
|
|
1842
|
+
s && (T.floating.style.width = `${L.reference.width}px`), l && (T.floating.style.minWidth = `${l}px`), r && (T.floating.style.maxWidth = `${r}px`);
|
|
1839
1843
|
}
|
|
1840
1844
|
})
|
|
1841
|
-
], [
|
|
1842
|
-
placement:
|
|
1843
|
-
open:
|
|
1844
|
-
onOpenChange:
|
|
1845
|
-
middleware:
|
|
1846
|
-
whileElementsMounted:
|
|
1847
|
-
}),
|
|
1848
|
-
listRef:
|
|
1849
|
-
activeIndex:
|
|
1850
|
-
onNavigate:
|
|
1845
|
+
], [s, r, l]), { refs: g, floatingStyles: p, context: u, placement: b } = st({
|
|
1846
|
+
placement: t,
|
|
1847
|
+
open: o,
|
|
1848
|
+
onOpenChange: a,
|
|
1849
|
+
middleware: h,
|
|
1850
|
+
whileElementsMounted: at
|
|
1851
|
+
}), C = hn(u, {
|
|
1852
|
+
listRef: i,
|
|
1853
|
+
activeIndex: c,
|
|
1854
|
+
onNavigate: f,
|
|
1851
1855
|
loop: w,
|
|
1852
1856
|
virtual: !0,
|
|
1853
1857
|
focusItemOnOpen: !1,
|
|
1854
|
-
disabledIndices:
|
|
1855
|
-
}),
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1858
|
+
disabledIndices: x
|
|
1859
|
+
}), v = St(u, {
|
|
1860
|
+
outsidePress: !0,
|
|
1861
|
+
escapeKey: !1
|
|
1862
|
+
}), { getReferenceProps: k, getFloatingProps: I, getItemProps: D } = Dt([C, v]), O = R.useRef({
|
|
1863
|
+
floatingStyles: p,
|
|
1864
|
+
setFloating: g.setFloating,
|
|
1865
|
+
placement: t,
|
|
1866
|
+
getFloatingProps: I
|
|
1861
1867
|
});
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
getFloatingProps: y
|
|
1868
|
+
O.current = {
|
|
1869
|
+
floatingStyles: p,
|
|
1870
|
+
setFloating: g.setFloating,
|
|
1871
|
+
placement: b,
|
|
1872
|
+
getFloatingProps: I
|
|
1868
1873
|
};
|
|
1869
|
-
const
|
|
1870
|
-
const
|
|
1871
|
-
const { floatingStyles: N, setFloating:
|
|
1874
|
+
const P = R.useMemo(() => {
|
|
1875
|
+
const L = (T) => {
|
|
1876
|
+
const { floatingStyles: N, setFloating: y, placement: A, getFloatingProps: z } = O.current, { className: $, open: j, children: re } = T;
|
|
1872
1877
|
return /* @__PURE__ */ e(
|
|
1873
|
-
|
|
1878
|
+
Ht,
|
|
1874
1879
|
{
|
|
1875
|
-
open:
|
|
1876
|
-
className:
|
|
1877
|
-
onOutsideClick: A,
|
|
1880
|
+
open: j,
|
|
1881
|
+
className: $,
|
|
1878
1882
|
floatingStyles: N,
|
|
1879
|
-
setFloating:
|
|
1880
|
-
placement:
|
|
1881
|
-
floatingProps:
|
|
1882
|
-
children:
|
|
1883
|
+
setFloating: y,
|
|
1884
|
+
placement: A,
|
|
1885
|
+
floatingProps: z(),
|
|
1886
|
+
children: re
|
|
1883
1887
|
}
|
|
1884
1888
|
);
|
|
1885
1889
|
};
|
|
1886
|
-
return
|
|
1890
|
+
return R.memo(L);
|
|
1887
1891
|
}, []);
|
|
1888
1892
|
return {
|
|
1889
|
-
anchorRef:
|
|
1890
|
-
Popover:
|
|
1891
|
-
getReferenceProps:
|
|
1893
|
+
anchorRef: g.setReference,
|
|
1894
|
+
Popover: P,
|
|
1895
|
+
getReferenceProps: k,
|
|
1892
1896
|
getItemProps: D
|
|
1893
1897
|
};
|
|
1894
|
-
},
|
|
1898
|
+
}, Er = (n) => {
|
|
1895
1899
|
const {
|
|
1896
|
-
className:
|
|
1900
|
+
className: t,
|
|
1897
1901
|
label: s,
|
|
1898
|
-
description:
|
|
1902
|
+
description: l,
|
|
1899
1903
|
options: r,
|
|
1900
|
-
onChange:
|
|
1904
|
+
onChange: o,
|
|
1901
1905
|
value: a,
|
|
1902
1906
|
placeholder: i,
|
|
1903
1907
|
maxHeight: c = 300,
|
|
1904
|
-
error:
|
|
1905
|
-
size:
|
|
1906
|
-
disabled:
|
|
1908
|
+
error: f,
|
|
1909
|
+
size: w = "md",
|
|
1910
|
+
disabled: x = !1,
|
|
1907
1911
|
clearable: h = !0
|
|
1908
|
-
} =
|
|
1909
|
-
() => r.map((N,
|
|
1912
|
+
} = n, [g, p] = W(!1), [u, b] = W(null), C = R.useRef(null), v = R.useRef([]), k = r?.find((N) => H(N) && G(N.value, a)), I = se(
|
|
1913
|
+
() => r.map((N, y) => !H(N) || N.disabled ? y : -1).filter((N) => N !== -1),
|
|
1910
1914
|
[r]
|
|
1911
1915
|
);
|
|
1912
|
-
|
|
1913
|
-
if (
|
|
1914
|
-
|
|
1915
|
-
const N = r.findIndex((
|
|
1916
|
+
xe(g, () => p(!1)), _(() => {
|
|
1917
|
+
if (g) {
|
|
1918
|
+
C.current?.focus({ preventScroll: !0 });
|
|
1919
|
+
const N = r.findIndex((y) => H(y) && G(y.value, a));
|
|
1916
1920
|
if (N >= 0)
|
|
1917
|
-
|
|
1921
|
+
b(N);
|
|
1918
1922
|
else {
|
|
1919
|
-
const
|
|
1920
|
-
|
|
1923
|
+
const y = r.findIndex((A) => H(A) && !A.disabled);
|
|
1924
|
+
b(y >= 0 ? y : null);
|
|
1921
1925
|
}
|
|
1922
1926
|
} else
|
|
1923
|
-
|
|
1924
|
-
}, [
|
|
1925
|
-
const { anchorRef: D, Popover:
|
|
1927
|
+
b(null);
|
|
1928
|
+
}, [g]);
|
|
1929
|
+
const { anchorRef: D, Popover: O, getReferenceProps: P, getItemProps: L } = _e({
|
|
1926
1930
|
placement: "bottom",
|
|
1927
1931
|
fullWidth: !0,
|
|
1928
1932
|
minWidth: 200,
|
|
1929
|
-
|
|
1930
|
-
open: b,
|
|
1933
|
+
open: g,
|
|
1931
1934
|
onOpenChange: p,
|
|
1932
|
-
listRef:
|
|
1933
|
-
activeIndex:
|
|
1934
|
-
onNavigate:
|
|
1935
|
-
disabledIndices:
|
|
1936
|
-
}),
|
|
1937
|
-
const
|
|
1938
|
-
|
|
1935
|
+
listRef: v,
|
|
1936
|
+
activeIndex: u,
|
|
1937
|
+
onNavigate: b,
|
|
1938
|
+
disabledIndices: I
|
|
1939
|
+
}), T = (N) => {
|
|
1940
|
+
const y = r[N];
|
|
1941
|
+
y && H(y) && !y.disabled && (o(y.value), p(!1));
|
|
1939
1942
|
};
|
|
1940
|
-
return /* @__PURE__ */ e(Q.Provider, { value:
|
|
1943
|
+
return /* @__PURE__ */ e(Q.Provider, { value: w, 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
1951
|
/* @__PURE__ */ e(q, { children: s }),
|
|
@@ -1950,141 +1953,140 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
|
|
|
1950
1953
|
/* @__PURE__ */ d(
|
|
1951
1954
|
"div",
|
|
1952
1955
|
{
|
|
1953
|
-
...
|
|
1954
|
-
ref:
|
|
1956
|
+
...P({
|
|
1957
|
+
ref: C,
|
|
1955
1958
|
role: "button",
|
|
1956
|
-
tabIndex:
|
|
1957
|
-
"aria-disabled":
|
|
1959
|
+
tabIndex: x ? -1 : 0,
|
|
1960
|
+
"aria-disabled": x,
|
|
1958
1961
|
onClick: () => {
|
|
1959
|
-
|
|
1962
|
+
x || p(!g);
|
|
1960
1963
|
},
|
|
1961
1964
|
onKeyDown: (N) => {
|
|
1962
|
-
|
|
1965
|
+
x || (N.key === " " ? (N.preventDefault(), p((y) => !y)) : N.key === "Enter" && (N.preventDefault(), g && u != null ? T(u) : p(!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
|
-
Y[
|
|
1969
|
-
|
|
1970
|
-
h && a ? Be[
|
|
1971
|
-
|
|
1972
|
-
!
|
|
1970
|
+
te[w],
|
|
1971
|
+
Y[w],
|
|
1972
|
+
me[w],
|
|
1973
|
+
h && a ? Be[w] : fe[w],
|
|
1974
|
+
x ? "select-trigger-disabled" : f && "select-trigger-error",
|
|
1975
|
+
!x && g && "ring-4"
|
|
1973
1976
|
),
|
|
1974
1977
|
children: [
|
|
1975
|
-
|
|
1976
|
-
!
|
|
1978
|
+
k && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: k.label }),
|
|
1979
|
+
!k && 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
|
+
!x && f && /* @__PURE__ */ e(ne, {}),
|
|
1985
|
+
h && !!a && !x && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => o(null) }),
|
|
1986
|
+
/* @__PURE__ */ e(Z, { Icon: be })
|
|
1984
1987
|
] }),
|
|
1985
|
-
/* @__PURE__ */ e(
|
|
1988
|
+
/* @__PURE__ */ e(O, { open: g, 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((N, y) => {
|
|
1986
1989
|
if (!H(N))
|
|
1987
1990
|
return N.kind === "header" ? /* @__PURE__ */ e(
|
|
1988
1991
|
He,
|
|
1989
1992
|
{
|
|
1990
|
-
ref: (
|
|
1991
|
-
|
|
1993
|
+
ref: (z) => {
|
|
1994
|
+
v.current[y] = z;
|
|
1992
1995
|
},
|
|
1993
1996
|
children: N.label
|
|
1994
1997
|
},
|
|
1995
|
-
`header-${
|
|
1998
|
+
`header-${y}`
|
|
1996
1999
|
) : /* @__PURE__ */ e(
|
|
1997
2000
|
$e,
|
|
1998
2001
|
{
|
|
1999
|
-
ref: (
|
|
2000
|
-
|
|
2002
|
+
ref: (z) => {
|
|
2003
|
+
v.current[y] = z;
|
|
2001
2004
|
}
|
|
2002
2005
|
},
|
|
2003
|
-
`divider-${
|
|
2006
|
+
`divider-${y}`
|
|
2004
2007
|
);
|
|
2005
2008
|
const A = G(N.value, a);
|
|
2006
2009
|
return /* @__PURE__ */ e(
|
|
2007
2010
|
We,
|
|
2008
2011
|
{
|
|
2009
|
-
...
|
|
2010
|
-
ref(
|
|
2011
|
-
|
|
2012
|
+
...L({
|
|
2013
|
+
ref(z) {
|
|
2014
|
+
v.current[y] = z;
|
|
2012
2015
|
}
|
|
2013
2016
|
}),
|
|
2014
|
-
onClick: () =>
|
|
2017
|
+
onClick: () => T(y),
|
|
2015
2018
|
selected: A,
|
|
2016
|
-
active:
|
|
2019
|
+
active: u === y,
|
|
2017
2020
|
disabled: N.disabled,
|
|
2018
2021
|
children: N.label
|
|
2019
2022
|
},
|
|
2020
|
-
`option-${
|
|
2023
|
+
`option-${y}`
|
|
2021
2024
|
);
|
|
2022
2025
|
}) }) }) })
|
|
2023
2026
|
] }),
|
|
2024
|
-
/* @__PURE__ */ e(V, { children:
|
|
2025
|
-
/* @__PURE__ */ e(K, { children:
|
|
2027
|
+
/* @__PURE__ */ e(V, { children: l }),
|
|
2028
|
+
/* @__PURE__ */ e(K, { children: f })
|
|
2026
2029
|
]
|
|
2027
2030
|
}
|
|
2028
2031
|
) });
|
|
2029
|
-
},
|
|
2032
|
+
}, zl = (n) => {
|
|
2030
2033
|
const {
|
|
2031
|
-
className:
|
|
2034
|
+
className: t,
|
|
2032
2035
|
label: s,
|
|
2033
|
-
description:
|
|
2036
|
+
description: l,
|
|
2034
2037
|
options: r,
|
|
2035
|
-
onChange:
|
|
2038
|
+
onChange: o,
|
|
2036
2039
|
onSearch: a,
|
|
2037
2040
|
value: i,
|
|
2038
2041
|
placeholder: c,
|
|
2039
|
-
maxHeight:
|
|
2040
|
-
error:
|
|
2041
|
-
size:
|
|
2042
|
+
maxHeight: f = 300,
|
|
2043
|
+
error: w,
|
|
2044
|
+
size: x = "md",
|
|
2042
2045
|
disabled: h = !1,
|
|
2043
|
-
clearable:
|
|
2044
|
-
} =
|
|
2045
|
-
() => N.map((
|
|
2046
|
+
clearable: g = !0
|
|
2047
|
+
} = n, [p, u] = W(!1), [b, C] = W(r), [v, k] = W(""), [I, D] = W(null), O = R.useRef(null), P = R.useRef(null), L = R.useRef([]), T = r?.find((E) => H(E) && G(E.value, i)), N = se(() => v !== "" ? b : r, [v, b, r]), y = se(
|
|
2048
|
+
() => N.map((E, U) => !H(E) || E.disabled ? U : -1).filter((E) => E !== -1),
|
|
2046
2049
|
[N]
|
|
2047
2050
|
);
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
}, [
|
|
2051
|
+
xe(p, () => u(!1)), _(() => {
|
|
2052
|
+
C(a(v));
|
|
2053
|
+
}, [v, r, a]), _(() => {
|
|
2051
2054
|
if (p) {
|
|
2052
|
-
setTimeout(() =>
|
|
2053
|
-
const
|
|
2054
|
-
if (
|
|
2055
|
-
D(
|
|
2055
|
+
setTimeout(() => P.current?.focus(), 100);
|
|
2056
|
+
const E = r.findIndex((U) => H(U) && G(U.value, i));
|
|
2057
|
+
if (E >= 0)
|
|
2058
|
+
D(E);
|
|
2056
2059
|
else {
|
|
2057
|
-
const U = r.findIndex((
|
|
2060
|
+
const U = r.findIndex((le) => H(le) && !le.disabled);
|
|
2058
2061
|
D(U >= 0 ? U : null);
|
|
2059
2062
|
}
|
|
2060
2063
|
} else
|
|
2061
|
-
D(null),
|
|
2064
|
+
D(null), k("");
|
|
2062
2065
|
}, [p]), _(() => {
|
|
2063
2066
|
if (!p) return;
|
|
2064
|
-
const
|
|
2065
|
-
D(
|
|
2066
|
-
}, [
|
|
2067
|
-
const { anchorRef: A, Popover:
|
|
2067
|
+
const E = N.findIndex((U) => H(U) && !U.disabled);
|
|
2068
|
+
D(E >= 0 ? E : null);
|
|
2069
|
+
}, [v, p, N]);
|
|
2070
|
+
const { anchorRef: A, Popover: z, getReferenceProps: $, getItemProps: j } = _e({
|
|
2068
2071
|
placement: "bottom",
|
|
2069
2072
|
fullWidth: !0,
|
|
2070
2073
|
minWidth: 200,
|
|
2071
|
-
onOutsideClick: () => m(!1),
|
|
2072
2074
|
open: p,
|
|
2073
|
-
onOpenChange:
|
|
2074
|
-
listRef:
|
|
2075
|
-
activeIndex:
|
|
2075
|
+
onOpenChange: u,
|
|
2076
|
+
listRef: L,
|
|
2077
|
+
activeIndex: I,
|
|
2076
2078
|
onNavigate: D,
|
|
2077
|
-
disabledIndices:
|
|
2078
|
-
}),
|
|
2079
|
-
const U = N[
|
|
2080
|
-
U && H(U) && !U.disabled && (
|
|
2081
|
-
},
|
|
2082
|
-
return /* @__PURE__ */ e(Q.Provider, { value:
|
|
2079
|
+
disabledIndices: y
|
|
2080
|
+
}), re = (E) => {
|
|
2081
|
+
const U = N[E];
|
|
2082
|
+
U && H(U) && !U.disabled && (o(U.value), u(!1));
|
|
2083
|
+
}, Ne = N.some((E) => H(E));
|
|
2084
|
+
return /* @__PURE__ */ e(Q.Provider, { value: x, 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
2092
|
/* @__PURE__ */ e(q, { children: s }),
|
|
@@ -2093,91 +2095,91 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
|
|
|
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 || u(!p);
|
|
2102
2104
|
},
|
|
2103
|
-
onKeyDown: (
|
|
2104
|
-
h || (
|
|
2105
|
+
onKeyDown: (E) => {
|
|
2106
|
+
h || (E.key === " " ? (E.preventDefault(), u((U) => !U)) : E.key === "Enter" && !p && (E.preventDefault(), u(!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
|
-
Y[
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
h ? "select-trigger-disabled" :
|
|
2111
|
+
te[x],
|
|
2112
|
+
Y[x],
|
|
2113
|
+
me[x],
|
|
2114
|
+
g && i ? Be[x] : fe[x],
|
|
2115
|
+
h ? "select-trigger-disabled" : w && "select-trigger-error",
|
|
2114
2116
|
!h && p && "ring-4"
|
|
2115
2117
|
),
|
|
2116
2118
|
children: [
|
|
2117
|
-
|
|
2118
|
-
!
|
|
2119
|
+
T && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: T.label }),
|
|
2120
|
+
!T && c && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: c })
|
|
2119
2121
|
]
|
|
2120
2122
|
}
|
|
2121
2123
|
),
|
|
2122
|
-
/* @__PURE__ */ d(
|
|
2123
|
-
!h &&
|
|
2124
|
-
|
|
2125
|
-
/* @__PURE__ */ e(Z, { Icon:
|
|
2124
|
+
/* @__PURE__ */ d(he, { children: [
|
|
2125
|
+
!h && w && /* @__PURE__ */ e(ne, {}),
|
|
2126
|
+
g && !!i && !h && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => o(null) }),
|
|
2127
|
+
/* @__PURE__ */ e(Z, { Icon: be })
|
|
2126
2128
|
] }),
|
|
2127
|
-
/* @__PURE__ */ e(
|
|
2129
|
+
/* @__PURE__ */ e(z, { open: p, children: /* @__PURE__ */ d(ve, { className: "gap-0 !p-0", style: { maxHeight: f }, 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: v,
|
|
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) => k(E.target.value),
|
|
2140
|
+
onKeyDown: (E) => {
|
|
2141
|
+
E.key === "Enter" && I != null && (E.preventDefault(), re(I));
|
|
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
|
-
N.map((
|
|
2148
|
-
if (!H(
|
|
2149
|
-
return
|
|
2148
|
+
v !== "" && !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
|
+
N.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
|
+
L.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
|
+
L.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
|
+
L.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: I === 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: l }),
|
|
2191
|
+
/* @__PURE__ */ e(K, { children: w })
|
|
2190
2192
|
]
|
|
2191
2193
|
}
|
|
2192
2194
|
) });
|
|
2193
|
-
},
|
|
2194
|
-
const [s,
|
|
2195
|
+
}, Fr = (n, t) => {
|
|
2196
|
+
const [s, l] = W(n);
|
|
2195
2197
|
return _(() => {
|
|
2196
2198
|
const r = setTimeout(() => {
|
|
2197
|
-
|
|
2198
|
-
},
|
|
2199
|
+
l(n);
|
|
2200
|
+
}, t);
|
|
2199
2201
|
return () => {
|
|
2200
2202
|
clearTimeout(r);
|
|
2201
2203
|
};
|
|
2202
|
-
}, [
|
|
2203
|
-
},
|
|
2204
|
+
}, [n, t]), s;
|
|
2205
|
+
}, Tl = (n) => {
|
|
2204
2206
|
const {
|
|
2205
|
-
className:
|
|
2207
|
+
className: t,
|
|
2206
2208
|
label: s,
|
|
2207
|
-
description:
|
|
2209
|
+
description: l,
|
|
2208
2210
|
onChange: r,
|
|
2209
|
-
fetchOptionsByQuery:
|
|
2211
|
+
fetchOptionsByQuery: o,
|
|
2210
2212
|
fetchOptionByValue: a,
|
|
2211
2213
|
onSearchDebounceMs: i = 300,
|
|
2212
2214
|
value: c,
|
|
2213
|
-
placeholder:
|
|
2214
|
-
maxHeight:
|
|
2215
|
-
error:
|
|
2215
|
+
placeholder: f,
|
|
2216
|
+
maxHeight: w = 300,
|
|
2217
|
+
error: x,
|
|
2216
2218
|
size: h = "md",
|
|
2217
|
-
disabled:
|
|
2219
|
+
disabled: g = !1,
|
|
2218
2220
|
clearable: p = !0
|
|
2219
|
-
} =
|
|
2220
|
-
() =>
|
|
2221
|
-
[
|
|
2221
|
+
} = n, [u, b] = W(!1), C = R.useRef(null), [v, k] = W(""), [I, D] = W([]), [O, P] = W(null), L = R.useRef(null), [T, N] = W(!1), [y, A] = W(!1), [z, $] = W(null), j = R.useRef([]), re = se(
|
|
2222
|
+
() => I.map((M, B) => !H(M) || M.disabled ? B : -1).filter((M) => M !== -1),
|
|
2223
|
+
[I]
|
|
2222
2224
|
);
|
|
2223
|
-
|
|
2224
|
-
const
|
|
2225
|
+
xe(u, () => b(!1));
|
|
2226
|
+
const Ne = Fr(v, i);
|
|
2225
2227
|
_(() => {
|
|
2226
2228
|
(async () => {
|
|
2227
2229
|
N(!0);
|
|
2228
|
-
const
|
|
2229
|
-
D(
|
|
2230
|
+
const B = await o(Ne);
|
|
2231
|
+
D(B), N(!1);
|
|
2230
2232
|
})();
|
|
2231
|
-
}, [
|
|
2233
|
+
}, [Ne, o]), _(() => {
|
|
2232
2234
|
if (c == null) {
|
|
2233
|
-
|
|
2235
|
+
P(null);
|
|
2234
2236
|
return;
|
|
2235
2237
|
}
|
|
2236
|
-
const M =
|
|
2237
|
-
M ?
|
|
2238
|
+
const M = I?.find((B) => H(B) && G(B.value, c));
|
|
2239
|
+
M ? P(M) : (async () => {
|
|
2238
2240
|
A(!0);
|
|
2239
|
-
const
|
|
2240
|
-
|
|
2241
|
+
const oe = await a(c);
|
|
2242
|
+
P(oe), A(!1);
|
|
2241
2243
|
})();
|
|
2242
|
-
}, [a,
|
|
2243
|
-
|
|
2244
|
-
}, [
|
|
2245
|
-
if (!
|
|
2246
|
-
const M =
|
|
2244
|
+
}, [a, I, c]), _(() => {
|
|
2245
|
+
u ? setTimeout(() => L.current?.focus(), 100) : ($(null), k(""));
|
|
2246
|
+
}, [u]), _(() => {
|
|
2247
|
+
if (!u) return;
|
|
2248
|
+
const M = I.findIndex((B) => H(B) && !B.disabled);
|
|
2247
2249
|
$(M >= 0 ? M : null);
|
|
2248
|
-
}, [
|
|
2249
|
-
const { anchorRef:
|
|
2250
|
+
}, [I, u]);
|
|
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: u,
|
|
2256
|
+
onOpenChange: b,
|
|
2256
2257
|
listRef: j,
|
|
2257
|
-
activeIndex:
|
|
2258
|
+
activeIndex: z,
|
|
2258
2259
|
onNavigate: $,
|
|
2259
|
-
disabledIndices:
|
|
2260
|
+
disabledIndices: re
|
|
2260
2261
|
}), Oe = (M) => {
|
|
2261
|
-
const
|
|
2262
|
-
|
|
2263
|
-
}, ze =
|
|
2262
|
+
const B = I[M];
|
|
2263
|
+
B && H(B) && !B.disabled && (r(B.value), b(!1));
|
|
2264
|
+
}, ze = I.some((M) => H(M));
|
|
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
2273
|
/* @__PURE__ */ e(q, { children: s }),
|
|
2273
|
-
/* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref:
|
|
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: C,
|
|
2279
2280
|
role: "button",
|
|
2280
|
-
tabIndex:
|
|
2281
|
-
"aria-disabled":
|
|
2281
|
+
tabIndex: g ? -1 : 0,
|
|
2282
|
+
"aria-disabled": g,
|
|
2282
2283
|
onClick: () => {
|
|
2283
|
-
|
|
2284
|
+
g || b(!u);
|
|
2284
2285
|
},
|
|
2285
2286
|
onKeyDown: (M) => {
|
|
2286
|
-
|
|
2287
|
+
g || (M.key === " " ? (M.preventDefault(), b((B) => !B)) : M.key === "Enter" && !u && (M.preventDefault(), b(!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
|
+
te[h],
|
|
2292
2293
|
Y[h],
|
|
2293
|
-
|
|
2294
|
-
p && c ? Be[h] :
|
|
2295
|
-
|
|
2296
|
-
!
|
|
2294
|
+
me[h],
|
|
2295
|
+
p && c ? Be[h] : fe[h],
|
|
2296
|
+
g ? "select-trigger-disabled" : x && "select-trigger-error",
|
|
2297
|
+
!g && u && "ring-4"
|
|
2297
2298
|
),
|
|
2298
2299
|
children: [
|
|
2299
|
-
!
|
|
2300
|
-
!
|
|
2301
|
-
|
|
2300
|
+
!y && O && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: O.label }),
|
|
2301
|
+
!y && !O && f && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: f }),
|
|
2302
|
+
y && /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-text)]" })
|
|
2302
2303
|
]
|
|
2303
2304
|
}
|
|
2304
2305
|
),
|
|
2305
|
-
/* @__PURE__ */ d(
|
|
2306
|
-
!
|
|
2307
|
-
p && !!c && !
|
|
2308
|
-
/* @__PURE__ */ e(Z, { Icon:
|
|
2306
|
+
/* @__PURE__ */ d(he, { children: [
|
|
2307
|
+
!g && x && /* @__PURE__ */ e(ne, {}),
|
|
2308
|
+
p && !!c && !g && /* @__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: u, children: /* @__PURE__ */ d(ve, { className: "gap-0 !p-0", style: { maxHeight: w }, 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: L,
|
|
2316
2317
|
type: "text",
|
|
2317
2318
|
placeholder: "Search",
|
|
2318
|
-
value:
|
|
2319
|
+
value: v,
|
|
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: (M) =>
|
|
2321
|
+
onChange: (M) => k(M.target.value),
|
|
2321
2322
|
onKeyDown: (M) => {
|
|
2322
|
-
M.key === "Enter" &&
|
|
2323
|
+
M.key === "Enter" && z != null && (M.preventDefault(), Oe(z));
|
|
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
|
-
|
|
2331
|
-
!
|
|
2330
|
+
!T && !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)]" }) }),
|
|
2331
|
+
T && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(Se, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
|
|
2332
|
+
!T && I.map((M, B) => {
|
|
2332
2333
|
if (!H(M))
|
|
2333
2334
|
return M.kind === "header" ? /* @__PURE__ */ e(
|
|
2334
2335
|
He,
|
|
2335
2336
|
{
|
|
2336
|
-
ref: (
|
|
2337
|
-
j.current[
|
|
2337
|
+
ref: (pe) => {
|
|
2338
|
+
j.current[B] = pe;
|
|
2338
2339
|
},
|
|
2339
2340
|
children: M.label
|
|
2340
2341
|
},
|
|
2341
|
-
`header-${
|
|
2342
|
+
`header-${B}`
|
|
2342
2343
|
) : /* @__PURE__ */ e(
|
|
2343
2344
|
$e,
|
|
2344
2345
|
{
|
|
2345
|
-
ref: (
|
|
2346
|
-
j.current[
|
|
2346
|
+
ref: (pe) => {
|
|
2347
|
+
j.current[B] = pe;
|
|
2347
2348
|
}
|
|
2348
2349
|
},
|
|
2349
|
-
`divider-${
|
|
2350
|
+
`divider-${B}`
|
|
2350
2351
|
);
|
|
2351
|
-
const
|
|
2352
|
+
const oe = G(M.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[B] = pe;
|
|
2358
2359
|
}
|
|
2359
2360
|
}),
|
|
2360
|
-
onClick: () => Oe(
|
|
2361
|
-
selected:
|
|
2362
|
-
active:
|
|
2361
|
+
onClick: () => Oe(B),
|
|
2362
|
+
selected: oe,
|
|
2363
|
+
active: z === B,
|
|
2363
2364
|
disabled: M.disabled,
|
|
2364
2365
|
children: M.label
|
|
2365
2366
|
},
|
|
2366
|
-
`option-${
|
|
2367
|
+
`option-${B}`
|
|
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: l }),
|
|
2374
|
+
/* @__PURE__ */ e(K, { children: x })
|
|
2374
2375
|
]
|
|
2375
2376
|
}
|
|
2376
2377
|
) });
|
|
@@ -2399,410 +2400,409 @@ 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 =
|
|
2403
|
+
}, Ee = R.forwardRef((n, t) => {
|
|
2403
2404
|
const {
|
|
2404
2405
|
className: s,
|
|
2405
|
-
children:
|
|
2406
|
+
children: l,
|
|
2406
2407
|
onClick: r,
|
|
2407
|
-
showCloseIcon:
|
|
2408
|
+
showCloseIcon: o,
|
|
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
|
s
|
|
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
|
-
|
|
2424
|
-
|
|
2423
|
+
/* @__PURE__ */ e("div", { className: "break-all line-clamp-1 text-left", children: l }),
|
|
2424
|
+
o && /* @__PURE__ */ e(
|
|
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: l })
|
|
2434
2435
|
] });
|
|
2435
2436
|
});
|
|
2436
|
-
function
|
|
2437
|
+
function Br(n) {
|
|
2437
2438
|
const {
|
|
2438
|
-
enabled:
|
|
2439
|
+
enabled: t,
|
|
2439
2440
|
triggerRef: s,
|
|
2440
|
-
measureRef:
|
|
2441
|
+
measureRef: l,
|
|
2441
2442
|
trayRef: r,
|
|
2442
|
-
itemCount:
|
|
2443
|
+
itemCount: o,
|
|
2443
2444
|
deps: a = [],
|
|
2444
2445
|
gap: i = 4
|
|
2445
|
-
} =
|
|
2446
|
-
return
|
|
2447
|
-
if (!
|
|
2448
|
-
const
|
|
2449
|
-
if (!
|
|
2446
|
+
} = n, [c, f] = W(0);
|
|
2447
|
+
return It(() => {
|
|
2448
|
+
if (!t) return;
|
|
2449
|
+
const w = s.current, x = l.current;
|
|
2450
|
+
if (!w || !x) return;
|
|
2450
2451
|
const h = () => {
|
|
2451
|
-
if (
|
|
2452
|
-
|
|
2452
|
+
if (o === 0) {
|
|
2453
|
+
f(0);
|
|
2453
2454
|
return;
|
|
2454
2455
|
}
|
|
2455
|
-
if (
|
|
2456
|
-
|
|
2456
|
+
if (o === 1) {
|
|
2457
|
+
f(1);
|
|
2457
2458
|
return;
|
|
2458
2459
|
}
|
|
2459
|
-
const p = window.getComputedStyle(
|
|
2460
|
-
let
|
|
2461
|
-
const
|
|
2462
|
-
if (
|
|
2463
|
-
const N =
|
|
2464
|
-
N.width > 0 && (
|
|
2460
|
+
const p = window.getComputedStyle(w), u = parseFloat(p.paddingLeft || "0"), b = w.getBoundingClientRect(), C = b.left + u;
|
|
2461
|
+
let v = b.right - parseFloat(p.paddingRight || "0");
|
|
2462
|
+
const k = r?.current;
|
|
2463
|
+
if (k) {
|
|
2464
|
+
const N = k.getBoundingClientRect();
|
|
2465
|
+
N.width > 0 && (v = Math.min(v, N.left - i));
|
|
2465
2466
|
}
|
|
2466
|
-
const
|
|
2467
|
-
if (D.length <
|
|
2468
|
-
let
|
|
2469
|
-
for (let N = 0; N <
|
|
2470
|
-
|
|
2471
|
-
if (
|
|
2472
|
-
|
|
2467
|
+
const I = Math.max(0, v - C), D = Array.from(x.children);
|
|
2468
|
+
if (D.length < o + 1) return;
|
|
2469
|
+
let O = 0;
|
|
2470
|
+
for (let N = 0; N < o; N++)
|
|
2471
|
+
O += D[N].offsetWidth + (N > 0 ? i : 0);
|
|
2472
|
+
if (O <= I) {
|
|
2473
|
+
f(o);
|
|
2473
2474
|
return;
|
|
2474
2475
|
}
|
|
2475
|
-
const
|
|
2476
|
-
let
|
|
2477
|
-
for (let N = 0; N <
|
|
2478
|
-
const
|
|
2479
|
-
if (A +
|
|
2480
|
-
|
|
2476
|
+
const P = D[o].offsetWidth;
|
|
2477
|
+
let L = 0, T = 0;
|
|
2478
|
+
for (let N = 0; N < o; N++) {
|
|
2479
|
+
const y = D[N].offsetWidth, A = L + y + (N > 0 ? i : 0);
|
|
2480
|
+
if (A + P + i > I) break;
|
|
2481
|
+
L = A, T++;
|
|
2481
2482
|
}
|
|
2482
|
-
|
|
2483
|
-
},
|
|
2484
|
-
return
|
|
2485
|
-
}, [
|
|
2483
|
+
f(Math.max(1, T));
|
|
2484
|
+
}, g = new ResizeObserver(h);
|
|
2485
|
+
return g.observe(w), r?.current && g.observe(r.current), h(), () => g.disconnect();
|
|
2486
|
+
}, [t, o, ...a]), c;
|
|
2486
2487
|
}
|
|
2487
|
-
const
|
|
2488
|
+
const Pl = (n) => {
|
|
2488
2489
|
const {
|
|
2489
|
-
className:
|
|
2490
|
+
className: t,
|
|
2490
2491
|
label: s,
|
|
2491
|
-
description:
|
|
2492
|
+
description: l,
|
|
2492
2493
|
options: r,
|
|
2493
|
-
onChange:
|
|
2494
|
+
onChange: o,
|
|
2494
2495
|
onSearch: a,
|
|
2495
2496
|
value: i,
|
|
2496
2497
|
placeholder: c,
|
|
2497
|
-
maxHeight:
|
|
2498
|
-
error:
|
|
2499
|
-
size:
|
|
2498
|
+
maxHeight: f = 300,
|
|
2499
|
+
error: w,
|
|
2500
|
+
size: x = "md",
|
|
2500
2501
|
singleLine: h = !1,
|
|
2501
|
-
color:
|
|
2502
|
+
color: g = "blue",
|
|
2502
2503
|
disabled: p = !1,
|
|
2503
|
-
clearable:
|
|
2504
|
-
} =
|
|
2505
|
-
() => i.map((S) => r.find((
|
|
2504
|
+
clearable: u = !0
|
|
2505
|
+
} = n, [b, C] = W(!1), [v, k] = W(r), [I, D] = W(""), [O, P] = W(null), L = R.useRef(null), T = R.useRef(null), N = R.useRef([]), y = R.useRef(null), A = R.useRef(null), z = se(
|
|
2506
|
+
() => i.map((S) => r.find((F) => H(F) && G(F.value, S))).filter((S) => S !== void 0),
|
|
2506
2507
|
[i, r]
|
|
2507
2508
|
), $ = (S) => {
|
|
2508
2509
|
if (S === "") return r;
|
|
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((S,
|
|
2510
|
+
const F = S.toLowerCase();
|
|
2511
|
+
return r.filter((Ie) => H(Ie) && typeof Ie.label == "string" ? Ie.label.toLowerCase().includes(F) : !0);
|
|
2512
|
+
}, j = se(
|
|
2513
|
+
() => I !== "" ? v : r,
|
|
2514
|
+
[I, v, r]
|
|
2515
|
+
), re = se(
|
|
2516
|
+
() => j.map((S, F) => !H(S) || S.disabled ? F : -1).filter((S) => S !== -1),
|
|
2516
2517
|
[j]
|
|
2517
2518
|
);
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
}, [
|
|
2521
|
-
if (
|
|
2522
|
-
setTimeout(() =>
|
|
2523
|
-
const S = r.findIndex((
|
|
2524
|
-
|
|
2519
|
+
xe(b, () => C(!1)), _(() => {
|
|
2520
|
+
k((a ?? $)(I));
|
|
2521
|
+
}, [I, r, a]), _(() => {
|
|
2522
|
+
if (b) {
|
|
2523
|
+
setTimeout(() => T.current?.focus(), 100);
|
|
2524
|
+
const S = r.findIndex((F) => H(F) && !F.disabled);
|
|
2525
|
+
P(S >= 0 ? S : null);
|
|
2525
2526
|
} else
|
|
2526
|
-
|
|
2527
|
-
}, [
|
|
2528
|
-
if (!
|
|
2529
|
-
const S = j.findIndex((
|
|
2530
|
-
|
|
2531
|
-
}, [
|
|
2532
|
-
const
|
|
2527
|
+
P(null), D("");
|
|
2528
|
+
}, [b]), _(() => {
|
|
2529
|
+
if (!b) return;
|
|
2530
|
+
const S = j.findIndex((F) => H(F) && !F.disabled);
|
|
2531
|
+
P(S >= 0 ? S : null);
|
|
2532
|
+
}, [I, b, j]);
|
|
2533
|
+
const Ne = Br({
|
|
2533
2534
|
enabled: h,
|
|
2534
|
-
triggerRef:
|
|
2535
|
-
measureRef:
|
|
2535
|
+
triggerRef: L,
|
|
2536
|
+
measureRef: y,
|
|
2536
2537
|
trayRef: A,
|
|
2537
|
-
itemCount:
|
|
2538
|
-
deps: [
|
|
2539
|
-
}), { anchorRef:
|
|
2538
|
+
itemCount: z.length,
|
|
2539
|
+
deps: [z, w]
|
|
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
|
-
onOpenChange: u,
|
|
2544
|
+
open: b,
|
|
2545
|
+
onOpenChange: C,
|
|
2546
2546
|
listRef: N,
|
|
2547
|
-
activeIndex:
|
|
2548
|
-
onNavigate:
|
|
2549
|
-
disabledIndices:
|
|
2547
|
+
activeIndex: O,
|
|
2548
|
+
onNavigate: P,
|
|
2549
|
+
disabledIndices: re
|
|
2550
2550
|
}), Oe = (S) => {
|
|
2551
|
-
i.some((
|
|
2551
|
+
i.some((F) => G(F, S)) ? o(i.filter((F) => !G(F, S))) : o([...i, S]);
|
|
2552
2552
|
}, ze = (S) => {
|
|
2553
|
-
const
|
|
2554
|
-
|
|
2555
|
-
}, M = j.some((S) => H(S)),
|
|
2556
|
-
return /* @__PURE__ */ e(Q.Provider, { value:
|
|
2553
|
+
const F = j[S];
|
|
2554
|
+
F && H(F) && !F.disabled && Oe(F.value);
|
|
2555
|
+
}, M = j.some((S) => H(S)), B = i.length > 0, oe = h ? Ne : z.length, pe = z.slice(0, oe), ut = z.length - oe;
|
|
2556
|
+
return /* @__PURE__ */ e(Q.Provider, { value: x, 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
2564
|
/* @__PURE__ */ e(q, { children: s }),
|
|
2565
|
-
/* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref:
|
|
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: L,
|
|
2571
2571
|
role: "button",
|
|
2572
2572
|
tabIndex: p ? -1 : 0,
|
|
2573
2573
|
"aria-disabled": p,
|
|
2574
2574
|
onClick: () => {
|
|
2575
|
-
p ||
|
|
2575
|
+
p || C(!b);
|
|
2576
2576
|
},
|
|
2577
2577
|
onKeyDown: (S) => {
|
|
2578
|
-
p || (S.key === " " ? (S.preventDefault(),
|
|
2578
|
+
p || (S.key === " " ? (S.preventDefault(), C((F) => !F)) : S.key === "Enter" && !b ? (S.preventDefault(), C(!0)) : S.key === "Backspace" && !b && B && (S.preventDefault(), o(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
|
-
Y[
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
p ? "select-trigger-disabled" :
|
|
2589
|
-
!p &&
|
|
2583
|
+
h && m("flex-nowrap overflow-hidden", te[x]),
|
|
2584
|
+
!h && m("flex-wrap py-1.5", Ft[x]),
|
|
2585
|
+
Y[x],
|
|
2586
|
+
me[x],
|
|
2587
|
+
u && B ? Be[x] : fe[x],
|
|
2588
|
+
p ? "select-trigger-disabled" : w && "select-trigger-error",
|
|
2589
|
+
!p && b && "ring-4"
|
|
2590
2590
|
),
|
|
2591
2591
|
children: [
|
|
2592
|
-
|
|
2592
|
+
B && pe.map((S, F) => /* @__PURE__ */ e(
|
|
2593
2593
|
Ee,
|
|
2594
2594
|
{
|
|
2595
|
-
color:
|
|
2596
|
-
className:
|
|
2597
|
-
h &&
|
|
2598
|
-
(!h ||
|
|
2595
|
+
color: g,
|
|
2596
|
+
className: m(
|
|
2597
|
+
h && oe > 1 && "shrink-0",
|
|
2598
|
+
(!h || oe === 1) && "max-w-full min-w-0"
|
|
2599
2599
|
),
|
|
2600
2600
|
children: S.label
|
|
2601
2601
|
},
|
|
2602
|
-
`badge-${
|
|
2602
|
+
`badge-${F}`
|
|
2603
2603
|
)),
|
|
2604
|
-
|
|
2604
|
+
B && 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
|
+
!B && 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: y,
|
|
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
|
+
z.map((S, F) => /* @__PURE__ */ e(Ee, { color: g, children: S.label }, `measure-${F}`)),
|
|
2621
|
+
z.length > 0 && /* @__PURE__ */ d("span", { className: "text-sm font-medium px-1", children: [
|
|
2622
2622
|
"+",
|
|
2623
|
-
|
|
2623
|
+
z.length,
|
|
2624
2624
|
" more"
|
|
2625
2625
|
] })
|
|
2626
2626
|
]
|
|
2627
2627
|
}
|
|
2628
2628
|
),
|
|
2629
|
-
/* @__PURE__ */ d(
|
|
2630
|
-
!p &&
|
|
2631
|
-
|
|
2632
|
-
/* @__PURE__ */ e(Z, { Icon:
|
|
2629
|
+
/* @__PURE__ */ d(he, { ref: A, children: [
|
|
2630
|
+
!p && w && /* @__PURE__ */ e(ne, {}),
|
|
2631
|
+
u && B && !p && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => o([]) }),
|
|
2632
|
+
/* @__PURE__ */ e(Z, { Icon: be })
|
|
2633
2633
|
] }),
|
|
2634
|
-
/* @__PURE__ */ e(U, { open:
|
|
2634
|
+
/* @__PURE__ */ e(U, { open: b, children: /* @__PURE__ */ d(ve, { className: "gap-0 !p-0", style: { maxHeight: f }, 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",
|
|
2638
2638
|
{
|
|
2639
|
-
ref:
|
|
2639
|
+
ref: T,
|
|
2640
2640
|
type: "text",
|
|
2641
2641
|
placeholder: "Search",
|
|
2642
|
-
value:
|
|
2642
|
+
value: I,
|
|
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
2644
|
onChange: (S) => D(S.target.value),
|
|
2645
2645
|
onKeyDown: (S) => {
|
|
2646
|
-
S.key === "Enter" &&
|
|
2646
|
+
S.key === "Enter" && O != null ? (S.preventDefault(), ze(O)) : S.key === "Backspace" && I === "" && B && (S.preventDefault(), o(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((S,
|
|
2653
|
+
I !== "" && !M && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
|
|
2654
|
+
j.map((S, F) => {
|
|
2655
2655
|
if (!H(S))
|
|
2656
2656
|
return S.kind === "header" ? /* @__PURE__ */ e(
|
|
2657
2657
|
He,
|
|
2658
2658
|
{
|
|
2659
|
-
ref: (
|
|
2660
|
-
N.current[
|
|
2659
|
+
ref: (ge) => {
|
|
2660
|
+
N.current[F] = ge;
|
|
2661
2661
|
},
|
|
2662
2662
|
children: S.label
|
|
2663
2663
|
},
|
|
2664
|
-
`header-${
|
|
2664
|
+
`header-${F}`
|
|
2665
2665
|
) : /* @__PURE__ */ e(
|
|
2666
2666
|
$e,
|
|
2667
2667
|
{
|
|
2668
|
-
ref: (
|
|
2669
|
-
N.current[
|
|
2668
|
+
ref: (ge) => {
|
|
2669
|
+
N.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, S.value));
|
|
2675
2675
|
return /* @__PURE__ */ e(
|
|
2676
2676
|
We,
|
|
2677
2677
|
{
|
|
2678
2678
|
...ee({
|
|
2679
|
-
ref(
|
|
2680
|
-
N.current[
|
|
2679
|
+
ref(ge) {
|
|
2680
|
+
N.current[F] = ge;
|
|
2681
2681
|
}
|
|
2682
2682
|
}),
|
|
2683
|
-
onClick: () => ze(
|
|
2683
|
+
onClick: () => ze(F),
|
|
2684
2684
|
selected: Ie,
|
|
2685
|
-
active:
|
|
2685
|
+
active: O === F,
|
|
2686
2686
|
disabled: S.disabled,
|
|
2687
2687
|
children: S.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: l }),
|
|
2696
|
+
/* @__PURE__ */ e(K, { children: w })
|
|
2697
2697
|
]
|
|
2698
2698
|
}
|
|
2699
2699
|
) });
|
|
2700
|
-
}, Ll =
|
|
2700
|
+
}, Ll = R.forwardRef((n, t) => {
|
|
2701
2701
|
const {
|
|
2702
2702
|
className: s,
|
|
2703
|
-
children:
|
|
2703
|
+
children: l,
|
|
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
|
s
|
|
2713
2713
|
),
|
|
2714
2714
|
...r,
|
|
2715
|
-
children:
|
|
2715
|
+
children: l
|
|
2716
2716
|
}
|
|
2717
2717
|
);
|
|
2718
|
-
}),
|
|
2718
|
+
}), El = R.forwardRef((n, t) => {
|
|
2719
2719
|
const {
|
|
2720
2720
|
className: s,
|
|
2721
|
-
children:
|
|
2721
|
+
children: l,
|
|
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
|
s
|
|
2731
2731
|
),
|
|
2732
2732
|
...r,
|
|
2733
|
-
children:
|
|
2733
|
+
children: l
|
|
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:
|
|
2738
|
+
className: t,
|
|
2739
2739
|
label: s,
|
|
2740
|
-
children:
|
|
2740
|
+
children: l,
|
|
2741
2741
|
orientation: r = "vertical",
|
|
2742
|
-
...
|
|
2743
|
-
} =
|
|
2742
|
+
...o
|
|
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
|
+
...o,
|
|
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: s }),
|
|
2754
|
+
/* @__PURE__ */ e("div", { className: "w-1/2 line-clamp-1 break-all", children: l })
|
|
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
|
+
...o,
|
|
2765
2765
|
children: [
|
|
2766
2766
|
s && /* @__PURE__ */ e("div", { className: yt, children: s }),
|
|
2767
|
-
/* @__PURE__ */ e("div", { children:
|
|
2767
|
+
/* @__PURE__ */ e("div", { children: l })
|
|
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:
|
|
2783
|
+
className: t,
|
|
2784
2784
|
children: s,
|
|
2785
|
-
Icon:
|
|
2785
|
+
Icon: l,
|
|
2786
2786
|
status: r,
|
|
2787
|
-
...
|
|
2788
|
-
} =
|
|
2787
|
+
...o
|
|
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
|
-
|
|
2790
|
+
l && /* @__PURE__ */ e(l, { className: "h-5 w-5 shrink-0" }),
|
|
2791
2791
|
/* @__PURE__ */ e("span", { className: "truncate", children: s })
|
|
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
|
-
if (
|
|
2799
|
-
const { href: c, ...
|
|
2798
|
+
if (o.href !== void 0) {
|
|
2799
|
+
const { href: c, ...f } = o;
|
|
2800
2800
|
return /* @__PURE__ */ e(
|
|
2801
2801
|
"a",
|
|
2802
2802
|
{
|
|
2803
2803
|
href: c,
|
|
2804
|
-
className:
|
|
2805
|
-
...
|
|
2804
|
+
className: m(kt, t),
|
|
2805
|
+
...f,
|
|
2806
2806
|
children: i
|
|
2807
2807
|
}
|
|
2808
2808
|
);
|
|
@@ -2810,66 +2810,66 @@ const Tl = (t) => {
|
|
|
2810
2810
|
return /* @__PURE__ */ e(
|
|
2811
2811
|
"button",
|
|
2812
2812
|
{
|
|
2813
|
-
className:
|
|
2814
|
-
...
|
|
2813
|
+
className: m(kt, t),
|
|
2814
|
+
...o,
|
|
2815
2815
|
children: i
|
|
2816
2816
|
}
|
|
2817
2817
|
);
|
|
2818
|
-
},
|
|
2818
|
+
}, Bl = (n) => {
|
|
2819
2819
|
const {
|
|
2820
|
-
className:
|
|
2820
|
+
className: t,
|
|
2821
2821
|
vertical: s = !1,
|
|
2822
|
-
...
|
|
2823
|
-
} =
|
|
2822
|
+
...l
|
|
2823
|
+
} = n;
|
|
2824
2824
|
return /* @__PURE__ */ e(
|
|
2825
2825
|
"div",
|
|
2826
2826
|
{
|
|
2827
|
-
className:
|
|
2827
|
+
className: m(
|
|
2828
2828
|
s ? "w-px h-full bg-[var(--color-divider)]" : "w-full h-px bg-[var(--color-divider)]",
|
|
2829
|
-
|
|
2829
|
+
t
|
|
2830
2830
|
),
|
|
2831
|
-
...
|
|
2831
|
+
...l
|
|
2832
2832
|
}
|
|
2833
2833
|
);
|
|
2834
|
-
},
|
|
2834
|
+
}, Al = (n) => {
|
|
2835
2835
|
const {
|
|
2836
|
-
children:
|
|
2836
|
+
children: t,
|
|
2837
2837
|
content: s,
|
|
2838
|
-
className:
|
|
2838
|
+
className: l,
|
|
2839
2839
|
placement: r = "top",
|
|
2840
|
-
minWidth:
|
|
2840
|
+
minWidth: o = 100,
|
|
2841
2841
|
maxWidth: a = 200
|
|
2842
|
-
} =
|
|
2842
|
+
} = n, [i, c] = W(!1), { anchorRef: f, Popover: w } = ct({
|
|
2843
2843
|
placement: r,
|
|
2844
|
-
minWidth:
|
|
2844
|
+
minWidth: o,
|
|
2845
2845
|
maxWidth: a
|
|
2846
2846
|
});
|
|
2847
2847
|
return /* @__PURE__ */ d(
|
|
2848
2848
|
"span",
|
|
2849
2849
|
{
|
|
2850
|
-
ref:
|
|
2851
|
-
className:
|
|
2850
|
+
ref: f,
|
|
2851
|
+
className: l,
|
|
2852
2852
|
onMouseEnter: () => c(!0),
|
|
2853
2853
|
onMouseLeave: () => c(!1),
|
|
2854
2854
|
children: [
|
|
2855
|
-
|
|
2856
|
-
/* @__PURE__ */ e(
|
|
2855
|
+
t,
|
|
2856
|
+
/* @__PURE__ */ e(w, { open: i, children: /* @__PURE__ */ e(ve, { children: s }) })
|
|
2857
2857
|
]
|
|
2858
2858
|
}
|
|
2859
2859
|
);
|
|
2860
|
-
},
|
|
2860
|
+
}, Ul = (n) => {
|
|
2861
2861
|
const {
|
|
2862
|
-
open:
|
|
2862
|
+
open: t,
|
|
2863
2863
|
onDismiss: s,
|
|
2864
|
-
enableDismissOnOutsideClick:
|
|
2864
|
+
enableDismissOnOutsideClick: l,
|
|
2865
2865
|
enableDismissOnEscKey: r,
|
|
2866
|
-
enableDismissButton:
|
|
2866
|
+
enableDismissButton: o,
|
|
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, s || (() => {
|
|
2872
|
+
})), /* @__PURE__ */ e(De, { children: t && /* @__PURE__ */ d(Me, { children: [
|
|
2873
2873
|
/* @__PURE__ */ e(
|
|
2874
2874
|
J.div,
|
|
2875
2875
|
{
|
|
@@ -2880,10 +2880,10 @@ 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: l ? s : void 0,
|
|
2887
2887
|
lockScroll: !0
|
|
2888
2888
|
}
|
|
2889
2889
|
)
|
|
@@ -2892,7 +2892,7 @@ const Tl = (t) => {
|
|
|
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
|
J.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
|
),
|
|
@@ -2902,10 +2902,10 @@ const Tl = (t) => {
|
|
|
2902
2902
|
exit: { opacity: 0, scale: 0.98, translateY: 10 },
|
|
2903
2903
|
transition: { duration: 0.15, ease: "easeInOut" },
|
|
2904
2904
|
children: [
|
|
2905
|
-
|
|
2906
|
-
|
|
2905
|
+
o && /* @__PURE__ */ e(
|
|
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",
|
|
@@ -2917,19 +2917,19 @@ const Tl = (t) => {
|
|
|
2917
2917
|
}
|
|
2918
2918
|
) })
|
|
2919
2919
|
] }) });
|
|
2920
|
-
},
|
|
2920
|
+
}, Wl = (n) => {
|
|
2921
2921
|
const {
|
|
2922
|
-
open:
|
|
2922
|
+
open: t,
|
|
2923
2923
|
onDismiss: s,
|
|
2924
|
-
enableDismissOnOutsideClick:
|
|
2924
|
+
enableDismissOnOutsideClick: l,
|
|
2925
2925
|
enableDismissOnEscKey: r,
|
|
2926
|
-
enableDismissButton:
|
|
2926
|
+
enableDismissButton: o,
|
|
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, s || (() => {
|
|
2932
|
+
})), /* @__PURE__ */ e(De, { children: t && /* @__PURE__ */ d(Me, { children: [
|
|
2933
2933
|
/* @__PURE__ */ e(
|
|
2934
2934
|
J.div,
|
|
2935
2935
|
{
|
|
@@ -2940,10 +2940,10 @@ 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: l ? s : void 0,
|
|
2947
2947
|
lockScroll: !0
|
|
2948
2948
|
}
|
|
2949
2949
|
)
|
|
@@ -2952,7 +2952,7 @@ const Tl = (t) => {
|
|
|
2952
2952
|
/* @__PURE__ */ e("div", { className: "fixed inset-0 flex flex-row justify-end pointer-events-none z-50", children: /* @__PURE__ */ d(
|
|
2953
2953
|
J.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
|
),
|
|
@@ -2962,10 +2962,10 @@ const Tl = (t) => {
|
|
|
2962
2962
|
exit: { translateX: "100%" },
|
|
2963
2963
|
transition: { duration: 0.25, ease: [0.32, 0.72, 0, 1] },
|
|
2964
2964
|
children: [
|
|
2965
|
-
|
|
2966
|
-
|
|
2965
|
+
o && /* @__PURE__ */ e(
|
|
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",
|
|
@@ -2977,186 +2977,186 @@ const Tl = (t) => {
|
|
|
2977
2977
|
}
|
|
2978
2978
|
) })
|
|
2979
2979
|
] }) });
|
|
2980
|
-
},
|
|
2980
|
+
}, Wr = (n) => {
|
|
2981
2981
|
const {
|
|
2982
|
-
className:
|
|
2982
|
+
className: t,
|
|
2983
2983
|
tabs: s
|
|
2984
|
-
} =
|
|
2985
|
-
return /* @__PURE__ */ e("div", { className:
|
|
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: s.map((
|
|
2989
|
-
const
|
|
2987
|
+
t
|
|
2988
|
+
), children: s.map((l, r) => {
|
|
2989
|
+
const o = 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
|
+
l.active && "tab-button-active shadow-sm"
|
|
2992
2992
|
);
|
|
2993
|
-
return
|
|
2993
|
+
return l.href ? /* @__PURE__ */ d(
|
|
2994
2994
|
"a",
|
|
2995
2995
|
{
|
|
2996
|
-
href:
|
|
2997
|
-
className:
|
|
2996
|
+
href: l.href,
|
|
2997
|
+
className: o,
|
|
2998
2998
|
children: [
|
|
2999
|
-
|
|
3000
|
-
|
|
2999
|
+
l.Icon && /* @__PURE__ */ e(l.Icon, { className: "h-5 w-5 shrink-0 mr-2 -ml-1" }),
|
|
3000
|
+
l.label
|
|
3001
3001
|
]
|
|
3002
3002
|
},
|
|
3003
3003
|
r
|
|
3004
3004
|
) : /* @__PURE__ */ d(
|
|
3005
3005
|
"button",
|
|
3006
3006
|
{
|
|
3007
|
-
className:
|
|
3008
|
-
onClick:
|
|
3007
|
+
className: o,
|
|
3008
|
+
onClick: l.onClick,
|
|
3009
3009
|
children: [
|
|
3010
|
-
|
|
3011
|
-
|
|
3010
|
+
l.Icon && /* @__PURE__ */ e(l.Icon, { className: "h-5 w-5 shrink-0 mr-2 -ml-1" }),
|
|
3011
|
+
l.label
|
|
3012
3012
|
]
|
|
3013
3013
|
},
|
|
3014
3014
|
r
|
|
3015
3015
|
);
|
|
3016
3016
|
}) });
|
|
3017
|
-
},
|
|
3017
|
+
}, Hl = (n) => {
|
|
3018
3018
|
const {
|
|
3019
|
-
duration:
|
|
3019
|
+
duration: t = 0.3,
|
|
3020
3020
|
ease: s = "easeInOut",
|
|
3021
|
-
horizontal:
|
|
3021
|
+
horizontal: l = !1,
|
|
3022
3022
|
children: r,
|
|
3023
|
-
className:
|
|
3023
|
+
className: o,
|
|
3024
3024
|
...a
|
|
3025
|
-
} =
|
|
3026
|
-
return
|
|
3027
|
-
const
|
|
3028
|
-
if (!
|
|
3025
|
+
} = n, i = R.useRef(null), c = R.useRef(null), f = R.useRef(null);
|
|
3026
|
+
return R.useEffect(() => {
|
|
3027
|
+
const w = i.current, x = c.current;
|
|
3028
|
+
if (!w || !x) return;
|
|
3029
3029
|
let h = !0;
|
|
3030
|
-
const
|
|
3031
|
-
const
|
|
3032
|
-
if (!(
|
|
3030
|
+
const g = () => {
|
|
3031
|
+
const u = l ? w.scrollWidth - w.clientWidth : w.scrollHeight - w.clientHeight, b = l ? w.scrollLeft : w.scrollTop;
|
|
3032
|
+
if (!(u <= 0 || Math.abs(u - b) < 1)) {
|
|
3033
3033
|
if (h) {
|
|
3034
|
-
h = !1,
|
|
3034
|
+
h = !1, l ? w.scrollLeft = u : w.scrollTop = u;
|
|
3035
3035
|
return;
|
|
3036
3036
|
}
|
|
3037
|
-
|
|
3038
|
-
duration:
|
|
3037
|
+
f.current?.stop(), f.current = Kt(b, u, {
|
|
3038
|
+
duration: t,
|
|
3039
3039
|
ease: s,
|
|
3040
|
-
onUpdate: (
|
|
3041
|
-
|
|
3040
|
+
onUpdate: (C) => {
|
|
3041
|
+
l ? w.scrollLeft = C : w.scrollTop = C;
|
|
3042
3042
|
}
|
|
3043
3043
|
});
|
|
3044
3044
|
}
|
|
3045
|
-
}, p = new ResizeObserver(
|
|
3046
|
-
return p.observe(
|
|
3047
|
-
p.disconnect(),
|
|
3045
|
+
}, p = new ResizeObserver(g);
|
|
3046
|
+
return p.observe(x), () => {
|
|
3047
|
+
p.disconnect(), f.current?.stop();
|
|
3048
3048
|
};
|
|
3049
|
-
}, [
|
|
3049
|
+
}, [t, s, l]), /* @__PURE__ */ e(
|
|
3050
3050
|
"div",
|
|
3051
3051
|
{
|
|
3052
3052
|
ref: i,
|
|
3053
|
-
className:
|
|
3053
|
+
className: m(
|
|
3054
3054
|
"min-h-0 min-w-0",
|
|
3055
|
-
|
|
3056
|
-
|
|
3055
|
+
l ? "overflow-x-auto" : "overflow-y-auto",
|
|
3056
|
+
o
|
|
3057
3057
|
),
|
|
3058
3058
|
...a,
|
|
3059
3059
|
children: /* @__PURE__ */ e("div", { ref: c, children: r })
|
|
3060
3060
|
}
|
|
3061
3061
|
);
|
|
3062
3062
|
};
|
|
3063
|
-
function
|
|
3063
|
+
function Hr(n) {
|
|
3064
3064
|
const {
|
|
3065
|
-
onDelta:
|
|
3065
|
+
onDelta: t,
|
|
3066
3066
|
onDragStart: s,
|
|
3067
|
-
onDragEnd:
|
|
3067
|
+
onDragEnd: l,
|
|
3068
3068
|
disabled: r = !1,
|
|
3069
|
-
primaryButtonOnly:
|
|
3069
|
+
primaryButtonOnly: o = !0,
|
|
3070
3070
|
preventScrollOnMove: a = !0
|
|
3071
|
-
} =
|
|
3072
|
-
|
|
3073
|
-
|
|
3071
|
+
} = n, [i, c] = R.useState(!1), f = R.useRef(!1), w = R.useRef(0), x = R.useRef(0), h = R.useRef(0), g = R.useRef(null), p = R.useRef(null), u = R.useRef({ onDelta: t, onDragStart: s, onDragEnd: l, preventScrollOnMove: a });
|
|
3072
|
+
R.useEffect(() => {
|
|
3073
|
+
u.current = { onDelta: t, onDragStart: s, onDragEnd: l, preventScrollOnMove: a };
|
|
3074
3074
|
});
|
|
3075
|
-
const
|
|
3076
|
-
if (!
|
|
3077
|
-
const
|
|
3078
|
-
clientX:
|
|
3079
|
-
startX:
|
|
3075
|
+
const b = R.useRef({}), C = R.useCallback((k) => {
|
|
3076
|
+
if (!f.current) return;
|
|
3077
|
+
const I = {
|
|
3078
|
+
clientX: k ?? x.current,
|
|
3079
|
+
startX: w.current,
|
|
3080
3080
|
totalDeltaX: h.current,
|
|
3081
|
-
target:
|
|
3081
|
+
target: g.current
|
|
3082
3082
|
};
|
|
3083
|
-
|
|
3084
|
-
const { move: D, up:
|
|
3085
|
-
D && window.removeEventListener("pointermove", D, !0),
|
|
3086
|
-
}, []),
|
|
3087
|
-
if (r ||
|
|
3088
|
-
|
|
3089
|
-
const
|
|
3090
|
-
clientX:
|
|
3091
|
-
startX:
|
|
3083
|
+
f.current = !1, c(!1);
|
|
3084
|
+
const { move: D, up: O, keydown: P } = b.current;
|
|
3085
|
+
D && window.removeEventListener("pointermove", D, !0), O && (window.removeEventListener("pointerup", O, !0), window.removeEventListener("pointercancel", O, !0)), P && window.removeEventListener("keydown", P, !0), b.current = {}, p.current != null && (cancelAnimationFrame(p.current), p.current = null), u.current.onDragEnd?.(I), g.current = null, h.current = 0;
|
|
3086
|
+
}, []), v = R.useCallback((k) => {
|
|
3087
|
+
if (r || o && k.button !== 0) return;
|
|
3088
|
+
k.target.setPointerCapture?.(k.pointerId), w.current = k.clientX, x.current = k.clientX, h.current = 0, g.current = k.target, f.current = !0, c(!0);
|
|
3089
|
+
const I = {
|
|
3090
|
+
clientX: k.clientX,
|
|
3091
|
+
startX: k.clientX,
|
|
3092
3092
|
totalDeltaX: 0,
|
|
3093
|
-
target:
|
|
3093
|
+
target: k.target
|
|
3094
3094
|
};
|
|
3095
|
-
|
|
3096
|
-
const D = (
|
|
3097
|
-
|
|
3095
|
+
u.current.onDragStart?.(I);
|
|
3096
|
+
const D = (L) => {
|
|
3097
|
+
f.current && p.current == null && (p.current = requestAnimationFrame(() => {
|
|
3098
3098
|
p.current = null;
|
|
3099
|
-
const
|
|
3099
|
+
const T = L.clientX, N = T - x.current;
|
|
3100
3100
|
if (N === 0) return;
|
|
3101
|
-
|
|
3102
|
-
const
|
|
3103
|
-
clientX:
|
|
3104
|
-
startX:
|
|
3101
|
+
x.current = T, h.current += N;
|
|
3102
|
+
const y = {
|
|
3103
|
+
clientX: T,
|
|
3104
|
+
startX: w.current,
|
|
3105
3105
|
totalDeltaX: h.current,
|
|
3106
|
-
target:
|
|
3106
|
+
target: g.current
|
|
3107
3107
|
};
|
|
3108
|
-
|
|
3108
|
+
u.current.preventScrollOnMove && L.preventDefault(), u.current.onDelta(N, y);
|
|
3109
3109
|
}));
|
|
3110
|
-
},
|
|
3111
|
-
|
|
3112
|
-
},
|
|
3113
|
-
|
|
3110
|
+
}, O = (L) => {
|
|
3111
|
+
C(L.clientX);
|
|
3112
|
+
}, P = (L) => {
|
|
3113
|
+
L.key === "Escape" && (L.preventDefault(), C());
|
|
3114
3114
|
};
|
|
3115
|
-
|
|
3115
|
+
b.current = { move: D, up: O, keydown: P }, window.addEventListener("pointermove", D, {
|
|
3116
3116
|
passive: !a,
|
|
3117
3117
|
capture: !0
|
|
3118
|
-
}), window.addEventListener("pointerup",
|
|
3119
|
-
}, [
|
|
3120
|
-
return
|
|
3121
|
-
|
|
3122
|
-
}, [
|
|
3118
|
+
}), window.addEventListener("pointerup", O, { capture: !0 }), window.addEventListener("pointercancel", O, { capture: !0 }), window.addEventListener("keydown", P, !0);
|
|
3119
|
+
}, [C, r, a, o]);
|
|
3120
|
+
return R.useEffect(() => () => {
|
|
3121
|
+
f.current && C();
|
|
3122
|
+
}, [C]), {
|
|
3123
3123
|
isDragging: i,
|
|
3124
3124
|
bind: {
|
|
3125
|
-
onPointerDown:
|
|
3125
|
+
onPointerDown: v,
|
|
3126
3126
|
role: "separator",
|
|
3127
3127
|
style: { touchAction: "none", cursor: "col-resize", userSelect: "none" }
|
|
3128
3128
|
}
|
|
3129
3129
|
};
|
|
3130
3130
|
}
|
|
3131
|
-
const
|
|
3131
|
+
const $r = (n) => {
|
|
3132
3132
|
const {
|
|
3133
|
-
column:
|
|
3133
|
+
column: t,
|
|
3134
3134
|
width: s,
|
|
3135
|
-
height:
|
|
3135
|
+
height: l,
|
|
3136
3136
|
onResize: r,
|
|
3137
|
-
sortDirection:
|
|
3137
|
+
sortDirection: o,
|
|
3138
3138
|
onSortClick: a
|
|
3139
|
-
} =
|
|
3140
|
-
onDelta: (
|
|
3139
|
+
} = n, i = !!t.sortable, { bind: c } = Hr({
|
|
3140
|
+
onDelta: (f) => r(f)
|
|
3141
3141
|
});
|
|
3142
3142
|
return /* @__PURE__ */ d(
|
|
3143
3143
|
"div",
|
|
3144
3144
|
{
|
|
3145
|
-
style: { width: s, height:
|
|
3145
|
+
style: { width: s, height: l },
|
|
3146
3146
|
className: "flex flex-row items-stretch select-none shrink-0",
|
|
3147
3147
|
children: [
|
|
3148
3148
|
/* @__PURE__ */ d(
|
|
3149
3149
|
"div",
|
|
3150
3150
|
{
|
|
3151
|
-
className:
|
|
3151
|
+
className: m(
|
|
3152
3152
|
"flex-1 min-w-0 px-4 table-header-cell transition-colors duration-100 flex flex-row items-center gap-2",
|
|
3153
3153
|
i && "cursor-pointer"
|
|
3154
3154
|
),
|
|
3155
3155
|
onClick: i ? a : void 0,
|
|
3156
3156
|
children: [
|
|
3157
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
3158
|
-
i &&
|
|
3159
|
-
i &&
|
|
3157
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: t.header }),
|
|
3158
|
+
i && o === "asc" && /* @__PURE__ */ e(dn, { className: "h-4 w-4 shrink-0" }),
|
|
3159
|
+
i && o === "desc" && /* @__PURE__ */ e(be, { className: "h-4 w-4 shrink-0" })
|
|
3160
3160
|
]
|
|
3161
3161
|
}
|
|
3162
3162
|
),
|
|
@@ -3176,78 +3176,79 @@ const Hr = (t) => {
|
|
|
3176
3176
|
]
|
|
3177
3177
|
}
|
|
3178
3178
|
);
|
|
3179
|
-
},
|
|
3180
|
-
const
|
|
3181
|
-
for (const s of
|
|
3182
|
-
|
|
3183
|
-
return
|
|
3184
|
-
},
|
|
3179
|
+
}, ke = 200, _r = 60, jr = (n) => {
|
|
3180
|
+
const t = {};
|
|
3181
|
+
for (const s of n)
|
|
3182
|
+
t[s.id] = s.defaultWidth ?? ke;
|
|
3183
|
+
return t;
|
|
3184
|
+
}, Xr = (n) => {
|
|
3185
3185
|
const {
|
|
3186
|
-
columns:
|
|
3186
|
+
columns: t,
|
|
3187
3187
|
rows: s,
|
|
3188
|
-
getRowId:
|
|
3188
|
+
getRowId: l,
|
|
3189
3189
|
onRowClick: r,
|
|
3190
|
-
sort:
|
|
3190
|
+
sort: o,
|
|
3191
3191
|
onSortChange: a,
|
|
3192
3192
|
className: i,
|
|
3193
3193
|
rowHeight: c = 44,
|
|
3194
|
-
headerHeight:
|
|
3195
|
-
|
|
3194
|
+
headerHeight: f = 44,
|
|
3195
|
+
emptyState: w
|
|
3196
|
+
} = n, [x, h] = W(() => jr(t));
|
|
3196
3197
|
_(() => {
|
|
3197
|
-
|
|
3198
|
-
const
|
|
3199
|
-
let
|
|
3200
|
-
for (const
|
|
3201
|
-
|
|
3202
|
-
return
|
|
3198
|
+
h((v) => {
|
|
3199
|
+
const k = {};
|
|
3200
|
+
let I = Object.keys(v).length !== t.length;
|
|
3201
|
+
for (const D of t)
|
|
3202
|
+
D.id in v ? k[D.id] = v[D.id] : (k[D.id] = D.defaultWidth ?? ke, I = !0);
|
|
3203
|
+
return I ? k : v;
|
|
3203
3204
|
});
|
|
3204
|
-
}, [
|
|
3205
|
-
const
|
|
3206
|
-
|
|
3207
|
-
const
|
|
3208
|
-
return
|
|
3205
|
+
}, [t]);
|
|
3206
|
+
const g = Pe((v, k, I) => {
|
|
3207
|
+
h((D) => {
|
|
3208
|
+
const O = D[v] ?? ke, P = Math.max(I, O + k);
|
|
3209
|
+
return P === O ? D : { ...D, [v]: P };
|
|
3209
3210
|
});
|
|
3210
|
-
}, []),
|
|
3211
|
+
}, []), p = Pe((v) => {
|
|
3211
3212
|
if (a) {
|
|
3212
|
-
if (!
|
|
3213
|
-
a({ columnId:
|
|
3213
|
+
if (!o || o.columnId !== v) {
|
|
3214
|
+
a({ columnId: v, direction: "asc" });
|
|
3214
3215
|
return;
|
|
3215
3216
|
}
|
|
3216
|
-
if (
|
|
3217
|
-
a({ columnId:
|
|
3217
|
+
if (o.direction === "asc") {
|
|
3218
|
+
a({ columnId: v, direction: "desc" });
|
|
3218
3219
|
return;
|
|
3219
3220
|
}
|
|
3220
3221
|
a(null);
|
|
3221
3222
|
}
|
|
3222
|
-
}, [
|
|
3223
|
-
(
|
|
3223
|
+
}, [o, a]), u = t.reduce(
|
|
3224
|
+
(v, k) => v + (x[k.id] ?? k.defaultWidth ?? ke),
|
|
3224
3225
|
0
|
|
3225
|
-
),
|
|
3226
|
-
|
|
3226
|
+
), b = Ce(null), C = (v) => {
|
|
3227
|
+
b.current && (b.current.scrollLeft = v.currentTarget.scrollLeft);
|
|
3227
3228
|
};
|
|
3228
|
-
return /* @__PURE__ */ d("div", { className:
|
|
3229
|
+
return /* @__PURE__ */ d("div", { className: m("flex flex-col h-full w-full", i), children: [
|
|
3229
3230
|
/* @__PURE__ */ e(
|
|
3230
3231
|
"div",
|
|
3231
3232
|
{
|
|
3232
|
-
ref:
|
|
3233
|
+
ref: b,
|
|
3233
3234
|
className: "overflow-hidden shrink-0 table-header-strip",
|
|
3234
|
-
style: { height:
|
|
3235
|
+
style: { height: f },
|
|
3235
3236
|
children: /* @__PURE__ */ e(
|
|
3236
3237
|
"div",
|
|
3237
3238
|
{
|
|
3238
3239
|
className: "flex flex-row table-header font-medium",
|
|
3239
|
-
style: { width:
|
|
3240
|
-
children:
|
|
3241
|
-
|
|
3240
|
+
style: { width: u, minWidth: "100%" },
|
|
3241
|
+
children: t.map((v) => /* @__PURE__ */ e(
|
|
3242
|
+
$r,
|
|
3242
3243
|
{
|
|
3243
|
-
column:
|
|
3244
|
-
width: x[
|
|
3245
|
-
height:
|
|
3246
|
-
onResize: (
|
|
3247
|
-
sortDirection:
|
|
3248
|
-
onSortClick: () =>
|
|
3244
|
+
column: v,
|
|
3245
|
+
width: x[v.id] ?? v.defaultWidth ?? ke,
|
|
3246
|
+
height: f,
|
|
3247
|
+
onResize: (k) => g(v.id, k, v.minWidth ?? _r),
|
|
3248
|
+
sortDirection: o?.columnId === v.id ? o.direction : null,
|
|
3249
|
+
onSortClick: () => p(v.id)
|
|
3249
3250
|
},
|
|
3250
|
-
|
|
3251
|
+
v.id
|
|
3251
3252
|
))
|
|
3252
3253
|
}
|
|
3253
3254
|
)
|
|
@@ -3257,47 +3258,57 @@ const Hr = (t) => {
|
|
|
3257
3258
|
"div",
|
|
3258
3259
|
{
|
|
3259
3260
|
className: "flex-1 overflow-auto",
|
|
3260
|
-
onScroll:
|
|
3261
|
-
children: /* @__PURE__ */ e(
|
|
3261
|
+
onScroll: C,
|
|
3262
|
+
children: s.length === 0 && w ? /* @__PURE__ */ e("div", { className: "flex h-full min-w-full items-center justify-center p-8", children: w }) : /* @__PURE__ */ e(
|
|
3262
3263
|
"div",
|
|
3263
3264
|
{
|
|
3264
3265
|
className: "flex flex-col",
|
|
3265
|
-
style: { width:
|
|
3266
|
-
children: s.map((
|
|
3266
|
+
style: { width: u, minWidth: "100%" },
|
|
3267
|
+
children: s.map((v, k) => /* @__PURE__ */ e(
|
|
3267
3268
|
"div",
|
|
3268
3269
|
{
|
|
3269
|
-
className:
|
|
3270
|
+
className: m(
|
|
3270
3271
|
"flex flex-row table-body-row transition-colors duration-100",
|
|
3271
3272
|
r && "cursor-pointer"
|
|
3272
3273
|
),
|
|
3273
|
-
onClick: r ? () => r(
|
|
3274
|
-
children:
|
|
3274
|
+
onClick: r ? () => r(v, k) : void 0,
|
|
3275
|
+
children: t.map((I) => /* @__PURE__ */ e(
|
|
3275
3276
|
"div",
|
|
3276
3277
|
{
|
|
3277
3278
|
className: "shrink-0 content-center px-4 relative",
|
|
3278
3279
|
style: {
|
|
3279
|
-
width: x[
|
|
3280
|
+
width: x[I.id] ?? I.defaultWidth ?? ke,
|
|
3280
3281
|
height: c
|
|
3281
3282
|
},
|
|
3282
|
-
children: /* @__PURE__ */ e("div", { className: "break-all line-clamp-1", children:
|
|
3283
|
+
children: /* @__PURE__ */ e("div", { className: "break-all line-clamp-1", children: I.renderCell(v, k) })
|
|
3283
3284
|
},
|
|
3284
|
-
|
|
3285
|
+
I.id
|
|
3285
3286
|
))
|
|
3286
3287
|
},
|
|
3287
|
-
|
|
3288
|
+
l(v, k)
|
|
3288
3289
|
))
|
|
3289
3290
|
}
|
|
3290
3291
|
)
|
|
3291
3292
|
}
|
|
3292
3293
|
)
|
|
3293
3294
|
] });
|
|
3294
|
-
},
|
|
3295
|
-
const {
|
|
3296
|
-
return /* @__PURE__ */ d("div", { className:
|
|
3297
|
-
|
|
3295
|
+
}, $l = (n) => {
|
|
3296
|
+
const { Icon: t, title: s, description: l, children: r, className: o } = n;
|
|
3297
|
+
return /* @__PURE__ */ d("div", { className: m("flex flex-col items-center gap-3 text-center", o), children: [
|
|
3298
|
+
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)]" }) }),
|
|
3299
|
+
(s || l) && /* @__PURE__ */ d("div", { className: "flex flex-col gap-1", children: [
|
|
3300
|
+
s && /* @__PURE__ */ e("div", { className: "font-medium text-[var(--color-input-text)]", children: s }),
|
|
3301
|
+
l && /* @__PURE__ */ e("div", { className: "text-sm text-[var(--color-input-description-text)]", children: l })
|
|
3302
|
+
] }),
|
|
3303
|
+
r
|
|
3304
|
+
] });
|
|
3305
|
+
}, Ct = (n) => {
|
|
3306
|
+
const { label: t, children: s, className: l } = n;
|
|
3307
|
+
return /* @__PURE__ */ d("div", { className: m("flex flex-col dropdown-button-group", l), children: [
|
|
3308
|
+
t && /* @__PURE__ */ e("div", { className: "mb-2 text-sm dropdown-group-label font-semibold px-3", children: t }),
|
|
3298
3309
|
s
|
|
3299
3310
|
] });
|
|
3300
|
-
},
|
|
3311
|
+
}, Vr = () => /* @__PURE__ */ e("div", {}), Kr = [
|
|
3301
3312
|
{ id: 1, email: "sarah.jennings@example.com", firstname: "Sarah", lastname: "Jennings", status: "active" },
|
|
3302
3313
|
{ id: 2, email: "liam.patel@outlook.com", firstname: "Liam", lastname: "Patel", status: "inactive" },
|
|
3303
3314
|
{ id: 3, email: "emily.wong@gmail.com", firstname: "Emily", lastname: "Wong", status: "active" },
|
|
@@ -3310,40 +3321,40 @@ const Hr = (t) => {
|
|
|
3310
3321
|
{ id: 10, email: "jackson.rivera@outlook.com", firstname: "Jackson", lastname: "Rivera", status: "active" },
|
|
3311
3322
|
{ id: 11, email: "ava.sanders@example.com", firstname: "Ava", lastname: "Sanders", status: "active" },
|
|
3312
3323
|
{ id: 12, email: "logan.bennett@company.io", firstname: "Logan", lastname: "Bennett", status: "inactive" }
|
|
3313
|
-
],
|
|
3314
|
-
{ id: "id", header: "ID", renderCell: (
|
|
3324
|
+
], Gr = [
|
|
3325
|
+
{ id: "id", header: "ID", renderCell: (n) => n.id },
|
|
3315
3326
|
{
|
|
3316
3327
|
id: "email",
|
|
3317
3328
|
header: "Email",
|
|
3318
|
-
renderCell: (
|
|
3319
|
-
}, children:
|
|
3329
|
+
renderCell: (n) => /* @__PURE__ */ e(Ee, { Icon: mn, onClick: () => {
|
|
3330
|
+
}, children: n.email })
|
|
3320
3331
|
},
|
|
3321
|
-
{ id: "firstname", header: "First Name", renderCell: (
|
|
3322
|
-
{ id: "lastname", header: "Last Name", renderCell: (
|
|
3332
|
+
{ id: "firstname", header: "First Name", renderCell: (n) => n.firstname },
|
|
3333
|
+
{ id: "lastname", header: "Last Name", renderCell: (n) => n.lastname },
|
|
3323
3334
|
{
|
|
3324
3335
|
id: "status",
|
|
3325
3336
|
header: "Status",
|
|
3326
|
-
renderCell: () => /* @__PURE__ */ e(
|
|
3337
|
+
renderCell: () => /* @__PURE__ */ e(Jr, {})
|
|
3327
3338
|
}
|
|
3328
|
-
],
|
|
3339
|
+
], _l = () => /* @__PURE__ */ d("div", { className: "flex flex-col gap-6", children: [
|
|
3329
3340
|
/* @__PURE__ */ d("div", { className: "flex flex-row items-center justify-start gap-3", children: [
|
|
3330
|
-
/* @__PURE__ */ e(
|
|
3331
|
-
/* @__PURE__ */ e(qe, { Icon:
|
|
3332
|
-
/* @__PURE__ */ e(
|
|
3341
|
+
/* @__PURE__ */ e(Wt, { Icon: Fe, placeholder: "Search..." }),
|
|
3342
|
+
/* @__PURE__ */ e(qe, { Icon: mt }),
|
|
3343
|
+
/* @__PURE__ */ e(Gn, { Icon: ft, children: "New" }),
|
|
3333
3344
|
/* @__PURE__ */ d(
|
|
3334
3345
|
Ue,
|
|
3335
3346
|
{
|
|
3336
|
-
trigger: /* @__PURE__ */ e(qe, { Icon:
|
|
3347
|
+
trigger: /* @__PURE__ */ e(qe, { Icon: mt }),
|
|
3337
3348
|
children: [
|
|
3338
|
-
/* @__PURE__ */ e(X, { dismissOnClick: !1, Icon:
|
|
3339
|
-
/* @__PURE__ */ e(X, { Icon:
|
|
3340
|
-
/* @__PURE__ */ d(
|
|
3349
|
+
/* @__PURE__ */ e(X, { dismissOnClick: !1, Icon: ft, children: "Add new" }),
|
|
3350
|
+
/* @__PURE__ */ e(X, { Icon: un, children: "Remove" }),
|
|
3351
|
+
/* @__PURE__ */ d(Ct, { label: "Test", className: "mt-2", children: [
|
|
3341
3352
|
/* @__PURE__ */ e(X, { children: "Item 1" }),
|
|
3342
3353
|
/* @__PURE__ */ e(X, { children: "Item 2" }),
|
|
3343
3354
|
/* @__PURE__ */ e(X, { children: "Item 3" }),
|
|
3344
3355
|
/* @__PURE__ */ e(X, { children: "Item 4" })
|
|
3345
3356
|
] }),
|
|
3346
|
-
/* @__PURE__ */ d(
|
|
3357
|
+
/* @__PURE__ */ d(Ct, { label: "Test", className: "mt-2", children: [
|
|
3347
3358
|
/* @__PURE__ */ e(X, { children: "Item 1" }),
|
|
3348
3359
|
/* @__PURE__ */ e(X, { children: "Item 2" }),
|
|
3349
3360
|
/* @__PURE__ */ e(X, { children: "Item 3" }),
|
|
@@ -3352,7 +3363,7 @@ const Hr = (t) => {
|
|
|
3352
3363
|
]
|
|
3353
3364
|
}
|
|
3354
3365
|
),
|
|
3355
|
-
/* @__PURE__ */ e(
|
|
3366
|
+
/* @__PURE__ */ e(Wr, { tabs: [
|
|
3356
3367
|
{
|
|
3357
3368
|
label: "Tab 1",
|
|
3358
3369
|
Icon: Ye,
|
|
@@ -3375,23 +3386,23 @@ const Hr = (t) => {
|
|
|
3375
3386
|
}
|
|
3376
3387
|
] })
|
|
3377
3388
|
] }),
|
|
3378
|
-
/* @__PURE__ */ e(
|
|
3389
|
+
/* @__PURE__ */ e(Er, { options: [
|
|
3379
3390
|
{ label: "Option 1", value: 1 },
|
|
3380
3391
|
{ label: "Option 2", value: 2 },
|
|
3381
3392
|
{ label: "Option 3", value: 3 }
|
|
3382
3393
|
], value: null, onChange: () => {
|
|
3383
3394
|
} }),
|
|
3384
3395
|
/* @__PURE__ */ e(
|
|
3385
|
-
|
|
3396
|
+
Xr,
|
|
3386
3397
|
{
|
|
3387
3398
|
className: "h-[300px] w-[300px]",
|
|
3388
|
-
columns:
|
|
3389
|
-
rows:
|
|
3390
|
-
getRowId: (
|
|
3399
|
+
columns: Gr,
|
|
3400
|
+
rows: Kr,
|
|
3401
|
+
getRowId: (n) => n.id
|
|
3391
3402
|
}
|
|
3392
3403
|
),
|
|
3393
|
-
/* @__PURE__ */ e(
|
|
3394
|
-
] }),
|
|
3404
|
+
/* @__PURE__ */ e(Vr, {})
|
|
3405
|
+
] }), Jr = () => /* @__PURE__ */ e(ce, { children: /* @__PURE__ */ d(
|
|
3395
3406
|
Ue,
|
|
3396
3407
|
{
|
|
3397
3408
|
placement: "bottom-end",
|
|
@@ -3406,72 +3417,73 @@ const Hr = (t) => {
|
|
|
3406
3417
|
}
|
|
3407
3418
|
) });
|
|
3408
3419
|
export {
|
|
3409
|
-
|
|
3420
|
+
Hl as AutoScroll,
|
|
3410
3421
|
Ee as Badge,
|
|
3411
3422
|
Mr as BadgeColor,
|
|
3412
|
-
|
|
3413
|
-
|
|
3423
|
+
Gn as Button,
|
|
3424
|
+
Ut as ButtonIconRound,
|
|
3414
3425
|
qe as ButtonIconSquare,
|
|
3415
|
-
|
|
3426
|
+
Bl as Divider,
|
|
3416
3427
|
X as DropdownButton,
|
|
3417
|
-
|
|
3428
|
+
Ct as DropdownButtonGroup,
|
|
3418
3429
|
Ue as DropdownMenu,
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3430
|
+
ve as DropdownPanel,
|
|
3431
|
+
Wt as Input,
|
|
3432
|
+
Cl as InputCheck,
|
|
3433
|
+
xl as InputColor,
|
|
3423
3434
|
V as InputDescription,
|
|
3424
3435
|
K as InputError,
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3436
|
+
ne as InputErrorIcon,
|
|
3437
|
+
Rl as InputFileMultiple,
|
|
3438
|
+
Il as InputFileSingle,
|
|
3428
3439
|
Z as InputIconButton,
|
|
3429
|
-
|
|
3440
|
+
he as InputIconButtonTray,
|
|
3430
3441
|
q as InputLabel,
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3442
|
+
Dl as InputLexical,
|
|
3443
|
+
wl as InputPassword,
|
|
3444
|
+
yl as InputRadio,
|
|
3445
|
+
Er as InputSelect,
|
|
3435
3446
|
$e as InputSelectDivider,
|
|
3436
3447
|
He as InputSelectGroupHeader,
|
|
3437
|
-
|
|
3438
|
-
|
|
3448
|
+
Pl as InputSelectMultiple,
|
|
3449
|
+
Ol as InputSelectNative,
|
|
3439
3450
|
We as InputSelectOption,
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3451
|
+
zl as InputSelectSearchable,
|
|
3452
|
+
Tl as InputSelectSearchableAsync,
|
|
3453
|
+
Nl as InputTextArea,
|
|
3443
3454
|
kl as InputToggle,
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3455
|
+
Nr as LEXICAL_NODES,
|
|
3456
|
+
Cr as LexicalBlockTypeSelect,
|
|
3457
|
+
Sl as LexicalDefaultToolbarContent,
|
|
3447
3458
|
Lr as LexicalFloatingToolbar,
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3459
|
+
Rr as LexicalFormatButtons,
|
|
3460
|
+
Or as LexicalHistoryButtons,
|
|
3461
|
+
Dr as LexicalLinkButton,
|
|
3462
|
+
Sr as LexicalListButtons,
|
|
3463
|
+
Pr as LexicalToolbar,
|
|
3464
|
+
ie as LexicalToolbarButton,
|
|
3454
3465
|
Je as LexicalToolbarDivider,
|
|
3455
|
-
|
|
3456
|
-
|
|
3466
|
+
Vt as LexicalToolbarItems,
|
|
3467
|
+
Ul as Modal,
|
|
3457
3468
|
Ll as Panel,
|
|
3458
|
-
|
|
3469
|
+
Fl as PanelField,
|
|
3459
3470
|
Ml as PanelLink,
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3471
|
+
El as PanelStack,
|
|
3472
|
+
Ht as PopoverBase,
|
|
3473
|
+
Wl as SidebarModal,
|
|
3463
3474
|
Se as Spinner,
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3475
|
+
Wr as TabButtons,
|
|
3476
|
+
Xr as Table,
|
|
3477
|
+
$r as TableColumnHead,
|
|
3478
|
+
$l as TableEmpty,
|
|
3479
|
+
_l as Test,
|
|
3480
|
+
Al as Tooltip,
|
|
3481
|
+
wr as UploadFileTile,
|
|
3470
3482
|
H as isSelectOption,
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3483
|
+
wt as lexicalTheme,
|
|
3484
|
+
we as useLexicalToolbar,
|
|
3485
|
+
_t as useLexicalToolbarState,
|
|
3486
|
+
ct as usePopover,
|
|
3475
3487
|
_e as useSelectPopover
|
|
3476
3488
|
};
|
|
3477
3489
|
//# sourceMappingURL=index.js.map
|