opsfuse-ui 0.1.26 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/sonner.d.ts +1 -1
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/core.js +2 -2
- package/dist/extended.js +2 -2
- package/dist/index.js +3 -3
- package/dist/{input-group-BFEABA03.js → input-group-X3fuX86H.js} +212 -170
- package/dist/{input-otp-kzcY4B1V.js → input-otp-DrVB1OD2.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{toggle-group-qup4FMjO.js → toggle-group-DYoC1Lda.js} +1 -1
- package/package.json +1 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import * as
|
|
4
|
-
import { cloneElement as
|
|
5
|
-
import { clsx as
|
|
6
|
-
import { twMerge as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { cva as
|
|
9
|
-
import { Dialog as
|
|
10
|
-
import { Toaster as
|
|
2
|
+
import { Loader2Icon as e, XIcon as t } from "lucide-react";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
import { cloneElement as r, isValidElement as i, useEffect as a, useRef as o } from "react";
|
|
5
|
+
import { clsx as s } from "clsx";
|
|
6
|
+
import { twMerge as c } from "tailwind-merge";
|
|
7
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
|
+
import { cva as f } from "class-variance-authority";
|
|
9
|
+
import { Dialog as p, Label as m, Slot as h } from "radix-ui";
|
|
10
|
+
import { Toaster as g, toast as _, useSonner as ee } from "sonner";
|
|
11
11
|
//#region src/lib/utils.ts
|
|
12
12
|
function v(...e) {
|
|
13
|
-
return
|
|
13
|
+
return c(s(e));
|
|
14
14
|
}
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/components/ui/spinner.tsx
|
|
17
|
-
function y({ className:
|
|
18
|
-
return /* @__PURE__ */
|
|
17
|
+
function y({ className: t, ...n }) {
|
|
18
|
+
return /* @__PURE__ */ u(e, {
|
|
19
19
|
role: "status",
|
|
20
20
|
"aria-label": "Loading",
|
|
21
|
-
className: v("size-4 animate-spin",
|
|
22
|
-
...
|
|
21
|
+
className: v("size-4 animate-spin", t),
|
|
22
|
+
...n
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
//#endregion
|
|
26
26
|
//#region src/components/ui/button.tsx
|
|
27
|
-
var b =
|
|
27
|
+
var b = f("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
28
|
variants: {
|
|
29
29
|
motion: {
|
|
30
30
|
default: "transition-all",
|
|
@@ -58,8 +58,8 @@ var b = p("cursor-pointer group/button inline-flex shrink-0 items-center justify
|
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
function x({ 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 ?
|
|
62
|
-
return /* @__PURE__ */
|
|
61
|
+
let c = i ? h.Root : "button";
|
|
62
|
+
return /* @__PURE__ */ u(c, {
|
|
63
63
|
"data-slot": "button",
|
|
64
64
|
"data-variant": t,
|
|
65
65
|
"data-size": n,
|
|
@@ -70,32 +70,32 @@ function x({ className: e, variant: t = "default", size: n = "default", motion:
|
|
|
70
70
|
motion: r
|
|
71
71
|
}), e),
|
|
72
72
|
...s,
|
|
73
|
-
children: a ? /* @__PURE__ */
|
|
73
|
+
children: a ? /* @__PURE__ */ d("div", {
|
|
74
74
|
className: "flex items-center gap-2",
|
|
75
|
-
children: [/* @__PURE__ */
|
|
75
|
+
children: [/* @__PURE__ */ u(y, { className: "size-4 animate-spin" }), o]
|
|
76
76
|
}) : s.children
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
//#endregion
|
|
80
80
|
//#region src/lib/brand-theme.ts
|
|
81
|
-
var
|
|
81
|
+
var te = [
|
|
82
82
|
"recruitsmartly",
|
|
83
83
|
"skillready",
|
|
84
84
|
"worklog",
|
|
85
85
|
"verity",
|
|
86
86
|
"lms"
|
|
87
|
-
],
|
|
87
|
+
], S = "recruitsmartly";
|
|
88
88
|
//#endregion
|
|
89
89
|
//#region src/lib/document-dark-mode.ts
|
|
90
|
-
function
|
|
90
|
+
function C() {
|
|
91
91
|
if (typeof document > "u") return !1;
|
|
92
92
|
let e = document.documentElement;
|
|
93
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
94
|
}
|
|
95
|
-
function
|
|
96
|
-
let [e, t] =
|
|
97
|
-
return
|
|
98
|
-
let e = () => t(
|
|
95
|
+
function w() {
|
|
96
|
+
let [e, t] = n.useState(() => typeof document > "u" ? !1 : C());
|
|
97
|
+
return n.useEffect(() => {
|
|
98
|
+
let e = () => t(C());
|
|
99
99
|
e();
|
|
100
100
|
let n = new MutationObserver(e);
|
|
101
101
|
return n.observe(document.documentElement, {
|
|
@@ -114,7 +114,7 @@ function T() {
|
|
|
114
114
|
}
|
|
115
115
|
//#endregion
|
|
116
116
|
//#region src/lib/theme-scope.ts
|
|
117
|
-
var
|
|
117
|
+
var T = "opsfuse-ui", E = {
|
|
118
118
|
"--color-background": "var(--background)",
|
|
119
119
|
"--color-foreground": "var(--foreground)",
|
|
120
120
|
"--color-card": "var(--card)",
|
|
@@ -191,56 +191,56 @@ var E = "opsfuse-ui", D = {
|
|
|
191
191
|
"--color-chart-6": "var(--chart-6)",
|
|
192
192
|
"--color-chart-grid": "var(--chart-grid)",
|
|
193
193
|
"--color-chart-axis": "var(--chart-axis)"
|
|
194
|
-
},
|
|
195
|
-
function
|
|
196
|
-
return /* @__PURE__ */
|
|
194
|
+
}, D = n.createContext(null);
|
|
195
|
+
function ne({ theme: e, children: t }) {
|
|
196
|
+
return /* @__PURE__ */ u(D.Provider, {
|
|
197
197
|
value: e,
|
|
198
198
|
children: t
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
|
-
function
|
|
202
|
-
return
|
|
201
|
+
function O() {
|
|
202
|
+
return n.useContext(D) ?? "recruitsmartly";
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function k(e) {
|
|
205
205
|
return `brand-${e}`;
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function A(e, t, n, r) {
|
|
208
208
|
return {
|
|
209
|
-
className: v(
|
|
209
|
+
className: v(T, k(e), t && "dark", n),
|
|
210
210
|
style: {
|
|
211
|
-
...
|
|
211
|
+
...E,
|
|
212
212
|
...r
|
|
213
213
|
}
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
return
|
|
216
|
+
function j(e, t) {
|
|
217
|
+
return A(O(), w(), e, t);
|
|
218
218
|
}
|
|
219
219
|
//#endregion
|
|
220
220
|
//#region src/lib/portaled-layer.ts
|
|
221
|
-
var
|
|
221
|
+
var M = { zIndex: "var(--z-popover)" }, N = {
|
|
222
222
|
onWheel: (e) => {
|
|
223
223
|
e.stopPropagation();
|
|
224
224
|
},
|
|
225
225
|
onTouchMove: (e) => {
|
|
226
226
|
e.stopPropagation();
|
|
227
227
|
}
|
|
228
|
-
},
|
|
229
|
-
|
|
228
|
+
}, P = ["[data-slot=\"combobox-content\"]", "[data-slot=\"combobox-positioner\"]"].join(", "), re = [
|
|
229
|
+
P,
|
|
230
230
|
"[data-slot=\"combobox-list\"]",
|
|
231
231
|
"[data-slot=\"combobox-chips\"]",
|
|
232
232
|
"[data-slot=\"combobox-chip-input\"]",
|
|
233
233
|
"[data-popup-open]",
|
|
234
234
|
".combobox-pointer-field"
|
|
235
235
|
].join(", ");
|
|
236
|
-
function
|
|
237
|
-
return e instanceof Element && !!e.closest(
|
|
236
|
+
function ie(e) {
|
|
237
|
+
return e instanceof Element && !!e.closest(re);
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
|
|
239
|
+
function ae(e) {
|
|
240
|
+
n.useEffect(() => {
|
|
241
241
|
if (!e) return;
|
|
242
242
|
let t = (e) => {
|
|
243
|
-
|
|
243
|
+
ie(e.target) || e.preventDefault();
|
|
244
244
|
};
|
|
245
245
|
return document.addEventListener("wheel", t, {
|
|
246
246
|
passive: !1,
|
|
@@ -253,85 +253,85 @@ function re(e) {
|
|
|
253
253
|
};
|
|
254
254
|
}, [e]);
|
|
255
255
|
}
|
|
256
|
-
function
|
|
257
|
-
return e instanceof Element && !!e.closest(
|
|
256
|
+
function oe(e) {
|
|
257
|
+
return e instanceof Element && !!e.closest(P);
|
|
258
258
|
}
|
|
259
|
-
function
|
|
260
|
-
return
|
|
259
|
+
function se(e) {
|
|
260
|
+
return oe(e.detail.originalEvent.target);
|
|
261
261
|
}
|
|
262
|
-
function
|
|
263
|
-
for (let e of document.querySelectorAll(
|
|
262
|
+
function F() {
|
|
263
|
+
for (let e of document.querySelectorAll(P)) for (let t = e; t && t !== document.body; t = t.parentElement) t.getAttribute("aria-hidden") === "true" && t.removeAttribute("aria-hidden");
|
|
264
264
|
}
|
|
265
265
|
//#endregion
|
|
266
266
|
//#region src/components/ui/dialog.tsx
|
|
267
|
-
function
|
|
268
|
-
return /* @__PURE__ */
|
|
267
|
+
function I({ ...e }) {
|
|
268
|
+
return /* @__PURE__ */ u(p.Root, {
|
|
269
269
|
"data-slot": "dialog",
|
|
270
270
|
...e
|
|
271
271
|
});
|
|
272
272
|
}
|
|
273
|
-
function
|
|
274
|
-
return /* @__PURE__ */
|
|
273
|
+
function ce({ ...e }) {
|
|
274
|
+
return /* @__PURE__ */ u(p.Trigger, {
|
|
275
275
|
"data-slot": "dialog-trigger",
|
|
276
276
|
...e
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
|
-
function
|
|
280
|
-
return /* @__PURE__ */
|
|
279
|
+
function L({ ...e }) {
|
|
280
|
+
return /* @__PURE__ */ u(p.Portal, {
|
|
281
281
|
"data-slot": "dialog-portal",
|
|
282
282
|
...e
|
|
283
283
|
});
|
|
284
284
|
}
|
|
285
|
-
function
|
|
286
|
-
return /* @__PURE__ */
|
|
285
|
+
function R({ ...e }) {
|
|
286
|
+
return /* @__PURE__ */ u(p.Close, {
|
|
287
287
|
"data-slot": "dialog-close",
|
|
288
288
|
...e
|
|
289
289
|
});
|
|
290
290
|
}
|
|
291
|
-
function
|
|
292
|
-
return /* @__PURE__ */
|
|
291
|
+
function z({ className: e, ...t }) {
|
|
292
|
+
return /* @__PURE__ */ u(p.Overlay, {
|
|
293
293
|
"data-slot": "dialog-overlay",
|
|
294
294
|
className: v("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),
|
|
295
295
|
...t
|
|
296
296
|
});
|
|
297
297
|
}
|
|
298
|
-
function
|
|
299
|
-
let
|
|
300
|
-
if (
|
|
298
|
+
function B({ className: e, children: r, showCloseButton: i = !0, style: a, onPointerDownOutside: o, onFocusOutside: s, onInteractOutside: c, ...l }) {
|
|
299
|
+
let f = j(), m = n.useCallback((e, t) => {
|
|
300
|
+
if (se(e)) {
|
|
301
301
|
e.preventDefault();
|
|
302
302
|
return;
|
|
303
303
|
}
|
|
304
304
|
t?.(e);
|
|
305
305
|
}, []);
|
|
306
|
-
return
|
|
307
|
-
|
|
306
|
+
return n.useLayoutEffect(() => {
|
|
307
|
+
F();
|
|
308
308
|
let e = new MutationObserver(() => {
|
|
309
|
-
|
|
309
|
+
F();
|
|
310
310
|
});
|
|
311
311
|
return e.observe(document.body, {
|
|
312
312
|
subtree: !0,
|
|
313
313
|
attributes: !0,
|
|
314
314
|
attributeFilter: ["aria-hidden"]
|
|
315
315
|
}), () => e.disconnect();
|
|
316
|
-
}, []), /* @__PURE__ */
|
|
316
|
+
}, []), /* @__PURE__ */ d(L, { children: [/* @__PURE__ */ u(z, {}), /* @__PURE__ */ d(p.Content, {
|
|
317
317
|
"data-slot": "dialog-content",
|
|
318
318
|
style: {
|
|
319
|
-
...
|
|
320
|
-
...
|
|
319
|
+
...f.style,
|
|
320
|
+
...a
|
|
321
321
|
},
|
|
322
|
-
className: v(
|
|
323
|
-
onPointerDownOutside: (e) =>
|
|
324
|
-
onFocusOutside: (e) =>
|
|
325
|
-
onInteractOutside: (e) =>
|
|
322
|
+
className: v(f.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),
|
|
323
|
+
onPointerDownOutside: (e) => m(e, o),
|
|
324
|
+
onFocusOutside: (e) => m(e, s),
|
|
325
|
+
onInteractOutside: (e) => m(e, c),
|
|
326
326
|
...l,
|
|
327
|
-
children: [
|
|
327
|
+
children: [r, i && /* @__PURE__ */ u(p.Close, {
|
|
328
328
|
"data-slot": "dialog-close",
|
|
329
329
|
asChild: !0,
|
|
330
|
-
children: /* @__PURE__ */
|
|
330
|
+
children: /* @__PURE__ */ d(x, {
|
|
331
331
|
variant: "ghost",
|
|
332
332
|
className: "absolute top-2 right-2",
|
|
333
333
|
size: "icon-sm",
|
|
334
|
-
children: [/* @__PURE__ */
|
|
334
|
+
children: [/* @__PURE__ */ u(t, {}), /* @__PURE__ */ u("span", {
|
|
335
335
|
className: "sr-only",
|
|
336
336
|
children: "Close"
|
|
337
337
|
})]
|
|
@@ -339,59 +339,59 @@ function W({ className: e, children: t, showCloseButton: n = !0, style: r, onPoi
|
|
|
339
339
|
})]
|
|
340
340
|
})] });
|
|
341
341
|
}
|
|
342
|
-
function
|
|
343
|
-
return /* @__PURE__ */
|
|
342
|
+
function V({ className: e, ...t }) {
|
|
343
|
+
return /* @__PURE__ */ u("div", {
|
|
344
344
|
"data-slot": "dialog-header",
|
|
345
345
|
className: v("flex flex-col gap-2", e),
|
|
346
346
|
...t
|
|
347
347
|
});
|
|
348
348
|
}
|
|
349
|
-
function
|
|
350
|
-
return /* @__PURE__ */
|
|
349
|
+
function H({ className: e, showCloseButton: t = !1, children: n, ...r }) {
|
|
350
|
+
return /* @__PURE__ */ d("div", {
|
|
351
351
|
"data-slot": "dialog-footer",
|
|
352
352
|
className: v("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", e),
|
|
353
353
|
...r,
|
|
354
|
-
children: [n, t && /* @__PURE__ */
|
|
354
|
+
children: [n, t && /* @__PURE__ */ u(p.Close, {
|
|
355
355
|
asChild: !0,
|
|
356
|
-
children: /* @__PURE__ */
|
|
356
|
+
children: /* @__PURE__ */ u(x, {
|
|
357
357
|
variant: "outline",
|
|
358
358
|
children: "Close"
|
|
359
359
|
})
|
|
360
360
|
})]
|
|
361
361
|
});
|
|
362
362
|
}
|
|
363
|
-
function
|
|
364
|
-
return /* @__PURE__ */
|
|
363
|
+
function U({ className: e, ...t }) {
|
|
364
|
+
return /* @__PURE__ */ u(p.Title, {
|
|
365
365
|
"data-slot": "dialog-title",
|
|
366
366
|
className: v("font-heading text-base leading-none font-semibold", e),
|
|
367
367
|
...t
|
|
368
368
|
});
|
|
369
369
|
}
|
|
370
|
-
function
|
|
371
|
-
return /* @__PURE__ */
|
|
370
|
+
function W({ className: e, ...t }) {
|
|
371
|
+
return /* @__PURE__ */ u(p.Description, {
|
|
372
372
|
"data-slot": "dialog-description",
|
|
373
373
|
className: v("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", e),
|
|
374
374
|
...t
|
|
375
375
|
});
|
|
376
376
|
}
|
|
377
|
-
var
|
|
378
|
-
function
|
|
379
|
-
|
|
377
|
+
var G = null;
|
|
378
|
+
function le(e) {
|
|
379
|
+
G?.(e);
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
let [t,
|
|
383
|
-
|
|
384
|
-
|
|
381
|
+
function ue({ children: e }) {
|
|
382
|
+
let [t, r] = n.useState(null);
|
|
383
|
+
n.useLayoutEffect(() => (G = (e) => r(e), () => {
|
|
384
|
+
G = null;
|
|
385
385
|
}), []);
|
|
386
|
-
let
|
|
387
|
-
e ||
|
|
386
|
+
let i = n.useCallback((e) => {
|
|
387
|
+
e || r((e) => (e && e.onClose?.(), null));
|
|
388
388
|
}, []);
|
|
389
|
-
return /* @__PURE__ */
|
|
389
|
+
return /* @__PURE__ */ d(l, { children: [e, t ? /* @__PURE__ */ u(I, {
|
|
390
390
|
open: !0,
|
|
391
|
-
onOpenChange:
|
|
392
|
-
children: /* @__PURE__ */
|
|
391
|
+
onOpenChange: i,
|
|
392
|
+
children: /* @__PURE__ */ d(B, {
|
|
393
393
|
showCloseButton: t.showCloseButton ?? !0,
|
|
394
|
-
children: [/* @__PURE__ */
|
|
394
|
+
children: [/* @__PURE__ */ d(V, { children: [/* @__PURE__ */ u(U, { children: t.title }), /* @__PURE__ */ u(W, {
|
|
395
395
|
className: t.description ? void 0 : "sr-only",
|
|
396
396
|
children: t.description ?? t.title
|
|
397
397
|
})] }), t.children]
|
|
@@ -400,50 +400,92 @@ function oe({ children: e }) {
|
|
|
400
400
|
}
|
|
401
401
|
//#endregion
|
|
402
402
|
//#region src/components/ui/sonner.tsx
|
|
403
|
-
var
|
|
404
|
-
|
|
405
|
-
return
|
|
406
|
-
|
|
407
|
-
|
|
403
|
+
var de = 7e3, K = "[data-sonner-toast]", q = "[data-sonner-toaster]", J = "[data-close-button]";
|
|
404
|
+
function Y(e) {
|
|
405
|
+
return typeof e == "function" ? Y(e()) : typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(Y).join("") : i(e) ? Y(e.props.children) : "";
|
|
406
|
+
}
|
|
407
|
+
function fe() {
|
|
408
|
+
let { toasts: e } = ee(), t = o(null), n = o(null), r = o(/* @__PURE__ */ new Map());
|
|
409
|
+
return a(() => {
|
|
410
|
+
let i = new Set(e.map((e) => e.id));
|
|
411
|
+
for (let e of r.current.keys()) i.has(e) || r.current.delete(e);
|
|
412
|
+
for (let i of [...e].reverse()) {
|
|
413
|
+
let e = [Y(i.title), Y(i.description)].filter(Boolean).join(". ") || Y(i.jsx), a = `${i.type}:${e}`;
|
|
414
|
+
if (!e || r.current.get(i.id) === a) continue;
|
|
415
|
+
r.current.set(i.id, a);
|
|
416
|
+
let o = i.type === "error" ? n.current : t.current;
|
|
417
|
+
if (!o) continue;
|
|
418
|
+
let s = document.createElement("p");
|
|
419
|
+
s.textContent = e, o.append(s), window.setTimeout(() => s.remove(), de);
|
|
420
|
+
}
|
|
421
|
+
}, [e]), /* @__PURE__ */ d("div", {
|
|
422
|
+
className: "sr-only",
|
|
423
|
+
children: [/* @__PURE__ */ u("div", {
|
|
424
|
+
ref: t,
|
|
425
|
+
"aria-live": "polite",
|
|
426
|
+
"aria-relevant": "additions",
|
|
427
|
+
"aria-atomic": "false"
|
|
428
|
+
}), /* @__PURE__ */ u("div", {
|
|
429
|
+
ref: n,
|
|
430
|
+
"aria-live": "assertive",
|
|
431
|
+
"aria-relevant": "additions",
|
|
432
|
+
"aria-atomic": "false"
|
|
433
|
+
})]
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
function pe() {
|
|
437
|
+
a(() => {
|
|
438
|
+
let e = null, t = (t) => {
|
|
439
|
+
let n = Array.from(t.parentElement?.querySelectorAll(`${K}:not([data-removed="true"])`) ?? []), r = n.indexOf(t), i = n[r + 1] ?? n[r - 1];
|
|
440
|
+
i && i !== t ? i.focus({ preventScroll: !0 }) : e?.focus({ preventScroll: !0 });
|
|
441
|
+
}, n = (t) => {
|
|
442
|
+
let n = t.target, r = t.relatedTarget;
|
|
443
|
+
n?.closest(q) && !r?.closest(q) && (e = r);
|
|
444
|
+
}, r = (e) => {
|
|
445
|
+
if (e.key !== "Escape" || e.defaultPrevented) return;
|
|
446
|
+
let t = document.activeElement?.closest(K);
|
|
447
|
+
if (!t || t.dataset.dismissible === "false") return;
|
|
448
|
+
let n = t.querySelector(`:scope > ${J}`);
|
|
449
|
+
n && (e.preventDefault(), e.stopPropagation(), n.click());
|
|
450
|
+
}, i = (e) => {
|
|
451
|
+
if (e.detail !== 0) return;
|
|
452
|
+
let n = (e.target?.closest(J))?.closest(K);
|
|
453
|
+
n && n.dataset.dismissible !== "false" && t(n);
|
|
454
|
+
};
|
|
455
|
+
return document.addEventListener("focusin", n), document.addEventListener("keydown", r, !0), document.addEventListener("click", i, !0), () => {
|
|
456
|
+
document.removeEventListener("focusin", n), document.removeEventListener("keydown", r, !0), document.removeEventListener("click", i, !0);
|
|
457
|
+
};
|
|
458
|
+
}, []);
|
|
459
|
+
}
|
|
460
|
+
var me = ({ style: e, className: t, toastOptions: n, ...r }) => {
|
|
461
|
+
let i = O(), s = w(), c = A(i, s), f = o(null);
|
|
462
|
+
return pe(), a(() => {
|
|
463
|
+
f.current?.setAttribute("aria-live", "off");
|
|
464
|
+
}, []), /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(g, {
|
|
465
|
+
ref: f,
|
|
466
|
+
theme: s ? "dark" : "light",
|
|
467
|
+
position: "bottom-right",
|
|
408
468
|
richColors: !0,
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
info: /* @__PURE__ */ d(t, { className: "size-4" }),
|
|
412
|
-
warning: /* @__PURE__ */ d(i, { className: "size-4" }),
|
|
413
|
-
error: /* @__PURE__ */ d(r, { className: "size-4" }),
|
|
414
|
-
loading: /* @__PURE__ */ d(n, { className: "size-4 animate-spin" })
|
|
415
|
-
},
|
|
469
|
+
closeButton: !0,
|
|
470
|
+
className: v("toaster group", c.className, t),
|
|
416
471
|
style: {
|
|
417
|
-
...
|
|
418
|
-
|
|
419
|
-
"--normal-text": "var(--popover-foreground)",
|
|
420
|
-
"--normal-border": "var(--border)",
|
|
421
|
-
"--success-bg": "var(--success-muted)",
|
|
422
|
-
"--success-text": "var(--success-muted-foreground)",
|
|
423
|
-
"--success-border": "oklch(0.76 0.13 152)",
|
|
424
|
-
"--error-bg": "var(--destructive-muted)",
|
|
425
|
-
"--error-text": "var(--destructive-muted-foreground)",
|
|
426
|
-
"--error-border": "oklch(0.72 0.14 28)",
|
|
427
|
-
"--warning-bg": "var(--warning-muted)",
|
|
428
|
-
"--warning-text": "var(--warning-muted-foreground)",
|
|
429
|
-
"--warning-border": "oklch(0.76 0.12 82)",
|
|
430
|
-
"--info-bg": "var(--info-muted)",
|
|
431
|
-
"--info-text": "var(--info-muted-foreground)",
|
|
432
|
-
"--info-border": "oklch(0.72 0.1 224)",
|
|
433
|
-
"--loading-bg": "var(--primary-muted)",
|
|
434
|
-
"--loading-text": "var(--primary-muted-foreground)",
|
|
435
|
-
"--loading-border": "oklch(0.8 0.09 278)",
|
|
436
|
-
"--border-radius": "var(--radius)",
|
|
437
|
-
...a
|
|
472
|
+
...c.style,
|
|
473
|
+
...e
|
|
438
474
|
},
|
|
439
|
-
toastOptions: {
|
|
440
|
-
|
|
441
|
-
|
|
475
|
+
toastOptions: {
|
|
476
|
+
...n,
|
|
477
|
+
classNames: {
|
|
478
|
+
...n?.classNames,
|
|
479
|
+
closeButton: v("not-focus-visible:pointer-events-none not-focus-visible:opacity-0", n?.classNames?.closeButton)
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
...r
|
|
483
|
+
}), /* @__PURE__ */ u(fe, {})] });
|
|
442
484
|
};
|
|
443
485
|
//#endregion
|
|
444
486
|
//#region src/components/ui/label.tsx
|
|
445
487
|
function X({ className: e, ...t }) {
|
|
446
|
-
return /* @__PURE__ */
|
|
488
|
+
return /* @__PURE__ */ u(m.Root, {
|
|
447
489
|
"data-slot": "label",
|
|
448
490
|
className: v("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),
|
|
449
491
|
...t
|
|
@@ -451,36 +493,36 @@ function X({ className: e, ...t }) {
|
|
|
451
493
|
}
|
|
452
494
|
//#endregion
|
|
453
495
|
//#region src/components/ui/input.tsx
|
|
454
|
-
function Z({ className: e, type: t, error: n = !1, label:
|
|
455
|
-
let
|
|
456
|
-
return /* @__PURE__ */
|
|
496
|
+
function Z({ className: e, type: t, error: n = !1, label: i, helperText: a, startIcon: o, endIcon: s, appearance: c = "default", ...l }) {
|
|
497
|
+
let f = o ? r(o, { className: v("stroke-text-input-placeholder") }) : null, p = s ? r(s, { className: v("stroke-text-input-placeholder") }) : null;
|
|
498
|
+
return /* @__PURE__ */ d("div", {
|
|
457
499
|
className: "w-full flex flex-col gap-2 h-fit ",
|
|
458
500
|
children: [
|
|
459
|
-
!!
|
|
460
|
-
/* @__PURE__ */
|
|
501
|
+
!!i && /* @__PURE__ */ u(X, { children: i }),
|
|
502
|
+
/* @__PURE__ */ d("div", {
|
|
461
503
|
className: "w-full relative",
|
|
462
504
|
children: [
|
|
463
|
-
|
|
505
|
+
f && /* @__PURE__ */ u("div", {
|
|
464
506
|
className: "absolute left-3 top-1/2 -translate-y-1/2",
|
|
465
|
-
children:
|
|
507
|
+
children: f
|
|
466
508
|
}),
|
|
467
|
-
/* @__PURE__ */
|
|
509
|
+
/* @__PURE__ */ u("input", {
|
|
468
510
|
...l,
|
|
469
511
|
type: t,
|
|
470
512
|
"data-slot": "input",
|
|
471
513
|
"data-appearance": c,
|
|
472
514
|
"aria-invalid": n ? !0 : l["aria-invalid"],
|
|
473
|
-
className: v(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 ${
|
|
515
|
+
className: v(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 ${f ? "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), f && c === "themed" && "pl-10", !f && c === "themed" && "pl-3", p && c === "themed" && "pr-10", !p && c === "themed" && "pr-3", e)
|
|
474
516
|
}),
|
|
475
|
-
p && /* @__PURE__ */
|
|
517
|
+
p && /* @__PURE__ */ u("div", {
|
|
476
518
|
className: "absolute right-3 top-1/2 -translate-y-1/2",
|
|
477
519
|
children: p
|
|
478
520
|
})
|
|
479
521
|
]
|
|
480
522
|
}),
|
|
481
|
-
|
|
523
|
+
a && /* @__PURE__ */ u("p", {
|
|
482
524
|
className: `text-caption ${n ? "text-destructive" : "text-muted-foreground"}`,
|
|
483
|
-
children:
|
|
525
|
+
children: a
|
|
484
526
|
})
|
|
485
527
|
]
|
|
486
528
|
});
|
|
@@ -488,16 +530,16 @@ function Z({ className: e, type: t, error: n = !1, label: r, helperText: i, star
|
|
|
488
530
|
//#endregion
|
|
489
531
|
//#region src/components/ui/textarea.tsx
|
|
490
532
|
function Q({ className: e, error: t = !1, label: n, helperText: r, ...i }) {
|
|
491
|
-
return /* @__PURE__ */
|
|
533
|
+
return /* @__PURE__ */ d("div", {
|
|
492
534
|
className: "w-full flex flex-col gap-2",
|
|
493
535
|
children: [
|
|
494
|
-
n && /* @__PURE__ */
|
|
495
|
-
/* @__PURE__ */
|
|
536
|
+
n && /* @__PURE__ */ u(X, { children: n }),
|
|
537
|
+
/* @__PURE__ */ u("textarea", {
|
|
496
538
|
"data-slot": "textarea",
|
|
497
539
|
className: v("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),
|
|
498
540
|
...i
|
|
499
541
|
}),
|
|
500
|
-
r && /* @__PURE__ */
|
|
542
|
+
r && /* @__PURE__ */ u("p", {
|
|
501
543
|
className: `text-caption ${t ? "text-destructive" : "text-muted-foreground"}`,
|
|
502
544
|
children: r
|
|
503
545
|
})
|
|
@@ -506,15 +548,15 @@ function Q({ className: e, error: t = !1, label: n, helperText: r, ...i }) {
|
|
|
506
548
|
}
|
|
507
549
|
//#endregion
|
|
508
550
|
//#region src/components/ui/input-group.tsx
|
|
509
|
-
function
|
|
510
|
-
return /* @__PURE__ */
|
|
551
|
+
function he({ className: e, ...t }) {
|
|
552
|
+
return /* @__PURE__ */ u("div", {
|
|
511
553
|
"data-slot": "input-group",
|
|
512
554
|
role: "group",
|
|
513
555
|
className: v("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),
|
|
514
556
|
...t
|
|
515
557
|
});
|
|
516
558
|
}
|
|
517
|
-
var
|
|
559
|
+
var ge = f("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", {
|
|
518
560
|
variants: { align: {
|
|
519
561
|
"inline-start": "order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]",
|
|
520
562
|
"inline-end": "order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]",
|
|
@@ -524,18 +566,18 @@ var le = p("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 tex
|
|
|
524
566
|
defaultVariants: { align: "inline-start" }
|
|
525
567
|
});
|
|
526
568
|
function $({ className: e, align: t = "inline-start", ...n }) {
|
|
527
|
-
return /* @__PURE__ */
|
|
569
|
+
return /* @__PURE__ */ u("div", {
|
|
528
570
|
role: "group",
|
|
529
571
|
"data-slot": "input-group-addon",
|
|
530
572
|
"data-align": t,
|
|
531
|
-
className: v(
|
|
573
|
+
className: v(ge({ align: t }), e),
|
|
532
574
|
onClick: (e) => {
|
|
533
575
|
e.target.closest("button") || e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
534
576
|
},
|
|
535
577
|
...n
|
|
536
578
|
});
|
|
537
579
|
}
|
|
538
|
-
var
|
|
580
|
+
var _e = f("flex items-center gap-2 text-sm shadow-none", {
|
|
539
581
|
variants: { size: {
|
|
540
582
|
xs: "h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
|
|
541
583
|
sm: "",
|
|
@@ -544,34 +586,34 @@ var ue = p("flex items-center gap-2 text-sm shadow-none", {
|
|
|
544
586
|
} },
|
|
545
587
|
defaultVariants: { size: "xs" }
|
|
546
588
|
});
|
|
547
|
-
function
|
|
548
|
-
return /* @__PURE__ */
|
|
589
|
+
function ve({ className: e, type: t = "button", variant: n = "ghost", size: r = "xs", ...i }) {
|
|
590
|
+
return /* @__PURE__ */ u(x, {
|
|
549
591
|
type: t,
|
|
550
592
|
"data-size": r,
|
|
551
593
|
variant: n,
|
|
552
|
-
className: v(
|
|
594
|
+
className: v(_e({ size: r }), e),
|
|
553
595
|
...i
|
|
554
596
|
});
|
|
555
597
|
}
|
|
556
|
-
function
|
|
557
|
-
return /* @__PURE__ */
|
|
598
|
+
function ye({ className: e, ...t }) {
|
|
599
|
+
return /* @__PURE__ */ u("span", {
|
|
558
600
|
className: v("flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", e),
|
|
559
601
|
...t
|
|
560
602
|
});
|
|
561
603
|
}
|
|
562
|
-
function
|
|
563
|
-
return /* @__PURE__ */
|
|
604
|
+
function be({ className: e, ...t }) {
|
|
605
|
+
return /* @__PURE__ */ u(Z, {
|
|
564
606
|
"data-slot": "input-group-control",
|
|
565
607
|
className: v("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),
|
|
566
608
|
...t
|
|
567
609
|
});
|
|
568
610
|
}
|
|
569
|
-
function
|
|
570
|
-
return /* @__PURE__ */
|
|
611
|
+
function xe({ className: e, ...t }) {
|
|
612
|
+
return /* @__PURE__ */ u(Q, {
|
|
571
613
|
"data-slot": "input-group-control",
|
|
572
614
|
className: v("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),
|
|
573
615
|
...t
|
|
574
616
|
});
|
|
575
617
|
}
|
|
576
618
|
//#endregion
|
|
577
|
-
export {
|
|
619
|
+
export { k as A, v as B, le as C, E as D, ae as E, S as F, te as I, x as L, j as M, T as N, ne as O, C as P, b as R, ce as S, M as T, V as _, ye as a, ue as b, Z as c, _ as d, I as f, H as g, W as h, be as i, O as j, A as k, X as l, B as m, $ as n, xe as o, R as p, ve as r, Q as s, he as t, me as u, z as v, N as w, U as x, L as y, y as z };
|