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