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