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