@noxickon/onyx 0.1.0 → 1.0.0
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/chunks/hooks-DiKvsNs-.js +48 -0
- package/dist/chunks/hooks-bJFfbTks.js +8624 -0
- package/dist/chunks/query-BhvXa-m6.js +10 -0
- package/dist/chunks/query-iDn3qBGF.js +14 -0
- package/dist/chunks/ui-ChsTPgui.js +41 -0
- package/dist/chunks/ui-DxsSYHCv.js +20634 -0
- package/dist/chunks/useAuth-BFgXzu6Q.js +12 -0
- package/dist/chunks/useAuth-DxoDe3YA.js +1 -0
- package/dist/contexts/contexts.cjs.js +5 -0
- package/dist/contexts/contexts.es.js +156 -0
- package/dist/contexts.d.ts +117 -0
- package/dist/hooks/hooks.cjs.js +1 -6
- package/dist/hooks/hooks.es.js +11 -1916
- package/dist/hooks.d.ts +79 -21
- package/dist/index.d.ts +1782 -268
- package/dist/layouts/layouts.cjs.js +1 -0
- package/dist/layouts/layouts.es.js +688 -0
- package/dist/layouts.d.ts +430 -0
- package/dist/onyx.cjs.js +1 -1
- package/dist/onyx.es.js +53 -1395
- package/dist/pages/pages.cjs.js +2 -2
- package/dist/pages/pages.es.js +71 -69
- package/dist/pages.d.ts +4 -4
- package/dist/routes/routes.cjs.js +1 -0
- package/dist/routes/routes.es.js +31 -0
- package/dist/routes.d.ts +28 -0
- package/dist/shared.css +77 -48
- package/dist/ui.css +1 -0
- package/dist/utils/utils.cjs.js +1 -1
- package/dist/utils/utils.es.js +20 -6
- package/dist/utils.d.ts +109 -5
- package/package.json +39 -28
- package/dist/chunks/AuthContext-CaZKJMxQ.js +0 -2149
- package/dist/chunks/AuthContext-uU1aP9gj.js +0 -31
- package/dist/chunks/Button-D-v4l8ZE.js +0 -20
- package/dist/chunks/Button-bARrxYyo.js +0 -11053
- package/dist/chunks/Input-CLi1H63d.js +0 -1
- package/dist/chunks/Input-dfvmdIHi.js +0 -138
- package/dist/chunks/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/chunks/_commonjsHelpers-DwGv2jUC.js +0 -1
- package/dist/chunks/constants-B1_n9ezb.js +0 -1
- package/dist/chunks/constants-CDXq37n6.js +0 -4
- package/dist/chunks/errorHelper-DbQKxxQA.js +0 -1
- package/dist/chunks/errorHelper-qN6iGI6f.js +0 -18
- package/dist/chunks/formatTimestamp-CMxOnPo1.js +0 -12
- package/dist/chunks/formatTimestamp-TTsNcy7u.js +0 -1
- package/dist/chunks/index-CPwC_oqh.js +0 -561
- package/dist/chunks/index-DY808_YF.js +0 -2
- package/dist/chunks/isObject-BDHKUJKN.js +0 -1
- package/dist/chunks/isObject-vmP43YLW.js +0 -6
- package/dist/chunks/jsx-runtime--oOP9f8K.js +0 -284
- package/dist/chunks/jsx-runtime-CITbqOLs.js +0 -22
- package/dist/chunks/tslib.es6-ci7D5hcx.js +0 -44
- package/dist/chunks/tslib.es6-nRfFZWHa.js +0 -1
- package/dist/chunks/useAuth-BsWbsZD5.js +0 -1
- package/dist/chunks/useAuth-CkaMowHd.js +0 -11
- package/dist/chunks/useForm-BuzPPZZE.js +0 -3070
- package/dist/chunks/useForm-F8doF8lW.js +0 -18
- package/dist/chunks/useQuery-Dh3SZN5S.js +0 -1482
- package/dist/chunks/useQuery-y4De9xeL.js +0 -2
- package/dist/context/context.cjs.js +0 -1
- package/dist/context/context.es.js +0 -39
- package/dist/context.d.ts +0 -47
- package/dist/index.css +0 -1
- package/dist/layout/layout.cjs.js +0 -1
- package/dist/layout/layout.es.js +0 -265
- package/dist/layout.d.ts +0 -90
package/dist/onyx.es.js
CHANGED
|
@@ -1,1397 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import U, { useState as S, useEffect as V, useId as G, useRef as ee, useCallback as oe, createContext as ae, useContext as ie } from "react";
|
|
3
|
-
import { t as b, b as $, a as B, O as le } from "./chunks/Button-bARrxYyo.js";
|
|
4
|
-
import { c as te, d as se, b as re } from "./chunks/Input-dfvmdIHi.js";
|
|
5
|
-
import { O as jt, a as yt } from "./chunks/Input-dfvmdIHi.js";
|
|
6
|
-
import { createPortal as ce } from "react-dom";
|
|
7
|
-
import { M as pe } from "./chunks/constants-CDXq37n6.js";
|
|
8
|
-
import { f as ge } from "./chunks/formatTimestamp-CMxOnPo1.js";
|
|
9
|
-
import "./chunks/AuthContext-CaZKJMxQ.js";
|
|
10
|
-
import { u as de } from "./chunks/useAuth-CkaMowHd.js";
|
|
11
|
-
import './index.css';const st = ({ children: t, className: s }) => /* @__PURE__ */ e.jsx("div", { className: b("flex items-center gap-3", s), children: t }), Q = {
|
|
12
|
-
rounded: "rounded-full",
|
|
13
|
-
square: "rounded-lg"
|
|
14
|
-
}, X = {
|
|
15
|
-
sm: "h-6 w-6",
|
|
16
|
-
md: "h-8 w-8",
|
|
17
|
-
lg: "h-10 w-10",
|
|
18
|
-
xl: "h-12 w-12",
|
|
19
|
-
"2xl": "h-16 w-16"
|
|
20
|
-
}, ve = {
|
|
21
|
-
sm: "h-2 w-2",
|
|
22
|
-
md: "h-2.5 w-2.5",
|
|
23
|
-
lg: "h-3 w-3",
|
|
24
|
-
xl: "h-3.5 w-3.5",
|
|
25
|
-
"2xl": "h-4 w-4"
|
|
26
|
-
}, we = {
|
|
27
|
-
online: "bg-green-500",
|
|
28
|
-
offline: "bg-neutral-500",
|
|
29
|
-
away: "bg-yellow-500",
|
|
30
|
-
busy: "bg-red-500"
|
|
31
|
-
}, je = {
|
|
32
|
-
sm: "text-xs",
|
|
33
|
-
md: "text-sm",
|
|
34
|
-
lg: "text-base",
|
|
35
|
-
xl: "text-base",
|
|
36
|
-
"2xl": "text-lg"
|
|
37
|
-
}, ye = ({
|
|
38
|
-
alt: t,
|
|
39
|
-
className: s,
|
|
40
|
-
fallback: n,
|
|
41
|
-
showStatus: o = !1,
|
|
42
|
-
size: r = "md",
|
|
43
|
-
skeleton: i = !1,
|
|
44
|
-
src: a,
|
|
45
|
-
status: l,
|
|
46
|
-
type: u = "square"
|
|
47
|
-
}) => {
|
|
48
|
-
const [h, d] = S(!1), [m, p] = S(!1), [f, g] = S(!0);
|
|
49
|
-
V(() => {
|
|
50
|
-
if (!a) {
|
|
51
|
-
d(!1), p(!0), g(!1);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
g(!0);
|
|
55
|
-
const y = new Image();
|
|
56
|
-
y.src = a;
|
|
57
|
-
const k = () => {
|
|
58
|
-
d(!0), p(!1), g(!1);
|
|
59
|
-
}, c = () => {
|
|
60
|
-
d(!1), p(!0), g(!1);
|
|
61
|
-
};
|
|
62
|
-
return y.addEventListener("load", k), y.addEventListener("error", c), () => {
|
|
63
|
-
y.removeEventListener("load", k), y.removeEventListener("error", c);
|
|
64
|
-
};
|
|
65
|
-
}, [a]);
|
|
66
|
-
const j = () => f && i ? /* @__PURE__ */ e.jsx("div", { className: $("animate-pulse bg-zinc-800", Q[u], X[r]) }) : h && !m ? /* @__PURE__ */ e.jsx(
|
|
67
|
-
"img",
|
|
68
|
-
{
|
|
69
|
-
alt: t,
|
|
70
|
-
className: b(Q[u], X[r], "object-cover", s),
|
|
71
|
-
loading: "lazy",
|
|
72
|
-
src: a
|
|
73
|
-
}
|
|
74
|
-
) : /* @__PURE__ */ e.jsx(
|
|
75
|
-
"div",
|
|
76
|
-
{
|
|
77
|
-
"aria-label": t,
|
|
78
|
-
className: b(
|
|
79
|
-
"flex items-center justify-center bg-zinc-800 font-medium text-white",
|
|
80
|
-
Q[u],
|
|
81
|
-
X[r],
|
|
82
|
-
je[r],
|
|
83
|
-
s
|
|
84
|
-
),
|
|
85
|
-
role: "img",
|
|
86
|
-
children: typeof n == "string" && n.length > 2 ? n.substring(0, 2) : n
|
|
87
|
-
}
|
|
88
|
-
);
|
|
89
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "relative shrink-0", children: [
|
|
90
|
-
j(),
|
|
91
|
-
o && l && /* @__PURE__ */ e.jsx(
|
|
92
|
-
"span",
|
|
93
|
-
{
|
|
94
|
-
"aria-label": `Status: ${l}`,
|
|
95
|
-
className: $(
|
|
96
|
-
"absolute right-0 bottom-0 rounded-full border-2 border-zinc-900",
|
|
97
|
-
ve[r],
|
|
98
|
-
we[l]
|
|
99
|
-
),
|
|
100
|
-
role: "status"
|
|
101
|
-
}
|
|
102
|
-
)
|
|
103
|
-
] });
|
|
104
|
-
}, rt = ({
|
|
105
|
-
className: t,
|
|
106
|
-
size: s = "md",
|
|
107
|
-
subtext: n,
|
|
108
|
-
username: o
|
|
109
|
-
}) => {
|
|
110
|
-
const r = {
|
|
111
|
-
sm: "text-xs",
|
|
112
|
-
md: "text-sm",
|
|
113
|
-
lg: "text-base",
|
|
114
|
-
xl: "text-lg",
|
|
115
|
-
"2xl": "text-xl"
|
|
116
|
-
}, i = {
|
|
117
|
-
sm: "text-xs",
|
|
118
|
-
md: "text-xs",
|
|
119
|
-
lg: "text-sm",
|
|
120
|
-
xl: "text-sm",
|
|
121
|
-
"2xl": "text-base"
|
|
122
|
-
};
|
|
123
|
-
return /* @__PURE__ */ e.jsxs("div", { className: b("flex flex-col justify-center overflow-hidden", t), children: [
|
|
124
|
-
/* @__PURE__ */ e.jsx("span", { className: $("block truncate font-medium text-white", r[s]), children: o }),
|
|
125
|
-
n && /* @__PURE__ */ e.jsx("span", { className: $("block truncate text-neutral-400", i[s]), children: n })
|
|
126
|
-
] });
|
|
127
|
-
}, Ne = {
|
|
128
|
-
sm: "px-1 py-0.5 text-xs",
|
|
129
|
-
md: "px-1.5 py-0.5 text-sm",
|
|
130
|
-
lg: "px-2 py-1 text-base"
|
|
131
|
-
}, ke = {
|
|
132
|
-
purple: "bg-purple-500/25 text-purple-400",
|
|
133
|
-
lime: "bg-lime-400/10 text-lime-300",
|
|
134
|
-
red: "bg-red-500/25 text-red-400",
|
|
135
|
-
yellow: "bg-yellow-500/25 text-yellow-400",
|
|
136
|
-
green: "bg-green-500/25 text-green-400",
|
|
137
|
-
blue: "bg-blue-500/25 text-blue-400",
|
|
138
|
-
indigo: "bg-indigo-500/25 text-indigo-400",
|
|
139
|
-
pink: "bg-pink-500/25 text-pink-400",
|
|
140
|
-
amber: "bg-amber-500/25 text-amber-400",
|
|
141
|
-
emerald: "bg-emerald-500/25 text-emerald-400",
|
|
142
|
-
teal: "bg-teal-500/25 text-teal-400",
|
|
143
|
-
cyan: "bg-cyan-500/25 text-cyan-400",
|
|
144
|
-
sky: "bg-sky-500/25 text-sky-400",
|
|
145
|
-
violet: "bg-violet-500/25 text-violet-400",
|
|
146
|
-
fuchsia: "bg-fuchsia-500/25 text-fuchsia-400",
|
|
147
|
-
gray: "bg-gray-500/25 text-gray-400"
|
|
148
|
-
};
|
|
149
|
-
function Ce(t) {
|
|
150
|
-
const s = t.startsWith("#") ? t.substring(1) : t;
|
|
151
|
-
if (!/^[0-9A-Fa-f]{3,6}$/.test(s)) return "#FFFFFF";
|
|
152
|
-
const o = parseInt(s.length === 3 ? s[0] + s[0] : s.substr(0, 2), 16), r = parseInt(s.length === 3 ? s[1] + s[1] : s.substr(2, 2), 16), i = parseInt(s.length === 3 ? s[2] + s[2] : s.substr(4, 2), 16);
|
|
153
|
-
return (0.299 * o + 0.587 * r + 0.114 * i) / 255 > 0.5 ? "#000000" : "#FFFFFF";
|
|
154
|
-
}
|
|
155
|
-
const q = ({
|
|
156
|
-
bgColor: t,
|
|
157
|
-
children: s,
|
|
158
|
-
className: n,
|
|
159
|
-
color: o = "purple",
|
|
160
|
-
size: r = "md",
|
|
161
|
-
textColor: i
|
|
162
|
-
}) => {
|
|
163
|
-
const a = !t && !i ? ke[o] : "", l = {};
|
|
164
|
-
return t && (l.backgroundColor = t, i || (l.color = Ce(t))), i && (l.color = i), /* @__PURE__ */ e.jsx(
|
|
165
|
-
"span",
|
|
166
|
-
{
|
|
167
|
-
className: b(
|
|
168
|
-
"inline-flex items-center rounded-md font-medium",
|
|
169
|
-
Ne[r],
|
|
170
|
-
a,
|
|
171
|
-
n
|
|
172
|
-
),
|
|
173
|
-
style: Object.keys(l).length ? l : void 0,
|
|
174
|
-
children: s
|
|
175
|
-
}
|
|
176
|
-
);
|
|
177
|
-
}, Oe = {
|
|
178
|
-
default: "bg-zinc-900/90 border border-zinc-800",
|
|
179
|
-
outline: "bg-transparent border border-zinc-700",
|
|
180
|
-
gradient: "bg-gradient-to-br from-zinc-900 via-purple-900/20 to-zinc-900 border border-purple-800/30"
|
|
181
|
-
}, ze = {
|
|
182
|
-
none: "p-0",
|
|
183
|
-
sm: "p-3",
|
|
184
|
-
md: "p-4",
|
|
185
|
-
lg: "p-6"
|
|
186
|
-
}, Ee = {
|
|
187
|
-
none: "",
|
|
188
|
-
lift: "hover:scale-[1.01] hover:-translate-y-1",
|
|
189
|
-
glow: "hover:shadow-lg hover:shadow-purple-500/10",
|
|
190
|
-
border: "hover:border-purple-500/50"
|
|
191
|
-
}, Ie = {
|
|
192
|
-
purple: "hover:border-purple-500/50",
|
|
193
|
-
blue: "hover:border-blue-500/50",
|
|
194
|
-
emerald: "hover:border-emerald-500/50",
|
|
195
|
-
orange: "hover:border-orange-500/50",
|
|
196
|
-
rose: "hover:border-rose-500/50",
|
|
197
|
-
amber: "hover:border-amber-500/50",
|
|
198
|
-
cyan: "hover:border-cyan-500/50",
|
|
199
|
-
indigo: "hover:border-indigo-500/50"
|
|
200
|
-
}, Le = {
|
|
201
|
-
purple: "from-purple-500/5 to-pink-500/5",
|
|
202
|
-
blue: "from-blue-500/5 to-cyan-500/5",
|
|
203
|
-
emerald: "from-emerald-500/5 to-teal-500/5",
|
|
204
|
-
orange: "from-orange-500/5 to-red-500/5",
|
|
205
|
-
rose: "from-rose-500/5 to-pink-500/5",
|
|
206
|
-
amber: "from-amber-500/5 to-orange-500/5",
|
|
207
|
-
cyan: "from-cyan-500/5 to-blue-500/5",
|
|
208
|
-
indigo: "from-indigo-500/5 to-purple-500/5"
|
|
209
|
-
}, nt = ({
|
|
210
|
-
backdropBlur: t = !1,
|
|
211
|
-
children: s,
|
|
212
|
-
className: n,
|
|
213
|
-
color: o = "purple",
|
|
214
|
-
equalHeight: r = !1,
|
|
215
|
-
hoverVariant: i = "lift",
|
|
216
|
-
hoverable: a = !1,
|
|
217
|
-
padding: l = "md",
|
|
218
|
-
variant: u = "default",
|
|
219
|
-
...h
|
|
220
|
-
}) => {
|
|
221
|
-
const d = a ? i : "none", m = a && d !== "none";
|
|
222
|
-
return /* @__PURE__ */ e.jsxs(
|
|
223
|
-
"div",
|
|
224
|
-
{
|
|
225
|
-
className: b(
|
|
226
|
-
"relative overflow-hidden rounded-lg transition-all duration-300",
|
|
227
|
-
Oe[u],
|
|
228
|
-
ze[l],
|
|
229
|
-
r && "flex flex-col",
|
|
230
|
-
t && "backdrop-blur-sm",
|
|
231
|
-
m && Ee[d],
|
|
232
|
-
m && "group hover:bg-white/5",
|
|
233
|
-
m && Ie[o],
|
|
234
|
-
n
|
|
235
|
-
),
|
|
236
|
-
...h,
|
|
237
|
-
children: [
|
|
238
|
-
m && /* @__PURE__ */ e.jsx(
|
|
239
|
-
"div",
|
|
240
|
-
{
|
|
241
|
-
className: b(
|
|
242
|
-
"absolute inset-0 bg-gradient-to-br opacity-0 transition-opacity duration-300 group-hover:opacity-100",
|
|
243
|
-
Le[o]
|
|
244
|
-
)
|
|
245
|
-
}
|
|
246
|
-
),
|
|
247
|
-
/* @__PURE__ */ e.jsx("div", { className: "relative z-10", children: s })
|
|
248
|
-
]
|
|
249
|
-
}
|
|
250
|
-
);
|
|
251
|
-
}, Fe = {
|
|
252
|
-
purple: {
|
|
253
|
-
border: "border-purple-500/20",
|
|
254
|
-
bg: "bg-purple-500/10",
|
|
255
|
-
text: "text-purple-400"
|
|
256
|
-
},
|
|
257
|
-
blue: {
|
|
258
|
-
border: "border-blue-500/20",
|
|
259
|
-
bg: "bg-blue-500/10",
|
|
260
|
-
text: "text-blue-400"
|
|
261
|
-
},
|
|
262
|
-
emerald: {
|
|
263
|
-
border: "border-emerald-500/20",
|
|
264
|
-
bg: "bg-emerald-500/10",
|
|
265
|
-
text: "text-emerald-400"
|
|
266
|
-
},
|
|
267
|
-
orange: {
|
|
268
|
-
border: "border-orange-500/20",
|
|
269
|
-
bg: "bg-orange-500/10",
|
|
270
|
-
text: "text-orange-400"
|
|
271
|
-
},
|
|
272
|
-
rose: {
|
|
273
|
-
border: "border-rose-500/20",
|
|
274
|
-
bg: "bg-rose-500/10",
|
|
275
|
-
text: "text-rose-400"
|
|
276
|
-
},
|
|
277
|
-
amber: {
|
|
278
|
-
border: "border-amber-500/20",
|
|
279
|
-
bg: "bg-amber-500/10",
|
|
280
|
-
text: "text-amber-400"
|
|
281
|
-
},
|
|
282
|
-
cyan: {
|
|
283
|
-
border: "border-cyan-500/20",
|
|
284
|
-
bg: "bg-cyan-500/10",
|
|
285
|
-
text: "text-cyan-400"
|
|
286
|
-
},
|
|
287
|
-
indigo: {
|
|
288
|
-
border: "border-indigo-500/20",
|
|
289
|
-
bg: "bg-indigo-500/10",
|
|
290
|
-
text: "text-indigo-400"
|
|
291
|
-
}
|
|
292
|
-
}, ot = ({
|
|
293
|
-
action: t,
|
|
294
|
-
children: s,
|
|
295
|
-
className: n,
|
|
296
|
-
color: o = "purple",
|
|
297
|
-
icon: r,
|
|
298
|
-
iconColor: i,
|
|
299
|
-
subtitle: a,
|
|
300
|
-
title: l,
|
|
301
|
-
...u
|
|
302
|
-
}) => {
|
|
303
|
-
if (s)
|
|
304
|
-
return /* @__PURE__ */ e.jsx("div", { className: b("mb-4", n), ...u, children: s });
|
|
305
|
-
const d = Fe[i || o];
|
|
306
|
-
return /* @__PURE__ */ e.jsxs("div", { className: b("mb-4 flex items-start justify-between gap-3", n), ...u, children: [
|
|
307
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
308
|
-
r && /* @__PURE__ */ e.jsx("div", { className: b("rounded-lg border p-2", d.border, d.bg), children: /* @__PURE__ */ e.jsx(B, { className: d.text, icon: r }) }),
|
|
309
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
310
|
-
l && /* @__PURE__ */ e.jsx("h3", { className: "text-base font-semibold text-white", children: l }),
|
|
311
|
-
a && /* @__PURE__ */ e.jsx("p", { className: "text-sm text-neutral-400", children: a })
|
|
312
|
-
] })
|
|
313
|
-
] }),
|
|
314
|
-
t && /* @__PURE__ */ e.jsx("div", { children: t })
|
|
315
|
-
] });
|
|
316
|
-
}, lt = ({
|
|
317
|
-
children: t,
|
|
318
|
-
className: s,
|
|
319
|
-
flexGrow: n = !0,
|
|
320
|
-
...o
|
|
321
|
-
}) => /* @__PURE__ */ e.jsx("div", { className: b("py-2", n && "flex-grow", s), ...o, children: t }), at = ({ children: t, className: s, ...n }) => /* @__PURE__ */ e.jsx(
|
|
322
|
-
"div",
|
|
323
|
-
{
|
|
324
|
-
className: b(
|
|
325
|
-
"mt-4 flex items-center justify-end border-t border-neutral-800 pt-4",
|
|
326
|
-
s
|
|
327
|
-
),
|
|
328
|
-
...n,
|
|
329
|
-
children: t
|
|
330
|
-
}
|
|
331
|
-
), Se = {
|
|
332
|
-
sm: "h-4 w-4",
|
|
333
|
-
md: "h-5 w-5",
|
|
334
|
-
lg: "h-6 w-6"
|
|
335
|
-
}, $e = {
|
|
336
|
-
sm: 0.5,
|
|
337
|
-
md: 0.7,
|
|
338
|
-
lg: 0.9
|
|
339
|
-
}, it = ({
|
|
340
|
-
checked: t,
|
|
341
|
-
className: s,
|
|
342
|
-
defaultChecked: n,
|
|
343
|
-
description: o,
|
|
344
|
-
disabled: r = !1,
|
|
345
|
-
error: i = !1,
|
|
346
|
-
errorMessage: a,
|
|
347
|
-
id: l,
|
|
348
|
-
label: u,
|
|
349
|
-
name: h,
|
|
350
|
-
onChange: d,
|
|
351
|
-
required: m = !1,
|
|
352
|
-
size: p = "md",
|
|
353
|
-
value: f,
|
|
354
|
-
...g
|
|
355
|
-
}) => {
|
|
356
|
-
const j = G(), y = l || j, k = `${y}-checkbox`, c = `${y}-description`, v = `${y}-error`, N = i && a, E = /* @__PURE__ */ e.jsxs("div", { className: "relative inline-flex shrink-0", children: [
|
|
357
|
-
/* @__PURE__ */ e.jsx(
|
|
358
|
-
"input",
|
|
359
|
-
{
|
|
360
|
-
id: k,
|
|
361
|
-
"aria-describedby": [o ? c : "", N ? v : ""].filter(Boolean).join(" ") || void 0,
|
|
362
|
-
"aria-invalid": i,
|
|
363
|
-
"aria-required": m,
|
|
364
|
-
checked: t,
|
|
365
|
-
className: b(
|
|
366
|
-
"peer cursor-pointer appearance-none rounded-sm",
|
|
367
|
-
"checked:bg-violet-700",
|
|
368
|
-
"default-outset-focus",
|
|
369
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
370
|
-
i ? "default-error-border" : "default-border",
|
|
371
|
-
Se[p],
|
|
372
|
-
s
|
|
373
|
-
),
|
|
374
|
-
defaultChecked: n,
|
|
375
|
-
disabled: r,
|
|
376
|
-
name: h,
|
|
377
|
-
type: "checkbox",
|
|
378
|
-
value: f,
|
|
379
|
-
onChange: d,
|
|
380
|
-
...g
|
|
381
|
-
}
|
|
382
|
-
),
|
|
383
|
-
/* @__PURE__ */ e.jsx(
|
|
384
|
-
B,
|
|
385
|
-
{
|
|
386
|
-
className: "pointer-events-none absolute inset-0 m-auto opacity-0 peer-checked:opacity-80",
|
|
387
|
-
icon: "mdiCheck",
|
|
388
|
-
size: $e[p] || 0.7
|
|
389
|
-
}
|
|
390
|
-
)
|
|
391
|
-
] });
|
|
392
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-col gap-1", children: [
|
|
393
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-2", children: [
|
|
394
|
-
E,
|
|
395
|
-
u && /* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-col gap-1", children: [
|
|
396
|
-
/* @__PURE__ */ e.jsx(te, { htmlFor: k, required: m, children: u }),
|
|
397
|
-
o ? /* @__PURE__ */ e.jsx(se, { id: c, disabled: r, children: o }) : null
|
|
398
|
-
] })
|
|
399
|
-
] }),
|
|
400
|
-
N ? /* @__PURE__ */ e.jsx(re, { id: v, children: a }) : null
|
|
401
|
-
] });
|
|
402
|
-
}, ne = ({
|
|
403
|
-
align: t = "center",
|
|
404
|
-
ariaHaspopup: s,
|
|
405
|
-
children: n,
|
|
406
|
-
className: o,
|
|
407
|
-
content: r,
|
|
408
|
-
contentClassName: i,
|
|
409
|
-
contentRole: a,
|
|
410
|
-
contentStyle: l,
|
|
411
|
-
disabled: u = !1,
|
|
412
|
-
id: h,
|
|
413
|
-
offset: d = 8,
|
|
414
|
-
onOpenChange: m,
|
|
415
|
-
open: p,
|
|
416
|
-
portal: f = !0,
|
|
417
|
-
position: g = "top",
|
|
418
|
-
trigger: j = "hover",
|
|
419
|
-
useAriaControls: y = !1
|
|
420
|
-
}) => {
|
|
421
|
-
const k = G(), [c, v] = S(!1), N = ee(null), E = ee(null), F = p !== void 0, C = u ? !1 : F ? p : c, D = h || k, I = oe(
|
|
422
|
-
(x) => {
|
|
423
|
-
u || (m?.(x), F || v(x));
|
|
424
|
-
},
|
|
425
|
-
[u, F, m]
|
|
426
|
-
), W = oe(() => {
|
|
427
|
-
if (!N.current || !E.current || !C) return;
|
|
428
|
-
const x = N.current.getBoundingClientRect(), w = E.current.getBoundingClientRect(), z = {
|
|
429
|
-
width: window.innerWidth,
|
|
430
|
-
height: window.innerHeight
|
|
431
|
-
};
|
|
432
|
-
let L = g;
|
|
433
|
-
g === "top" && x.top < w.height + d ? L = "bottom" : g === "bottom" && x.bottom + w.height + d > z.height ? L = "top" : g === "left" && x.left < w.width + d ? L = "right" : g === "right" && x.right + w.width + d > z.width && (L = "left");
|
|
434
|
-
const M = H(x, w, L, t, d);
|
|
435
|
-
E.current && (E.current.style.left = `${M.x}px`, E.current.style.top = `${M.y}px`);
|
|
436
|
-
}, [C, g, t, d]);
|
|
437
|
-
V(() => {
|
|
438
|
-
if (!C || j !== "click") return;
|
|
439
|
-
const x = (w) => {
|
|
440
|
-
N.current && !N.current.contains(w.target) && E.current && !E.current.contains(w.target) && I(!1);
|
|
441
|
-
};
|
|
442
|
-
return document.addEventListener("mousedown", x), () => document.removeEventListener("mousedown", x);
|
|
443
|
-
}, [C, I, j]), V(() => {
|
|
444
|
-
if (C) {
|
|
445
|
-
W();
|
|
446
|
-
const x = () => W(), w = () => W();
|
|
447
|
-
return window.addEventListener("resize", x), window.addEventListener("scroll", w, !0), () => {
|
|
448
|
-
window.removeEventListener("resize", x), window.removeEventListener("scroll", w, !0);
|
|
449
|
-
};
|
|
450
|
-
}
|
|
451
|
-
}, [C, g, t, d, W]);
|
|
452
|
-
const H = (x, w, z, L, M) => {
|
|
453
|
-
let P = 0, T = 0;
|
|
454
|
-
switch (z) {
|
|
455
|
-
case "top":
|
|
456
|
-
P = x.left, T = x.top - w.height - M;
|
|
457
|
-
break;
|
|
458
|
-
case "bottom":
|
|
459
|
-
P = x.left, T = x.bottom + M;
|
|
460
|
-
break;
|
|
461
|
-
case "left":
|
|
462
|
-
P = x.left - w.width - M, T = x.top;
|
|
463
|
-
break;
|
|
464
|
-
case "right":
|
|
465
|
-
P = x.right + M, T = x.top;
|
|
466
|
-
break;
|
|
467
|
-
}
|
|
468
|
-
if (z === "top" || z === "bottom")
|
|
469
|
-
switch (L) {
|
|
470
|
-
case "start":
|
|
471
|
-
break;
|
|
472
|
-
case "center":
|
|
473
|
-
P = x.left + (x.width - w.width) / 2;
|
|
474
|
-
break;
|
|
475
|
-
case "end":
|
|
476
|
-
P = x.right - w.width;
|
|
477
|
-
break;
|
|
478
|
-
}
|
|
479
|
-
else if (z === "left" || z === "right")
|
|
480
|
-
switch (L) {
|
|
481
|
-
case "start":
|
|
482
|
-
break;
|
|
483
|
-
case "center":
|
|
484
|
-
T = x.top + (x.height - w.height) / 2;
|
|
485
|
-
break;
|
|
486
|
-
case "end":
|
|
487
|
-
T = x.bottom - w.height;
|
|
488
|
-
break;
|
|
489
|
-
}
|
|
490
|
-
return { x: P, y: T };
|
|
491
|
-
}, A = () => {
|
|
492
|
-
j === "hover" && I(!0);
|
|
493
|
-
}, J = () => {
|
|
494
|
-
j === "hover" && I(!1);
|
|
495
|
-
}, K = () => {
|
|
496
|
-
j === "click" && I(!C);
|
|
497
|
-
}, _ = () => {
|
|
498
|
-
j === "focus" && I(!0);
|
|
499
|
-
}, Y = () => {
|
|
500
|
-
j === "focus" && I(!1);
|
|
501
|
-
}, O = C ? /* @__PURE__ */ e.jsx(
|
|
502
|
-
"div",
|
|
503
|
-
{
|
|
504
|
-
id: D,
|
|
505
|
-
"aria-hidden": !C,
|
|
506
|
-
className: b(
|
|
507
|
-
"fixed z-50 transition-opacity duration-200",
|
|
508
|
-
C ? "opacity-100" : "pointer-events-none opacity-0",
|
|
509
|
-
i
|
|
510
|
-
),
|
|
511
|
-
ref: E,
|
|
512
|
-
role: a,
|
|
513
|
-
style: { left: -9999, top: -9999, ...l },
|
|
514
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "relative", children: r })
|
|
515
|
-
}
|
|
516
|
-
) : null;
|
|
517
|
-
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
518
|
-
/* @__PURE__ */ e.jsx(
|
|
519
|
-
"div",
|
|
520
|
-
{
|
|
521
|
-
"aria-controls": y && C ? D : void 0,
|
|
522
|
-
"aria-describedby": !y && C ? D : void 0,
|
|
523
|
-
"aria-expanded": y ? C : void 0,
|
|
524
|
-
"aria-haspopup": s,
|
|
525
|
-
className: b("w-full", o),
|
|
526
|
-
ref: N,
|
|
527
|
-
onBlur: Y,
|
|
528
|
-
onClick: K,
|
|
529
|
-
onFocus: _,
|
|
530
|
-
onMouseEnter: A,
|
|
531
|
-
onMouseLeave: J,
|
|
532
|
-
children: n
|
|
533
|
-
}
|
|
534
|
-
),
|
|
535
|
-
f && typeof document < "u" ? ce(O, document.body) : O
|
|
536
|
-
] });
|
|
537
|
-
}, ue = ({ children: t }) => /* @__PURE__ */ e.jsx(e.Fragment, { children: t }), De = ({ children: t }) => /* @__PURE__ */ e.jsx(e.Fragment, { children: t }), xe = ({ children: t, className: s }) => /* @__PURE__ */ e.jsx(
|
|
538
|
-
"div",
|
|
539
|
-
{
|
|
540
|
-
className: b(
|
|
541
|
-
"sticky top-0 flex-shrink-0 border-b border-neutral-700 bg-zinc-1000/95 px-3 py-2 backdrop-blur-lg",
|
|
542
|
-
s
|
|
543
|
-
),
|
|
544
|
-
children: t
|
|
545
|
-
}
|
|
546
|
-
), me = ae({
|
|
547
|
-
open: !1,
|
|
548
|
-
setOpen: () => {
|
|
549
|
-
},
|
|
550
|
-
disabled: !1
|
|
551
|
-
});
|
|
552
|
-
function fe() {
|
|
553
|
-
const t = ie(me);
|
|
554
|
-
if (t === void 0)
|
|
555
|
-
throw new Error("useDropdownContext must be used within a DropdownProvider");
|
|
556
|
-
return t;
|
|
557
|
-
}
|
|
558
|
-
const be = ({
|
|
559
|
-
animateIcon: t = !1,
|
|
560
|
-
children: s,
|
|
561
|
-
className: n,
|
|
562
|
-
disabled: o = !1,
|
|
563
|
-
icon: r,
|
|
564
|
-
outline: i = !1,
|
|
565
|
-
unstyled: a = !1,
|
|
566
|
-
...l
|
|
567
|
-
}) => {
|
|
568
|
-
const { disabled: u, open: h } = fe(), d = o || u;
|
|
569
|
-
return /* @__PURE__ */ e.jsxs(
|
|
570
|
-
"button",
|
|
571
|
-
{
|
|
572
|
-
"aria-expanded": h,
|
|
573
|
-
"aria-haspopup": "menu",
|
|
574
|
-
className: b(
|
|
575
|
-
!a && [
|
|
576
|
-
"flex h-10 items-center justify-between rounded-lg px-3 py-2 text-sm enabled:cursor-pointer enabled:text-white enabled:hover:bg-white/6",
|
|
577
|
-
"default-outset-focus",
|
|
578
|
-
i ? "default-border" : "bg-transparent",
|
|
579
|
-
"default-disabled"
|
|
580
|
-
],
|
|
581
|
-
n
|
|
582
|
-
),
|
|
583
|
-
disabled: d,
|
|
584
|
-
type: "button",
|
|
585
|
-
...l,
|
|
586
|
-
children: [
|
|
587
|
-
a ? s : /* @__PURE__ */ e.jsx("span", { className: "flex items-center gap-2", children: s }),
|
|
588
|
-
r && /* @__PURE__ */ e.jsx(
|
|
589
|
-
B,
|
|
590
|
-
{
|
|
591
|
-
className: $(
|
|
592
|
-
!a && "ml-2",
|
|
593
|
-
d && "text-neutral-500",
|
|
594
|
-
t && ["transition-transform duration-200", h && "rotate-180"]
|
|
595
|
-
),
|
|
596
|
-
icon: r,
|
|
597
|
-
size: 0.8
|
|
598
|
-
}
|
|
599
|
-
)
|
|
600
|
-
]
|
|
601
|
-
}
|
|
602
|
-
);
|
|
603
|
-
}, We = ({
|
|
604
|
-
children: t,
|
|
605
|
-
className: s,
|
|
606
|
-
defaultOpen: n = !1,
|
|
607
|
-
disabled: o = !1,
|
|
608
|
-
onOpenChange: r,
|
|
609
|
-
open: i
|
|
610
|
-
}) => {
|
|
611
|
-
const [a, l] = S(n), u = i !== void 0, h = u ? i : a, d = (c) => {
|
|
612
|
-
o || (u || l(c), r?.(c));
|
|
613
|
-
}, m = { open: h, setOpen: d, disabled: o };
|
|
614
|
-
let p = null, f = null;
|
|
615
|
-
const g = {
|
|
616
|
-
children: null,
|
|
617
|
-
className: ""
|
|
618
|
-
}, j = {
|
|
619
|
-
children: null,
|
|
620
|
-
className: ""
|
|
621
|
-
};
|
|
622
|
-
let y = {
|
|
623
|
-
side: "bottom",
|
|
624
|
-
align: "start",
|
|
625
|
-
className: ""
|
|
626
|
-
};
|
|
627
|
-
U.Children.forEach(t, (c) => {
|
|
628
|
-
if (U.isValidElement(c)) {
|
|
629
|
-
if (c.type === be)
|
|
630
|
-
p = c;
|
|
631
|
-
else if (c.type === xe) {
|
|
632
|
-
const v = c.props;
|
|
633
|
-
g.className = v.className, g.children = v.children;
|
|
634
|
-
} else if (c.type === De) {
|
|
635
|
-
const v = c.props;
|
|
636
|
-
j.className = v.className, j.children = v.children;
|
|
637
|
-
} else if (c.type === ue) {
|
|
638
|
-
const v = c.props;
|
|
639
|
-
f = v.children, y = {
|
|
640
|
-
side: v.side || "bottom",
|
|
641
|
-
align: v.align || "start",
|
|
642
|
-
className: v.className || ""
|
|
643
|
-
};
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
});
|
|
647
|
-
const k = /* @__PURE__ */ e.jsxs(
|
|
648
|
-
"div",
|
|
649
|
-
{
|
|
650
|
-
className: b(
|
|
651
|
-
"default-border z-50 flex max-h-96 min-w-[8rem] flex-col overflow-hidden rounded-lg bg-zinc-1000/50 p-1 backdrop-blur-xl",
|
|
652
|
-
y.side === "bottom" && "animate-dropdown-in-bottom",
|
|
653
|
-
y.side === "top" && "animate-dropdown-in-top",
|
|
654
|
-
y.className
|
|
655
|
-
),
|
|
656
|
-
children: [
|
|
657
|
-
g.children ? /* @__PURE__ */ e.jsx(
|
|
658
|
-
"div",
|
|
659
|
-
{
|
|
660
|
-
className: b(
|
|
661
|
-
"flex-shrink-0 border-b border-neutral-700 bg-zinc-1000/95 px-3 py-2 backdrop-blur-sm",
|
|
662
|
-
g.className
|
|
663
|
-
),
|
|
664
|
-
children: g.children
|
|
665
|
-
}
|
|
666
|
-
) : null,
|
|
667
|
-
/* @__PURE__ */ e.jsx("ul", { className: b("min-h-0 flex-1 overflow-y-auto"), children: f }),
|
|
668
|
-
j.children ? /* @__PURE__ */ e.jsx(
|
|
669
|
-
"div",
|
|
670
|
-
{
|
|
671
|
-
className: b(
|
|
672
|
-
"flex-shrink-0 border-t border-neutral-700 bg-zinc-1000/95 px-3 py-2 backdrop-blur-sm",
|
|
673
|
-
j.className
|
|
674
|
-
),
|
|
675
|
-
children: j.children
|
|
676
|
-
}
|
|
677
|
-
) : null
|
|
678
|
-
]
|
|
679
|
-
}
|
|
680
|
-
);
|
|
681
|
-
return /* @__PURE__ */ e.jsx(me.Provider, { value: m, children: /* @__PURE__ */ e.jsx("div", { className: b("inline-block", s), children: /* @__PURE__ */ e.jsx(
|
|
682
|
-
ne,
|
|
683
|
-
{
|
|
684
|
-
align: y.align,
|
|
685
|
-
content: k,
|
|
686
|
-
contentRole: "menu",
|
|
687
|
-
disabled: o,
|
|
688
|
-
open: h,
|
|
689
|
-
portal: !0,
|
|
690
|
-
position: y.side,
|
|
691
|
-
trigger: "click",
|
|
692
|
-
onOpenChange: d,
|
|
693
|
-
children: p
|
|
694
|
-
}
|
|
695
|
-
) }) });
|
|
696
|
-
}, Be = ({
|
|
697
|
-
children: t,
|
|
698
|
-
className: s,
|
|
699
|
-
disabled: n = !1,
|
|
700
|
-
icon: o,
|
|
701
|
-
onClick: r,
|
|
702
|
-
unstyled: i = !1
|
|
703
|
-
}) => {
|
|
704
|
-
const { setOpen: a } = fe(), l = (u) => {
|
|
705
|
-
n || (r && r(u), a(!1));
|
|
706
|
-
};
|
|
707
|
-
return /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsxs(
|
|
708
|
-
"button",
|
|
709
|
-
{
|
|
710
|
-
className: b(
|
|
711
|
-
!i && [
|
|
712
|
-
"group flex w-full items-center rounded-sm px-2 py-1.5 text-left text-sm enabled:text-white",
|
|
713
|
-
"enabled:cursor-pointer enabled:hover:bg-white/6",
|
|
714
|
-
"default-inset-focus",
|
|
715
|
-
"default-disabled"
|
|
716
|
-
],
|
|
717
|
-
s
|
|
718
|
-
),
|
|
719
|
-
disabled: n,
|
|
720
|
-
role: "menuitem",
|
|
721
|
-
onClick: l,
|
|
722
|
-
children: [
|
|
723
|
-
o && /* @__PURE__ */ e.jsx(
|
|
724
|
-
B,
|
|
725
|
-
{
|
|
726
|
-
className: $("mr-2", n && "text-neutral-500"),
|
|
727
|
-
icon: o,
|
|
728
|
-
size: 0.75
|
|
729
|
-
}
|
|
730
|
-
),
|
|
731
|
-
t
|
|
732
|
-
]
|
|
733
|
-
}
|
|
734
|
-
) });
|
|
735
|
-
}, ct = ({ className: t }) => /* @__PURE__ */ e.jsx("li", { className: "px-1 py-1", children: /* @__PURE__ */ e.jsx("hr", { className: b("border-t-neutral-700", t) }) }), dt = ({ children: t, className: s }) => /* @__PURE__ */ e.jsx(
|
|
736
|
-
"span",
|
|
737
|
-
{
|
|
738
|
-
className: b("ml-auto text-xs tracking-widest text-neutral-500", s),
|
|
739
|
-
"data-part": "dropdown-shortcut",
|
|
740
|
-
children: t
|
|
741
|
-
}
|
|
742
|
-
), Me = {
|
|
743
|
-
error: {
|
|
744
|
-
background: "bg-rose-500/20",
|
|
745
|
-
iconClass: "text-rose-400",
|
|
746
|
-
icon: "mdiAlertCircleOutline"
|
|
747
|
-
},
|
|
748
|
-
success: {
|
|
749
|
-
background: "bg-green-500/20",
|
|
750
|
-
iconClass: "text-green-400",
|
|
751
|
-
icon: "mdiCheckCircleOutline"
|
|
752
|
-
},
|
|
753
|
-
warning: {
|
|
754
|
-
background: "bg-amber-500/20",
|
|
755
|
-
iconClass: "text-amber-400",
|
|
756
|
-
icon: "mdiAlertOutline"
|
|
757
|
-
},
|
|
758
|
-
info: {
|
|
759
|
-
background: "bg-blue-500/20",
|
|
760
|
-
iconClass: "text-blue-400",
|
|
761
|
-
icon: "mdiInformationOutline"
|
|
762
|
-
},
|
|
763
|
-
default: {
|
|
764
|
-
background: "bg-neutral-500/20",
|
|
765
|
-
iconClass: "text-neutral-400",
|
|
766
|
-
icon: "mdiBellOutline"
|
|
767
|
-
}
|
|
768
|
-
}, ut = ({
|
|
769
|
-
className: t,
|
|
770
|
-
disabled: s = !1,
|
|
771
|
-
emptyMessage: n = "No notifications",
|
|
772
|
-
maxHeight: o = "max-h-96",
|
|
773
|
-
notifications: r,
|
|
774
|
-
onMarkAllRead: i,
|
|
775
|
-
onNotificationClick: a,
|
|
776
|
-
unreadCount: l = 0
|
|
777
|
-
}) => {
|
|
778
|
-
const [u, h] = S(!1), [d, m] = S(!1), p = l > 99 ? "99+" : l.toString(), f = l > 0, g = r.length > 0;
|
|
779
|
-
V(() => {
|
|
780
|
-
const c = () => {
|
|
781
|
-
const v = window.innerWidth < pe;
|
|
782
|
-
m(v), v && u ? document.body.classList.add("overflow-hidden") : document.body.classList.remove("overflow-hidden");
|
|
783
|
-
};
|
|
784
|
-
return c(), window.addEventListener("resize", c), () => {
|
|
785
|
-
document.body.classList.remove("overflow-hidden"), window.removeEventListener("resize", c);
|
|
786
|
-
};
|
|
787
|
-
}, [u]);
|
|
788
|
-
const j = (c) => {
|
|
789
|
-
a?.(c), d && h(!1);
|
|
790
|
-
}, y = () => {
|
|
791
|
-
i?.(), d && h(!1);
|
|
792
|
-
}, k = () => /* @__PURE__ */ e.jsx(e.Fragment, { children: g ? /* @__PURE__ */ e.jsx("div", { className: "divide-y divide-neutral-800/50", children: r.map((c, v) => {
|
|
793
|
-
const N = Me[c.type || "default"];
|
|
794
|
-
return /* @__PURE__ */ e.jsxs(
|
|
795
|
-
Be,
|
|
796
|
-
{
|
|
797
|
-
className: b(
|
|
798
|
-
"secondary-inset-focus flex w-full items-start gap-3 px-3 py-3 text-left hover:bg-white/6",
|
|
799
|
-
!c.read && "bg-white/3",
|
|
800
|
-
v === r.length - 1 && "pb-4"
|
|
801
|
-
),
|
|
802
|
-
unstyled: !0,
|
|
803
|
-
onClick: () => j(c),
|
|
804
|
-
children: [
|
|
805
|
-
/* @__PURE__ */ e.jsx(
|
|
806
|
-
"div",
|
|
807
|
-
{
|
|
808
|
-
className: b(
|
|
809
|
-
"mt-0.5 flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg",
|
|
810
|
-
N.background
|
|
811
|
-
),
|
|
812
|
-
children: c.img ? /* @__PURE__ */ e.jsx(
|
|
813
|
-
ye,
|
|
814
|
-
{
|
|
815
|
-
alt: "User avatar",
|
|
816
|
-
fallback: "NA",
|
|
817
|
-
size: "md",
|
|
818
|
-
src: c.img
|
|
819
|
-
}
|
|
820
|
-
) : /* @__PURE__ */ e.jsx(
|
|
821
|
-
B,
|
|
822
|
-
{
|
|
823
|
-
className: N.iconClass,
|
|
824
|
-
icon: c.icon ?? N.icon,
|
|
825
|
-
size: 0.75
|
|
826
|
-
}
|
|
827
|
-
)
|
|
828
|
-
}
|
|
829
|
-
),
|
|
830
|
-
/* @__PURE__ */ e.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
831
|
-
/* @__PURE__ */ e.jsx("p", { className: "mb-1 text-sm leading-5 text-white", children: c.title }),
|
|
832
|
-
c.message && /* @__PURE__ */ e.jsx("p", { className: "mb-1 text-xs leading-4 text-neutral-400", children: c.message }),
|
|
833
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-xs text-neutral-500", children: ge(c.timestamp) })
|
|
834
|
-
] }),
|
|
835
|
-
!c.read && /* @__PURE__ */ e.jsx("div", { className: "mt-1.5 h-2 w-2 flex-shrink-0 rounded-full bg-rose-500" })
|
|
836
|
-
]
|
|
837
|
-
},
|
|
838
|
-
c.id
|
|
839
|
-
);
|
|
840
|
-
}) }) : /* @__PURE__ */ e.jsxs(
|
|
841
|
-
"div",
|
|
842
|
-
{
|
|
843
|
-
"aria-label": "No notifications available",
|
|
844
|
-
className: "px-3 py-8 text-center",
|
|
845
|
-
role: "status",
|
|
846
|
-
children: [
|
|
847
|
-
/* @__PURE__ */ e.jsx(B, { className: "mx-auto mb-2 text-neutral-500", icon: "mdiBellOffOutline", size: 2 }),
|
|
848
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-neutral-400", children: n })
|
|
849
|
-
]
|
|
850
|
-
}
|
|
851
|
-
) });
|
|
852
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: d ? /* @__PURE__ */ e.jsxs("div", { children: [
|
|
853
|
-
/* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
854
|
-
/* @__PURE__ */ e.jsx(
|
|
855
|
-
le,
|
|
856
|
-
{
|
|
857
|
-
"aria-expanded": u,
|
|
858
|
-
"aria-label": `Notifications${f ? ` (${l} unread)` : ""}`,
|
|
859
|
-
disabled: s,
|
|
860
|
-
icon: "mdiBellOutline",
|
|
861
|
-
variant: "ghost",
|
|
862
|
-
onClick: () => h(!u)
|
|
863
|
-
}
|
|
864
|
-
),
|
|
865
|
-
f ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx("div", { className: "absolute -top-2 -right-2", children: /* @__PURE__ */ e.jsx(q, { className: "min-w-[1.25rem] justify-center px-1", color: "violet", size: "sm", children: p }) }) }) : null
|
|
866
|
-
] }),
|
|
867
|
-
ce(
|
|
868
|
-
/* @__PURE__ */ e.jsxs(
|
|
869
|
-
"div",
|
|
870
|
-
{
|
|
871
|
-
"aria-labelledby": "notifications-title-mobile",
|
|
872
|
-
"aria-modal": "true",
|
|
873
|
-
className: b(
|
|
874
|
-
"fixed inset-y-0 z-50 flex w-full flex-col bg-zinc-1000/50 backdrop-blur-xl transition-transform duration-300",
|
|
875
|
-
u ? "translate-x-0" : "translate-x-full"
|
|
876
|
-
),
|
|
877
|
-
role: "dialog",
|
|
878
|
-
children: [
|
|
879
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex h-15 items-center justify-between border-b border-neutral-800 px-4", children: [
|
|
880
|
-
d ? /* @__PURE__ */ e.jsx(
|
|
881
|
-
le,
|
|
882
|
-
{
|
|
883
|
-
"aria-label": "Close sidebar",
|
|
884
|
-
icon: "mdiClose",
|
|
885
|
-
variant: "ghost",
|
|
886
|
-
onClick: () => h(!1)
|
|
887
|
-
}
|
|
888
|
-
) : null,
|
|
889
|
-
/* @__PURE__ */ e.jsx("h3", { id: "notifications-title-mobile", className: "text-sm font-semibold text-white", children: "Notifications" }),
|
|
890
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: f && i && /* @__PURE__ */ e.jsx(
|
|
891
|
-
"button",
|
|
892
|
-
{
|
|
893
|
-
className: "cursor-pointer text-xs text-neutral-400 transition-colors hover:text-white",
|
|
894
|
-
onClick: y,
|
|
895
|
-
children: "Mark all read"
|
|
896
|
-
}
|
|
897
|
-
) })
|
|
898
|
-
] }),
|
|
899
|
-
/* @__PURE__ */ e.jsx("ul", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ e.jsx(k, {}) })
|
|
900
|
-
]
|
|
901
|
-
}
|
|
902
|
-
),
|
|
903
|
-
document.body
|
|
904
|
-
)
|
|
905
|
-
] }) : /* @__PURE__ */ e.jsxs(We, { className: t, disabled: s, children: [
|
|
906
|
-
/* @__PURE__ */ e.jsx(
|
|
907
|
-
be,
|
|
908
|
-
{
|
|
909
|
-
"aria-label": `Notifications${f ? ` (${l} unread)` : ""}`,
|
|
910
|
-
className: $(
|
|
911
|
-
"relative flex h-10 w-10 items-center justify-center px-2 text-sm",
|
|
912
|
-
"secondary-outset-focus group rounded-lg border border-transparent bg-transparent text-white enabled:cursor-pointer enabled:hover:bg-white/6"
|
|
913
|
-
),
|
|
914
|
-
disabled: s,
|
|
915
|
-
icon: "mdiBellOutline",
|
|
916
|
-
unstyled: !0,
|
|
917
|
-
children: f ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx("div", { className: "absolute -top-2 -right-2", children: /* @__PURE__ */ e.jsx(q, { className: "min-w-[1.25rem] justify-center px-1", color: "violet", size: "sm", children: p }) }) }) : null
|
|
918
|
-
}
|
|
919
|
-
),
|
|
920
|
-
/* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
921
|
-
/* @__PURE__ */ e.jsx("h3", { id: "notifications-title", className: "text-sm font-semibold text-white", children: "Notifications" }),
|
|
922
|
-
f && i && /* @__PURE__ */ e.jsx(
|
|
923
|
-
"button",
|
|
924
|
-
{
|
|
925
|
-
className: "secondary-outset-focus cursor-pointer rounded-lg p-1 text-xs text-neutral-400 transition-colors hover:text-white",
|
|
926
|
-
onClick: i,
|
|
927
|
-
children: "Mark all read"
|
|
928
|
-
}
|
|
929
|
-
)
|
|
930
|
-
] }) }),
|
|
931
|
-
/* @__PURE__ */ e.jsx(
|
|
932
|
-
ue,
|
|
933
|
-
{
|
|
934
|
-
align: "end",
|
|
935
|
-
"aria-labelledby": "notifications-title",
|
|
936
|
-
className: b("flex w-85 flex-col overflow-hidden p-0", o),
|
|
937
|
-
side: "bottom",
|
|
938
|
-
children: /* @__PURE__ */ e.jsx(k, {})
|
|
939
|
-
}
|
|
940
|
-
)
|
|
941
|
-
] }) });
|
|
942
|
-
}, he = ae(void 0), Pe = () => {
|
|
943
|
-
const t = ie(he);
|
|
944
|
-
if (!t)
|
|
945
|
-
throw new Error("Select components must be used within an OxSelect");
|
|
946
|
-
return t;
|
|
947
|
-
}, Te = ({
|
|
948
|
-
children: t,
|
|
949
|
-
className: s,
|
|
950
|
-
disabled: n = !1,
|
|
951
|
-
id: o,
|
|
952
|
-
value: r
|
|
953
|
-
}) => {
|
|
954
|
-
const { closeDropdown: i, onSelect: a, selectedValue: l } = Pe(), u = () => {
|
|
955
|
-
a({ value: r, label: t });
|
|
956
|
-
}, h = (m) => {
|
|
957
|
-
(m.key === "Enter" || m.key === " ") && (m.preventDefault(), a({ value: r, label: t })), m.key === "Escape" && i();
|
|
958
|
-
}, d = l.includes(r);
|
|
959
|
-
return /* @__PURE__ */ e.jsx("li", { role: "none", children: /* @__PURE__ */ e.jsxs(
|
|
960
|
-
"button",
|
|
961
|
-
{
|
|
962
|
-
id: o,
|
|
963
|
-
"aria-selected": d,
|
|
964
|
-
className: b(
|
|
965
|
-
"group flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-left text-sm enabled:text-white",
|
|
966
|
-
"enabled:cursor-pointer enabled:hover:bg-white/6",
|
|
967
|
-
"default-inset-focus",
|
|
968
|
-
"default-disabled",
|
|
969
|
-
d && "bg-white/5",
|
|
970
|
-
s
|
|
971
|
-
),
|
|
972
|
-
disabled: n,
|
|
973
|
-
role: "option",
|
|
974
|
-
tabIndex: n ? -1 : 0,
|
|
975
|
-
onClick: u,
|
|
976
|
-
onKeyDown: h,
|
|
977
|
-
children: [
|
|
978
|
-
t,
|
|
979
|
-
d && !n && /* @__PURE__ */ e.jsx(B, { className: "text-violet-700", icon: "mdiCheck", size: 0.8 })
|
|
980
|
-
]
|
|
981
|
-
}
|
|
982
|
-
) });
|
|
983
|
-
};
|
|
984
|
-
let Z = null, R = null;
|
|
985
|
-
const He = () => (Z || (Z = document.createElement("canvas"), R = Z.getContext("2d"), R.font = "0.875rem system-ui, sans-serif"), R), Ve = (t, s, n) => {
|
|
986
|
-
if (t.length === 0) return [];
|
|
987
|
-
if (!s.current) return t.slice(0, 1);
|
|
988
|
-
const o = s.current.offsetWidth || 0, r = 12, i = 32, a = 32;
|
|
989
|
-
let l = o - r - i;
|
|
990
|
-
t.length > 1 && (l -= a);
|
|
991
|
-
const u = He();
|
|
992
|
-
if (!u) return t.slice(0, 2);
|
|
993
|
-
const h = n ? 4 : 8, d = n ? 12 : 0;
|
|
994
|
-
let m = 0, p = 0;
|
|
995
|
-
for (let f = 0; f < t.length; f++) {
|
|
996
|
-
const g = t[f], j = String(g.label), k = u.measureText(j).width + (n ? d : 0), c = f > 0 ? m + k + h : m + k;
|
|
997
|
-
if (c <= l)
|
|
998
|
-
m = c, p++;
|
|
999
|
-
else
|
|
1000
|
-
break;
|
|
1001
|
-
}
|
|
1002
|
-
return p = Math.max(1, p), t.slice(0, p);
|
|
1003
|
-
}, Ae = (t) => t == null ? [] : Array.isArray(t) ? t : [t], xt = ({
|
|
1004
|
-
badgeColor: t = "purple",
|
|
1005
|
-
children: s,
|
|
1006
|
-
className: n,
|
|
1007
|
-
defaultValue: o = null,
|
|
1008
|
-
description: r,
|
|
1009
|
-
disabled: i = !1,
|
|
1010
|
-
displayAsBadges: a = !1,
|
|
1011
|
-
error: l = !1,
|
|
1012
|
-
errorMessage: u,
|
|
1013
|
-
id: h,
|
|
1014
|
-
label: d,
|
|
1015
|
-
multiple: m = !1,
|
|
1016
|
-
name: p,
|
|
1017
|
-
onChange: f,
|
|
1018
|
-
placeholder: g = "Select an option",
|
|
1019
|
-
required: j = !1
|
|
1020
|
-
}) => {
|
|
1021
|
-
const y = G(), k = ee(null), [c, v] = S(!1), [N, E] = S([]), F = h || y, C = `${F}-select`, D = `${F}-description`, I = `${F}-error`, W = l && u, H = (O, x) => {
|
|
1022
|
-
let w = null;
|
|
1023
|
-
return U.Children.forEach(O, (z) => {
|
|
1024
|
-
if (U.isValidElement(z) && z.type === Te) {
|
|
1025
|
-
const L = z.props;
|
|
1026
|
-
L.value === x && (w = { value: L.value, label: L.children });
|
|
1027
|
-
}
|
|
1028
|
-
}), w;
|
|
1029
|
-
}, A = (O) => {
|
|
1030
|
-
let x;
|
|
1031
|
-
if (m ? N.some((z) => z.value === O.value) ? x = N.filter((z) => z.value !== O.value) : x = [...N, O] : (x = [O], v(!1)), E(x), f) {
|
|
1032
|
-
const w = m ? x.map((z) => z.value) : x[0]?.value ?? null;
|
|
1033
|
-
f(w);
|
|
1034
|
-
}
|
|
1035
|
-
};
|
|
1036
|
-
V(() => {
|
|
1037
|
-
if (o !== void 0) {
|
|
1038
|
-
const O = Ae(o), x = [];
|
|
1039
|
-
O.forEach((w) => {
|
|
1040
|
-
const z = H(s, w);
|
|
1041
|
-
z && x.push(z);
|
|
1042
|
-
}), E(m ? x : x.slice(0, 1));
|
|
1043
|
-
}
|
|
1044
|
-
}, [o, s, m]);
|
|
1045
|
-
const J = /* @__PURE__ */ e.jsx(
|
|
1046
|
-
"ul",
|
|
1047
|
-
{
|
|
1048
|
-
id: `${C}-listbox`,
|
|
1049
|
-
"aria-multiselectable": m,
|
|
1050
|
-
className: "max-h-72 space-y-0.5 overflow-hidden overflow-y-auto",
|
|
1051
|
-
role: "listbox",
|
|
1052
|
-
children: s
|
|
1053
|
-
}
|
|
1054
|
-
), K = Ve(N, k, a), _ = N.length - K.length, Y = _ > 0;
|
|
1055
|
-
return /* @__PURE__ */ e.jsx(
|
|
1056
|
-
he.Provider,
|
|
1057
|
-
{
|
|
1058
|
-
value: {
|
|
1059
|
-
selectedValue: N.map((O) => O.value),
|
|
1060
|
-
multiple: m,
|
|
1061
|
-
onSelect: A,
|
|
1062
|
-
closeDropdown: () => v(!1)
|
|
1063
|
-
},
|
|
1064
|
-
children: /* @__PURE__ */ e.jsxs("div", { className: b("flex w-full flex-col gap-1", n), children: [
|
|
1065
|
-
d && /* @__PURE__ */ e.jsx(te, { htmlFor: C, required: j, children: d }),
|
|
1066
|
-
/* @__PURE__ */ e.jsx(
|
|
1067
|
-
ne,
|
|
1068
|
-
{
|
|
1069
|
-
align: "start",
|
|
1070
|
-
content: J,
|
|
1071
|
-
contentClassName: "default-border bg-zinc-1000/70 rounded-lg p-1 backdrop-blur-xl animate-dropdown-in-bottom",
|
|
1072
|
-
contentStyle: { minWidth: `${k.current?.offsetWidth || 200}px` },
|
|
1073
|
-
disabled: i,
|
|
1074
|
-
open: c,
|
|
1075
|
-
position: "bottom",
|
|
1076
|
-
trigger: "click",
|
|
1077
|
-
onOpenChange: v,
|
|
1078
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
1079
|
-
"button",
|
|
1080
|
-
{
|
|
1081
|
-
id: C,
|
|
1082
|
-
"aria-controls": `${C}-listbox`,
|
|
1083
|
-
"aria-describedby": [r ? D : "", W ? I : ""].filter(Boolean).join(" ") || void 0,
|
|
1084
|
-
"aria-disabled": i,
|
|
1085
|
-
"aria-expanded": c,
|
|
1086
|
-
"aria-haspopup": "listbox",
|
|
1087
|
-
"aria-invalid": l,
|
|
1088
|
-
"aria-required": j,
|
|
1089
|
-
className: $(
|
|
1090
|
-
"relative flex h-10 w-full gap-x-2 rounded-lg py-2 ps-3 pe-8 text-start text-sm enabled:cursor-pointer enabled:text-white",
|
|
1091
|
-
"default-outset-focus default-disabled",
|
|
1092
|
-
l ? "default-error-border" : "default-border",
|
|
1093
|
-
c && "default-active-border"
|
|
1094
|
-
),
|
|
1095
|
-
disabled: i,
|
|
1096
|
-
ref: k,
|
|
1097
|
-
role: "combobox",
|
|
1098
|
-
type: "button",
|
|
1099
|
-
children: [
|
|
1100
|
-
/* @__PURE__ */ e.jsx(
|
|
1101
|
-
"span",
|
|
1102
|
-
{
|
|
1103
|
-
className: $(
|
|
1104
|
-
"w-full overflow-hidden text-ellipsis",
|
|
1105
|
-
a ? m && "flex flex-wrap gap-1" : "whitespace-nowrap",
|
|
1106
|
-
i && a && "opacity-50"
|
|
1107
|
-
),
|
|
1108
|
-
children: N.length > 0 ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1109
|
-
a && m ? K.map((O) => /* @__PURE__ */ e.jsx(q, { color: t, size: "sm", children: O.label }, String(O.value))) : K.map((O, x, w) => /* @__PURE__ */ e.jsxs(U.Fragment, { children: [
|
|
1110
|
-
O.label,
|
|
1111
|
-
x < w.length - 1 && ", "
|
|
1112
|
-
] }, String(O.value))),
|
|
1113
|
-
Y && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1114
|
-
!(a && m) && " ",
|
|
1115
|
-
/* @__PURE__ */ e.jsxs(q, { color: t, size: "sm", children: [
|
|
1116
|
-
"+",
|
|
1117
|
-
_
|
|
1118
|
-
] })
|
|
1119
|
-
] })
|
|
1120
|
-
] }) : g
|
|
1121
|
-
}
|
|
1122
|
-
),
|
|
1123
|
-
/* @__PURE__ */ e.jsx("div", { className: "absolute end-3 top-1/2 -translate-y-1/2", children: /* @__PURE__ */ e.jsx(
|
|
1124
|
-
B,
|
|
1125
|
-
{
|
|
1126
|
-
className: $(
|
|
1127
|
-
"transition-transform duration-300 ease-in-out",
|
|
1128
|
-
i && "text-neutral-500",
|
|
1129
|
-
c && "rotate-180"
|
|
1130
|
-
),
|
|
1131
|
-
icon: "mdiChevronDown",
|
|
1132
|
-
size: 0.8
|
|
1133
|
-
}
|
|
1134
|
-
) })
|
|
1135
|
-
]
|
|
1136
|
-
}
|
|
1137
|
-
)
|
|
1138
|
-
}
|
|
1139
|
-
),
|
|
1140
|
-
p && /* @__PURE__ */ e.jsx(
|
|
1141
|
-
"input",
|
|
1142
|
-
{
|
|
1143
|
-
name: p,
|
|
1144
|
-
type: "hidden",
|
|
1145
|
-
value: N.map((O) => O.value).join(",")
|
|
1146
|
-
}
|
|
1147
|
-
),
|
|
1148
|
-
r && /* @__PURE__ */ e.jsx(se, { id: D, disabled: i, children: r }),
|
|
1149
|
-
W && /* @__PURE__ */ e.jsx(re, { id: I, children: u })
|
|
1150
|
-
] })
|
|
1151
|
-
}
|
|
1152
|
-
);
|
|
1153
|
-
}, mt = ({ children: t, className: s }) => /* @__PURE__ */ e.jsx("div", { className: b("px-2 py-1 text-xs font-medium text-neutral-400", s), children: t }), Ke = {
|
|
1154
|
-
default: "bg-zinc-800/80",
|
|
1155
|
-
purple: "bg-purple-950/50",
|
|
1156
|
-
blue: "bg-blue-950/50",
|
|
1157
|
-
gray: "bg-gray-800/50"
|
|
1158
|
-
}, Ue = {
|
|
1159
|
-
rectangle: "rounded-md",
|
|
1160
|
-
circle: "rounded-full"
|
|
1161
|
-
}, _e = ({
|
|
1162
|
-
animate: t = !0,
|
|
1163
|
-
className: s,
|
|
1164
|
-
color: n = "default",
|
|
1165
|
-
fullWidth: o = !1,
|
|
1166
|
-
height: r,
|
|
1167
|
-
shape: i = "rectangle",
|
|
1168
|
-
width: a,
|
|
1169
|
-
...l
|
|
1170
|
-
}) => {
|
|
1171
|
-
const u = {
|
|
1172
|
-
height: typeof r == "number" ? `${r}px` : r,
|
|
1173
|
-
width: typeof a == "number" ? `${a}px` : a
|
|
1174
|
-
};
|
|
1175
|
-
return /* @__PURE__ */ e.jsx(
|
|
1176
|
-
"div",
|
|
1177
|
-
{
|
|
1178
|
-
"aria-busy": "true",
|
|
1179
|
-
"aria-label": "Loading...",
|
|
1180
|
-
className: b(
|
|
1181
|
-
"relative overflow-hidden",
|
|
1182
|
-
Ke[n],
|
|
1183
|
-
Ue[i],
|
|
1184
|
-
t && "animate-pulse",
|
|
1185
|
-
o && "w-full",
|
|
1186
|
-
s
|
|
1187
|
-
),
|
|
1188
|
-
role: "status",
|
|
1189
|
-
style: u,
|
|
1190
|
-
...l
|
|
1191
|
-
}
|
|
1192
|
-
);
|
|
1193
|
-
}, ft = ({
|
|
1194
|
-
animate: t = !0,
|
|
1195
|
-
className: s,
|
|
1196
|
-
color: n = "default",
|
|
1197
|
-
fullWidth: o = !1,
|
|
1198
|
-
gap: r = 8,
|
|
1199
|
-
height: i = 20,
|
|
1200
|
-
lines: a = 1,
|
|
1201
|
-
width: l,
|
|
1202
|
-
...u
|
|
1203
|
-
}) => {
|
|
1204
|
-
const h = (p) => p <= 1 ? `${p * 100}%` : `${p}px`, d = (p) => {
|
|
1205
|
-
if (!o) {
|
|
1206
|
-
if (Array.isArray(l)) {
|
|
1207
|
-
const f = l[p % l.length];
|
|
1208
|
-
return f == null ? void 0 : typeof f == "number" ? h(f) : f;
|
|
1209
|
-
}
|
|
1210
|
-
if (typeof l == "number") {
|
|
1211
|
-
if (a > 1 && p === a - 1) {
|
|
1212
|
-
const f = l <= 1 ? l * 0.6 : Math.max(100, l * 0.6);
|
|
1213
|
-
return h(f);
|
|
1214
|
-
}
|
|
1215
|
-
return h(l);
|
|
1216
|
-
}
|
|
1217
|
-
return "200px";
|
|
1218
|
-
}
|
|
1219
|
-
}, m = {
|
|
1220
|
-
4: "space-y-1",
|
|
1221
|
-
8: "space-y-2",
|
|
1222
|
-
12: "space-y-3",
|
|
1223
|
-
16: "space-y-4",
|
|
1224
|
-
20: "space-y-5"
|
|
1225
|
-
}[r] || "space-y-2";
|
|
1226
|
-
return /* @__PURE__ */ e.jsx("div", { className: b("flex flex-col", m, s), ...u, children: Array.from({ length: a }).map((p, f) => /* @__PURE__ */ e.jsx(
|
|
1227
|
-
_e,
|
|
1228
|
-
{
|
|
1229
|
-
animate: t,
|
|
1230
|
-
color: n,
|
|
1231
|
-
fullWidth: o,
|
|
1232
|
-
height: i,
|
|
1233
|
-
width: d(f)
|
|
1234
|
-
},
|
|
1235
|
-
f
|
|
1236
|
-
)) });
|
|
1237
|
-
}, bt = ({
|
|
1238
|
-
className: t,
|
|
1239
|
-
description: s,
|
|
1240
|
-
disabled: n = !1,
|
|
1241
|
-
error: o = !1,
|
|
1242
|
-
errorMessage: r,
|
|
1243
|
-
id: i,
|
|
1244
|
-
label: a,
|
|
1245
|
-
name: l,
|
|
1246
|
-
onChange: u,
|
|
1247
|
-
placeholder: h = "Enter text...",
|
|
1248
|
-
readOnly: d = !1,
|
|
1249
|
-
required: m = !1,
|
|
1250
|
-
rows: p = 3,
|
|
1251
|
-
showMaxLength: f = !1,
|
|
1252
|
-
value: g,
|
|
1253
|
-
...j
|
|
1254
|
-
}) => {
|
|
1255
|
-
const y = G(), [k, c] = S(
|
|
1256
|
-
typeof g == "string" ? g.length : 0
|
|
1257
|
-
), v = i || y, N = `${v}-textarea`, E = `${v}-description`, F = `${v}-error`, C = j.maxLength, D = o && r;
|
|
1258
|
-
V(() => {
|
|
1259
|
-
typeof g == "string" && c(g.length);
|
|
1260
|
-
}, [g]);
|
|
1261
|
-
const I = (H) => {
|
|
1262
|
-
const A = H.target.value.length;
|
|
1263
|
-
c(A), u?.(H);
|
|
1264
|
-
}, W = /* @__PURE__ */ e.jsx(
|
|
1265
|
-
"textarea",
|
|
1266
|
-
{
|
|
1267
|
-
id: N,
|
|
1268
|
-
"aria-describedby": [s ? E : "", D ? F : ""].filter(Boolean).join(" ") || void 0,
|
|
1269
|
-
"aria-invalid": o,
|
|
1270
|
-
"aria-required": m,
|
|
1271
|
-
className: b(
|
|
1272
|
-
"flex min-h-10 w-full resize-y rounded-lg bg-transparent px-2 py-2 text-sm text-white",
|
|
1273
|
-
"placeholder:text-neutral-500",
|
|
1274
|
-
"default-outset-focus",
|
|
1275
|
-
"default-disabled",
|
|
1276
|
-
o ? "default-error-border" : "default-border",
|
|
1277
|
-
t
|
|
1278
|
-
),
|
|
1279
|
-
disabled: n,
|
|
1280
|
-
name: l,
|
|
1281
|
-
placeholder: h,
|
|
1282
|
-
readOnly: d,
|
|
1283
|
-
rows: p,
|
|
1284
|
-
value: g,
|
|
1285
|
-
onChange: I,
|
|
1286
|
-
...j
|
|
1287
|
-
}
|
|
1288
|
-
);
|
|
1289
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-col gap-1", children: [
|
|
1290
|
-
a ? /* @__PURE__ */ e.jsx(te, { htmlFor: N, required: m, children: a }) : null,
|
|
1291
|
-
W,
|
|
1292
|
-
f && typeof C == "number" ? /* @__PURE__ */ e.jsxs("div", { className: "pointer-events-none mt-1 text-right text-xs text-neutral-400", children: [
|
|
1293
|
-
k,
|
|
1294
|
-
"/",
|
|
1295
|
-
C
|
|
1296
|
-
] }) : null,
|
|
1297
|
-
s ? /* @__PURE__ */ e.jsx(se, { id: E, disabled: n, children: s }) : null,
|
|
1298
|
-
D ? /* @__PURE__ */ e.jsx(re, { id: F, children: r }) : null
|
|
1299
|
-
] });
|
|
1300
|
-
}, qe = {
|
|
1301
|
-
default: "default-border backdrop-blur-xl text-white bg-zinc-1000/70",
|
|
1302
|
-
error: "bg-red-900/70 text-red-200 border-red-700",
|
|
1303
|
-
warning: "bg-amber-900/70 text-amber-200 border-amber-700",
|
|
1304
|
-
info: "bg-blue-900/70 text-blue-200 border-blue-700",
|
|
1305
|
-
success: "bg-green-900/70 text-green-200 border-green-700"
|
|
1306
|
-
}, ht = ({
|
|
1307
|
-
align: t = "center",
|
|
1308
|
-
children: s,
|
|
1309
|
-
className: n,
|
|
1310
|
-
content: o,
|
|
1311
|
-
disabled: r = !1,
|
|
1312
|
-
id: i,
|
|
1313
|
-
onOpenChange: a,
|
|
1314
|
-
open: l,
|
|
1315
|
-
position: u = "top",
|
|
1316
|
-
trigger: h = "hover",
|
|
1317
|
-
variant: d = "default"
|
|
1318
|
-
}) => {
|
|
1319
|
-
const m = /* @__PURE__ */ e.jsx(
|
|
1320
|
-
"div",
|
|
1321
|
-
{
|
|
1322
|
-
className: b(
|
|
1323
|
-
"max-w-xs rounded-md border px-2 py-1 text-xs break-words backdrop-blur-sm",
|
|
1324
|
-
qe[d],
|
|
1325
|
-
n
|
|
1326
|
-
),
|
|
1327
|
-
children: o
|
|
1328
|
-
}
|
|
1329
|
-
);
|
|
1330
|
-
return /* @__PURE__ */ e.jsx(
|
|
1331
|
-
ne,
|
|
1332
|
-
{
|
|
1333
|
-
id: i,
|
|
1334
|
-
align: t,
|
|
1335
|
-
content: m,
|
|
1336
|
-
contentRole: "tooltip",
|
|
1337
|
-
disabled: r,
|
|
1338
|
-
offset: 8,
|
|
1339
|
-
open: l,
|
|
1340
|
-
position: u,
|
|
1341
|
-
trigger: h,
|
|
1342
|
-
useAriaControls: !1,
|
|
1343
|
-
onOpenChange: a,
|
|
1344
|
-
children: s
|
|
1345
|
-
}
|
|
1346
|
-
);
|
|
1347
|
-
}, pt = ({
|
|
1348
|
-
children: t,
|
|
1349
|
-
onAuthenticated: s = null,
|
|
1350
|
-
onLoading: n = null
|
|
1351
|
-
}) => {
|
|
1352
|
-
const { isLoggedIn: o, loading: r } = de();
|
|
1353
|
-
return r ? n : o ? s : t;
|
|
1354
|
-
}, gt = ({
|
|
1355
|
-
children: t,
|
|
1356
|
-
onLoading: s = null,
|
|
1357
|
-
onUnauthenticated: n = null
|
|
1358
|
-
}) => {
|
|
1359
|
-
const { isLoggedIn: o, loading: r } = de();
|
|
1360
|
-
return r ? s : o ? t : n;
|
|
1361
|
-
};
|
|
1
|
+
import { O as x, a as O, b as e, c as o, d as t, e as r, f as i, g as n, I as p, L as l, V as d, h as T, o as c, i as u, j as g, W as S, J as D, k as b, K as m, X as I, l as k, m as F, Y as L, Z as P, n as v, p as w, M as A, N as B, q as C, r as f, s as h, R as N, S as y, t as E, u as H, v as J, w as R, x as U, y as j, z as q, T as z, A as G, B as K, P as M, U as Q, Q as V, C as W, F as X, D as Y, G as Z, H as _, E as $ } from "./chunks/ui-DxsSYHCv.js";
|
|
1362
2
|
export {
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
3
|
+
x as OxAccordion,
|
|
4
|
+
O as OxAlert,
|
|
5
|
+
e as OxAvatar,
|
|
6
|
+
o as OxBadge,
|
|
7
|
+
t as OxBreadcrumb,
|
|
8
|
+
r as OxButton,
|
|
9
|
+
i as OxCalendar,
|
|
10
|
+
n as OxCard,
|
|
11
|
+
p as OxCheckbox,
|
|
12
|
+
l as OxDateInput,
|
|
13
|
+
d as OxDescription,
|
|
14
|
+
T as OxDescriptionList,
|
|
15
|
+
c as OxDialog,
|
|
16
|
+
u as OxDrawer,
|
|
17
|
+
g as OxDropdown,
|
|
18
|
+
S as OxError,
|
|
19
|
+
D as OxFileUpload,
|
|
20
|
+
b as OxFloating,
|
|
21
|
+
m as OxForm,
|
|
22
|
+
I as OxHeading,
|
|
23
|
+
k as OxIcon,
|
|
24
|
+
F as OxJsonField,
|
|
25
|
+
L as OxLabel,
|
|
26
|
+
P as OxLegend,
|
|
27
|
+
v as OxLink,
|
|
28
|
+
w as OxNotifications,
|
|
29
|
+
A as OxNumberInput,
|
|
30
|
+
B as OxOtpInput,
|
|
31
|
+
C as OxPagination,
|
|
32
|
+
f as OxPopover,
|
|
33
|
+
h as OxProgress,
|
|
34
|
+
N as OxRadio,
|
|
35
|
+
y as OxSelect,
|
|
36
|
+
E as OxSeparator,
|
|
37
|
+
H as OxSkeleton,
|
|
38
|
+
J as OxSkeletonText,
|
|
39
|
+
R as OxSlider,
|
|
40
|
+
U as OxSpinner,
|
|
41
|
+
j as OxStatusDisplay,
|
|
42
|
+
q as OxStepper,
|
|
43
|
+
z as OxSwitch,
|
|
44
|
+
G as OxTable,
|
|
45
|
+
K as OxTabs,
|
|
46
|
+
M as OxTextInput,
|
|
47
|
+
Q as OxTextarea,
|
|
48
|
+
V as OxTimeInput,
|
|
49
|
+
W as OxTimeline,
|
|
50
|
+
X as OxToast,
|
|
51
|
+
Y as OxToastProvider,
|
|
52
|
+
Z as OxToggle,
|
|
53
|
+
_ as OxTooltip,
|
|
54
|
+
$ as useOxToast
|
|
1397
55
|
};
|