opsfuse-ui 0.1.27 → 0.1.29

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.
@@ -0,0 +1,830 @@
1
+ "use client";
2
+ import { Loader2Icon as e, XIcon as t } from "lucide-react";
3
+ import * as n from "react";
4
+ import r, { cloneElement as i, isValidElement as a, useEffect as o, useRef as s } from "react";
5
+ import { clsx as c } from "clsx";
6
+ import { twMerge as l } from "tailwind-merge";
7
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
8
+ import { cva as p } from "class-variance-authority";
9
+ import { AlertDialog as m, Dialog as h, Label as ee, Slot as te } from "radix-ui";
10
+ import { Toaster as ne, toast as g, useSonner as re } from "sonner";
11
+ //#region src/lib/utils.ts
12
+ function _(...e) {
13
+ return l(c(e));
14
+ }
15
+ //#endregion
16
+ //#region src/components/ui/spinner.tsx
17
+ function v({ className: t, ...n }) {
18
+ return /* @__PURE__ */ d(e, {
19
+ role: "status",
20
+ "aria-label": "Loading",
21
+ className: _("size-4 animate-spin", t),
22
+ ...n
23
+ });
24
+ }
25
+ //#endregion
26
+ //#region src/components/ui/button.tsx
27
+ var y = p("cursor-pointer group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
28
+ variants: {
29
+ motion: {
30
+ default: "transition-all",
31
+ micro: "transition-micro",
32
+ smooth: "transition-smooth",
33
+ data: "transition-data"
34
+ },
35
+ variant: {
36
+ default: "bg-primary text-primary-foreground hover:bg-primary/80",
37
+ outline: "border-border text-foreground/90 bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
38
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
39
+ ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
40
+ destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
41
+ link: "text-primary underline-offset-4 hover:underline"
42
+ },
43
+ size: {
44
+ default: "h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
45
+ xs: "h-6 gap-1 rounded-sm px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
46
+ sm: "h-8 gap-1 rounded-md px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
47
+ lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
48
+ icon: "size-9",
49
+ "icon-xs": "size-6 rounded-sm in-data-[slot=button-group]:rounded-sm [&_svg:not([class*='size-'])]:size-3",
50
+ "icon-sm": "size-8 rounded-md in-data-[slot=button-group]:rounded-md",
51
+ "icon-lg": "size-10"
52
+ }
53
+ },
54
+ defaultVariants: {
55
+ motion: "default",
56
+ variant: "default",
57
+ size: "default"
58
+ }
59
+ });
60
+ function b({ className: e, variant: t = "default", size: n = "default", motion: r = "default", asChild: i = !1, loading: a = !1, loadingText: o = "Loading...", ...s }) {
61
+ let c = i ? te.Root : "button";
62
+ return /* @__PURE__ */ d(c, {
63
+ "data-slot": "button",
64
+ "data-variant": t,
65
+ "data-size": n,
66
+ "data-motion": r,
67
+ className: _(y({
68
+ variant: t,
69
+ size: n,
70
+ motion: r
71
+ }), e),
72
+ ...s,
73
+ children: a ? /* @__PURE__ */ f("div", {
74
+ className: "flex items-center gap-2",
75
+ children: [/* @__PURE__ */ d(v, { className: "size-4 animate-spin" }), o]
76
+ }) : s.children
77
+ });
78
+ }
79
+ //#endregion
80
+ //#region src/lib/brand-theme.ts
81
+ var ie = [
82
+ "recruitsmartly",
83
+ "skillready",
84
+ "worklog",
85
+ "verity",
86
+ "lms"
87
+ ], ae = "recruitsmartly";
88
+ //#endregion
89
+ //#region src/lib/document-dark-mode.ts
90
+ function x() {
91
+ if (typeof document > "u") return !1;
92
+ let e = document.documentElement;
93
+ return e.classList.contains("dark") || e.getAttribute("data-theme") === "dark" || e.getAttribute("data-mode") === "dark" || e.getAttribute("data-color-mode") === "dark" || e.classList.contains("theme-dark") || (document.body?.classList.contains("dark") ?? !1);
94
+ }
95
+ function oe() {
96
+ let [e, t] = n.useState(() => typeof document > "u" ? !1 : x());
97
+ return n.useEffect(() => {
98
+ let e = () => t(x());
99
+ e();
100
+ let n = new MutationObserver(e);
101
+ return n.observe(document.documentElement, {
102
+ attributes: !0,
103
+ attributeFilter: [
104
+ "class",
105
+ "data-theme",
106
+ "data-mode",
107
+ "data-color-mode"
108
+ ]
109
+ }), document.body && n.observe(document.body, {
110
+ attributes: !0,
111
+ attributeFilter: ["class"]
112
+ }), () => n.disconnect();
113
+ }, []), e;
114
+ }
115
+ //#endregion
116
+ //#region src/lib/theme-scope.ts
117
+ var se = "opsfuse-ui", ce = {
118
+ "--color-background": "var(--background)",
119
+ "--color-foreground": "var(--foreground)",
120
+ "--color-card": "var(--card)",
121
+ "--color-card-foreground": "var(--card-foreground)",
122
+ "--color-popover": "var(--popover)",
123
+ "--color-popover-foreground": "var(--popover-foreground)",
124
+ "--color-muted": "var(--muted)",
125
+ "--color-muted-foreground": "var(--muted-foreground)",
126
+ "--color-accent": "var(--accent)",
127
+ "--color-accent-foreground": "var(--accent-foreground)",
128
+ "--color-secondary": "var(--secondary)",
129
+ "--color-secondary-foreground": "var(--secondary-foreground)",
130
+ "--color-subtle-foreground": "var(--subtle-foreground)",
131
+ "--color-disabled-foreground": "var(--disabled-foreground)",
132
+ "--color-text-disabled": "var(--disabled-foreground)",
133
+ "--color-text-input-placeholder": "var(--muted-foreground)",
134
+ "--color-primary": "var(--primary)",
135
+ "--color-primary-foreground": "var(--primary-foreground)",
136
+ "--color-primary-hover": "var(--primary-hover)",
137
+ "--color-primary-active": "var(--primary-active)",
138
+ "--color-primary-muted": "var(--primary-muted)",
139
+ "--color-primary-muted-hover": "var(--primary-muted-hover)",
140
+ "--color-primary-border": "var(--primary-border)",
141
+ "--color-primary-muted-foreground": "var(--primary-muted-foreground)",
142
+ "--color-ai": "var(--ai)",
143
+ "--color-ai-foreground": "var(--ai-foreground)",
144
+ "--color-ai-muted": "var(--ai-muted)",
145
+ "--color-ai-muted-hover": "var(--ai-muted-hover)",
146
+ "--color-ai-border": "var(--ai-border)",
147
+ "--color-ai-muted-foreground": "var(--ai-muted-foreground)",
148
+ "--color-success": "var(--success)",
149
+ "--color-success-foreground": "var(--success-foreground)",
150
+ "--color-success-muted": "var(--success-muted)",
151
+ "--color-success-border": "var(--success-border)",
152
+ "--color-success-muted-foreground": "var(--success-muted-foreground)",
153
+ "--color-warning": "var(--warning)",
154
+ "--color-warning-foreground": "var(--warning-foreground)",
155
+ "--color-warning-muted": "var(--warning-muted)",
156
+ "--color-warning-border": "var(--warning-border)",
157
+ "--color-warning-muted-foreground": "var(--warning-muted-foreground)",
158
+ "--color-destructive": "var(--destructive)",
159
+ "--color-destructive-foreground": "var(--destructive-foreground)",
160
+ "--color-destructive-muted": "var(--destructive-muted)",
161
+ "--color-destructive-border": "var(--destructive-border)",
162
+ "--color-destructive-muted-foreground": "var(--destructive-muted-foreground)",
163
+ "--color-info": "var(--info)",
164
+ "--color-info-foreground": "var(--info-foreground)",
165
+ "--color-info-muted": "var(--info-muted)",
166
+ "--color-info-border": "var(--info-border)",
167
+ "--color-info-muted-foreground": "var(--info-muted-foreground)",
168
+ "--color-border": "var(--border)",
169
+ "--color-border-subtle": "var(--border-subtle)",
170
+ "--color-border-strong": "var(--border-strong)",
171
+ "--color-input": "var(--input)",
172
+ "--color-ring": "var(--ring)",
173
+ "--color-sidebar": "var(--sidebar)",
174
+ "--color-sidebar-foreground": "var(--sidebar-foreground)",
175
+ "--color-sidebar-primary": "var(--sidebar-primary)",
176
+ "--color-sidebar-primary-foreground": "var(--sidebar-primary-foreground)",
177
+ "--color-sidebar-accent": "var(--sidebar-accent)",
178
+ "--color-sidebar-accent-foreground": "var(--sidebar-accent-foreground)",
179
+ "--color-sidebar-border": "var(--sidebar-border)",
180
+ "--color-sidebar-ring": "var(--sidebar-ring)",
181
+ "--color-score-excellent": "var(--score-excellent)",
182
+ "--color-score-good": "var(--score-good)",
183
+ "--color-score-average": "var(--score-average)",
184
+ "--color-score-below": "var(--score-below)",
185
+ "--color-score-poor": "var(--score-poor)",
186
+ "--color-chart-1": "var(--chart-1)",
187
+ "--color-chart-2": "var(--chart-2)",
188
+ "--color-chart-3": "var(--chart-3)",
189
+ "--color-chart-4": "var(--chart-4)",
190
+ "--color-chart-5": "var(--chart-5)",
191
+ "--color-chart-6": "var(--chart-6)",
192
+ "--color-chart-grid": "var(--chart-grid)",
193
+ "--color-chart-axis": "var(--chart-axis)"
194
+ }, le = n.createContext(null);
195
+ function ue({ theme: e, children: t }) {
196
+ return /* @__PURE__ */ d(le.Provider, {
197
+ value: e,
198
+ children: t
199
+ });
200
+ }
201
+ function S() {
202
+ return n.useContext(le) ?? "recruitsmartly";
203
+ }
204
+ function C(e) {
205
+ return `brand-${e}`;
206
+ }
207
+ function w(e, t, n, r) {
208
+ return {
209
+ className: _(se, C(e), t && "dark", n),
210
+ style: {
211
+ ...ce,
212
+ ...r
213
+ }
214
+ };
215
+ }
216
+ function T(e, t) {
217
+ return w(S(), oe(), e, t);
218
+ }
219
+ //#endregion
220
+ //#region src/components/ui/shadcn/shadcn-alert-dialog.tsx
221
+ function de({ ...e }) {
222
+ return /* @__PURE__ */ d(m.Root, {
223
+ "data-slot": "alert-dialog",
224
+ ...e
225
+ });
226
+ }
227
+ function fe({ ...e }) {
228
+ return /* @__PURE__ */ d(m.Trigger, {
229
+ "data-slot": "alert-dialog-trigger",
230
+ ...e
231
+ });
232
+ }
233
+ function E({ ...e }) {
234
+ return /* @__PURE__ */ d(m.Portal, {
235
+ "data-slot": "alert-dialog-portal",
236
+ ...e
237
+ });
238
+ }
239
+ function D({ className: e, ...t }) {
240
+ return /* @__PURE__ */ d(m.Overlay, {
241
+ "data-slot": "alert-dialog-overlay",
242
+ className: _("fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", e),
243
+ ...t
244
+ });
245
+ }
246
+ function O({ className: e, size: t = "default", style: n, ...r }) {
247
+ let i = T();
248
+ return /* @__PURE__ */ f(E, { children: [/* @__PURE__ */ d(D, {}), /* @__PURE__ */ d(m.Content, {
249
+ "data-slot": "alert-dialog-content",
250
+ "data-size": t,
251
+ style: {
252
+ ...i.style,
253
+ ...n
254
+ },
255
+ className: _(i.className, "group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", e),
256
+ ...r
257
+ })] });
258
+ }
259
+ function k({ className: e, ...t }) {
260
+ return /* @__PURE__ */ d("div", {
261
+ "data-slot": "alert-dialog-header",
262
+ className: _("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", e),
263
+ ...t
264
+ });
265
+ }
266
+ function A({ className: e, ...t }) {
267
+ return /* @__PURE__ */ d("div", {
268
+ "data-slot": "alert-dialog-footer",
269
+ className: _("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end", e),
270
+ ...t
271
+ });
272
+ }
273
+ function pe({ className: e, ...t }) {
274
+ return /* @__PURE__ */ d("div", {
275
+ "data-slot": "alert-dialog-media",
276
+ className: _("mb-2 inline-flex size-16 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8", e),
277
+ ...t
278
+ });
279
+ }
280
+ function j({ className: e, ...t }) {
281
+ return /* @__PURE__ */ d(m.Title, {
282
+ "data-slot": "alert-dialog-title",
283
+ className: _("font-heading text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", e),
284
+ ...t
285
+ });
286
+ }
287
+ function M({ className: e, ...t }) {
288
+ return /* @__PURE__ */ d(m.Description, {
289
+ "data-slot": "alert-dialog-description",
290
+ className: _("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", e),
291
+ ...t
292
+ });
293
+ }
294
+ function N({ className: e, variant: t = "default", size: n = "default", loading: r = !1, loadingText: i = "Loading...", disabled: a = !1, ...o }) {
295
+ return /* @__PURE__ */ d(b, {
296
+ variant: t,
297
+ size: n,
298
+ asChild: !0,
299
+ loading: r,
300
+ loadingText: i,
301
+ disabled: a,
302
+ children: /* @__PURE__ */ d(m.Action, {
303
+ "data-slot": "alert-dialog-action",
304
+ className: _(e),
305
+ ...o
306
+ })
307
+ });
308
+ }
309
+ function P({ className: e, variant: t = "outline", size: n = "default", loading: r = !1, loadingText: i = "Loading...", disabled: a = !1, ...o }) {
310
+ return /* @__PURE__ */ d(b, {
311
+ variant: t,
312
+ size: n,
313
+ asChild: !0,
314
+ loading: r,
315
+ loadingText: i,
316
+ disabled: a,
317
+ children: /* @__PURE__ */ d(m.Cancel, {
318
+ "data-slot": "alert-dialog-cancel",
319
+ className: _(e),
320
+ ...o
321
+ })
322
+ });
323
+ }
324
+ //#endregion
325
+ //#region src/components/ui/alert-dialog.tsx
326
+ var me = "Confirm", he = "Cancel", F = null;
327
+ function I(e) {
328
+ F?.(e);
329
+ }
330
+ function ge({ children: e }) {
331
+ let [t, n] = r.useState(null), i = r.useRef(!1), [a, o] = r.useState(!1);
332
+ r.useLayoutEffect(() => (F = (e) => n(e), () => {
333
+ F = null;
334
+ }), []);
335
+ let s = r.useCallback((e) => {
336
+ if (!e) {
337
+ if (i.current) {
338
+ i.current = !1, n(null);
339
+ return;
340
+ }
341
+ n((e) => (e && e.onCancel?.(), null));
342
+ }
343
+ }, []), c = r.useCallback(async () => {
344
+ i.current = !0;
345
+ let e = t;
346
+ if (!e) {
347
+ i.current = !1;
348
+ return;
349
+ }
350
+ try {
351
+ o(!0), await Promise.resolve(e.onConfirm?.());
352
+ } finally {
353
+ n(null), o(!1);
354
+ }
355
+ }, [t]);
356
+ return /* @__PURE__ */ f(u, { children: [e, t ? /* @__PURE__ */ d(de, {
357
+ open: !0,
358
+ onOpenChange: s,
359
+ children: /* @__PURE__ */ f(O, { children: [/* @__PURE__ */ f(k, { children: [/* @__PURE__ */ d(j, { children: t.title }), /* @__PURE__ */ d(M, {
360
+ className: t.description ? void 0 : "sr-only",
361
+ children: t.description ?? t.title
362
+ })] }), t.hideCancel && t.hideConfirm ? null : /* @__PURE__ */ f(A, { children: [t.hideCancel ? null : /* @__PURE__ */ d(P, {
363
+ disabled: a,
364
+ children: t.cancelText ?? he
365
+ }), t.hideConfirm ? null : /* @__PURE__ */ d(N, {
366
+ onClick: async (e) => {
367
+ e.preventDefault(), await c();
368
+ },
369
+ loading: a,
370
+ disabled: a,
371
+ loadingText: "Confirming...",
372
+ children: t.confirmText ?? me
373
+ })] })] })
374
+ }) : null] });
375
+ }
376
+ //#endregion
377
+ //#region src/lib/portaled-layer.ts
378
+ var _e = { zIndex: "var(--z-popover)" }, ve = {
379
+ onWheel: (e) => {
380
+ e.stopPropagation();
381
+ },
382
+ onTouchMove: (e) => {
383
+ e.stopPropagation();
384
+ }
385
+ }, L = ["[data-slot=\"combobox-content\"]", "[data-slot=\"combobox-positioner\"]"].join(", "), ye = [
386
+ L,
387
+ "[data-slot=\"combobox-list\"]",
388
+ "[data-slot=\"combobox-chips\"]",
389
+ "[data-slot=\"combobox-chip-input\"]",
390
+ "[data-popup-open]",
391
+ ".combobox-pointer-field"
392
+ ].join(", ");
393
+ function be(e) {
394
+ return e instanceof Element && !!e.closest(ye);
395
+ }
396
+ function xe(e) {
397
+ n.useEffect(() => {
398
+ if (!e) return;
399
+ let t = (e) => {
400
+ be(e.target) || e.preventDefault();
401
+ };
402
+ return document.addEventListener("wheel", t, {
403
+ passive: !1,
404
+ capture: !0
405
+ }), document.addEventListener("touchmove", t, {
406
+ passive: !1,
407
+ capture: !0
408
+ }), () => {
409
+ document.removeEventListener("wheel", t, { capture: !0 }), document.removeEventListener("touchmove", t, { capture: !0 });
410
+ };
411
+ }, [e]);
412
+ }
413
+ function Se(e) {
414
+ return e instanceof Element && !!e.closest(L);
415
+ }
416
+ function Ce(e) {
417
+ return Se(e.detail.originalEvent.target);
418
+ }
419
+ function R() {
420
+ for (let e of document.querySelectorAll(L)) for (let t = e; t && t !== document.body; t = t.parentElement) t.getAttribute("aria-hidden") === "true" && t.removeAttribute("aria-hidden");
421
+ }
422
+ //#endregion
423
+ //#region src/components/ui/dialog.tsx
424
+ function z({ ...e }) {
425
+ return /* @__PURE__ */ d(h.Root, {
426
+ "data-slot": "dialog",
427
+ ...e
428
+ });
429
+ }
430
+ function we({ ...e }) {
431
+ return /* @__PURE__ */ d(h.Trigger, {
432
+ "data-slot": "dialog-trigger",
433
+ ...e
434
+ });
435
+ }
436
+ function B({ ...e }) {
437
+ return /* @__PURE__ */ d(h.Portal, {
438
+ "data-slot": "dialog-portal",
439
+ ...e
440
+ });
441
+ }
442
+ function Te({ ...e }) {
443
+ return /* @__PURE__ */ d(h.Close, {
444
+ "data-slot": "dialog-close",
445
+ ...e
446
+ });
447
+ }
448
+ function V({ className: e, ...t }) {
449
+ return /* @__PURE__ */ d(h.Overlay, {
450
+ "data-slot": "dialog-overlay",
451
+ className: _("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", e),
452
+ ...t
453
+ });
454
+ }
455
+ function H({ className: e, children: r, showCloseButton: i = !0, style: a, onPointerDownOutside: o, onFocusOutside: s, onInteractOutside: c, ...l }) {
456
+ let u = T(), p = n.useCallback((e, t) => {
457
+ if (Ce(e)) {
458
+ e.preventDefault();
459
+ return;
460
+ }
461
+ t?.(e);
462
+ }, []);
463
+ return n.useLayoutEffect(() => {
464
+ R();
465
+ let e = new MutationObserver(() => {
466
+ R();
467
+ });
468
+ return e.observe(document.body, {
469
+ subtree: !0,
470
+ attributes: !0,
471
+ attributeFilter: ["aria-hidden"]
472
+ }), () => e.disconnect();
473
+ }, []), /* @__PURE__ */ f(B, { children: [/* @__PURE__ */ d(V, {}), /* @__PURE__ */ f(h.Content, {
474
+ "data-slot": "dialog-content",
475
+ style: {
476
+ ...u.style,
477
+ ...a
478
+ },
479
+ className: _(u.className, "fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", e),
480
+ onPointerDownOutside: (e) => p(e, o),
481
+ onFocusOutside: (e) => p(e, s),
482
+ onInteractOutside: (e) => p(e, c),
483
+ ...l,
484
+ children: [r, i && /* @__PURE__ */ d(h.Close, {
485
+ "data-slot": "dialog-close",
486
+ asChild: !0,
487
+ children: /* @__PURE__ */ f(b, {
488
+ variant: "ghost",
489
+ className: "absolute top-2 right-2",
490
+ size: "icon-sm",
491
+ children: [/* @__PURE__ */ d(t, {}), /* @__PURE__ */ d("span", {
492
+ className: "sr-only",
493
+ children: "Close"
494
+ })]
495
+ })
496
+ })]
497
+ })] });
498
+ }
499
+ function U({ className: e, ...t }) {
500
+ return /* @__PURE__ */ d("div", {
501
+ "data-slot": "dialog-header",
502
+ className: _("flex flex-col gap-2", e),
503
+ ...t
504
+ });
505
+ }
506
+ function Ee({ className: e, showCloseButton: t = !1, children: n, ...r }) {
507
+ return /* @__PURE__ */ f("div", {
508
+ "data-slot": "dialog-footer",
509
+ className: _("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", e),
510
+ ...r,
511
+ children: [n, t && /* @__PURE__ */ d(h.Close, {
512
+ asChild: !0,
513
+ children: /* @__PURE__ */ d(b, {
514
+ variant: "outline",
515
+ children: "Close"
516
+ })
517
+ })]
518
+ });
519
+ }
520
+ function W({ className: e, ...t }) {
521
+ return /* @__PURE__ */ d(h.Title, {
522
+ "data-slot": "dialog-title",
523
+ className: _("font-heading text-base leading-none font-semibold", e),
524
+ ...t
525
+ });
526
+ }
527
+ function G({ className: e, ...t }) {
528
+ return /* @__PURE__ */ d(h.Description, {
529
+ "data-slot": "dialog-description",
530
+ className: _("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", e),
531
+ ...t
532
+ });
533
+ }
534
+ var K = null;
535
+ function De(e) {
536
+ K?.(e);
537
+ }
538
+ function Oe({ children: e }) {
539
+ let [t, r] = n.useState(null);
540
+ n.useLayoutEffect(() => (K = (e) => r(e), () => {
541
+ K = null;
542
+ }), []);
543
+ let i = n.useCallback((e) => {
544
+ e || r((e) => (e && e.onClose?.(), null));
545
+ }, []);
546
+ return /* @__PURE__ */ f(u, { children: [e, t ? /* @__PURE__ */ d(z, {
547
+ open: !0,
548
+ onOpenChange: i,
549
+ children: /* @__PURE__ */ f(H, {
550
+ showCloseButton: t.showCloseButton ?? !0,
551
+ children: [/* @__PURE__ */ f(U, { children: [/* @__PURE__ */ d(W, { children: t.title }), /* @__PURE__ */ d(G, {
552
+ className: t.description ? void 0 : "sr-only",
553
+ children: t.description ?? t.title
554
+ })] }), t.children]
555
+ })
556
+ }) : null] });
557
+ }
558
+ //#endregion
559
+ //#region src/components/ui/sonner.tsx
560
+ var q = 4e3, J = Infinity;
561
+ function Y(e, t) {
562
+ return {
563
+ ...e,
564
+ duration: e?.duration ?? t
565
+ };
566
+ }
567
+ function ke(e, t) {
568
+ if (e == null) return e;
569
+ if (typeof e == "function") {
570
+ let n = e;
571
+ return (async (e) => {
572
+ let r = await n(e);
573
+ return typeof r == "object" && r && !a(r) ? {
574
+ duration: t,
575
+ ...r
576
+ } : {
577
+ message: r,
578
+ duration: t
579
+ };
580
+ });
581
+ }
582
+ return typeof e == "object" && !a(e) ? {
583
+ duration: t,
584
+ ...e
585
+ } : {
586
+ message: e,
587
+ duration: t
588
+ };
589
+ }
590
+ var Ae = Object.assign((e, t) => g(e, Y(t, q)), {
591
+ ...g,
592
+ success: (e, t) => g.success(e, Y(t, q)),
593
+ info: (e, t) => g.info(e, Y(t, q)),
594
+ message: (e, t) => g.message(e, Y(t, q)),
595
+ warning: (e, t) => g.warning(e, Y(t, J)),
596
+ error: (e, t) => g.error(e, Y(t, J)),
597
+ promise: (e, t) => g.promise(e, {
598
+ ...t,
599
+ success: ke(t?.success, q),
600
+ error: ke(t?.error, J)
601
+ }),
602
+ critical: (e) => {
603
+ I({
604
+ title: e.title,
605
+ description: e.description,
606
+ confirmText: e.confirmText ?? "OK",
607
+ hideCancel: !0,
608
+ onConfirm: e.onConfirm
609
+ });
610
+ }
611
+ }), je = 7e3, X = "[data-sonner-toast]", Me = "[data-sonner-toaster]", Z = "[data-close-button]";
612
+ function Q(e) {
613
+ return typeof e == "function" ? Q(e()) : typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(Q).join("") : a(e) ? Q(e.props.children) : "";
614
+ }
615
+ function Ne() {
616
+ let { toasts: e } = re(), t = s(null), n = s(null), r = s(/* @__PURE__ */ new Map());
617
+ return o(() => {
618
+ let i = new Set(e.map((e) => e.id));
619
+ for (let e of r.current.keys()) i.has(e) || r.current.delete(e);
620
+ for (let i of [...e].reverse()) {
621
+ let e = [Q(i.title), Q(i.description)].filter(Boolean).join(". ") || Q(i.jsx), a = `${i.type}:${e}`;
622
+ if (!e || r.current.get(i.id) === a) continue;
623
+ r.current.set(i.id, a);
624
+ let o = i.type === "error" ? n.current : t.current;
625
+ if (!o) continue;
626
+ let s = document.createElement("p");
627
+ s.textContent = e, o.append(s), window.setTimeout(() => s.remove(), je);
628
+ }
629
+ }, [e]), /* @__PURE__ */ f("div", {
630
+ className: "sr-only",
631
+ children: [/* @__PURE__ */ d("div", {
632
+ ref: t,
633
+ "aria-live": "polite",
634
+ "aria-relevant": "additions",
635
+ "aria-atomic": "false"
636
+ }), /* @__PURE__ */ d("div", {
637
+ ref: n,
638
+ "aria-live": "assertive",
639
+ "aria-relevant": "additions",
640
+ "aria-atomic": "false"
641
+ })]
642
+ });
643
+ }
644
+ function Pe() {
645
+ o(() => {
646
+ let e = null, t = (t) => {
647
+ let n = Array.from(t.parentElement?.querySelectorAll(`${X}:not([data-removed="true"])`) ?? []), r = n.indexOf(t), i = n[r + 1] ?? n[r - 1];
648
+ i && i !== t ? i.focus({ preventScroll: !0 }) : e?.focus({ preventScroll: !0 });
649
+ }, n = (t) => {
650
+ let n = t.target, r = t.relatedTarget;
651
+ n?.closest(Me) && !r?.closest(Me) && (e = r);
652
+ }, r = (e) => {
653
+ if (e.key !== "Escape" || e.defaultPrevented) return;
654
+ let t = document.activeElement?.closest(X);
655
+ if (!t || t.dataset.dismissible === "false") return;
656
+ let n = t.querySelector(`:scope > ${Z}`);
657
+ n && (e.preventDefault(), e.stopPropagation(), n.click());
658
+ }, i = (e) => {
659
+ if (e.detail !== 0) return;
660
+ let n = (e.target?.closest(Z))?.closest(X);
661
+ n && n.dataset.dismissible !== "false" && t(n);
662
+ };
663
+ return document.addEventListener("focusin", n), document.addEventListener("keydown", r, !0), document.addEventListener("click", i, !0), () => {
664
+ document.removeEventListener("focusin", n), document.removeEventListener("keydown", r, !0), document.removeEventListener("click", i, !0);
665
+ };
666
+ }, []);
667
+ }
668
+ var Fe = ({ style: e, className: t, toastOptions: n, duration: r, ...i }) => {
669
+ let a = S(), c = oe(), l = w(a, c), p = s(null);
670
+ return Pe(), o(() => {
671
+ p.current?.setAttribute("aria-live", "off");
672
+ }, []), /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(ne, {
673
+ ref: p,
674
+ theme: c ? "dark" : "light",
675
+ position: "bottom-right",
676
+ richColors: !0,
677
+ closeButton: !0,
678
+ duration: r ?? q,
679
+ className: _("toaster group", l.className, t),
680
+ style: {
681
+ ...l.style,
682
+ ...e
683
+ },
684
+ toastOptions: {
685
+ ...n,
686
+ classNames: {
687
+ ...n?.classNames,
688
+ closeButton: _("opacity-0 pointer-events-none focus-visible:opacity-100 focus-visible:pointer-events-auto", n?.classNames?.closeButton),
689
+ warning: _("[&_[data-close-button]]:opacity-100 [&_[data-close-button]]:pointer-events-auto", n?.classNames?.warning),
690
+ error: _("[&_[data-close-button]]:opacity-100 [&_[data-close-button]]:pointer-events-auto", n?.classNames?.error)
691
+ }
692
+ },
693
+ ...i
694
+ }), /* @__PURE__ */ d(Ne, {})] });
695
+ };
696
+ //#endregion
697
+ //#region src/components/ui/label.tsx
698
+ function $({ className: e, ...t }) {
699
+ return /* @__PURE__ */ d(ee.Root, {
700
+ "data-slot": "label",
701
+ className: _("flex items-center text-foreground gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", e),
702
+ ...t
703
+ });
704
+ }
705
+ //#endregion
706
+ //#region src/components/ui/input.tsx
707
+ function Ie({ className: e, type: t, error: n = !1, label: r, helperText: a, startIcon: o, endIcon: s, appearance: c = "default", ...l }) {
708
+ let u = o ? i(o, { className: _("stroke-text-input-placeholder") }) : null, p = s ? i(s, { className: _("stroke-text-input-placeholder") }) : null;
709
+ return /* @__PURE__ */ f("div", {
710
+ className: "w-full flex flex-col gap-2 h-fit ",
711
+ children: [
712
+ !!r && /* @__PURE__ */ d($, { children: r }),
713
+ /* @__PURE__ */ f("div", {
714
+ className: "w-full relative",
715
+ children: [
716
+ u && /* @__PURE__ */ d("div", {
717
+ className: "absolute left-3 top-1/2 -translate-y-1/2",
718
+ children: u
719
+ }),
720
+ /* @__PURE__ */ d("input", {
721
+ ...l,
722
+ type: t,
723
+ "data-slot": "input",
724
+ "data-appearance": c,
725
+ "aria-invalid": n ? !0 : l["aria-invalid"],
726
+ className: _(c === "themed" && "input-themed transition-smooth flex h-9 w-full min-w-0 py-1 text-base shadow-none outline-none md:text-sm", c === "default" && `file:text-foreground ${l?.placeholder ? "placeholder:text-text-disabled placeholder:text-sm placeholder:font-normal" : "placeholder:text-muted-foreground"} selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 ${u ? "pl-10" : "pl-3"} ${p ? "pr-10" : "pr-3"} py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-base-secondary-disabled md:text-sm`, c === "default" && "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", c === "themed" && (n || l["aria-invalid"] === !0 ? "input-error" : void 0), u && c === "themed" && "pl-10", !u && c === "themed" && "pl-3", p && c === "themed" && "pr-10", !p && c === "themed" && "pr-3", e)
727
+ }),
728
+ p && /* @__PURE__ */ d("div", {
729
+ className: "absolute right-3 top-1/2 -translate-y-1/2",
730
+ children: p
731
+ })
732
+ ]
733
+ }),
734
+ a && /* @__PURE__ */ d("p", {
735
+ className: `text-caption ${n ? "text-destructive" : "text-muted-foreground"}`,
736
+ children: a
737
+ })
738
+ ]
739
+ });
740
+ }
741
+ //#endregion
742
+ //#region src/components/ui/textarea.tsx
743
+ function Le({ className: e, error: t = !1, label: n, helperText: r, ...i }) {
744
+ return /* @__PURE__ */ f("div", {
745
+ className: "w-full flex flex-col gap-2",
746
+ children: [
747
+ n && /* @__PURE__ */ d($, { children: n }),
748
+ /* @__PURE__ */ d("textarea", {
749
+ "data-slot": "textarea",
750
+ className: _("flex-1 border-input placeholder:text-text-disabled focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", e),
751
+ ...i
752
+ }),
753
+ r && /* @__PURE__ */ d("p", {
754
+ className: `text-caption ${t ? "text-destructive" : "text-muted-foreground"}`,
755
+ children: r
756
+ })
757
+ ]
758
+ });
759
+ }
760
+ //#endregion
761
+ //#region src/components/ui/input-group.tsx
762
+ function Re({ className: e, ...t }) {
763
+ return /* @__PURE__ */ d("div", {
764
+ "data-slot": "input-group",
765
+ role: "group",
766
+ className: _("group/input-group relative flex h-9 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5", e),
767
+ ...t
768
+ });
769
+ }
770
+ var ze = p("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4", {
771
+ variants: { align: {
772
+ "inline-start": "order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]",
773
+ "inline-end": "order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]",
774
+ "block-start": "order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
775
+ "block-end": "order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"
776
+ } },
777
+ defaultVariants: { align: "inline-start" }
778
+ });
779
+ function Be({ className: e, align: t = "inline-start", ...n }) {
780
+ return /* @__PURE__ */ d("div", {
781
+ role: "group",
782
+ "data-slot": "input-group-addon",
783
+ "data-align": t,
784
+ className: _(ze({ align: t }), e),
785
+ onClick: (e) => {
786
+ e.target.closest("button") || e.currentTarget.parentElement?.querySelector("input")?.focus();
787
+ },
788
+ ...n
789
+ });
790
+ }
791
+ var Ve = p("flex items-center gap-2 text-sm shadow-none", {
792
+ variants: { size: {
793
+ xs: "h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
794
+ sm: "",
795
+ "icon-xs": "size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0",
796
+ "icon-sm": "size-8 p-0 has-[>svg]:p-0"
797
+ } },
798
+ defaultVariants: { size: "xs" }
799
+ });
800
+ function He({ className: e, type: t = "button", variant: n = "ghost", size: r = "xs", ...i }) {
801
+ return /* @__PURE__ */ d(b, {
802
+ type: t,
803
+ "data-size": r,
804
+ variant: n,
805
+ className: _(Ve({ size: r }), e),
806
+ ...i
807
+ });
808
+ }
809
+ function Ue({ className: e, ...t }) {
810
+ return /* @__PURE__ */ d("span", {
811
+ className: _("flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", e),
812
+ ...t
813
+ });
814
+ }
815
+ function We({ className: e, ...t }) {
816
+ return /* @__PURE__ */ d(Ie, {
817
+ "data-slot": "input-group-control",
818
+ className: _("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent", e),
819
+ ...t
820
+ });
821
+ }
822
+ function Ge({ className: e, ...t }) {
823
+ return /* @__PURE__ */ d(Le, {
824
+ "data-slot": "input-group-control",
825
+ className: _("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent", e),
826
+ ...t
827
+ });
828
+ }
829
+ //#endregion
830
+ export { v as $, N as A, fe as B, De as C, ge as D, xe as E, k as F, S as G, ue as H, pe as I, x as J, T as K, D as L, O as M, M as N, I as O, A as P, y as Q, E as R, we as S, _e as T, w as U, ce as V, C as W, ie as X, ae as Y, b as Z, U as _, Ue as a, Oe as b, Ie as c, Ae as d, _ as et, z as f, Ee as g, G as h, We as i, P as j, de as k, $ as l, H as m, Be as n, Ge as o, Te as p, se as q, He as r, Le as s, Re as t, Fe as u, V as v, ve as w, W as x, B as y, j as z };