@noxickon/onyx 0.0.1 → 0.0.3

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.
Files changed (41) hide show
  1. package/dist/chunks/Button-BV4_pmoH.js +11054 -0
  2. package/dist/chunks/Button-CU-zvMVL.js +20 -0
  3. package/dist/chunks/Input-BraK4lDE.js +138 -0
  4. package/dist/chunks/Input-C5dK8VSu.js +1 -0
  5. package/dist/chunks/_commonjsHelpers-C6fGbg64.js +6 -0
  6. package/dist/chunks/_commonjsHelpers-DwGv2jUC.js +1 -0
  7. package/dist/chunks/constants-B1_n9ezb.js +1 -0
  8. package/dist/chunks/constants-CDXq37n6.js +4 -0
  9. package/dist/chunks/index-DGjVEo0G.js +22 -0
  10. package/dist/chunks/index-Dgwp7JKP.js +601 -0
  11. package/dist/chunks/index-DnVdNmco.js +2129 -0
  12. package/dist/chunks/index-rUH_mzKt.js +2 -0
  13. package/dist/chunks/isObject-BDHKUJKN.js +1 -0
  14. package/dist/chunks/isObject-vmP43YLW.js +6 -0
  15. package/dist/chunks/jsx-runtime--oOP9f8K.js +284 -0
  16. package/dist/chunks/jsx-runtime-CITbqOLs.js +22 -0
  17. package/dist/chunks/useAuth-BwjRd05B.js +10 -0
  18. package/dist/chunks/useAuth-CR3bAGqp.js +61 -0
  19. package/dist/chunks/useForm-BAbY8X4X.js +3085 -0
  20. package/dist/chunks/useForm-cxgyAiOs.js +26 -0
  21. package/dist/chunks/useQuery--6GP2-dN.js +2 -0
  22. package/dist/chunks/useQuery-mFRa2XuW.js +1481 -0
  23. package/dist/context/context.cjs.js +1 -0
  24. package/dist/context/context.es.js +6 -0
  25. package/dist/context.d.ts +44 -0
  26. package/dist/hooks/hooks.cjs.js +6 -0
  27. package/dist/hooks/hooks.es.js +1917 -0
  28. package/dist/hooks.d.ts +130 -0
  29. package/dist/index.css +1 -1
  30. package/dist/index.d.ts +144 -110
  31. package/dist/layout/layout.cjs.js +1 -0
  32. package/dist/layout/layout.es.js +264 -0
  33. package/dist/layout.d.ts +89 -0
  34. package/dist/onyx.cjs.js +1 -0
  35. package/dist/onyx.es.js +1219 -9485
  36. package/dist/pages/pages.cjs.js +7 -0
  37. package/dist/pages/pages.es.js +93 -0
  38. package/dist/pages.d.ts +14 -0
  39. package/dist/shared.css +104 -0
  40. package/package.json +40 -16
  41. package/dist/onyx.umd.js +0 -42
@@ -0,0 +1,264 @@
1
+ import { j as e } from "../chunks/jsx-runtime--oOP9f8K.js";
2
+ import { createContext as w, useMemo as N, useEffect as y, useContext as z } from "react";
3
+ import { t as d, O as h, b as m, a as u } from "../chunks/Button-BV4_pmoH.js";
4
+ import { M as C } from "../chunks/constants-CDXq37n6.js";
5
+ const L = ({
6
+ brand: r,
7
+ children: s,
8
+ className: a,
9
+ hasSidebar: t = !1,
10
+ navClassName: o,
11
+ toggleSidebar: n
12
+ }) => /* @__PURE__ */ e.jsx(
13
+ "header",
14
+ {
15
+ className: d(
16
+ "fixed top-0 z-50 h-15 w-full border-b border-neutral-800 bg-zinc-1000/50 backdrop-blur-xl",
17
+ a
18
+ ),
19
+ children: /* @__PURE__ */ e.jsxs(
20
+ "nav",
21
+ {
22
+ className: d(
23
+ "mx-auto flex max-w-10xl items-center justify-between px-4 py-2.5",
24
+ o
25
+ ),
26
+ children: [
27
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
28
+ t ? /* @__PURE__ */ e.jsx(
29
+ h,
30
+ {
31
+ "aria-label": "Open menu",
32
+ icon: "mdiMenu",
33
+ size: "md",
34
+ variant: "ghost",
35
+ onClick: n
36
+ }
37
+ ) : null,
38
+ r ? /* @__PURE__ */ e.jsx("div", { children: r }) : null
39
+ ] }),
40
+ s
41
+ ]
42
+ }
43
+ )
44
+ }
45
+ ), g = w({ collapsed: !1 }), f = "h-15", H = ({
46
+ brand: r,
47
+ children: s,
48
+ className: a,
49
+ collapsed: t = !1,
50
+ onClose: o
51
+ }) => {
52
+ const n = N(() => ({ collapsed: t }), [t]);
53
+ y(() => {
54
+ const l = () => {
55
+ window.innerWidth < C && !t ? document.body.classList.add("overflow-hidden") : document.body.classList.remove("overflow-hidden");
56
+ };
57
+ return l(), window.addEventListener("resize", l), () => {
58
+ document.body.classList.remove("overflow-hidden"), window.removeEventListener("resize", l);
59
+ };
60
+ }, [t]);
61
+ const i = r || o;
62
+ return /* @__PURE__ */ e.jsxs(g.Provider, { value: n, children: [
63
+ /* @__PURE__ */ e.jsxs(
64
+ "nav",
65
+ {
66
+ "aria-label": "Mobile navigation",
67
+ className: d(
68
+ "fixed inset-0 top-0 z-50 flex h-screen flex-col bg-zinc-1000/50 backdrop-blur-xl transition-transform duration-300 md:hidden",
69
+ t ? "-translate-x-full" : "translate-x-0",
70
+ a
71
+ ),
72
+ role: "navigation",
73
+ children: [
74
+ i ? /* @__PURE__ */ e.jsxs(
75
+ "div",
76
+ {
77
+ className: m(
78
+ f,
79
+ "flex h-15 items-center gap-3 border-b border-neutral-800 px-4"
80
+ ),
81
+ children: [
82
+ o ? /* @__PURE__ */ e.jsx(
83
+ h,
84
+ {
85
+ "aria-label": "Close sidebar",
86
+ icon: "mdiClose",
87
+ variant: "ghost",
88
+ onClick: o
89
+ }
90
+ ) : null,
91
+ r || null
92
+ ]
93
+ }
94
+ ) : null,
95
+ s
96
+ ]
97
+ }
98
+ ),
99
+ /* @__PURE__ */ e.jsxs(
100
+ "nav",
101
+ {
102
+ "aria-label": "Desktop navigation",
103
+ className: d(
104
+ "fixed z-40 hidden flex-col border-r border-neutral-800 bg-zinc-1000/50 text-white backdrop-blur-xl md:flex",
105
+ r ? "top-0 h-screen" : "viewport-minus-header",
106
+ t ? "w-16" : "w-64",
107
+ a
108
+ ),
109
+ role: "navigation",
110
+ children: [
111
+ r && !t ? /* @__PURE__ */ e.jsx(
112
+ "div",
113
+ {
114
+ "aria-label": t ? "Navigation collapsed" : "Navigation expanded",
115
+ className: m(f, "flex items-center border-b border-neutral-800 px-4"),
116
+ children: r
117
+ }
118
+ ) : null,
119
+ s
120
+ ]
121
+ }
122
+ )
123
+ ] });
124
+ }, p = () => z(g), I = ({
125
+ children: r,
126
+ className: s,
127
+ disabled: a = !1,
128
+ icon: t,
129
+ isActive: o = !1,
130
+ ...n
131
+ }) => {
132
+ const { collapsed: i } = p(), l = d(
133
+ "flex cursor-pointer items-center rounded-lg text-sm font-medium transition-colors",
134
+ i ? "size-10 justify-center" : "h-10 w-full gap-3 px-3",
135
+ o ? "bg-white/10 text-white" : a ? "cursor-not-allowed text-neutral-500" : "secondary-inset-focus text-neutral-300 hover:bg-white/6 hover:text-white",
136
+ s
137
+ );
138
+ if ("href" in n && n.href) {
139
+ const { href: c, ...v } = n;
140
+ return /* @__PURE__ */ e.jsxs(
141
+ "a",
142
+ {
143
+ "aria-current": o ? "page" : void 0,
144
+ className: l,
145
+ href: a ? void 0 : c,
146
+ onClick: a ? (j) => j.preventDefault() : void 0,
147
+ ...v,
148
+ children: [
149
+ /* @__PURE__ */ e.jsx("span", { className: "flex items-center", children: /* @__PURE__ */ e.jsx(u, { icon: t, size: 0.8 }) }),
150
+ !i && r ? r : null
151
+ ]
152
+ }
153
+ );
154
+ }
155
+ const { onClick: x, ...b } = n;
156
+ return /* @__PURE__ */ e.jsxs(
157
+ "button",
158
+ {
159
+ className: l,
160
+ disabled: a,
161
+ type: "button",
162
+ onClick: a ? void 0 : x,
163
+ ...b,
164
+ children: [
165
+ /* @__PURE__ */ e.jsx("span", { className: "flex items-center", children: /* @__PURE__ */ e.jsx(u, { icon: t, size: 0.8 }) }),
166
+ !i && r ? r : null
167
+ ]
168
+ }
169
+ );
170
+ }, P = ({
171
+ children: r,
172
+ className: s,
173
+ headline: a
174
+ }) => {
175
+ const { collapsed: t } = p();
176
+ return /* @__PURE__ */ e.jsxs("div", { className: d("flex flex-col gap-1", s), children: [
177
+ t ? null : /* @__PURE__ */ e.jsx("h3", { className: "mb-2 cursor-default px-3 text-xs font-medium text-neutral-400", children: a }),
178
+ r
179
+ ] });
180
+ }, B = ({ children: r, className: s }) => /* @__PURE__ */ e.jsx("div", { className: d("flex-1 space-y-1 overflow-y-auto p-4", s), children: r }), D = ({ children: r, className: s }) => /* @__PURE__ */ e.jsx("div", { className: d("border-t border-neutral-800 p-4", s), children: r }), O = {
181
+ purple: {
182
+ border: "border-purple-500/20",
183
+ bg: "bg-purple-500/10",
184
+ text: "text-purple-400"
185
+ },
186
+ blue: {
187
+ border: "border-blue-500/20",
188
+ bg: "bg-blue-500/10",
189
+ text: "text-blue-400"
190
+ },
191
+ emerald: {
192
+ border: "border-emerald-500/20",
193
+ bg: "bg-emerald-500/10",
194
+ text: "text-emerald-400"
195
+ },
196
+ orange: {
197
+ border: "border-orange-500/20",
198
+ bg: "bg-orange-500/10",
199
+ text: "text-orange-400"
200
+ },
201
+ rose: {
202
+ border: "border-rose-500/20",
203
+ bg: "bg-rose-500/10",
204
+ text: "text-rose-400"
205
+ },
206
+ amber: {
207
+ border: "border-amber-500/20",
208
+ bg: "bg-amber-500/10",
209
+ text: "text-amber-400"
210
+ },
211
+ cyan: {
212
+ border: "border-cyan-500/20",
213
+ bg: "bg-cyan-500/10",
214
+ text: "text-cyan-400"
215
+ },
216
+ indigo: {
217
+ border: "border-indigo-500/20",
218
+ bg: "bg-indigo-500/10",
219
+ text: "text-indigo-400"
220
+ }
221
+ }, R = ({
222
+ children: r,
223
+ className: s,
224
+ collapsed: a = !1,
225
+ color: t = "purple",
226
+ hasHeader: o = !1,
227
+ hasSidebar: n = !1,
228
+ icon: i,
229
+ subtitle: l,
230
+ title: x
231
+ }) => {
232
+ const b = x || l || i, c = O[t];
233
+ return /* @__PURE__ */ e.jsxs(
234
+ "main",
235
+ {
236
+ "aria-labelledby": b ? "main-headline" : void 0,
237
+ className: d(
238
+ "m-auto max-w-10xl overflow-y-auto p-6",
239
+ o && "mt-15 h-[calc(100vh-60px)]",
240
+ n && (a ? "md:ml-16" : "md:ml-64"),
241
+ s
242
+ ),
243
+ children: [
244
+ b && /* @__PURE__ */ e.jsx("div", { className: "mb-8 border-b border-neutral-800 pb-6", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-4", children: [
245
+ i && /* @__PURE__ */ e.jsx("div", { className: m("rounded-lg border p-3", c.border, c.bg), children: /* @__PURE__ */ e.jsx(u, { className: m(c.text), icon: i, size: 1.41 }) }),
246
+ /* @__PURE__ */ e.jsxs("div", { children: [
247
+ x && /* @__PURE__ */ e.jsx("h1", { id: "main-headline", className: "text-3xl font-bold text-white", children: x }),
248
+ l && /* @__PURE__ */ e.jsx("p", { className: "mt-1 text-sm text-neutral-400", children: l })
249
+ ] })
250
+ ] }) }),
251
+ r
252
+ ]
253
+ }
254
+ );
255
+ };
256
+ export {
257
+ L as OxHeader,
258
+ R as OxMainContent,
259
+ H as OxSidebar,
260
+ B as OxSidebarBody,
261
+ D as OxSidebarFooter,
262
+ P as OxSidebarGroup,
263
+ I as OxSidebarItem
264
+ };
@@ -0,0 +1,89 @@
1
+ import { default as default_2 } from 'react';
2
+
3
+ export declare interface BaseSidebarItemProps {
4
+ 'aria-label'?: string;
5
+ children: React.ReactNode;
6
+ className?: string;
7
+ disabled?: boolean;
8
+ icon: string;
9
+ isActive?: boolean;
10
+ }
11
+
12
+ export declare const OxHeader: default_2.FC<OxHeaderProps>;
13
+
14
+ export declare interface OxHeaderProps {
15
+ brand?: React.ReactNode;
16
+ children: React.ReactNode;
17
+ className?: string;
18
+ hasSidebar?: boolean;
19
+ navClassName?: string;
20
+ toggleSidebar?: () => void;
21
+ }
22
+
23
+ export declare const OxMainContent: React.FC<OxMainContentProps>;
24
+
25
+ declare type OxMainContentColor = 'purple' | 'blue' | 'emerald' | 'orange' | 'rose' | 'amber' | 'cyan' | 'indigo';
26
+
27
+ export declare interface OxMainContentProps {
28
+ children: React.ReactNode;
29
+ className?: string;
30
+ collapsed?: boolean;
31
+ color?: OxMainContentColor;
32
+ hasHeader?: boolean;
33
+ hasSidebar?: boolean;
34
+ icon?: string;
35
+ subtitle?: string;
36
+ title?: string;
37
+ }
38
+
39
+ export declare const OxSidebar: React.FC<OxSidebarProps>;
40
+
41
+ export declare const OxSidebarBody: React.FC<OxSidebarBodyProps>;
42
+
43
+ export declare interface OxSidebarBodyProps {
44
+ children: React.ReactNode;
45
+ className?: string;
46
+ }
47
+
48
+ export declare const OxSidebarFooter: default_2.FC<OxSidebarFooterProps>;
49
+
50
+ export declare interface OxSidebarFooterProps {
51
+ children: React.ReactNode;
52
+ className?: string;
53
+ }
54
+
55
+ export declare const OxSidebarGroup: default_2.FC<OxSidebarGroupProps>;
56
+
57
+ export declare interface OxSidebarGroupProps {
58
+ children: React.ReactNode;
59
+ className?: string;
60
+ headline: string;
61
+ }
62
+
63
+ export declare const OxSidebarItem: default_2.FC<OxSidebarItemProps>;
64
+
65
+ declare type OxSidebarItemProps = SidebarItemLinkProps | SidebarItemActionProps;
66
+
67
+ export declare interface OxSidebarProps {
68
+ brand?: React.ReactNode;
69
+ children: React.ReactNode;
70
+ className?: string;
71
+ collapsed?: boolean;
72
+ onClose?: () => void;
73
+ }
74
+
75
+ export declare interface SidebarItemActionProps extends BaseSidebarItemProps {
76
+ 'aria-controls'?: string;
77
+ 'aria-expanded'?: boolean;
78
+ 'aria-haspopup'?: boolean | 'menu' | 'dialog';
79
+ href?: never;
80
+ onClick: () => void;
81
+ }
82
+
83
+ export declare interface SidebarItemLinkProps extends BaseSidebarItemProps {
84
+ 'aria-describedby'?: string;
85
+ href: string;
86
+ onClick?: never;
87
+ }
88
+
89
+ export { }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("./chunks/jsx-runtime-CITbqOLs.js"),b=require("react"),o=require("./chunks/Button-CU-zvMVL.js"),M=require("./chunks/Input-C5dK8VSu.js"),Z=require("react-dom"),de=require("./chunks/constants-B1_n9ezb.js"),ee=require("./chunks/useAuth-BwjRd05B.js"),ue=({children:t,className:s})=>e.jsxRuntimeExports.jsx("div",{className:o.twMerge("flex items-center gap-3",s),children:t}),G={rounded:"rounded-full",square:"rounded-lg"},K={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10",xl:"h-12 w-12","2xl":"h-16 w-16"},me={sm:"h-2 w-2",md:"h-2.5 w-2.5",lg:"h-3 w-3",xl:"h-3.5 w-3.5","2xl":"h-4 w-4"},pe={online:"bg-green-500",offline:"bg-neutral-500",away:"bg-yellow-500",busy:"bg-red-500"},fe={sm:"text-xs",md:"text-sm",lg:"text-base",xl:"text-base","2xl":"text-lg"},te=({alt:t,className:s,fallback:n,showStatus:i=!1,size:r="md",skeleton:x=!1,src:l,status:a,type:u="square"})=>{const[w,m]=b.useState(!1),[p,h]=b.useState(!1),[f,j]=b.useState(!0);b.useEffect(()=>{if(!l){m(!1),h(!0),j(!1);return}j(!0);const R=new Image;R.src=l;const N=()=>{m(!0),h(!1),j(!1)},c=()=>{m(!1),h(!0),j(!1)};return R.addEventListener("load",N),R.addEventListener("error",c),()=>{R.removeEventListener("load",N),R.removeEventListener("error",c)}},[l]);const v=()=>f&&x?e.jsxRuntimeExports.jsx("div",{className:o.twJoin("animate-pulse bg-zinc-800",G[u],K[r])}):w&&!p?e.jsxRuntimeExports.jsx("img",{alt:t,className:o.twMerge(G[u],K[r],"object-cover",s),loading:"lazy",src:l}):e.jsxRuntimeExports.jsx("div",{"aria-label":t,className:o.twMerge("flex items-center justify-center bg-zinc-800 font-medium text-white",G[u],K[r],fe[r],s),role:"img",children:typeof n=="string"&&n.length>2?n.substring(0,2):n});return e.jsxRuntimeExports.jsxs("div",{className:"relative shrink-0",children:[v(),i&&a&&e.jsxRuntimeExports.jsx("span",{"aria-label":`Status: ${a}`,className:o.twJoin("absolute right-0 bottom-0 rounded-full border-2 border-zinc-900",me[r],pe[a]),role:"status"})]})},be=({className:t,size:s="md",subtext:n,username:i})=>{const r={sm:"text-xs",md:"text-sm",lg:"text-base",xl:"text-lg","2xl":"text-xl"},x={sm:"text-xs",md:"text-xs",lg:"text-sm",xl:"text-sm","2xl":"text-base"};return e.jsxRuntimeExports.jsxs("div",{className:o.twMerge("flex flex-col justify-center overflow-hidden",t),children:[e.jsxRuntimeExports.jsx("span",{className:o.twJoin("block truncate font-medium text-white",r[s]),children:i}),n&&e.jsxRuntimeExports.jsx("span",{className:o.twJoin("block truncate text-neutral-400",x[s]),children:n})]})},he={sm:"px-1 py-0.5 text-xs",md:"px-1.5 py-0.5 text-sm",lg:"px-2 py-1 text-base"},je={purple:"bg-purple-500/25 text-purple-400",lime:"bg-lime-400/10 text-lime-300",red:"bg-red-500/25 text-red-400",yellow:"bg-yellow-500/25 text-yellow-400",green:"bg-green-500/25 text-green-400",blue:"bg-blue-500/25 text-blue-400",indigo:"bg-indigo-500/25 text-indigo-400",pink:"bg-pink-500/25 text-pink-400",amber:"bg-amber-500/25 text-amber-400",emerald:"bg-emerald-500/25 text-emerald-400",teal:"bg-teal-500/25 text-teal-400",cyan:"bg-cyan-500/25 text-cyan-400",sky:"bg-sky-500/25 text-sky-400",violet:"bg-violet-500/25 text-violet-400",fuchsia:"bg-fuchsia-500/25 text-fuchsia-400",gray:"bg-gray-500/25 text-gray-400"};function ge(t){const s=t.startsWith("#")?t.substring(1):t;if(!/^[0-9A-Fa-f]{3,6}$/.test(s))return"#FFFFFF";const i=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),x=parseInt(s.length===3?s[2]+s[2]:s.substr(4,2),16);return(.299*i+.587*r+.114*x)/255>.5?"#000000":"#FFFFFF"}const J=({bgColor:t,children:s,className:n,color:i="purple",size:r="md",textColor:x})=>{const l=!t&&!x?je[i]:"",a={};return t&&(a.backgroundColor=t,x||(a.color=ge(t))),x&&(a.color=x),e.jsxRuntimeExports.jsx("span",{className:o.twMerge("inline-flex items-center rounded-md font-medium",he[r],l,n),style:Object.keys(a).length?a:void 0,children:s})},we={default:"bg-zinc-900/90 border border-zinc-800",outline:"bg-transparent border border-zinc-700",gradient:"bg-gradient-to-br from-zinc-900 via-purple-900/20 to-zinc-900 border border-purple-800/30"},Ee={none:"p-0",sm:"p-3",md:"p-4",lg:"p-6"},ve={none:"",lift:"hover:scale-[1.01] hover:-translate-y-1",glow:"hover:shadow-lg hover:shadow-purple-500/10",border:"hover:border-purple-500/50"},Re={purple:"hover:border-purple-500/50",blue:"hover:border-blue-500/50",emerald:"hover:border-emerald-500/50",orange:"hover:border-orange-500/50",rose:"hover:border-rose-500/50",amber:"hover:border-amber-500/50",cyan:"hover:border-cyan-500/50",indigo:"hover:border-indigo-500/50"},ye={purple:"from-purple-500/5 to-pink-500/5",blue:"from-blue-500/5 to-cyan-500/5",emerald:"from-emerald-500/5 to-teal-500/5",orange:"from-orange-500/5 to-red-500/5",rose:"from-rose-500/5 to-pink-500/5",amber:"from-amber-500/5 to-orange-500/5",cyan:"from-cyan-500/5 to-blue-500/5",indigo:"from-indigo-500/5 to-purple-500/5"},Ne=({backdropBlur:t=!1,children:s,className:n,color:i="purple",equalHeight:r=!1,hoverVariant:x="lift",hoverable:l=!1,padding:a="md",variant:u="default",...w})=>{const m=l?x:"none",p=l&&m!=="none";return e.jsxRuntimeExports.jsxs("div",{className:o.twMerge("relative overflow-hidden rounded-lg transition-all duration-300",we[u],Ee[a],r&&"flex flex-col",t&&"backdrop-blur-sm",p&&ve[m],p&&"group hover:bg-white/5",p&&Re[i],n),...w,children:[p&&e.jsxRuntimeExports.jsx("div",{className:o.twMerge("absolute inset-0 bg-gradient-to-br opacity-0 transition-opacity duration-300 group-hover:opacity-100",ye[i])}),e.jsxRuntimeExports.jsx("div",{className:"relative z-10",children:s})]})},Oe={purple:{border:"border-purple-500/20",bg:"bg-purple-500/10",text:"text-purple-400"},blue:{border:"border-blue-500/20",bg:"bg-blue-500/10",text:"text-blue-400"},emerald:{border:"border-emerald-500/20",bg:"bg-emerald-500/10",text:"text-emerald-400"},orange:{border:"border-orange-500/20",bg:"bg-orange-500/10",text:"text-orange-400"},rose:{border:"border-rose-500/20",bg:"bg-rose-500/10",text:"text-rose-400"},amber:{border:"border-amber-500/20",bg:"bg-amber-500/10",text:"text-amber-400"},cyan:{border:"border-cyan-500/20",bg:"bg-cyan-500/10",text:"text-cyan-400"},indigo:{border:"border-indigo-500/20",bg:"bg-indigo-500/10",text:"text-indigo-400"}},ke=({action:t,children:s,className:n,color:i="purple",icon:r,iconColor:x,subtitle:l,title:a,...u})=>{if(s)return e.jsxRuntimeExports.jsx("div",{className:o.twMerge("mb-4",n),...u,children:s});const m=Oe[x||i];return e.jsxRuntimeExports.jsxs("div",{className:o.twMerge("mb-4 flex items-start justify-between gap-3",n),...u,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-3",children:[r&&e.jsxRuntimeExports.jsx("div",{className:o.twMerge("rounded-lg border p-2",m.border,m.bg),children:e.jsxRuntimeExports.jsx(o.OxIcon,{className:m.text,icon:r})}),e.jsxRuntimeExports.jsxs("div",{children:[a&&e.jsxRuntimeExports.jsx("h3",{className:"text-base font-semibold text-white",children:a}),l&&e.jsxRuntimeExports.jsx("p",{className:"text-sm text-neutral-400",children:l})]})]}),t&&e.jsxRuntimeExports.jsx("div",{children:t})]})},Ce=({children:t,className:s,flexGrow:n=!0,...i})=>e.jsxRuntimeExports.jsx("div",{className:o.twMerge("py-2",n&&"flex-grow",s),...i,children:t}),Ie=({children:t,className:s,...n})=>e.jsxRuntimeExports.jsx("div",{className:o.twMerge("mt-4 flex items-center justify-end border-t border-neutral-800 pt-4",s),...n,children:t}),Se={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},Me={sm:.5,md:.7,lg:.9},ze=({checked:t,className:s,defaultChecked:n,description:i,disabled:r=!1,error:x=!1,errorMessage:l,id:a,label:u,name:w,onChange:m,required:p=!1,size:h="md",value:f,...j})=>{const v=b.useId(),R=a||v,N=`${R}-checkbox`,c=`${R}-description`,E=`${R}-error`,y=x&&l,S=e.jsxRuntimeExports.jsxs("div",{className:"relative inline-flex shrink-0",children:[e.jsxRuntimeExports.jsx("input",{id:N,"aria-describedby":[i?c:"",y?E:""].filter(Boolean).join(" ")||void 0,"aria-invalid":x,"aria-required":p,checked:t,className:o.twMerge("peer cursor-pointer appearance-none rounded-sm","checked:bg-violet-700","default-outset-focus","disabled:cursor-not-allowed disabled:opacity-50",x?"default-error-border":"default-border",Se[h],s),defaultChecked:n,disabled:r,name:w,type:"checkbox",value:f,onChange:m,...j}),e.jsxRuntimeExports.jsx(o.OxIcon,{className:"pointer-events-none absolute inset-0 m-auto opacity-0 peer-checked:opacity-80",icon:"mdiCheck",size:Me[h]||.7})]});return e.jsxRuntimeExports.jsxs("div",{className:"flex w-full flex-col gap-1",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-start gap-2",children:[S,u&&e.jsxRuntimeExports.jsxs("div",{className:"flex w-full flex-col gap-1",children:[e.jsxRuntimeExports.jsx(M.OxLabel,{htmlFor:N,required:p,children:u}),i?e.jsxRuntimeExports.jsx(M.OxDescription,{id:c,disabled:r,children:i}):null]})]}),y?e.jsxRuntimeExports.jsx(M.OxErrorMessage,{id:E,children:l}):null]})},se=({align:t="center",ariaHaspopup:s,children:n,className:i,content:r,contentClassName:x,contentRole:l,contentStyle:a,disabled:u=!1,id:w,offset:m=8,onOpenChange:p,open:h,portal:f=!0,position:j="top",trigger:v="hover",useAriaControls:R=!1})=>{const N=b.useId(),[c,E]=b.useState(!1),y=b.useRef(null),S=b.useRef(null),L=h!==void 0,O=u?!1:L?h:c,D=w||N,z=b.useCallback(d=>{u||(p==null||p(d),L||E(d))},[u,L,p]),F=b.useCallback(()=>{if(!y.current||!S.current||!O)return;const d=y.current.getBoundingClientRect(),g=S.current.getBoundingClientRect(),k={width:window.innerWidth,height:window.innerHeight};let C=j;j==="top"&&d.top<g.height+m?C="bottom":j==="bottom"&&d.bottom+g.height+m>k.height?C="top":j==="left"&&d.left<g.width+m?C="right":j==="right"&&d.right+g.width+m>k.width&&(C="left");const I=B(d,g,C,t,m);S.current&&(S.current.style.left=`${I.x}px`,S.current.style.top=`${I.y}px`)},[O,j,t,m]);b.useEffect(()=>{if(!O||v!=="click")return;const d=g=>{y.current&&!y.current.contains(g.target)&&S.current&&!S.current.contains(g.target)&&z(!1)};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[O,z,v]),b.useEffect(()=>{if(O){F();const d=()=>F(),g=()=>F();return window.addEventListener("resize",d),window.addEventListener("scroll",g,!0),()=>{window.removeEventListener("resize",d),window.removeEventListener("scroll",g,!0)}}},[O,j,t,m,F]);const B=(d,g,k,C,I)=>{let $=0,T=0;switch(k){case"top":$=d.left,T=d.top-g.height-I;break;case"bottom":$=d.left,T=d.bottom+I;break;case"left":$=d.left-g.width-I,T=d.top;break;case"right":$=d.right+I,T=d.top;break}if(k==="top"||k==="bottom")switch(C){case"start":break;case"center":$=d.left+(d.width-g.width)/2;break;case"end":$=d.right-g.width;break}else if(k==="left"||k==="right")switch(C){case"start":break;case"center":T=d.top+(d.height-g.height)/2;break;case"end":T=d.bottom-g.height;break}return{x:$,y:T}},P=()=>{v==="hover"&&z(!0)},V=()=>{v==="hover"&&z(!1)},W=()=>{v==="click"&&z(!O)},q=()=>{v==="focus"&&z(!0)},A=()=>{v==="focus"&&z(!1)},H=O?e.jsxRuntimeExports.jsx("div",{id:D,"aria-hidden":!O,className:o.twMerge("fixed z-50 transition-opacity duration-200",O?"opacity-100":"pointer-events-none opacity-0",x),ref:S,role:l,style:{left:-9999,top:-9999,...a},children:e.jsxRuntimeExports.jsx("div",{className:"relative",children:r})}):null;return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{"aria-controls":R&&O?D:void 0,"aria-describedby":!R&&O?D:void 0,"aria-expanded":R?O:void 0,"aria-haspopup":s,className:o.twMerge("w-full",i),ref:y,onBlur:A,onClick:W,onFocus:q,onMouseEnter:P,onMouseLeave:V,children:n}),f&&typeof document<"u"?Z.createPortal(H,document.body):H]})},Y=({children:t})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t}),re=({children:t})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t}),Q=({children:t,className:s})=>e.jsxRuntimeExports.jsx("div",{className:o.twMerge("sticky top-0 flex-shrink-0 border-b border-neutral-700 bg-zinc-1000/95 px-3 py-2 backdrop-blur-lg",s),children:t}),ne=b.createContext({open:!1,setOpen:()=>{},disabled:!1});function oe(){const t=b.useContext(ne);if(t===void 0)throw new Error("useDropdownContext must be used within a DropdownProvider");return t}const X=({animateIcon:t=!1,children:s,className:n,disabled:i=!1,icon:r,outline:x=!1,unstyled:l=!1,...a})=>{const{disabled:u,open:w}=oe(),m=i||u;return e.jsxRuntimeExports.jsxs("button",{"aria-expanded":w,"aria-haspopup":"menu",className:o.twMerge(!l&&["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","default-outset-focus",x?"default-border":"bg-transparent","default-disabled"],n),disabled:m,type:"button",...a,children:[l?s:e.jsxRuntimeExports.jsx("span",{className:"flex items-center gap-2",children:s}),r&&e.jsxRuntimeExports.jsx(o.OxIcon,{className:o.twJoin(!l&&"ml-2",m&&"text-neutral-500",t&&["transition-transform duration-200",w&&"rotate-180"]),icon:r,size:.8})]})},ie=({children:t,className:s,defaultOpen:n=!1,disabled:i=!1,onOpenChange:r,open:x})=>{const[l,a]=b.useState(n),u=x!==void 0,w=u?x:l,m=c=>{i||(u||a(c),r==null||r(c))},p={open:w,setOpen:m,disabled:i};let h=null,f=null;const j={children:null,className:""},v={children:null,className:""};let R={side:"bottom",align:"start",className:""};b.Children.forEach(t,c=>{if(b.isValidElement(c)){if(c.type===X)h=c;else if(c.type===Q){const E=c.props;j.className=E.className,j.children=E.children}else if(c.type===re){const E=c.props;v.className=E.className,v.children=E.children}else if(c.type===Y){const E=c.props;f=E.children,R={side:E.side||"bottom",align:E.align||"start",className:E.className||""}}}});const N=e.jsxRuntimeExports.jsxs("div",{className:o.twMerge("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",R.side==="bottom"&&"animate-dropdown-in-bottom",R.side==="top"&&"animate-dropdown-in-top",R.className),children:[j.children?e.jsxRuntimeExports.jsx("div",{className:o.twMerge("flex-shrink-0 border-b border-neutral-700 bg-zinc-1000/95 px-3 py-2 backdrop-blur-sm",j.className),children:j.children}):null,e.jsxRuntimeExports.jsx("ul",{className:o.twMerge("min-h-0 flex-1 overflow-y-auto"),children:f}),v.children?e.jsxRuntimeExports.jsx("div",{className:o.twMerge("flex-shrink-0 border-t border-neutral-700 bg-zinc-1000/95 px-3 py-2 backdrop-blur-sm",v.className),children:v.children}):null]});return e.jsxRuntimeExports.jsx(ne.Provider,{value:p,children:e.jsxRuntimeExports.jsx("div",{className:o.twMerge("inline-block",s),children:e.jsxRuntimeExports.jsx(se,{align:R.align,content:N,contentRole:"menu",disabled:i,open:w,portal:!0,position:R.side,trigger:"click",onOpenChange:m,children:h})})})},le=({children:t,className:s,disabled:n=!1,icon:i,onClick:r,unstyled:x=!1})=>{const{setOpen:l}=oe(),a=u=>{n||(r&&r(u),l(!1))};return e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsxs("button",{className:o.twMerge(!x&&["group flex w-full items-center rounded-sm px-2 py-1.5 text-left text-sm enabled:text-white","enabled:cursor-pointer enabled:hover:bg-white/6","default-inset-focus","default-disabled"],s),disabled:n,role:"menuitem",onClick:a,children:[i&&e.jsxRuntimeExports.jsx(o.OxIcon,{className:o.twJoin("mr-2",n&&"text-neutral-500"),icon:i,size:.75}),t]})})},Le=({className:t})=>e.jsxRuntimeExports.jsx("li",{className:"px-1 py-1",children:e.jsxRuntimeExports.jsx("hr",{className:o.twMerge("border-t-neutral-700",t)})}),De=({children:t,className:s})=>e.jsxRuntimeExports.jsx("span",{className:o.twMerge("ml-auto text-xs tracking-widest text-neutral-500",s),"data-part":"dropdown-shortcut",children:t}),Fe=t=>{const n=Math.floor((new Date().getTime()-t.getTime())/(1e3*60));if(n<1)return"just now";if(n<60)return`${n}m ago`;const i=Math.floor(n/60);if(i<24)return`${i}h ago`;const r=Math.floor(i/24);return r<7?`${r}d ago`:t.toLocaleDateString()},$e={error:{background:"bg-rose-500/20",iconClass:"text-rose-400",icon:"mdiAlertCircleOutline"},success:{background:"bg-green-500/20",iconClass:"text-green-400",icon:"mdiCheckCircleOutline"},warning:{background:"bg-amber-500/20",iconClass:"text-amber-400",icon:"mdiAlertOutline"},info:{background:"bg-blue-500/20",iconClass:"text-blue-400",icon:"mdiInformationOutline"},default:{background:"bg-neutral-500/20",iconClass:"text-neutral-400",icon:"mdiBellOutline"}},Te=({className:t,disabled:s=!1,emptyMessage:n="No notifications",maxHeight:i="max-h-96",notifications:r,onMarkAllRead:x,onNotificationClick:l,unreadCount:a=0})=>{const[u,w]=b.useState(!1),[m,p]=b.useState(!1),h=a>99?"99+":a.toString(),f=a>0,j=r.length>0;b.useEffect(()=>{const c=()=>{const E=window.innerWidth<de.MOBILE_BREAKPOINT;p(E),E&&u?document.body.classList.add("overflow-hidden"):document.body.classList.remove("overflow-hidden")};return c(),window.addEventListener("resize",c),()=>{document.body.classList.remove("overflow-hidden"),window.removeEventListener("resize",c)}},[u]);const v=c=>{l==null||l(c),m&&w(!1)},R=()=>{x==null||x(),m&&w(!1)},N=()=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:j?e.jsxRuntimeExports.jsx("div",{className:"divide-y divide-neutral-800/50",children:r.map((c,E)=>{const y=$e[c.type||"default"];return e.jsxRuntimeExports.jsxs(le,{className:o.twMerge("secondary-inset-focus flex w-full items-start gap-3 px-3 py-3 text-left hover:bg-white/6",!c.read&&"bg-white/3",E===r.length-1&&"pb-4"),unstyled:!0,onClick:()=>v(c),children:[e.jsxRuntimeExports.jsx("div",{className:o.twMerge("mt-0.5 flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg",y.background),children:c.img?e.jsxRuntimeExports.jsx(te,{alt:"User avatar",fallback:"NA",size:"md",src:c.img}):e.jsxRuntimeExports.jsx(o.OxIcon,{className:y.iconClass,icon:c.icon??y.icon,size:.75})}),e.jsxRuntimeExports.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxRuntimeExports.jsx("p",{className:"mb-1 text-sm leading-5 text-white",children:c.title}),c.message&&e.jsxRuntimeExports.jsx("p",{className:"mb-1 text-xs leading-4 text-neutral-400",children:c.message}),e.jsxRuntimeExports.jsx("p",{className:"text-xs text-neutral-500",children:Fe(c.timestamp)})]}),!c.read&&e.jsxRuntimeExports.jsx("div",{className:"mt-1.5 h-2 w-2 flex-shrink-0 rounded-full bg-rose-500"})]},c.id)})}):e.jsxRuntimeExports.jsxs("div",{"aria-label":"No notifications available",className:"px-3 py-8 text-center",role:"status",children:[e.jsxRuntimeExports.jsx(o.OxIcon,{className:"mx-auto mb-2 text-neutral-500",icon:"mdiBellOffOutline",size:2}),e.jsxRuntimeExports.jsx("p",{className:"text-sm text-neutral-400",children:n})]})});return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:m?e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("div",{className:"relative",children:[e.jsxRuntimeExports.jsx(o.OxButton,{"aria-expanded":u,"aria-label":`Notifications${f?` (${a} unread)`:""}`,disabled:s,icon:"mdiBellOutline",variant:"ghost",onClick:()=>w(!u)}),f?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{className:"absolute -top-2 -right-2",children:e.jsxRuntimeExports.jsx(J,{className:"min-w-[1.25rem] justify-center px-1",color:"violet",size:"sm",children:h})})}):null]}),Z.createPortal(e.jsxRuntimeExports.jsxs("div",{"aria-labelledby":"notifications-title-mobile","aria-modal":"true",className:o.twMerge("fixed inset-y-0 z-50 flex w-full flex-col bg-zinc-1000/50 backdrop-blur-xl transition-transform duration-300",u?"translate-x-0":"translate-x-full"),role:"dialog",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex h-15 items-center justify-between border-b border-neutral-800 px-4",children:[m?e.jsxRuntimeExports.jsx(o.OxButton,{"aria-label":"Close sidebar",icon:"mdiClose",variant:"ghost",onClick:()=>w(!1)}):null,e.jsxRuntimeExports.jsx("h3",{id:"notifications-title-mobile",className:"text-sm font-semibold text-white",children:"Notifications"}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center gap-2",children:f&&x&&e.jsxRuntimeExports.jsx("button",{className:"cursor-pointer text-xs text-neutral-400 transition-colors hover:text-white",onClick:R,children:"Mark all read"})})]}),e.jsxRuntimeExports.jsx("ul",{className:"flex-1 overflow-y-auto",children:e.jsxRuntimeExports.jsx(N,{})})]}),document.body)]}):e.jsxRuntimeExports.jsxs(ie,{className:t,disabled:s,children:[e.jsxRuntimeExports.jsx(X,{"aria-label":`Notifications${f?` (${a} unread)`:""}`,className:o.twJoin("relative flex h-10 w-10 items-center justify-center px-2 text-sm","secondary-outset-focus group rounded-lg border border-transparent bg-transparent text-white enabled:cursor-pointer enabled:hover:bg-white/6"),disabled:s,icon:"mdiBellOutline",unstyled:!0,children:f?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{className:"absolute -top-2 -right-2",children:e.jsxRuntimeExports.jsx(J,{className:"min-w-[1.25rem] justify-center px-1",color:"violet",size:"sm",children:h})})}):null}),e.jsxRuntimeExports.jsx(Q,{children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxRuntimeExports.jsx("h3",{id:"notifications-title",className:"text-sm font-semibold text-white",children:"Notifications"}),f&&x&&e.jsxRuntimeExports.jsx("button",{className:"secondary-outset-focus cursor-pointer rounded-lg p-1 text-xs text-neutral-400 transition-colors hover:text-white",onClick:x,children:"Mark all read"})]})}),e.jsxRuntimeExports.jsx(Y,{align:"end","aria-labelledby":"notifications-title",className:o.twMerge("flex w-85 flex-col overflow-hidden p-0",i),side:"bottom",children:e.jsxRuntimeExports.jsx(N,{})})]})})},ae=b.createContext(void 0),Be=()=>{const t=b.useContext(ae);if(!t)throw new Error("Select components must be used within an OxSelect");return t},xe=({children:t,className:s,disabled:n=!1,id:i,value:r})=>{const{closeDropdown:x,onSelect:l,selectedValue:a}=Be(),u=()=>{l({value:r,label:t})},w=p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),l({value:r,label:t})),p.key==="Escape"&&x()},m=a.includes(r);return e.jsxRuntimeExports.jsx("li",{role:"none",children:e.jsxRuntimeExports.jsxs("button",{id:i,"aria-selected":m,className:o.twMerge("group flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-left text-sm enabled:text-white","enabled:cursor-pointer enabled:hover:bg-white/6","default-inset-focus","default-disabled",m&&"bg-white/5",s),disabled:n,role:"option",tabIndex:n?-1:0,onClick:u,onKeyDown:w,children:[t,m&&!n&&e.jsxRuntimeExports.jsx(o.OxIcon,{className:"text-violet-700",icon:"mdiCheck",size:.8})]})})};let U=null,_=null;const Pe=()=>(U||(U=document.createElement("canvas"),_=U.getContext("2d"),_.font="0.875rem system-ui, sans-serif"),_),We=(t,s,n)=>{if(t.length===0)return[];if(!s.current)return t.slice(0,1);const i=s.current.offsetWidth||0,r=12,x=32,l=32;let a=i-r-x;t.length>1&&(a-=l);const u=Pe();if(!u)return t.slice(0,2);const w=n?4:8,m=n?12:0;let p=0,h=0;for(let f=0;f<t.length;f++){const j=t[f],v=String(j.label),N=u.measureText(v).width+(n?m:0),c=f>0?p+N+w:p+N;if(c<=a)p=c,h++;else break}return h=Math.max(1,h),t.slice(0,h)},He=t=>t==null?[]:Array.isArray(t)?t:[t],Je=({badgeColor:t="purple",children:s,className:n,defaultValue:i=null,description:r,disabled:x=!1,displayAsBadges:l=!1,error:a=!1,errorMessage:u,id:w,label:m,multiple:p=!1,name:h,onChange:f,placeholder:j="Select an option",required:v=!1})=>{var H;const R=b.useId(),N=b.useRef(null),[c,E]=b.useState(!1),[y,S]=b.useState([]),L=w||R,O=`${L}-select`,D=`${L}-description`,z=`${L}-error`,F=a&&u,B=(d,g)=>{let k=null;return b.Children.forEach(d,C=>{if(b.isValidElement(C)&&C.type===xe){const I=C.props;I.value===g&&(k={value:I.value,label:I.children})}}),k},P=d=>{var k;let g;if(p?y.some(I=>I.value===d.value)?g=y.filter(I=>I.value!==d.value):g=[...y,d]:(g=[d],E(!1)),S(g),f){const C=p?g.map(I=>I.value):((k=g[0])==null?void 0:k.value)??null;f(C)}};b.useEffect(()=>{if(i!==void 0){const d=He(i),g=[];d.forEach(k=>{const C=B(s,k);C&&g.push(C)}),S(p?g:g.slice(0,1))}},[i,s,p]);const V=e.jsxRuntimeExports.jsx("ul",{id:`${O}-listbox`,"aria-multiselectable":p,className:"max-h-72 space-y-0.5 overflow-hidden overflow-y-auto",role:"listbox",children:s}),W=We(y,N,l),q=y.length-W.length,A=q>0;return e.jsxRuntimeExports.jsx(ae.Provider,{value:{selectedValue:y.map(d=>d.value),multiple:p,onSelect:P,closeDropdown:()=>E(!1)},children:e.jsxRuntimeExports.jsxs("div",{className:o.twMerge("flex w-full flex-col gap-1",n),children:[m&&e.jsxRuntimeExports.jsx(M.OxLabel,{htmlFor:O,required:v,children:m}),e.jsxRuntimeExports.jsx(se,{align:"start",content:V,contentClassName:"default-border bg-zinc-1000/70 rounded-lg p-1 backdrop-blur-xl animate-dropdown-in-bottom",contentStyle:{minWidth:`${((H=N.current)==null?void 0:H.offsetWidth)||200}px`},disabled:x,open:c,position:"bottom",trigger:"click",onOpenChange:E,children:e.jsxRuntimeExports.jsxs("button",{id:O,"aria-controls":`${O}-listbox`,"aria-describedby":[r?D:"",F?z:""].filter(Boolean).join(" ")||void 0,"aria-disabled":x,"aria-expanded":c,"aria-haspopup":"listbox","aria-invalid":a,"aria-required":v,className:o.twJoin("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","default-outset-focus default-disabled",a?"default-error-border":"default-border",c&&"default-active-border"),disabled:x,ref:N,role:"combobox",type:"button",children:[e.jsxRuntimeExports.jsx("span",{className:o.twJoin("w-full overflow-hidden text-ellipsis",l?p&&"flex flex-wrap gap-1":"whitespace-nowrap",x&&l&&"opacity-50"),children:y.length>0?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[l&&p?W.map(d=>e.jsxRuntimeExports.jsx(J,{color:t,size:"sm",children:d.label},String(d.value))):W.map((d,g,k)=>e.jsxRuntimeExports.jsxs(b.Fragment,{children:[d.label,g<k.length-1&&", "]},String(d.value))),A&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[!(l&&p)&&" ",e.jsxRuntimeExports.jsxs(J,{color:t,size:"sm",children:["+",q]})]})]}):j}),e.jsxRuntimeExports.jsx("div",{className:"absolute end-3 top-1/2 -translate-y-1/2",children:e.jsxRuntimeExports.jsx(o.OxIcon,{className:o.twJoin("transition-transform duration-300 ease-in-out",x&&"text-neutral-500",c&&"rotate-180"),icon:"mdiChevronDown",size:.8})})]})}),h&&e.jsxRuntimeExports.jsx("input",{name:h,type:"hidden",value:y.map(d=>d.value).join(",")}),r&&e.jsxRuntimeExports.jsx(M.OxDescription,{id:D,disabled:x,children:r}),F&&e.jsxRuntimeExports.jsx(M.OxErrorMessage,{id:z,children:u})]})})},qe=({children:t,className:s})=>e.jsxRuntimeExports.jsx("div",{className:o.twMerge("px-2 py-1 text-xs font-medium text-neutral-400",s),children:t}),Ve={default:"bg-zinc-800/80",purple:"bg-purple-950/50",blue:"bg-blue-950/50",gray:"bg-gray-800/50"},Ae={rectangle:"rounded-md",circle:"rounded-full"},ce=({animate:t=!0,className:s,color:n="default",fullWidth:i=!1,height:r,shape:x="rectangle",width:l,...a})=>{const u={height:typeof r=="number"?`${r}px`:r,width:typeof l=="number"?`${l}px`:l};return e.jsxRuntimeExports.jsx("div",{"aria-busy":"true","aria-label":"Loading...",className:o.twMerge("relative overflow-hidden",Ve[n],Ae[x],t&&"animate-pulse",i&&"w-full",s),role:"status",style:u,...a})},Ge=({animate:t=!0,className:s,color:n="default",fullWidth:i=!1,gap:r=8,height:x=20,lines:l=1,width:a,...u})=>{const w=h=>h<=1?`${h*100}%`:`${h}px`,m=h=>{if(!i){if(Array.isArray(a)){const f=a[h%a.length];return f==null?void 0:typeof f=="number"?w(f):f}if(typeof a=="number"){if(l>1&&h===l-1){const f=a<=1?a*.6:Math.max(100,a*.6);return w(f)}return w(a)}return"200px"}},p={4:"space-y-1",8:"space-y-2",12:"space-y-3",16:"space-y-4",20:"space-y-5"}[r]||"space-y-2";return e.jsxRuntimeExports.jsx("div",{className:o.twMerge("flex flex-col",p,s),...u,children:Array.from({length:l}).map((h,f)=>e.jsxRuntimeExports.jsx(ce,{animate:t,color:n,fullWidth:i,height:x,width:m(f)},f))})},Ke=({className:t,description:s,disabled:n=!1,error:i=!1,errorMessage:r,id:x,label:l,name:a,onChange:u,placeholder:w="Enter text...",readOnly:m=!1,required:p=!1,rows:h=3,showMaxLength:f=!1,value:j,...v})=>{const R=b.useId(),[N,c]=b.useState(typeof j=="string"?j.length:0),E=x||R,y=`${E}-textarea`,S=`${E}-description`,L=`${E}-error`,O=v.maxLength,D=i&&r;b.useEffect(()=>{typeof j=="string"&&c(j.length)},[j]);const z=B=>{const P=B.target.value.length;c(P),u==null||u(B)},F=e.jsxRuntimeExports.jsx("textarea",{id:y,"aria-describedby":[s?S:"",D?L:""].filter(Boolean).join(" ")||void 0,"aria-invalid":i,"aria-required":p,className:o.twMerge("flex min-h-10 w-full resize-y rounded-lg bg-transparent px-2 py-2 text-sm text-white","placeholder:text-neutral-500","default-outset-focus","default-disabled",i?"default-error-border":"default-border",t),disabled:n,name:a,placeholder:w,readOnly:m,rows:h,value:j,onChange:z,...v});return e.jsxRuntimeExports.jsxs("div",{className:"flex w-full flex-col gap-1",children:[l?e.jsxRuntimeExports.jsx(M.OxLabel,{htmlFor:y,required:p,children:l}):null,F,f&&typeof O=="number"?e.jsxRuntimeExports.jsxs("div",{className:"pointer-events-none mt-1 text-right text-xs text-neutral-400",children:[N,"/",O]}):null,s?e.jsxRuntimeExports.jsx(M.OxDescription,{id:S,disabled:n,children:s}):null,D?e.jsxRuntimeExports.jsx(M.OxErrorMessage,{id:L,children:r}):null]})},Ue=({children:t,onAuthenticated:s=null,onLoading:n=null})=>{const{isLoggedIn:i,loading:r}=ee.useOxAuth();return r?n:i?s:t},_e=({children:t,onLoading:s=null,onUnauthenticated:n=null})=>{const{isLoggedIn:i,loading:r}=ee.useOxAuth();return r?s:i?t:n};exports.OxButton=o.OxButton;exports.OxIcon=o.OxIcon;exports.OxDescription=M.OxDescription;exports.OxErrorMessage=M.OxErrorMessage;exports.OxForm=M.OxForm;exports.OxInput=M.OxInput;exports.OxLabel=M.OxLabel;exports.OxAvatar=ue;exports.OxAvatarImage=te;exports.OxAvatarText=be;exports.OxBadge=J;exports.OxCard=Ne;exports.OxCardContent=Ce;exports.OxCardFooter=Ie;exports.OxCardHeader=ke;exports.OxCheckbox=ze;exports.OxDropdown=ie;exports.OxDropdownContent=Y;exports.OxDropdownFooter=re;exports.OxDropdownHeader=Q;exports.OxDropdownItem=le;exports.OxDropdownSeparator=Le;exports.OxDropdownShortcut=De;exports.OxDropdownTrigger=X;exports.OxGuestRoute=Ue;exports.OxNotificationDropdown=Te;exports.OxProtectedRoute=_e;exports.OxSelect=Je;exports.OxSelectLabel=qe;exports.OxSelectOption=xe;exports.OxSkeleton=ce;exports.OxSkeletonText=Ge;exports.OxTextarea=Ke;