@exegia/corpora-ui 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/components/agents/__tests__/ai-sidebar.test.d.ts +1 -0
- package/dist-lib/components/agents/ai-sidebar.d.ts +1 -1
- package/dist-lib/components/agents/index.d.ts +1 -0
- package/dist-lib/components/agents/sidebar-row.d.ts +1 -1
- package/dist-lib/components/agents/type.d.ts +7 -1
- package/dist-lib/components/blocks/shell/index.d.ts +2 -0
- package/dist-lib/index.d.ts +2 -1
- package/dist-lib/index.js +1365 -643
- package/dist-lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/agents/__tests__/ai-sidebar.test.tsx +93 -0
- package/src/components/agents/ai-sidebar.tsx +3 -1
- package/src/components/agents/index.ts +2 -1
- package/src/components/agents/sidebar-row.tsx +52 -14
- package/src/components/agents/type.ts +7 -1
- package/src/components/blocks/shell/index.ts +3 -1
- package/src/index.ts +4 -1
package/dist-lib/index.js
CHANGED
|
@@ -5,42 +5,42 @@ import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
|
5
5
|
import { mergeProps as o } from "@base-ui/react/merge-props";
|
|
6
6
|
import { useRender as s } from "@base-ui/react/use-render";
|
|
7
7
|
import { cva as c } from "class-variance-authority";
|
|
8
|
-
import { ArrowLeftIcon as l,
|
|
9
|
-
import * as
|
|
10
|
-
import { Children as
|
|
11
|
-
import { Checkbox as
|
|
12
|
-
import { bind as
|
|
13
|
-
import { Field as
|
|
8
|
+
import { ArrowLeftIcon as l, Bookmark as u, CheckIcon as d, ChevronRight as f, ChevronRightIcon as p, ChevronsUpDownIcon as m, EyeIcon as h, EyeOffIcon as g, FileText as _, FingerprintIcon as v, Folder as y, FolderOpen as b, KeyRoundIcon as x, Loader2Icon as S, LogOutIcon as C, MailIcon as w, MenuIcon as T, MoreHorizontal as E, PanelLeftIcon as D, PanelRightIcon as O, Pencil as k, SettingsIcon as A, SmartphoneIcon as j, UserIcon as M, UserPlusIcon as N, UsersIcon as ee, XIcon as te } from "lucide-react";
|
|
9
|
+
import * as P from "react";
|
|
10
|
+
import { Children as F, cloneElement as I, createContext as L, createElement as R, forwardRef as z, isValidElement as B, useCallback as V, useContext as ne, useEffect as H, useId as re, useLayoutEffect as ie, useMemo as ae, useRef as U, useState as W, useSyncExternalStore as oe } from "react";
|
|
11
|
+
import { Checkbox as se } from "@base-ui/react/checkbox";
|
|
12
|
+
import { bind as ce, play as le, play as ue, setEnabled as de, setVolume as fe, sounds as pe } from "cuelume";
|
|
13
|
+
import { Field as me, Field as he } from "@base-ui/react/field";
|
|
14
14
|
import { Input as ge } from "@base-ui/react/input";
|
|
15
|
-
import { Menu as
|
|
15
|
+
import { Menu as G } from "@base-ui/react/menu";
|
|
16
16
|
import { OTPField as _e } from "@base-ui/react/otp-field";
|
|
17
17
|
import { Separator as ve } from "@base-ui/react/separator";
|
|
18
|
-
import { AnimatePresence as
|
|
18
|
+
import { AnimatePresence as K, MotionConfig as ye, motion as q, useReducedMotion as be } from "motion/react";
|
|
19
19
|
import { RiAppleFill as xe, RiGithubFill as Se, RiGoogleFill as Ce, RiTwitterXFill as we } from "@remixicon/react";
|
|
20
20
|
import { createPortal as Te } from "react-dom";
|
|
21
21
|
//#region src/lib/utils.ts
|
|
22
|
-
function
|
|
22
|
+
function J(...e) {
|
|
23
23
|
return n(t(e));
|
|
24
24
|
}
|
|
25
25
|
//#endregion
|
|
26
26
|
//#region src/components/ui/avatar.tsx
|
|
27
27
|
function Ee({ className: t, ...n }) {
|
|
28
28
|
return /* @__PURE__ */ i(e.Root, {
|
|
29
|
-
className:
|
|
29
|
+
className: J("inline-flex size-8 shrink-0 select-none items-center justify-center overflow-hidden rounded-full bg-background align-middle font-medium text-xs", t),
|
|
30
30
|
"data-slot": "avatar",
|
|
31
31
|
...n
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
function De({ className: t, ...n }) {
|
|
35
35
|
return /* @__PURE__ */ i(e.Image, {
|
|
36
|
-
className:
|
|
36
|
+
className: J("size-full object-cover", t),
|
|
37
37
|
"data-slot": "avatar-image",
|
|
38
38
|
...n
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
function Oe({ className: t, ...n }) {
|
|
42
42
|
return /* @__PURE__ */ i(e.Fallback, {
|
|
43
|
-
className:
|
|
43
|
+
className: J("flex size-full items-center justify-center rounded-full bg-muted", t),
|
|
44
44
|
"data-slot": "avatar-fallback",
|
|
45
45
|
...n
|
|
46
46
|
});
|
|
@@ -48,9 +48,9 @@ function Oe({ className: t, ...n }) {
|
|
|
48
48
|
//#endregion
|
|
49
49
|
//#region src/components/ui/spinner.tsx
|
|
50
50
|
function ke({ className: e, ...t }) {
|
|
51
|
-
return /* @__PURE__ */ i(
|
|
51
|
+
return /* @__PURE__ */ i(S, {
|
|
52
52
|
"aria-label": "Loading",
|
|
53
|
-
className:
|
|
53
|
+
className: J("animate-spin", e),
|
|
54
54
|
role: "status",
|
|
55
55
|
...t
|
|
56
56
|
});
|
|
@@ -92,13 +92,13 @@ function Pe({ width: e, height: t, radius: n, bezel: r }) {
|
|
|
92
92
|
function Fe(e) {
|
|
93
93
|
return (1 - (1 - e) ** 4) ** .25;
|
|
94
94
|
}
|
|
95
|
-
var Ie =
|
|
96
|
-
let p =
|
|
95
|
+
var Ie = z(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: o = .34, saturation: s = 1.28, className: c, style: l, children: u, ...d }, f) {
|
|
96
|
+
let p = re(), m = ae(() => `liquid-glass-${p.replace(/:/g, "")}`, [p]);
|
|
97
97
|
console.log(n);
|
|
98
|
-
let h =
|
|
98
|
+
let h = U(null), g = V((e) => {
|
|
99
99
|
h.current = e, typeof f == "function" ? f(e) : f && (f.current = e);
|
|
100
|
-
}, [f]), [_, v] =
|
|
101
|
-
|
|
100
|
+
}, [f]), [_, v] = W(null);
|
|
101
|
+
H(() => {
|
|
102
102
|
let e = h.current;
|
|
103
103
|
if (!e) return;
|
|
104
104
|
let t = () => {
|
|
@@ -116,14 +116,14 @@ var Ie = M(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: o = .3
|
|
|
116
116
|
let n = new ResizeObserver(t);
|
|
117
117
|
return n.observe(e), () => n.disconnect();
|
|
118
118
|
}, [o]);
|
|
119
|
-
let y = ae(() => _ ? Pe(_) : "", [_]), [b, x] =
|
|
120
|
-
|
|
119
|
+
let y = ae(() => _ ? Pe(_) : "", [_]), [b, x] = W(!1);
|
|
120
|
+
H(() => {
|
|
121
121
|
x(Ne());
|
|
122
122
|
}, []);
|
|
123
123
|
let S = b && y !== "", C = S ? `url(#${m}) blur(${e}px) saturate(${s})` : `blur(${e + 2}px) saturate(${s})`;
|
|
124
124
|
return /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ a("div", {
|
|
125
125
|
ref: g,
|
|
126
|
-
className:
|
|
126
|
+
className: J("relative overflow-hidden rounded-full bg-white/[0.08]", c),
|
|
127
127
|
style: {
|
|
128
128
|
...l,
|
|
129
129
|
backdropFilter: C,
|
|
@@ -251,7 +251,7 @@ var Ie = M(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: o = .3
|
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
});
|
|
254
|
-
function
|
|
254
|
+
function Y({ className: e, variant: t, size: n, render: c, children: l, loading: u = !1, disabled: d, glassVariant: f, sound: p = !0, ...m }) {
|
|
255
255
|
let h = !!(u || d), g = c ? void 0 : "button", _ = t === "glass" ? f ?? "liquid-refract" : void 0, v = _ === "liquid-refract", y = (n ?? "default").startsWith("icon"), b = s({
|
|
256
256
|
defaultTagName: "button",
|
|
257
257
|
props: o({
|
|
@@ -259,7 +259,7 @@ function H({ className: e, variant: t, size: n, render: c, children: l, loading:
|
|
|
259
259
|
!y && /* @__PURE__ */ i("span", {
|
|
260
260
|
"aria-hidden": !u || void 0,
|
|
261
261
|
"data-slot": "button-loading-indicator",
|
|
262
|
-
className:
|
|
262
|
+
className: J("pointer-events-none inline-flex shrink-0 items-center overflow-hidden transition-[max-width,margin-inline-start,opacity,filter] duration-300 ease-smooth-out motion-reduce:transition-none", u ? "max-w-6" : J("max-w-0 opacity-0 blur-[2px]", n === "xs" ? "-ms-1" : n === "sm" ? "-ms-1.5" : "-ms-2")),
|
|
263
263
|
children: /* @__PURE__ */ i(ke, { className: u ? void 0 : "animate-none" })
|
|
264
264
|
}),
|
|
265
265
|
l,
|
|
@@ -268,7 +268,7 @@ function H({ className: e, variant: t, size: n, render: c, children: l, loading:
|
|
|
268
268
|
"data-slot": "button-loading-indicator"
|
|
269
269
|
})
|
|
270
270
|
] }),
|
|
271
|
-
className:
|
|
271
|
+
className: J(Re({
|
|
272
272
|
size: n,
|
|
273
273
|
variant: t
|
|
274
274
|
}), !y && "hover:[&_svg:not([class*='animate-'])]:scale-110 motion-reduce:hover:[&_svg]:scale-100", u && y && "data-loading:text-transparent", _ && Le[_], v && "bg-transparent border-0 shadow-none", e),
|
|
@@ -291,7 +291,7 @@ function ze({ className: e, render: t, ...n }) {
|
|
|
291
291
|
return s({
|
|
292
292
|
defaultTagName: "div",
|
|
293
293
|
props: o({
|
|
294
|
-
className:
|
|
294
|
+
className: J("relative flex flex-col rounded-2xl border bg-card not-dark:bg-clip-padding text-card-foreground shadow-xs/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]", e),
|
|
295
295
|
"data-slot": "card"
|
|
296
296
|
}, n),
|
|
297
297
|
render: t
|
|
@@ -301,7 +301,7 @@ function Be({ className: e, render: t, ...n }) {
|
|
|
301
301
|
return s({
|
|
302
302
|
defaultTagName: "div",
|
|
303
303
|
props: o({
|
|
304
|
-
className:
|
|
304
|
+
className: J("relative flex flex-col rounded-2xl border bg-card not-dark:bg-clip-padding text-card-foreground shadow-xs/5 [--clip-bottom:-1rem] [--clip-top:-1rem] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:bg-muted/72 before:shadow-[0_1px_--theme(--color-black/4%)] has-data-[slot=table-container]:overflow-hidden *:data-[slot=card]:-m-px *:data-[slot=table-container]:-m-px *:data-[slot=table-container]:w-[calc(100%+2px)] *:not-first:data-[slot=card]:rounded-t-xl *:not-last:data-[slot=card]:rounded-b-xl *:data-[slot=card]:bg-clip-padding *:data-[slot=card]:shadow-none *:data-[slot=card]:before:hidden *:not-first:data-[slot=card]:before:rounded-t-[calc(var(--radius-xl)-1px)] *:not-last:data-[slot=card]:before:rounded-b-[calc(var(--radius-xl)-1px)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)] *:data-[slot=card]:[clip-path:inset(var(--clip-top)_1px_var(--clip-bottom)_1px_round_calc(var(--radius-2xl)-1px))] *:data-[slot=card]:last:[--clip-bottom:1px] *:data-[slot=card]:first:[--clip-top:1px]", e),
|
|
305
305
|
"data-slot": "card-frame"
|
|
306
306
|
}, n),
|
|
307
307
|
render: t
|
|
@@ -311,7 +311,7 @@ function Ve({ className: e, render: t, ...n }) {
|
|
|
311
311
|
return s({
|
|
312
312
|
defaultTagName: "div",
|
|
313
313
|
props: o({
|
|
314
|
-
className:
|
|
314
|
+
className: J("relative flex grid auto-rows-min grid-rows-[auto_auto] flex-col items-start gap-x-4 px-6 py-4 has-data-[slot=card-frame-action]:grid-cols-[1fr_auto]", e),
|
|
315
315
|
"data-slot": "card-frame-header"
|
|
316
316
|
}, n),
|
|
317
317
|
render: t
|
|
@@ -321,7 +321,7 @@ function He({ className: e, render: t, ...n }) {
|
|
|
321
321
|
return s({
|
|
322
322
|
defaultTagName: "div",
|
|
323
323
|
props: o({
|
|
324
|
-
className:
|
|
324
|
+
className: J("self-center font-semibold text-sm", e),
|
|
325
325
|
"data-slot": "card-frame-title"
|
|
326
326
|
}, n),
|
|
327
327
|
render: t
|
|
@@ -331,7 +331,7 @@ function Ue({ className: e, render: t, ...n }) {
|
|
|
331
331
|
return s({
|
|
332
332
|
defaultTagName: "div",
|
|
333
333
|
props: o({
|
|
334
|
-
className:
|
|
334
|
+
className: J("self-center text-muted-foreground text-sm", e),
|
|
335
335
|
"data-slot": "card-frame-description"
|
|
336
336
|
}, n),
|
|
337
337
|
render: t
|
|
@@ -341,7 +341,7 @@ function We({ className: e, render: t, ...n }) {
|
|
|
341
341
|
return s({
|
|
342
342
|
defaultTagName: "div",
|
|
343
343
|
props: o({
|
|
344
|
-
className:
|
|
344
|
+
className: J("col-start-2 nth-3:row-span-2 nth-3:row-start-1 inline-flex self-center justify-self-end", e),
|
|
345
345
|
"data-slot": "card-frame-action"
|
|
346
346
|
}, n),
|
|
347
347
|
render: t
|
|
@@ -351,7 +351,7 @@ function Ge({ className: e, render: t, ...n }) {
|
|
|
351
351
|
return s({
|
|
352
352
|
defaultTagName: "div",
|
|
353
353
|
props: o({
|
|
354
|
-
className:
|
|
354
|
+
className: J("px-6 py-4", e),
|
|
355
355
|
"data-slot": "card-frame-footer"
|
|
356
356
|
}, n),
|
|
357
357
|
render: t
|
|
@@ -361,7 +361,7 @@ function Ke({ className: e, render: t, ...n }) {
|
|
|
361
361
|
return s({
|
|
362
362
|
defaultTagName: "div",
|
|
363
363
|
props: o({
|
|
364
|
-
className:
|
|
364
|
+
className: J("grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 p-6 in-[[data-slot=card]:has(>[data-slot=card-panel])]:pb-4 has-data-[slot=card-action]:grid-cols-[1fr_auto]", e),
|
|
365
365
|
"data-slot": "card-header"
|
|
366
366
|
}, n),
|
|
367
367
|
render: t
|
|
@@ -371,7 +371,7 @@ function qe({ className: e, render: t, ...n }) {
|
|
|
371
371
|
return s({
|
|
372
372
|
defaultTagName: "div",
|
|
373
373
|
props: o({
|
|
374
|
-
className:
|
|
374
|
+
className: J("font-heading font-semibold text-lg leading-none", e),
|
|
375
375
|
"data-slot": "card-title"
|
|
376
376
|
}, n),
|
|
377
377
|
render: t
|
|
@@ -381,7 +381,7 @@ function Je({ className: e, render: t, ...n }) {
|
|
|
381
381
|
return s({
|
|
382
382
|
defaultTagName: "div",
|
|
383
383
|
props: o({
|
|
384
|
-
className:
|
|
384
|
+
className: J("text-muted-foreground text-sm", e),
|
|
385
385
|
"data-slot": "card-description"
|
|
386
386
|
}, n),
|
|
387
387
|
render: t
|
|
@@ -391,7 +391,7 @@ function Ye({ className: e, render: t, ...n }) {
|
|
|
391
391
|
return s({
|
|
392
392
|
defaultTagName: "div",
|
|
393
393
|
props: o({
|
|
394
|
-
className:
|
|
394
|
+
className: J("col-start-2 row-span-2 row-start-1 inline-flex self-start justify-self-end", e),
|
|
395
395
|
"data-slot": "card-action"
|
|
396
396
|
}, n),
|
|
397
397
|
render: t
|
|
@@ -401,7 +401,7 @@ function Xe({ className: e, render: t, ...n }) {
|
|
|
401
401
|
return s({
|
|
402
402
|
defaultTagName: "div",
|
|
403
403
|
props: o({
|
|
404
|
-
className:
|
|
404
|
+
className: J("flex-1 p-6 in-[[data-slot=card]:has(>[data-slot=card-header]:not(.border-b))]:pt-0 in-[[data-slot=card]:has(>[data-slot=card-footer]:not(.border-t))]:pb-0", e),
|
|
405
405
|
"data-slot": "card-panel"
|
|
406
406
|
}, n),
|
|
407
407
|
render: t
|
|
@@ -411,7 +411,7 @@ function Ze({ className: e, render: t, ...n }) {
|
|
|
411
411
|
return s({
|
|
412
412
|
defaultTagName: "div",
|
|
413
413
|
props: o({
|
|
414
|
-
className:
|
|
414
|
+
className: J("flex items-center p-6 in-[[data-slot=card]:has(>[data-slot=card-panel])]:pt-4", e),
|
|
415
415
|
"data-slot": "card-footer"
|
|
416
416
|
}, n),
|
|
417
417
|
render: t
|
|
@@ -421,22 +421,22 @@ function Ze({ className: e, render: t, ...n }) {
|
|
|
421
421
|
//#region src/lib/sound.ts
|
|
422
422
|
var Qe = !1;
|
|
423
423
|
function $e(e) {
|
|
424
|
-
Qe = !0,
|
|
424
|
+
Qe = !0, ce(e);
|
|
425
425
|
}
|
|
426
426
|
function et(e, t) {
|
|
427
|
-
Qe &&
|
|
427
|
+
Qe && le(e, t);
|
|
428
428
|
}
|
|
429
429
|
//#endregion
|
|
430
430
|
//#region src/components/ui/checkbox.tsx
|
|
431
431
|
function tt({ className: e, sound: t = !0, onCheckedChange: n, ...r }) {
|
|
432
|
-
return /* @__PURE__ */ i(
|
|
432
|
+
return /* @__PURE__ */ i(se.Root, {
|
|
433
433
|
onCheckedChange: (e, r) => {
|
|
434
434
|
t && et("toggle"), n?.(e, r);
|
|
435
435
|
},
|
|
436
|
-
className:
|
|
436
|
+
className: J("relative inline-flex size-4.5 shrink-0 cursor-pointer items-center justify-center rounded-[.25rem] border border-input bg-background not-dark:bg-clip-padding shadow-xs/5 outline-none ring-ring transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[3px] not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-background aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/48 data-disabled:cursor-not-allowed data-disabled:opacity-64 sm:size-4 dark:not-data-checked:bg-input/32 dark:aria-invalid:ring-destructive/24 dark:not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)] [[data-disabled],[data-checked],[aria-invalid]]:shadow-none", e),
|
|
437
437
|
"data-slot": "checkbox",
|
|
438
438
|
...r,
|
|
439
|
-
children: /* @__PURE__ */ i(
|
|
439
|
+
children: /* @__PURE__ */ i(se.Indicator, {
|
|
440
440
|
className: "absolute -inset-px flex items-center justify-center rounded-[.25rem] text-primary-foreground data-unchecked:hidden data-checked:bg-primary data-indeterminate:text-foreground",
|
|
441
441
|
"data-slot": "checkbox-indicator",
|
|
442
442
|
render: (e, t) => /* @__PURE__ */ i("span", {
|
|
@@ -474,92 +474,92 @@ function tt({ className: e, sound: t = !0, onCheckedChange: n, ...r }) {
|
|
|
474
474
|
}
|
|
475
475
|
//#endregion
|
|
476
476
|
//#region src/components/ui/field.tsx
|
|
477
|
-
function
|
|
478
|
-
return /* @__PURE__ */ i(
|
|
479
|
-
className:
|
|
477
|
+
function X({ className: e, ...t }) {
|
|
478
|
+
return /* @__PURE__ */ i(he.Root, {
|
|
479
|
+
className: J("flex flex-col items-start gap-2", e),
|
|
480
480
|
"data-slot": "field",
|
|
481
481
|
...t
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
|
-
function
|
|
485
|
-
return /* @__PURE__ */ i(
|
|
486
|
-
className:
|
|
484
|
+
function Z({ className: e, ...t }) {
|
|
485
|
+
return /* @__PURE__ */ i(he.Label, {
|
|
486
|
+
className: J("inline-flex cursor-pointer items-center gap-2 font-medium text-base/4 text-foreground data-disabled:cursor-not-allowed data-disabled:opacity-64 sm:text-xs/3.5 ml-3", e),
|
|
487
487
|
"data-slot": "field-label",
|
|
488
488
|
...t
|
|
489
489
|
});
|
|
490
490
|
}
|
|
491
491
|
function nt({ className: e, ...t }) {
|
|
492
|
-
return /* @__PURE__ */ i(
|
|
493
|
-
className:
|
|
492
|
+
return /* @__PURE__ */ i(he.Item, {
|
|
493
|
+
className: J("flex", e),
|
|
494
494
|
"data-slot": "field-item",
|
|
495
495
|
...t
|
|
496
496
|
});
|
|
497
497
|
}
|
|
498
498
|
function rt({ className: e, ...t }) {
|
|
499
|
-
return /* @__PURE__ */ i(
|
|
500
|
-
className:
|
|
499
|
+
return /* @__PURE__ */ i(he.Description, {
|
|
500
|
+
className: J("overflow-hidden text-muted-foreground text-xs transition-[height,opacity,filter,translate] duration-300 ease-smooth-out starting:h-0 starting:translate-y-1 starting:opacity-0 starting:blur-[2px] motion-reduce:transition-none", e),
|
|
501
501
|
"data-slot": "field-description",
|
|
502
502
|
...t
|
|
503
503
|
});
|
|
504
504
|
}
|
|
505
505
|
function it({ className: e, ...t }) {
|
|
506
|
-
return /* @__PURE__ */ i(
|
|
507
|
-
className:
|
|
506
|
+
return /* @__PURE__ */ i(he.Error, {
|
|
507
|
+
className: J("overflow-hidden text-destructive-foreground text-xs transition-[height,opacity,filter,translate] duration-300 ease-smooth-out starting:h-0 starting:translate-y-1 starting:opacity-0 starting:blur-[2px] motion-reduce:transition-none", e),
|
|
508
508
|
"data-slot": "field-error",
|
|
509
509
|
...t
|
|
510
510
|
});
|
|
511
511
|
}
|
|
512
|
-
var at =
|
|
512
|
+
var at = he.Control, ot = he.Validity;
|
|
513
513
|
//#endregion
|
|
514
514
|
//#region src/components/ui/frame.tsx
|
|
515
515
|
function st({ className: e, ...t }) {
|
|
516
516
|
return /* @__PURE__ */ i("div", {
|
|
517
|
-
className:
|
|
517
|
+
className: J("relative flex flex-col rounded-2xl bg-muted/72 p-1", "*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-1", e),
|
|
518
518
|
"data-slot": "frame",
|
|
519
519
|
...t
|
|
520
520
|
});
|
|
521
521
|
}
|
|
522
522
|
function ct({ className: e, ...t }) {
|
|
523
523
|
return /* @__PURE__ */ i("div", {
|
|
524
|
-
className:
|
|
524
|
+
className: J("relative rounded-xl border bg-background bg-clip-padding p-5 shadow-xs/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]", e),
|
|
525
525
|
"data-slot": "frame-panel",
|
|
526
526
|
...t
|
|
527
527
|
});
|
|
528
528
|
}
|
|
529
529
|
function lt({ className: e, ...t }) {
|
|
530
530
|
return /* @__PURE__ */ i("header", {
|
|
531
|
-
className:
|
|
531
|
+
className: J("flex flex-col px-5 py-4", e),
|
|
532
532
|
"data-slot": "frame-panel-header",
|
|
533
533
|
...t
|
|
534
534
|
});
|
|
535
535
|
}
|
|
536
536
|
function ut({ className: e, ...t }) {
|
|
537
537
|
return /* @__PURE__ */ i("div", {
|
|
538
|
-
className:
|
|
538
|
+
className: J("font-semibold text-sm", e),
|
|
539
539
|
"data-slot": "frame-panel-title",
|
|
540
540
|
...t
|
|
541
541
|
});
|
|
542
542
|
}
|
|
543
543
|
function dt({ className: e, ...t }) {
|
|
544
544
|
return /* @__PURE__ */ i("div", {
|
|
545
|
-
className:
|
|
545
|
+
className: J("text-muted-foreground text-sm", e),
|
|
546
546
|
"data-slot": "frame-panel-description",
|
|
547
547
|
...t
|
|
548
548
|
});
|
|
549
549
|
}
|
|
550
550
|
function ft({ className: e, ...t }) {
|
|
551
551
|
return /* @__PURE__ */ i("footer", {
|
|
552
|
-
className:
|
|
552
|
+
className: J("px-5 py-4", e),
|
|
553
553
|
"data-slot": "frame-panel-footer",
|
|
554
554
|
...t
|
|
555
555
|
});
|
|
556
556
|
}
|
|
557
557
|
//#endregion
|
|
558
558
|
//#region src/components/ui/input.tsx
|
|
559
|
-
function
|
|
560
|
-
let s =
|
|
559
|
+
function pt({ className: e, size: t = "default", unstyled: n = !1, nativeInput: r = !1, style: a, ...o }) {
|
|
560
|
+
let s = J("h-8.5 w-full min-w-0 rounded-[inherit] px-[calc(--spacing(3)-1px)] leading-8.5 outline-none [transition:background-color_5000000s_ease-in-out_0s,height_300ms_var(--ease-smooth-out),line-height_300ms_var(--ease-smooth-out),padding_300ms_var(--ease-smooth-out),font-size_300ms_var(--ease-smooth-out)] placeholder:text-muted-foreground/72 motion-reduce:[transition:background-color_5000000s_ease-in-out_0s] sm:h-7.5 sm:leading-7.5", t === "sm" && "h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5", t === "lg" && "h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5", o.type === "search" && "[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none", o.type === "file" && "text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm");
|
|
561
561
|
return /* @__PURE__ */ i("span", {
|
|
562
|
-
className:
|
|
562
|
+
className: J(!n && "relative inline-flex w-full rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-[box-shadow,border-color] duration-150 ease-smooth-out has-aria-invalid:animate-input-shake motion-reduce:animate-none motion-reduce:transition-none before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring has-autofill:bg-foreground/4 has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none has-focus-visible:ring-[3px] sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]", e) || void 0,
|
|
563
563
|
"data-size": t,
|
|
564
564
|
"data-slot": "input-control",
|
|
565
565
|
children: r ? /* @__PURE__ */ i("input", {
|
|
@@ -579,12 +579,12 @@ function G({ className: e, size: t = "default", unstyled: n = !1, nativeInput: r
|
|
|
579
579
|
}
|
|
580
580
|
//#endregion
|
|
581
581
|
//#region src/components/ui/textarea.tsx
|
|
582
|
-
function
|
|
582
|
+
function mt({ className: e, size: t = "default", unstyled: n = !1, ref: r, ...a }) {
|
|
583
583
|
return /* @__PURE__ */ i("span", {
|
|
584
|
-
className:
|
|
584
|
+
className: J(!n && "relative inline-flex w-full rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none has-focus-visible:ring-[3px] not-has-disabled:has-not-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] sm:text-sm dark:bg-input/32 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:has-not-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]", e) || void 0,
|
|
585
585
|
"data-size": t,
|
|
586
586
|
"data-slot": "textarea-control",
|
|
587
|
-
children: /* @__PURE__ */ i(
|
|
587
|
+
children: /* @__PURE__ */ i(me.Control, {
|
|
588
588
|
ref: r,
|
|
589
589
|
value: a.value,
|
|
590
590
|
defaultValue: a.defaultValue,
|
|
@@ -592,7 +592,7 @@ function pt({ className: e, size: t = "default", unstyled: n = !1, ref: r, ...a
|
|
|
592
592
|
id: a.id,
|
|
593
593
|
name: a.name,
|
|
594
594
|
render: (e) => /* @__PURE__ */ i("textarea", {
|
|
595
|
-
className:
|
|
595
|
+
className: J("field-sizing-content min-h-17.5 w-full rounded-[inherit] px-[calc(--spacing(3)-1px)] py-[calc(--spacing(1.5)-1px)] outline-none max-sm:min-h-20.5", t === "sm" && "min-h-16.5 px-[calc(--spacing(2.5)-1px)] py-[calc(--spacing(1)-1px)] max-sm:min-h-19.5", t === "lg" && "min-h-18.5 py-[calc(--spacing(2)-1px)] max-sm:min-h-21.5"),
|
|
596
596
|
"data-slot": "textarea",
|
|
597
597
|
...o(e, a)
|
|
598
598
|
})
|
|
@@ -601,7 +601,7 @@ function pt({ className: e, size: t = "default", unstyled: n = !1, ref: r, ...a
|
|
|
601
601
|
}
|
|
602
602
|
//#endregion
|
|
603
603
|
//#region src/components/ui/input-group.tsx
|
|
604
|
-
var
|
|
604
|
+
var ht = c("flex h-auto cursor-text select-none items-center justify-center gap-2 leading-none [&>kbd]:rounded-[calc(var(--radius)-5px)] in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 [&_svg]:-mx-0.5 not-has-[button]:**:[svg:not([class*='opacity-'])]:opacity-80", {
|
|
605
605
|
defaultVariants: { align: "inline-start" },
|
|
606
606
|
variants: { align: {
|
|
607
607
|
"block-end": "order-last w-full justify-start px-[calc(--spacing(3)-1px)] pb-[calc(--spacing(3)-1px)] [.border-t]:pt-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]",
|
|
@@ -610,17 +610,17 @@ var mt = c("flex h-auto cursor-text select-none items-center justify-center gap-
|
|
|
610
610
|
"inline-start": "order-first ps-[calc(--spacing(3)-1px)] has-[>:last-child[data-slot=badge]]:-ms-1.5 has-[>button]:-ms-2 has-[>kbd:last-child]:ms-[-0.35rem] [[data-size=sm]+&]:ps-[calc(--spacing(2.5)-1px)]"
|
|
611
611
|
} }
|
|
612
612
|
});
|
|
613
|
-
function
|
|
613
|
+
function gt({ className: e, ...t }) {
|
|
614
614
|
return /* @__PURE__ */ i("div", {
|
|
615
|
-
className:
|
|
615
|
+
className: J("relative inline-flex w-full min-w-0 items-center rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_1px_--theme(--color-black/4%)] has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/64 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/16 has-[textarea]:h-auto has-data-[align=block-end]:h-auto has-data-[align=block-start]:h-auto has-data-[align=block-end]:flex-col has-data-[align=block-start]:flex-col has-[input:focus-visible,textarea:focus-visible]:border-ring has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/36 has-autofill:bg-foreground/4 has-[input:disabled,textarea:disabled]:opacity-64 has-[input:disabled,textarea:disabled,input:focus-visible,textarea:focus-visible,input[aria-invalid],textarea[aria-invalid]]:shadow-none has-[input:focus-visible,textarea:focus-visible]:ring-[3px] sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/24 dark:not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_-1px_--theme(--color-white/6%)] has-data-[align=inline-start]:**:[[data-size=sm]_input]:ps-1.5 has-data-[align=inline-end]:**:[[data-size=sm]_input]:pe-1.5 *:[[data-slot=input-control],[data-slot=textarea-control]]:contents *:[[data-slot=input-control],[data-slot=textarea-control]]:before:hidden has-[[data-align=block-start],[data-align=block-end]]:**:[input]:h-auto has-data-[align=inline-start]:**:[input]:ps-2 has-data-[align=inline-end]:**:[input]:pe-2 has-data-[align=block-end]:**:[input]:pt-1.5 has-data-[align=block-start]:**:[input]:pb-1.5 **:[textarea]:min-h-20.5 **:[textarea]:resize-none **:[textarea]:py-[calc(--spacing(3)-1px)] **:[textarea]:max-sm:min-h-23.5 **:[textarea_button]:rounded-[calc(var(--radius-md)-1px)]", e),
|
|
616
616
|
"data-slot": "input-group",
|
|
617
617
|
role: "group",
|
|
618
618
|
...t
|
|
619
619
|
});
|
|
620
620
|
}
|
|
621
|
-
function
|
|
621
|
+
function _t({ className: e, align: t = "inline-start", ...n }) {
|
|
622
622
|
return /* @__PURE__ */ i("div", {
|
|
623
|
-
className:
|
|
623
|
+
className: J(ht({ align: t }), e),
|
|
624
624
|
"data-align": t,
|
|
625
625
|
"data-slot": "input-group-addon",
|
|
626
626
|
onMouseDown: (e) => {
|
|
@@ -632,21 +632,21 @@ function gt({ className: e, align: t = "inline-start", ...n }) {
|
|
|
632
632
|
...n
|
|
633
633
|
});
|
|
634
634
|
}
|
|
635
|
-
function
|
|
635
|
+
function vt({ className: e, ...t }) {
|
|
636
636
|
return /* @__PURE__ */ i("span", {
|
|
637
|
-
className:
|
|
637
|
+
className: J("line-clamp-1 flex items-center gap-2 whitespace-nowrap text-muted-foreground leading-none in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:-mx-0.5", e),
|
|
638
638
|
...t
|
|
639
639
|
});
|
|
640
640
|
}
|
|
641
|
-
function
|
|
642
|
-
return /* @__PURE__ */ i(
|
|
641
|
+
function yt({ className: e, ...t }) {
|
|
642
|
+
return /* @__PURE__ */ i(pt, {
|
|
643
643
|
className: e,
|
|
644
644
|
unstyled: !0,
|
|
645
645
|
...t
|
|
646
646
|
});
|
|
647
647
|
}
|
|
648
|
-
function
|
|
649
|
-
return /* @__PURE__ */ i(
|
|
648
|
+
function bt({ className: e, ...t }) {
|
|
649
|
+
return /* @__PURE__ */ i(mt, {
|
|
650
650
|
className: e,
|
|
651
651
|
unstyled: !0,
|
|
652
652
|
...t
|
|
@@ -654,11 +654,11 @@ function yt({ className: e, ...t }) {
|
|
|
654
654
|
}
|
|
655
655
|
//#endregion
|
|
656
656
|
//#region src/components/ui/label.tsx
|
|
657
|
-
function
|
|
657
|
+
function xt({ className: e, render: t, sound: n = !1, ...r }) {
|
|
658
658
|
return s({
|
|
659
659
|
defaultTagName: "label",
|
|
660
660
|
props: o({
|
|
661
|
-
className:
|
|
661
|
+
className: J("inline-flex cursor-pointer items-center gap-2 font-medium text-base/4.5 text-foreground sm:text-sm/4", e),
|
|
662
662
|
"data-cuelume-hover": n ? "tick" : void 0,
|
|
663
663
|
"data-slot": "label"
|
|
664
664
|
}, r),
|
|
@@ -667,19 +667,19 @@ function bt({ className: e, render: t, sound: n = !1, ...r }) {
|
|
|
667
667
|
}
|
|
668
668
|
//#endregion
|
|
669
669
|
//#region src/components/ui/menu.tsx
|
|
670
|
-
var
|
|
671
|
-
function
|
|
672
|
-
return /* @__PURE__ */ i(
|
|
670
|
+
var St = G.createHandle, Ct = G.Root, wt = G.Portal;
|
|
671
|
+
function Tt({ className: e, children: t, ...n }) {
|
|
672
|
+
return /* @__PURE__ */ i(G.Trigger, {
|
|
673
673
|
className: e,
|
|
674
674
|
"data-slot": "menu-trigger",
|
|
675
675
|
...n,
|
|
676
676
|
children: t
|
|
677
677
|
});
|
|
678
678
|
}
|
|
679
|
-
function
|
|
680
|
-
return /* @__PURE__ */ i(
|
|
679
|
+
function Et({ children: e, className: t, sideOffset: n = 4, align: r = "center", alignOffset: a, side: o = "bottom", anchor: s, portalProps: c, ...l }) {
|
|
680
|
+
return /* @__PURE__ */ i(wt, {
|
|
681
681
|
...c,
|
|
682
|
-
children: /* @__PURE__ */ i(
|
|
682
|
+
children: /* @__PURE__ */ i(G.Positioner, {
|
|
683
683
|
align: r,
|
|
684
684
|
alignOffset: a,
|
|
685
685
|
anchor: s,
|
|
@@ -687,8 +687,8 @@ function Tt({ children: e, className: t, sideOffset: n = 4, align: r = "center",
|
|
|
687
687
|
"data-slot": "menu-positioner",
|
|
688
688
|
side: o,
|
|
689
689
|
sideOffset: n,
|
|
690
|
-
children: /* @__PURE__ */ i(
|
|
691
|
-
className:
|
|
690
|
+
children: /* @__PURE__ */ i(G.Popup, {
|
|
691
|
+
className: J("relative flex not-[class*='w-']:min-w-32 origin-(--transform-origin) rounded-lg border bg-popover not-dark:bg-clip-padding shadow-lg/5 outline-none before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] focus:outline-none dark:before:shadow-[0_-1px_--theme(--color-white/6%)]", t),
|
|
692
692
|
"data-slot": "menu-popup",
|
|
693
693
|
...l,
|
|
694
694
|
children: /* @__PURE__ */ i("div", {
|
|
@@ -699,24 +699,24 @@ function Tt({ children: e, className: t, sideOffset: n = 4, align: r = "center",
|
|
|
699
699
|
})
|
|
700
700
|
});
|
|
701
701
|
}
|
|
702
|
-
function
|
|
703
|
-
return /* @__PURE__ */ i(
|
|
702
|
+
function Dt(e) {
|
|
703
|
+
return /* @__PURE__ */ i(G.Group, {
|
|
704
704
|
"data-slot": "menu-group",
|
|
705
705
|
...e
|
|
706
706
|
});
|
|
707
707
|
}
|
|
708
|
-
function
|
|
709
|
-
return /* @__PURE__ */ i(
|
|
710
|
-
className:
|
|
708
|
+
function Ot({ className: e, inset: t, variant: n = "default", ...r }) {
|
|
709
|
+
return /* @__PURE__ */ i(G.Item, {
|
|
710
|
+
className: J("flex min-h-8 cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-base text-foreground outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-inset:ps-8 data-[variant=destructive]:text-destructive-foreground data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&>svg:not([class*='opacity-'])]:opacity-80 [&>svg:not([class*='size-'])]:size-4.5 sm:[&>svg:not([class*='size-'])]:size-4 [&>svg]:pointer-events-none [&>svg]:-mx-0.5 [&>svg]:shrink-0", e),
|
|
711
711
|
"data-inset": t,
|
|
712
712
|
"data-slot": "menu-item",
|
|
713
713
|
"data-variant": n,
|
|
714
714
|
...r
|
|
715
715
|
});
|
|
716
716
|
}
|
|
717
|
-
function
|
|
718
|
-
return /* @__PURE__ */ i(
|
|
719
|
-
className:
|
|
717
|
+
function kt({ className: e, inset: t, variant: n = "default", closeOnClick: r = !0, ...a }) {
|
|
718
|
+
return /* @__PURE__ */ i(G.LinkItem, {
|
|
719
|
+
className: J("flex min-h-8 cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-base text-foreground outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-inset:ps-8 data-[variant=destructive]:text-destructive-foreground data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&>svg:not([class*='opacity-'])]:opacity-80 [&>svg:not([class*='size-'])]:size-4.5 sm:[&>svg:not([class*='size-'])]:size-4 [&>svg]:pointer-events-none [&>svg]:-mx-0.5 [&>svg]:shrink-0", e),
|
|
720
720
|
closeOnClick: r,
|
|
721
721
|
"data-inset": t,
|
|
722
722
|
"data-slot": "menu-link-item",
|
|
@@ -724,20 +724,20 @@ function Ot({ className: e, inset: t, variant: n = "default", closeOnClick: r =
|
|
|
724
724
|
...a
|
|
725
725
|
});
|
|
726
726
|
}
|
|
727
|
-
function
|
|
728
|
-
return /* @__PURE__ */ i(
|
|
727
|
+
function At({ className: e, children: t, checked: n, variant: o = "default", ...s }) {
|
|
728
|
+
return /* @__PURE__ */ i(G.CheckboxItem, {
|
|
729
729
|
checked: n,
|
|
730
|
-
className:
|
|
730
|
+
className: J("grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default items-center gap-2 rounded-sm py-1 ps-2 text-base text-foreground outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", o === "switch" ? "grid-cols-[1fr_auto] gap-4 pe-1.5" : "grid-cols-[.75rem_1fr] pe-4", e),
|
|
731
731
|
"data-slot": "menu-checkbox-item",
|
|
732
732
|
...s,
|
|
733
733
|
children: o === "switch" ? /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i("span", {
|
|
734
734
|
className: "col-start-1",
|
|
735
735
|
children: t
|
|
736
|
-
}), /* @__PURE__ */ i(
|
|
736
|
+
}), /* @__PURE__ */ i(G.CheckboxItemIndicator, {
|
|
737
737
|
className: "inset-shadow-[0_1px_--theme(--color-black/4%)] inline-flex h-[calc(var(--thumb-size)+2px)] w-[calc(var(--thumb-size)*2-2px)] shrink-0 items-center rounded-full p-px outline-none transition-[background-color,box-shadow] duration-200 [--thumb-size:--spacing(4)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:opacity-64 sm:[--thumb-size:--spacing(3)]",
|
|
738
738
|
keepMounted: !0,
|
|
739
739
|
children: /* @__PURE__ */ i("span", { className: "pointer-events-none block aspect-square h-full in-[[data-slot=menu-checkbox-item][data-checked]]:origin-[var(--thumb-size)_50%] origin-left in-[[data-slot=menu-checkbox-item][data-checked]]:translate-x-[calc(var(--thumb-size)-4px)] in-[[data-slot=menu-checkbox-item]:active]:not-data-disabled:scale-x-110 in-[[data-slot=menu-checkbox-item]:active]:rounded-[var(--thumb-size)/calc(var(--thumb-size)*1.10)] rounded-(--thumb-size) bg-background shadow-sm/5 will-change-transform [transition:translate_.15s,border-radius_.15s,scale_.1s_.1s,transform-origin_.15s]" })
|
|
740
|
-
})] }) : /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i(
|
|
740
|
+
})] }) : /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i(G.CheckboxItemIndicator, {
|
|
741
741
|
className: "col-start-1 -ms-0.5",
|
|
742
742
|
children: /* @__PURE__ */ i("svg", {
|
|
743
743
|
"aria-hidden": "true",
|
|
@@ -758,18 +758,18 @@ function kt({ className: e, children: t, checked: n, variant: o = "default", ...
|
|
|
758
758
|
})] })
|
|
759
759
|
});
|
|
760
760
|
}
|
|
761
|
-
function
|
|
762
|
-
return /* @__PURE__ */ i(
|
|
761
|
+
function jt(e) {
|
|
762
|
+
return /* @__PURE__ */ i(G.RadioGroup, {
|
|
763
763
|
"data-slot": "menu-radio-group",
|
|
764
764
|
...e
|
|
765
765
|
});
|
|
766
766
|
}
|
|
767
|
-
function
|
|
768
|
-
return /* @__PURE__ */ a(
|
|
769
|
-
className:
|
|
767
|
+
function Mt({ className: e, children: t, ...n }) {
|
|
768
|
+
return /* @__PURE__ */ a(G.RadioItem, {
|
|
769
|
+
className: J("grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[.75rem_1fr] items-center gap-2 rounded-sm py-1 ps-2 pe-4 text-base text-foreground outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", e),
|
|
770
770
|
"data-slot": "menu-radio-item",
|
|
771
771
|
...n,
|
|
772
|
-
children: [/* @__PURE__ */ i(
|
|
772
|
+
children: [/* @__PURE__ */ i(G.RadioItemIndicator, {
|
|
773
773
|
className: "col-start-1 -ms-0.5",
|
|
774
774
|
children: /* @__PURE__ */ i("svg", {
|
|
775
775
|
"aria-hidden": "true",
|
|
@@ -790,45 +790,45 @@ function jt({ className: e, children: t, ...n }) {
|
|
|
790
790
|
})]
|
|
791
791
|
});
|
|
792
792
|
}
|
|
793
|
-
function
|
|
794
|
-
return /* @__PURE__ */ i(
|
|
795
|
-
className:
|
|
793
|
+
function Nt({ className: e, inset: t, ...n }) {
|
|
794
|
+
return /* @__PURE__ */ i(G.GroupLabel, {
|
|
795
|
+
className: J("px-2 py-1.5 font-medium text-muted-foreground text-xs data-inset:ps-9 sm:data-inset:ps-8", e),
|
|
796
796
|
"data-inset": t,
|
|
797
797
|
"data-slot": "menu-label",
|
|
798
798
|
...n
|
|
799
799
|
});
|
|
800
800
|
}
|
|
801
|
-
function
|
|
802
|
-
return /* @__PURE__ */ i(
|
|
803
|
-
className:
|
|
801
|
+
function Pt({ className: e, ...t }) {
|
|
802
|
+
return /* @__PURE__ */ i(G.Separator, {
|
|
803
|
+
className: J("mx-2 my-1 h-px bg-border", e),
|
|
804
804
|
"data-slot": "menu-separator",
|
|
805
805
|
...t
|
|
806
806
|
});
|
|
807
807
|
}
|
|
808
|
-
function
|
|
808
|
+
function Ft({ className: e, ...t }) {
|
|
809
809
|
return /* @__PURE__ */ i("kbd", {
|
|
810
|
-
className:
|
|
810
|
+
className: J("ms-auto font-medium font-sans text-muted-foreground/72 text-xs tracking-widest", e),
|
|
811
811
|
"data-slot": "menu-shortcut",
|
|
812
812
|
...t
|
|
813
813
|
});
|
|
814
814
|
}
|
|
815
|
-
function
|
|
816
|
-
return /* @__PURE__ */ i(
|
|
815
|
+
function It(e) {
|
|
816
|
+
return /* @__PURE__ */ i(G.SubmenuRoot, {
|
|
817
817
|
"data-slot": "menu-sub",
|
|
818
818
|
...e
|
|
819
819
|
});
|
|
820
820
|
}
|
|
821
|
-
function
|
|
822
|
-
return /* @__PURE__ */ a(
|
|
823
|
-
className:
|
|
821
|
+
function Lt({ className: e, inset: t, children: n, ...r }) {
|
|
822
|
+
return /* @__PURE__ */ a(G.SubmenuTrigger, {
|
|
823
|
+
className: J("flex min-h-8 items-center gap-2 rounded-sm px-2 py-1 text-base text-foreground outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-popup-open:bg-accent data-inset:ps-8 data-highlighted:text-accent-foreground data-popup-open:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&>svg:not(:last-child)]:-mx-0.5 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none", e),
|
|
824
824
|
"data-inset": t,
|
|
825
825
|
"data-slot": "menu-sub-trigger",
|
|
826
826
|
...r,
|
|
827
|
-
children: [n, /* @__PURE__ */ i(
|
|
827
|
+
children: [n, /* @__PURE__ */ i(p, { className: "ms-auto -me-0.5 opacity-80" })]
|
|
828
828
|
});
|
|
829
829
|
}
|
|
830
|
-
function
|
|
831
|
-
return /* @__PURE__ */ i(
|
|
830
|
+
function Rt({ className: e, sideOffset: t = 0, alignOffset: n, align: r = "start", ...a }) {
|
|
831
|
+
return /* @__PURE__ */ i(Et, {
|
|
832
832
|
align: r,
|
|
833
833
|
alignOffset: n ?? (r === "center" ? void 0 : -5),
|
|
834
834
|
className: e,
|
|
@@ -840,9 +840,9 @@ function Lt({ className: e, sideOffset: t = 0, alignOffset: n, align: r = "start
|
|
|
840
840
|
}
|
|
841
841
|
//#endregion
|
|
842
842
|
//#region src/components/ui/separator.tsx
|
|
843
|
-
function
|
|
843
|
+
function zt({ className: e, orientation: t = "horizontal", ...n }) {
|
|
844
844
|
return /* @__PURE__ */ i(ve, {
|
|
845
|
-
className:
|
|
845
|
+
className: J("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:not-[[class^='h-']]:not-[[class*='_h-']]:self-stretch", e),
|
|
846
846
|
"data-slot": "separator",
|
|
847
847
|
orientation: t,
|
|
848
848
|
...n
|
|
@@ -850,10 +850,10 @@ function Rt({ className: e, orientation: t = "horizontal", ...n }) {
|
|
|
850
850
|
}
|
|
851
851
|
//#endregion
|
|
852
852
|
//#region src/components/ui/otp-field.tsx
|
|
853
|
-
function
|
|
854
|
-
let o =
|
|
853
|
+
function Bt({ className: e, size: t = "default", sound: n = !0, onValueChange: r, ...a }) {
|
|
854
|
+
let o = P.useRef(String(a.value ?? a.defaultValue ?? "").length);
|
|
855
855
|
return /* @__PURE__ */ i(_e.Root, {
|
|
856
|
-
className:
|
|
856
|
+
className: J("flex items-center gap-2 has-disabled:opacity-64 has-disabled:**:data-[slot=otp-field-input]:shadow-none has-disabled:**:data-[slot=otp-field-input]:before:shadow-none!", e),
|
|
857
857
|
"data-size": t,
|
|
858
858
|
"data-slot": "otp-field",
|
|
859
859
|
onValueChange: (e, ...t) => {
|
|
@@ -862,38 +862,38 @@ function zt({ className: e, size: t = "default", sound: n = !0, onValueChange: r
|
|
|
862
862
|
...a
|
|
863
863
|
});
|
|
864
864
|
}
|
|
865
|
-
function
|
|
865
|
+
function Vt({ className: e, ...t }) {
|
|
866
866
|
return /* @__PURE__ */ i(_e.Input, {
|
|
867
|
-
className:
|
|
867
|
+
className: J("relative in-[[data-slot=otp-field][data-size=lg]]:size-10 size-9 min-w-0 rounded-lg border border-input bg-background not-dark:bg-clip-padding text-center in-[[data-slot=otp-field][data-size=lg]]:text-lg text-base text-foreground in-[[data-slot=otp-field][data-size=lg]]:leading-10 leading-9 shadow-xs/5 outline-none ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-focus-visible:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:z-10 focus-visible:border-ring focus-visible:shadow-none focus-visible:ring-[3px] focus-visible:ring-ring/24 aria-invalid:border-destructive/36 aria-invalid:shadow-none aria-invalid:focus-visible:border-destructive/64 aria-invalid:focus-visible:ring-destructive/16 sm:in-[[data-slot=otp-field][data-size=lg]]:size-9 sm:size-8 sm:in-[[data-slot=otp-field][data-size=lg]]:text-base sm:text-sm sm:in-[[data-slot=otp-field][data-size=lg]]:leading-9 sm:leading-8 dark:bg-input/32 dark:aria-invalid:focus-visible:ring-destructive/24 dark:not-focus-visible:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]", e),
|
|
868
868
|
"data-slot": "otp-field-input",
|
|
869
869
|
spellCheck: !1,
|
|
870
870
|
...t
|
|
871
871
|
});
|
|
872
872
|
}
|
|
873
|
-
function
|
|
874
|
-
return /* @__PURE__ */ i(_e.Separator, { render: /* @__PURE__ */ i(
|
|
875
|
-
className:
|
|
873
|
+
function Ht({ className: e, ...t }) {
|
|
874
|
+
return /* @__PURE__ */ i(_e.Separator, { render: /* @__PURE__ */ i(zt, {
|
|
875
|
+
className: J("rounded-full bg-input data-[orientation=horizontal]:h-0.5 data-[orientation=horizontal]:w-3", e),
|
|
876
876
|
orientation: "horizontal",
|
|
877
877
|
...t
|
|
878
878
|
}) });
|
|
879
879
|
}
|
|
880
880
|
//#endregion
|
|
881
881
|
//#region src/components/ui/skeleton.tsx
|
|
882
|
-
function
|
|
882
|
+
function Ut({ className: e, ...t }) {
|
|
883
883
|
return /* @__PURE__ */ i("div", {
|
|
884
|
-
className:
|
|
884
|
+
className: J("animate-skeleton rounded-sm [--skeleton-highlight:--alpha(var(--color-white)/64%)] [background:linear-gradient(120deg,transparent_40%,var(--skeleton-highlight),transparent_60%)_var(--color-muted)_0_0/200%_100%_fixed] dark:[--skeleton-highlight:--alpha(var(--color-white)/4%)]", e),
|
|
885
885
|
"data-slot": "skeleton",
|
|
886
886
|
...t
|
|
887
887
|
});
|
|
888
888
|
}
|
|
889
889
|
//#endregion
|
|
890
890
|
//#region src/components/composed/password-input.tsx
|
|
891
|
-
var
|
|
891
|
+
var Wt = [
|
|
892
892
|
.22,
|
|
893
893
|
1,
|
|
894
894
|
.36,
|
|
895
895
|
1
|
|
896
|
-
],
|
|
896
|
+
], Gt = [
|
|
897
897
|
{
|
|
898
898
|
regex: /.{8,}/,
|
|
899
899
|
text: "At least 8 characters"
|
|
@@ -911,42 +911,42 @@ var Ut = [
|
|
|
911
911
|
text: "At least 1 uppercase letter"
|
|
912
912
|
}
|
|
913
913
|
];
|
|
914
|
-
function
|
|
915
|
-
return
|
|
914
|
+
function Kt(e) {
|
|
915
|
+
return Gt.filter((t) => t.regex.test(e)).length;
|
|
916
916
|
}
|
|
917
|
-
var
|
|
917
|
+
var qt = [
|
|
918
918
|
"bg-border",
|
|
919
919
|
"bg-red-500",
|
|
920
920
|
"bg-orange-500",
|
|
921
921
|
"bg-amber-500",
|
|
922
922
|
"bg-emerald-500"
|
|
923
923
|
];
|
|
924
|
-
function
|
|
925
|
-
let [
|
|
924
|
+
function Jt({ visibilityToggle: e = !0, showStrength: t = !1, sound: n = !0, className: r, value: o, defaultValue: s, onChange: c, ...l }) {
|
|
925
|
+
let [u, f] = P.useState(!1), [p, m] = P.useState(String(s ?? "")), _ = o === void 0 ? p : String(o), v = Kt(_);
|
|
926
926
|
return /* @__PURE__ */ a("div", {
|
|
927
|
-
className:
|
|
928
|
-
children: [/* @__PURE__ */ a(
|
|
927
|
+
className: J("flex w-full flex-col gap-3", r),
|
|
928
|
+
children: [/* @__PURE__ */ a(gt, { children: [/* @__PURE__ */ i(yt, {
|
|
929
929
|
placeholder: "Enter your password",
|
|
930
930
|
...l,
|
|
931
|
-
type:
|
|
931
|
+
type: u ? "text" : "password",
|
|
932
932
|
value: _,
|
|
933
933
|
onChange: (e) => {
|
|
934
|
-
|
|
934
|
+
m(e.target.value), c?.(e);
|
|
935
935
|
}
|
|
936
|
-
}), e && /* @__PURE__ */ i(
|
|
936
|
+
}), e && /* @__PURE__ */ i(_t, {
|
|
937
937
|
align: "inline-end",
|
|
938
|
-
children: /* @__PURE__ */ i(
|
|
939
|
-
"aria-label":
|
|
938
|
+
children: /* @__PURE__ */ i(Y, {
|
|
939
|
+
"aria-label": u ? "Hide password" : "Show password",
|
|
940
940
|
onClick: () => {
|
|
941
|
-
n && et(
|
|
941
|
+
n && et(u ? "droplet" : "bloom"), f((e) => !e);
|
|
942
942
|
},
|
|
943
943
|
size: "icon-xs",
|
|
944
944
|
variant: "ghost",
|
|
945
945
|
sound: !1,
|
|
946
|
-
children: /* @__PURE__ */ i(
|
|
946
|
+
children: /* @__PURE__ */ i(K, {
|
|
947
947
|
mode: "wait",
|
|
948
948
|
initial: !1,
|
|
949
|
-
children: /* @__PURE__ */ i(
|
|
949
|
+
children: /* @__PURE__ */ i(q.span, {
|
|
950
950
|
className: "inline-flex",
|
|
951
951
|
initial: {
|
|
952
952
|
opacity: 0,
|
|
@@ -965,15 +965,15 @@ function qt({ visibilityToggle: e = !0, showStrength: t = !1, sound: n = !0, cla
|
|
|
965
965
|
},
|
|
966
966
|
transition: {
|
|
967
967
|
duration: .15,
|
|
968
|
-
ease:
|
|
968
|
+
ease: Wt
|
|
969
969
|
},
|
|
970
|
-
children: i(
|
|
971
|
-
},
|
|
970
|
+
children: i(u ? g : h, { "aria-hidden": "true" })
|
|
971
|
+
}, u ? "off" : "on")
|
|
972
972
|
})
|
|
973
973
|
})
|
|
974
|
-
})] }), /* @__PURE__ */ i(
|
|
974
|
+
})] }), /* @__PURE__ */ i(K, {
|
|
975
975
|
initial: !1,
|
|
976
|
-
children: t && /* @__PURE__ */ a(
|
|
976
|
+
children: t && /* @__PURE__ */ a(q.div, {
|
|
977
977
|
className: "flex flex-col gap-2 overflow-hidden",
|
|
978
978
|
initial: {
|
|
979
979
|
height: 0,
|
|
@@ -989,7 +989,7 @@ function qt({ visibilityToggle: e = !0, showStrength: t = !1, sound: n = !0, cla
|
|
|
989
989
|
},
|
|
990
990
|
transition: {
|
|
991
991
|
duration: .25,
|
|
992
|
-
ease:
|
|
992
|
+
ease: Wt
|
|
993
993
|
},
|
|
994
994
|
children: [/* @__PURE__ */ i("div", {
|
|
995
995
|
"aria-label": "Password strength",
|
|
@@ -998,25 +998,25 @@ function qt({ visibilityToggle: e = !0, showStrength: t = !1, sound: n = !0, cla
|
|
|
998
998
|
"aria-valuenow": v,
|
|
999
999
|
className: "h-1 w-full overflow-hidden rounded-full bg-border",
|
|
1000
1000
|
role: "progressbar",
|
|
1001
|
-
children: /* @__PURE__ */ i(
|
|
1002
|
-
className:
|
|
1001
|
+
children: /* @__PURE__ */ i(q.div, {
|
|
1002
|
+
className: J("h-full rounded-full", qt[v]),
|
|
1003
1003
|
animate: { width: `${v / 4 * 100}%` },
|
|
1004
1004
|
transition: {
|
|
1005
1005
|
duration: .4,
|
|
1006
|
-
ease:
|
|
1006
|
+
ease: Wt
|
|
1007
1007
|
}
|
|
1008
1008
|
})
|
|
1009
1009
|
}), /* @__PURE__ */ i("ul", {
|
|
1010
1010
|
"aria-label": "Password requirements",
|
|
1011
1011
|
className: "flex flex-col gap-1",
|
|
1012
|
-
children:
|
|
1012
|
+
children: Gt.map((e) => {
|
|
1013
1013
|
let t = e.regex.test(_);
|
|
1014
1014
|
return /* @__PURE__ */ a("li", {
|
|
1015
1015
|
className: "flex items-center gap-2 text-xs",
|
|
1016
|
-
children: [t ? /* @__PURE__ */ i(
|
|
1016
|
+
children: [t ? /* @__PURE__ */ i(d, {
|
|
1017
1017
|
"aria-hidden": "true",
|
|
1018
1018
|
className: "size-3.5 text-emerald-500"
|
|
1019
|
-
}) : /* @__PURE__ */ i(
|
|
1019
|
+
}) : /* @__PURE__ */ i(te, {
|
|
1020
1020
|
"aria-hidden": "true",
|
|
1021
1021
|
className: "size-3.5 text-muted-foreground/80"
|
|
1022
1022
|
}), /* @__PURE__ */ a("span", {
|
|
@@ -1035,7 +1035,7 @@ function qt({ visibilityToggle: e = !0, showStrength: t = !1, sound: n = !0, cla
|
|
|
1035
1035
|
}
|
|
1036
1036
|
//#endregion
|
|
1037
1037
|
//#region src/components/composed/social-providers.tsx
|
|
1038
|
-
function
|
|
1038
|
+
function Yt(e) {
|
|
1039
1039
|
return /* @__PURE__ */ a("svg", {
|
|
1040
1040
|
viewBox: "0 0 24 24",
|
|
1041
1041
|
fill: "none",
|
|
@@ -1060,11 +1060,11 @@ function Jt(e) {
|
|
|
1060
1060
|
]
|
|
1061
1061
|
});
|
|
1062
1062
|
}
|
|
1063
|
-
var
|
|
1063
|
+
var Xt = {
|
|
1064
1064
|
google: {
|
|
1065
1065
|
label: "Google",
|
|
1066
1066
|
Icon: Ce,
|
|
1067
|
-
BrandIcon:
|
|
1067
|
+
BrandIcon: Yt,
|
|
1068
1068
|
brandClassName: ""
|
|
1069
1069
|
},
|
|
1070
1070
|
apple: {
|
|
@@ -1085,33 +1085,33 @@ var Yt = {
|
|
|
1085
1085
|
BrandIcon: we,
|
|
1086
1086
|
brandClassName: "text-foreground"
|
|
1087
1087
|
}
|
|
1088
|
-
},
|
|
1088
|
+
}, Zt = {
|
|
1089
1089
|
login: "Login with",
|
|
1090
1090
|
signup: "Sign up with",
|
|
1091
1091
|
continue: "Continue with"
|
|
1092
1092
|
};
|
|
1093
|
-
function
|
|
1093
|
+
function Qt({ providers: e = [
|
|
1094
1094
|
"google",
|
|
1095
1095
|
"apple",
|
|
1096
1096
|
"github"
|
|
1097
1097
|
], action: t = "continue", layout: n = "stack", loadingProvider: r = null, disabled: o = !1, onSelect: s, className: c }) {
|
|
1098
1098
|
let l = n === "row";
|
|
1099
1099
|
return /* @__PURE__ */ i("div", {
|
|
1100
|
-
className:
|
|
1100
|
+
className: J("flex w-full gap-2", l ? "flex-row justify-center" : "flex-col", c),
|
|
1101
1101
|
children: e.map((e) => {
|
|
1102
|
-
let { label: n, Icon: c } =
|
|
1103
|
-
return /* @__PURE__ */ a(
|
|
1102
|
+
let { label: n, Icon: c } = Xt[e];
|
|
1103
|
+
return /* @__PURE__ */ a(Y, {
|
|
1104
1104
|
variant: "outline",
|
|
1105
1105
|
size: l ? "icon" : "default",
|
|
1106
1106
|
className: l ? void 0 : "w-full",
|
|
1107
|
-
"aria-label": `${
|
|
1107
|
+
"aria-label": `${Zt[t]} ${n}`,
|
|
1108
1108
|
loading: r === e,
|
|
1109
1109
|
disabled: o || r !== null && r !== e,
|
|
1110
1110
|
onClick: () => s?.(e),
|
|
1111
1111
|
children: [/* @__PURE__ */ i(c, { "aria-hidden": "true" }), !l && /* @__PURE__ */ a("span", {
|
|
1112
1112
|
className: "flex-1",
|
|
1113
1113
|
children: [
|
|
1114
|
-
|
|
1114
|
+
Zt[t],
|
|
1115
1115
|
" ",
|
|
1116
1116
|
n
|
|
1117
1117
|
]
|
|
@@ -1122,14 +1122,14 @@ function Zt({ providers: e = [
|
|
|
1122
1122
|
}
|
|
1123
1123
|
//#endregion
|
|
1124
1124
|
//#region src/components/composed/user-avatar.tsx
|
|
1125
|
-
function
|
|
1125
|
+
function $t(e) {
|
|
1126
1126
|
let t = e.trim().split(/\s+/).filter(Boolean);
|
|
1127
1127
|
return t.length === 0 ? "" : ((t[0]?.[0] ?? "") + (t.length > 1 ? t.at(-1)?.[0] ?? "" : "")).toUpperCase();
|
|
1128
1128
|
}
|
|
1129
|
-
function
|
|
1130
|
-
let [l, u] =
|
|
1129
|
+
function en({ src: e, name: t = "", initials: n, alt: r, loading: o, className: s, ...c }) {
|
|
1130
|
+
let [l, u] = P.useState("idle"), d = o ?? (e !== void 0 && (l === "idle" || l === "loading"));
|
|
1131
1131
|
return /* @__PURE__ */ a(Ee, {
|
|
1132
|
-
className:
|
|
1132
|
+
className: J("size-8", s),
|
|
1133
1133
|
"data-loading": d || void 0,
|
|
1134
1134
|
"data-slot": "user-avatar",
|
|
1135
1135
|
...c,
|
|
@@ -1137,15 +1137,15 @@ function $t({ src: e, name: t = "", initials: n, alt: r, loading: o, className:
|
|
|
1137
1137
|
alt: r ?? t,
|
|
1138
1138
|
onLoadingStatusChange: u,
|
|
1139
1139
|
src: e
|
|
1140
|
-
}), /* @__PURE__ */ i(Oe, { children: d ? /* @__PURE__ */ i(
|
|
1140
|
+
}), /* @__PURE__ */ i(Oe, { children: d ? /* @__PURE__ */ i(Ut, {
|
|
1141
1141
|
className: "size-full rounded-full",
|
|
1142
1142
|
"data-slot": "avatar-skeleton"
|
|
1143
|
-
}) : n ??
|
|
1143
|
+
}) : n ?? $t(t) })]
|
|
1144
1144
|
});
|
|
1145
1145
|
}
|
|
1146
1146
|
//#endregion
|
|
1147
1147
|
//#region src/lib/auth-accent.ts
|
|
1148
|
-
var
|
|
1148
|
+
var tn = {
|
|
1149
1149
|
corpora: {
|
|
1150
1150
|
"--auth-accent": "#E8B124",
|
|
1151
1151
|
"--auth-accent-image": "none",
|
|
@@ -1156,24 +1156,24 @@ var en = {
|
|
|
1156
1156
|
"--auth-accent-image": "linear-gradient(44deg in oklab, rgba(29,0,202,0.66) 3%, #3B0080 37%, rgba(36,0,72,0.86) 98%)",
|
|
1157
1157
|
"--auth-accent-foreground": "oklch(0.985 0 0)"
|
|
1158
1158
|
}
|
|
1159
|
-
},
|
|
1159
|
+
}, nn = "border-transparent bg-[var(--auth-accent)] bg-[image:var(--auth-accent-image)] text-[var(--auth-accent-foreground)] shadow-none hover:bg-[var(--auth-accent)] hover:brightness-110 data-pressed:bg-[var(--auth-accent)] data-pressed:brightness-110 *:data-[slot=button-loading-indicator]:text-[var(--auth-accent-foreground)]", Q = [
|
|
1160
1160
|
.22,
|
|
1161
1161
|
1,
|
|
1162
1162
|
.36,
|
|
1163
1163
|
1
|
|
1164
1164
|
];
|
|
1165
|
-
function
|
|
1165
|
+
function rn({ title: e, description: t, children: n, footer: r, className: o, logo: s, accent: c }) {
|
|
1166
1166
|
return /* @__PURE__ */ i(ye, {
|
|
1167
1167
|
reducedMotion: "user",
|
|
1168
1168
|
children: /* @__PURE__ */ i(st, {
|
|
1169
|
-
className:
|
|
1169
|
+
className: J("w-full max-w-sm", o),
|
|
1170
1170
|
"data-accent": c,
|
|
1171
|
-
style: c ?
|
|
1172
|
-
children: /* @__PURE__ */ a(
|
|
1171
|
+
style: c ? tn[c] : void 0,
|
|
1172
|
+
children: /* @__PURE__ */ a(q.div, {
|
|
1173
1173
|
layout: !0,
|
|
1174
1174
|
transition: {
|
|
1175
1175
|
duration: .3,
|
|
1176
|
-
ease:
|
|
1176
|
+
ease: Q
|
|
1177
1177
|
},
|
|
1178
1178
|
className: "flex flex-col",
|
|
1179
1179
|
children: [/* @__PURE__ */ a(ze, { children: [/* @__PURE__ */ a(Ke, { children: [
|
|
@@ -1195,11 +1195,11 @@ function q({ title: e, description: t, children: n, footer: r, className: o, log
|
|
|
1195
1195
|
})
|
|
1196
1196
|
});
|
|
1197
1197
|
}
|
|
1198
|
-
function
|
|
1199
|
-
return /* @__PURE__ */ i(
|
|
1198
|
+
function an({ step: e, children: t, className: n }) {
|
|
1199
|
+
return /* @__PURE__ */ i(K, {
|
|
1200
1200
|
mode: "popLayout",
|
|
1201
1201
|
initial: !1,
|
|
1202
|
-
children: /* @__PURE__ */ i(
|
|
1202
|
+
children: /* @__PURE__ */ i(q.div, {
|
|
1203
1203
|
className: n,
|
|
1204
1204
|
initial: {
|
|
1205
1205
|
opacity: 0,
|
|
@@ -1218,24 +1218,24 @@ function J({ step: e, children: t, className: n }) {
|
|
|
1218
1218
|
},
|
|
1219
1219
|
transition: {
|
|
1220
1220
|
duration: .25,
|
|
1221
|
-
ease:
|
|
1221
|
+
ease: Q
|
|
1222
1222
|
},
|
|
1223
1223
|
children: t
|
|
1224
1224
|
}, e)
|
|
1225
1225
|
});
|
|
1226
1226
|
}
|
|
1227
|
-
function
|
|
1228
|
-
let [r, a] =
|
|
1227
|
+
function $({ show: e, children: t, className: n }) {
|
|
1228
|
+
let [r, a] = P.useState({
|
|
1229
1229
|
show: e,
|
|
1230
1230
|
settled: e
|
|
1231
1231
|
});
|
|
1232
1232
|
return r.show !== e && a({
|
|
1233
1233
|
show: e,
|
|
1234
1234
|
settled: !1
|
|
1235
|
-
}), /* @__PURE__ */ i(
|
|
1235
|
+
}), /* @__PURE__ */ i(K, {
|
|
1236
1236
|
initial: !1,
|
|
1237
|
-
children: e && /* @__PURE__ */ i(
|
|
1238
|
-
className:
|
|
1237
|
+
children: e && /* @__PURE__ */ i(q.div, {
|
|
1238
|
+
className: J(!r.settled && "overflow-hidden", n),
|
|
1239
1239
|
initial: {
|
|
1240
1240
|
height: 0,
|
|
1241
1241
|
opacity: 0,
|
|
@@ -1256,7 +1256,7 @@ function Y({ show: e, children: t, className: n }) {
|
|
|
1256
1256
|
},
|
|
1257
1257
|
transition: {
|
|
1258
1258
|
duration: .25,
|
|
1259
|
-
ease:
|
|
1259
|
+
ease: Q
|
|
1260
1260
|
},
|
|
1261
1261
|
onAnimationComplete: () => a((e) => ({
|
|
1262
1262
|
...e,
|
|
@@ -1266,10 +1266,10 @@ function Y({ show: e, children: t, className: n }) {
|
|
|
1266
1266
|
})
|
|
1267
1267
|
});
|
|
1268
1268
|
}
|
|
1269
|
-
function
|
|
1270
|
-
return /* @__PURE__ */ i(
|
|
1269
|
+
function on({ message: e }) {
|
|
1270
|
+
return /* @__PURE__ */ i(K, {
|
|
1271
1271
|
initial: !1,
|
|
1272
|
-
children: e && /* @__PURE__ */ i(
|
|
1272
|
+
children: e && /* @__PURE__ */ i(q.p, {
|
|
1273
1273
|
role: "alert",
|
|
1274
1274
|
className: "text-sm text-destructive-foreground",
|
|
1275
1275
|
initial: {
|
|
@@ -1294,7 +1294,7 @@ function X({ message: e }) {
|
|
|
1294
1294
|
},
|
|
1295
1295
|
transition: {
|
|
1296
1296
|
duration: .25,
|
|
1297
|
-
ease:
|
|
1297
|
+
ease: Q,
|
|
1298
1298
|
x: {
|
|
1299
1299
|
duration: .4,
|
|
1300
1300
|
ease: "easeInOut"
|
|
@@ -1304,11 +1304,11 @@ function X({ message: e }) {
|
|
|
1304
1304
|
}, e)
|
|
1305
1305
|
});
|
|
1306
1306
|
}
|
|
1307
|
-
function
|
|
1307
|
+
function sn({ title: e, description: t, children: n }) {
|
|
1308
1308
|
return /* @__PURE__ */ a("div", {
|
|
1309
1309
|
className: "flex flex-col items-center gap-3 py-4 text-center",
|
|
1310
1310
|
children: [
|
|
1311
|
-
/* @__PURE__ */ i(
|
|
1311
|
+
/* @__PURE__ */ i(q.span, {
|
|
1312
1312
|
className: "flex size-12 items-center justify-center rounded-full bg-emerald-500/12 text-emerald-600",
|
|
1313
1313
|
initial: {
|
|
1314
1314
|
scale: .6,
|
|
@@ -1320,7 +1320,7 @@ function Z({ title: e, description: t, children: n }) {
|
|
|
1320
1320
|
},
|
|
1321
1321
|
transition: {
|
|
1322
1322
|
duration: .4,
|
|
1323
|
-
ease:
|
|
1323
|
+
ease: Q
|
|
1324
1324
|
},
|
|
1325
1325
|
children: /* @__PURE__ */ i("svg", {
|
|
1326
1326
|
"aria-hidden": "true",
|
|
@@ -1331,14 +1331,14 @@ function Z({ title: e, description: t, children: n }) {
|
|
|
1331
1331
|
strokeWidth: "2.5",
|
|
1332
1332
|
strokeLinecap: "round",
|
|
1333
1333
|
strokeLinejoin: "round",
|
|
1334
|
-
children: /* @__PURE__ */ i(
|
|
1334
|
+
children: /* @__PURE__ */ i(q.path, {
|
|
1335
1335
|
d: "M4 12.5l5 5L20 6.5",
|
|
1336
1336
|
initial: { pathLength: 0 },
|
|
1337
1337
|
animate: { pathLength: 1 },
|
|
1338
1338
|
transition: {
|
|
1339
1339
|
duration: .4,
|
|
1340
1340
|
delay: .15,
|
|
1341
|
-
ease:
|
|
1341
|
+
ease: Q
|
|
1342
1342
|
}
|
|
1343
1343
|
})
|
|
1344
1344
|
})
|
|
@@ -1357,21 +1357,21 @@ function Z({ title: e, description: t, children: n }) {
|
|
|
1357
1357
|
]
|
|
1358
1358
|
});
|
|
1359
1359
|
}
|
|
1360
|
-
function
|
|
1360
|
+
function cn({ label: e = "Or" }) {
|
|
1361
1361
|
return /* @__PURE__ */ a("div", {
|
|
1362
1362
|
className: "flex items-center gap-3",
|
|
1363
1363
|
children: [
|
|
1364
|
-
/* @__PURE__ */ i(
|
|
1364
|
+
/* @__PURE__ */ i(zt, { className: "flex-1" }),
|
|
1365
1365
|
/* @__PURE__ */ i("span", {
|
|
1366
1366
|
className: "text-xs text-muted-foreground uppercase",
|
|
1367
1367
|
children: e
|
|
1368
1368
|
}),
|
|
1369
|
-
/* @__PURE__ */ i(
|
|
1369
|
+
/* @__PURE__ */ i(zt, { className: "flex-1" })
|
|
1370
1370
|
]
|
|
1371
1371
|
});
|
|
1372
1372
|
}
|
|
1373
|
-
function
|
|
1374
|
-
let [n, r] =
|
|
1373
|
+
function ln(e, t) {
|
|
1374
|
+
let [n, r] = P.useState({
|
|
1375
1375
|
restartKey: t,
|
|
1376
1376
|
seconds: e,
|
|
1377
1377
|
remaining: e
|
|
@@ -1380,7 +1380,7 @@ function rn(e, t) {
|
|
|
1380
1380
|
restartKey: t,
|
|
1381
1381
|
seconds: e,
|
|
1382
1382
|
remaining: e
|
|
1383
|
-
}),
|
|
1383
|
+
}), P.useEffect(() => {
|
|
1384
1384
|
if (e <= 0) return;
|
|
1385
1385
|
let t = window.setInterval(() => {
|
|
1386
1386
|
r((e) => e.remaining <= 0 ? e : {
|
|
@@ -1393,8 +1393,8 @@ function rn(e, t) {
|
|
|
1393
1393
|
}
|
|
1394
1394
|
//#endregion
|
|
1395
1395
|
//#region src/components/blocks/auth/code-auth-block.tsx
|
|
1396
|
-
function
|
|
1397
|
-
let [p, m] =
|
|
1396
|
+
function un({ channel: e = "email", logo: t, accent: n, destination: o, length: s = 6, autoSubmit: c = !0, resendSeconds: l = 30, onVerify: u, onResend: d, onBack: f }) {
|
|
1397
|
+
let [p, m] = P.useState("idle"), [h, g] = P.useState(null), [_, v] = P.useState(""), [y, b] = P.useState(0), x = ln(l, y), S = e === "sms" ? j : w, C = e === "sms" ? "phone" : "email", T = P.useCallback(async (e) => {
|
|
1398
1398
|
g(null), m("loading");
|
|
1399
1399
|
try {
|
|
1400
1400
|
await u?.(e), m("success");
|
|
@@ -1402,23 +1402,23 @@ function an({ channel: e = "email", logo: t, accent: n, destination: o, length:
|
|
|
1402
1402
|
m("idle"), v(""), g(e instanceof Error ? e.message : "Invalid code.");
|
|
1403
1403
|
}
|
|
1404
1404
|
}, [u]);
|
|
1405
|
-
function
|
|
1406
|
-
v(e), h && g(null), c && e.length === s && p === "idle" &&
|
|
1405
|
+
function E(e) {
|
|
1406
|
+
v(e), h && g(null), c && e.length === s && p === "idle" && T(e);
|
|
1407
1407
|
}
|
|
1408
|
-
async function
|
|
1409
|
-
|
|
1408
|
+
async function D() {
|
|
1409
|
+
b((e) => e + 1), v(""), g(null), await d?.();
|
|
1410
1410
|
}
|
|
1411
|
-
return /* @__PURE__ */ i(
|
|
1411
|
+
return /* @__PURE__ */ i(rn, {
|
|
1412
1412
|
title: "Enter verification code",
|
|
1413
1413
|
logo: t,
|
|
1414
1414
|
accent: n,
|
|
1415
1415
|
description: /* @__PURE__ */ a("span", {
|
|
1416
1416
|
className: "inline-flex items-center gap-1.5",
|
|
1417
|
-
children: [/* @__PURE__ */ i(
|
|
1417
|
+
children: [/* @__PURE__ */ i(S, { className: "size-3.5 shrink-0" }), /* @__PURE__ */ a("span", { children: [
|
|
1418
1418
|
"We sent a ",
|
|
1419
1419
|
s,
|
|
1420
1420
|
"-digit code to your ",
|
|
1421
|
-
|
|
1421
|
+
C,
|
|
1422
1422
|
o ? /* @__PURE__ */ a(r, { children: [" ", /* @__PURE__ */ i("span", {
|
|
1423
1423
|
className: "font-medium text-foreground",
|
|
1424
1424
|
children: o
|
|
@@ -1426,20 +1426,20 @@ function an({ channel: e = "email", logo: t, accent: n, destination: o, length:
|
|
|
1426
1426
|
"."
|
|
1427
1427
|
] })]
|
|
1428
1428
|
}),
|
|
1429
|
-
footer: p !== "success" && /* @__PURE__ */ a(
|
|
1429
|
+
footer: p !== "success" && /* @__PURE__ */ a(Y, {
|
|
1430
1430
|
variant: "link",
|
|
1431
1431
|
onClick: f,
|
|
1432
|
-
children: ["Use a different ",
|
|
1432
|
+
children: ["Use a different ", C]
|
|
1433
1433
|
}),
|
|
1434
|
-
children: /* @__PURE__ */ i(
|
|
1434
|
+
children: /* @__PURE__ */ i(an, {
|
|
1435
1435
|
step: p === "success" ? "success" : "form",
|
|
1436
|
-
children: p === "success" ? /* @__PURE__ */ i(
|
|
1436
|
+
children: p === "success" ? /* @__PURE__ */ i(sn, {
|
|
1437
1437
|
title: "Verified",
|
|
1438
1438
|
description: "Your identity has been confirmed."
|
|
1439
1439
|
}) : /* @__PURE__ */ a("div", {
|
|
1440
1440
|
className: "flex flex-col items-center gap-4",
|
|
1441
1441
|
children: [
|
|
1442
|
-
/* @__PURE__ */ i(
|
|
1442
|
+
/* @__PURE__ */ i(q.div, {
|
|
1443
1443
|
animate: h ? { x: [
|
|
1444
1444
|
0,
|
|
1445
1445
|
-8,
|
|
@@ -1452,43 +1452,43 @@ function an({ channel: e = "email", logo: t, accent: n, destination: o, length:
|
|
|
1452
1452
|
duration: .4,
|
|
1453
1453
|
ease: "easeInOut"
|
|
1454
1454
|
},
|
|
1455
|
-
children: /* @__PURE__ */ i(
|
|
1455
|
+
children: /* @__PURE__ */ i(Bt, {
|
|
1456
1456
|
length: s,
|
|
1457
1457
|
value: _,
|
|
1458
|
-
onValueChange:
|
|
1458
|
+
onValueChange: E,
|
|
1459
1459
|
disabled: p === "loading",
|
|
1460
|
-
children: Array.from({ length: s }, (e, t) => /* @__PURE__ */ i(
|
|
1460
|
+
children: Array.from({ length: s }, (e, t) => /* @__PURE__ */ i(Vt, {
|
|
1461
1461
|
"aria-invalid": h ? !0 : void 0,
|
|
1462
1462
|
"aria-label": `Digit ${t + 1} of ${s}`
|
|
1463
1463
|
}, `slot-${t}`))
|
|
1464
1464
|
})
|
|
1465
1465
|
}, h ?? "steady"),
|
|
1466
|
-
/* @__PURE__ */ i(
|
|
1467
|
-
!c && /* @__PURE__ */ i(
|
|
1468
|
-
className:
|
|
1466
|
+
/* @__PURE__ */ i(on, { message: h }),
|
|
1467
|
+
!c && /* @__PURE__ */ i(Y, {
|
|
1468
|
+
className: J("w-full", n && "border-transparent bg-[var(--auth-accent)] bg-[image:var(--auth-accent-image)] text-[var(--auth-accent-foreground)] shadow-none hover:bg-[var(--auth-accent)] hover:brightness-110 data-pressed:bg-[var(--auth-accent)] data-pressed:brightness-110 *:data-[slot=button-loading-indicator]:text-[var(--auth-accent-foreground)]"),
|
|
1469
1469
|
loading: p === "loading",
|
|
1470
1470
|
disabled: _.length !== s,
|
|
1471
|
-
onClick: () => void
|
|
1471
|
+
onClick: () => void T(_),
|
|
1472
1472
|
children: "Verify"
|
|
1473
1473
|
}),
|
|
1474
|
-
/* @__PURE__ */ i(
|
|
1474
|
+
/* @__PURE__ */ i(q.p, {
|
|
1475
1475
|
layout: !0,
|
|
1476
1476
|
transition: {
|
|
1477
1477
|
duration: .25,
|
|
1478
|
-
ease:
|
|
1478
|
+
ease: Q
|
|
1479
1479
|
},
|
|
1480
1480
|
className: "text-center text-sm text-muted-foreground",
|
|
1481
|
-
children:
|
|
1481
|
+
children: x > 0 ? /* @__PURE__ */ a(r, { children: [
|
|
1482
1482
|
"Resend code in",
|
|
1483
1483
|
" ",
|
|
1484
1484
|
/* @__PURE__ */ a("span", {
|
|
1485
1485
|
className: "font-medium tabular-nums text-foreground",
|
|
1486
|
-
children: [
|
|
1486
|
+
children: [x, "s"]
|
|
1487
1487
|
})
|
|
1488
|
-
] }) : /* @__PURE__ */ i(
|
|
1488
|
+
] }) : /* @__PURE__ */ i(Y, {
|
|
1489
1489
|
variant: "link",
|
|
1490
1490
|
disabled: p === "loading",
|
|
1491
|
-
onClick: () => void
|
|
1491
|
+
onClick: () => void D(),
|
|
1492
1492
|
children: "Resend code"
|
|
1493
1493
|
})
|
|
1494
1494
|
})
|
|
@@ -1499,8 +1499,8 @@ function an({ channel: e = "email", logo: t, accent: n, destination: o, length:
|
|
|
1499
1499
|
}
|
|
1500
1500
|
//#endregion
|
|
1501
1501
|
//#region src/components/blocks/auth/forgot-password-block.tsx
|
|
1502
|
-
function
|
|
1503
|
-
let u =
|
|
1502
|
+
function dn({ title: e = "Reset your password", logo: t, accent: n, description: o = "Enter your email and we will send you a reset link", onSubmit: s, onBackToLogin: c }) {
|
|
1503
|
+
let u = P.useId(), [d, f] = P.useState("idle"), [p, m] = P.useState(null), [h, g] = P.useState("");
|
|
1504
1504
|
async function _(e) {
|
|
1505
1505
|
e.preventDefault(), m(null), f("loading");
|
|
1506
1506
|
try {
|
|
@@ -1509,20 +1509,20 @@ function on({ title: e = "Reset your password", logo: t, accent: n, description:
|
|
|
1509
1509
|
f("idle"), m(e instanceof Error ? e.message : "Unable to send reset link.");
|
|
1510
1510
|
}
|
|
1511
1511
|
}
|
|
1512
|
-
return /* @__PURE__ */ i(
|
|
1512
|
+
return /* @__PURE__ */ i(rn, {
|
|
1513
1513
|
title: e,
|
|
1514
1514
|
description: o,
|
|
1515
1515
|
logo: t,
|
|
1516
1516
|
accent: n,
|
|
1517
|
-
footer: /* @__PURE__ */ a(
|
|
1517
|
+
footer: /* @__PURE__ */ a(Y, {
|
|
1518
1518
|
variant: "link",
|
|
1519
1519
|
className: "gap-1",
|
|
1520
1520
|
onClick: c,
|
|
1521
1521
|
children: [/* @__PURE__ */ i(l, { className: "size-3.5" }), "Back to login"]
|
|
1522
1522
|
}),
|
|
1523
|
-
children: /* @__PURE__ */ i(
|
|
1523
|
+
children: /* @__PURE__ */ i(an, {
|
|
1524
1524
|
step: d === "success" ? "success" : "form",
|
|
1525
|
-
children: d === "success" ? /* @__PURE__ */ i(
|
|
1525
|
+
children: d === "success" ? /* @__PURE__ */ i(sn, {
|
|
1526
1526
|
title: "Check your inbox",
|
|
1527
1527
|
description: /* @__PURE__ */ a(r, { children: [
|
|
1528
1528
|
"We sent a password reset link to",
|
|
@@ -1533,7 +1533,7 @@ function on({ title: e = "Reset your password", logo: t, accent: n, description:
|
|
|
1533
1533
|
}),
|
|
1534
1534
|
"."
|
|
1535
1535
|
] }),
|
|
1536
|
-
children: /* @__PURE__ */ i(
|
|
1536
|
+
children: /* @__PURE__ */ i(Y, {
|
|
1537
1537
|
variant: "link",
|
|
1538
1538
|
className: "text-xs sm:text-xs",
|
|
1539
1539
|
onClick: () => f("idle"),
|
|
@@ -1543,12 +1543,12 @@ function on({ title: e = "Reset your password", logo: t, accent: n, description:
|
|
|
1543
1543
|
className: "flex flex-col gap-4",
|
|
1544
1544
|
onSubmit: _,
|
|
1545
1545
|
children: [
|
|
1546
|
-
/* @__PURE__ */ a(
|
|
1546
|
+
/* @__PURE__ */ a(X, {
|
|
1547
1547
|
name: "email",
|
|
1548
|
-
children: [/* @__PURE__ */ i(
|
|
1548
|
+
children: [/* @__PURE__ */ i(Z, {
|
|
1549
1549
|
htmlFor: u,
|
|
1550
1550
|
children: "Email"
|
|
1551
|
-
}), /* @__PURE__ */ i(
|
|
1551
|
+
}), /* @__PURE__ */ i(pt, {
|
|
1552
1552
|
id: u,
|
|
1553
1553
|
name: "email",
|
|
1554
1554
|
type: "email",
|
|
@@ -1560,9 +1560,9 @@ function on({ title: e = "Reset your password", logo: t, accent: n, description:
|
|
|
1560
1560
|
onChange: (e) => g(e.target.value)
|
|
1561
1561
|
})]
|
|
1562
1562
|
}),
|
|
1563
|
-
/* @__PURE__ */ i(
|
|
1564
|
-
/* @__PURE__ */ i(
|
|
1565
|
-
className:
|
|
1563
|
+
/* @__PURE__ */ i(on, { message: p }),
|
|
1564
|
+
/* @__PURE__ */ i(Y, {
|
|
1565
|
+
className: J("w-full", n && "border-transparent bg-[var(--auth-accent)] bg-[image:var(--auth-accent-image)] text-[var(--auth-accent-foreground)] shadow-none hover:bg-[var(--auth-accent)] hover:brightness-110 data-pressed:bg-[var(--auth-accent)] data-pressed:brightness-110 *:data-[slot=button-loading-indicator]:text-[var(--auth-accent-foreground)]"),
|
|
1566
1566
|
type: "submit",
|
|
1567
1567
|
loading: d === "loading",
|
|
1568
1568
|
children: "Send reset link"
|
|
@@ -1574,13 +1574,13 @@ function on({ title: e = "Reset your password", logo: t, accent: n, description:
|
|
|
1574
1574
|
}
|
|
1575
1575
|
//#endregion
|
|
1576
1576
|
//#region src/components/blocks/auth/linked-accounts-block.tsx
|
|
1577
|
-
var
|
|
1578
|
-
function
|
|
1577
|
+
var fn = "This is your only way to sign in, so it can't be disconnected.";
|
|
1578
|
+
function pn({ title: e = "Connected accounts", description: t = "Manage the accounts you can use to sign in.", identities: n = [], providers: r = [
|
|
1579
1579
|
"google",
|
|
1580
1580
|
"apple",
|
|
1581
1581
|
"github"
|
|
1582
1582
|
], loading: o = !1, hasOtherSignInMethods: s = !1, onLink: c, onUnlink: l, className: u }) {
|
|
1583
|
-
let d =
|
|
1583
|
+
let d = P.useId(), [f, p] = P.useState(null), [m, h] = P.useState(null), [g, _] = P.useState(null), v = new Set(n.map((e) => e.provider)), y = r.filter((e) => !v.has(e)), b = m !== null || g !== null, x = !s && n.length <= 1;
|
|
1584
1584
|
async function S(e) {
|
|
1585
1585
|
if (!b) {
|
|
1586
1586
|
p(null), h(e);
|
|
@@ -1608,28 +1608,28 @@ function cn({ title: e = "Connected accounts", description: t = "Manage the acco
|
|
|
1608
1608
|
return /* @__PURE__ */ i(ye, {
|
|
1609
1609
|
reducedMotion: "user",
|
|
1610
1610
|
children: /* @__PURE__ */ a(ze, {
|
|
1611
|
-
className:
|
|
1611
|
+
className: J("w-full", u),
|
|
1612
1612
|
"data-slot": "auth-block",
|
|
1613
1613
|
children: [/* @__PURE__ */ a(Ke, { children: [/* @__PURE__ */ i(qe, { children: e }), /* @__PURE__ */ i(Je, { children: t })] }), /* @__PURE__ */ i(Xe, { children: o ? /* @__PURE__ */ a("div", {
|
|
1614
1614
|
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
1615
1615
|
children: [/* @__PURE__ */ i(ke, { className: "size-4" }), "Loading connected accounts…"]
|
|
1616
|
-
}) : /* @__PURE__ */ a(
|
|
1616
|
+
}) : /* @__PURE__ */ a(q.div, {
|
|
1617
1617
|
layout: !0,
|
|
1618
1618
|
transition: {
|
|
1619
1619
|
duration: .3,
|
|
1620
|
-
ease:
|
|
1620
|
+
ease: Q
|
|
1621
1621
|
},
|
|
1622
1622
|
className: "flex flex-col gap-3",
|
|
1623
1623
|
children: [
|
|
1624
|
-
/* @__PURE__ */ i(
|
|
1624
|
+
/* @__PURE__ */ i(on, { message: f }),
|
|
1625
1625
|
n.length > 0 ? /* @__PURE__ */ i("ul", {
|
|
1626
1626
|
"aria-label": "Connected accounts",
|
|
1627
1627
|
className: "flex flex-col gap-2",
|
|
1628
|
-
children: /* @__PURE__ */ i(
|
|
1628
|
+
children: /* @__PURE__ */ i(K, {
|
|
1629
1629
|
initial: !1,
|
|
1630
1630
|
children: n.map((e, t) => {
|
|
1631
|
-
let { label: n, BrandIcon: r, brandClassName: o } =
|
|
1632
|
-
return /* @__PURE__ */ a(
|
|
1631
|
+
let { label: n, BrandIcon: r, brandClassName: o } = Xt[e.provider];
|
|
1632
|
+
return /* @__PURE__ */ a(q.li, {
|
|
1633
1633
|
layout: !0,
|
|
1634
1634
|
className: "flex items-center justify-between gap-3 rounded-lg border px-3 py-2",
|
|
1635
1635
|
initial: {
|
|
@@ -1646,14 +1646,14 @@ function cn({ title: e = "Connected accounts", description: t = "Manage the acco
|
|
|
1646
1646
|
},
|
|
1647
1647
|
transition: {
|
|
1648
1648
|
duration: .25,
|
|
1649
|
-
ease:
|
|
1649
|
+
ease: Q,
|
|
1650
1650
|
delay: Math.min(t, 5) * .04
|
|
1651
1651
|
},
|
|
1652
1652
|
children: [/* @__PURE__ */ a("div", {
|
|
1653
1653
|
className: "flex min-w-0 items-center gap-2.5",
|
|
1654
1654
|
children: [/* @__PURE__ */ i(r, {
|
|
1655
1655
|
"aria-hidden": "true",
|
|
1656
|
-
className:
|
|
1656
|
+
className: J("size-4", o)
|
|
1657
1657
|
}), /* @__PURE__ */ a("div", {
|
|
1658
1658
|
className: "flex min-w-0 flex-col",
|
|
1659
1659
|
children: [/* @__PURE__ */ i("span", {
|
|
@@ -1664,7 +1664,7 @@ function cn({ title: e = "Connected accounts", description: t = "Manage the acco
|
|
|
1664
1664
|
children: e.email
|
|
1665
1665
|
})]
|
|
1666
1666
|
})]
|
|
1667
|
-
}), /* @__PURE__ */ i(
|
|
1667
|
+
}), /* @__PURE__ */ i(Y, {
|
|
1668
1668
|
"aria-describedby": x ? d : void 0,
|
|
1669
1669
|
"aria-label": `Disconnect ${n}`,
|
|
1670
1670
|
size: "sm",
|
|
@@ -1685,11 +1685,11 @@ function cn({ title: e = "Connected accounts", description: t = "Manage the acco
|
|
|
1685
1685
|
x && n.length > 0 && /* @__PURE__ */ i("p", {
|
|
1686
1686
|
className: "text-xs text-muted-foreground",
|
|
1687
1687
|
id: d,
|
|
1688
|
-
children:
|
|
1688
|
+
children: fn
|
|
1689
1689
|
}),
|
|
1690
1690
|
y.map((e) => {
|
|
1691
|
-
let { label: t, BrandIcon: n, brandClassName: r } =
|
|
1692
|
-
return /* @__PURE__ */ a(
|
|
1691
|
+
let { label: t, BrandIcon: n, brandClassName: r } = Xt[e];
|
|
1692
|
+
return /* @__PURE__ */ a(Y, {
|
|
1693
1693
|
className: "w-full",
|
|
1694
1694
|
type: "button",
|
|
1695
1695
|
variant: "outline",
|
|
@@ -1712,14 +1712,14 @@ function cn({ title: e = "Connected accounts", description: t = "Manage the acco
|
|
|
1712
1712
|
}
|
|
1713
1713
|
//#endregion
|
|
1714
1714
|
//#region src/components/blocks/auth/login-block.tsx
|
|
1715
|
-
function
|
|
1715
|
+
function mn({ title: e = "Login to your account", description: t = "Enter your email and password to login", logo: n, accent: o, providers: s = [
|
|
1716
1716
|
"google",
|
|
1717
1717
|
"apple",
|
|
1718
1718
|
"github"
|
|
1719
1719
|
], showRememberMe: c = !0, showForgotPassword: l = !0, onSubmit: u, onProviderSelect: d, onForgotPassword: f, onSignup: p }) {
|
|
1720
|
-
let m =
|
|
1721
|
-
async function
|
|
1722
|
-
if (e.preventDefault(), !
|
|
1720
|
+
let m = P.useId(), h = P.useId(), [g, _] = P.useState("idle"), [v, y] = P.useState(null), [b, x] = P.useState(null), [S, C] = P.useState(!1), [w, T] = P.useState(""), [E, D] = P.useState(!1), [O, k] = P.useState(""), A = g === "loading" || b !== null, j = O.trim().length > 0, M = E && j;
|
|
1721
|
+
async function N(e) {
|
|
1722
|
+
if (e.preventDefault(), !M) return;
|
|
1723
1723
|
let t = new FormData(e.currentTarget);
|
|
1724
1724
|
y(null), _("loading");
|
|
1725
1725
|
try {
|
|
@@ -1732,7 +1732,7 @@ function ln({ title: e = "Login to your account", description: t = "Enter your e
|
|
|
1732
1732
|
_("idle"), y(e instanceof Error ? e.message : "Unable to login.");
|
|
1733
1733
|
}
|
|
1734
1734
|
}
|
|
1735
|
-
async function
|
|
1735
|
+
async function ee(e) {
|
|
1736
1736
|
y(null), x(e);
|
|
1737
1737
|
try {
|
|
1738
1738
|
await d?.(e), _("success");
|
|
@@ -1742,7 +1742,7 @@ function ln({ title: e = "Login to your account", description: t = "Enter your e
|
|
|
1742
1742
|
x(null);
|
|
1743
1743
|
}
|
|
1744
1744
|
}
|
|
1745
|
-
return /* @__PURE__ */ i(
|
|
1745
|
+
return /* @__PURE__ */ i(rn, {
|
|
1746
1746
|
title: e,
|
|
1747
1747
|
description: t,
|
|
1748
1748
|
logo: n,
|
|
@@ -1750,29 +1750,29 @@ function ln({ title: e = "Login to your account", description: t = "Enter your e
|
|
|
1750
1750
|
footer: g !== "success" && /* @__PURE__ */ a(r, { children: [
|
|
1751
1751
|
"Don't have an account?",
|
|
1752
1752
|
" ",
|
|
1753
|
-
/* @__PURE__ */ i(
|
|
1753
|
+
/* @__PURE__ */ i(Y, {
|
|
1754
1754
|
variant: "link",
|
|
1755
1755
|
onClick: p,
|
|
1756
1756
|
children: "Sign up"
|
|
1757
1757
|
})
|
|
1758
1758
|
] }),
|
|
1759
|
-
children: /* @__PURE__ */ i(
|
|
1759
|
+
children: /* @__PURE__ */ i(an, {
|
|
1760
1760
|
step: g === "success" ? "success" : "form",
|
|
1761
|
-
children: g === "success" ? /* @__PURE__ */ i(
|
|
1761
|
+
children: g === "success" ? /* @__PURE__ */ i(sn, {
|
|
1762
1762
|
title: "Welcome back",
|
|
1763
1763
|
description: "You are now logged in."
|
|
1764
1764
|
}) : /* @__PURE__ */ a("div", {
|
|
1765
1765
|
className: "flex flex-col gap-4",
|
|
1766
1766
|
children: [/* @__PURE__ */ a("form", {
|
|
1767
1767
|
className: "flex flex-col gap-4",
|
|
1768
|
-
onSubmit:
|
|
1768
|
+
onSubmit: N,
|
|
1769
1769
|
children: [
|
|
1770
|
-
/* @__PURE__ */ a(
|
|
1770
|
+
/* @__PURE__ */ a(X, {
|
|
1771
1771
|
name: "email",
|
|
1772
|
-
children: [/* @__PURE__ */ i(
|
|
1772
|
+
children: [/* @__PURE__ */ i(Z, {
|
|
1773
1773
|
htmlFor: m,
|
|
1774
1774
|
children: "Email"
|
|
1775
|
-
}), /* @__PURE__ */ i(
|
|
1775
|
+
}), /* @__PURE__ */ i(pt, {
|
|
1776
1776
|
id: m,
|
|
1777
1777
|
"aria-label": "Email",
|
|
1778
1778
|
name: "email",
|
|
@@ -1780,32 +1780,32 @@ function ln({ title: e = "Login to your account", description: t = "Enter your e
|
|
|
1780
1780
|
autoComplete: "email",
|
|
1781
1781
|
placeholder: "you@example.com",
|
|
1782
1782
|
required: !0,
|
|
1783
|
-
disabled:
|
|
1783
|
+
disabled: A,
|
|
1784
1784
|
value: w,
|
|
1785
1785
|
onChange: (e) => {
|
|
1786
1786
|
T(e.currentTarget.value), D(e.currentTarget.validity.valid);
|
|
1787
1787
|
}
|
|
1788
1788
|
})]
|
|
1789
1789
|
}),
|
|
1790
|
-
/* @__PURE__ */ i(
|
|
1790
|
+
/* @__PURE__ */ i($, {
|
|
1791
1791
|
show: E,
|
|
1792
|
-
children: /* @__PURE__ */ a(
|
|
1792
|
+
children: /* @__PURE__ */ a(X, {
|
|
1793
1793
|
name: "password",
|
|
1794
1794
|
children: [
|
|
1795
|
-
/* @__PURE__ */ i(
|
|
1795
|
+
/* @__PURE__ */ i(Z, {
|
|
1796
1796
|
htmlFor: "password",
|
|
1797
1797
|
children: "Password"
|
|
1798
1798
|
}),
|
|
1799
|
-
/* @__PURE__ */ i(
|
|
1799
|
+
/* @__PURE__ */ i(Jt, {
|
|
1800
1800
|
id: "password",
|
|
1801
1801
|
name: "password",
|
|
1802
1802
|
autoComplete: "current-password",
|
|
1803
1803
|
required: !0,
|
|
1804
|
-
disabled:
|
|
1804
|
+
disabled: A,
|
|
1805
1805
|
value: O,
|
|
1806
1806
|
onChange: (e) => k(e.target.value)
|
|
1807
1807
|
}),
|
|
1808
|
-
l && /* @__PURE__ */ i(
|
|
1808
|
+
l && /* @__PURE__ */ i(Y, {
|
|
1809
1809
|
variant: "link",
|
|
1810
1810
|
type: "button",
|
|
1811
1811
|
className: "self-end font-normal text-muted-foreground text-xs hover:text-foreground sm:text-xs",
|
|
@@ -1821,34 +1821,34 @@ function ln({ title: e = "Login to your account", description: t = "Enter your e
|
|
|
1821
1821
|
id: h,
|
|
1822
1822
|
checked: S,
|
|
1823
1823
|
onCheckedChange: (e) => C(e),
|
|
1824
|
-
disabled:
|
|
1825
|
-
}), /* @__PURE__ */ i(
|
|
1824
|
+
disabled: A
|
|
1825
|
+
}), /* @__PURE__ */ i(xt, {
|
|
1826
1826
|
htmlFor: h,
|
|
1827
1827
|
className: "font-normal",
|
|
1828
1828
|
children: "Remember me"
|
|
1829
1829
|
})]
|
|
1830
1830
|
}),
|
|
1831
|
-
/* @__PURE__ */ i(
|
|
1832
|
-
/* @__PURE__ */ i(
|
|
1833
|
-
show:
|
|
1834
|
-
children: /* @__PURE__ */ i(
|
|
1835
|
-
className:
|
|
1831
|
+
/* @__PURE__ */ i(on, { message: v }),
|
|
1832
|
+
/* @__PURE__ */ i($, {
|
|
1833
|
+
show: M,
|
|
1834
|
+
children: /* @__PURE__ */ i(Y, {
|
|
1835
|
+
className: J("w-full", o && "border-transparent bg-[var(--auth-accent)] bg-[image:var(--auth-accent-image)] text-[var(--auth-accent-foreground)] shadow-none hover:bg-[var(--auth-accent)] hover:brightness-110 data-pressed:bg-[var(--auth-accent)] data-pressed:brightness-110 *:data-[slot=button-loading-indicator]:text-[var(--auth-accent-foreground)]"),
|
|
1836
1836
|
type: "submit",
|
|
1837
1837
|
loading: g === "loading",
|
|
1838
|
-
disabled:
|
|
1838
|
+
disabled: A,
|
|
1839
1839
|
children: "Login"
|
|
1840
1840
|
})
|
|
1841
1841
|
})
|
|
1842
1842
|
]
|
|
1843
|
-
}), s.length > 0 && /* @__PURE__ */ a(
|
|
1844
|
-
show: !
|
|
1843
|
+
}), s.length > 0 && /* @__PURE__ */ a($, {
|
|
1844
|
+
show: !M,
|
|
1845
1845
|
className: "flex flex-col gap-4",
|
|
1846
|
-
children: [/* @__PURE__ */ i(
|
|
1846
|
+
children: [/* @__PURE__ */ i(cn, { label: "Or continue with" }), /* @__PURE__ */ i(Qt, {
|
|
1847
1847
|
providers: s,
|
|
1848
1848
|
action: "login",
|
|
1849
1849
|
loadingProvider: b,
|
|
1850
1850
|
disabled: g === "loading",
|
|
1851
|
-
onSelect:
|
|
1851
|
+
onSelect: ee
|
|
1852
1852
|
})]
|
|
1853
1853
|
})]
|
|
1854
1854
|
})
|
|
@@ -1857,10 +1857,10 @@ function ln({ title: e = "Login to your account", description: t = "Enter your e
|
|
|
1857
1857
|
}
|
|
1858
1858
|
//#endregion
|
|
1859
1859
|
//#region src/components/blocks/auth/onboarding/profile-step.tsx
|
|
1860
|
-
function
|
|
1860
|
+
function hn(e, t) {
|
|
1861
1861
|
return e.kind === "checkbox" ? typeof t == "boolean" && t : typeof t == "string" ? t : "";
|
|
1862
1862
|
}
|
|
1863
|
-
function
|
|
1863
|
+
function gn(e, t) {
|
|
1864
1864
|
let n = e.required === !0;
|
|
1865
1865
|
if (e.kind === "checkbox") return n && t !== !0 ? `${e.label} is required` : null;
|
|
1866
1866
|
let r = typeof t == "string" ? t.trim() : "";
|
|
@@ -1872,8 +1872,8 @@ function dn(e, t) {
|
|
|
1872
1872
|
}
|
|
1873
1873
|
return e.kind === "select" && r.length > 0 && !e.options.map((e) => e.value).includes(r) ? `Choose a valid option for ${e.label}` : e.validate?.(r) ?? null;
|
|
1874
1874
|
}
|
|
1875
|
-
function
|
|
1876
|
-
let l =
|
|
1875
|
+
function _n({ step: e, values: t, submitting: n = !1, submitLabel: r, onSubmit: o, onBack: s, onDraftChange: c }) {
|
|
1876
|
+
let l = P.useId(), [u, d] = P.useState(() => Object.fromEntries(e.fields.map((e) => [e.name, hn(e, t[e.name])]))), [f, p] = P.useState({});
|
|
1877
1877
|
function m(e, t) {
|
|
1878
1878
|
d((n) => ({
|
|
1879
1879
|
...n,
|
|
@@ -1887,7 +1887,7 @@ function fn({ step: e, values: t, submitting: n = !1, submitLabel: r, onSubmit:
|
|
|
1887
1887
|
if (t.preventDefault(), n) return;
|
|
1888
1888
|
let r = {};
|
|
1889
1889
|
for (let t of e.fields) {
|
|
1890
|
-
let e =
|
|
1890
|
+
let e = gn(t, u[t.name]);
|
|
1891
1891
|
e && (r[t.name] = e);
|
|
1892
1892
|
}
|
|
1893
1893
|
if (Object.keys(r).length > 0) {
|
|
@@ -1908,7 +1908,7 @@ function fn({ step: e, values: t, submitting: n = !1, submitLabel: r, onSubmit:
|
|
|
1908
1908
|
onSubmit: h,
|
|
1909
1909
|
children: [e.fields.map((e) => {
|
|
1910
1910
|
let t = f[e.name] || void 0, r = `${l}-${e.name}`, o = u[e.name];
|
|
1911
|
-
return e.kind === "checkbox" ? /* @__PURE__ */ a(
|
|
1911
|
+
return e.kind === "checkbox" ? /* @__PURE__ */ a(X, {
|
|
1912
1912
|
name: e.name,
|
|
1913
1913
|
invalid: !!t,
|
|
1914
1914
|
className: "gap-1.5",
|
|
@@ -1919,7 +1919,7 @@ function fn({ step: e, values: t, submitting: n = !1, submitLabel: r, onSubmit:
|
|
|
1919
1919
|
checked: o === !0,
|
|
1920
1920
|
disabled: n,
|
|
1921
1921
|
onCheckedChange: (t) => m(e.name, t)
|
|
1922
|
-
}), /* @__PURE__ */ i(
|
|
1922
|
+
}), /* @__PURE__ */ i(xt, {
|
|
1923
1923
|
htmlFor: r,
|
|
1924
1924
|
className: "font-normal",
|
|
1925
1925
|
children: e.label
|
|
@@ -1928,15 +1928,15 @@ function fn({ step: e, values: t, submitting: n = !1, submitLabel: r, onSubmit:
|
|
|
1928
1928
|
match: !0,
|
|
1929
1929
|
children: t
|
|
1930
1930
|
})]
|
|
1931
|
-
}, e.name) : /* @__PURE__ */ a(
|
|
1931
|
+
}, e.name) : /* @__PURE__ */ a(X, {
|
|
1932
1932
|
name: e.name,
|
|
1933
1933
|
invalid: !!t,
|
|
1934
1934
|
children: [
|
|
1935
|
-
/* @__PURE__ */ i(
|
|
1935
|
+
/* @__PURE__ */ i(Z, {
|
|
1936
1936
|
htmlFor: r,
|
|
1937
1937
|
children: e.label
|
|
1938
1938
|
}),
|
|
1939
|
-
e.kind === "textarea" ? /* @__PURE__ */ i(
|
|
1939
|
+
e.kind === "textarea" ? /* @__PURE__ */ i(mt, {
|
|
1940
1940
|
id: r,
|
|
1941
1941
|
"aria-invalid": t ? !0 : void 0,
|
|
1942
1942
|
disabled: n,
|
|
@@ -1946,7 +1946,7 @@ function fn({ step: e, values: t, submitting: n = !1, submitLabel: r, onSubmit:
|
|
|
1946
1946
|
}) : e.kind === "select" ? /* @__PURE__ */ a("select", {
|
|
1947
1947
|
id: r,
|
|
1948
1948
|
"aria-invalid": t ? !0 : void 0,
|
|
1949
|
-
className:
|
|
1949
|
+
className: J("h-8.5 w-full rounded-lg border border-input bg-background px-[calc(--spacing(3)-1px)] text-base text-foreground shadow-xs/5 outline-none transition-[box-shadow,border-color] duration-150 ease-smooth-out focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/24 disabled:opacity-64 aria-invalid:border-destructive/36 sm:h-7.5 sm:text-sm dark:bg-input/32"),
|
|
1950
1950
|
disabled: n,
|
|
1951
1951
|
value: String(o ?? ""),
|
|
1952
1952
|
onChange: (t) => m(e.name, t.target.value),
|
|
@@ -1957,7 +1957,7 @@ function fn({ step: e, values: t, submitting: n = !1, submitLabel: r, onSubmit:
|
|
|
1957
1957
|
value: e.value,
|
|
1958
1958
|
children: e.label
|
|
1959
1959
|
}, e.value))]
|
|
1960
|
-
}) : /* @__PURE__ */ i(
|
|
1960
|
+
}) : /* @__PURE__ */ i(pt, {
|
|
1961
1961
|
id: r,
|
|
1962
1962
|
"aria-invalid": t ? !0 : void 0,
|
|
1963
1963
|
disabled: n,
|
|
@@ -1974,13 +1974,13 @@ function fn({ step: e, values: t, submitting: n = !1, submitLabel: r, onSubmit:
|
|
|
1974
1974
|
}, e.name);
|
|
1975
1975
|
}), /* @__PURE__ */ a("div", {
|
|
1976
1976
|
className: "flex gap-2",
|
|
1977
|
-
children: [s && /* @__PURE__ */ i(
|
|
1977
|
+
children: [s && /* @__PURE__ */ i(Y, {
|
|
1978
1978
|
type: "button",
|
|
1979
1979
|
variant: "outline",
|
|
1980
1980
|
disabled: n,
|
|
1981
1981
|
onClick: s,
|
|
1982
1982
|
children: "Back"
|
|
1983
|
-
}), /* @__PURE__ */ i(
|
|
1983
|
+
}), /* @__PURE__ */ i(Y, {
|
|
1984
1984
|
className: "flex-1",
|
|
1985
1985
|
type: "submit",
|
|
1986
1986
|
loading: n,
|
|
@@ -1991,7 +1991,7 @@ function fn({ step: e, values: t, submitting: n = !1, submitLabel: r, onSubmit:
|
|
|
1991
1991
|
}
|
|
1992
1992
|
//#endregion
|
|
1993
1993
|
//#region src/components/blocks/auth/onboarding-block.tsx
|
|
1994
|
-
var
|
|
1994
|
+
var vn = [{
|
|
1995
1995
|
id: "profile",
|
|
1996
1996
|
title: "Your profile",
|
|
1997
1997
|
fields: [{
|
|
@@ -2001,9 +2001,9 @@ var pn = [{
|
|
|
2001
2001
|
required: !0
|
|
2002
2002
|
}]
|
|
2003
2003
|
}];
|
|
2004
|
-
function
|
|
2005
|
-
let l =
|
|
2006
|
-
|
|
2004
|
+
function yn({ steps: e = vn, logo: t, accent: n, onStepSubmit: r, onComplete: o, showCompleteScreen: s = !0, className: c }) {
|
|
2005
|
+
let l = P.useRef(null), u = P.useRef({}), [d, f] = P.useState({}), [p, m] = P.useState(0), [h, g] = P.useState({}), [_, v] = P.useState("idle"), [y, b] = P.useState(null), x = _ === "success", S = e[p], C = p >= e.length - 1;
|
|
2006
|
+
P.useEffect(() => {
|
|
2007
2007
|
y || l.current?.focus();
|
|
2008
2008
|
}, [
|
|
2009
2009
|
p,
|
|
@@ -2023,15 +2023,15 @@ function mn({ steps: e = pn, logo: t, accent: n, onStepSubmit: r, onComplete: o,
|
|
|
2023
2023
|
v("idle"), b(e instanceof Error ? e.message : "Unable to save your profile.");
|
|
2024
2024
|
}
|
|
2025
2025
|
}
|
|
2026
|
-
return x && !s ? null : /* @__PURE__ */ i(
|
|
2026
|
+
return x && !s ? null : /* @__PURE__ */ i(rn, {
|
|
2027
2027
|
title: x ? "You're all set" : S?.title ?? "Your profile",
|
|
2028
2028
|
description: x ? void 0 : S?.description,
|
|
2029
2029
|
logo: t,
|
|
2030
2030
|
accent: n,
|
|
2031
2031
|
className: c,
|
|
2032
|
-
children: /* @__PURE__ */ i(
|
|
2032
|
+
children: /* @__PURE__ */ i(an, {
|
|
2033
2033
|
step: x ? "done" : `step-${p}`,
|
|
2034
|
-
children: x ? /* @__PURE__ */ i(
|
|
2034
|
+
children: x ? /* @__PURE__ */ i(sn, {
|
|
2035
2035
|
title: "Profile saved",
|
|
2036
2036
|
description: "Your account is ready and your profile has been saved."
|
|
2037
2037
|
}) : S ? /* @__PURE__ */ a("div", {
|
|
@@ -2043,7 +2043,7 @@ function mn({ steps: e = pn, logo: t, accent: n, onStepSubmit: r, onComplete: o,
|
|
|
2043
2043
|
className: "flex flex-wrap gap-x-3 gap-y-1 text-xs",
|
|
2044
2044
|
children: e.map((e, t) => /* @__PURE__ */ a("li", {
|
|
2045
2045
|
"aria-current": t === p ? "step" : void 0,
|
|
2046
|
-
className:
|
|
2046
|
+
className: J("text-muted-foreground", t === p && "font-medium text-foreground"),
|
|
2047
2047
|
children: [e.title, t < p && /* @__PURE__ */ i("span", {
|
|
2048
2048
|
className: "sr-only",
|
|
2049
2049
|
children: " (completed)"
|
|
@@ -2057,8 +2057,8 @@ function mn({ steps: e = pn, logo: t, accent: n, onStepSubmit: r, onComplete: o,
|
|
|
2057
2057
|
className: "sr-only",
|
|
2058
2058
|
children: S.title
|
|
2059
2059
|
}),
|
|
2060
|
-
/* @__PURE__ */ i(
|
|
2061
|
-
/* @__PURE__ */ i(
|
|
2060
|
+
/* @__PURE__ */ i(on, { message: y }),
|
|
2061
|
+
/* @__PURE__ */ i(_n, {
|
|
2062
2062
|
step: S,
|
|
2063
2063
|
values: {
|
|
2064
2064
|
...h,
|
|
@@ -2084,14 +2084,14 @@ function mn({ steps: e = pn, logo: t, accent: n, onStepSubmit: r, onComplete: o,
|
|
|
2084
2084
|
}
|
|
2085
2085
|
//#endregion
|
|
2086
2086
|
//#region src/components/blocks/auth/passkey-manager-block.tsx
|
|
2087
|
-
var
|
|
2088
|
-
function
|
|
2087
|
+
var bn = 120, xn = "This is your last passkey. After deleting it you won't be able to sign in with a passkey until you register a new one.";
|
|
2088
|
+
function Sn(e) {
|
|
2089
2089
|
if (!e) return null;
|
|
2090
2090
|
let t = new Date(e);
|
|
2091
2091
|
return Number.isNaN(t.getTime()) ? null : t.toLocaleDateString();
|
|
2092
2092
|
}
|
|
2093
|
-
function
|
|
2094
|
-
let [d, f] =
|
|
2093
|
+
function Cn({ title: e = "Passkeys", description: t = "Sign in without a password using your device's biometrics or security key.", passkeys: n = [], available: r = !0, loading: o = !1, onRegister: s, onRename: c, onDelete: l, className: u }) {
|
|
2094
|
+
let [d, f] = P.useState(null), [p, m] = P.useState(!1), [h, g] = P.useState(!1), [_, v] = P.useState(null), [y, b] = P.useState(""), [S, C] = P.useState(null), [w, T] = P.useState(null), E = n.length === 1;
|
|
2095
2095
|
async function D(e) {
|
|
2096
2096
|
if (p) return { ok: !1 };
|
|
2097
2097
|
f(null), m(!0);
|
|
@@ -2110,45 +2110,45 @@ function vn({ title: e = "Passkeys", description: t = "Sign in without a passwor
|
|
|
2110
2110
|
g(!0), await D(() => s?.()), g(!1);
|
|
2111
2111
|
}
|
|
2112
2112
|
function k(e) {
|
|
2113
|
-
T(null),
|
|
2113
|
+
T(null), v(e.id), b(e.name ?? ""), C(null);
|
|
2114
2114
|
}
|
|
2115
|
-
async function
|
|
2116
|
-
let t =
|
|
2117
|
-
if (t.length < 1 || t.length >
|
|
2118
|
-
C(`Name must be between 1 and ${
|
|
2115
|
+
async function A(e) {
|
|
2116
|
+
let t = y.trim();
|
|
2117
|
+
if (t.length < 1 || t.length > bn) {
|
|
2118
|
+
C(`Name must be between 1 and ${bn} characters.`);
|
|
2119
2119
|
return;
|
|
2120
2120
|
}
|
|
2121
|
-
(await D(() => c?.(e, t))).ok && (
|
|
2121
|
+
(await D(() => c?.(e, t))).ok && (v(null), C(null));
|
|
2122
2122
|
}
|
|
2123
|
-
async function
|
|
2123
|
+
async function j(e) {
|
|
2124
2124
|
let t = await D(() => l?.(e));
|
|
2125
|
-
T(null), t.ok &&
|
|
2125
|
+
T(null), t.ok && _ === e && v(null);
|
|
2126
2126
|
}
|
|
2127
2127
|
return /* @__PURE__ */ i(ye, {
|
|
2128
2128
|
reducedMotion: "user",
|
|
2129
2129
|
children: /* @__PURE__ */ a(ze, {
|
|
2130
|
-
className:
|
|
2130
|
+
className: J("w-full", u),
|
|
2131
2131
|
"data-slot": "auth-block",
|
|
2132
2132
|
children: [/* @__PURE__ */ a(Ke, { children: [/* @__PURE__ */ i(qe, { children: e }), /* @__PURE__ */ i(Je, { children: t })] }), /* @__PURE__ */ i(Xe, { children: r ? o ? /* @__PURE__ */ a("div", {
|
|
2133
2133
|
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
2134
2134
|
children: [/* @__PURE__ */ i(ke, { className: "size-4" }), "Loading passkeys…"]
|
|
2135
|
-
}) : /* @__PURE__ */ a(
|
|
2135
|
+
}) : /* @__PURE__ */ a(q.div, {
|
|
2136
2136
|
layout: !0,
|
|
2137
2137
|
transition: {
|
|
2138
2138
|
duration: .3,
|
|
2139
|
-
ease:
|
|
2139
|
+
ease: Q
|
|
2140
2140
|
},
|
|
2141
2141
|
className: "flex flex-col gap-3",
|
|
2142
2142
|
children: [
|
|
2143
|
-
/* @__PURE__ */ i(
|
|
2143
|
+
/* @__PURE__ */ i(on, { message: d }),
|
|
2144
2144
|
n.length > 0 ? /* @__PURE__ */ i("ul", {
|
|
2145
2145
|
"aria-label": "Passkeys",
|
|
2146
2146
|
className: "flex flex-col gap-2",
|
|
2147
|
-
children: /* @__PURE__ */ i(
|
|
2147
|
+
children: /* @__PURE__ */ i(K, {
|
|
2148
2148
|
initial: !1,
|
|
2149
2149
|
children: n.map((e, t) => {
|
|
2150
|
-
let n = e.name ?? "Passkey", r =
|
|
2151
|
-
return /* @__PURE__ */ a(
|
|
2150
|
+
let n = e.name ?? "Passkey", r = Sn(e.createdAt), o = Sn(e.lastUsedAt);
|
|
2151
|
+
return /* @__PURE__ */ a(q.li, {
|
|
2152
2152
|
layout: !0,
|
|
2153
2153
|
className: "flex flex-col gap-2 rounded-lg border px-3 py-2",
|
|
2154
2154
|
initial: {
|
|
@@ -2165,7 +2165,7 @@ function vn({ title: e = "Passkeys", description: t = "Sign in without a passwor
|
|
|
2165
2165
|
},
|
|
2166
2166
|
transition: {
|
|
2167
2167
|
duration: .25,
|
|
2168
|
-
ease:
|
|
2168
|
+
ease: Q,
|
|
2169
2169
|
delay: Math.min(t, 5) * .04
|
|
2170
2170
|
},
|
|
2171
2171
|
children: [
|
|
@@ -2176,7 +2176,7 @@ function vn({ title: e = "Passkeys", description: t = "Sign in without a passwor
|
|
|
2176
2176
|
children: [/* @__PURE__ */ i("span", {
|
|
2177
2177
|
"aria-hidden": "true",
|
|
2178
2178
|
className: "grid size-8 shrink-0 place-items-center rounded-md bg-muted text-muted-foreground",
|
|
2179
|
-
children: /* @__PURE__ */ i(
|
|
2179
|
+
children: /* @__PURE__ */ i(x, { className: "size-4" })
|
|
2180
2180
|
}), /* @__PURE__ */ a("div", {
|
|
2181
2181
|
className: "flex min-w-0 flex-col",
|
|
2182
2182
|
children: [/* @__PURE__ */ i("span", {
|
|
@@ -2193,7 +2193,7 @@ function vn({ title: e = "Passkeys", description: t = "Sign in without a passwor
|
|
|
2193
2193
|
})]
|
|
2194
2194
|
}), /* @__PURE__ */ a("div", {
|
|
2195
2195
|
className: "flex shrink-0 gap-2",
|
|
2196
|
-
children: [/* @__PURE__ */ i(
|
|
2196
|
+
children: [/* @__PURE__ */ i(Y, {
|
|
2197
2197
|
"aria-label": `Rename ${n}`,
|
|
2198
2198
|
size: "sm",
|
|
2199
2199
|
type: "button",
|
|
@@ -2201,43 +2201,43 @@ function vn({ title: e = "Passkeys", description: t = "Sign in without a passwor
|
|
|
2201
2201
|
disabled: p,
|
|
2202
2202
|
onClick: () => k(e),
|
|
2203
2203
|
children: "Rename"
|
|
2204
|
-
}), /* @__PURE__ */ i(
|
|
2204
|
+
}), /* @__PURE__ */ i(Y, {
|
|
2205
2205
|
"aria-label": `Delete ${n}`,
|
|
2206
2206
|
size: "sm",
|
|
2207
2207
|
type: "button",
|
|
2208
2208
|
variant: "destructive-outline",
|
|
2209
2209
|
disabled: p,
|
|
2210
2210
|
onClick: () => {
|
|
2211
|
-
|
|
2211
|
+
v(null), T(e.id);
|
|
2212
2212
|
},
|
|
2213
2213
|
children: "Delete"
|
|
2214
2214
|
})]
|
|
2215
2215
|
})]
|
|
2216
2216
|
}),
|
|
2217
|
-
/* @__PURE__ */ i(
|
|
2218
|
-
show:
|
|
2217
|
+
/* @__PURE__ */ i($, {
|
|
2218
|
+
show: _ === e.id,
|
|
2219
2219
|
children: /* @__PURE__ */ a("form", {
|
|
2220
2220
|
className: "flex items-start gap-2 pt-1",
|
|
2221
2221
|
onSubmit: (t) => {
|
|
2222
|
-
t.preventDefault(),
|
|
2222
|
+
t.preventDefault(), A(e.id);
|
|
2223
2223
|
},
|
|
2224
2224
|
children: [
|
|
2225
|
-
/* @__PURE__ */ a(
|
|
2225
|
+
/* @__PURE__ */ a(X, {
|
|
2226
2226
|
className: "min-w-0 grow",
|
|
2227
2227
|
invalid: !!S,
|
|
2228
2228
|
children: [
|
|
2229
|
-
/* @__PURE__ */ i(
|
|
2229
|
+
/* @__PURE__ */ i(Z, {
|
|
2230
2230
|
className: "sr-only",
|
|
2231
2231
|
children: "Passkey name"
|
|
2232
2232
|
}),
|
|
2233
|
-
/* @__PURE__ */ i(
|
|
2233
|
+
/* @__PURE__ */ i(pt, {
|
|
2234
2234
|
"aria-label": "Passkey name",
|
|
2235
2235
|
"aria-invalid": S ? !0 : void 0,
|
|
2236
2236
|
autoFocus: !0,
|
|
2237
2237
|
disabled: p,
|
|
2238
2238
|
maxLength: 121,
|
|
2239
|
-
value:
|
|
2240
|
-
onChange: (e) =>
|
|
2239
|
+
value: y,
|
|
2240
|
+
onChange: (e) => b(e.target.value)
|
|
2241
2241
|
}),
|
|
2242
2242
|
S && /* @__PURE__ */ i(it, {
|
|
2243
2243
|
match: !0,
|
|
@@ -2245,24 +2245,24 @@ function vn({ title: e = "Passkeys", description: t = "Sign in without a passwor
|
|
|
2245
2245
|
})
|
|
2246
2246
|
]
|
|
2247
2247
|
}),
|
|
2248
|
-
/* @__PURE__ */ i(
|
|
2248
|
+
/* @__PURE__ */ i(Y, {
|
|
2249
2249
|
size: "sm",
|
|
2250
2250
|
type: "submit",
|
|
2251
2251
|
loading: p,
|
|
2252
2252
|
children: "Save"
|
|
2253
2253
|
}),
|
|
2254
|
-
/* @__PURE__ */ i(
|
|
2254
|
+
/* @__PURE__ */ i(Y, {
|
|
2255
2255
|
size: "sm",
|
|
2256
2256
|
type: "button",
|
|
2257
2257
|
variant: "ghost",
|
|
2258
2258
|
disabled: p,
|
|
2259
|
-
onClick: () =>
|
|
2259
|
+
onClick: () => v(null),
|
|
2260
2260
|
children: "Cancel"
|
|
2261
2261
|
})
|
|
2262
2262
|
]
|
|
2263
2263
|
})
|
|
2264
2264
|
}),
|
|
2265
|
-
/* @__PURE__ */ i(
|
|
2265
|
+
/* @__PURE__ */ i($, {
|
|
2266
2266
|
show: w === e.id,
|
|
2267
2267
|
children: /* @__PURE__ */ a("div", {
|
|
2268
2268
|
className: "flex flex-col gap-2 rounded-lg bg-muted/50 p-2",
|
|
@@ -2275,18 +2275,18 @@ function vn({ title: e = "Passkeys", description: t = "Sign in without a passwor
|
|
|
2275
2275
|
}),
|
|
2276
2276
|
E && /* @__PURE__ */ i("p", {
|
|
2277
2277
|
className: "text-xs text-destructive-foreground",
|
|
2278
|
-
children:
|
|
2278
|
+
children: xn
|
|
2279
2279
|
}),
|
|
2280
2280
|
/* @__PURE__ */ a("div", {
|
|
2281
2281
|
className: "flex gap-2",
|
|
2282
|
-
children: [/* @__PURE__ */ i(
|
|
2282
|
+
children: [/* @__PURE__ */ i(Y, {
|
|
2283
2283
|
size: "sm",
|
|
2284
2284
|
type: "button",
|
|
2285
2285
|
variant: "destructive",
|
|
2286
2286
|
loading: p,
|
|
2287
|
-
onClick: () => void
|
|
2287
|
+
onClick: () => void j(e.id),
|
|
2288
2288
|
children: "Delete passkey"
|
|
2289
|
-
}), /* @__PURE__ */ i(
|
|
2289
|
+
}), /* @__PURE__ */ i(Y, {
|
|
2290
2290
|
size: "sm",
|
|
2291
2291
|
type: "button",
|
|
2292
2292
|
variant: "ghost",
|
|
@@ -2306,7 +2306,7 @@ function vn({ title: e = "Passkeys", description: t = "Sign in without a passwor
|
|
|
2306
2306
|
className: "text-sm text-muted-foreground",
|
|
2307
2307
|
children: "No passkeys registered yet. Add one to sign in without a password."
|
|
2308
2308
|
}),
|
|
2309
|
-
/* @__PURE__ */ i(
|
|
2309
|
+
/* @__PURE__ */ i(Y, {
|
|
2310
2310
|
className: "w-full",
|
|
2311
2311
|
type: "button",
|
|
2312
2312
|
variant: "outline",
|
|
@@ -2325,8 +2325,8 @@ function vn({ title: e = "Passkeys", description: t = "Sign in without a passwor
|
|
|
2325
2325
|
}
|
|
2326
2326
|
//#endregion
|
|
2327
2327
|
//#region src/components/blocks/auth/passkey-sign-in-block.tsx
|
|
2328
|
-
function
|
|
2329
|
-
let [s, c] =
|
|
2328
|
+
function wn({ available: e = !0, label: t = "Sign in with a passkey", onSignIn: n, fallbackHint: r = "You can still sign in with your other methods below.", className: o }) {
|
|
2329
|
+
let [s, c] = P.useState(null), [l, u] = P.useState(!1);
|
|
2330
2330
|
if (!e) return null;
|
|
2331
2331
|
async function d() {
|
|
2332
2332
|
if (!l) {
|
|
@@ -2341,21 +2341,21 @@ function yn({ available: e = !0, label: t = "Sign in with a passkey", onSignIn:
|
|
|
2341
2341
|
}
|
|
2342
2342
|
}
|
|
2343
2343
|
return /* @__PURE__ */ a("div", {
|
|
2344
|
-
className:
|
|
2344
|
+
className: J("flex w-full flex-col gap-2", o),
|
|
2345
2345
|
children: [
|
|
2346
|
-
/* @__PURE__ */ a(
|
|
2346
|
+
/* @__PURE__ */ a(Y, {
|
|
2347
2347
|
variant: "outline",
|
|
2348
2348
|
className: "w-full",
|
|
2349
2349
|
type: "button",
|
|
2350
2350
|
loading: l,
|
|
2351
2351
|
onClick: () => void d(),
|
|
2352
|
-
children: [/* @__PURE__ */ i(
|
|
2352
|
+
children: [/* @__PURE__ */ i(v, { "aria-hidden": "true" }), /* @__PURE__ */ i("span", {
|
|
2353
2353
|
className: "flex-1",
|
|
2354
2354
|
children: t
|
|
2355
2355
|
})]
|
|
2356
2356
|
}),
|
|
2357
|
-
/* @__PURE__ */ i(
|
|
2358
|
-
/* @__PURE__ */ i(
|
|
2357
|
+
/* @__PURE__ */ i(on, { message: s }),
|
|
2358
|
+
/* @__PURE__ */ i($, {
|
|
2359
2359
|
show: !!s && !!r,
|
|
2360
2360
|
children: /* @__PURE__ */ i("p", {
|
|
2361
2361
|
className: "text-xs text-muted-foreground",
|
|
@@ -2367,22 +2367,22 @@ function yn({ available: e = !0, label: t = "Sign in with a passkey", onSignIn:
|
|
|
2367
2367
|
}
|
|
2368
2368
|
//#endregion
|
|
2369
2369
|
//#region src/components/blocks/auth/signup-block.tsx
|
|
2370
|
-
function
|
|
2370
|
+
function Tn({ title: e = "Create your account", description: t = "Start exploring manuscripts in minutes", logo: n, accent: o, providers: s = [
|
|
2371
2371
|
"google",
|
|
2372
2372
|
"apple",
|
|
2373
2373
|
"github"
|
|
2374
2374
|
], showNameField: c = !0, showTerms: l = !0, termsChecked: u, defaultTermsChecked: d = !1, onTermsCheckedChange: f, enforceStrongPassword: p = !0, onSubmit: m, termsComponent: h, onProviderSelect: g, onLogin: _, onTerms: v }) {
|
|
2375
|
-
let y =
|
|
2376
|
-
function
|
|
2377
|
-
u === void 0 &&
|
|
2375
|
+
let y = P.useId(), b = P.useId(), x = P.useId(), S = P.useId(), [C, w] = P.useState("idle"), [T, E] = P.useState(null), [D, O] = P.useState(null), [k, A] = P.useState(""), [j, M] = P.useState(d), N = u ?? j;
|
|
2376
|
+
function ee(e) {
|
|
2377
|
+
u === void 0 && M(e), f?.(e);
|
|
2378
2378
|
}
|
|
2379
|
-
let [
|
|
2380
|
-
async function
|
|
2381
|
-
if (e.preventDefault(), E(null), !
|
|
2379
|
+
let [te, F] = P.useState(!1), [I, L] = P.useState(!1), R = C === "loading" || D !== null, z = !p || Kt(k) === Gt.length, B = k.trim().length > 0 && z, V = (!c || I) && te && B;
|
|
2380
|
+
async function ne(e) {
|
|
2381
|
+
if (e.preventDefault(), E(null), !z) {
|
|
2382
2382
|
E("Please meet all password requirements.");
|
|
2383
2383
|
return;
|
|
2384
2384
|
}
|
|
2385
|
-
if (l && !
|
|
2385
|
+
if (l && !N) {
|
|
2386
2386
|
E("Please accept the terms to continue.");
|
|
2387
2387
|
return;
|
|
2388
2388
|
}
|
|
@@ -2398,7 +2398,7 @@ function bn({ title: e = "Create your account", description: t = "Start explorin
|
|
|
2398
2398
|
w("idle"), E(e instanceof Error ? e.message : "Unable to create account.");
|
|
2399
2399
|
}
|
|
2400
2400
|
}
|
|
2401
|
-
async function
|
|
2401
|
+
async function H(e) {
|
|
2402
2402
|
E(null), O(e);
|
|
2403
2403
|
try {
|
|
2404
2404
|
await g?.(e), w("success");
|
|
@@ -2408,7 +2408,7 @@ function bn({ title: e = "Create your account", description: t = "Start explorin
|
|
|
2408
2408
|
O(null);
|
|
2409
2409
|
}
|
|
2410
2410
|
}
|
|
2411
|
-
return /* @__PURE__ */ i(
|
|
2411
|
+
return /* @__PURE__ */ i(rn, {
|
|
2412
2412
|
title: e,
|
|
2413
2413
|
description: t,
|
|
2414
2414
|
logo: n,
|
|
@@ -2416,55 +2416,55 @@ function bn({ title: e = "Create your account", description: t = "Start explorin
|
|
|
2416
2416
|
footer: C !== "success" && /* @__PURE__ */ a(r, { children: [
|
|
2417
2417
|
"Already have an account?",
|
|
2418
2418
|
" ",
|
|
2419
|
-
/* @__PURE__ */ i(
|
|
2419
|
+
/* @__PURE__ */ i(Y, {
|
|
2420
2420
|
variant: "link",
|
|
2421
2421
|
onClick: _,
|
|
2422
2422
|
children: "Login"
|
|
2423
2423
|
})
|
|
2424
2424
|
] }),
|
|
2425
|
-
children: /* @__PURE__ */ i(
|
|
2425
|
+
children: /* @__PURE__ */ i(an, {
|
|
2426
2426
|
step: C === "success" ? "success" : "form",
|
|
2427
|
-
children: C === "success" ? /* @__PURE__ */ i(
|
|
2427
|
+
children: C === "success" ? /* @__PURE__ */ i(sn, {
|
|
2428
2428
|
title: "Account created",
|
|
2429
2429
|
description: "Check your inbox to confirm your email address."
|
|
2430
2430
|
}) : /* @__PURE__ */ a("div", {
|
|
2431
2431
|
className: "flex flex-col gap-4",
|
|
2432
|
-
children: [s.length > 0 && /* @__PURE__ */ a(
|
|
2433
|
-
show: !
|
|
2432
|
+
children: [s.length > 0 && /* @__PURE__ */ a($, {
|
|
2433
|
+
show: !V,
|
|
2434
2434
|
className: "flex flex-col gap-4",
|
|
2435
|
-
children: [/* @__PURE__ */ i(
|
|
2435
|
+
children: [/* @__PURE__ */ i(Qt, {
|
|
2436
2436
|
providers: s,
|
|
2437
2437
|
action: "signup",
|
|
2438
2438
|
loadingProvider: D,
|
|
2439
2439
|
disabled: C === "loading",
|
|
2440
|
-
onSelect:
|
|
2441
|
-
}), /* @__PURE__ */ i(
|
|
2440
|
+
onSelect: H
|
|
2441
|
+
}), /* @__PURE__ */ i(cn, { label: "Or with email" })]
|
|
2442
2442
|
}), /* @__PURE__ */ a("form", {
|
|
2443
2443
|
className: "flex flex-col gap-4",
|
|
2444
|
-
onSubmit:
|
|
2444
|
+
onSubmit: ne,
|
|
2445
2445
|
children: [
|
|
2446
|
-
c && /* @__PURE__ */ a(
|
|
2446
|
+
c && /* @__PURE__ */ a(X, {
|
|
2447
2447
|
name: "name",
|
|
2448
|
-
children: [/* @__PURE__ */ i(
|
|
2448
|
+
children: [/* @__PURE__ */ i(Z, {
|
|
2449
2449
|
htmlFor: y,
|
|
2450
2450
|
children: "Name"
|
|
2451
|
-
}), /* @__PURE__ */ i(
|
|
2451
|
+
}), /* @__PURE__ */ i(pt, {
|
|
2452
2452
|
"aria-label": "Name",
|
|
2453
2453
|
id: y,
|
|
2454
2454
|
name: "name",
|
|
2455
2455
|
autoComplete: "name",
|
|
2456
2456
|
placeholder: "Your name",
|
|
2457
2457
|
required: !0,
|
|
2458
|
-
disabled:
|
|
2459
|
-
onChange: (e) =>
|
|
2458
|
+
disabled: R,
|
|
2459
|
+
onChange: (e) => L(e.currentTarget.validity.valid)
|
|
2460
2460
|
})]
|
|
2461
2461
|
}),
|
|
2462
|
-
/* @__PURE__ */ a(
|
|
2462
|
+
/* @__PURE__ */ a(X, {
|
|
2463
2463
|
name: "email",
|
|
2464
|
-
children: [/* @__PURE__ */ i(
|
|
2464
|
+
children: [/* @__PURE__ */ i(Z, {
|
|
2465
2465
|
htmlFor: b,
|
|
2466
2466
|
children: "Email"
|
|
2467
|
-
}), /* @__PURE__ */ i(
|
|
2467
|
+
}), /* @__PURE__ */ i(pt, {
|
|
2468
2468
|
id: b,
|
|
2469
2469
|
name: "email",
|
|
2470
2470
|
type: "email",
|
|
@@ -2472,18 +2472,18 @@ function bn({ title: e = "Create your account", description: t = "Start explorin
|
|
|
2472
2472
|
autoComplete: "email",
|
|
2473
2473
|
placeholder: "you@example.com",
|
|
2474
2474
|
required: !0,
|
|
2475
|
-
disabled:
|
|
2476
|
-
onChange: (e) =>
|
|
2475
|
+
disabled: R,
|
|
2476
|
+
onChange: (e) => F(e.currentTarget.validity.valid)
|
|
2477
2477
|
})]
|
|
2478
2478
|
}),
|
|
2479
|
-
/* @__PURE__ */ i(
|
|
2480
|
-
show:
|
|
2481
|
-
children: /* @__PURE__ */ a(
|
|
2479
|
+
/* @__PURE__ */ i($, {
|
|
2480
|
+
show: te,
|
|
2481
|
+
children: /* @__PURE__ */ a(X, {
|
|
2482
2482
|
name: "password",
|
|
2483
|
-
children: [/* @__PURE__ */ i(
|
|
2483
|
+
children: [/* @__PURE__ */ i(Z, {
|
|
2484
2484
|
htmlFor: x,
|
|
2485
2485
|
children: "Password"
|
|
2486
|
-
}), /* @__PURE__ */ i(
|
|
2486
|
+
}), /* @__PURE__ */ i(Jt, {
|
|
2487
2487
|
id: x,
|
|
2488
2488
|
name: "password",
|
|
2489
2489
|
"aria-label": "Password",
|
|
@@ -2491,9 +2491,9 @@ function bn({ title: e = "Create your account", description: t = "Start explorin
|
|
|
2491
2491
|
placeholder: "Create a password",
|
|
2492
2492
|
showStrength: !0,
|
|
2493
2493
|
required: !0,
|
|
2494
|
-
disabled:
|
|
2494
|
+
disabled: R,
|
|
2495
2495
|
value: k,
|
|
2496
|
-
onChange: (e) =>
|
|
2496
|
+
onChange: (e) => A(e.target.value)
|
|
2497
2497
|
})]
|
|
2498
2498
|
})
|
|
2499
2499
|
}),
|
|
@@ -2501,16 +2501,16 @@ function bn({ title: e = "Create your account", description: t = "Start explorin
|
|
|
2501
2501
|
className: "flex items-center gap-2",
|
|
2502
2502
|
children: [/* @__PURE__ */ i(tt, {
|
|
2503
2503
|
id: S,
|
|
2504
|
-
checked:
|
|
2505
|
-
onCheckedChange: (e) =>
|
|
2506
|
-
disabled:
|
|
2507
|
-
}), /* @__PURE__ */ a(
|
|
2504
|
+
checked: N,
|
|
2505
|
+
onCheckedChange: (e) => ee(e === !0),
|
|
2506
|
+
disabled: R
|
|
2507
|
+
}), /* @__PURE__ */ a(xt, {
|
|
2508
2508
|
htmlFor: S,
|
|
2509
2509
|
className: "font-normal",
|
|
2510
2510
|
children: [
|
|
2511
2511
|
"I agree to the",
|
|
2512
2512
|
" ",
|
|
2513
|
-
h ?? /* @__PURE__ */ i(
|
|
2513
|
+
h ?? /* @__PURE__ */ i(Y, {
|
|
2514
2514
|
variant: "link",
|
|
2515
2515
|
type: "button",
|
|
2516
2516
|
onClick: v,
|
|
@@ -2519,12 +2519,12 @@ function bn({ title: e = "Create your account", description: t = "Start explorin
|
|
|
2519
2519
|
]
|
|
2520
2520
|
})]
|
|
2521
2521
|
}),
|
|
2522
|
-
/* @__PURE__ */ i(
|
|
2523
|
-
/* @__PURE__ */ i(
|
|
2524
|
-
className:
|
|
2522
|
+
/* @__PURE__ */ i(on, { message: T }),
|
|
2523
|
+
/* @__PURE__ */ i(Y, {
|
|
2524
|
+
className: J("w-full", o && "border-transparent bg-[var(--auth-accent)] bg-[image:var(--auth-accent-image)] text-[var(--auth-accent-foreground)] shadow-none hover:bg-[var(--auth-accent)] hover:brightness-110 data-pressed:bg-[var(--auth-accent)] data-pressed:brightness-110 *:data-[slot=button-loading-indicator]:text-[var(--auth-accent-foreground)]"),
|
|
2525
2525
|
type: "submit",
|
|
2526
2526
|
loading: C === "loading",
|
|
2527
|
-
disabled:
|
|
2527
|
+
disabled: R,
|
|
2528
2528
|
children: "Create account"
|
|
2529
2529
|
})
|
|
2530
2530
|
]
|
|
@@ -2535,8 +2535,8 @@ function bn({ title: e = "Create your account", description: t = "Start explorin
|
|
|
2535
2535
|
}
|
|
2536
2536
|
//#endregion
|
|
2537
2537
|
//#region src/components/blocks/auth/update-password-block.tsx
|
|
2538
|
-
function
|
|
2539
|
-
let l =
|
|
2538
|
+
function En({ title: e = "Update your password", description: t = "Choose a new password for your account", logo: n, accent: r, minStrength: o = 4, onSubmit: s, onDone: c }) {
|
|
2539
|
+
let l = P.useId(), u = P.useId(), [d, f] = P.useState("idle"), [p, m] = P.useState(null), [h, g] = P.useState(""), [_, v] = P.useState(""), y = Kt(h) >= o, b = _.length > 0 && _ === h, x = y && b, S = _.length > 0 && !h.startsWith(_);
|
|
2540
2540
|
async function C(e) {
|
|
2541
2541
|
if (e.preventDefault(), x) {
|
|
2542
2542
|
m(null), f("loading");
|
|
@@ -2547,17 +2547,17 @@ function xn({ title: e = "Update your password", description: t = "Choose a new
|
|
|
2547
2547
|
}
|
|
2548
2548
|
}
|
|
2549
2549
|
}
|
|
2550
|
-
return /* @__PURE__ */ i(
|
|
2550
|
+
return /* @__PURE__ */ i(rn, {
|
|
2551
2551
|
title: e,
|
|
2552
2552
|
description: t,
|
|
2553
2553
|
logo: n,
|
|
2554
2554
|
accent: r,
|
|
2555
|
-
children: /* @__PURE__ */ i(
|
|
2555
|
+
children: /* @__PURE__ */ i(an, {
|
|
2556
2556
|
step: d === "success" ? "success" : "form",
|
|
2557
|
-
children: d === "success" ? /* @__PURE__ */ i(
|
|
2557
|
+
children: d === "success" ? /* @__PURE__ */ i(sn, {
|
|
2558
2558
|
title: "Password updated",
|
|
2559
2559
|
description: "Your password has been changed successfully.",
|
|
2560
|
-
children: c && /* @__PURE__ */ i(
|
|
2560
|
+
children: c && /* @__PURE__ */ i(Y, {
|
|
2561
2561
|
variant: "link",
|
|
2562
2562
|
onClick: c,
|
|
2563
2563
|
children: "Continue"
|
|
@@ -2566,12 +2566,12 @@ function xn({ title: e = "Update your password", description: t = "Choose a new
|
|
|
2566
2566
|
className: "flex flex-col gap-4",
|
|
2567
2567
|
onSubmit: C,
|
|
2568
2568
|
children: [
|
|
2569
|
-
/* @__PURE__ */ a(
|
|
2569
|
+
/* @__PURE__ */ a(X, {
|
|
2570
2570
|
name: "password",
|
|
2571
|
-
children: [/* @__PURE__ */ i(
|
|
2571
|
+
children: [/* @__PURE__ */ i(Z, {
|
|
2572
2572
|
htmlFor: l,
|
|
2573
2573
|
children: "New password"
|
|
2574
|
-
}), /* @__PURE__ */ i(
|
|
2574
|
+
}), /* @__PURE__ */ i(Jt, {
|
|
2575
2575
|
id: l,
|
|
2576
2576
|
name: "password",
|
|
2577
2577
|
autoComplete: "new-password",
|
|
@@ -2582,14 +2582,14 @@ function xn({ title: e = "Update your password", description: t = "Choose a new
|
|
|
2582
2582
|
onChange: (e) => g(e.target.value)
|
|
2583
2583
|
})]
|
|
2584
2584
|
}),
|
|
2585
|
-
/* @__PURE__ */ i(
|
|
2585
|
+
/* @__PURE__ */ i($, {
|
|
2586
2586
|
show: y,
|
|
2587
|
-
children: /* @__PURE__ */ a(
|
|
2587
|
+
children: /* @__PURE__ */ a(X, {
|
|
2588
2588
|
name: "confirmPassword",
|
|
2589
|
-
children: [/* @__PURE__ */ i(
|
|
2589
|
+
children: [/* @__PURE__ */ i(Z, {
|
|
2590
2590
|
htmlFor: u,
|
|
2591
2591
|
children: "Confirm new password"
|
|
2592
|
-
}), /* @__PURE__ */ i(
|
|
2592
|
+
}), /* @__PURE__ */ i(Jt, {
|
|
2593
2593
|
id: u,
|
|
2594
2594
|
name: "confirmPassword",
|
|
2595
2595
|
autoComplete: "new-password",
|
|
@@ -2600,11 +2600,11 @@ function xn({ title: e = "Update your password", description: t = "Choose a new
|
|
|
2600
2600
|
})]
|
|
2601
2601
|
})
|
|
2602
2602
|
}),
|
|
2603
|
-
/* @__PURE__ */ i(
|
|
2604
|
-
/* @__PURE__ */ i(
|
|
2603
|
+
/* @__PURE__ */ i(on, { message: p ?? (S ? "Passwords do not match." : null) }),
|
|
2604
|
+
/* @__PURE__ */ i($, {
|
|
2605
2605
|
show: x,
|
|
2606
|
-
children: /* @__PURE__ */ i(
|
|
2607
|
-
className:
|
|
2606
|
+
children: /* @__PURE__ */ i(Y, {
|
|
2607
|
+
className: J("w-full", r && "border-transparent bg-[var(--auth-accent)] bg-[image:var(--auth-accent-image)] text-[var(--auth-accent-foreground)] shadow-none hover:bg-[var(--auth-accent)] hover:brightness-110 data-pressed:bg-[var(--auth-accent)] data-pressed:brightness-110 *:data-[slot=button-loading-indicator]:text-[var(--auth-accent-foreground)]"),
|
|
2608
2608
|
type: "submit",
|
|
2609
2609
|
loading: d === "loading",
|
|
2610
2610
|
children: "Update password"
|
|
@@ -2617,50 +2617,50 @@ function xn({ title: e = "Update your password", description: t = "Choose a new
|
|
|
2617
2617
|
}
|
|
2618
2618
|
//#endregion
|
|
2619
2619
|
//#region src/lib/ease.ts
|
|
2620
|
-
var
|
|
2620
|
+
var Dn = [
|
|
2621
2621
|
.16,
|
|
2622
2622
|
1,
|
|
2623
2623
|
.3,
|
|
2624
2624
|
1
|
|
2625
|
-
],
|
|
2625
|
+
], On = [
|
|
2626
2626
|
.77,
|
|
2627
2627
|
0,
|
|
2628
2628
|
.175,
|
|
2629
2629
|
1
|
|
2630
|
-
],
|
|
2630
|
+
], kn = [
|
|
2631
2631
|
.32,
|
|
2632
2632
|
.72,
|
|
2633
2633
|
0,
|
|
2634
2634
|
1
|
|
2635
|
-
],
|
|
2635
|
+
], An = "cubic-bezier(0.16, 1, 0.3, 1)", jn = {
|
|
2636
2636
|
type: "spring",
|
|
2637
2637
|
stiffness: 500,
|
|
2638
2638
|
damping: 30,
|
|
2639
2639
|
mass: .6
|
|
2640
|
-
},
|
|
2640
|
+
}, Mn = {
|
|
2641
2641
|
type: "spring",
|
|
2642
2642
|
stiffness: 460,
|
|
2643
2643
|
damping: 30,
|
|
2644
2644
|
mass: .55
|
|
2645
|
-
},
|
|
2645
|
+
}, Nn = {
|
|
2646
2646
|
type: "spring",
|
|
2647
2647
|
stiffness: 420,
|
|
2648
2648
|
damping: 40,
|
|
2649
2649
|
mass: .5
|
|
2650
|
-
},
|
|
2650
|
+
}, Pn = {
|
|
2651
2651
|
type: "spring",
|
|
2652
2652
|
stiffness: 360,
|
|
2653
2653
|
damping: 32,
|
|
2654
2654
|
mass: .6
|
|
2655
|
-
},
|
|
2655
|
+
}, Fn = {
|
|
2656
2656
|
stiffness: 200,
|
|
2657
2657
|
damping: 15,
|
|
2658
2658
|
mass: .3
|
|
2659
|
-
},
|
|
2659
|
+
}, In = {
|
|
2660
2660
|
stiffness: 700,
|
|
2661
2661
|
damping: 50,
|
|
2662
2662
|
mass: .5
|
|
2663
|
-
},
|
|
2663
|
+
}, Ln = {
|
|
2664
2664
|
initial: {
|
|
2665
2665
|
opacity: 0,
|
|
2666
2666
|
filter: "blur(6px)"
|
|
@@ -2673,36 +2673,36 @@ var Q = [
|
|
|
2673
2673
|
opacity: 0,
|
|
2674
2674
|
filter: "blur(6px)"
|
|
2675
2675
|
}
|
|
2676
|
-
},
|
|
2676
|
+
}, Rn = {
|
|
2677
2677
|
initial: { opacity: 0 },
|
|
2678
2678
|
animate: { opacity: 1 },
|
|
2679
2679
|
exit: (e) => e ? {} : { opacity: 0 }
|
|
2680
|
-
},
|
|
2681
|
-
let [f, p] =
|
|
2680
|
+
}, zn = z(function({ children: e, as: t = "div", className: n, onMouseLeave: o, pillClassName: s, pillContainerClassName: c, inset: l = 20, ...u }, d) {
|
|
2681
|
+
let [f, p] = W(null), m = re(), h = be(), g = F.toArray(e).filter(B).map((e, t) => {
|
|
2682
2682
|
let n = e, o = n.key ? String(n.key) : `item-${t}`;
|
|
2683
|
-
return
|
|
2683
|
+
return I(n, {
|
|
2684
2684
|
key: o,
|
|
2685
|
-
className:
|
|
2685
|
+
className: J("relative", n.props.className),
|
|
2686
2686
|
onMouseEnter: () => {
|
|
2687
2687
|
n.props.onMouseEnter?.(), p(o);
|
|
2688
2688
|
}
|
|
2689
|
-
}, /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i(
|
|
2689
|
+
}, /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i(K, {
|
|
2690
2690
|
custom: f !== null,
|
|
2691
|
-
children: f === null ? null : /* @__PURE__ */ i(
|
|
2692
|
-
variants: h ?
|
|
2691
|
+
children: f === null ? null : /* @__PURE__ */ i(q.div, {
|
|
2692
|
+
variants: h ? Rn : Ln,
|
|
2693
2693
|
initial: "initial",
|
|
2694
2694
|
animate: "animate",
|
|
2695
2695
|
exit: "exit",
|
|
2696
2696
|
custom: f !== null,
|
|
2697
|
-
className:
|
|
2697
|
+
className: J("pointer-events-none absolute inset-y-0", c),
|
|
2698
2698
|
style: {
|
|
2699
2699
|
left: -l,
|
|
2700
2700
|
right: -l
|
|
2701
2701
|
},
|
|
2702
|
-
children: f === o ? /* @__PURE__ */ i(
|
|
2702
|
+
children: f === o ? /* @__PURE__ */ i(q.div, {
|
|
2703
2703
|
layoutId: `shared-bg-${m}`,
|
|
2704
|
-
transition: h ? { duration: 0 } :
|
|
2705
|
-
className:
|
|
2704
|
+
transition: h ? { duration: 0 } : Pn,
|
|
2705
|
+
className: J("pointer-events-none h-full w-full rounded-2xl bg-primary/[0.06]", s)
|
|
2706
2706
|
}) : null
|
|
2707
2707
|
})
|
|
2708
2708
|
}), /* @__PURE__ */ i("div", {
|
|
@@ -2712,39 +2712,39 @@ var Q = [
|
|
|
2712
2712
|
}), _ = (e) => {
|
|
2713
2713
|
p(null), o?.(e);
|
|
2714
2714
|
};
|
|
2715
|
-
return i(t === "ul" ?
|
|
2715
|
+
return i(t === "ul" ? q.ul : q.div, {
|
|
2716
2716
|
...u,
|
|
2717
2717
|
ref: d,
|
|
2718
2718
|
layoutRoot: !0,
|
|
2719
2719
|
onMouseLeave: _,
|
|
2720
|
-
className:
|
|
2720
|
+
className: J("flex w-full flex-col", n),
|
|
2721
2721
|
children: g
|
|
2722
2722
|
});
|
|
2723
|
-
}),
|
|
2723
|
+
}), Bn = "(max-width: 767px)", Vn = "b", Hn = {
|
|
2724
2724
|
duration: .36,
|
|
2725
|
-
ease:
|
|
2726
|
-
},
|
|
2725
|
+
ease: kn
|
|
2726
|
+
}, Un = {
|
|
2727
2727
|
type: "spring",
|
|
2728
2728
|
stiffness: 380,
|
|
2729
2729
|
damping: 35,
|
|
2730
2730
|
mass: .75
|
|
2731
|
-
},
|
|
2731
|
+
}, Wn = {
|
|
2732
2732
|
duration: .2,
|
|
2733
2733
|
delay: .08,
|
|
2734
|
-
ease:
|
|
2735
|
-
},
|
|
2734
|
+
ease: Dn
|
|
2735
|
+
}, Gn = {
|
|
2736
2736
|
duration: .12,
|
|
2737
|
-
ease:
|
|
2738
|
-
},
|
|
2737
|
+
ease: Dn
|
|
2738
|
+
}, Kn = {
|
|
2739
2739
|
duration: .18,
|
|
2740
|
-
ease:
|
|
2741
|
-
},
|
|
2740
|
+
ease: Dn
|
|
2741
|
+
}, qn = {
|
|
2742
2742
|
closed: {
|
|
2743
2743
|
opacity: 0,
|
|
2744
2744
|
clipPath: "inset(0 0 100% 0 round 8px)",
|
|
2745
2745
|
transition: {
|
|
2746
2746
|
duration: .14,
|
|
2747
|
-
ease:
|
|
2747
|
+
ease: Dn,
|
|
2748
2748
|
staggerChildren: .025,
|
|
2749
2749
|
staggerDirection: -1
|
|
2750
2750
|
}
|
|
@@ -2755,11 +2755,11 @@ var Q = [
|
|
|
2755
2755
|
transition: {
|
|
2756
2756
|
duration: .2,
|
|
2757
2757
|
delayChildren: .035,
|
|
2758
|
-
ease:
|
|
2758
|
+
ease: Dn,
|
|
2759
2759
|
staggerChildren: .045
|
|
2760
2760
|
}
|
|
2761
2761
|
}
|
|
2762
|
-
},
|
|
2762
|
+
}, Jn = {
|
|
2763
2763
|
closed: {
|
|
2764
2764
|
opacity: 0,
|
|
2765
2765
|
y: -6,
|
|
@@ -2769,12 +2769,12 @@ var Q = [
|
|
|
2769
2769
|
opacity: 1,
|
|
2770
2770
|
y: 0,
|
|
2771
2771
|
filter: "blur(0px)",
|
|
2772
|
-
transition:
|
|
2772
|
+
transition: Kn
|
|
2773
2773
|
}
|
|
2774
|
-
},
|
|
2774
|
+
}, Yn = {
|
|
2775
2775
|
duration: .16,
|
|
2776
|
-
ease:
|
|
2777
|
-
},
|
|
2776
|
+
ease: Dn
|
|
2777
|
+
}, Xn = [
|
|
2778
2778
|
"a[href]",
|
|
2779
2779
|
"button:not([disabled])",
|
|
2780
2780
|
"input:not([disabled])",
|
|
@@ -2782,38 +2782,38 @@ var Q = [
|
|
|
2782
2782
|
"textarea:not([disabled])",
|
|
2783
2783
|
"[tabindex]:not([tabindex='-1'])"
|
|
2784
2784
|
].join(",");
|
|
2785
|
-
function
|
|
2786
|
-
let t = window.matchMedia(
|
|
2785
|
+
function Zn(e) {
|
|
2786
|
+
let t = window.matchMedia(Bn);
|
|
2787
2787
|
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
2788
2788
|
}
|
|
2789
|
-
function
|
|
2790
|
-
return window.matchMedia(
|
|
2789
|
+
function Qn() {
|
|
2790
|
+
return window.matchMedia(Bn).matches;
|
|
2791
2791
|
}
|
|
2792
|
-
function
|
|
2792
|
+
function $n() {
|
|
2793
2793
|
return !1;
|
|
2794
2794
|
}
|
|
2795
|
-
function
|
|
2796
|
-
return
|
|
2795
|
+
function er() {
|
|
2796
|
+
return oe(Zn, Qn, $n);
|
|
2797
2797
|
}
|
|
2798
|
-
var
|
|
2799
|
-
function
|
|
2800
|
-
let e =
|
|
2798
|
+
var tr = L(null), nr = L(null);
|
|
2799
|
+
function rr() {
|
|
2800
|
+
let e = ne(tr);
|
|
2801
2801
|
if (!e) throw Error("useAnimatedSidebar must be used inside AnimatedSidebarProvider.");
|
|
2802
2802
|
return e;
|
|
2803
2803
|
}
|
|
2804
|
-
function
|
|
2805
|
-
let e =
|
|
2804
|
+
function ir() {
|
|
2805
|
+
let e = ne(nr);
|
|
2806
2806
|
if (!e) throw Error("Animated Sidebar parts must be used inside AnimatedSidebar.");
|
|
2807
2807
|
return e;
|
|
2808
2808
|
}
|
|
2809
|
-
function
|
|
2810
|
-
let [m, h] =
|
|
2809
|
+
function ar({ children: e, open: t, defaultOpen: n = !0, onOpenChange: r, openMobile: a, defaultOpenMobile: o = !1, onOpenMobileChange: s, openRight: c, defaultOpenRight: l = !1, onOpenRightChange: u, className: d, style: f, ...p }) {
|
|
2810
|
+
let [m, h] = W(n), [g, _] = W(o), [v, y] = W(l), b = er(), x = be() ?? !1, S = re(), C = U(null), w = U(null), T = t ?? m, E = a ?? g, D = c ?? v, O = V((e) => {
|
|
2811
2811
|
t === void 0 && h(e), r?.(e);
|
|
2812
|
-
}, [r, t]), k =
|
|
2812
|
+
}, [r, t]), k = V((e) => {
|
|
2813
2813
|
a === void 0 && _(e), s?.(e);
|
|
2814
|
-
}, [s, a]), A =
|
|
2814
|
+
}, [s, a]), A = V((e) => {
|
|
2815
2815
|
c === void 0 && y(e), u?.(e);
|
|
2816
|
-
}, [u, c]), j =
|
|
2816
|
+
}, [u, c]), j = V(() => {
|
|
2817
2817
|
b ? k(!E) : O(!T);
|
|
2818
2818
|
}, [
|
|
2819
2819
|
T,
|
|
@@ -2821,15 +2821,15 @@ function Qn({ children: e, open: t, defaultOpen: n = !0, onOpenChange: r, openMo
|
|
|
2821
2821
|
E,
|
|
2822
2822
|
O,
|
|
2823
2823
|
k
|
|
2824
|
-
]),
|
|
2824
|
+
]), M = V(() => {
|
|
2825
2825
|
A(!D);
|
|
2826
2826
|
}, [D, A]);
|
|
2827
|
-
return
|
|
2827
|
+
return H(() => {
|
|
2828
2828
|
let e = (e) => {
|
|
2829
|
-
e.key.toLowerCase() ===
|
|
2829
|
+
e.key.toLowerCase() === Vn && (e.metaKey || e.ctrlKey) && (e.preventDefault(), j());
|
|
2830
2830
|
};
|
|
2831
2831
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
2832
|
-
}, [j]), /* @__PURE__ */ i(
|
|
2832
|
+
}, [j]), /* @__PURE__ */ i(tr.Provider, {
|
|
2833
2833
|
value: {
|
|
2834
2834
|
isMobile: b,
|
|
2835
2835
|
layoutId: `${S}-active`,
|
|
@@ -2842,7 +2842,7 @@ function Qn({ children: e, open: t, defaultOpen: n = !0, onOpenChange: r, openMo
|
|
|
2842
2842
|
setOpenRight: A,
|
|
2843
2843
|
state: T ? "expanded" : "collapsed",
|
|
2844
2844
|
toggleSidebar: j,
|
|
2845
|
-
toggleRightSidebar:
|
|
2845
|
+
toggleRightSidebar: M,
|
|
2846
2846
|
triggerRef: C,
|
|
2847
2847
|
rightTriggerRef: w
|
|
2848
2848
|
},
|
|
@@ -2857,14 +2857,14 @@ function Qn({ children: e, open: t, defaultOpen: n = !0, onOpenChange: r, openMo
|
|
|
2857
2857
|
"--sidebar-width-mobile": "18rem",
|
|
2858
2858
|
...f
|
|
2859
2859
|
},
|
|
2860
|
-
className:
|
|
2860
|
+
className: J("group/sidebar-wrapper flex min-h-svh w-full min-w-0", d),
|
|
2861
2861
|
children: e
|
|
2862
2862
|
})
|
|
2863
2863
|
});
|
|
2864
2864
|
}
|
|
2865
|
-
function
|
|
2866
|
-
let o =
|
|
2867
|
-
return
|
|
2865
|
+
function or({ ariaLabel: e, children: t, className: n, side: r }) {
|
|
2866
|
+
let o = rr(), s = r === "right", c = s ? o.openRight : o.openMobile, l = s ? o.setOpenRight : o.setOpenMobile, u = s ? o.rightTriggerRef : o.triggerRef, d = U(null), [f, p] = W(!1);
|
|
2867
|
+
return H(() => p(!0), []), H(() => {
|
|
2868
2868
|
if (!c) return;
|
|
2869
2869
|
let e = document.body, t = window.scrollY, n = u.current, r = {
|
|
2870
2870
|
left: e.style.left,
|
|
@@ -2875,23 +2875,23 @@ function $n({ ariaLabel: e, children: t, className: n, side: r }) {
|
|
|
2875
2875
|
};
|
|
2876
2876
|
e.style.position = "fixed", e.style.top = `-${t}px`, e.style.left = "0", e.style.right = "0", e.style.overflow = "hidden";
|
|
2877
2877
|
let i = requestAnimationFrame(() => {
|
|
2878
|
-
(d.current?.querySelector(
|
|
2878
|
+
(d.current?.querySelector(Xn) ?? d.current)?.focus({ preventScroll: !0 });
|
|
2879
2879
|
});
|
|
2880
2880
|
return () => {
|
|
2881
2881
|
cancelAnimationFrame(i), e.style.position = r.position, e.style.top = r.top, e.style.left = r.left, e.style.right = r.right, e.style.overflow = r.overflow, window.scrollTo(0, t), n?.focus({ preventScroll: !0 });
|
|
2882
2882
|
};
|
|
2883
2883
|
}, [c, u]), f ? Te(/* @__PURE__ */ a("div", {
|
|
2884
|
-
className:
|
|
2885
|
-
children: [/* @__PURE__ */ i(
|
|
2884
|
+
className: J("pointer-events-none fixed inset-0 z-50 md:hidden", c ? "visible" : "invisible"),
|
|
2885
|
+
children: [/* @__PURE__ */ i(q.button, {
|
|
2886
2886
|
type: "button",
|
|
2887
2887
|
"aria-label": "Close sidebar",
|
|
2888
2888
|
tabIndex: c ? 0 : -1,
|
|
2889
2889
|
initial: !1,
|
|
2890
2890
|
animate: { opacity: +!!c },
|
|
2891
|
-
transition: o.reduce ?
|
|
2891
|
+
transition: o.reduce ? Yn : Hn,
|
|
2892
2892
|
onClick: () => l(!1),
|
|
2893
|
-
className:
|
|
2894
|
-
}), /* @__PURE__ */ i(
|
|
2893
|
+
className: J("absolute inset-0", c ? "pointer-events-auto" : "pointer-events-none")
|
|
2894
|
+
}), /* @__PURE__ */ i(q.div, {
|
|
2895
2895
|
ref: d,
|
|
2896
2896
|
role: "dialog",
|
|
2897
2897
|
"aria-modal": "true",
|
|
@@ -2907,14 +2907,14 @@ function $n({ ariaLabel: e, children: t, className: n, side: r }) {
|
|
|
2907
2907
|
opacity: o.reduce ? +!!c : 1,
|
|
2908
2908
|
x: o.reduce ? 0 : c ? "0%" : r === "left" ? "-100%" : "100%"
|
|
2909
2909
|
},
|
|
2910
|
-
transition: o.reduce ?
|
|
2910
|
+
transition: o.reduce ? Yn : Hn,
|
|
2911
2911
|
onKeyDown: (e) => {
|
|
2912
2912
|
if (e.key === "Escape") {
|
|
2913
2913
|
e.preventDefault(), l(!1);
|
|
2914
2914
|
return;
|
|
2915
2915
|
}
|
|
2916
2916
|
if (e.key !== "Tab") return;
|
|
2917
|
-
let t = d.current ? Array.from(d.current.querySelectorAll(
|
|
2917
|
+
let t = d.current ? Array.from(d.current.querySelectorAll(Xn)) : [];
|
|
2918
2918
|
if (t.length === 0) {
|
|
2919
2919
|
e.preventDefault(), d.current?.focus();
|
|
2920
2920
|
return;
|
|
@@ -2922,8 +2922,8 @@ function $n({ ariaLabel: e, children: t, className: n, side: r }) {
|
|
|
2922
2922
|
let n = t[0], r = t[t.length - 1];
|
|
2923
2923
|
e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
|
|
2924
2924
|
},
|
|
2925
|
-
className:
|
|
2926
|
-
children: /* @__PURE__ */ i(
|
|
2925
|
+
className: J("pointer-events-auto absolute inset-y-0 flex h-dvh w-(--sidebar-width-mobile) max-w-[88vw] flex-col overflow-hidden", "will-change-transform", r === "left" ? "left-0 border-r" : "right-0", !c && "pointer-events-none", n),
|
|
2926
|
+
children: /* @__PURE__ */ i(nr.Provider, {
|
|
2927
2927
|
value: {
|
|
2928
2928
|
collapsed: !1,
|
|
2929
2929
|
collapsible: "none",
|
|
@@ -2934,14 +2934,14 @@ function $n({ ariaLabel: e, children: t, className: n, side: r }) {
|
|
|
2934
2934
|
})]
|
|
2935
2935
|
}), document.body) : null;
|
|
2936
2936
|
}
|
|
2937
|
-
var
|
|
2938
|
-
let f =
|
|
2939
|
-
return f.isMobile ? /* @__PURE__ */ i(
|
|
2937
|
+
var sr = z(function({ side: e = "left", variant: t = "sidebar", collapsible: n = "icon", ariaLabel: r = "Sidebar", children: o, className: s, panelClassName: c, style: l, ...u }, d) {
|
|
2938
|
+
let f = rr(), p = e === "right" ? f.openRight : f.open, m = n !== "none" && !p, h = m && n === "offcanvas", g = h ? "0px" : m ? "var(--sidebar-width-icon)" : "var(--sidebar-width)";
|
|
2939
|
+
return f.isMobile ? /* @__PURE__ */ i(or, {
|
|
2940
2940
|
ariaLabel: r,
|
|
2941
2941
|
className: s,
|
|
2942
2942
|
side: e,
|
|
2943
2943
|
children: o
|
|
2944
|
-
}) : /* @__PURE__ */ a(
|
|
2944
|
+
}) : /* @__PURE__ */ a(q.aside, {
|
|
2945
2945
|
...u,
|
|
2946
2946
|
ref: d,
|
|
2947
2947
|
initial: !1,
|
|
@@ -2952,18 +2952,18 @@ var er = M(function({ side: e = "left", variant: t = "sidebar", collapsible: n =
|
|
|
2952
2952
|
"data-variant": t,
|
|
2953
2953
|
"data-side": e,
|
|
2954
2954
|
animate: { width: g },
|
|
2955
|
-
transition: f.reduce ? { duration: 0 } :
|
|
2955
|
+
transition: f.reduce ? { duration: 0 } : Un,
|
|
2956
2956
|
style: l,
|
|
2957
|
-
className:
|
|
2958
|
-
children: [e === "right" && !m && /* @__PURE__ */ i(
|
|
2957
|
+
className: J("group/sidebar relative hidden h-auto shrink-0 will-change-[width] md:block", "peer flex!", n === "offcanvas" && "overflow-x-visible [overflow-clip-margin:1rem]", e === "right" && "order-last", s),
|
|
2958
|
+
children: [e === "right" && !m && /* @__PURE__ */ i(q.div, { className: "h-full p-0.5 flex flex-1 bg-radial/decreasing from-amber-400 to-0% hover:to-50% ease-smooth-out to-amber-500/0 cursor-col-resize transition-colors duration-1000 animate-in" }), /* @__PURE__ */ i(q.div, {
|
|
2959
2959
|
initial: !1,
|
|
2960
2960
|
animate: {
|
|
2961
2961
|
opacity: +!h,
|
|
2962
2962
|
x: h ? e === "left" ? "-100%" : "100%" : "0%"
|
|
2963
2963
|
},
|
|
2964
|
-
transition: f.reduce ?
|
|
2965
|
-
className:
|
|
2966
|
-
children: /* @__PURE__ */ i(
|
|
2964
|
+
transition: f.reduce ? Yn : Hn,
|
|
2965
|
+
className: J("sticky top-0 flex h-svh w-full flex-col overflow-hidden", n === "offcanvas" && "w-[var(--sidebar-width)]", t === "floating" && "m-2 h-[calc(100svh-1rem)]", t === "inset" && "m-2 h-[calc(100svh-1rem)]", c),
|
|
2966
|
+
children: /* @__PURE__ */ i(nr.Provider, {
|
|
2967
2967
|
value: {
|
|
2968
2968
|
collapsed: m,
|
|
2969
2969
|
collapsible: n,
|
|
@@ -2973,8 +2973,8 @@ var er = M(function({ side: e = "left", variant: t = "sidebar", collapsible: n =
|
|
|
2973
2973
|
})
|
|
2974
2974
|
})]
|
|
2975
2975
|
});
|
|
2976
|
-
}),
|
|
2977
|
-
let s =
|
|
2976
|
+
}), cr = z(function({ className: e, onClick: t, side: n = "left", type: r = "button", ...a }, o) {
|
|
2977
|
+
let s = rr(), c = n === "right", l = c ? s.openRight : s.isMobile ? s.openMobile : s.open, u = c ? s.rightTriggerRef : s.triggerRef;
|
|
2978
2978
|
return /* @__PURE__ */ i("button", {
|
|
2979
2979
|
...a,
|
|
2980
2980
|
ref: (e) => {
|
|
@@ -2989,10 +2989,10 @@ var er = M(function({ side: e = "left", variant: t = "sidebar", collapsible: n =
|
|
|
2989
2989
|
onClick: (e) => {
|
|
2990
2990
|
t?.(e), !e.defaultPrevented && (c ? s.toggleRightSidebar() : s.toggleSidebar());
|
|
2991
2991
|
},
|
|
2992
|
-
className:
|
|
2992
|
+
className: J("inline-flex size-10 shrink-0 items-center justify-center rounded-xl outline-none", "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background", e)
|
|
2993
2993
|
});
|
|
2994
|
-
}),
|
|
2995
|
-
let s =
|
|
2994
|
+
}), lr = z(function({ className: e, onClick: t, side: n = "left", type: r = "button", ...a }, o) {
|
|
2995
|
+
let s = rr();
|
|
2996
2996
|
return /* @__PURE__ */ i("button", {
|
|
2997
2997
|
...a,
|
|
2998
2998
|
ref: o,
|
|
@@ -3002,10 +3002,10 @@ var er = M(function({ side: e = "left", variant: t = "sidebar", collapsible: n =
|
|
|
3002
3002
|
onClick: (e) => {
|
|
3003
3003
|
t?.(e), !e.defaultPrevented && (n === "right" ? s.setOpenRight(!1) : s.isMobile ? s.setOpenMobile(!1) : s.setOpen(!1));
|
|
3004
3004
|
},
|
|
3005
|
-
className:
|
|
3005
|
+
className: J("inline-flex size-10 shrink-0 items-center justify-center rounded-xl outline-none", "focus-visible:ring-2 focus-visible:ring-ring", e)
|
|
3006
3006
|
});
|
|
3007
|
-
}),
|
|
3008
|
-
let o =
|
|
3007
|
+
}), ur = z(function({ className: e, onClick: t, type: n = "button", ...r }, a) {
|
|
3008
|
+
let o = rr(), s = ir();
|
|
3009
3009
|
return /* @__PURE__ */ i("button", {
|
|
3010
3010
|
...r,
|
|
3011
3011
|
ref: a,
|
|
@@ -3017,62 +3017,62 @@ var er = M(function({ side: e = "left", variant: t = "sidebar", collapsible: n =
|
|
|
3017
3017
|
onClick: (e) => {
|
|
3018
3018
|
t?.(e), !e.defaultPrevented && (s.side === "right" ? o.toggleRightSidebar() : o.toggleSidebar());
|
|
3019
3019
|
},
|
|
3020
|
-
className:
|
|
3020
|
+
className: J("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 outline-none md:block", "after:absolute after:inset-y-0 after:left-1/2 after:w-px after:bg-transparent after:transition-colors hover:after:bg-border", "data-[side=left]:left-full data-[side=right]:right-0 data-[side=right]:translate-x-1/2", e)
|
|
3021
3021
|
});
|
|
3022
|
-
}),
|
|
3023
|
-
return /* @__PURE__ */ i(
|
|
3022
|
+
}), dr = z(function({ className: e, ...t }, n) {
|
|
3023
|
+
return /* @__PURE__ */ i(q.main, {
|
|
3024
3024
|
...t,
|
|
3025
3025
|
ref: n,
|
|
3026
3026
|
"data-slot": "sidebar-inset",
|
|
3027
|
-
className:
|
|
3027
|
+
className: J("relative flex min-w-0 flex-1 flex-col bg-background", "md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:mr-1.5 md:peer-data-[variant=inset]:rounded-md md:peer-data-[variant=inset]:shadow-md", e)
|
|
3028
3028
|
});
|
|
3029
|
-
}),
|
|
3029
|
+
}), fr = z(function({ className: e, ...t }, n) {
|
|
3030
3030
|
return /* @__PURE__ */ i("div", {
|
|
3031
3031
|
...t,
|
|
3032
3032
|
ref: n,
|
|
3033
3033
|
"data-slot": "sidebar-header",
|
|
3034
|
-
className:
|
|
3034
|
+
className: J("flex shrink-0 flex-col gap-2 p-3", e)
|
|
3035
3035
|
});
|
|
3036
|
-
}),
|
|
3036
|
+
}), pr = z(function({ className: e, ...t }, n) {
|
|
3037
3037
|
return /* @__PURE__ */ i("div", {
|
|
3038
3038
|
...t,
|
|
3039
3039
|
ref: n,
|
|
3040
3040
|
"data-slot": "sidebar-content",
|
|
3041
|
-
className:
|
|
3041
|
+
className: J("flex min-h-0 flex-1 flex-col gap-2 overflow-x-hidden overflow-y-auto overscroll-contain px-2 py-2", e)
|
|
3042
3042
|
});
|
|
3043
|
-
}),
|
|
3043
|
+
}), mr = z(function({ className: e, ...t }, n) {
|
|
3044
3044
|
return /* @__PURE__ */ i("div", {
|
|
3045
3045
|
...t,
|
|
3046
3046
|
ref: n,
|
|
3047
3047
|
"data-slot": "sidebar-footer",
|
|
3048
|
-
className:
|
|
3048
|
+
className: J("flex shrink-0 flex-col gap-2 border-t border-border p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]", e)
|
|
3049
3049
|
});
|
|
3050
|
-
}),
|
|
3050
|
+
}), hr = z(function({ className: e, ...t }, n) {
|
|
3051
3051
|
return /* @__PURE__ */ i("div", {
|
|
3052
3052
|
...t,
|
|
3053
3053
|
ref: n,
|
|
3054
3054
|
"data-slot": "sidebar-group",
|
|
3055
|
-
className:
|
|
3055
|
+
className: J("flex w-full min-w-0 flex-col px-1 py-1.5", e)
|
|
3056
3056
|
});
|
|
3057
|
-
}),
|
|
3058
|
-
let { collapsed: a } =
|
|
3057
|
+
}), gr = z(function({ children: e, className: t, ...n }, r) {
|
|
3058
|
+
let { collapsed: a } = ir();
|
|
3059
3059
|
return /* @__PURE__ */ i("div", {
|
|
3060
3060
|
...n,
|
|
3061
3061
|
ref: r,
|
|
3062
3062
|
"aria-hidden": a,
|
|
3063
3063
|
"data-slot": "sidebar-group-label",
|
|
3064
|
-
className:
|
|
3064
|
+
className: J("mb-1 h-7 overflow-hidden px-2 text-[10px] font-medium tracking-[0.14em] text-muted-foreground uppercase transition-opacity", a ? "opacity-0" : "opacity-100", t),
|
|
3065
3065
|
children: e
|
|
3066
3066
|
});
|
|
3067
|
-
}),
|
|
3067
|
+
}), _r = z(function({ className: e, ...t }, n) {
|
|
3068
3068
|
return /* @__PURE__ */ i("div", {
|
|
3069
3069
|
...t,
|
|
3070
3070
|
ref: n,
|
|
3071
3071
|
"data-slot": "sidebar-group-content",
|
|
3072
|
-
className:
|
|
3072
|
+
className: J("w-full min-w-0", e)
|
|
3073
3073
|
});
|
|
3074
|
-
}),
|
|
3075
|
-
return /* @__PURE__ */ i(
|
|
3074
|
+
}), vr = z(function({ children: e, className: t, ...n }, r) {
|
|
3075
|
+
return /* @__PURE__ */ i(zn, {
|
|
3076
3076
|
...n,
|
|
3077
3077
|
ref: r,
|
|
3078
3078
|
as: "ul",
|
|
@@ -3080,47 +3080,47 @@ var er = M(function({ side: e = "left", variant: t = "sidebar", collapsible: n =
|
|
|
3080
3080
|
pillClassName: "rounded-xl bg-muted/70",
|
|
3081
3081
|
pillContainerClassName: "inset-y-auto top-0 h-9",
|
|
3082
3082
|
"data-slot": "sidebar-menu",
|
|
3083
|
-
className:
|
|
3083
|
+
className: J("flex w-full min-w-0 list-none flex-col gap-0.5", t),
|
|
3084
3084
|
children: e
|
|
3085
3085
|
});
|
|
3086
|
-
}),
|
|
3087
|
-
return /* @__PURE__ */ i(
|
|
3086
|
+
}), yr = z(function({ className: e, ...t }, n) {
|
|
3087
|
+
return /* @__PURE__ */ i(q.li, {
|
|
3088
3088
|
...t,
|
|
3089
3089
|
ref: n,
|
|
3090
3090
|
layout: "position",
|
|
3091
|
-
transition:
|
|
3091
|
+
transition: Pn,
|
|
3092
3092
|
"data-slot": "sidebar-menu-item",
|
|
3093
|
-
className:
|
|
3093
|
+
className: J("relative", e)
|
|
3094
3094
|
});
|
|
3095
|
-
}),
|
|
3096
|
-
let o =
|
|
3097
|
-
return /* @__PURE__ */ i(
|
|
3095
|
+
}), br = z(function({ open: e, children: t, className: n, ...r }, a) {
|
|
3096
|
+
let o = rr(), s = ir();
|
|
3097
|
+
return /* @__PURE__ */ i(K, {
|
|
3098
3098
|
initial: !1,
|
|
3099
3099
|
mode: "popLayout",
|
|
3100
|
-
children: e && !s.collapsed ? /* @__PURE__ */
|
|
3100
|
+
children: e && !s.collapsed ? /* @__PURE__ */ R(q.ul, {
|
|
3101
3101
|
...r,
|
|
3102
3102
|
ref: a,
|
|
3103
3103
|
key: "sidebar-submenu",
|
|
3104
|
-
variants: o.reduce ? void 0 :
|
|
3104
|
+
variants: o.reduce ? void 0 : qn,
|
|
3105
3105
|
initial: !o.reduce && "closed",
|
|
3106
3106
|
animate: o.reduce ? { opacity: 1 } : "open",
|
|
3107
3107
|
exit: o.reduce ? { opacity: 0 } : "closed",
|
|
3108
3108
|
transition: o.reduce ? { duration: .12 } : void 0,
|
|
3109
3109
|
"data-slot": "sidebar-menu-sub",
|
|
3110
|
-
className:
|
|
3110
|
+
className: J("relative mt-1 ml-5 flex min-w-0 flex-col gap-0.5 border-l border-border pl-3", n)
|
|
3111
3111
|
}, t) : null
|
|
3112
3112
|
});
|
|
3113
|
-
}),
|
|
3114
|
-
return /* @__PURE__ */ i(
|
|
3113
|
+
}), xr = z(function({ className: e, ...t }, n) {
|
|
3114
|
+
return /* @__PURE__ */ i(q.li, {
|
|
3115
3115
|
...t,
|
|
3116
3116
|
ref: n,
|
|
3117
|
-
variants:
|
|
3117
|
+
variants: Jn,
|
|
3118
3118
|
"data-slot": "sidebar-menu-sub-item",
|
|
3119
|
-
className:
|
|
3119
|
+
className: J("relative min-w-0", e)
|
|
3120
3120
|
});
|
|
3121
3121
|
});
|
|
3122
|
-
function
|
|
3123
|
-
let p =
|
|
3122
|
+
function Sr({ children: e, icon: t, href: n, isActive: o = !1, disabled: s = !1, closeOnSelect: c = !0, target: l, rel: u, onSelect: d, className: f }) {
|
|
3123
|
+
let p = rr(), m = (e) => {
|
|
3124
3124
|
if (s) {
|
|
3125
3125
|
e.preventDefault();
|
|
3126
3126
|
return;
|
|
@@ -3133,8 +3133,8 @@ function hr({ children: e, icon: t, href: n, isActive: o = !1, disabled: s = !1,
|
|
|
3133
3133
|
}), /* @__PURE__ */ i("span", {
|
|
3134
3134
|
className: "min-w-0 flex-1 truncate",
|
|
3135
3135
|
children: e
|
|
3136
|
-
})] }), g =
|
|
3137
|
-
return n ? /* @__PURE__ */ i(
|
|
3136
|
+
})] }), g = J("flex min-h-8 w-full min-w-0 items-center gap-2 rounded-lg px-2 text-left text-xs outline-none", "text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground", "focus-visible:bg-muted/70 focus-visible:ring-2 focus-visible:ring-ring", o && "bg-muted/70 text-foreground", s && "cursor-not-allowed opacity-40", f);
|
|
3137
|
+
return n ? /* @__PURE__ */ i(q.a, {
|
|
3138
3138
|
href: n,
|
|
3139
3139
|
target: l,
|
|
3140
3140
|
rel: u ?? (l === "_blank" ? "noreferrer noopener" : void 0),
|
|
@@ -3143,22 +3143,22 @@ function hr({ children: e, icon: t, href: n, isActive: o = !1, disabled: s = !1,
|
|
|
3143
3143
|
tabIndex: s ? -1 : void 0,
|
|
3144
3144
|
onClick: m,
|
|
3145
3145
|
whileTap: p.reduce || s ? void 0 : { scale: .98 },
|
|
3146
|
-
transition:
|
|
3146
|
+
transition: jn,
|
|
3147
3147
|
className: g,
|
|
3148
3148
|
children: h
|
|
3149
|
-
}) : /* @__PURE__ */ i(
|
|
3149
|
+
}) : /* @__PURE__ */ i(q.button, {
|
|
3150
3150
|
type: "button",
|
|
3151
3151
|
disabled: s,
|
|
3152
3152
|
"aria-current": o ? "page" : void 0,
|
|
3153
3153
|
onClick: m,
|
|
3154
3154
|
whileTap: p.reduce || s ? void 0 : { scale: .98 },
|
|
3155
|
-
transition:
|
|
3155
|
+
transition: jn,
|
|
3156
3156
|
className: g,
|
|
3157
3157
|
children: h
|
|
3158
3158
|
});
|
|
3159
3159
|
}
|
|
3160
|
-
function
|
|
3161
|
-
let g =
|
|
3160
|
+
function Cr({ children: e, icon: t, badge: n, href: o, isActive: s = !1, ariaExpanded: c, disabled: l = !1, closeOnSelect: u, target: d, rel: p, onSelect: m, className: h }) {
|
|
3161
|
+
let g = rr(), _ = ir(), v = typeof e == "string" ? e : void 0, y = (e) => {
|
|
3162
3162
|
if (l) {
|
|
3163
3163
|
e.preventDefault();
|
|
3164
3164
|
return;
|
|
@@ -3167,9 +3167,9 @@ function gr({ children: e, icon: t, badge: n, href: o, isActive: s = !1, ariaExp
|
|
|
3167
3167
|
let t = u ?? c === void 0;
|
|
3168
3168
|
g.isMobile && t && g.setOpenMobile(!1);
|
|
3169
3169
|
}, b = /* @__PURE__ */ a(r, { children: [
|
|
3170
|
-
s ? /* @__PURE__ */ i(
|
|
3170
|
+
s ? /* @__PURE__ */ i(q.span, {
|
|
3171
3171
|
layoutId: g.layoutId,
|
|
3172
|
-
transition: g.reduce ? { duration: 0 } :
|
|
3172
|
+
transition: g.reduce ? { duration: 0 } : Pn,
|
|
3173
3173
|
className: "absolute inset-0 rounded-xl bg-muted"
|
|
3174
3174
|
}) : null,
|
|
3175
3175
|
t ? /* @__PURE__ */ i("span", {
|
|
@@ -3177,22 +3177,22 @@ function gr({ children: e, icon: t, badge: n, href: o, isActive: s = !1, ariaExp
|
|
|
3177
3177
|
className: "relative z-10 grid size-5 shrink-0 place-items-center",
|
|
3178
3178
|
children: t
|
|
3179
3179
|
}) : null,
|
|
3180
|
-
/* @__PURE__ */ i(
|
|
3180
|
+
/* @__PURE__ */ i(q.span, {
|
|
3181
3181
|
initial: !1,
|
|
3182
3182
|
animate: {
|
|
3183
3183
|
opacity: +!_.collapsed,
|
|
3184
3184
|
x: _.collapsed ? -4 : 0
|
|
3185
3185
|
},
|
|
3186
|
-
transition: g.reduce ?
|
|
3186
|
+
transition: g.reduce ? Yn : _.collapsed ? Gn : Wn,
|
|
3187
3187
|
"aria-hidden": _.collapsed,
|
|
3188
|
-
className:
|
|
3188
|
+
className: J("relative z-10 min-w-0 flex-1 truncate", _.collapsed && "pointer-events-none"),
|
|
3189
3189
|
children: e
|
|
3190
3190
|
}),
|
|
3191
3191
|
n && !_.collapsed ? /* @__PURE__ */ i("span", {
|
|
3192
3192
|
className: "relative z-10 shrink-0 text-xs text-muted-foreground",
|
|
3193
3193
|
children: n
|
|
3194
3194
|
}) : null,
|
|
3195
|
-
c === void 0 ? null : /* @__PURE__ */ i(
|
|
3195
|
+
c === void 0 ? null : /* @__PURE__ */ i(q.span, {
|
|
3196
3196
|
"aria-hidden": "true",
|
|
3197
3197
|
initial: !1,
|
|
3198
3198
|
animate: {
|
|
@@ -3200,15 +3200,15 @@ function gr({ children: e, icon: t, badge: n, href: o, isActive: s = !1, ariaExp
|
|
|
3200
3200
|
rotate: c ? 90 : 0,
|
|
3201
3201
|
x: _.collapsed ? 4 : 0
|
|
3202
3202
|
},
|
|
3203
|
-
transition: g.reduce ? { duration: 0 } :
|
|
3203
|
+
transition: g.reduce ? { duration: 0 } : Pn,
|
|
3204
3204
|
className: "relative z-10 grid size-4 shrink-0 place-items-center text-muted-foreground",
|
|
3205
|
-
children: /* @__PURE__ */ i(
|
|
3205
|
+
children: /* @__PURE__ */ i(f, { className: "size-3.5" })
|
|
3206
3206
|
})
|
|
3207
|
-
] }), x =
|
|
3208
|
-
return o ? /* @__PURE__ */ i(
|
|
3207
|
+
] }), x = J("relative flex min-h-9 w-full min-w-0 items-center gap-2.5 overflow-hidden rounded-xl px-3 text-left text-sm font-medium outline-none", "text-muted-foreground transition-colors hover:text-foreground", "focus-visible:bg-muted/70 focus-visible:ring-2 focus-visible:ring-ring", s && "text-foreground", l && "cursor-not-allowed opacity-40", h);
|
|
3208
|
+
return o ? /* @__PURE__ */ i(q.a, {
|
|
3209
3209
|
href: o,
|
|
3210
|
-
target:
|
|
3211
|
-
rel: p ?? (
|
|
3210
|
+
target: d,
|
|
3211
|
+
rel: p ?? (d === "_blank" ? "noreferrer noopener" : void 0),
|
|
3212
3212
|
"aria-current": s ? "page" : void 0,
|
|
3213
3213
|
"aria-expanded": c,
|
|
3214
3214
|
"aria-disabled": l || void 0,
|
|
@@ -3217,10 +3217,10 @@ function gr({ children: e, icon: t, badge: n, href: o, isActive: s = !1, ariaExp
|
|
|
3217
3217
|
tabIndex: l ? -1 : void 0,
|
|
3218
3218
|
onClick: y,
|
|
3219
3219
|
whileTap: g.reduce || l ? void 0 : { scale: .98 },
|
|
3220
|
-
transition:
|
|
3220
|
+
transition: jn,
|
|
3221
3221
|
className: x,
|
|
3222
3222
|
children: b
|
|
3223
|
-
}) : /* @__PURE__ */ i(
|
|
3223
|
+
}) : /* @__PURE__ */ i(q.button, {
|
|
3224
3224
|
type: "button",
|
|
3225
3225
|
disabled: l,
|
|
3226
3226
|
"aria-current": s ? "page" : void 0,
|
|
@@ -3229,32 +3229,32 @@ function gr({ children: e, icon: t, badge: n, href: o, isActive: s = !1, ariaExp
|
|
|
3229
3229
|
title: _.collapsed ? v : void 0,
|
|
3230
3230
|
onClick: y,
|
|
3231
3231
|
whileTap: g.reduce || l ? void 0 : { scale: .98 },
|
|
3232
|
-
transition:
|
|
3232
|
+
transition: jn,
|
|
3233
3233
|
className: x,
|
|
3234
3234
|
children: b
|
|
3235
3235
|
});
|
|
3236
3236
|
}
|
|
3237
3237
|
//#endregion
|
|
3238
3238
|
//#region src/components/blocks/nav/utils.ts
|
|
3239
|
-
function
|
|
3239
|
+
function wr(e, t) {
|
|
3240
3240
|
return t !== void 0 && e === t;
|
|
3241
3241
|
}
|
|
3242
3242
|
//#endregion
|
|
3243
3243
|
//#region src/components/blocks/nav/sidebar-nav-row.tsx
|
|
3244
|
-
function
|
|
3245
|
-
let r = e.items ?? [], o = r.length > 0, s = r.some((e) =>
|
|
3244
|
+
function Tr({ item: e, activeId: t, onNavigate: n }) {
|
|
3245
|
+
let r = e.items ?? [], o = r.length > 0, s = r.some((e) => wr(e.id, t)), [c, l] = P.useState(null), [u, d] = P.useState(s);
|
|
3246
3246
|
s !== u && (d(s), s && l(null));
|
|
3247
3247
|
let f = c ?? e.defaultOpen ?? s;
|
|
3248
3248
|
function p(e) {
|
|
3249
3249
|
e.onSelect?.(), n?.(e);
|
|
3250
3250
|
}
|
|
3251
|
-
return /* @__PURE__ */ a(
|
|
3251
|
+
return /* @__PURE__ */ a(yr, { children: [/* @__PURE__ */ i(Cr, {
|
|
3252
3252
|
ariaExpanded: o ? f : void 0,
|
|
3253
3253
|
badge: e.badge,
|
|
3254
3254
|
disabled: e.disabled,
|
|
3255
3255
|
href: o ? void 0 : e.href,
|
|
3256
3256
|
icon: e.icon,
|
|
3257
|
-
isActive:
|
|
3257
|
+
isActive: wr(e.id, t),
|
|
3258
3258
|
onSelect: () => {
|
|
3259
3259
|
if (o) {
|
|
3260
3260
|
l(!f);
|
|
@@ -3264,13 +3264,13 @@ function vr({ item: e, activeId: t, onNavigate: n }) {
|
|
|
3264
3264
|
},
|
|
3265
3265
|
target: e.target,
|
|
3266
3266
|
children: e.label
|
|
3267
|
-
}), o ? /* @__PURE__ */ i(
|
|
3267
|
+
}), o ? /* @__PURE__ */ i(br, {
|
|
3268
3268
|
open: f,
|
|
3269
|
-
children: r.map((e) => /* @__PURE__ */ i(
|
|
3269
|
+
children: r.map((e) => /* @__PURE__ */ i(xr, { children: /* @__PURE__ */ i(Sr, {
|
|
3270
3270
|
disabled: e.disabled,
|
|
3271
3271
|
href: e.href,
|
|
3272
3272
|
icon: e.icon,
|
|
3273
|
-
isActive:
|
|
3273
|
+
isActive: wr(e.id, t),
|
|
3274
3274
|
onSelect: () => p(e),
|
|
3275
3275
|
target: e.target,
|
|
3276
3276
|
children: e.label
|
|
@@ -3279,8 +3279,8 @@ function vr({ item: e, activeId: t, onNavigate: n }) {
|
|
|
3279
3279
|
}
|
|
3280
3280
|
//#endregion
|
|
3281
3281
|
//#region src/components/blocks/nav/sidebar-block.tsx
|
|
3282
|
-
function
|
|
3283
|
-
return /* @__PURE__ */ i(
|
|
3282
|
+
function Er({ sections: e, activeId: t, onNavigate: n, header: r, footer: o, showTrigger: s = !0, side: c = "left", variant: l = "sidebar", collapsible: u = "icon", open: d, defaultOpen: f, onOpenChange: p, openMobile: m, defaultOpenMobile: h, onOpenMobileChange: g, width: _, iconWidth: v, mobileWidth: y, ariaLabel: b = "Main", className: x }) {
|
|
3283
|
+
return /* @__PURE__ */ i(ar, {
|
|
3284
3284
|
className: "h-full min-h-0 w-auto",
|
|
3285
3285
|
defaultOpen: f,
|
|
3286
3286
|
defaultOpenMobile: h,
|
|
@@ -3293,40 +3293,43 @@ function yr({ sections: e, activeId: t, onNavigate: n, header: r, footer: o, sho
|
|
|
3293
3293
|
...v ? { "--sidebar-width-icon": v } : null,
|
|
3294
3294
|
...y ? { "--sidebar-width-mobile": y } : null
|
|
3295
3295
|
},
|
|
3296
|
-
children: /* @__PURE__ */ a(
|
|
3296
|
+
children: /* @__PURE__ */ a(sr, {
|
|
3297
3297
|
ariaLabel: b,
|
|
3298
|
-
className:
|
|
3298
|
+
className: J("h-full", x),
|
|
3299
3299
|
collapsible: u,
|
|
3300
3300
|
panelClassName: "h-full",
|
|
3301
3301
|
role: "navigation",
|
|
3302
3302
|
side: c,
|
|
3303
3303
|
variant: l,
|
|
3304
3304
|
children: [
|
|
3305
|
-
r || s && /* @__PURE__ */ i(
|
|
3305
|
+
r || s && /* @__PURE__ */ i(fr, { children: /* @__PURE__ */ a("div", {
|
|
3306
3306
|
className: "flex min-w-0 items-center justify-between gap-2",
|
|
3307
3307
|
children: [r && /* @__PURE__ */ i("div", {
|
|
3308
3308
|
className: "min-w-0 flex-1",
|
|
3309
3309
|
children: r
|
|
3310
|
-
}), s && /* @__PURE__ */ i(
|
|
3310
|
+
}), s && /* @__PURE__ */ i(cr, {
|
|
3311
3311
|
className: "text-muted-foreground hover:text-foreground",
|
|
3312
|
-
children: /* @__PURE__ */ i(
|
|
3312
|
+
children: /* @__PURE__ */ i(D, { className: "size-4.5" })
|
|
3313
3313
|
})]
|
|
3314
3314
|
}) }),
|
|
3315
|
-
/* @__PURE__ */ i(
|
|
3315
|
+
/* @__PURE__ */ i(pr, { children: e.map((e) => /* @__PURE__ */ a(hr, { children: [e.label && /* @__PURE__ */ i(gr, { children: e.label }), /* @__PURE__ */ i(_r, { children: /* @__PURE__ */ i(vr, { children: e.items.map((e) => /* @__PURE__ */ i(Tr, {
|
|
3316
3316
|
activeId: t,
|
|
3317
3317
|
item: e,
|
|
3318
3318
|
onNavigate: n
|
|
3319
3319
|
}, e.id)) }) })] }, e.id)) }),
|
|
3320
|
-
o && /* @__PURE__ */ i(
|
|
3320
|
+
o && /* @__PURE__ */ i(mr, { children: o })
|
|
3321
3321
|
]
|
|
3322
3322
|
})
|
|
3323
3323
|
});
|
|
3324
3324
|
}
|
|
3325
3325
|
//#endregion
|
|
3326
|
+
//#region src/components/blocks/shell/utils.ts
|
|
3327
|
+
var Dr = 48;
|
|
3328
|
+
//#endregion
|
|
3326
3329
|
//#region src/components/blocks/shell/shell-layout.tsx
|
|
3327
|
-
function
|
|
3328
|
-
return /* @__PURE__ */ a(
|
|
3329
|
-
className:
|
|
3330
|
+
function Or({ children: e, open: t, defaultOpen: n, onOpenChange: r, rightDrawer: o, rightOpen: s, defaultRightOpen: c, onRightOpenChange: l, variant: u = "desktop", className: d }) {
|
|
3331
|
+
return /* @__PURE__ */ a(ar, {
|
|
3332
|
+
className: J("block-full", d, "bg-linear-to-tr/increasing from-neutral-200 via-neutral-100 to-stone-200 dark:from-neutral-900 dark:via-neutral-950 dark:to-stone-950", "relative pr-2"),
|
|
3330
3333
|
defaultOpen: n,
|
|
3331
3334
|
defaultOpenRight: c,
|
|
3332
3335
|
onOpenChange: r,
|
|
@@ -3335,38 +3338,38 @@ function br({ children: e, open: t, defaultOpen: n, onOpenChange: r, rightDrawer
|
|
|
3335
3338
|
openRight: s,
|
|
3336
3339
|
style: { paddingTop: u === "desktop" ? 48 : 0 },
|
|
3337
3340
|
children: [
|
|
3338
|
-
/* @__PURE__ */ i(
|
|
3341
|
+
/* @__PURE__ */ i(sr, {
|
|
3339
3342
|
ariaLabel: "Primary navigation",
|
|
3340
|
-
className:
|
|
3343
|
+
className: J(""),
|
|
3341
3344
|
collapsible: "icon",
|
|
3342
3345
|
role: "navigation",
|
|
3343
3346
|
variant: "inset"
|
|
3344
3347
|
}),
|
|
3345
|
-
/* @__PURE__ */ a(
|
|
3346
|
-
className:
|
|
3348
|
+
/* @__PURE__ */ a(dr, {
|
|
3349
|
+
className: J("min-w-24 overflow-hidden border-t border-neutral-200 dark:border-neutral-700 inset-ring-1 inset-ring-neutral-50 dark:inset-ring-black bg-white dark:bg-card rounded-lg!", "mx-0!"),
|
|
3347
3350
|
children: [/* @__PURE__ */ a("header", {
|
|
3348
3351
|
className: "flex h-16 items-center justify-between gap-3 px-4 sm:px-6",
|
|
3349
3352
|
children: [/* @__PURE__ */ i("div", {
|
|
3350
3353
|
className: "flex min-w-0 items-center gap-3",
|
|
3351
|
-
children: /* @__PURE__ */ i(
|
|
3354
|
+
children: /* @__PURE__ */ i(cr, { children: /* @__PURE__ */ i(T, { className: "size-5" }) })
|
|
3352
3355
|
}), /* @__PURE__ */ i("div", {
|
|
3353
3356
|
className: "flex shrink-0 items-center gap-3",
|
|
3354
|
-
children: /* @__PURE__ */ i(
|
|
3357
|
+
children: /* @__PURE__ */ i(cr, {
|
|
3355
3358
|
"aria-label": "Toggle panel",
|
|
3356
3359
|
side: "right",
|
|
3357
|
-
children: /* @__PURE__ */ i(
|
|
3360
|
+
children: /* @__PURE__ */ i(O, { className: "size-5" })
|
|
3358
3361
|
})
|
|
3359
3362
|
})]
|
|
3360
3363
|
}), /* @__PURE__ */ i("div", {
|
|
3361
3364
|
className: "min-h-24 flex-1 overflow-auto",
|
|
3362
|
-
children: e ?? /* @__PURE__ */ i(
|
|
3365
|
+
children: e ?? /* @__PURE__ */ i(kr, {})
|
|
3363
3366
|
})]
|
|
3364
3367
|
}),
|
|
3365
|
-
/* @__PURE__ */ i(
|
|
3368
|
+
/* @__PURE__ */ i(sr, {
|
|
3366
3369
|
ariaLabel: "Secondary panel",
|
|
3367
|
-
className:
|
|
3370
|
+
className: J("max-md:border-l max-md:border-neutral-200 max-md:bg-white dark:max-md:border-neutral-700 dark:max-md:bg-card"),
|
|
3368
3371
|
collapsible: "offcanvas",
|
|
3369
|
-
panelClassName:
|
|
3372
|
+
panelClassName: J("top-2 ml-0 h-[calc(100%-1rem)] min-w-[calc(var(--sidebar-width))]", "rounded-lg border-t border-neutral-200 bg-white shadow-md inset-ring-1 inset-ring-neutral-50", "dark:border-neutral-700 dark:bg-card dark:inset-ring-black"),
|
|
3370
3373
|
role: "complementary",
|
|
3371
3374
|
side: "right",
|
|
3372
3375
|
variant: "inset",
|
|
@@ -3375,7 +3378,7 @@ function br({ children: e, open: t, defaultOpen: n, onOpenChange: r, rightDrawer
|
|
|
3375
3378
|
]
|
|
3376
3379
|
});
|
|
3377
3380
|
}
|
|
3378
|
-
function
|
|
3381
|
+
function kr() {
|
|
3379
3382
|
return /* @__PURE__ */ a("div", {
|
|
3380
3383
|
className: "grid gap-5",
|
|
3381
3384
|
children: [/* @__PURE__ */ i("div", {
|
|
@@ -3386,7 +3389,7 @@ function xr() {
|
|
|
3386
3389
|
}
|
|
3387
3390
|
//#endregion
|
|
3388
3391
|
//#region src/components/blocks/profile/profile-card-block.tsx
|
|
3389
|
-
var
|
|
3392
|
+
var Ar = [
|
|
3390
3393
|
{
|
|
3391
3394
|
type: "label",
|
|
3392
3395
|
label: "Management"
|
|
@@ -3394,43 +3397,43 @@ var Sr = [
|
|
|
3394
3397
|
{
|
|
3395
3398
|
id: "profile",
|
|
3396
3399
|
label: "Profile",
|
|
3397
|
-
icon: /* @__PURE__ */ i(
|
|
3400
|
+
icon: /* @__PURE__ */ i(M, { "aria-hidden": "true" })
|
|
3398
3401
|
},
|
|
3399
3402
|
{
|
|
3400
3403
|
id: "settings",
|
|
3401
3404
|
label: "Settings",
|
|
3402
|
-
icon: /* @__PURE__ */ i(
|
|
3405
|
+
icon: /* @__PURE__ */ i(A, { "aria-hidden": "true" })
|
|
3403
3406
|
},
|
|
3404
3407
|
{ type: "separator" },
|
|
3405
3408
|
{
|
|
3406
3409
|
id: "teams",
|
|
3407
3410
|
label: "Teams",
|
|
3408
|
-
icon: /* @__PURE__ */ i(
|
|
3411
|
+
icon: /* @__PURE__ */ i(ee, { "aria-hidden": "true" })
|
|
3409
3412
|
},
|
|
3410
3413
|
{
|
|
3411
3414
|
id: "invite",
|
|
3412
3415
|
label: "Invite",
|
|
3413
|
-
icon: /* @__PURE__ */ i(
|
|
3416
|
+
icon: /* @__PURE__ */ i(N, { "aria-hidden": "true" })
|
|
3414
3417
|
},
|
|
3415
3418
|
{ type: "separator" },
|
|
3416
3419
|
{
|
|
3417
3420
|
id: "sign-out",
|
|
3418
3421
|
label: "Log out",
|
|
3419
|
-
icon: /* @__PURE__ */ i(
|
|
3422
|
+
icon: /* @__PURE__ */ i(C, { "aria-hidden": "true" }),
|
|
3420
3423
|
variant: "destructive"
|
|
3421
3424
|
}
|
|
3422
3425
|
];
|
|
3423
|
-
function
|
|
3426
|
+
function jr(e) {
|
|
3424
3427
|
let t = [], n = { actions: [] };
|
|
3425
3428
|
for (let r of e) r.type === "separator" ? (t.push(n), n = { actions: [] }) : r.type === "label" ? n.label = r.label : n.actions.push(r);
|
|
3426
3429
|
return t.push(n), t.filter((e) => e.actions.length > 0 || e.label !== void 0);
|
|
3427
3430
|
}
|
|
3428
|
-
function
|
|
3429
|
-
let [h, g] =
|
|
3430
|
-
|
|
3431
|
+
function Mr({ user: e, items: t = Ar, align: n = "center", side: r = "bottom", sideOffset: o = 8, menuWidth: s = "content", open: c, defaultOpen: l, onOpenChange: u, sound: d = !0, onError: f, className: p }) {
|
|
3432
|
+
let [h, g] = P.useState(null), _ = P.useRef(!0);
|
|
3433
|
+
P.useEffect(() => (_.current = !0, () => {
|
|
3431
3434
|
_.current = !1;
|
|
3432
3435
|
}), []);
|
|
3433
|
-
let v =
|
|
3436
|
+
let v = P.useMemo(() => jr(t), [t]);
|
|
3434
3437
|
function y(e) {
|
|
3435
3438
|
let t = e.onSelect?.();
|
|
3436
3439
|
t instanceof Promise && (g(e.id), t.catch((e) => f?.(e)).finally(() => {
|
|
@@ -3438,24 +3441,24 @@ function wr({ user: e, items: t = Sr, align: n = "center", side: r = "bottom", s
|
|
|
3438
3441
|
}));
|
|
3439
3442
|
}
|
|
3440
3443
|
let b = h !== null;
|
|
3441
|
-
return /* @__PURE__ */ a(
|
|
3444
|
+
return /* @__PURE__ */ a(Ct, {
|
|
3442
3445
|
defaultOpen: l,
|
|
3443
3446
|
onOpenChange: (e, t) => {
|
|
3444
3447
|
d && et(e ? "bloom" : "droplet"), u?.(e, t);
|
|
3445
3448
|
},
|
|
3446
3449
|
open: c,
|
|
3447
|
-
children: [/* @__PURE__ */ i(
|
|
3450
|
+
children: [/* @__PURE__ */ i(Tt, {
|
|
3448
3451
|
disabled: b,
|
|
3449
|
-
render: /* @__PURE__ */ a(
|
|
3452
|
+
render: /* @__PURE__ */ a(Y, {
|
|
3450
3453
|
"aria-label": `${e.name}${e.username ? ` ${e.username}` : ""}, account menu`,
|
|
3451
|
-
className:
|
|
3454
|
+
className: J("h-auto w-full justify-between py-1.5 pl-1.5 data-popup-open:bg-accent sm:h-auto", p),
|
|
3452
3455
|
"data-slot": "profile-card",
|
|
3453
3456
|
loading: b,
|
|
3454
3457
|
sound: d,
|
|
3455
3458
|
variant: "ghost",
|
|
3456
3459
|
children: [/* @__PURE__ */ a("span", {
|
|
3457
3460
|
className: "flex w-full min-w-0 items-center justify-start gap-2",
|
|
3458
|
-
children: [/* @__PURE__ */ i(
|
|
3461
|
+
children: [/* @__PURE__ */ i(en, {
|
|
3459
3462
|
alt: "",
|
|
3460
3463
|
initials: e.initials,
|
|
3461
3464
|
name: e.name,
|
|
@@ -3470,30 +3473,749 @@ function wr({ user: e, items: t = Sr, align: n = "center", side: r = "bottom", s
|
|
|
3470
3473
|
children: e.username
|
|
3471
3474
|
}) : null]
|
|
3472
3475
|
})]
|
|
3473
|
-
}), /* @__PURE__ */ i(
|
|
3476
|
+
}), /* @__PURE__ */ i(m, {
|
|
3474
3477
|
"aria-hidden": "true",
|
|
3475
3478
|
className: "size-3.5"
|
|
3476
3479
|
})]
|
|
3477
3480
|
})
|
|
3478
|
-
}), /* @__PURE__ */ i(
|
|
3481
|
+
}), /* @__PURE__ */ i(Et, {
|
|
3479
3482
|
align: n,
|
|
3480
|
-
className:
|
|
3483
|
+
className: J(s === "card" ? "w-(--anchor-width)" : "min-w-44!", "origin-(--transform-origin) transition-[opacity,scale,translate] duration-150 ease-smooth-out data-ending-style:scale-98 data-ending-style:opacity-0 data-ending-style:duration-100 data-starting-style:scale-98 data-starting-style:opacity-0 data-[side=bottom]:data-ending-style:-translate-y-1 data-[side=bottom]:data-starting-style:-translate-y-1 data-[side=top]:data-ending-style:translate-y-1 data-[side=top]:data-starting-style:translate-y-1 motion-reduce:transition-none"),
|
|
3481
3484
|
side: r,
|
|
3482
3485
|
sideOffset: o,
|
|
3483
|
-
children: v.map((e, t) => /* @__PURE__ */ a(
|
|
3486
|
+
children: v.map((e, t) => /* @__PURE__ */ a(P.Fragment, { children: [t > 0 ? /* @__PURE__ */ i(Pt, {}) : null, /* @__PURE__ */ a(Dt, { children: [e.label ? /* @__PURE__ */ i(Nt, { children: e.label }) : null, e.actions.map((e) => /* @__PURE__ */ a(Ot, {
|
|
3484
3487
|
disabled: e.disabled,
|
|
3485
3488
|
onClick: () => y(e),
|
|
3486
3489
|
variant: e.variant,
|
|
3487
3490
|
children: [
|
|
3488
3491
|
e.icon,
|
|
3489
3492
|
/* @__PURE__ */ i("span", { children: e.label }),
|
|
3490
|
-
e.shortcut ? /* @__PURE__ */ i(
|
|
3493
|
+
e.shortcut ? /* @__PURE__ */ i(Ft, { children: e.shortcut }) : null
|
|
3491
3494
|
]
|
|
3492
3495
|
}, e.id))] })] }, e.label ?? `group-${e.actions[0]?.id}`))
|
|
3493
3496
|
})]
|
|
3494
3497
|
});
|
|
3495
3498
|
}
|
|
3496
3499
|
//#endregion
|
|
3497
|
-
|
|
3500
|
+
//#region src/components/agents/utils.ts
|
|
3501
|
+
var Nr = {
|
|
3502
|
+
duration: .16,
|
|
3503
|
+
ease: Dn
|
|
3504
|
+
};
|
|
3505
|
+
function Pr(e) {
|
|
3506
|
+
return e.kind === "folder" || e.kind === "project";
|
|
3507
|
+
}
|
|
3508
|
+
function Fr(e, t, n = 0, r = null) {
|
|
3509
|
+
return e.flatMap((e) => {
|
|
3510
|
+
let i = {
|
|
3511
|
+
item: e,
|
|
3512
|
+
depth: n,
|
|
3513
|
+
parentId: r
|
|
3514
|
+
};
|
|
3515
|
+
return !e.children?.length || !t.has(e.id) ? [i] : [i, ...Fr(e.children, t, n + 1, e.id)];
|
|
3516
|
+
});
|
|
3517
|
+
}
|
|
3518
|
+
function Ir(e, t) {
|
|
3519
|
+
for (let n of e) {
|
|
3520
|
+
if (n.id === t) return n;
|
|
3521
|
+
let e = n.children ? Ir(n.children, t) : void 0;
|
|
3522
|
+
if (e) return e;
|
|
3523
|
+
}
|
|
3524
|
+
}
|
|
3525
|
+
function Lr(e, t) {
|
|
3526
|
+
return e.id === t || e.children?.some((e) => Lr(e, t)) === !0;
|
|
3527
|
+
}
|
|
3528
|
+
function Rr(e, t) {
|
|
3529
|
+
let n, r = [];
|
|
3530
|
+
for (let i of e) {
|
|
3531
|
+
if (i.id === t) {
|
|
3532
|
+
n = i;
|
|
3533
|
+
continue;
|
|
3534
|
+
}
|
|
3535
|
+
if (i.children?.length) {
|
|
3536
|
+
let e = Rr(i.children, t);
|
|
3537
|
+
if (e.removed) {
|
|
3538
|
+
n = e.removed, r.push({
|
|
3539
|
+
...i,
|
|
3540
|
+
children: e.items
|
|
3541
|
+
});
|
|
3542
|
+
continue;
|
|
3543
|
+
}
|
|
3544
|
+
}
|
|
3545
|
+
r.push(i);
|
|
3546
|
+
}
|
|
3547
|
+
return {
|
|
3548
|
+
items: r,
|
|
3549
|
+
removed: n
|
|
3550
|
+
};
|
|
3551
|
+
}
|
|
3552
|
+
function zr(e, t, n, r) {
|
|
3553
|
+
if (n === null) return [...e, t];
|
|
3554
|
+
let i = [];
|
|
3555
|
+
for (let a of e) {
|
|
3556
|
+
if (a.id === n) {
|
|
3557
|
+
r === "before" ? i.push(t, a) : r === "after" ? i.push(a, t) : i.push({
|
|
3558
|
+
...a,
|
|
3559
|
+
children: [...a.children ?? [], t]
|
|
3560
|
+
});
|
|
3561
|
+
continue;
|
|
3562
|
+
}
|
|
3563
|
+
a.children?.length ? i.push({
|
|
3564
|
+
...a,
|
|
3565
|
+
children: zr(a.children, t, n, r)
|
|
3566
|
+
}) : i.push(a);
|
|
3567
|
+
}
|
|
3568
|
+
return i;
|
|
3569
|
+
}
|
|
3570
|
+
function Br(e, t) {
|
|
3571
|
+
let n = Ir(e, t.itemId);
|
|
3572
|
+
if (!n || n.disabled || t.targetId && Lr(n, t.targetId)) return null;
|
|
3573
|
+
let r = t.targetId ? Ir(e, t.targetId) : void 0;
|
|
3574
|
+
if (t.position === "inside" && (!r || r.disabled || !Pr(r))) return null;
|
|
3575
|
+
let i = Rr(e, t.itemId);
|
|
3576
|
+
return i.removed ? zr(i.items, i.removed, t.targetId, t.position) : null;
|
|
3577
|
+
}
|
|
3578
|
+
function Vr(e, t, n) {
|
|
3579
|
+
return e.map((e) => ({
|
|
3580
|
+
...e,
|
|
3581
|
+
label: e.id === t ? n : e.label,
|
|
3582
|
+
children: e.children ? Vr(e.children, t, n) : void 0
|
|
3583
|
+
}));
|
|
3584
|
+
}
|
|
3585
|
+
//#endregion
|
|
3586
|
+
//#region src/components/agents/use-ai-sidebar.ts
|
|
3587
|
+
function Hr({ items: e, defaultItems: t = [], onItemsChange: n, onMove: r, onMoveError: i, onRename: a, activeId: o, defaultActiveId: s = null, onActiveChange: c, defaultExpandedIds: l = [] }) {
|
|
3588
|
+
let [u, d] = W(e ?? t), [f, p] = W(s), [m, h] = W(() => new Set(l)), [g, _] = W(o ?? s), [v, y] = W(null), [b, x] = W(null), [S, C] = W(null), [w, T] = W(null), [E, D] = W(null), O = re(), [k, A] = W(""), j = U(/* @__PURE__ */ new Map()), M = U(!1), N = u, ee = o ?? f, [te, P] = W(e);
|
|
3589
|
+
e !== te && (P(e), e && d(e));
|
|
3590
|
+
let F = ae(() => Fr(N, m), [m, N]);
|
|
3591
|
+
if (!(g !== null && F.some((e) => e.item.id === g))) {
|
|
3592
|
+
let e = F[0]?.item.id ?? null;
|
|
3593
|
+
g !== e && _(e);
|
|
3594
|
+
}
|
|
3595
|
+
H(() => {
|
|
3596
|
+
if (!S) return;
|
|
3597
|
+
let e = requestAnimationFrame(() => {
|
|
3598
|
+
Array.from(document.querySelectorAll("[data-sidebar-resource-menu]")).find((e) => e.dataset.sidebarResourceMenu === S)?.querySelector("button, a[href]")?.focus();
|
|
3599
|
+
});
|
|
3600
|
+
return () => cancelAnimationFrame(e);
|
|
3601
|
+
}, [S]);
|
|
3602
|
+
let I = V((e) => {
|
|
3603
|
+
d(e), n?.(e);
|
|
3604
|
+
}, [n]), L = V(async (e) => {
|
|
3605
|
+
if (M.current) {
|
|
3606
|
+
A("Wait for the current move to finish.");
|
|
3607
|
+
return;
|
|
3608
|
+
}
|
|
3609
|
+
let t = N, n = Br(t, e);
|
|
3610
|
+
if (!n || n === t) return;
|
|
3611
|
+
M.current = !0, I(n), x(null), y(null);
|
|
3612
|
+
let a = Ir(t, e.itemId), o = e.targetId ? Ir(t, e.targetId) : null;
|
|
3613
|
+
A(o ? `Moved ${a?.label ?? "item"} ${e.position} ${o.label}.` : `Moved ${a?.label ?? "item"} to the top level.`);
|
|
3614
|
+
try {
|
|
3615
|
+
await r?.(e);
|
|
3616
|
+
} catch (n) {
|
|
3617
|
+
I(t), A(`Move failed. ${a?.label ?? "Item"} was restored.`), i?.(n, e);
|
|
3618
|
+
} finally {
|
|
3619
|
+
M.current = !1;
|
|
3620
|
+
}
|
|
3621
|
+
}, [
|
|
3622
|
+
r,
|
|
3623
|
+
i,
|
|
3624
|
+
N,
|
|
3625
|
+
I
|
|
3626
|
+
]), R = V((e) => {
|
|
3627
|
+
_(e), requestAnimationFrame(() => j.current.get(e)?.focus());
|
|
3628
|
+
}, []), z = V((e) => {
|
|
3629
|
+
o === void 0 && p(e), c?.(e);
|
|
3630
|
+
}, [o, c]), B = V((e) => {
|
|
3631
|
+
h((t) => {
|
|
3632
|
+
let n = new Set(t);
|
|
3633
|
+
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
3634
|
+
});
|
|
3635
|
+
}, []), ne = V((e, t) => {
|
|
3636
|
+
let n = F.findIndex(({ item: e }) => e.id === t.item.id), r = F[n - 1], i = F[n + 1], a = e.altKey && e.shiftKey;
|
|
3637
|
+
if (e.key === "ArrowDown" && !a && i) {
|
|
3638
|
+
e.preventDefault(), R(i.item.id);
|
|
3639
|
+
return;
|
|
3640
|
+
}
|
|
3641
|
+
if (e.key === "ArrowUp" && !a && r) {
|
|
3642
|
+
e.preventDefault(), R(r.item.id);
|
|
3643
|
+
return;
|
|
3644
|
+
}
|
|
3645
|
+
if (e.key === "Home" && F[0]) {
|
|
3646
|
+
e.preventDefault(), R(F[0].item.id);
|
|
3647
|
+
return;
|
|
3648
|
+
}
|
|
3649
|
+
if (e.key === "End" && F.at(-1)) {
|
|
3650
|
+
e.preventDefault(), R(F.at(-1)?.item.id ?? t.item.id);
|
|
3651
|
+
return;
|
|
3652
|
+
}
|
|
3653
|
+
if (t.item.disabled) {
|
|
3654
|
+
e.key === "ArrowLeft" && t.parentId ? (e.preventDefault(), R(t.parentId)) : (a || [
|
|
3655
|
+
"ArrowRight",
|
|
3656
|
+
"Enter",
|
|
3657
|
+
" ",
|
|
3658
|
+
"F2",
|
|
3659
|
+
"ContextMenu"
|
|
3660
|
+
].includes(e.key) || e.shiftKey && e.key === "F10") && e.preventDefault();
|
|
3661
|
+
return;
|
|
3662
|
+
}
|
|
3663
|
+
if (a && e.key === "ArrowUp" && r) {
|
|
3664
|
+
e.preventDefault(), L({
|
|
3665
|
+
itemId: t.item.id,
|
|
3666
|
+
targetId: r.item.id,
|
|
3667
|
+
position: "before"
|
|
3668
|
+
});
|
|
3669
|
+
return;
|
|
3670
|
+
}
|
|
3671
|
+
if (a && e.key === "ArrowDown" && i) {
|
|
3672
|
+
e.preventDefault(), L({
|
|
3673
|
+
itemId: t.item.id,
|
|
3674
|
+
targetId: i.item.id,
|
|
3675
|
+
position: "after"
|
|
3676
|
+
});
|
|
3677
|
+
return;
|
|
3678
|
+
}
|
|
3679
|
+
if (a && e.key === "ArrowRight" && r && Pr(r.item)) {
|
|
3680
|
+
e.preventDefault(), h((e) => new Set(e).add(r.item.id)), L({
|
|
3681
|
+
itemId: t.item.id,
|
|
3682
|
+
targetId: r.item.id,
|
|
3683
|
+
position: "inside"
|
|
3684
|
+
});
|
|
3685
|
+
return;
|
|
3686
|
+
}
|
|
3687
|
+
if (a && e.key === "ArrowLeft" && t.parentId) {
|
|
3688
|
+
e.preventDefault(), L({
|
|
3689
|
+
itemId: t.item.id,
|
|
3690
|
+
targetId: t.parentId,
|
|
3691
|
+
position: "after"
|
|
3692
|
+
});
|
|
3693
|
+
return;
|
|
3694
|
+
}
|
|
3695
|
+
e.key === "ArrowRight" && Pr(t.item) ? (e.preventDefault(), m.has(t.item.id) ? i?.parentId === t.item.id && R(i.item.id) : B(t.item.id)) : e.key === "ArrowLeft" ? (e.preventDefault(), m.has(t.item.id) ? B(t.item.id) : t.parentId && R(t.parentId)) : e.key === "Enter" || e.key === " " ? (e.preventDefault(), Pr(t.item) ? B(t.item.id) : z(t.item.id)) : e.key === "F2" ? (e.preventDefault(), T(t.item.id)) : (e.key === "ContextMenu" || e.shiftKey && e.key === "F10") && (e.preventDefault(), C(t.item.id));
|
|
3696
|
+
}, [
|
|
3697
|
+
m,
|
|
3698
|
+
F,
|
|
3699
|
+
R,
|
|
3700
|
+
L,
|
|
3701
|
+
z,
|
|
3702
|
+
B
|
|
3703
|
+
]), ie = V((e) => {
|
|
3704
|
+
!v || e.target !== e.currentTarget || (e.preventDefault(), x({
|
|
3705
|
+
id: null,
|
|
3706
|
+
position: "after"
|
|
3707
|
+
}));
|
|
3708
|
+
}, [v]), oe = V((e) => {
|
|
3709
|
+
e.preventDefault(), e.stopPropagation(), v && b && L({
|
|
3710
|
+
itemId: v,
|
|
3711
|
+
targetId: b.id,
|
|
3712
|
+
position: b.position
|
|
3713
|
+
});
|
|
3714
|
+
}, [
|
|
3715
|
+
v,
|
|
3716
|
+
b,
|
|
3717
|
+
L
|
|
3718
|
+
]), se = V((e, t) => {
|
|
3719
|
+
y(t), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", t);
|
|
3720
|
+
}, []), ce = V(() => {
|
|
3721
|
+
y(null), x(null);
|
|
3722
|
+
}, []), le = V((e, t) => {
|
|
3723
|
+
if (!v || v === t.item.id) return;
|
|
3724
|
+
let n = Ir(N, v);
|
|
3725
|
+
if (n && Lr(n, t.item.id)) return;
|
|
3726
|
+
e.preventDefault(), e.stopPropagation();
|
|
3727
|
+
let r = e.currentTarget.getBoundingClientRect(), i = (e.clientY - r.top) / r.height, a = !t.item.disabled && Pr(t.item) && i >= .25 && i <= .75 ? "inside" : i < .5 ? "before" : "after";
|
|
3728
|
+
x({
|
|
3729
|
+
id: t.item.id,
|
|
3730
|
+
position: a
|
|
3731
|
+
});
|
|
3732
|
+
}, [v, N]), ue = V((e, t) => {
|
|
3733
|
+
let n = t.trim();
|
|
3734
|
+
if (T(null), !n || n === e.item.label) return;
|
|
3735
|
+
let r = N;
|
|
3736
|
+
I(Vr(r, e.item.id, n)), Promise.resolve(a?.(e.item, n)).catch(() => {
|
|
3737
|
+
I(r), A(`Rename failed. ${e.item.label} was restored.`);
|
|
3738
|
+
});
|
|
3739
|
+
}, [
|
|
3740
|
+
a,
|
|
3741
|
+
N,
|
|
3742
|
+
I
|
|
3743
|
+
]), de = V((e, t) => {
|
|
3744
|
+
C(t ? e.item.id : null), t || R(e.item.id);
|
|
3745
|
+
}, [R]);
|
|
3746
|
+
return {
|
|
3747
|
+
flat: F,
|
|
3748
|
+
selectedId: ee,
|
|
3749
|
+
expandedIds: m,
|
|
3750
|
+
focusedId: g,
|
|
3751
|
+
setFocusedId: _,
|
|
3752
|
+
draggingId: v,
|
|
3753
|
+
dropTarget: b,
|
|
3754
|
+
hoveredId: E,
|
|
3755
|
+
hoverLayoutId: O,
|
|
3756
|
+
handleRowHover: V((e, t) => {
|
|
3757
|
+
D((n) => t ? e : n === e ? null : n);
|
|
3758
|
+
}, []),
|
|
3759
|
+
clearHover: V(() => D(null), []),
|
|
3760
|
+
menuOpenId: S,
|
|
3761
|
+
renamingId: w,
|
|
3762
|
+
setRenamingId: T,
|
|
3763
|
+
announcement: k,
|
|
3764
|
+
select: z,
|
|
3765
|
+
toggle: B,
|
|
3766
|
+
handleKeyDown: ne,
|
|
3767
|
+
handleRootDragOver: ie,
|
|
3768
|
+
handleDrop: oe,
|
|
3769
|
+
handleRowDragStart: se,
|
|
3770
|
+
handleRowDragEnd: ce,
|
|
3771
|
+
handleRowDragOver: le,
|
|
3772
|
+
commitRename: ue,
|
|
3773
|
+
handleMenuOpenChange: de,
|
|
3774
|
+
setRowRef: V((e, t) => {
|
|
3775
|
+
t ? j.current.set(e, t) : j.current.delete(e);
|
|
3776
|
+
}, [])
|
|
3777
|
+
};
|
|
3778
|
+
}
|
|
3779
|
+
//#endregion
|
|
3780
|
+
//#region src/components/agents/sidebar-icon.tsx
|
|
3781
|
+
function Ur(e, t) {
|
|
3782
|
+
return /* @__PURE__ */ i(e.kind === "folder" || e.kind === "project" ? t ? b : y : e.kind === "bookmark" ? u : _, { className: "size-4" });
|
|
3783
|
+
}
|
|
3784
|
+
//#endregion
|
|
3785
|
+
//#region src/components/agents/marquee-label.tsx
|
|
3786
|
+
function Wr({ active: e, children: t }) {
|
|
3787
|
+
let n = be() ?? !1, r = U(null), o = U(null), [s, c] = W(0);
|
|
3788
|
+
H(() => {
|
|
3789
|
+
let e = () => {
|
|
3790
|
+
let e = r.current, t = o.current;
|
|
3791
|
+
!e || !t || c(t.scrollWidth > e.clientWidth ? t.scrollWidth + 24 : 0);
|
|
3792
|
+
};
|
|
3793
|
+
e();
|
|
3794
|
+
let t = new ResizeObserver(e);
|
|
3795
|
+
return r.current && t.observe(r.current), o.current && t.observe(o.current), () => t.disconnect();
|
|
3796
|
+
}, []);
|
|
3797
|
+
let l = e && s > 0 && !n;
|
|
3798
|
+
return /* @__PURE__ */ i("span", {
|
|
3799
|
+
ref: r,
|
|
3800
|
+
className: "relative block min-w-0 flex-1 overflow-hidden",
|
|
3801
|
+
children: /* @__PURE__ */ a(q.span, {
|
|
3802
|
+
className: "flex w-max items-center gap-6 whitespace-nowrap",
|
|
3803
|
+
animate: { x: l ? [0, -s] : 0 },
|
|
3804
|
+
transition: l ? {
|
|
3805
|
+
duration: Math.max(2.4, s / 34),
|
|
3806
|
+
ease: "linear",
|
|
3807
|
+
repeat: Infinity,
|
|
3808
|
+
repeatDelay: 2
|
|
3809
|
+
} : Nr,
|
|
3810
|
+
children: [/* @__PURE__ */ i("span", {
|
|
3811
|
+
ref: o,
|
|
3812
|
+
children: t
|
|
3813
|
+
}), l ? /* @__PURE__ */ i("span", {
|
|
3814
|
+
"aria-hidden": "true",
|
|
3815
|
+
children: t
|
|
3816
|
+
}) : null]
|
|
3817
|
+
})
|
|
3818
|
+
});
|
|
3819
|
+
}
|
|
3820
|
+
//#endregion
|
|
3821
|
+
//#region src/components/motion/popover-position.ts
|
|
3822
|
+
function Gr(e, t) {
|
|
3823
|
+
return e?.trigger.left === t.trigger.left && e.trigger.top === t.trigger.top && e.trigger.width === t.trigger.width && e.trigger.height === t.trigger.height && e.content.width === t.content.width && e.content.height === t.content.height;
|
|
3824
|
+
}
|
|
3825
|
+
function Kr(e, t, n) {
|
|
3826
|
+
let [r, i] = W(null), a = V(() => {
|
|
3827
|
+
let n = e.current, r = t.current;
|
|
3828
|
+
if (!n || !r) return;
|
|
3829
|
+
let a = n.getBoundingClientRect(), o = {
|
|
3830
|
+
trigger: {
|
|
3831
|
+
left: a.left,
|
|
3832
|
+
top: a.top,
|
|
3833
|
+
width: a.width,
|
|
3834
|
+
height: a.height
|
|
3835
|
+
},
|
|
3836
|
+
content: {
|
|
3837
|
+
width: r.offsetWidth,
|
|
3838
|
+
height: r.offsetHeight
|
|
3839
|
+
}
|
|
3840
|
+
};
|
|
3841
|
+
i((e) => Gr(e, o) ? e : o);
|
|
3842
|
+
}, [t, e]);
|
|
3843
|
+
return ie(() => {
|
|
3844
|
+
if (a(), !n) return;
|
|
3845
|
+
let r = e.current, i = t.current, o = new ResizeObserver(a);
|
|
3846
|
+
return r && o.observe(r), i && o.observe(i), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a), () => {
|
|
3847
|
+
o.disconnect(), window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a);
|
|
3848
|
+
};
|
|
3849
|
+
}, [
|
|
3850
|
+
n,
|
|
3851
|
+
t,
|
|
3852
|
+
e,
|
|
3853
|
+
a
|
|
3854
|
+
]), r;
|
|
3855
|
+
}
|
|
3856
|
+
//#endregion
|
|
3857
|
+
//#region src/components/motion/popover-morph.tsx
|
|
3858
|
+
var qr = L(null);
|
|
3859
|
+
function Jr(e) {
|
|
3860
|
+
let t = ne(qr);
|
|
3861
|
+
if (!t) throw Error(`${e} must be used within <MorphPopover>`);
|
|
3862
|
+
return t;
|
|
3863
|
+
}
|
|
3864
|
+
function Yr({ children: e, open: t, defaultOpen: n = !1, onOpenChange: r, className: a }) {
|
|
3865
|
+
let o = re(), s = U(null), c = U(null), l = U(null), [u, d] = W(n), f = t !== void 0, p = f ? t : u, m = V((e) => {
|
|
3866
|
+
f || d(e), r?.(e);
|
|
3867
|
+
}, [f, r]), h = V(() => m(!p), [m, p]);
|
|
3868
|
+
H(() => {
|
|
3869
|
+
if (!p) return;
|
|
3870
|
+
let e = (e) => e.key === "Escape" && m(!1), t = (e) => {
|
|
3871
|
+
let t = e.target;
|
|
3872
|
+
s.current && !s.current.contains(t) && !l.current?.contains(t) && m(!1);
|
|
3873
|
+
};
|
|
3874
|
+
return window.addEventListener("keydown", e), window.addEventListener("pointerdown", t), () => {
|
|
3875
|
+
window.removeEventListener("keydown", e), window.removeEventListener("pointerdown", t);
|
|
3876
|
+
};
|
|
3877
|
+
}, [p, m]);
|
|
3878
|
+
let g = ae(() => ({
|
|
3879
|
+
open: p,
|
|
3880
|
+
setOpen: m,
|
|
3881
|
+
toggle: h,
|
|
3882
|
+
triggerId: `${o}-trigger`,
|
|
3883
|
+
contentId: `${o}-content`,
|
|
3884
|
+
triggerRef: c,
|
|
3885
|
+
setContentRef: (e) => {
|
|
3886
|
+
l.current = e;
|
|
3887
|
+
},
|
|
3888
|
+
contentRef: l
|
|
3889
|
+
}), [
|
|
3890
|
+
p,
|
|
3891
|
+
m,
|
|
3892
|
+
h,
|
|
3893
|
+
o
|
|
3894
|
+
]);
|
|
3895
|
+
return /* @__PURE__ */ i(qr.Provider, {
|
|
3896
|
+
value: g,
|
|
3897
|
+
children: /* @__PURE__ */ i("div", {
|
|
3898
|
+
ref: s,
|
|
3899
|
+
className: J("relative inline-flex", a),
|
|
3900
|
+
children: e
|
|
3901
|
+
})
|
|
3902
|
+
});
|
|
3903
|
+
}
|
|
3904
|
+
function Xr(...e) {
|
|
3905
|
+
return (t) => {
|
|
3906
|
+
for (let n of e) typeof n == "function" ? n(t) : n && typeof n == "object" && (n.current = t);
|
|
3907
|
+
};
|
|
3908
|
+
}
|
|
3909
|
+
function Zr({ children: e }) {
|
|
3910
|
+
let t = Jr("MorphPopoverTrigger");
|
|
3911
|
+
if (!B(e)) return e;
|
|
3912
|
+
let n = e, r = n.props.onClick, i = n.props.ref;
|
|
3913
|
+
return I(n, {
|
|
3914
|
+
id: t.triggerId,
|
|
3915
|
+
ref: Xr(i, (e) => {
|
|
3916
|
+
t.triggerRef.current = e;
|
|
3917
|
+
}),
|
|
3918
|
+
onClick: (e) => {
|
|
3919
|
+
r?.(e), t.toggle();
|
|
3920
|
+
},
|
|
3921
|
+
"aria-haspopup": "dialog",
|
|
3922
|
+
"aria-expanded": t.open,
|
|
3923
|
+
"aria-controls": t.open ? t.contentId : void 0
|
|
3924
|
+
});
|
|
3925
|
+
}
|
|
3926
|
+
var Qr = (e, t) => `${e === "bottom" ? "top" : "bottom"} ${t === "end" ? "right" : "left"}`;
|
|
3927
|
+
function $r(e, t, n) {
|
|
3928
|
+
return `inset(${e === "bottom" ? "0%" : "92%"} ${t === "end" ? "0%" : "92%"} ${e === "bottom" ? "92%" : "0%"} ${t === "end" ? "92%" : "0%"} round ${n}px)`;
|
|
3929
|
+
}
|
|
3930
|
+
var ei = (e) => `inset(0% 0% 0% 0% round ${e}px)`, ti = {
|
|
3931
|
+
duration: .32,
|
|
3932
|
+
ease: Dn
|
|
3933
|
+
};
|
|
3934
|
+
function ni({ children: e, side: t = "bottom", align: n = "end", sideOffset: r = 8, radius: a = 16, className: o }) {
|
|
3935
|
+
let s = Jr("MorphPopoverContent"), { contentId: c, setContentRef: l, triggerId: u } = s, d = be() ?? !1, [f, p] = W(!1), m = Kr(s.triggerRef, s.contentRef, f && s.open);
|
|
3936
|
+
H(() => p(!0), []);
|
|
3937
|
+
let h = m ? n === "end" ? m.trigger.left + m.trigger.width - m.content.width : m.trigger.left : 0, g = m ? t === "bottom" ? m.trigger.top + m.trigger.height + r : m.trigger.top - m.content.height - r : 0, _ = d ? void 0 : {
|
|
3938
|
+
hidden: {
|
|
3939
|
+
opacity: 0,
|
|
3940
|
+
scale: .96,
|
|
3941
|
+
transition: Nn
|
|
3942
|
+
},
|
|
3943
|
+
show: {
|
|
3944
|
+
opacity: 1,
|
|
3945
|
+
scale: 1,
|
|
3946
|
+
transition: Nn
|
|
3947
|
+
}
|
|
3948
|
+
}, v = d ? void 0 : {
|
|
3949
|
+
hidden: {
|
|
3950
|
+
clipPath: $r(t, n, a),
|
|
3951
|
+
transition: ti
|
|
3952
|
+
},
|
|
3953
|
+
show: {
|
|
3954
|
+
clipPath: ei(a),
|
|
3955
|
+
transition: ti
|
|
3956
|
+
}
|
|
3957
|
+
};
|
|
3958
|
+
return f ? Te(/* @__PURE__ */ i(K, { children: s.open ? /* @__PURE__ */ i(q.div, {
|
|
3959
|
+
"data-morph-popover-portal": "",
|
|
3960
|
+
variants: _,
|
|
3961
|
+
initial: d ? { opacity: 0 } : "hidden",
|
|
3962
|
+
animate: d ? { opacity: 1 } : "show",
|
|
3963
|
+
exit: d ? { opacity: 0 } : "hidden",
|
|
3964
|
+
transition: d ? { duration: .12 } : void 0,
|
|
3965
|
+
style: {
|
|
3966
|
+
left: h,
|
|
3967
|
+
top: g,
|
|
3968
|
+
visibility: m ? "visible" : "hidden",
|
|
3969
|
+
transformOrigin: Qr(t, n)
|
|
3970
|
+
},
|
|
3971
|
+
className: "fixed z-[9999] [filter:drop-shadow(0_10px_18px_rgba(0,0,0,0.14))]",
|
|
3972
|
+
children: /* @__PURE__ */ i(q.div, {
|
|
3973
|
+
ref: l,
|
|
3974
|
+
id: c,
|
|
3975
|
+
role: "dialog",
|
|
3976
|
+
"aria-labelledby": u,
|
|
3977
|
+
variants: v,
|
|
3978
|
+
style: { borderRadius: a },
|
|
3979
|
+
className: J("overflow-hidden border border-border bg-background", o),
|
|
3980
|
+
children: e
|
|
3981
|
+
})
|
|
3982
|
+
}) : null }), document.body) : null;
|
|
3983
|
+
}
|
|
3984
|
+
//#endregion
|
|
3985
|
+
//#region src/components/agents/sidebar-row.tsx
|
|
3986
|
+
var ri = {
|
|
3987
|
+
initial: {
|
|
3988
|
+
opacity: 0,
|
|
3989
|
+
filter: "blur(6px)"
|
|
3990
|
+
},
|
|
3991
|
+
animate: {
|
|
3992
|
+
opacity: 1,
|
|
3993
|
+
filter: "blur(0px)"
|
|
3994
|
+
},
|
|
3995
|
+
exit: (e) => e ? {} : {
|
|
3996
|
+
opacity: 0,
|
|
3997
|
+
filter: "blur(6px)"
|
|
3998
|
+
}
|
|
3999
|
+
}, ii = {
|
|
4000
|
+
initial: { opacity: 0 },
|
|
4001
|
+
animate: { opacity: 1 },
|
|
4002
|
+
exit: (e) => e ? {} : { opacity: 0 }
|
|
4003
|
+
};
|
|
4004
|
+
function ai({ row: e, active: t, expanded: n, focused: r, draggingId: o, dropTarget: s, menuOpen: c, renaming: l, onDragEnd: u, onDragOver: d, onDragStart: p, onDrop: m, onFocus: h, onKeyDown: g, onMenuOpenChange: _, onRenameCancel: v, onRenameCommit: y, onRenameStart: b, onSelect: x, onToggle: S, hoverActive: C = !1, hoverPill: w = !1, hoverLayoutId: T, onHoverChange: D, renderIcon: O, renderMenu: A, renderActionsTrigger: j, setRef: M }) {
|
|
4005
|
+
let N = be() ?? !1, [ee, te] = W(!1), P = U(null), F = U(!1), L = U(!1), [R, z] = W(e.item.label), B = Pr(e.item), V = o === e.item.id, ne = s?.id === e.item.id ? s.position : null;
|
|
4006
|
+
H(() => {
|
|
4007
|
+
l && (F.current = !1, requestAnimationFrame(() => {
|
|
4008
|
+
P.current?.focus(), P.current?.select();
|
|
4009
|
+
}));
|
|
4010
|
+
}, [l, e.item.label]);
|
|
4011
|
+
let re = A?.(e.item, {
|
|
4012
|
+
close: () => _(!1),
|
|
4013
|
+
rename: () => {
|
|
4014
|
+
_(!1), b();
|
|
4015
|
+
}
|
|
4016
|
+
}) ?? /* @__PURE__ */ a("button", {
|
|
4017
|
+
type: "button",
|
|
4018
|
+
onClick: () => {
|
|
4019
|
+
_(!1), b();
|
|
4020
|
+
},
|
|
4021
|
+
className: "flex h-8 w-full items-center gap-2 rounded-lg px-2.5 text-left text-xs text-foreground transition-colors outline-none hover:bg-muted focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-ring",
|
|
4022
|
+
children: [/* @__PURE__ */ i(k, {
|
|
4023
|
+
"aria-hidden": "true",
|
|
4024
|
+
className: "size-3.5"
|
|
4025
|
+
}), "Rename"]
|
|
4026
|
+
});
|
|
4027
|
+
return /* @__PURE__ */ a(q.div, {
|
|
4028
|
+
ref: M,
|
|
4029
|
+
layout: "position",
|
|
4030
|
+
transition: N ? { duration: 0 } : Pn,
|
|
4031
|
+
role: "treeitem",
|
|
4032
|
+
"aria-level": e.depth + 1,
|
|
4033
|
+
"aria-selected": B ? void 0 : t,
|
|
4034
|
+
"aria-expanded": B ? n : void 0,
|
|
4035
|
+
"aria-disabled": e.item.disabled || void 0,
|
|
4036
|
+
tabIndex: r ? 0 : -1,
|
|
4037
|
+
draggable: !e.item.disabled && !l,
|
|
4038
|
+
"data-menu-open": c || void 0,
|
|
4039
|
+
"data-drop": ne ?? void 0,
|
|
4040
|
+
"data-dragging": V || void 0,
|
|
4041
|
+
onFocus: h,
|
|
4042
|
+
onKeyDown: g,
|
|
4043
|
+
onClick: (t) => {
|
|
4044
|
+
t.defaultPrevented || L.current || l || e.item.disabled || (B ? S() : x());
|
|
4045
|
+
},
|
|
4046
|
+
onDoubleClick: (t) => {
|
|
4047
|
+
B || e.item.disabled || (t.preventDefault(), b());
|
|
4048
|
+
},
|
|
4049
|
+
onMouseEnter: () => {
|
|
4050
|
+
te(!0), D?.(!0);
|
|
4051
|
+
},
|
|
4052
|
+
onMouseLeave: () => {
|
|
4053
|
+
te(!1), D?.(!1);
|
|
4054
|
+
},
|
|
4055
|
+
onDragStartCapture: (t) => {
|
|
4056
|
+
L.current = !0, p(t, e.item.id);
|
|
4057
|
+
},
|
|
4058
|
+
onDragEndCapture: () => {
|
|
4059
|
+
u(), requestAnimationFrame(() => {
|
|
4060
|
+
L.current = !1;
|
|
4061
|
+
});
|
|
4062
|
+
},
|
|
4063
|
+
onDragOver: (t) => d(t, e),
|
|
4064
|
+
onDrop: m,
|
|
4065
|
+
className: J("group/resource relative flex min-h-9 min-w-0 cursor-pointer items-center gap-2.5 rounded-md pr-3 text-sm outline-none", "text-muted-foreground transition-[color,background-color,scale] duration-150 ease-smooth-out hover:text-foreground motion-reduce:transition-none", !e.item.disabled && !l && "active:scale-97 motion-reduce:active:scale-100", T === void 0 && "hover:bg-muted", "focus-visible:bg-muted/70 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", "data-[menu-open=true]:bg-muted data-[menu-open=true]:text-foreground", "data-[dragging=true]:opacity-40", "data-[drop=inside]:bg-primary/10 data-[drop=inside]:ring-1 data-[drop=inside]:ring-primary/45", "data-[drop=before]:before:absolute data-[drop=before]:before:-top-0.5 data-[drop=before]:before:right-2 data-[drop=before]:before:left-2 data-[drop=before]:before:h-0.5 data-[drop=before]:before:rounded-full data-[drop=before]:before:bg-primary", "data-[drop=after]:after:absolute data-[drop=after]:after:right-2 data-[drop=after]:after:-bottom-0.5 data-[drop=after]:after:left-2 data-[drop=after]:after:h-0.5 data-[drop=after]:after:rounded-full data-[drop=after]:after:bg-primary", !B && t && "bg-primary/10 text-primary dark:bg-primary/25 dark:text-primary-foreground", e.item.disabled && "cursor-not-allowed opacity-45"),
|
|
4066
|
+
style: { paddingLeft: `${12 + e.depth * 16}px` },
|
|
4067
|
+
children: [
|
|
4068
|
+
T ? /* @__PURE__ */ i(K, {
|
|
4069
|
+
custom: C,
|
|
4070
|
+
children: C ? /* @__PURE__ */ i(q.span, {
|
|
4071
|
+
"aria-hidden": "true",
|
|
4072
|
+
variants: N ? ii : ri,
|
|
4073
|
+
initial: "initial",
|
|
4074
|
+
animate: "animate",
|
|
4075
|
+
exit: "exit",
|
|
4076
|
+
custom: C,
|
|
4077
|
+
className: "pointer-events-none absolute inset-0",
|
|
4078
|
+
children: w ? /* @__PURE__ */ i(q.span, {
|
|
4079
|
+
layoutId: T,
|
|
4080
|
+
transition: N ? { duration: 0 } : Pn,
|
|
4081
|
+
className: "block h-full w-full rounded-md bg-foreground/8 dark:bg-muted/50"
|
|
4082
|
+
}) : null
|
|
4083
|
+
}) : null
|
|
4084
|
+
}) : null,
|
|
4085
|
+
/* @__PURE__ */ i("span", {
|
|
4086
|
+
"aria-hidden": "true",
|
|
4087
|
+
className: "relative grid size-5 shrink-0 place-items-center",
|
|
4088
|
+
children: O?.(e.item) ?? Ur(e.item, n)
|
|
4089
|
+
}),
|
|
4090
|
+
l ? /* @__PURE__ */ i("input", {
|
|
4091
|
+
ref: P,
|
|
4092
|
+
value: R,
|
|
4093
|
+
"aria-label": `Rename ${e.item.label}`,
|
|
4094
|
+
onChange: (e) => z(e.target.value),
|
|
4095
|
+
draggable: !1,
|
|
4096
|
+
onClick: (e) => e.stopPropagation(),
|
|
4097
|
+
onDoubleClick: (e) => e.stopPropagation(),
|
|
4098
|
+
onBlur: () => {
|
|
4099
|
+
F.current || y(R);
|
|
4100
|
+
},
|
|
4101
|
+
onKeyDown: (e) => {
|
|
4102
|
+
e.stopPropagation(), e.key === "Enter" && (F.current = !0, y(R)), e.key === "Escape" && (F.current = !0, v());
|
|
4103
|
+
},
|
|
4104
|
+
className: "relative h-7 min-w-0 flex-1 text-sm text-foreground outline-none focus-visible:ring-0 focus-visible:ring-ring"
|
|
4105
|
+
}) : /* @__PURE__ */ i(Wr, {
|
|
4106
|
+
active: ee || c,
|
|
4107
|
+
children: e.item.label
|
|
4108
|
+
}),
|
|
4109
|
+
!l && !e.item.disabled ? /* @__PURE__ */ a(Yr, {
|
|
4110
|
+
open: c,
|
|
4111
|
+
onOpenChange: _,
|
|
4112
|
+
children: [/* @__PURE__ */ i(Zr, { children: (() => {
|
|
4113
|
+
let t = j?.(e.item);
|
|
4114
|
+
if (t) {
|
|
4115
|
+
let e = t.props.onClick;
|
|
4116
|
+
return I(t, {
|
|
4117
|
+
draggable: !1,
|
|
4118
|
+
onClick: (t) => {
|
|
4119
|
+
t.stopPropagation(), e?.(t);
|
|
4120
|
+
}
|
|
4121
|
+
});
|
|
4122
|
+
}
|
|
4123
|
+
return /* @__PURE__ */ i(Y, {
|
|
4124
|
+
draggable: !1,
|
|
4125
|
+
tabIndex: -1,
|
|
4126
|
+
variant: "link",
|
|
4127
|
+
"aria-label": `Actions for ${e.item.label}`,
|
|
4128
|
+
onClick: (e) => e.stopPropagation(),
|
|
4129
|
+
className: "relative grid size-7 shrink-0 place-items-center rounded-lg opacity-0 transition-opacity duration-150 ease-smooth-out outline-none group-hover/resource:opacity-80 group-hover/resource:delay-150 group-data-[menu-open=true]/resource:opacity-100 hover:bg-foreground/5 focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",
|
|
4130
|
+
children: /* @__PURE__ */ i(E, {
|
|
4131
|
+
"aria-hidden": "true",
|
|
4132
|
+
className: "size-4"
|
|
4133
|
+
})
|
|
4134
|
+
});
|
|
4135
|
+
})() }), /* @__PURE__ */ i(ni, {
|
|
4136
|
+
side: "bottom",
|
|
4137
|
+
align: "end",
|
|
4138
|
+
sideOffset: 8,
|
|
4139
|
+
radius: 12,
|
|
4140
|
+
className: "w-40 p-1.5",
|
|
4141
|
+
children: /* @__PURE__ */ i("div", {
|
|
4142
|
+
"data-sidebar-resource-menu": e.item.id,
|
|
4143
|
+
children: re
|
|
4144
|
+
})
|
|
4145
|
+
})]
|
|
4146
|
+
}) : null,
|
|
4147
|
+
e.depth === 0 && B && (e.item.children?.length ?? 0) > 0 ? /* @__PURE__ */ i(f, {
|
|
4148
|
+
"aria-hidden": "true",
|
|
4149
|
+
className: J("relative size-3.5 shrink-0 text-muted-foreground transition-transform duration-200 ease-smooth-out motion-reduce:transition-none", n && "rotate-90")
|
|
4150
|
+
}) : null
|
|
4151
|
+
]
|
|
4152
|
+
});
|
|
4153
|
+
}
|
|
4154
|
+
//#endregion
|
|
4155
|
+
//#region src/components/agents/ai-sidebar.tsx
|
|
4156
|
+
function oi({ renderIcon: e, renderMenu: t, renderActionsTrigger: n, ariaLabel: o = "Resources", className: s, ...c }) {
|
|
4157
|
+
let { flat: l, selectedId: u, expandedIds: d, focusedId: f, setFocusedId: p, draggingId: m, dropTarget: h, hoveredId: g, hoverLayoutId: _, handleRowHover: v, clearHover: y, menuOpenId: b, renamingId: x, setRenamingId: S, announcement: C, select: w, toggle: T, handleKeyDown: E, handleRootDragOver: D, handleDrop: O, handleRowDragStart: k, handleRowDragEnd: A, handleRowDragOver: j, commitRename: M, handleMenuOpenChange: N, setRowRef: ee } = Hr(c);
|
|
4158
|
+
return /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ a("div", {
|
|
4159
|
+
role: "tree",
|
|
4160
|
+
"aria-label": o,
|
|
4161
|
+
"aria-multiselectable": "false",
|
|
4162
|
+
onDragOver: D,
|
|
4163
|
+
onDrop: O,
|
|
4164
|
+
onMouseLeave: y,
|
|
4165
|
+
className: J("relative flex min-w-0 flex-col gap-0.5 [overflow-anchor:none] group-data-[state=collapsed]/sidebar:hidden", m && "select-none pb-9", s),
|
|
4166
|
+
children: [/* @__PURE__ */ i(K, {
|
|
4167
|
+
initial: !1,
|
|
4168
|
+
children: l.map((r) => /* @__PURE__ */ i(ai, {
|
|
4169
|
+
row: r,
|
|
4170
|
+
active: u === r.item.id,
|
|
4171
|
+
expanded: d.has(r.item.id),
|
|
4172
|
+
focused: f === r.item.id,
|
|
4173
|
+
draggingId: m,
|
|
4174
|
+
dropTarget: h,
|
|
4175
|
+
menuOpen: b === r.item.id,
|
|
4176
|
+
renaming: x === r.item.id,
|
|
4177
|
+
hoverActive: g !== null && !m,
|
|
4178
|
+
hoverPill: g === r.item.id && !m && !r.item.disabled,
|
|
4179
|
+
hoverLayoutId: _,
|
|
4180
|
+
onHoverChange: (e) => v(r.item.id, e),
|
|
4181
|
+
onFocus: () => p(r.item.id),
|
|
4182
|
+
onSelect: () => w(r.item.id),
|
|
4183
|
+
onToggle: () => T(r.item.id),
|
|
4184
|
+
onKeyDown: (e) => E(e, r),
|
|
4185
|
+
onRenameStart: () => S(r.item.id),
|
|
4186
|
+
onRenameCancel: () => S(null),
|
|
4187
|
+
onRenameCommit: (e) => M(r, e),
|
|
4188
|
+
onMenuOpenChange: (e) => N(r, e),
|
|
4189
|
+
onDragStart: k,
|
|
4190
|
+
onDragEnd: A,
|
|
4191
|
+
onDragOver: j,
|
|
4192
|
+
onDrop: O,
|
|
4193
|
+
renderIcon: e,
|
|
4194
|
+
renderMenu: t,
|
|
4195
|
+
renderActionsTrigger: n,
|
|
4196
|
+
setRef: (e) => ee(r.item.id, e)
|
|
4197
|
+
}, r.item.id))
|
|
4198
|
+
}), m ? /* @__PURE__ */ i("div", {
|
|
4199
|
+
"aria-hidden": "true",
|
|
4200
|
+
"data-active": h?.id === null || void 0,
|
|
4201
|
+
className: "absolute inset-x-1 bottom-0 flex h-8 items-center justify-center rounded-md border border-dashed border-border text-[10px] text-muted-foreground data-[active=true]:border-primary/50 data-[active=true]:bg-primary/10 data-[active=true]:text-foreground",
|
|
4202
|
+
children: "Move to top level"
|
|
4203
|
+
}) : null]
|
|
4204
|
+
}), /* @__PURE__ */ i("span", {
|
|
4205
|
+
className: "sr-only",
|
|
4206
|
+
"aria-live": "polite",
|
|
4207
|
+
children: C
|
|
4208
|
+
})] });
|
|
4209
|
+
}
|
|
4210
|
+
//#endregion
|
|
4211
|
+
//#region src/components/agents/index.ts
|
|
4212
|
+
var si = {
|
|
4213
|
+
Wrapper: oi,
|
|
4214
|
+
MarqueeLabel: Wr,
|
|
4215
|
+
Row: ai,
|
|
4216
|
+
Icon: Ur
|
|
4217
|
+
};
|
|
4218
|
+
//#endregion
|
|
4219
|
+
export { oi as AISidebar, sr as AnimatedSidebar, lr as AnimatedSidebarClose, pr as AnimatedSidebarContent, mr as AnimatedSidebarFooter, hr as AnimatedSidebarGroup, _r as AnimatedSidebarGroupContent, gr as AnimatedSidebarGroupLabel, fr as AnimatedSidebarHeader, dr as AnimatedSidebarInset, vr as AnimatedSidebarMenu, Cr as AnimatedSidebarMenuButton, yr as AnimatedSidebarMenuItem, br as AnimatedSidebarMenuSub, Sr as AnimatedSidebarMenuSubButton, xr as AnimatedSidebarMenuSubItem, ar as AnimatedSidebarProvider, ur as AnimatedSidebarRail, cr as AnimatedSidebarTrigger, rn as AuthCard, on as AuthError, cn as AuthSeparator, sn as AuthSuccess, Ee as Avatar, Oe as AvatarFallback, De as AvatarImage, e as AvatarPrimitive, Y as Button, ze as Card, Ye as CardAction, Xe as CardContent, Xe as CardPanel, Je as CardDescription, Ze as CardFooter, Be as CardFrame, We as CardFrameAction, Ue as CardFrameDescription, Ge as CardFrameFooter, Ve as CardFrameHeader, He as CardFrameTitle, Ke as CardHeader, qe as CardTitle, tt as Checkbox, se as CheckboxPrimitive, un as CodeAuthBlock, vn as DEFAULT_ONBOARDING_STEPS, Ct as DropdownMenu, Ct as Menu, At as DropdownMenuCheckboxItem, At as MenuCheckboxItem, Et as DropdownMenuContent, Et as MenuPopup, St as DropdownMenuCreateHandle, St as MenuCreateHandle, Dt as DropdownMenuGroup, Dt as MenuGroup, Ot as DropdownMenuItem, Ot as MenuItem, Nt as DropdownMenuLabel, Nt as MenuGroupLabel, wt as DropdownMenuPortal, wt as MenuPortal, jt as DropdownMenuRadioGroup, jt as MenuRadioGroup, Mt as DropdownMenuRadioItem, Mt as MenuRadioItem, Pt as DropdownMenuSeparator, Pt as MenuSeparator, Ft as DropdownMenuShortcut, Ft as MenuShortcut, It as DropdownMenuSub, It as MenuSub, Rt as DropdownMenuSubContent, Rt as MenuSubPopup, Lt as DropdownMenuSubTrigger, Lt as MenuSubTrigger, Tt as DropdownMenuTrigger, Tt as MenuTrigger, Q as EASE, kn as EASE_DRAWER, On as EASE_IN_OUT, Dn as EASE_OUT, An as EASE_OUT_CSS, X as Field, at as FieldControl, rt as FieldDescription, it as FieldError, nt as FieldItem, Z as FieldLabel, ot as FieldValidity, dn as ForgotPasswordBlock, st as Frame, dt as FrameDescription, ft as FrameFooter, lt as FrameHeader, ct as FramePanel, ut as FrameTitle, pt as Input, gt as InputGroup, _t as InputGroupAddon, yt as InputGroupInput, vt as InputGroupText, bt as InputGroupTextarea, ge as InputPrimitive, xt as Label, pn as LinkedAccountsBlock, mn as LoginBlock, Wr as MarqueeLabel, kt as MenuLinkItem, G as MenuPrimitive, an as MorphStep, Bt as OTPField, Vt as OTPFieldInput, _e as OTPFieldPrimitive, Ht as OTPFieldSeparator, yn as OnboardingBlock, Cn as PasskeyManagerBlock, wn as PasskeySignInBlock, Jt as PasswordInput, Mr as ProfileCardBlock, ai as ResourceRow, $ as Reveal, Xt as SOCIAL_PROVIDERS, In as SPRING_GLIDE, Pn as SPRING_LAYOUT, Fn as SPRING_MOUSE, Nn as SPRING_PANEL, jn as SPRING_PRESS, Mn as SPRING_SWAP, zt as Separator, ve as SeparatorPrimitive, zn as SharedLayoutBg, Or as ShellLayout, si as Sidebar, Er as SidebarBlock, Ur as SidebarIcon, Tn as SignupBlock, Ut as Skeleton, Qt as SocialProviders, ke as Spinner, Dr as TITLE_BAR_HEIGHT, mt as Textarea, En as UpdatePasswordBlock, en as UserAvatar, nn as authAccentActionStyles, tn as authAccentVars, $e as bindSounds, Re as buttonVariants, J as cn, Ar as defaultProfileCardItems, Kt as getPasswordStrength, $t as initialsFrom, Gt as passwordRequirements, et as playCue, ue as playSound, de as setSoundEnabled, fe as setSoundVolume, pe as sounds, Hr as useAISidebar, rr as useAnimatedSidebar, ln as useCountdown };
|
|
3498
4220
|
|
|
3499
4221
|
//# sourceMappingURL=index.js.map
|