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