@exegia/corpora-ui 0.8.0 → 0.9.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/blocks/nav/__tests__/sidebar-block.test.d.ts +1 -0
- package/dist-lib/components/blocks/nav/sidebar-block.d.ts +67 -0
- package/dist-lib/components/blocks/profile/__tests__/profile-card-block.test.d.ts +1 -0
- package/dist-lib/components/blocks/profile/profile-card-block.d.ts +77 -0
- package/dist-lib/components/composed/__tests__/user-avatar.test.d.ts +1 -0
- package/dist-lib/components/composed/user-avatar.d.ts +30 -0
- package/dist-lib/components/motion/animated-sidebar.d.ts +98 -0
- package/dist-lib/components/motion/shared-layout-bg.d.ts +13 -0
- package/dist-lib/components/ui/avatar.d.ts +6 -0
- package/dist-lib/components/ui/menu.d.ts +43 -0
- package/dist-lib/components/ui/skeleton.d.ts +2 -0
- package/dist-lib/index.d.ts +9 -0
- package/dist-lib/index.js +1896 -864
- package/dist-lib/index.js.map +1 -1
- package/dist-lib/lib/ease.d.ts +46 -0
- package/package.json +1 -1
- package/src/components/blocks/nav/__tests__/sidebar-block.test.tsx +125 -0
- package/src/components/blocks/nav/sidebar-block.tsx +264 -0
- package/src/components/blocks/profile/__tests__/profile-card-block.test.tsx +134 -0
- package/src/components/blocks/profile/profile-card-block.tsx +281 -0
- package/src/components/composed/__tests__/user-avatar.test.tsx +85 -0
- package/src/components/composed/user-avatar.tsx +98 -0
- package/src/components/motion/animated-sidebar.tsx +1145 -0
- package/src/components/motion/shared-layout-bg.tsx +151 -0
- package/src/components/ui/avatar.tsx +52 -0
- package/src/components/ui/menu.tsx +352 -0
- package/src/components/ui/skeleton.tsx +18 -0
- package/src/index.css +4 -0
- package/src/index.ts +11 -0
- package/src/lib/ease.ts +53 -0
package/dist-lib/index.js
CHANGED
|
@@ -1,46 +1,72 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
1
|
+
import { Avatar as e } from "@base-ui/react/avatar";
|
|
2
|
+
import { clsx as t } from "clsx";
|
|
3
|
+
import { twMerge as n } from "tailwind-merge";
|
|
4
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import { mergeProps as o } from "@base-ui/react/merge-props";
|
|
6
|
+
import { useRender as s } from "@base-ui/react/use-render";
|
|
7
|
+
import { cva as c } from "class-variance-authority";
|
|
8
|
+
import { ArrowLeftIcon as l, CheckIcon as u, ChevronRight as d, ChevronRightIcon as f, ChevronsUpDownIcon as p, EyeIcon as m, EyeOffIcon as h, FingerprintIcon as g, Loader2Icon as _, LogOutIcon as v, MailIcon as y, PanelLeftIcon as b, SettingsIcon as x, SmartphoneIcon as S, UserIcon as C, UserPlusIcon as w, UsersIcon as T, XIcon as E } from "lucide-react";
|
|
9
|
+
import * as D from "react";
|
|
10
|
+
import { Children as O, cloneElement as k, createContext as A, createElement as j, forwardRef as M, isValidElement as N, useCallback as P, useContext as ee, useEffect as F, useId as te, useMemo as ne, useRef as re, useState as I, useSyncExternalStore as ie } from "react";
|
|
11
|
+
import { Checkbox as ae } from "@base-ui/react/checkbox";
|
|
12
|
+
import { bind as oe, play as se, play as ce, setEnabled as le, setVolume as ue, sounds as de } from "cuelume";
|
|
13
|
+
import { Field as fe, Field as L } from "@base-ui/react/field";
|
|
14
|
+
import { Input as pe } from "@base-ui/react/input";
|
|
15
|
+
import { Menu as R } from "@base-ui/react/menu";
|
|
16
|
+
import { OTPField as me } from "@base-ui/react/otp-field";
|
|
17
|
+
import { Separator as he } from "@base-ui/react/separator";
|
|
18
|
+
import { AnimatePresence as z, MotionConfig as ge, motion as B, useReducedMotion as _e } from "motion/react";
|
|
19
|
+
import { RiAppleFill as ve, RiGithubFill as ye, RiGoogleFill as be, RiTwitterXFill as xe } from "@remixicon/react";
|
|
20
|
+
import { createPortal as Se } from "react-dom";
|
|
18
21
|
//#region src/lib/utils.ts
|
|
19
|
-
function
|
|
20
|
-
return
|
|
22
|
+
function V(...e) {
|
|
23
|
+
return n(t(e));
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/components/ui/avatar.tsx
|
|
27
|
+
function Ce({ className: t, ...n }) {
|
|
28
|
+
return /* @__PURE__ */ i(e.Root, {
|
|
29
|
+
className: V("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
|
+
"data-slot": "avatar",
|
|
31
|
+
...n
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function we({ className: t, ...n }) {
|
|
35
|
+
return /* @__PURE__ */ i(e.Image, {
|
|
36
|
+
className: V("size-full object-cover", t),
|
|
37
|
+
"data-slot": "avatar-image",
|
|
38
|
+
...n
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function Te({ className: t, ...n }) {
|
|
42
|
+
return /* @__PURE__ */ i(e.Fallback, {
|
|
43
|
+
className: V("flex size-full items-center justify-center rounded-full bg-muted", t),
|
|
44
|
+
"data-slot": "avatar-fallback",
|
|
45
|
+
...n
|
|
46
|
+
});
|
|
21
47
|
}
|
|
22
48
|
//#endregion
|
|
23
49
|
//#region src/components/ui/spinner.tsx
|
|
24
|
-
function
|
|
25
|
-
return /* @__PURE__ */
|
|
50
|
+
function Ee({ className: e, ...t }) {
|
|
51
|
+
return /* @__PURE__ */ i(_, {
|
|
26
52
|
"aria-label": "Loading",
|
|
27
|
-
className:
|
|
53
|
+
className: V("animate-spin", e),
|
|
28
54
|
role: "status",
|
|
29
55
|
...t
|
|
30
56
|
});
|
|
31
57
|
}
|
|
32
58
|
//#endregion
|
|
33
59
|
//#region src/components/ui/glasscn/liquid-glass.tsx
|
|
34
|
-
var
|
|
35
|
-
function
|
|
60
|
+
var De = 480, Oe = 1.25, ke = /* @__PURE__ */ new Map();
|
|
61
|
+
function Ae() {
|
|
36
62
|
if (typeof navigator > "u") return !1;
|
|
37
63
|
let e = navigator.userAgent;
|
|
38
64
|
return (/Chrom(e|ium)/.test(e) || /Edg\//.test(e)) && !/Firefox/.test(e);
|
|
39
65
|
}
|
|
40
|
-
function
|
|
41
|
-
let i = `${e}:${t}:${n}:${r}`, a =
|
|
66
|
+
function je({ width: e, height: t, radius: n, bezel: r }) {
|
|
67
|
+
let i = `${e}:${t}:${n}:${r}`, a = ke.get(i);
|
|
42
68
|
if (a !== void 0) return a;
|
|
43
|
-
let o = Math.min(1,
|
|
69
|
+
let o = Math.min(1, De / Math.max(e, t)), s = Math.max(2, Math.round(e * o)), c = Math.max(2, Math.round(t * o)), l = document.createElement("canvas");
|
|
44
70
|
l.width = s, l.height = c;
|
|
45
71
|
let u = l.getContext("2d");
|
|
46
72
|
if (!u) return "";
|
|
@@ -56,55 +82,55 @@ function ue({ width: e, height: t, radius: n, bezel: r }) {
|
|
|
56
82
|
f[v] = 128, f[v + 1] = 128, f[v + 2] = 128, f[v + 3] = 255;
|
|
57
83
|
continue;
|
|
58
84
|
}
|
|
59
|
-
let b = 1 -
|
|
60
|
-
b *= Math.min(1, y /
|
|
85
|
+
let b = 1 - Me(Math.min(1, y / g));
|
|
86
|
+
b *= Math.min(1, y / Oe), f[v] = Math.round(128 + d * b * 127), f[v + 1] = Math.round(128 + _ * b * 127), f[v + 2] = 128, f[v + 3] = 255;
|
|
61
87
|
}
|
|
62
88
|
u.putImageData(d, 0, 0);
|
|
63
89
|
let _ = l.toDataURL("image/png");
|
|
64
|
-
return
|
|
90
|
+
return ke.set(i, _), _;
|
|
65
91
|
}
|
|
66
|
-
function
|
|
92
|
+
function Me(e) {
|
|
67
93
|
return (1 - (1 - e) ** 4) ** .25;
|
|
68
94
|
}
|
|
69
|
-
var
|
|
70
|
-
let
|
|
95
|
+
var Ne = M(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 = te(), m = ne(() => `liquid-glass-${p.replace(/:/g, "")}`, [p]);
|
|
71
97
|
console.log(n);
|
|
72
|
-
let
|
|
73
|
-
|
|
74
|
-
}, [
|
|
75
|
-
|
|
76
|
-
let e =
|
|
98
|
+
let h = re(null), g = P((e) => {
|
|
99
|
+
h.current = e, typeof f == "function" ? f(e) : f && (f.current = e);
|
|
100
|
+
}, [f]), [_, v] = I(null);
|
|
101
|
+
F(() => {
|
|
102
|
+
let e = h.current;
|
|
77
103
|
if (!e) return;
|
|
78
104
|
let t = () => {
|
|
79
|
-
let t = e.getBoundingClientRect(), n = Math.round(t.width),
|
|
80
|
-
if (!n || !
|
|
81
|
-
let
|
|
82
|
-
v((e) => e && e.width === n && e.height ===
|
|
105
|
+
let t = e.getBoundingClientRect(), n = Math.round(t.width), r = Math.round(t.height);
|
|
106
|
+
if (!n || !r) return;
|
|
107
|
+
let i = Number.parseFloat(getComputedStyle(e).borderTopLeftRadius), a = Math.min(Number.isFinite(i) ? i : Math.min(n, r) / 2, n / 2, r / 2);
|
|
108
|
+
v((e) => e && e.width === n && e.height === r && e.radius === a && e.bezel === o ? e : {
|
|
83
109
|
width: n,
|
|
84
|
-
height:
|
|
85
|
-
radius:
|
|
86
|
-
bezel:
|
|
110
|
+
height: r,
|
|
111
|
+
radius: a,
|
|
112
|
+
bezel: o
|
|
87
113
|
});
|
|
88
114
|
};
|
|
89
115
|
t();
|
|
90
116
|
let n = new ResizeObserver(t);
|
|
91
117
|
return n.observe(e), () => n.disconnect();
|
|
92
|
-
}, [
|
|
93
|
-
let
|
|
94
|
-
|
|
95
|
-
|
|
118
|
+
}, [o]);
|
|
119
|
+
let y = ne(() => _ ? je(_) : "", [_]), [b, x] = I(!1);
|
|
120
|
+
F(() => {
|
|
121
|
+
x(Ae());
|
|
96
122
|
}, []);
|
|
97
|
-
let
|
|
98
|
-
return /* @__PURE__ */
|
|
99
|
-
ref:
|
|
100
|
-
className:
|
|
123
|
+
let S = b && y !== "", C = S ? `url(#${m}) blur(${e}px) saturate(${s})` : `blur(${e + 2}px) saturate(${s})`;
|
|
124
|
+
return /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ a("div", {
|
|
125
|
+
ref: g,
|
|
126
|
+
className: V("relative overflow-hidden rounded-full bg-white/[0.08]", c),
|
|
101
127
|
style: {
|
|
102
|
-
...
|
|
103
|
-
backdropFilter:
|
|
104
|
-
WebkitBackdropFilter:
|
|
128
|
+
...l,
|
|
129
|
+
backdropFilter: C,
|
|
130
|
+
WebkitBackdropFilter: C
|
|
105
131
|
},
|
|
106
|
-
...
|
|
107
|
-
children: [
|
|
132
|
+
...d,
|
|
133
|
+
children: [u, /* @__PURE__ */ i("span", {
|
|
108
134
|
"aria-hidden": !0,
|
|
109
135
|
className: "pointer-events-none absolute inset-0 rounded-[inherit]",
|
|
110
136
|
style: {
|
|
@@ -115,19 +141,19 @@ var fe = v(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .3
|
|
|
115
141
|
mask: "linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0)"
|
|
116
142
|
}
|
|
117
143
|
})]
|
|
118
|
-
}),
|
|
144
|
+
}), S && /* @__PURE__ */ i("svg", {
|
|
119
145
|
className: "absolute size-0 overflow-hidden",
|
|
120
146
|
"aria-hidden": !0,
|
|
121
|
-
children: /* @__PURE__ */
|
|
122
|
-
id:
|
|
147
|
+
children: /* @__PURE__ */ a("filter", {
|
|
148
|
+
id: m,
|
|
123
149
|
x: "0",
|
|
124
150
|
y: "0",
|
|
125
151
|
width: "100%",
|
|
126
152
|
height: "100%",
|
|
127
153
|
colorInterpolationFilters: "sRGB",
|
|
128
154
|
children: [
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
href:
|
|
155
|
+
/* @__PURE__ */ i("feImage", {
|
|
156
|
+
href: y,
|
|
131
157
|
x: "0",
|
|
132
158
|
y: "0",
|
|
133
159
|
width: "100%",
|
|
@@ -135,7 +161,7 @@ var fe = v(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .3
|
|
|
135
161
|
preserveAspectRatio: "none",
|
|
136
162
|
result: "map"
|
|
137
163
|
}),
|
|
138
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ i("feDisplacementMap", {
|
|
139
165
|
in: "SourceGraphic",
|
|
140
166
|
in2: "map",
|
|
141
167
|
scale: t,
|
|
@@ -143,14 +169,14 @@ var fe = v(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .3
|
|
|
143
169
|
yChannelSelector: "G",
|
|
144
170
|
result: "displaced"
|
|
145
171
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ i("feGaussianBlur", {
|
|
147
173
|
in: "displaced",
|
|
148
174
|
stdDeviation: "0.15"
|
|
149
175
|
})
|
|
150
176
|
]
|
|
151
177
|
})
|
|
152
178
|
})] });
|
|
153
|
-
}),
|
|
179
|
+
}), Pe = {
|
|
154
180
|
clear: [
|
|
155
181
|
"backdrop-blur-[2px] backdrop-saturate-[1.9]",
|
|
156
182
|
"bg-white/[0.25] dark:bg-black/[0.25]",
|
|
@@ -184,7 +210,7 @@ var fe = v(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .3
|
|
|
184
210
|
"[will-change:background-position]"
|
|
185
211
|
].join(" "),
|
|
186
212
|
"liquid-refract": ""
|
|
187
|
-
},
|
|
213
|
+
}, Fe = c("relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-base outline-none transition-[scale,box-shadow,width,height,background-color,border-color] [transition-duration:150ms,150ms,300ms,300ms,150ms,150ms] ease-smooth-out active:scale-97 data-pressed:scale-97 motion-reduce:transition-none motion-reduce:active:scale-100 motion-reduce:data-pressed:scale-100 [&_svg]:transition-transform [&_svg]:duration-150 [&_svg]:ease-smooth-out motion-reduce:[&_svg]:transition-none before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 data-loading:select-none 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", {
|
|
188
214
|
compoundVariants: [{
|
|
189
215
|
class: "h-auto border-0 px-0 align-middle sm:h-auto",
|
|
190
216
|
size: [
|
|
@@ -225,197 +251,197 @@ var fe = v(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .3
|
|
|
225
251
|
}
|
|
226
252
|
}
|
|
227
253
|
});
|
|
228
|
-
function
|
|
229
|
-
let
|
|
254
|
+
function H({ className: e, variant: t, size: n, render: c, children: l, loading: u = !1, disabled: d, glassVariant: f, sound: p = !0, ...m }) {
|
|
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({
|
|
230
256
|
defaultTagName: "button",
|
|
231
|
-
props:
|
|
232
|
-
children: /* @__PURE__ */
|
|
233
|
-
!y && /* @__PURE__ */
|
|
234
|
-
"aria-hidden": !
|
|
257
|
+
props: o({
|
|
258
|
+
children: /* @__PURE__ */ a(r, { children: [
|
|
259
|
+
!y && /* @__PURE__ */ i("span", {
|
|
260
|
+
"aria-hidden": !u || void 0,
|
|
235
261
|
"data-slot": "button-loading-indicator",
|
|
236
|
-
className:
|
|
237
|
-
children: /* @__PURE__ */
|
|
262
|
+
className: V("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" : V("max-w-0 opacity-0 blur-[2px]", n === "xs" ? "-ms-1" : n === "sm" ? "-ms-1.5" : "-ms-2")),
|
|
263
|
+
children: /* @__PURE__ */ i(Ee, { className: u ? void 0 : "animate-none" })
|
|
238
264
|
}),
|
|
239
|
-
|
|
240
|
-
|
|
265
|
+
l,
|
|
266
|
+
u && y && /* @__PURE__ */ i(Ee, {
|
|
241
267
|
className: "pointer-events-none absolute",
|
|
242
268
|
"data-slot": "button-loading-indicator"
|
|
243
269
|
})
|
|
244
270
|
] }),
|
|
245
|
-
className:
|
|
246
|
-
size:
|
|
247
|
-
variant:
|
|
248
|
-
}), !y && "hover:[&_svg:not([class*='animate-'])]:scale-110 motion-reduce:hover:[&_svg]:scale-100",
|
|
249
|
-
"aria-disabled":
|
|
250
|
-
"data-cuelume-press":
|
|
251
|
-
"data-cuelume-release":
|
|
252
|
-
"data-loading":
|
|
271
|
+
className: V(Fe({
|
|
272
|
+
size: n,
|
|
273
|
+
variant: t
|
|
274
|
+
}), !y && "hover:[&_svg:not([class*='animate-'])]:scale-110 motion-reduce:hover:[&_svg]:scale-100", u && y && "data-loading:text-transparent", _ && Pe[_], v && "bg-transparent border-0 shadow-none", e),
|
|
275
|
+
"aria-disabled": u || void 0,
|
|
276
|
+
"data-cuelume-press": p ? "" : void 0,
|
|
277
|
+
"data-cuelume-release": p ? "" : void 0,
|
|
278
|
+
"data-loading": u ? "" : void 0,
|
|
253
279
|
"data-glass-variant": _,
|
|
254
280
|
"data-slot": "button",
|
|
255
|
-
disabled:
|
|
256
|
-
type:
|
|
257
|
-
},
|
|
258
|
-
render:
|
|
281
|
+
disabled: h,
|
|
282
|
+
type: g
|
|
283
|
+
}, m),
|
|
284
|
+
render: c
|
|
259
285
|
});
|
|
260
|
-
return v ? /* @__PURE__ */
|
|
286
|
+
return v ? /* @__PURE__ */ i(Ne, { children: b }) : b;
|
|
261
287
|
}
|
|
262
288
|
//#endregion
|
|
263
289
|
//#region src/components/ui/card.tsx
|
|
264
|
-
function
|
|
265
|
-
return
|
|
290
|
+
function Ie({ className: e, render: t, ...n }) {
|
|
291
|
+
return s({
|
|
266
292
|
defaultTagName: "div",
|
|
267
|
-
props:
|
|
268
|
-
className:
|
|
293
|
+
props: o({
|
|
294
|
+
className: V("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),
|
|
269
295
|
"data-slot": "card"
|
|
270
|
-
},
|
|
271
|
-
render:
|
|
296
|
+
}, n),
|
|
297
|
+
render: t
|
|
272
298
|
});
|
|
273
299
|
}
|
|
274
|
-
function
|
|
275
|
-
return
|
|
300
|
+
function Le({ className: e, render: t, ...n }) {
|
|
301
|
+
return s({
|
|
276
302
|
defaultTagName: "div",
|
|
277
|
-
props:
|
|
278
|
-
className:
|
|
303
|
+
props: o({
|
|
304
|
+
className: V("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),
|
|
279
305
|
"data-slot": "card-frame"
|
|
280
|
-
},
|
|
281
|
-
render:
|
|
306
|
+
}, n),
|
|
307
|
+
render: t
|
|
282
308
|
});
|
|
283
309
|
}
|
|
284
|
-
function
|
|
285
|
-
return
|
|
310
|
+
function Re({ className: e, render: t, ...n }) {
|
|
311
|
+
return s({
|
|
286
312
|
defaultTagName: "div",
|
|
287
|
-
props:
|
|
288
|
-
className:
|
|
313
|
+
props: o({
|
|
314
|
+
className: V("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),
|
|
289
315
|
"data-slot": "card-frame-header"
|
|
290
|
-
},
|
|
291
|
-
render:
|
|
316
|
+
}, n),
|
|
317
|
+
render: t
|
|
292
318
|
});
|
|
293
319
|
}
|
|
294
|
-
function
|
|
295
|
-
return
|
|
320
|
+
function ze({ className: e, render: t, ...n }) {
|
|
321
|
+
return s({
|
|
296
322
|
defaultTagName: "div",
|
|
297
|
-
props:
|
|
298
|
-
className:
|
|
323
|
+
props: o({
|
|
324
|
+
className: V("self-center font-semibold text-sm", e),
|
|
299
325
|
"data-slot": "card-frame-title"
|
|
300
|
-
},
|
|
301
|
-
render:
|
|
326
|
+
}, n),
|
|
327
|
+
render: t
|
|
302
328
|
});
|
|
303
329
|
}
|
|
304
|
-
function
|
|
305
|
-
return
|
|
330
|
+
function Be({ className: e, render: t, ...n }) {
|
|
331
|
+
return s({
|
|
306
332
|
defaultTagName: "div",
|
|
307
|
-
props:
|
|
308
|
-
className:
|
|
333
|
+
props: o({
|
|
334
|
+
className: V("self-center text-muted-foreground text-sm", e),
|
|
309
335
|
"data-slot": "card-frame-description"
|
|
310
|
-
},
|
|
311
|
-
render:
|
|
336
|
+
}, n),
|
|
337
|
+
render: t
|
|
312
338
|
});
|
|
313
339
|
}
|
|
314
|
-
function
|
|
315
|
-
return
|
|
340
|
+
function Ve({ className: e, render: t, ...n }) {
|
|
341
|
+
return s({
|
|
316
342
|
defaultTagName: "div",
|
|
317
|
-
props:
|
|
318
|
-
className:
|
|
343
|
+
props: o({
|
|
344
|
+
className: V("col-start-2 nth-3:row-span-2 nth-3:row-start-1 inline-flex self-center justify-self-end", e),
|
|
319
345
|
"data-slot": "card-frame-action"
|
|
320
|
-
},
|
|
321
|
-
render:
|
|
346
|
+
}, n),
|
|
347
|
+
render: t
|
|
322
348
|
});
|
|
323
349
|
}
|
|
324
|
-
function
|
|
325
|
-
return
|
|
350
|
+
function He({ className: e, render: t, ...n }) {
|
|
351
|
+
return s({
|
|
326
352
|
defaultTagName: "div",
|
|
327
|
-
props:
|
|
328
|
-
className:
|
|
353
|
+
props: o({
|
|
354
|
+
className: V("px-6 py-4", e),
|
|
329
355
|
"data-slot": "card-frame-footer"
|
|
330
|
-
},
|
|
331
|
-
render:
|
|
356
|
+
}, n),
|
|
357
|
+
render: t
|
|
332
358
|
});
|
|
333
359
|
}
|
|
334
|
-
function
|
|
335
|
-
return
|
|
360
|
+
function Ue({ className: e, render: t, ...n }) {
|
|
361
|
+
return s({
|
|
336
362
|
defaultTagName: "div",
|
|
337
|
-
props:
|
|
338
|
-
className:
|
|
363
|
+
props: o({
|
|
364
|
+
className: V("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),
|
|
339
365
|
"data-slot": "card-header"
|
|
340
|
-
},
|
|
341
|
-
render:
|
|
366
|
+
}, n),
|
|
367
|
+
render: t
|
|
342
368
|
});
|
|
343
369
|
}
|
|
344
|
-
function
|
|
345
|
-
return
|
|
370
|
+
function We({ className: e, render: t, ...n }) {
|
|
371
|
+
return s({
|
|
346
372
|
defaultTagName: "div",
|
|
347
|
-
props:
|
|
348
|
-
className:
|
|
373
|
+
props: o({
|
|
374
|
+
className: V("font-heading font-semibold text-lg leading-none", e),
|
|
349
375
|
"data-slot": "card-title"
|
|
350
|
-
},
|
|
351
|
-
render:
|
|
376
|
+
}, n),
|
|
377
|
+
render: t
|
|
352
378
|
});
|
|
353
379
|
}
|
|
354
|
-
function
|
|
355
|
-
return
|
|
380
|
+
function Ge({ className: e, render: t, ...n }) {
|
|
381
|
+
return s({
|
|
356
382
|
defaultTagName: "div",
|
|
357
|
-
props:
|
|
358
|
-
className:
|
|
383
|
+
props: o({
|
|
384
|
+
className: V("text-muted-foreground text-sm", e),
|
|
359
385
|
"data-slot": "card-description"
|
|
360
|
-
},
|
|
361
|
-
render:
|
|
386
|
+
}, n),
|
|
387
|
+
render: t
|
|
362
388
|
});
|
|
363
389
|
}
|
|
364
|
-
function
|
|
365
|
-
return
|
|
390
|
+
function Ke({ className: e, render: t, ...n }) {
|
|
391
|
+
return s({
|
|
366
392
|
defaultTagName: "div",
|
|
367
|
-
props:
|
|
368
|
-
className:
|
|
393
|
+
props: o({
|
|
394
|
+
className: V("col-start-2 row-span-2 row-start-1 inline-flex self-start justify-self-end", e),
|
|
369
395
|
"data-slot": "card-action"
|
|
370
|
-
},
|
|
371
|
-
render:
|
|
396
|
+
}, n),
|
|
397
|
+
render: t
|
|
372
398
|
});
|
|
373
399
|
}
|
|
374
|
-
function
|
|
375
|
-
return
|
|
400
|
+
function qe({ className: e, render: t, ...n }) {
|
|
401
|
+
return s({
|
|
376
402
|
defaultTagName: "div",
|
|
377
|
-
props:
|
|
378
|
-
className:
|
|
403
|
+
props: o({
|
|
404
|
+
className: V("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),
|
|
379
405
|
"data-slot": "card-panel"
|
|
380
|
-
},
|
|
381
|
-
render:
|
|
406
|
+
}, n),
|
|
407
|
+
render: t
|
|
382
408
|
});
|
|
383
409
|
}
|
|
384
|
-
function
|
|
385
|
-
return
|
|
410
|
+
function Je({ className: e, render: t, ...n }) {
|
|
411
|
+
return s({
|
|
386
412
|
defaultTagName: "div",
|
|
387
|
-
props:
|
|
388
|
-
className:
|
|
413
|
+
props: o({
|
|
414
|
+
className: V("flex items-center p-6 in-[[data-slot=card]:has(>[data-slot=card-panel])]:pt-4", e),
|
|
389
415
|
"data-slot": "card-footer"
|
|
390
|
-
},
|
|
391
|
-
render:
|
|
416
|
+
}, n),
|
|
417
|
+
render: t
|
|
392
418
|
});
|
|
393
419
|
}
|
|
394
420
|
//#endregion
|
|
395
421
|
//#region src/lib/sound.ts
|
|
396
|
-
var
|
|
397
|
-
function
|
|
398
|
-
|
|
422
|
+
var Ye = !1;
|
|
423
|
+
function Xe(e) {
|
|
424
|
+
Ye = !0, oe(e);
|
|
399
425
|
}
|
|
400
|
-
function
|
|
401
|
-
|
|
426
|
+
function Ze(e, t) {
|
|
427
|
+
Ye && se(e, t);
|
|
402
428
|
}
|
|
403
429
|
//#endregion
|
|
404
430
|
//#region src/components/ui/checkbox.tsx
|
|
405
|
-
function
|
|
406
|
-
return /* @__PURE__ */
|
|
431
|
+
function Qe({ className: e, sound: t = !0, onCheckedChange: n, ...r }) {
|
|
432
|
+
return /* @__PURE__ */ i(ae.Root, {
|
|
407
433
|
onCheckedChange: (e, r) => {
|
|
408
|
-
t &&
|
|
434
|
+
t && Ze("toggle"), n?.(e, r);
|
|
409
435
|
},
|
|
410
|
-
className:
|
|
436
|
+
className: V("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),
|
|
411
437
|
"data-slot": "checkbox",
|
|
412
438
|
...r,
|
|
413
|
-
children: /* @__PURE__ */
|
|
439
|
+
children: /* @__PURE__ */ i(ae.Indicator, {
|
|
414
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",
|
|
415
441
|
"data-slot": "checkbox-indicator",
|
|
416
|
-
render: (e, t) => /* @__PURE__ */
|
|
442
|
+
render: (e, t) => /* @__PURE__ */ i("span", {
|
|
417
443
|
...e,
|
|
418
|
-
children: t.indeterminate ? /* @__PURE__ */
|
|
444
|
+
children: t.indeterminate ? /* @__PURE__ */ i("svg", {
|
|
419
445
|
"aria-hidden": "true",
|
|
420
446
|
className: "size-3.5 sm:size-3",
|
|
421
447
|
fill: "none",
|
|
@@ -427,8 +453,8 @@ function ke({ className: e, sound: t = !0, onCheckedChange: n, ...r }) {
|
|
|
427
453
|
viewBox: "0 0 24 24",
|
|
428
454
|
width: "24",
|
|
429
455
|
xmlns: "http://www.w3.org/2000/svg",
|
|
430
|
-
children: /* @__PURE__ */
|
|
431
|
-
}) : /* @__PURE__ */
|
|
456
|
+
children: /* @__PURE__ */ i("path", { d: "M5.252 12h13.496" })
|
|
457
|
+
}) : /* @__PURE__ */ i("svg", {
|
|
432
458
|
"aria-hidden": "true",
|
|
433
459
|
className: "size-3.5 sm:size-3",
|
|
434
460
|
fill: "none",
|
|
@@ -440,7 +466,7 @@ function ke({ className: e, sound: t = !0, onCheckedChange: n, ...r }) {
|
|
|
440
466
|
viewBox: "0 0 24 24",
|
|
441
467
|
width: "24",
|
|
442
468
|
xmlns: "http://www.w3.org/2000/svg",
|
|
443
|
-
children: /* @__PURE__ */
|
|
469
|
+
children: /* @__PURE__ */ i("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
|
|
444
470
|
})
|
|
445
471
|
})
|
|
446
472
|
})
|
|
@@ -449,133 +475,133 @@ function ke({ className: e, sound: t = !0, onCheckedChange: n, ...r }) {
|
|
|
449
475
|
//#endregion
|
|
450
476
|
//#region src/components/ui/field.tsx
|
|
451
477
|
function U({ className: e, ...t }) {
|
|
452
|
-
return /* @__PURE__ */
|
|
453
|
-
className:
|
|
478
|
+
return /* @__PURE__ */ i(L.Root, {
|
|
479
|
+
className: V("flex flex-col items-start gap-2", e),
|
|
454
480
|
"data-slot": "field",
|
|
455
481
|
...t
|
|
456
482
|
});
|
|
457
483
|
}
|
|
458
484
|
function W({ className: e, ...t }) {
|
|
459
|
-
return /* @__PURE__ */
|
|
460
|
-
className:
|
|
485
|
+
return /* @__PURE__ */ i(L.Label, {
|
|
486
|
+
className: V("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),
|
|
461
487
|
"data-slot": "field-label",
|
|
462
488
|
...t
|
|
463
489
|
});
|
|
464
490
|
}
|
|
465
|
-
function
|
|
466
|
-
return /* @__PURE__ */
|
|
467
|
-
className:
|
|
491
|
+
function $e({ className: e, ...t }) {
|
|
492
|
+
return /* @__PURE__ */ i(L.Item, {
|
|
493
|
+
className: V("flex", e),
|
|
468
494
|
"data-slot": "field-item",
|
|
469
495
|
...t
|
|
470
496
|
});
|
|
471
497
|
}
|
|
472
|
-
function
|
|
473
|
-
return /* @__PURE__ */
|
|
474
|
-
className:
|
|
498
|
+
function et({ className: e, ...t }) {
|
|
499
|
+
return /* @__PURE__ */ i(L.Description, {
|
|
500
|
+
className: V("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),
|
|
475
501
|
"data-slot": "field-description",
|
|
476
502
|
...t
|
|
477
503
|
});
|
|
478
504
|
}
|
|
479
|
-
function
|
|
480
|
-
return /* @__PURE__ */
|
|
481
|
-
className:
|
|
505
|
+
function tt({ className: e, ...t }) {
|
|
506
|
+
return /* @__PURE__ */ i(L.Error, {
|
|
507
|
+
className: V("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),
|
|
482
508
|
"data-slot": "field-error",
|
|
483
509
|
...t
|
|
484
510
|
});
|
|
485
511
|
}
|
|
486
|
-
var
|
|
512
|
+
var nt = L.Control, rt = L.Validity;
|
|
487
513
|
//#endregion
|
|
488
514
|
//#region src/components/ui/frame.tsx
|
|
489
|
-
function
|
|
490
|
-
return /* @__PURE__ */
|
|
491
|
-
className:
|
|
515
|
+
function it({ className: e, ...t }) {
|
|
516
|
+
return /* @__PURE__ */ i("div", {
|
|
517
|
+
className: V("relative flex flex-col rounded-2xl bg-muted/72 p-1", "*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-1", e),
|
|
492
518
|
"data-slot": "frame",
|
|
493
519
|
...t
|
|
494
520
|
});
|
|
495
521
|
}
|
|
496
|
-
function
|
|
497
|
-
return /* @__PURE__ */
|
|
498
|
-
className:
|
|
522
|
+
function at({ className: e, ...t }) {
|
|
523
|
+
return /* @__PURE__ */ i("div", {
|
|
524
|
+
className: V("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),
|
|
499
525
|
"data-slot": "frame-panel",
|
|
500
526
|
...t
|
|
501
527
|
});
|
|
502
528
|
}
|
|
503
|
-
function
|
|
504
|
-
return /* @__PURE__ */
|
|
505
|
-
className:
|
|
529
|
+
function ot({ className: e, ...t }) {
|
|
530
|
+
return /* @__PURE__ */ i("header", {
|
|
531
|
+
className: V("flex flex-col px-5 py-4", e),
|
|
506
532
|
"data-slot": "frame-panel-header",
|
|
507
533
|
...t
|
|
508
534
|
});
|
|
509
535
|
}
|
|
510
|
-
function
|
|
511
|
-
return /* @__PURE__ */
|
|
512
|
-
className:
|
|
536
|
+
function st({ className: e, ...t }) {
|
|
537
|
+
return /* @__PURE__ */ i("div", {
|
|
538
|
+
className: V("font-semibold text-sm", e),
|
|
513
539
|
"data-slot": "frame-panel-title",
|
|
514
540
|
...t
|
|
515
541
|
});
|
|
516
542
|
}
|
|
517
|
-
function
|
|
518
|
-
return /* @__PURE__ */
|
|
519
|
-
className:
|
|
543
|
+
function ct({ className: e, ...t }) {
|
|
544
|
+
return /* @__PURE__ */ i("div", {
|
|
545
|
+
className: V("text-muted-foreground text-sm", e),
|
|
520
546
|
"data-slot": "frame-panel-description",
|
|
521
547
|
...t
|
|
522
548
|
});
|
|
523
549
|
}
|
|
524
|
-
function
|
|
525
|
-
return /* @__PURE__ */
|
|
526
|
-
className:
|
|
550
|
+
function lt({ className: e, ...t }) {
|
|
551
|
+
return /* @__PURE__ */ i("footer", {
|
|
552
|
+
className: V("px-5 py-4", e),
|
|
527
553
|
"data-slot": "frame-panel-footer",
|
|
528
554
|
...t
|
|
529
555
|
});
|
|
530
556
|
}
|
|
531
557
|
//#endregion
|
|
532
558
|
//#region src/components/ui/input.tsx
|
|
533
|
-
function G({ className: e, size: t = "default", unstyled: n = !1, nativeInput: r = !1, style:
|
|
534
|
-
let
|
|
535
|
-
return /* @__PURE__ */
|
|
536
|
-
className:
|
|
559
|
+
function G({ className: e, size: t = "default", unstyled: n = !1, nativeInput: r = !1, style: a, ...o }) {
|
|
560
|
+
let s = V("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
|
+
return /* @__PURE__ */ i("span", {
|
|
562
|
+
className: V(!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,
|
|
537
563
|
"data-size": t,
|
|
538
564
|
"data-slot": "input-control",
|
|
539
|
-
children: r ? /* @__PURE__ */
|
|
540
|
-
className:
|
|
565
|
+
children: r ? /* @__PURE__ */ i("input", {
|
|
566
|
+
className: s,
|
|
541
567
|
"data-slot": "input",
|
|
542
568
|
size: typeof t == "number" ? t : void 0,
|
|
543
|
-
style: typeof
|
|
544
|
-
...
|
|
545
|
-
}) : /* @__PURE__ */
|
|
546
|
-
className:
|
|
569
|
+
style: typeof a == "function" ? void 0 : a,
|
|
570
|
+
...o
|
|
571
|
+
}) : /* @__PURE__ */ i(pe, {
|
|
572
|
+
className: s,
|
|
547
573
|
"data-slot": "input",
|
|
548
574
|
size: typeof t == "number" ? t : void 0,
|
|
549
|
-
style:
|
|
550
|
-
...
|
|
575
|
+
style: a,
|
|
576
|
+
...o
|
|
551
577
|
})
|
|
552
578
|
});
|
|
553
579
|
}
|
|
554
580
|
//#endregion
|
|
555
581
|
//#region src/components/ui/textarea.tsx
|
|
556
|
-
function
|
|
557
|
-
return /* @__PURE__ */
|
|
558
|
-
className:
|
|
559
|
-
"data-size":
|
|
582
|
+
function ut({ className: e, size: t = "default", unstyled: n = !1, ref: r, ...a }) {
|
|
583
|
+
return /* @__PURE__ */ i("span", {
|
|
584
|
+
className: V(!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
|
+
"data-size": t,
|
|
560
586
|
"data-slot": "textarea-control",
|
|
561
|
-
children: /* @__PURE__ */
|
|
562
|
-
ref:
|
|
587
|
+
children: /* @__PURE__ */ i(fe.Control, {
|
|
588
|
+
ref: r,
|
|
563
589
|
value: a.value,
|
|
564
590
|
defaultValue: a.defaultValue,
|
|
565
591
|
disabled: a.disabled,
|
|
566
592
|
id: a.id,
|
|
567
593
|
name: a.name,
|
|
568
|
-
render: (
|
|
569
|
-
className:
|
|
594
|
+
render: (e) => /* @__PURE__ */ i("textarea", {
|
|
595
|
+
className: V("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"),
|
|
570
596
|
"data-slot": "textarea",
|
|
571
|
-
...e
|
|
597
|
+
...o(e, a)
|
|
572
598
|
})
|
|
573
599
|
})
|
|
574
600
|
});
|
|
575
601
|
}
|
|
576
602
|
//#endregion
|
|
577
603
|
//#region src/components/ui/input-group.tsx
|
|
578
|
-
var
|
|
604
|
+
var dt = 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", {
|
|
579
605
|
defaultVariants: { align: "inline-start" },
|
|
580
606
|
variants: { align: {
|
|
581
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)]",
|
|
@@ -584,17 +610,17 @@ var He = n("flex h-auto cursor-text select-none items-center justify-center gap-
|
|
|
584
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)]"
|
|
585
611
|
} }
|
|
586
612
|
});
|
|
587
|
-
function
|
|
588
|
-
return /* @__PURE__ */
|
|
589
|
-
className:
|
|
613
|
+
function ft({ className: e, ...t }) {
|
|
614
|
+
return /* @__PURE__ */ i("div", {
|
|
615
|
+
className: V("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),
|
|
590
616
|
"data-slot": "input-group",
|
|
591
617
|
role: "group",
|
|
592
618
|
...t
|
|
593
619
|
});
|
|
594
620
|
}
|
|
595
|
-
function
|
|
596
|
-
return /* @__PURE__ */
|
|
597
|
-
className:
|
|
621
|
+
function pt({ className: e, align: t = "inline-start", ...n }) {
|
|
622
|
+
return /* @__PURE__ */ i("div", {
|
|
623
|
+
className: V(dt({ align: t }), e),
|
|
598
624
|
"data-align": t,
|
|
599
625
|
"data-slot": "input-group-addon",
|
|
600
626
|
onMouseDown: (e) => {
|
|
@@ -606,21 +632,21 @@ function We({ className: e, align: t = "inline-start", ...n }) {
|
|
|
606
632
|
...n
|
|
607
633
|
});
|
|
608
634
|
}
|
|
609
|
-
function
|
|
610
|
-
return /* @__PURE__ */
|
|
611
|
-
className:
|
|
635
|
+
function mt({ className: e, ...t }) {
|
|
636
|
+
return /* @__PURE__ */ i("span", {
|
|
637
|
+
className: V("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),
|
|
612
638
|
...t
|
|
613
639
|
});
|
|
614
640
|
}
|
|
615
|
-
function
|
|
616
|
-
return /* @__PURE__ */
|
|
641
|
+
function ht({ className: e, ...t }) {
|
|
642
|
+
return /* @__PURE__ */ i(G, {
|
|
617
643
|
className: e,
|
|
618
644
|
unstyled: !0,
|
|
619
645
|
...t
|
|
620
646
|
});
|
|
621
647
|
}
|
|
622
|
-
function
|
|
623
|
-
return /* @__PURE__ */
|
|
648
|
+
function gt({ className: e, ...t }) {
|
|
649
|
+
return /* @__PURE__ */ i(ut, {
|
|
624
650
|
className: e,
|
|
625
651
|
unstyled: !0,
|
|
626
652
|
...t
|
|
@@ -628,22 +654,195 @@ function qe({ className: e, ...t }) {
|
|
|
628
654
|
}
|
|
629
655
|
//#endregion
|
|
630
656
|
//#region src/components/ui/label.tsx
|
|
631
|
-
function
|
|
632
|
-
return
|
|
657
|
+
function _t({ className: e, render: t, sound: n = !1, ...r }) {
|
|
658
|
+
return s({
|
|
633
659
|
defaultTagName: "label",
|
|
634
|
-
props:
|
|
635
|
-
className:
|
|
636
|
-
"data-cuelume-hover":
|
|
660
|
+
props: o({
|
|
661
|
+
className: V("inline-flex cursor-pointer items-center gap-2 font-medium text-base/4.5 text-foreground sm:text-sm/4", e),
|
|
662
|
+
"data-cuelume-hover": n ? "tick" : void 0,
|
|
637
663
|
"data-slot": "label"
|
|
638
|
-
},
|
|
639
|
-
render:
|
|
664
|
+
}, r),
|
|
665
|
+
render: t
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
//#endregion
|
|
669
|
+
//#region src/components/ui/menu.tsx
|
|
670
|
+
var vt = R.createHandle, yt = R.Root, bt = R.Portal;
|
|
671
|
+
function xt({ className: e, children: t, ...n }) {
|
|
672
|
+
return /* @__PURE__ */ i(R.Trigger, {
|
|
673
|
+
className: e,
|
|
674
|
+
"data-slot": "menu-trigger",
|
|
675
|
+
...n,
|
|
676
|
+
children: t
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
function St({ children: e, className: t, sideOffset: n = 4, align: r = "center", alignOffset: a, side: o = "bottom", anchor: s, portalProps: c, ...l }) {
|
|
680
|
+
return /* @__PURE__ */ i(bt, {
|
|
681
|
+
...c,
|
|
682
|
+
children: /* @__PURE__ */ i(R.Positioner, {
|
|
683
|
+
align: r,
|
|
684
|
+
alignOffset: a,
|
|
685
|
+
anchor: s,
|
|
686
|
+
className: "z-50",
|
|
687
|
+
"data-slot": "menu-positioner",
|
|
688
|
+
side: o,
|
|
689
|
+
sideOffset: n,
|
|
690
|
+
children: /* @__PURE__ */ i(R.Popup, {
|
|
691
|
+
className: V("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
|
+
"data-slot": "menu-popup",
|
|
693
|
+
...l,
|
|
694
|
+
children: /* @__PURE__ */ i("div", {
|
|
695
|
+
className: "max-h-(--available-height) w-full overflow-y-auto p-1",
|
|
696
|
+
children: e
|
|
697
|
+
})
|
|
698
|
+
})
|
|
699
|
+
})
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
function Ct(e) {
|
|
703
|
+
return /* @__PURE__ */ i(R.Group, {
|
|
704
|
+
"data-slot": "menu-group",
|
|
705
|
+
...e
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
function wt({ className: e, inset: t, variant: n = "default", ...r }) {
|
|
709
|
+
return /* @__PURE__ */ i(R.Item, {
|
|
710
|
+
className: V("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
|
+
"data-inset": t,
|
|
712
|
+
"data-slot": "menu-item",
|
|
713
|
+
"data-variant": n,
|
|
714
|
+
...r
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
function Tt({ className: e, inset: t, variant: n = "default", closeOnClick: r = !0, ...a }) {
|
|
718
|
+
return /* @__PURE__ */ i(R.LinkItem, {
|
|
719
|
+
className: V("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
|
+
closeOnClick: r,
|
|
721
|
+
"data-inset": t,
|
|
722
|
+
"data-slot": "menu-link-item",
|
|
723
|
+
"data-variant": n,
|
|
724
|
+
...a
|
|
725
|
+
});
|
|
726
|
+
}
|
|
727
|
+
function Et({ className: e, children: t, checked: n, variant: o = "default", ...s }) {
|
|
728
|
+
return /* @__PURE__ */ i(R.CheckboxItem, {
|
|
729
|
+
checked: n,
|
|
730
|
+
className: V("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
|
+
"data-slot": "menu-checkbox-item",
|
|
732
|
+
...s,
|
|
733
|
+
children: o === "switch" ? /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i("span", {
|
|
734
|
+
className: "col-start-1",
|
|
735
|
+
children: t
|
|
736
|
+
}), /* @__PURE__ */ i(R.CheckboxItemIndicator, {
|
|
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
|
+
keepMounted: !0,
|
|
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(R.CheckboxItemIndicator, {
|
|
741
|
+
className: "col-start-1 -ms-0.5",
|
|
742
|
+
children: /* @__PURE__ */ i("svg", {
|
|
743
|
+
"aria-hidden": "true",
|
|
744
|
+
fill: "none",
|
|
745
|
+
height: "24",
|
|
746
|
+
stroke: "currentColor",
|
|
747
|
+
strokeLinecap: "round",
|
|
748
|
+
strokeLinejoin: "round",
|
|
749
|
+
strokeWidth: "2",
|
|
750
|
+
viewBox: "0 0 24 24",
|
|
751
|
+
width: "24",
|
|
752
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
753
|
+
children: /* @__PURE__ */ i("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
|
|
754
|
+
})
|
|
755
|
+
}), /* @__PURE__ */ i("span", {
|
|
756
|
+
className: "col-start-2",
|
|
757
|
+
children: t
|
|
758
|
+
})] })
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
function Dt(e) {
|
|
762
|
+
return /* @__PURE__ */ i(R.RadioGroup, {
|
|
763
|
+
"data-slot": "menu-radio-group",
|
|
764
|
+
...e
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
function Ot({ className: e, children: t, ...n }) {
|
|
768
|
+
return /* @__PURE__ */ a(R.RadioItem, {
|
|
769
|
+
className: V("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
|
+
"data-slot": "menu-radio-item",
|
|
771
|
+
...n,
|
|
772
|
+
children: [/* @__PURE__ */ i(R.RadioItemIndicator, {
|
|
773
|
+
className: "col-start-1 -ms-0.5",
|
|
774
|
+
children: /* @__PURE__ */ i("svg", {
|
|
775
|
+
"aria-hidden": "true",
|
|
776
|
+
fill: "none",
|
|
777
|
+
height: "24",
|
|
778
|
+
stroke: "currentColor",
|
|
779
|
+
strokeLinecap: "round",
|
|
780
|
+
strokeLinejoin: "round",
|
|
781
|
+
strokeWidth: "2",
|
|
782
|
+
viewBox: "0 0 24 24",
|
|
783
|
+
width: "24",
|
|
784
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
785
|
+
children: /* @__PURE__ */ i("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
|
|
786
|
+
})
|
|
787
|
+
}), /* @__PURE__ */ i("span", {
|
|
788
|
+
className: "col-start-2",
|
|
789
|
+
children: t
|
|
790
|
+
})]
|
|
791
|
+
});
|
|
792
|
+
}
|
|
793
|
+
function kt({ className: e, inset: t, ...n }) {
|
|
794
|
+
return /* @__PURE__ */ i(R.GroupLabel, {
|
|
795
|
+
className: V("px-2 py-1.5 font-medium text-muted-foreground text-xs data-inset:ps-9 sm:data-inset:ps-8", e),
|
|
796
|
+
"data-inset": t,
|
|
797
|
+
"data-slot": "menu-label",
|
|
798
|
+
...n
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
function At({ className: e, ...t }) {
|
|
802
|
+
return /* @__PURE__ */ i(R.Separator, {
|
|
803
|
+
className: V("mx-2 my-1 h-px bg-border", e),
|
|
804
|
+
"data-slot": "menu-separator",
|
|
805
|
+
...t
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
function jt({ className: e, ...t }) {
|
|
809
|
+
return /* @__PURE__ */ i("kbd", {
|
|
810
|
+
className: V("ms-auto font-medium font-sans text-muted-foreground/72 text-xs tracking-widest", e),
|
|
811
|
+
"data-slot": "menu-shortcut",
|
|
812
|
+
...t
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
function Mt(e) {
|
|
816
|
+
return /* @__PURE__ */ i(R.SubmenuRoot, {
|
|
817
|
+
"data-slot": "menu-sub",
|
|
818
|
+
...e
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
function Nt({ className: e, inset: t, children: n, ...r }) {
|
|
822
|
+
return /* @__PURE__ */ a(R.SubmenuTrigger, {
|
|
823
|
+
className: V("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
|
+
"data-inset": t,
|
|
825
|
+
"data-slot": "menu-sub-trigger",
|
|
826
|
+
...r,
|
|
827
|
+
children: [n, /* @__PURE__ */ i(f, { className: "ms-auto -me-0.5 opacity-80" })]
|
|
828
|
+
});
|
|
829
|
+
}
|
|
830
|
+
function Pt({ className: e, sideOffset: t = 0, alignOffset: n, align: r = "start", ...a }) {
|
|
831
|
+
return /* @__PURE__ */ i(St, {
|
|
832
|
+
align: r,
|
|
833
|
+
alignOffset: n ?? (r === "center" ? void 0 : -5),
|
|
834
|
+
className: e,
|
|
835
|
+
"data-slot": "menu-sub-content",
|
|
836
|
+
side: "inline-end",
|
|
837
|
+
sideOffset: t,
|
|
838
|
+
...a
|
|
640
839
|
});
|
|
641
840
|
}
|
|
642
841
|
//#endregion
|
|
643
842
|
//#region src/components/ui/separator.tsx
|
|
644
|
-
function
|
|
645
|
-
return /* @__PURE__ */
|
|
646
|
-
className:
|
|
843
|
+
function Ft({ className: e, orientation: t = "horizontal", ...n }) {
|
|
844
|
+
return /* @__PURE__ */ i(he, {
|
|
845
|
+
className: V("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),
|
|
647
846
|
"data-slot": "separator",
|
|
648
847
|
orientation: t,
|
|
649
848
|
...n
|
|
@@ -651,41 +850,50 @@ function Ye({ className: e, orientation: t = "horizontal", ...n }) {
|
|
|
651
850
|
}
|
|
652
851
|
//#endregion
|
|
653
852
|
//#region src/components/ui/otp-field.tsx
|
|
654
|
-
function
|
|
655
|
-
let
|
|
656
|
-
return /* @__PURE__ */
|
|
657
|
-
className:
|
|
853
|
+
function It({ className: e, size: t = "default", sound: n = !0, onValueChange: r, ...a }) {
|
|
854
|
+
let o = D.useRef(String(a.value ?? a.defaultValue ?? "").length);
|
|
855
|
+
return /* @__PURE__ */ i(me.Root, {
|
|
856
|
+
className: V("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),
|
|
658
857
|
"data-size": t,
|
|
659
858
|
"data-slot": "otp-field",
|
|
660
859
|
onValueChange: (e, ...t) => {
|
|
661
|
-
n && e.length >
|
|
860
|
+
n && e.length > o.current && Ze("tick"), o.current = e.length, r?.(e, ...t);
|
|
662
861
|
},
|
|
663
|
-
...
|
|
862
|
+
...a
|
|
664
863
|
});
|
|
665
864
|
}
|
|
666
|
-
function
|
|
667
|
-
return /* @__PURE__ */
|
|
668
|
-
className:
|
|
865
|
+
function Lt({ className: e, ...t }) {
|
|
866
|
+
return /* @__PURE__ */ i(me.Input, {
|
|
867
|
+
className: V("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),
|
|
669
868
|
"data-slot": "otp-field-input",
|
|
670
869
|
spellCheck: !1,
|
|
671
870
|
...t
|
|
672
871
|
});
|
|
673
872
|
}
|
|
674
|
-
function
|
|
675
|
-
return /* @__PURE__ */
|
|
676
|
-
className:
|
|
873
|
+
function Rt({ className: e, ...t }) {
|
|
874
|
+
return /* @__PURE__ */ i(me.Separator, { render: /* @__PURE__ */ i(Ft, {
|
|
875
|
+
className: V("rounded-full bg-input data-[orientation=horizontal]:h-0.5 data-[orientation=horizontal]:w-3", e),
|
|
677
876
|
orientation: "horizontal",
|
|
678
877
|
...t
|
|
679
878
|
}) });
|
|
680
879
|
}
|
|
681
880
|
//#endregion
|
|
881
|
+
//#region src/components/ui/skeleton.tsx
|
|
882
|
+
function zt({ className: e, ...t }) {
|
|
883
|
+
return /* @__PURE__ */ i("div", {
|
|
884
|
+
className: V("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
|
+
"data-slot": "skeleton",
|
|
886
|
+
...t
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
//#endregion
|
|
682
890
|
//#region src/components/composed/password-input.tsx
|
|
683
|
-
var
|
|
891
|
+
var Bt = [
|
|
684
892
|
.22,
|
|
685
893
|
1,
|
|
686
894
|
.36,
|
|
687
895
|
1
|
|
688
|
-
],
|
|
896
|
+
], Vt = [
|
|
689
897
|
{
|
|
690
898
|
regex: /.{8,}/,
|
|
691
899
|
text: "At least 8 characters"
|
|
@@ -703,42 +911,42 @@ var $e = [
|
|
|
703
911
|
text: "At least 1 uppercase letter"
|
|
704
912
|
}
|
|
705
913
|
];
|
|
706
|
-
function
|
|
707
|
-
return
|
|
914
|
+
function Ht(e) {
|
|
915
|
+
return Vt.filter((t) => t.regex.test(e)).length;
|
|
708
916
|
}
|
|
709
|
-
var
|
|
917
|
+
var Ut = [
|
|
710
918
|
"bg-border",
|
|
711
919
|
"bg-red-500",
|
|
712
920
|
"bg-orange-500",
|
|
713
921
|
"bg-amber-500",
|
|
714
922
|
"bg-emerald-500"
|
|
715
923
|
];
|
|
716
|
-
function
|
|
717
|
-
let [d, f] =
|
|
718
|
-
return /* @__PURE__ */
|
|
719
|
-
className:
|
|
720
|
-
children: [/* @__PURE__ */
|
|
924
|
+
function Wt({ visibilityToggle: e = !0, showStrength: t = !1, sound: n = !0, className: r, value: o, defaultValue: s, onChange: c, ...l }) {
|
|
925
|
+
let [d, f] = D.useState(!1), [p, g] = D.useState(String(s ?? "")), _ = o === void 0 ? p : String(o), v = Ht(_);
|
|
926
|
+
return /* @__PURE__ */ a("div", {
|
|
927
|
+
className: V("flex w-full flex-col gap-3", r),
|
|
928
|
+
children: [/* @__PURE__ */ a(ft, { children: [/* @__PURE__ */ i(ht, {
|
|
721
929
|
placeholder: "Enter your password",
|
|
722
|
-
...
|
|
930
|
+
...l,
|
|
723
931
|
type: d ? "text" : "password",
|
|
724
|
-
value:
|
|
932
|
+
value: _,
|
|
725
933
|
onChange: (e) => {
|
|
726
|
-
|
|
934
|
+
g(e.target.value), c?.(e);
|
|
727
935
|
}
|
|
728
|
-
}), e && /* @__PURE__ */
|
|
936
|
+
}), e && /* @__PURE__ */ i(pt, {
|
|
729
937
|
align: "inline-end",
|
|
730
|
-
children: /* @__PURE__ */
|
|
938
|
+
children: /* @__PURE__ */ i(H, {
|
|
731
939
|
"aria-label": d ? "Hide password" : "Show password",
|
|
732
940
|
onClick: () => {
|
|
733
|
-
n &&
|
|
941
|
+
n && Ze(d ? "droplet" : "bloom"), f((e) => !e);
|
|
734
942
|
},
|
|
735
943
|
size: "icon-xs",
|
|
736
944
|
variant: "ghost",
|
|
737
945
|
sound: !1,
|
|
738
|
-
children: /* @__PURE__ */
|
|
946
|
+
children: /* @__PURE__ */ i(z, {
|
|
739
947
|
mode: "wait",
|
|
740
948
|
initial: !1,
|
|
741
|
-
children: /* @__PURE__ */
|
|
949
|
+
children: /* @__PURE__ */ i(B.span, {
|
|
742
950
|
className: "inline-flex",
|
|
743
951
|
initial: {
|
|
744
952
|
opacity: 0,
|
|
@@ -757,15 +965,15 @@ function K({ visibilityToggle: e = !0, showStrength: t = !1, sound: n = !0, clas
|
|
|
757
965
|
},
|
|
758
966
|
transition: {
|
|
759
967
|
duration: .15,
|
|
760
|
-
ease:
|
|
968
|
+
ease: Bt
|
|
761
969
|
},
|
|
762
|
-
children:
|
|
970
|
+
children: i(d ? h : m, { "aria-hidden": "true" })
|
|
763
971
|
}, d ? "off" : "on")
|
|
764
972
|
})
|
|
765
973
|
})
|
|
766
|
-
})] }), /* @__PURE__ */
|
|
974
|
+
})] }), /* @__PURE__ */ i(z, {
|
|
767
975
|
initial: !1,
|
|
768
|
-
children: t && /* @__PURE__ */
|
|
976
|
+
children: t && /* @__PURE__ */ a(B.div, {
|
|
769
977
|
className: "flex flex-col gap-2 overflow-hidden",
|
|
770
978
|
initial: {
|
|
771
979
|
height: 0,
|
|
@@ -781,39 +989,39 @@ function K({ visibilityToggle: e = !0, showStrength: t = !1, sound: n = !0, clas
|
|
|
781
989
|
},
|
|
782
990
|
transition: {
|
|
783
991
|
duration: .25,
|
|
784
|
-
ease:
|
|
992
|
+
ease: Bt
|
|
785
993
|
},
|
|
786
|
-
children: [/* @__PURE__ */
|
|
994
|
+
children: [/* @__PURE__ */ i("div", {
|
|
787
995
|
"aria-label": "Password strength",
|
|
788
996
|
"aria-valuemax": 4,
|
|
789
997
|
"aria-valuemin": 0,
|
|
790
|
-
"aria-valuenow":
|
|
998
|
+
"aria-valuenow": v,
|
|
791
999
|
className: "h-1 w-full overflow-hidden rounded-full bg-border",
|
|
792
1000
|
role: "progressbar",
|
|
793
|
-
children: /* @__PURE__ */
|
|
794
|
-
className:
|
|
795
|
-
animate: { width: `${
|
|
1001
|
+
children: /* @__PURE__ */ i(B.div, {
|
|
1002
|
+
className: V("h-full rounded-full", Ut[v]),
|
|
1003
|
+
animate: { width: `${v / 4 * 100}%` },
|
|
796
1004
|
transition: {
|
|
797
1005
|
duration: .4,
|
|
798
|
-
ease:
|
|
1006
|
+
ease: Bt
|
|
799
1007
|
}
|
|
800
1008
|
})
|
|
801
|
-
}), /* @__PURE__ */
|
|
1009
|
+
}), /* @__PURE__ */ i("ul", {
|
|
802
1010
|
"aria-label": "Password requirements",
|
|
803
1011
|
className: "flex flex-col gap-1",
|
|
804
|
-
children:
|
|
805
|
-
let t = e.regex.test(
|
|
806
|
-
return /* @__PURE__ */
|
|
1012
|
+
children: Vt.map((e) => {
|
|
1013
|
+
let t = e.regex.test(_);
|
|
1014
|
+
return /* @__PURE__ */ a("li", {
|
|
807
1015
|
className: "flex items-center gap-2 text-xs",
|
|
808
|
-
children: [t ? /* @__PURE__ */
|
|
1016
|
+
children: [t ? /* @__PURE__ */ i(u, {
|
|
809
1017
|
"aria-hidden": "true",
|
|
810
1018
|
className: "size-3.5 text-emerald-500"
|
|
811
|
-
}) : /* @__PURE__ */
|
|
1019
|
+
}) : /* @__PURE__ */ i(E, {
|
|
812
1020
|
"aria-hidden": "true",
|
|
813
1021
|
className: "size-3.5 text-muted-foreground/80"
|
|
814
|
-
}), /* @__PURE__ */
|
|
1022
|
+
}), /* @__PURE__ */ a("span", {
|
|
815
1023
|
className: t ? "text-emerald-600" : "text-muted-foreground",
|
|
816
|
-
children: [e.text, /* @__PURE__ */
|
|
1024
|
+
children: [e.text, /* @__PURE__ */ i("span", {
|
|
817
1025
|
className: "sr-only",
|
|
818
1026
|
children: t ? " - met" : " - not met"
|
|
819
1027
|
})]
|
|
@@ -827,50 +1035,50 @@ function K({ visibilityToggle: e = !0, showStrength: t = !1, sound: n = !0, clas
|
|
|
827
1035
|
}
|
|
828
1036
|
//#endregion
|
|
829
1037
|
//#region src/components/composed/social-providers.tsx
|
|
830
|
-
var
|
|
1038
|
+
var Gt = {
|
|
831
1039
|
google: {
|
|
832
1040
|
label: "Google",
|
|
833
|
-
Icon:
|
|
1041
|
+
Icon: be
|
|
834
1042
|
},
|
|
835
1043
|
apple: {
|
|
836
1044
|
label: "Apple",
|
|
837
|
-
Icon:
|
|
1045
|
+
Icon: ve
|
|
838
1046
|
},
|
|
839
1047
|
github: {
|
|
840
1048
|
label: "GitHub",
|
|
841
|
-
Icon:
|
|
1049
|
+
Icon: ye
|
|
842
1050
|
},
|
|
843
1051
|
x: {
|
|
844
1052
|
label: "X",
|
|
845
|
-
Icon:
|
|
1053
|
+
Icon: xe
|
|
846
1054
|
}
|
|
847
|
-
},
|
|
1055
|
+
}, Kt = {
|
|
848
1056
|
login: "Login with",
|
|
849
1057
|
signup: "Sign up with",
|
|
850
1058
|
continue: "Continue with"
|
|
851
1059
|
};
|
|
852
|
-
function
|
|
1060
|
+
function qt({ providers: e = [
|
|
853
1061
|
"google",
|
|
854
1062
|
"apple",
|
|
855
1063
|
"github"
|
|
856
|
-
], action: t = "continue", layout: n = "stack", loadingProvider: r = null, disabled:
|
|
857
|
-
let
|
|
858
|
-
return /* @__PURE__ */
|
|
859
|
-
className:
|
|
1064
|
+
], action: t = "continue", layout: n = "stack", loadingProvider: r = null, disabled: o = !1, onSelect: s, className: c }) {
|
|
1065
|
+
let l = n === "row";
|
|
1066
|
+
return /* @__PURE__ */ i("div", {
|
|
1067
|
+
className: V("flex w-full gap-2", l ? "flex-row justify-center" : "flex-col", c),
|
|
860
1068
|
children: e.map((e) => {
|
|
861
|
-
let { label: n, Icon:
|
|
862
|
-
return /* @__PURE__ */
|
|
1069
|
+
let { label: n, Icon: c } = Gt[e];
|
|
1070
|
+
return /* @__PURE__ */ a(H, {
|
|
863
1071
|
variant: "outline",
|
|
864
|
-
size:
|
|
865
|
-
className:
|
|
866
|
-
"aria-label": `${
|
|
1072
|
+
size: l ? "icon" : "default",
|
|
1073
|
+
className: l ? void 0 : "w-full",
|
|
1074
|
+
"aria-label": `${Kt[t]} ${n}`,
|
|
867
1075
|
loading: r === e,
|
|
868
|
-
disabled:
|
|
869
|
-
onClick: () =>
|
|
870
|
-
children: [/* @__PURE__ */
|
|
1076
|
+
disabled: o || r !== null && r !== e,
|
|
1077
|
+
onClick: () => s?.(e),
|
|
1078
|
+
children: [/* @__PURE__ */ i(c, { "aria-hidden": "true" }), !l && /* @__PURE__ */ a("span", {
|
|
871
1079
|
className: "flex-1",
|
|
872
1080
|
children: [
|
|
873
|
-
|
|
1081
|
+
Kt[t],
|
|
874
1082
|
" ",
|
|
875
1083
|
n
|
|
876
1084
|
]
|
|
@@ -880,8 +1088,31 @@ function it({ providers: e = [
|
|
|
880
1088
|
});
|
|
881
1089
|
}
|
|
882
1090
|
//#endregion
|
|
1091
|
+
//#region src/components/composed/user-avatar.tsx
|
|
1092
|
+
function Jt(e) {
|
|
1093
|
+
let t = e.trim().split(/\s+/).filter(Boolean);
|
|
1094
|
+
return t.length === 0 ? "" : ((t[0]?.[0] ?? "") + (t.length > 1 ? t.at(-1)?.[0] ?? "" : "")).toUpperCase();
|
|
1095
|
+
}
|
|
1096
|
+
function Yt({ src: e, name: t = "", initials: n, alt: r, loading: o, className: s, ...c }) {
|
|
1097
|
+
let [l, u] = D.useState("idle"), d = o ?? (e !== void 0 && (l === "idle" || l === "loading"));
|
|
1098
|
+
return /* @__PURE__ */ a(Ce, {
|
|
1099
|
+
className: V("size-8", s),
|
|
1100
|
+
"data-loading": d || void 0,
|
|
1101
|
+
"data-slot": "user-avatar",
|
|
1102
|
+
...c,
|
|
1103
|
+
children: [e === void 0 || o === !0 ? null : /* @__PURE__ */ i(we, {
|
|
1104
|
+
alt: r ?? t,
|
|
1105
|
+
onLoadingStatusChange: u,
|
|
1106
|
+
src: e
|
|
1107
|
+
}), /* @__PURE__ */ i(Te, { children: d ? /* @__PURE__ */ i(zt, {
|
|
1108
|
+
className: "size-full rounded-full",
|
|
1109
|
+
"data-slot": "avatar-skeleton"
|
|
1110
|
+
}) : n ?? Jt(t) })]
|
|
1111
|
+
});
|
|
1112
|
+
}
|
|
1113
|
+
//#endregion
|
|
883
1114
|
//#region src/lib/auth-accent.ts
|
|
884
|
-
var
|
|
1115
|
+
var Xt = {
|
|
885
1116
|
corpora: {
|
|
886
1117
|
"--auth-accent": "#E8B124",
|
|
887
1118
|
"--auth-accent-image": "none",
|
|
@@ -892,38 +1123,38 @@ var at = {
|
|
|
892
1123
|
"--auth-accent-image": "linear-gradient(44deg in oklab, rgba(29,0,202,0.66) 3%, #3B0080 37%, rgba(36,0,72,0.86) 98%)",
|
|
893
1124
|
"--auth-accent-foreground": "oklch(0.985 0 0)"
|
|
894
1125
|
}
|
|
895
|
-
},
|
|
1126
|
+
}, Zt = "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)]", K = [
|
|
896
1127
|
.22,
|
|
897
1128
|
1,
|
|
898
1129
|
.36,
|
|
899
1130
|
1
|
|
900
1131
|
];
|
|
901
|
-
function
|
|
902
|
-
return /* @__PURE__ */
|
|
1132
|
+
function q({ title: e, description: t, children: n, footer: r, className: o, logo: s, accent: c }) {
|
|
1133
|
+
return /* @__PURE__ */ i(ge, {
|
|
903
1134
|
reducedMotion: "user",
|
|
904
|
-
children: /* @__PURE__ */
|
|
905
|
-
className:
|
|
906
|
-
"data-accent":
|
|
907
|
-
style:
|
|
908
|
-
children: /* @__PURE__ */
|
|
1135
|
+
children: /* @__PURE__ */ i(it, {
|
|
1136
|
+
className: V("w-full max-w-sm", o),
|
|
1137
|
+
"data-accent": c,
|
|
1138
|
+
style: c ? Xt[c] : void 0,
|
|
1139
|
+
children: /* @__PURE__ */ a(B.div, {
|
|
909
1140
|
layout: !0,
|
|
910
1141
|
transition: {
|
|
911
1142
|
duration: .3,
|
|
912
|
-
ease:
|
|
1143
|
+
ease: K
|
|
913
1144
|
},
|
|
914
1145
|
className: "flex flex-col",
|
|
915
|
-
children: [/* @__PURE__ */
|
|
916
|
-
|
|
1146
|
+
children: [/* @__PURE__ */ a(Ie, { children: [/* @__PURE__ */ a(Ue, { children: [
|
|
1147
|
+
s && /* @__PURE__ */ i("div", {
|
|
917
1148
|
className: "mb-1.5 flex items-center [&_img:not([class*='h-'])]:h-8 [&_img]:w-auto [&_svg:not([class*='size-'])]:size-8",
|
|
918
1149
|
"data-slot": "auth-logo",
|
|
919
|
-
children:
|
|
1150
|
+
children: s
|
|
920
1151
|
}),
|
|
921
|
-
/* @__PURE__ */
|
|
922
|
-
t && /* @__PURE__ */
|
|
923
|
-
] }), /* @__PURE__ */
|
|
1152
|
+
/* @__PURE__ */ i(We, { children: e }),
|
|
1153
|
+
t && /* @__PURE__ */ i(Ge, { children: t })
|
|
1154
|
+
] }), /* @__PURE__ */ i(qe, {
|
|
924
1155
|
className: "overflow-hidden",
|
|
925
1156
|
children: n
|
|
926
|
-
})] }), r && /* @__PURE__ */
|
|
1157
|
+
})] }), r && /* @__PURE__ */ i(lt, {
|
|
927
1158
|
className: "text-center text-sm text-muted-foreground",
|
|
928
1159
|
children: r
|
|
929
1160
|
})]
|
|
@@ -931,11 +1162,11 @@ function Y({ title: e, description: t, children: n, footer: r, className: i, log
|
|
|
931
1162
|
})
|
|
932
1163
|
});
|
|
933
1164
|
}
|
|
934
|
-
function
|
|
935
|
-
return /* @__PURE__ */
|
|
1165
|
+
function J({ step: e, children: t, className: n }) {
|
|
1166
|
+
return /* @__PURE__ */ i(z, {
|
|
936
1167
|
mode: "popLayout",
|
|
937
1168
|
initial: !1,
|
|
938
|
-
children: /* @__PURE__ */
|
|
1169
|
+
children: /* @__PURE__ */ i(B.div, {
|
|
939
1170
|
className: n,
|
|
940
1171
|
initial: {
|
|
941
1172
|
opacity: 0,
|
|
@@ -954,24 +1185,24 @@ function X({ step: e, children: t, className: n }) {
|
|
|
954
1185
|
},
|
|
955
1186
|
transition: {
|
|
956
1187
|
duration: .25,
|
|
957
|
-
ease:
|
|
1188
|
+
ease: K
|
|
958
1189
|
},
|
|
959
1190
|
children: t
|
|
960
1191
|
}, e)
|
|
961
1192
|
});
|
|
962
1193
|
}
|
|
963
|
-
function
|
|
964
|
-
let [r,
|
|
1194
|
+
function Y({ show: e, children: t, className: n }) {
|
|
1195
|
+
let [r, a] = D.useState({
|
|
965
1196
|
show: e,
|
|
966
1197
|
settled: e
|
|
967
1198
|
});
|
|
968
|
-
return r.show !== e &&
|
|
1199
|
+
return r.show !== e && a({
|
|
969
1200
|
show: e,
|
|
970
1201
|
settled: !1
|
|
971
|
-
}), /* @__PURE__ */
|
|
1202
|
+
}), /* @__PURE__ */ i(z, {
|
|
972
1203
|
initial: !1,
|
|
973
|
-
children: e && /* @__PURE__ */
|
|
974
|
-
className:
|
|
1204
|
+
children: e && /* @__PURE__ */ i(B.div, {
|
|
1205
|
+
className: V(!r.settled && "overflow-hidden", n),
|
|
975
1206
|
initial: {
|
|
976
1207
|
height: 0,
|
|
977
1208
|
opacity: 0,
|
|
@@ -992,9 +1223,9 @@ function Z({ show: e, children: t, className: n }) {
|
|
|
992
1223
|
},
|
|
993
1224
|
transition: {
|
|
994
1225
|
duration: .25,
|
|
995
|
-
ease:
|
|
1226
|
+
ease: K
|
|
996
1227
|
},
|
|
997
|
-
onAnimationComplete: () =>
|
|
1228
|
+
onAnimationComplete: () => a((e) => ({
|
|
998
1229
|
...e,
|
|
999
1230
|
settled: !0
|
|
1000
1231
|
})),
|
|
@@ -1002,10 +1233,10 @@ function Z({ show: e, children: t, className: n }) {
|
|
|
1002
1233
|
})
|
|
1003
1234
|
});
|
|
1004
1235
|
}
|
|
1005
|
-
function
|
|
1006
|
-
return /* @__PURE__ */
|
|
1236
|
+
function X({ message: e }) {
|
|
1237
|
+
return /* @__PURE__ */ i(z, {
|
|
1007
1238
|
initial: !1,
|
|
1008
|
-
children: e && /* @__PURE__ */
|
|
1239
|
+
children: e && /* @__PURE__ */ i(B.p, {
|
|
1009
1240
|
role: "alert",
|
|
1010
1241
|
className: "text-sm text-destructive-foreground",
|
|
1011
1242
|
initial: {
|
|
@@ -1030,7 +1261,7 @@ function Q({ message: e }) {
|
|
|
1030
1261
|
},
|
|
1031
1262
|
transition: {
|
|
1032
1263
|
duration: .25,
|
|
1033
|
-
ease:
|
|
1264
|
+
ease: K,
|
|
1034
1265
|
x: {
|
|
1035
1266
|
duration: .4,
|
|
1036
1267
|
ease: "easeInOut"
|
|
@@ -1040,11 +1271,11 @@ function Q({ message: e }) {
|
|
|
1040
1271
|
}, e)
|
|
1041
1272
|
});
|
|
1042
1273
|
}
|
|
1043
|
-
function
|
|
1044
|
-
return /* @__PURE__ */
|
|
1274
|
+
function Z({ title: e, description: t, children: n }) {
|
|
1275
|
+
return /* @__PURE__ */ a("div", {
|
|
1045
1276
|
className: "flex flex-col items-center gap-3 py-4 text-center",
|
|
1046
1277
|
children: [
|
|
1047
|
-
/* @__PURE__ */
|
|
1278
|
+
/* @__PURE__ */ i(B.span, {
|
|
1048
1279
|
className: "flex size-12 items-center justify-center rounded-full bg-emerald-500/12 text-emerald-600",
|
|
1049
1280
|
initial: {
|
|
1050
1281
|
scale: .6,
|
|
@@ -1056,9 +1287,9 @@ function $({ title: e, description: t, children: n }) {
|
|
|
1056
1287
|
},
|
|
1057
1288
|
transition: {
|
|
1058
1289
|
duration: .4,
|
|
1059
|
-
ease:
|
|
1290
|
+
ease: K
|
|
1060
1291
|
},
|
|
1061
|
-
children: /* @__PURE__ */
|
|
1292
|
+
children: /* @__PURE__ */ i("svg", {
|
|
1062
1293
|
"aria-hidden": "true",
|
|
1063
1294
|
viewBox: "0 0 24 24",
|
|
1064
1295
|
className: "size-6",
|
|
@@ -1067,24 +1298,24 @@ function $({ title: e, description: t, children: n }) {
|
|
|
1067
1298
|
strokeWidth: "2.5",
|
|
1068
1299
|
strokeLinecap: "round",
|
|
1069
1300
|
strokeLinejoin: "round",
|
|
1070
|
-
children: /* @__PURE__ */
|
|
1301
|
+
children: /* @__PURE__ */ i(B.path, {
|
|
1071
1302
|
d: "M4 12.5l5 5L20 6.5",
|
|
1072
1303
|
initial: { pathLength: 0 },
|
|
1073
1304
|
animate: { pathLength: 1 },
|
|
1074
1305
|
transition: {
|
|
1075
1306
|
duration: .4,
|
|
1076
1307
|
delay: .15,
|
|
1077
|
-
ease:
|
|
1308
|
+
ease: K
|
|
1078
1309
|
}
|
|
1079
1310
|
})
|
|
1080
1311
|
})
|
|
1081
1312
|
}),
|
|
1082
|
-
/* @__PURE__ */
|
|
1313
|
+
/* @__PURE__ */ a("div", {
|
|
1083
1314
|
className: "flex flex-col gap-1",
|
|
1084
|
-
children: [/* @__PURE__ */
|
|
1315
|
+
children: [/* @__PURE__ */ i("p", {
|
|
1085
1316
|
className: "font-medium",
|
|
1086
1317
|
children: e
|
|
1087
|
-
}), t && /* @__PURE__ */
|
|
1318
|
+
}), t && /* @__PURE__ */ i("p", {
|
|
1088
1319
|
className: "text-sm text-muted-foreground",
|
|
1089
1320
|
children: t
|
|
1090
1321
|
})]
|
|
@@ -1093,21 +1324,21 @@ function $({ title: e, description: t, children: n }) {
|
|
|
1093
1324
|
]
|
|
1094
1325
|
});
|
|
1095
1326
|
}
|
|
1096
|
-
function
|
|
1097
|
-
return /* @__PURE__ */
|
|
1327
|
+
function Qt({ label: e = "Or" }) {
|
|
1328
|
+
return /* @__PURE__ */ a("div", {
|
|
1098
1329
|
className: "flex items-center gap-3",
|
|
1099
1330
|
children: [
|
|
1100
|
-
/* @__PURE__ */
|
|
1101
|
-
/* @__PURE__ */
|
|
1331
|
+
/* @__PURE__ */ i(Ft, { className: "flex-1" }),
|
|
1332
|
+
/* @__PURE__ */ i("span", {
|
|
1102
1333
|
className: "text-xs text-muted-foreground uppercase",
|
|
1103
1334
|
children: e
|
|
1104
1335
|
}),
|
|
1105
|
-
/* @__PURE__ */
|
|
1336
|
+
/* @__PURE__ */ i(Ft, { className: "flex-1" })
|
|
1106
1337
|
]
|
|
1107
1338
|
});
|
|
1108
1339
|
}
|
|
1109
|
-
function
|
|
1110
|
-
let [n, r] =
|
|
1340
|
+
function $t(e, t) {
|
|
1341
|
+
let [n, r] = D.useState({
|
|
1111
1342
|
restartKey: t,
|
|
1112
1343
|
seconds: e,
|
|
1113
1344
|
remaining: e
|
|
@@ -1116,7 +1347,7 @@ function ct(e, t) {
|
|
|
1116
1347
|
restartKey: t,
|
|
1117
1348
|
seconds: e,
|
|
1118
1349
|
remaining: e
|
|
1119
|
-
}),
|
|
1350
|
+
}), D.useEffect(() => {
|
|
1120
1351
|
if (e <= 0) return;
|
|
1121
1352
|
let t = window.setInterval(() => {
|
|
1122
1353
|
r((e) => e.remaining <= 0 ? e : {
|
|
@@ -1129,54 +1360,54 @@ function ct(e, t) {
|
|
|
1129
1360
|
}
|
|
1130
1361
|
//#endregion
|
|
1131
1362
|
//#region src/components/blocks/auth/code-auth-block.tsx
|
|
1132
|
-
function
|
|
1133
|
-
let [
|
|
1134
|
-
|
|
1363
|
+
function en({ channel: e = "email", logo: t, accent: n, destination: o, length: s = 6, autoSubmit: c = !0, resendSeconds: l = 30, onVerify: u, onResend: d, onBack: f }) {
|
|
1364
|
+
let [p, m] = D.useState("idle"), [h, g] = D.useState(null), [_, v] = D.useState(""), [b, x] = D.useState(0), C = $t(l, b), w = e === "sms" ? S : y, T = e === "sms" ? "phone" : "email", E = D.useCallback(async (e) => {
|
|
1365
|
+
g(null), m("loading");
|
|
1135
1366
|
try {
|
|
1136
|
-
await
|
|
1367
|
+
await u?.(e), m("success");
|
|
1137
1368
|
} catch (e) {
|
|
1138
|
-
|
|
1369
|
+
m("idle"), v(""), g(e instanceof Error ? e.message : "Invalid code.");
|
|
1139
1370
|
}
|
|
1140
|
-
}, [
|
|
1371
|
+
}, [u]);
|
|
1141
1372
|
function O(e) {
|
|
1142
|
-
|
|
1373
|
+
v(e), h && g(null), c && e.length === s && p === "idle" && E(e);
|
|
1143
1374
|
}
|
|
1144
1375
|
async function k() {
|
|
1145
|
-
|
|
1376
|
+
x((e) => e + 1), v(""), g(null), await d?.();
|
|
1146
1377
|
}
|
|
1147
|
-
return /* @__PURE__ */
|
|
1378
|
+
return /* @__PURE__ */ i(q, {
|
|
1148
1379
|
title: "Enter verification code",
|
|
1149
1380
|
logo: t,
|
|
1150
1381
|
accent: n,
|
|
1151
|
-
description: /* @__PURE__ */
|
|
1382
|
+
description: /* @__PURE__ */ a("span", {
|
|
1152
1383
|
className: "inline-flex items-center gap-1.5",
|
|
1153
|
-
children: [/* @__PURE__ */
|
|
1384
|
+
children: [/* @__PURE__ */ i(w, { className: "size-3.5 shrink-0" }), /* @__PURE__ */ a("span", { children: [
|
|
1154
1385
|
"We sent a ",
|
|
1155
|
-
|
|
1386
|
+
s,
|
|
1156
1387
|
"-digit code to your ",
|
|
1157
|
-
|
|
1158
|
-
|
|
1388
|
+
T,
|
|
1389
|
+
o ? /* @__PURE__ */ a(r, { children: [" ", /* @__PURE__ */ i("span", {
|
|
1159
1390
|
className: "font-medium text-foreground",
|
|
1160
|
-
children:
|
|
1391
|
+
children: o
|
|
1161
1392
|
})] }) : null,
|
|
1162
1393
|
"."
|
|
1163
1394
|
] })]
|
|
1164
1395
|
}),
|
|
1165
|
-
footer:
|
|
1396
|
+
footer: p !== "success" && /* @__PURE__ */ a(H, {
|
|
1166
1397
|
variant: "link",
|
|
1167
|
-
onClick:
|
|
1168
|
-
children: ["Use a different ",
|
|
1398
|
+
onClick: f,
|
|
1399
|
+
children: ["Use a different ", T]
|
|
1169
1400
|
}),
|
|
1170
|
-
children: /* @__PURE__ */
|
|
1171
|
-
step:
|
|
1172
|
-
children:
|
|
1401
|
+
children: /* @__PURE__ */ i(J, {
|
|
1402
|
+
step: p === "success" ? "success" : "form",
|
|
1403
|
+
children: p === "success" ? /* @__PURE__ */ i(Z, {
|
|
1173
1404
|
title: "Verified",
|
|
1174
1405
|
description: "Your identity has been confirmed."
|
|
1175
|
-
}) : /* @__PURE__ */
|
|
1406
|
+
}) : /* @__PURE__ */ a("div", {
|
|
1176
1407
|
className: "flex flex-col items-center gap-4",
|
|
1177
1408
|
children: [
|
|
1178
|
-
/* @__PURE__ */
|
|
1179
|
-
animate:
|
|
1409
|
+
/* @__PURE__ */ i(B.div, {
|
|
1410
|
+
animate: h ? { x: [
|
|
1180
1411
|
0,
|
|
1181
1412
|
-8,
|
|
1182
1413
|
8,
|
|
@@ -1188,42 +1419,42 @@ function lt({ channel: e = "email", logo: t, accent: n, destination: r, length:
|
|
|
1188
1419
|
duration: .4,
|
|
1189
1420
|
ease: "easeInOut"
|
|
1190
1421
|
},
|
|
1191
|
-
children: /* @__PURE__ */
|
|
1192
|
-
length:
|
|
1193
|
-
value:
|
|
1422
|
+
children: /* @__PURE__ */ i(It, {
|
|
1423
|
+
length: s,
|
|
1424
|
+
value: _,
|
|
1194
1425
|
onValueChange: O,
|
|
1195
|
-
disabled:
|
|
1196
|
-
children: Array.from({ length:
|
|
1197
|
-
"aria-invalid":
|
|
1198
|
-
"aria-label": `Digit ${t + 1} of ${
|
|
1426
|
+
disabled: p === "loading",
|
|
1427
|
+
children: Array.from({ length: s }, (e, t) => /* @__PURE__ */ i(Lt, {
|
|
1428
|
+
"aria-invalid": h ? !0 : void 0,
|
|
1429
|
+
"aria-label": `Digit ${t + 1} of ${s}`
|
|
1199
1430
|
}, `slot-${t}`))
|
|
1200
1431
|
})
|
|
1201
|
-
},
|
|
1202
|
-
/* @__PURE__ */
|
|
1203
|
-
!
|
|
1204
|
-
className:
|
|
1205
|
-
loading:
|
|
1206
|
-
disabled:
|
|
1207
|
-
onClick: () => void
|
|
1432
|
+
}, h ?? "steady"),
|
|
1433
|
+
/* @__PURE__ */ i(X, { message: h }),
|
|
1434
|
+
!c && /* @__PURE__ */ i(H, {
|
|
1435
|
+
className: V("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)]"),
|
|
1436
|
+
loading: p === "loading",
|
|
1437
|
+
disabled: _.length !== s,
|
|
1438
|
+
onClick: () => void E(_),
|
|
1208
1439
|
children: "Verify"
|
|
1209
1440
|
}),
|
|
1210
|
-
/* @__PURE__ */
|
|
1441
|
+
/* @__PURE__ */ i(B.p, {
|
|
1211
1442
|
layout: !0,
|
|
1212
1443
|
transition: {
|
|
1213
1444
|
duration: .25,
|
|
1214
|
-
ease:
|
|
1445
|
+
ease: K
|
|
1215
1446
|
},
|
|
1216
1447
|
className: "text-center text-sm text-muted-foreground",
|
|
1217
|
-
children:
|
|
1448
|
+
children: C > 0 ? /* @__PURE__ */ a(r, { children: [
|
|
1218
1449
|
"Resend code in",
|
|
1219
1450
|
" ",
|
|
1220
|
-
/* @__PURE__ */
|
|
1451
|
+
/* @__PURE__ */ a("span", {
|
|
1221
1452
|
className: "font-medium tabular-nums text-foreground",
|
|
1222
|
-
children: [
|
|
1453
|
+
children: [C, "s"]
|
|
1223
1454
|
})
|
|
1224
|
-
] }) : /* @__PURE__ */
|
|
1455
|
+
] }) : /* @__PURE__ */ i(H, {
|
|
1225
1456
|
variant: "link",
|
|
1226
|
-
disabled:
|
|
1457
|
+
disabled: p === "loading",
|
|
1227
1458
|
onClick: () => void k(),
|
|
1228
1459
|
children: "Resend code"
|
|
1229
1460
|
})
|
|
@@ -1235,72 +1466,72 @@ function lt({ channel: e = "email", logo: t, accent: n, destination: r, length:
|
|
|
1235
1466
|
}
|
|
1236
1467
|
//#endregion
|
|
1237
1468
|
//#region src/components/blocks/auth/forgot-password-block.tsx
|
|
1238
|
-
function
|
|
1239
|
-
let
|
|
1240
|
-
async function
|
|
1241
|
-
e.preventDefault(),
|
|
1469
|
+
function tn({ 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 }) {
|
|
1470
|
+
let u = D.useId(), [d, f] = D.useState("idle"), [p, m] = D.useState(null), [h, g] = D.useState("");
|
|
1471
|
+
async function _(e) {
|
|
1472
|
+
e.preventDefault(), m(null), f("loading");
|
|
1242
1473
|
try {
|
|
1243
|
-
await
|
|
1474
|
+
await s?.({ email: h }), f("success");
|
|
1244
1475
|
} catch (e) {
|
|
1245
|
-
|
|
1476
|
+
f("idle"), m(e instanceof Error ? e.message : "Unable to send reset link.");
|
|
1246
1477
|
}
|
|
1247
1478
|
}
|
|
1248
|
-
return /* @__PURE__ */
|
|
1479
|
+
return /* @__PURE__ */ i(q, {
|
|
1249
1480
|
title: e,
|
|
1250
|
-
description:
|
|
1481
|
+
description: o,
|
|
1251
1482
|
logo: t,
|
|
1252
1483
|
accent: n,
|
|
1253
|
-
footer: /* @__PURE__ */
|
|
1484
|
+
footer: /* @__PURE__ */ a(H, {
|
|
1254
1485
|
variant: "link",
|
|
1255
1486
|
className: "gap-1",
|
|
1256
|
-
onClick:
|
|
1257
|
-
children: [/* @__PURE__ */
|
|
1487
|
+
onClick: c,
|
|
1488
|
+
children: [/* @__PURE__ */ i(l, { className: "size-3.5" }), "Back to login"]
|
|
1258
1489
|
}),
|
|
1259
|
-
children: /* @__PURE__ */
|
|
1260
|
-
step:
|
|
1261
|
-
children:
|
|
1490
|
+
children: /* @__PURE__ */ i(J, {
|
|
1491
|
+
step: d === "success" ? "success" : "form",
|
|
1492
|
+
children: d === "success" ? /* @__PURE__ */ i(Z, {
|
|
1262
1493
|
title: "Check your inbox",
|
|
1263
|
-
description: /* @__PURE__ */
|
|
1494
|
+
description: /* @__PURE__ */ a(r, { children: [
|
|
1264
1495
|
"We sent a password reset link to",
|
|
1265
1496
|
" ",
|
|
1266
|
-
/* @__PURE__ */
|
|
1497
|
+
/* @__PURE__ */ i("span", {
|
|
1267
1498
|
className: "font-medium text-foreground",
|
|
1268
|
-
children:
|
|
1499
|
+
children: h
|
|
1269
1500
|
}),
|
|
1270
1501
|
"."
|
|
1271
1502
|
] }),
|
|
1272
|
-
children: /* @__PURE__ */
|
|
1503
|
+
children: /* @__PURE__ */ i(H, {
|
|
1273
1504
|
variant: "link",
|
|
1274
1505
|
className: "text-xs sm:text-xs",
|
|
1275
|
-
onClick: () =>
|
|
1506
|
+
onClick: () => f("idle"),
|
|
1276
1507
|
children: "Use a different email"
|
|
1277
1508
|
})
|
|
1278
|
-
}) : /* @__PURE__ */
|
|
1509
|
+
}) : /* @__PURE__ */ a("form", {
|
|
1279
1510
|
className: "flex flex-col gap-4",
|
|
1280
|
-
onSubmit:
|
|
1511
|
+
onSubmit: _,
|
|
1281
1512
|
children: [
|
|
1282
|
-
/* @__PURE__ */
|
|
1513
|
+
/* @__PURE__ */ a(U, {
|
|
1283
1514
|
name: "email",
|
|
1284
|
-
children: [/* @__PURE__ */
|
|
1285
|
-
htmlFor:
|
|
1515
|
+
children: [/* @__PURE__ */ i(W, {
|
|
1516
|
+
htmlFor: u,
|
|
1286
1517
|
children: "Email"
|
|
1287
|
-
}), /* @__PURE__ */
|
|
1288
|
-
id:
|
|
1518
|
+
}), /* @__PURE__ */ i(G, {
|
|
1519
|
+
id: u,
|
|
1289
1520
|
name: "email",
|
|
1290
1521
|
type: "email",
|
|
1291
1522
|
autoComplete: "email",
|
|
1292
1523
|
placeholder: "you@example.com",
|
|
1293
1524
|
required: !0,
|
|
1294
|
-
disabled:
|
|
1295
|
-
value:
|
|
1296
|
-
onChange: (e) =>
|
|
1525
|
+
disabled: d === "loading",
|
|
1526
|
+
value: h,
|
|
1527
|
+
onChange: (e) => g(e.target.value)
|
|
1297
1528
|
})]
|
|
1298
1529
|
}),
|
|
1299
|
-
/* @__PURE__ */
|
|
1300
|
-
/* @__PURE__ */
|
|
1301
|
-
className:
|
|
1530
|
+
/* @__PURE__ */ i(X, { message: p }),
|
|
1531
|
+
/* @__PURE__ */ i(H, {
|
|
1532
|
+
className: V("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)]"),
|
|
1302
1533
|
type: "submit",
|
|
1303
|
-
loading:
|
|
1534
|
+
loading: d === "loading",
|
|
1304
1535
|
children: "Send reset link"
|
|
1305
1536
|
})
|
|
1306
1537
|
]
|
|
@@ -1310,62 +1541,62 @@ function ut({ title: e = "Reset your password", logo: t, accent: n, description:
|
|
|
1310
1541
|
}
|
|
1311
1542
|
//#endregion
|
|
1312
1543
|
//#region src/components/blocks/auth/linked-accounts-block.tsx
|
|
1313
|
-
var
|
|
1314
|
-
function
|
|
1544
|
+
var nn = "This is your only way to sign in, so it can't be disconnected.";
|
|
1545
|
+
function rn({ title: e = "Connected accounts", description: t = "Manage the accounts you can use to sign in.", identities: n = [], providers: r = [
|
|
1315
1546
|
"google",
|
|
1316
1547
|
"apple",
|
|
1317
1548
|
"github"
|
|
1318
|
-
], loading:
|
|
1319
|
-
let
|
|
1320
|
-
async function
|
|
1321
|
-
if (!
|
|
1322
|
-
|
|
1549
|
+
], loading: o = !1, onLink: s, onUnlink: c, className: l }) {
|
|
1550
|
+
let u = D.useId(), [d, f] = D.useState(null), [p, m] = D.useState(null), [h, g] = D.useState(null), _ = new Set(n.map((e) => e.provider)), v = r.filter((e) => !_.has(e)), y = p !== null || h !== null, b = n.length <= 1;
|
|
1551
|
+
async function x(e) {
|
|
1552
|
+
if (!y) {
|
|
1553
|
+
f(null), m(e);
|
|
1323
1554
|
try {
|
|
1324
|
-
await
|
|
1555
|
+
await s?.(e);
|
|
1325
1556
|
} catch (e) {
|
|
1326
|
-
|
|
1557
|
+
f(e instanceof Error ? e.message : "Unable to connect account.");
|
|
1327
1558
|
} finally {
|
|
1328
|
-
|
|
1559
|
+
m(null);
|
|
1329
1560
|
}
|
|
1330
1561
|
}
|
|
1331
1562
|
}
|
|
1332
|
-
async function
|
|
1333
|
-
if (!(
|
|
1334
|
-
|
|
1563
|
+
async function S(e) {
|
|
1564
|
+
if (!(y || b)) {
|
|
1565
|
+
f(null), g(e);
|
|
1335
1566
|
try {
|
|
1336
|
-
await
|
|
1567
|
+
await c?.(e);
|
|
1337
1568
|
} catch (e) {
|
|
1338
|
-
|
|
1569
|
+
f(e instanceof Error ? e.message : "Unable to disconnect account.");
|
|
1339
1570
|
} finally {
|
|
1340
|
-
|
|
1571
|
+
g(null);
|
|
1341
1572
|
}
|
|
1342
1573
|
}
|
|
1343
1574
|
}
|
|
1344
|
-
return /* @__PURE__ */
|
|
1575
|
+
return /* @__PURE__ */ i(ge, {
|
|
1345
1576
|
reducedMotion: "user",
|
|
1346
|
-
children: /* @__PURE__ */
|
|
1347
|
-
className:
|
|
1577
|
+
children: /* @__PURE__ */ a(Ie, {
|
|
1578
|
+
className: V("w-full", l),
|
|
1348
1579
|
"data-slot": "auth-block",
|
|
1349
|
-
children: [/* @__PURE__ */
|
|
1580
|
+
children: [/* @__PURE__ */ a(Ue, { children: [/* @__PURE__ */ i(We, { children: e }), /* @__PURE__ */ i(Ge, { children: t })] }), /* @__PURE__ */ i(qe, { children: o ? /* @__PURE__ */ a("div", {
|
|
1350
1581
|
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
1351
|
-
children: [/* @__PURE__ */
|
|
1352
|
-
}) : /* @__PURE__ */
|
|
1582
|
+
children: [/* @__PURE__ */ i(Ee, { className: "size-4" }), "Loading connected accounts…"]
|
|
1583
|
+
}) : /* @__PURE__ */ a(B.div, {
|
|
1353
1584
|
layout: !0,
|
|
1354
1585
|
transition: {
|
|
1355
1586
|
duration: .3,
|
|
1356
|
-
ease:
|
|
1587
|
+
ease: K
|
|
1357
1588
|
},
|
|
1358
1589
|
className: "flex flex-col gap-3",
|
|
1359
1590
|
children: [
|
|
1360
|
-
/* @__PURE__ */
|
|
1361
|
-
n.length > 0 ? /* @__PURE__ */
|
|
1591
|
+
/* @__PURE__ */ i(X, { message: d }),
|
|
1592
|
+
n.length > 0 ? /* @__PURE__ */ i("ul", {
|
|
1362
1593
|
"aria-label": "Connected accounts",
|
|
1363
1594
|
className: "flex flex-col gap-2",
|
|
1364
|
-
children: /* @__PURE__ */
|
|
1595
|
+
children: /* @__PURE__ */ i(z, {
|
|
1365
1596
|
initial: !1,
|
|
1366
1597
|
children: n.map((e, t) => {
|
|
1367
|
-
let { label: n, Icon: r } =
|
|
1368
|
-
return /* @__PURE__ */
|
|
1598
|
+
let { label: n, Icon: r } = Gt[e.provider];
|
|
1599
|
+
return /* @__PURE__ */ a(B.li, {
|
|
1369
1600
|
layout: !0,
|
|
1370
1601
|
className: "flex items-center justify-between gap-3 rounded-lg border px-3 py-2",
|
|
1371
1602
|
initial: {
|
|
@@ -1382,57 +1613,57 @@ function ft({ title: e = "Connected accounts", description: t = "Manage the acco
|
|
|
1382
1613
|
},
|
|
1383
1614
|
transition: {
|
|
1384
1615
|
duration: .25,
|
|
1385
|
-
ease:
|
|
1616
|
+
ease: K,
|
|
1386
1617
|
delay: Math.min(t, 5) * .04
|
|
1387
1618
|
},
|
|
1388
|
-
children: [/* @__PURE__ */
|
|
1619
|
+
children: [/* @__PURE__ */ a("div", {
|
|
1389
1620
|
className: "flex min-w-0 items-center gap-2.5",
|
|
1390
|
-
children: [/* @__PURE__ */
|
|
1621
|
+
children: [/* @__PURE__ */ i(r, {
|
|
1391
1622
|
"aria-hidden": "true",
|
|
1392
1623
|
className: "size-4 text-muted-foreground"
|
|
1393
|
-
}), /* @__PURE__ */
|
|
1624
|
+
}), /* @__PURE__ */ a("div", {
|
|
1394
1625
|
className: "flex min-w-0 flex-col",
|
|
1395
|
-
children: [/* @__PURE__ */
|
|
1626
|
+
children: [/* @__PURE__ */ i("span", {
|
|
1396
1627
|
className: "font-medium text-sm",
|
|
1397
1628
|
children: n
|
|
1398
|
-
}), e.email && /* @__PURE__ */
|
|
1629
|
+
}), e.email && /* @__PURE__ */ i("span", {
|
|
1399
1630
|
className: "truncate text-xs text-muted-foreground",
|
|
1400
1631
|
children: e.email
|
|
1401
1632
|
})]
|
|
1402
1633
|
})]
|
|
1403
|
-
}), /* @__PURE__ */
|
|
1404
|
-
"aria-describedby":
|
|
1634
|
+
}), /* @__PURE__ */ i(H, {
|
|
1635
|
+
"aria-describedby": b ? u : void 0,
|
|
1405
1636
|
"aria-label": `Disconnect ${n}`,
|
|
1406
1637
|
size: "sm",
|
|
1407
1638
|
type: "button",
|
|
1408
1639
|
variant: "destructive-outline",
|
|
1409
|
-
disabled:
|
|
1410
|
-
loading:
|
|
1411
|
-
onClick: () => void
|
|
1640
|
+
disabled: y || b,
|
|
1641
|
+
loading: h === e.id,
|
|
1642
|
+
onClick: () => void S(e.id),
|
|
1412
1643
|
children: "Disconnect"
|
|
1413
1644
|
})]
|
|
1414
1645
|
}, e.id);
|
|
1415
1646
|
})
|
|
1416
1647
|
})
|
|
1417
|
-
}) : /* @__PURE__ */
|
|
1648
|
+
}) : /* @__PURE__ */ i("p", {
|
|
1418
1649
|
className: "text-sm text-muted-foreground",
|
|
1419
1650
|
children: "No sign-in methods connected yet."
|
|
1420
1651
|
}),
|
|
1421
|
-
|
|
1652
|
+
b && n.length > 0 && /* @__PURE__ */ i("p", {
|
|
1422
1653
|
className: "text-xs text-muted-foreground",
|
|
1423
|
-
id:
|
|
1424
|
-
children:
|
|
1654
|
+
id: u,
|
|
1655
|
+
children: nn
|
|
1425
1656
|
}),
|
|
1426
|
-
|
|
1427
|
-
let { label: t, Icon: n } =
|
|
1428
|
-
return /* @__PURE__ */
|
|
1657
|
+
v.map((e) => {
|
|
1658
|
+
let { label: t, Icon: n } = Gt[e];
|
|
1659
|
+
return /* @__PURE__ */ a(H, {
|
|
1429
1660
|
className: "w-full",
|
|
1430
1661
|
type: "button",
|
|
1431
1662
|
variant: "outline",
|
|
1432
|
-
disabled:
|
|
1433
|
-
loading:
|
|
1434
|
-
onClick: () => void
|
|
1435
|
-
children: [/* @__PURE__ */
|
|
1663
|
+
disabled: y,
|
|
1664
|
+
loading: p === e,
|
|
1665
|
+
onClick: () => void x(e),
|
|
1666
|
+
children: [/* @__PURE__ */ i(n, { "aria-hidden": "true" }), /* @__PURE__ */ a("span", {
|
|
1436
1667
|
className: "flex-1",
|
|
1437
1668
|
children: ["Connect ", t]
|
|
1438
1669
|
})]
|
|
@@ -1445,68 +1676,68 @@ function ft({ title: e = "Connected accounts", description: t = "Manage the acco
|
|
|
1445
1676
|
}
|
|
1446
1677
|
//#endregion
|
|
1447
1678
|
//#region src/components/blocks/auth/login-block.tsx
|
|
1448
|
-
function
|
|
1679
|
+
function an({ title: e = "Login to your account", description: t = "Enter your email and password to login", logo: n, accent: o, providers: s = [
|
|
1449
1680
|
"google",
|
|
1450
1681
|
"apple",
|
|
1451
1682
|
"github"
|
|
1452
|
-
], showRememberMe:
|
|
1453
|
-
let
|
|
1454
|
-
async function
|
|
1455
|
-
if (e.preventDefault(), !
|
|
1683
|
+
], showRememberMe: c = !0, showForgotPassword: l = !0, onSubmit: u, onProviderSelect: d, onForgotPassword: f, onSignup: p }) {
|
|
1684
|
+
let m = D.useId(), h = D.useId(), [g, _] = D.useState("idle"), [v, y] = D.useState(null), [b, x] = D.useState(null), [S, C] = D.useState(!1), [w, T] = D.useState(""), [E, O] = D.useState(!1), [k, A] = D.useState(""), j = g === "loading" || b !== null, M = k.trim().length > 0, N = E && M;
|
|
1685
|
+
async function P(e) {
|
|
1686
|
+
if (e.preventDefault(), !N) return;
|
|
1456
1687
|
let t = new FormData(e.currentTarget);
|
|
1457
|
-
|
|
1688
|
+
y(null), _("loading");
|
|
1458
1689
|
try {
|
|
1459
|
-
await
|
|
1690
|
+
await u?.({
|
|
1460
1691
|
email: String(t.get("email") ?? ""),
|
|
1461
1692
|
password: String(t.get("password") ?? ""),
|
|
1462
|
-
remember:
|
|
1463
|
-
}),
|
|
1693
|
+
remember: S
|
|
1694
|
+
}), _("success");
|
|
1464
1695
|
} catch (e) {
|
|
1465
|
-
|
|
1696
|
+
_("idle"), y(e instanceof Error ? e.message : "Unable to login.");
|
|
1466
1697
|
}
|
|
1467
1698
|
}
|
|
1468
|
-
async function
|
|
1469
|
-
|
|
1699
|
+
async function ee(e) {
|
|
1700
|
+
y(null), x(e);
|
|
1470
1701
|
try {
|
|
1471
|
-
await
|
|
1702
|
+
await d?.(e), _("success");
|
|
1472
1703
|
} catch (e) {
|
|
1473
|
-
|
|
1704
|
+
y(e instanceof Error ? e.message : "Unable to login.");
|
|
1474
1705
|
} finally {
|
|
1475
|
-
|
|
1706
|
+
x(null);
|
|
1476
1707
|
}
|
|
1477
1708
|
}
|
|
1478
|
-
return /* @__PURE__ */
|
|
1709
|
+
return /* @__PURE__ */ i(q, {
|
|
1479
1710
|
title: e,
|
|
1480
1711
|
description: t,
|
|
1481
1712
|
logo: n,
|
|
1482
|
-
accent:
|
|
1483
|
-
footer:
|
|
1713
|
+
accent: o,
|
|
1714
|
+
footer: g !== "success" && /* @__PURE__ */ a(r, { children: [
|
|
1484
1715
|
"Don't have an account?",
|
|
1485
1716
|
" ",
|
|
1486
|
-
/* @__PURE__ */
|
|
1717
|
+
/* @__PURE__ */ i(H, {
|
|
1487
1718
|
variant: "link",
|
|
1488
|
-
onClick:
|
|
1719
|
+
onClick: p,
|
|
1489
1720
|
children: "Sign up"
|
|
1490
1721
|
})
|
|
1491
1722
|
] }),
|
|
1492
|
-
children: /* @__PURE__ */
|
|
1493
|
-
step:
|
|
1494
|
-
children:
|
|
1723
|
+
children: /* @__PURE__ */ i(J, {
|
|
1724
|
+
step: g === "success" ? "success" : "form",
|
|
1725
|
+
children: g === "success" ? /* @__PURE__ */ i(Z, {
|
|
1495
1726
|
title: "Welcome back",
|
|
1496
1727
|
description: "You are now logged in."
|
|
1497
|
-
}) : /* @__PURE__ */
|
|
1728
|
+
}) : /* @__PURE__ */ a("div", {
|
|
1498
1729
|
className: "flex flex-col gap-4",
|
|
1499
|
-
children: [/* @__PURE__ */
|
|
1730
|
+
children: [/* @__PURE__ */ a("form", {
|
|
1500
1731
|
className: "flex flex-col gap-4",
|
|
1501
|
-
onSubmit:
|
|
1732
|
+
onSubmit: P,
|
|
1502
1733
|
children: [
|
|
1503
|
-
/* @__PURE__ */
|
|
1734
|
+
/* @__PURE__ */ a(U, {
|
|
1504
1735
|
name: "email",
|
|
1505
|
-
children: [/* @__PURE__ */
|
|
1506
|
-
htmlFor:
|
|
1736
|
+
children: [/* @__PURE__ */ i(W, {
|
|
1737
|
+
htmlFor: m,
|
|
1507
1738
|
children: "Email"
|
|
1508
|
-
}), /* @__PURE__ */
|
|
1509
|
-
id:
|
|
1739
|
+
}), /* @__PURE__ */ i(G, {
|
|
1740
|
+
id: m,
|
|
1510
1741
|
"aria-label": "Email",
|
|
1511
1742
|
name: "email",
|
|
1512
1743
|
type: "email",
|
|
@@ -1514,22 +1745,22 @@ function pt({ title: e = "Login to your account", description: t = "Enter your e
|
|
|
1514
1745
|
placeholder: "you@example.com",
|
|
1515
1746
|
required: !0,
|
|
1516
1747
|
disabled: j,
|
|
1517
|
-
value:
|
|
1748
|
+
value: w,
|
|
1518
1749
|
onChange: (e) => {
|
|
1519
|
-
|
|
1750
|
+
T(e.currentTarget.value), O(e.currentTarget.validity.valid);
|
|
1520
1751
|
}
|
|
1521
1752
|
})]
|
|
1522
1753
|
}),
|
|
1523
|
-
/* @__PURE__ */
|
|
1524
|
-
show:
|
|
1525
|
-
children: /* @__PURE__ */
|
|
1754
|
+
/* @__PURE__ */ i(Y, {
|
|
1755
|
+
show: E,
|
|
1756
|
+
children: /* @__PURE__ */ a(U, {
|
|
1526
1757
|
name: "password",
|
|
1527
1758
|
children: [
|
|
1528
|
-
/* @__PURE__ */
|
|
1759
|
+
/* @__PURE__ */ i(W, {
|
|
1529
1760
|
htmlFor: "password",
|
|
1530
1761
|
children: "Password"
|
|
1531
1762
|
}),
|
|
1532
|
-
/* @__PURE__ */
|
|
1763
|
+
/* @__PURE__ */ i(Wt, {
|
|
1533
1764
|
id: "password",
|
|
1534
1765
|
name: "password",
|
|
1535
1766
|
autoComplete: "current-password",
|
|
@@ -1538,50 +1769,50 @@ function pt({ title: e = "Login to your account", description: t = "Enter your e
|
|
|
1538
1769
|
value: k,
|
|
1539
1770
|
onChange: (e) => A(e.target.value)
|
|
1540
1771
|
}),
|
|
1541
|
-
|
|
1772
|
+
l && /* @__PURE__ */ i(H, {
|
|
1542
1773
|
variant: "link",
|
|
1543
1774
|
type: "button",
|
|
1544
1775
|
className: "self-end font-normal text-muted-foreground text-xs hover:text-foreground sm:text-xs",
|
|
1545
|
-
onClick:
|
|
1776
|
+
onClick: f,
|
|
1546
1777
|
children: "Forgot password?"
|
|
1547
1778
|
})
|
|
1548
1779
|
]
|
|
1549
1780
|
})
|
|
1550
1781
|
}),
|
|
1551
|
-
|
|
1782
|
+
c && /* @__PURE__ */ a("div", {
|
|
1552
1783
|
className: "flex items-center gap-2",
|
|
1553
|
-
children: [/* @__PURE__ */
|
|
1554
|
-
id:
|
|
1555
|
-
checked:
|
|
1556
|
-
onCheckedChange: (e) =>
|
|
1784
|
+
children: [/* @__PURE__ */ i(Qe, {
|
|
1785
|
+
id: h,
|
|
1786
|
+
checked: S,
|
|
1787
|
+
onCheckedChange: (e) => C(e),
|
|
1557
1788
|
disabled: j
|
|
1558
|
-
}), /* @__PURE__ */
|
|
1559
|
-
htmlFor:
|
|
1789
|
+
}), /* @__PURE__ */ i(_t, {
|
|
1790
|
+
htmlFor: h,
|
|
1560
1791
|
className: "font-normal",
|
|
1561
1792
|
children: "Remember me"
|
|
1562
1793
|
})]
|
|
1563
1794
|
}),
|
|
1564
|
-
/* @__PURE__ */
|
|
1565
|
-
/* @__PURE__ */
|
|
1566
|
-
show:
|
|
1567
|
-
children: /* @__PURE__ */
|
|
1568
|
-
className:
|
|
1795
|
+
/* @__PURE__ */ i(X, { message: v }),
|
|
1796
|
+
/* @__PURE__ */ i(Y, {
|
|
1797
|
+
show: N,
|
|
1798
|
+
children: /* @__PURE__ */ i(H, {
|
|
1799
|
+
className: V("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)]"),
|
|
1569
1800
|
type: "submit",
|
|
1570
|
-
loading:
|
|
1801
|
+
loading: g === "loading",
|
|
1571
1802
|
disabled: j,
|
|
1572
1803
|
children: "Login"
|
|
1573
1804
|
})
|
|
1574
1805
|
})
|
|
1575
1806
|
]
|
|
1576
|
-
}),
|
|
1577
|
-
show: !
|
|
1807
|
+
}), s.length > 0 && /* @__PURE__ */ a(Y, {
|
|
1808
|
+
show: !N,
|
|
1578
1809
|
className: "flex flex-col gap-4",
|
|
1579
|
-
children: [/* @__PURE__ */
|
|
1580
|
-
providers:
|
|
1810
|
+
children: [/* @__PURE__ */ i(Qt, { label: "Or continue with" }), /* @__PURE__ */ i(qt, {
|
|
1811
|
+
providers: s,
|
|
1581
1812
|
action: "login",
|
|
1582
|
-
loadingProvider:
|
|
1583
|
-
disabled:
|
|
1584
|
-
onSelect:
|
|
1813
|
+
loadingProvider: b,
|
|
1814
|
+
disabled: g === "loading",
|
|
1815
|
+
onSelect: ee
|
|
1585
1816
|
})]
|
|
1586
1817
|
})]
|
|
1587
1818
|
})
|
|
@@ -1590,10 +1821,10 @@ function pt({ title: e = "Login to your account", description: t = "Enter your e
|
|
|
1590
1821
|
}
|
|
1591
1822
|
//#endregion
|
|
1592
1823
|
//#region src/components/blocks/auth/onboarding/profile-step.tsx
|
|
1593
|
-
function
|
|
1824
|
+
function on(e, t) {
|
|
1594
1825
|
return e.kind === "checkbox" ? typeof t == "boolean" && t : typeof t == "string" ? t : "";
|
|
1595
1826
|
}
|
|
1596
|
-
function
|
|
1827
|
+
function sn(e, t) {
|
|
1597
1828
|
let n = e.required === !0;
|
|
1598
1829
|
if (e.kind === "checkbox") return n && t !== !0 ? `${e.label} is required` : null;
|
|
1599
1830
|
let r = typeof t == "string" ? t.trim() : "";
|
|
@@ -1605,115 +1836,115 @@ function ht(e, t) {
|
|
|
1605
1836
|
}
|
|
1606
1837
|
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;
|
|
1607
1838
|
}
|
|
1608
|
-
function
|
|
1609
|
-
let
|
|
1610
|
-
function
|
|
1611
|
-
|
|
1839
|
+
function cn({ step: e, values: t, submitting: n = !1, submitLabel: r, onSubmit: o, onBack: s, onDraftChange: c }) {
|
|
1840
|
+
let l = D.useId(), [u, d] = D.useState(() => Object.fromEntries(e.fields.map((e) => [e.name, on(e, t[e.name])]))), [f, p] = D.useState({});
|
|
1841
|
+
function m(e, t) {
|
|
1842
|
+
d((n) => ({
|
|
1612
1843
|
...n,
|
|
1613
1844
|
[e]: t
|
|
1614
|
-
})),
|
|
1845
|
+
})), c?.(e, t), p((t) => t[e] ? {
|
|
1615
1846
|
...t,
|
|
1616
1847
|
[e]: ""
|
|
1617
1848
|
} : t);
|
|
1618
1849
|
}
|
|
1619
|
-
async function
|
|
1850
|
+
async function h(t) {
|
|
1620
1851
|
if (t.preventDefault(), n) return;
|
|
1621
1852
|
let r = {};
|
|
1622
1853
|
for (let t of e.fields) {
|
|
1623
|
-
let e =
|
|
1854
|
+
let e = sn(t, u[t.name]);
|
|
1624
1855
|
e && (r[t.name] = e);
|
|
1625
1856
|
}
|
|
1626
1857
|
if (Object.keys(r).length > 0) {
|
|
1627
|
-
|
|
1858
|
+
p(r);
|
|
1628
1859
|
return;
|
|
1629
1860
|
}
|
|
1630
|
-
|
|
1631
|
-
let
|
|
1861
|
+
p({});
|
|
1862
|
+
let i = {};
|
|
1632
1863
|
for (let t of e.fields) {
|
|
1633
|
-
let e =
|
|
1634
|
-
|
|
1864
|
+
let e = u[t.name];
|
|
1865
|
+
i[t.name] = typeof e == "string" ? e.trim() : e;
|
|
1635
1866
|
}
|
|
1636
|
-
await i
|
|
1867
|
+
await o(i);
|
|
1637
1868
|
}
|
|
1638
|
-
return /* @__PURE__ */
|
|
1869
|
+
return /* @__PURE__ */ a("form", {
|
|
1639
1870
|
className: "flex flex-col gap-4",
|
|
1640
1871
|
noValidate: !0,
|
|
1641
|
-
onSubmit:
|
|
1872
|
+
onSubmit: h,
|
|
1642
1873
|
children: [e.fields.map((e) => {
|
|
1643
|
-
let t =
|
|
1644
|
-
return e.kind === "checkbox" ? /* @__PURE__ */
|
|
1874
|
+
let t = f[e.name] || void 0, r = `${l}-${e.name}`, o = u[e.name];
|
|
1875
|
+
return e.kind === "checkbox" ? /* @__PURE__ */ a(U, {
|
|
1645
1876
|
name: e.name,
|
|
1646
1877
|
invalid: !!t,
|
|
1647
1878
|
className: "gap-1.5",
|
|
1648
|
-
children: [/* @__PURE__ */
|
|
1879
|
+
children: [/* @__PURE__ */ a("div", {
|
|
1649
1880
|
className: "flex items-center gap-2",
|
|
1650
|
-
children: [/* @__PURE__ */
|
|
1881
|
+
children: [/* @__PURE__ */ i(Qe, {
|
|
1651
1882
|
id: r,
|
|
1652
|
-
checked:
|
|
1883
|
+
checked: o === !0,
|
|
1653
1884
|
disabled: n,
|
|
1654
|
-
onCheckedChange: (t) =>
|
|
1655
|
-
}), /* @__PURE__ */
|
|
1885
|
+
onCheckedChange: (t) => m(e.name, t)
|
|
1886
|
+
}), /* @__PURE__ */ i(_t, {
|
|
1656
1887
|
htmlFor: r,
|
|
1657
1888
|
className: "font-normal",
|
|
1658
1889
|
children: e.label
|
|
1659
1890
|
})]
|
|
1660
|
-
}), t && /* @__PURE__ */
|
|
1891
|
+
}), t && /* @__PURE__ */ i(tt, {
|
|
1661
1892
|
match: !0,
|
|
1662
1893
|
children: t
|
|
1663
1894
|
})]
|
|
1664
|
-
}, e.name) : /* @__PURE__ */
|
|
1895
|
+
}, e.name) : /* @__PURE__ */ a(U, {
|
|
1665
1896
|
name: e.name,
|
|
1666
1897
|
invalid: !!t,
|
|
1667
1898
|
children: [
|
|
1668
|
-
/* @__PURE__ */
|
|
1899
|
+
/* @__PURE__ */ i(W, {
|
|
1669
1900
|
htmlFor: r,
|
|
1670
1901
|
children: e.label
|
|
1671
1902
|
}),
|
|
1672
|
-
e.kind === "textarea" ? /* @__PURE__ */
|
|
1903
|
+
e.kind === "textarea" ? /* @__PURE__ */ i(ut, {
|
|
1673
1904
|
id: r,
|
|
1674
1905
|
"aria-invalid": t ? !0 : void 0,
|
|
1675
1906
|
disabled: n,
|
|
1676
1907
|
placeholder: e.placeholder,
|
|
1677
|
-
value: String(
|
|
1678
|
-
onChange: (t) =>
|
|
1679
|
-
}) : e.kind === "select" ? /* @__PURE__ */
|
|
1908
|
+
value: String(o ?? ""),
|
|
1909
|
+
onChange: (t) => m(e.name, t.target.value)
|
|
1910
|
+
}) : e.kind === "select" ? /* @__PURE__ */ a("select", {
|
|
1680
1911
|
id: r,
|
|
1681
1912
|
"aria-invalid": t ? !0 : void 0,
|
|
1682
|
-
className:
|
|
1913
|
+
className: V("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"),
|
|
1683
1914
|
disabled: n,
|
|
1684
|
-
value: String(
|
|
1685
|
-
onChange: (t) =>
|
|
1686
|
-
children: [/* @__PURE__ */
|
|
1915
|
+
value: String(o ?? ""),
|
|
1916
|
+
onChange: (t) => m(e.name, t.target.value),
|
|
1917
|
+
children: [/* @__PURE__ */ i("option", {
|
|
1687
1918
|
value: "",
|
|
1688
1919
|
children: e.placeholder ?? "Choose an option"
|
|
1689
|
-
}), e.options.map((e) => /* @__PURE__ */
|
|
1920
|
+
}), e.options.map((e) => /* @__PURE__ */ i("option", {
|
|
1690
1921
|
value: e.value,
|
|
1691
1922
|
children: e.label
|
|
1692
1923
|
}, e.value))]
|
|
1693
|
-
}) : /* @__PURE__ */
|
|
1924
|
+
}) : /* @__PURE__ */ i(G, {
|
|
1694
1925
|
id: r,
|
|
1695
1926
|
"aria-invalid": t ? !0 : void 0,
|
|
1696
1927
|
disabled: n,
|
|
1697
1928
|
placeholder: e.placeholder,
|
|
1698
1929
|
type: e.kind === "url" ? "url" : "text",
|
|
1699
|
-
value: String(
|
|
1700
|
-
onChange: (t) =>
|
|
1930
|
+
value: String(o ?? ""),
|
|
1931
|
+
onChange: (t) => m(e.name, t.target.value)
|
|
1701
1932
|
}),
|
|
1702
|
-
t && /* @__PURE__ */
|
|
1933
|
+
t && /* @__PURE__ */ i(tt, {
|
|
1703
1934
|
match: !0,
|
|
1704
1935
|
children: t
|
|
1705
1936
|
})
|
|
1706
1937
|
]
|
|
1707
1938
|
}, e.name);
|
|
1708
|
-
}), /* @__PURE__ */
|
|
1939
|
+
}), /* @__PURE__ */ a("div", {
|
|
1709
1940
|
className: "flex gap-2",
|
|
1710
|
-
children: [
|
|
1941
|
+
children: [s && /* @__PURE__ */ i(H, {
|
|
1711
1942
|
type: "button",
|
|
1712
1943
|
variant: "outline",
|
|
1713
1944
|
disabled: n,
|
|
1714
|
-
onClick:
|
|
1945
|
+
onClick: s,
|
|
1715
1946
|
children: "Back"
|
|
1716
|
-
}), /* @__PURE__ */
|
|
1947
|
+
}), /* @__PURE__ */ i(H, {
|
|
1717
1948
|
className: "flex-1",
|
|
1718
1949
|
type: "submit",
|
|
1719
1950
|
loading: n,
|
|
@@ -1724,7 +1955,7 @@ function gt({ step: e, values: t, submitting: n = !1, submitLabel: r, onSubmit:
|
|
|
1724
1955
|
}
|
|
1725
1956
|
//#endregion
|
|
1726
1957
|
//#region src/components/blocks/auth/onboarding-block.tsx
|
|
1727
|
-
var
|
|
1958
|
+
var ln = [{
|
|
1728
1959
|
id: "profile",
|
|
1729
1960
|
title: "Your profile",
|
|
1730
1961
|
fields: [{
|
|
@@ -1734,82 +1965,82 @@ var _t = [{
|
|
|
1734
1965
|
required: !0
|
|
1735
1966
|
}]
|
|
1736
1967
|
}];
|
|
1737
|
-
function
|
|
1738
|
-
let
|
|
1739
|
-
|
|
1740
|
-
|
|
1968
|
+
function un({ steps: e = ln, logo: t, accent: n, onStepSubmit: r, onComplete: o, showCompleteScreen: s = !0, className: c }) {
|
|
1969
|
+
let l = D.useRef(null), u = D.useRef({}), [d, f] = D.useState({}), [p, m] = D.useState(0), [h, g] = D.useState({}), [_, v] = D.useState("idle"), [y, b] = D.useState(null), x = _ === "success", S = e[p], C = p >= e.length - 1;
|
|
1970
|
+
D.useEffect(() => {
|
|
1971
|
+
y || l.current?.focus();
|
|
1741
1972
|
}, [
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1973
|
+
p,
|
|
1974
|
+
x,
|
|
1975
|
+
y
|
|
1745
1976
|
]);
|
|
1746
|
-
async function
|
|
1747
|
-
if (!
|
|
1977
|
+
async function w(e) {
|
|
1978
|
+
if (!S) return;
|
|
1748
1979
|
let t = {
|
|
1749
|
-
...
|
|
1980
|
+
...h,
|
|
1750
1981
|
...e
|
|
1751
1982
|
};
|
|
1752
|
-
|
|
1983
|
+
b(null), v("loading");
|
|
1753
1984
|
try {
|
|
1754
|
-
await r?.(
|
|
1985
|
+
await r?.(S.id, e), C && await o?.(t), g(t), delete u.current[S.id], f({ ...u.current }), v(C ? "success" : "idle"), C || m((e) => e + 1);
|
|
1755
1986
|
} catch (e) {
|
|
1756
|
-
|
|
1987
|
+
v("idle"), b(e instanceof Error ? e.message : "Unable to save your profile.");
|
|
1757
1988
|
}
|
|
1758
1989
|
}
|
|
1759
|
-
return
|
|
1760
|
-
title:
|
|
1761
|
-
description:
|
|
1990
|
+
return x && !s ? null : /* @__PURE__ */ i(q, {
|
|
1991
|
+
title: x ? "You're all set" : S?.title ?? "Your profile",
|
|
1992
|
+
description: x ? void 0 : S?.description,
|
|
1762
1993
|
logo: t,
|
|
1763
1994
|
accent: n,
|
|
1764
|
-
className:
|
|
1765
|
-
children: /* @__PURE__ */
|
|
1766
|
-
step:
|
|
1767
|
-
children:
|
|
1995
|
+
className: c,
|
|
1996
|
+
children: /* @__PURE__ */ i(J, {
|
|
1997
|
+
step: x ? "done" : `step-${p}`,
|
|
1998
|
+
children: x ? /* @__PURE__ */ i(Z, {
|
|
1768
1999
|
title: "Profile saved",
|
|
1769
2000
|
description: "Your account is ready and your profile has been saved."
|
|
1770
|
-
}) :
|
|
2001
|
+
}) : S ? /* @__PURE__ */ a("div", {
|
|
1771
2002
|
className: "flex flex-col gap-4",
|
|
1772
2003
|
children: [
|
|
1773
|
-
/* @__PURE__ */
|
|
2004
|
+
/* @__PURE__ */ i("nav", {
|
|
1774
2005
|
"aria-label": "Onboarding progress",
|
|
1775
|
-
children: /* @__PURE__ */
|
|
2006
|
+
children: /* @__PURE__ */ i("ol", {
|
|
1776
2007
|
className: "flex flex-wrap gap-x-3 gap-y-1 text-xs",
|
|
1777
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
1778
|
-
"aria-current": t ===
|
|
1779
|
-
className:
|
|
1780
|
-
children: [e.title, t <
|
|
2008
|
+
children: e.map((e, t) => /* @__PURE__ */ a("li", {
|
|
2009
|
+
"aria-current": t === p ? "step" : void 0,
|
|
2010
|
+
className: V("text-muted-foreground", t === p && "font-medium text-foreground"),
|
|
2011
|
+
children: [e.title, t < p && /* @__PURE__ */ i("span", {
|
|
1781
2012
|
className: "sr-only",
|
|
1782
2013
|
children: " (completed)"
|
|
1783
2014
|
})]
|
|
1784
2015
|
}, e.id))
|
|
1785
2016
|
})
|
|
1786
2017
|
}),
|
|
1787
|
-
/* @__PURE__ */
|
|
1788
|
-
ref:
|
|
2018
|
+
/* @__PURE__ */ i("h3", {
|
|
2019
|
+
ref: l,
|
|
1789
2020
|
tabIndex: -1,
|
|
1790
2021
|
className: "sr-only",
|
|
1791
|
-
children:
|
|
2022
|
+
children: S.title
|
|
1792
2023
|
}),
|
|
1793
|
-
/* @__PURE__ */
|
|
1794
|
-
/* @__PURE__ */
|
|
1795
|
-
step:
|
|
2024
|
+
/* @__PURE__ */ i(X, { message: y }),
|
|
2025
|
+
/* @__PURE__ */ i(cn, {
|
|
2026
|
+
step: S,
|
|
1796
2027
|
values: {
|
|
1797
|
-
...
|
|
1798
|
-
...
|
|
2028
|
+
...h,
|
|
2029
|
+
...d[S.id]
|
|
1799
2030
|
},
|
|
1800
|
-
submitting:
|
|
1801
|
-
submitLabel:
|
|
1802
|
-
onBack:
|
|
1803
|
-
|
|
2031
|
+
submitting: _ === "loading",
|
|
2032
|
+
submitLabel: C ? "Finish" : "Continue",
|
|
2033
|
+
onBack: p > 0 ? () => {
|
|
2034
|
+
b(null), f({ ...u.current }), m((e) => e - 1);
|
|
1804
2035
|
} : void 0,
|
|
1805
2036
|
onDraftChange: (e, t) => {
|
|
1806
|
-
|
|
1807
|
-
...
|
|
2037
|
+
u.current[S.id] = {
|
|
2038
|
+
...u.current[S.id],
|
|
1808
2039
|
[e]: t
|
|
1809
2040
|
};
|
|
1810
2041
|
},
|
|
1811
|
-
onSubmit:
|
|
1812
|
-
},
|
|
2042
|
+
onSubmit: w
|
|
2043
|
+
}, S.id)
|
|
1813
2044
|
]
|
|
1814
2045
|
}) : null
|
|
1815
2046
|
})
|
|
@@ -1817,71 +2048,71 @@ function vt({ steps: e = _t, logo: t, accent: n, onStepSubmit: r, onComplete: i,
|
|
|
1817
2048
|
}
|
|
1818
2049
|
//#endregion
|
|
1819
2050
|
//#region src/components/blocks/auth/passkey-manager-block.tsx
|
|
1820
|
-
var
|
|
1821
|
-
function
|
|
2051
|
+
var dn = 120, fn = "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.";
|
|
2052
|
+
function pn(e) {
|
|
1822
2053
|
if (!e) return null;
|
|
1823
2054
|
let t = new Date(e);
|
|
1824
2055
|
return Number.isNaN(t.getTime()) ? null : t.toLocaleDateString();
|
|
1825
2056
|
}
|
|
1826
|
-
function
|
|
1827
|
-
let [
|
|
1828
|
-
async function
|
|
1829
|
-
if (
|
|
1830
|
-
|
|
2057
|
+
function mn({ 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 }) {
|
|
2058
|
+
let [d, f] = D.useState(null), [p, m] = D.useState(!1), [h, g] = D.useState(!1), [_, v] = D.useState(null), [y, b] = D.useState(""), [x, S] = D.useState(null), [C, w] = D.useState(null), T = n.length === 1;
|
|
2059
|
+
async function E(e) {
|
|
2060
|
+
if (p) return { ok: !1 };
|
|
2061
|
+
f(null), m(!0);
|
|
1831
2062
|
try {
|
|
1832
2063
|
return {
|
|
1833
2064
|
ok: !0,
|
|
1834
2065
|
result: await e()
|
|
1835
2066
|
};
|
|
1836
2067
|
} catch (e) {
|
|
1837
|
-
return
|
|
2068
|
+
return f(e instanceof Error ? e.message : "Something went wrong."), { ok: !1 };
|
|
1838
2069
|
} finally {
|
|
1839
|
-
|
|
2070
|
+
m(!1);
|
|
1840
2071
|
}
|
|
1841
2072
|
}
|
|
1842
2073
|
async function O() {
|
|
1843
|
-
|
|
2074
|
+
g(!0), await E(() => s?.()), g(!1);
|
|
1844
2075
|
}
|
|
1845
2076
|
function k(e) {
|
|
1846
|
-
|
|
2077
|
+
w(null), v(e.id), b(e.name ?? ""), S(null);
|
|
1847
2078
|
}
|
|
1848
2079
|
async function A(e) {
|
|
1849
|
-
let t =
|
|
1850
|
-
if (t.length < 1 || t.length >
|
|
1851
|
-
|
|
2080
|
+
let t = y.trim();
|
|
2081
|
+
if (t.length < 1 || t.length > dn) {
|
|
2082
|
+
S(`Name must be between 1 and ${dn} characters.`);
|
|
1852
2083
|
return;
|
|
1853
2084
|
}
|
|
1854
|
-
(await
|
|
2085
|
+
(await E(() => c?.(e, t))).ok && (v(null), S(null));
|
|
1855
2086
|
}
|
|
1856
2087
|
async function j(e) {
|
|
1857
|
-
let t = await
|
|
1858
|
-
|
|
2088
|
+
let t = await E(() => l?.(e));
|
|
2089
|
+
w(null), t.ok && _ === e && v(null);
|
|
1859
2090
|
}
|
|
1860
|
-
return /* @__PURE__ */
|
|
2091
|
+
return /* @__PURE__ */ i(ge, {
|
|
1861
2092
|
reducedMotion: "user",
|
|
1862
|
-
children: /* @__PURE__ */
|
|
1863
|
-
className:
|
|
2093
|
+
children: /* @__PURE__ */ a(Ie, {
|
|
2094
|
+
className: V("w-full", u),
|
|
1864
2095
|
"data-slot": "auth-block",
|
|
1865
|
-
children: [/* @__PURE__ */
|
|
2096
|
+
children: [/* @__PURE__ */ a(Ue, { children: [/* @__PURE__ */ i(We, { children: e }), /* @__PURE__ */ i(Ge, { children: t })] }), /* @__PURE__ */ i(qe, { children: r ? o ? /* @__PURE__ */ a("div", {
|
|
1866
2097
|
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
1867
|
-
children: [/* @__PURE__ */
|
|
1868
|
-
}) : /* @__PURE__ */
|
|
2098
|
+
children: [/* @__PURE__ */ i(Ee, { className: "size-4" }), "Loading passkeys…"]
|
|
2099
|
+
}) : /* @__PURE__ */ a(B.div, {
|
|
1869
2100
|
layout: !0,
|
|
1870
2101
|
transition: {
|
|
1871
2102
|
duration: .3,
|
|
1872
|
-
ease:
|
|
2103
|
+
ease: K
|
|
1873
2104
|
},
|
|
1874
2105
|
className: "flex flex-col gap-3",
|
|
1875
2106
|
children: [
|
|
1876
|
-
/* @__PURE__ */
|
|
1877
|
-
n.length > 0 ? /* @__PURE__ */
|
|
2107
|
+
/* @__PURE__ */ i(X, { message: d }),
|
|
2108
|
+
n.length > 0 ? /* @__PURE__ */ i("ul", {
|
|
1878
2109
|
"aria-label": "Passkeys",
|
|
1879
2110
|
className: "flex flex-col gap-2",
|
|
1880
|
-
children: /* @__PURE__ */
|
|
2111
|
+
children: /* @__PURE__ */ i(z, {
|
|
1881
2112
|
initial: !1,
|
|
1882
2113
|
children: n.map((e, t) => {
|
|
1883
|
-
let n = e.name ?? "Passkey", r =
|
|
1884
|
-
return /* @__PURE__ */
|
|
2114
|
+
let n = e.name ?? "Passkey", r = pn(e.createdAt), o = pn(e.lastUsedAt);
|
|
2115
|
+
return /* @__PURE__ */ a(B.li, {
|
|
1885
2116
|
layout: !0,
|
|
1886
2117
|
className: "flex flex-col gap-2 rounded-lg border px-3 py-2",
|
|
1887
2118
|
initial: {
|
|
@@ -1898,126 +2129,126 @@ function St({ title: e = "Passkeys", description: t = "Sign in without a passwor
|
|
|
1898
2129
|
},
|
|
1899
2130
|
transition: {
|
|
1900
2131
|
duration: .25,
|
|
1901
|
-
ease:
|
|
2132
|
+
ease: K,
|
|
1902
2133
|
delay: Math.min(t, 5) * .04
|
|
1903
2134
|
},
|
|
1904
2135
|
children: [
|
|
1905
|
-
/* @__PURE__ */
|
|
2136
|
+
/* @__PURE__ */ a("div", {
|
|
1906
2137
|
className: "flex items-center justify-between gap-3",
|
|
1907
|
-
children: [/* @__PURE__ */
|
|
2138
|
+
children: [/* @__PURE__ */ a("div", {
|
|
1908
2139
|
className: "flex min-w-0 flex-col",
|
|
1909
|
-
children: [/* @__PURE__ */
|
|
2140
|
+
children: [/* @__PURE__ */ i("span", {
|
|
1910
2141
|
className: "truncate font-medium text-sm",
|
|
1911
2142
|
children: n
|
|
1912
|
-
}), /* @__PURE__ */
|
|
2143
|
+
}), /* @__PURE__ */ a("span", {
|
|
1913
2144
|
className: "text-xs text-muted-foreground",
|
|
1914
2145
|
children: [
|
|
1915
2146
|
r ? `Added ${r}` : null,
|
|
1916
|
-
r &&
|
|
1917
|
-
|
|
2147
|
+
r && o ? " · " : null,
|
|
2148
|
+
o ? `Last used ${o}` : null
|
|
1918
2149
|
]
|
|
1919
2150
|
})]
|
|
1920
|
-
}), /* @__PURE__ */
|
|
2151
|
+
}), /* @__PURE__ */ a("div", {
|
|
1921
2152
|
className: "flex shrink-0 gap-2",
|
|
1922
|
-
children: [/* @__PURE__ */
|
|
2153
|
+
children: [/* @__PURE__ */ i(H, {
|
|
1923
2154
|
"aria-label": `Rename ${n}`,
|
|
1924
2155
|
size: "sm",
|
|
1925
2156
|
type: "button",
|
|
1926
2157
|
variant: "outline",
|
|
1927
|
-
disabled:
|
|
2158
|
+
disabled: p,
|
|
1928
2159
|
onClick: () => k(e),
|
|
1929
2160
|
children: "Rename"
|
|
1930
|
-
}), /* @__PURE__ */
|
|
2161
|
+
}), /* @__PURE__ */ i(H, {
|
|
1931
2162
|
"aria-label": `Delete ${n}`,
|
|
1932
2163
|
size: "sm",
|
|
1933
2164
|
type: "button",
|
|
1934
2165
|
variant: "destructive-outline",
|
|
1935
|
-
disabled:
|
|
2166
|
+
disabled: p,
|
|
1936
2167
|
onClick: () => {
|
|
1937
|
-
|
|
2168
|
+
v(null), w(e.id);
|
|
1938
2169
|
},
|
|
1939
2170
|
children: "Delete"
|
|
1940
2171
|
})]
|
|
1941
2172
|
})]
|
|
1942
2173
|
}),
|
|
1943
|
-
/* @__PURE__ */
|
|
1944
|
-
show:
|
|
1945
|
-
children: /* @__PURE__ */
|
|
2174
|
+
/* @__PURE__ */ i(Y, {
|
|
2175
|
+
show: _ === e.id,
|
|
2176
|
+
children: /* @__PURE__ */ a("form", {
|
|
1946
2177
|
className: "flex items-start gap-2 pt-1",
|
|
1947
2178
|
onSubmit: (t) => {
|
|
1948
2179
|
t.preventDefault(), A(e.id);
|
|
1949
2180
|
},
|
|
1950
2181
|
children: [
|
|
1951
|
-
/* @__PURE__ */
|
|
2182
|
+
/* @__PURE__ */ a(U, {
|
|
1952
2183
|
className: "min-w-0 grow",
|
|
1953
|
-
invalid: !!
|
|
2184
|
+
invalid: !!x,
|
|
1954
2185
|
children: [
|
|
1955
|
-
/* @__PURE__ */
|
|
2186
|
+
/* @__PURE__ */ i(W, {
|
|
1956
2187
|
className: "sr-only",
|
|
1957
2188
|
children: "Passkey name"
|
|
1958
2189
|
}),
|
|
1959
|
-
/* @__PURE__ */
|
|
2190
|
+
/* @__PURE__ */ i(G, {
|
|
1960
2191
|
"aria-label": "Passkey name",
|
|
1961
|
-
"aria-invalid":
|
|
2192
|
+
"aria-invalid": x ? !0 : void 0,
|
|
1962
2193
|
autoFocus: !0,
|
|
1963
|
-
disabled:
|
|
2194
|
+
disabled: p,
|
|
1964
2195
|
maxLength: 121,
|
|
1965
|
-
value:
|
|
1966
|
-
onChange: (e) =>
|
|
2196
|
+
value: y,
|
|
2197
|
+
onChange: (e) => b(e.target.value)
|
|
1967
2198
|
}),
|
|
1968
|
-
|
|
2199
|
+
x && /* @__PURE__ */ i(tt, {
|
|
1969
2200
|
match: !0,
|
|
1970
|
-
children:
|
|
2201
|
+
children: x
|
|
1971
2202
|
})
|
|
1972
2203
|
]
|
|
1973
2204
|
}),
|
|
1974
|
-
/* @__PURE__ */
|
|
2205
|
+
/* @__PURE__ */ i(H, {
|
|
1975
2206
|
size: "sm",
|
|
1976
2207
|
type: "submit",
|
|
1977
|
-
loading:
|
|
2208
|
+
loading: p,
|
|
1978
2209
|
children: "Save"
|
|
1979
2210
|
}),
|
|
1980
|
-
/* @__PURE__ */
|
|
2211
|
+
/* @__PURE__ */ i(H, {
|
|
1981
2212
|
size: "sm",
|
|
1982
2213
|
type: "button",
|
|
1983
2214
|
variant: "ghost",
|
|
1984
|
-
disabled:
|
|
1985
|
-
onClick: () =>
|
|
2215
|
+
disabled: p,
|
|
2216
|
+
onClick: () => v(null),
|
|
1986
2217
|
children: "Cancel"
|
|
1987
2218
|
})
|
|
1988
2219
|
]
|
|
1989
2220
|
})
|
|
1990
2221
|
}),
|
|
1991
|
-
/* @__PURE__ */
|
|
1992
|
-
show:
|
|
1993
|
-
children: /* @__PURE__ */
|
|
2222
|
+
/* @__PURE__ */ i(Y, {
|
|
2223
|
+
show: C === e.id,
|
|
2224
|
+
children: /* @__PURE__ */ a("div", {
|
|
1994
2225
|
className: "flex flex-col gap-2 rounded-lg bg-muted/50 p-2",
|
|
1995
2226
|
role: "alertdialog",
|
|
1996
2227
|
"aria-label": `Confirm deleting ${n}`,
|
|
1997
2228
|
children: [
|
|
1998
|
-
/* @__PURE__ */
|
|
2229
|
+
/* @__PURE__ */ i("p", {
|
|
1999
2230
|
className: "text-sm",
|
|
2000
2231
|
children: "Delete this passkey? It can no longer be used to sign in."
|
|
2001
2232
|
}),
|
|
2002
|
-
|
|
2233
|
+
T && /* @__PURE__ */ i("p", {
|
|
2003
2234
|
className: "text-xs text-destructive-foreground",
|
|
2004
|
-
children:
|
|
2235
|
+
children: fn
|
|
2005
2236
|
}),
|
|
2006
|
-
/* @__PURE__ */
|
|
2237
|
+
/* @__PURE__ */ a("div", {
|
|
2007
2238
|
className: "flex gap-2",
|
|
2008
|
-
children: [/* @__PURE__ */
|
|
2239
|
+
children: [/* @__PURE__ */ i(H, {
|
|
2009
2240
|
size: "sm",
|
|
2010
2241
|
type: "button",
|
|
2011
2242
|
variant: "destructive",
|
|
2012
|
-
loading:
|
|
2243
|
+
loading: p,
|
|
2013
2244
|
onClick: () => void j(e.id),
|
|
2014
2245
|
children: "Delete passkey"
|
|
2015
|
-
}), /* @__PURE__ */
|
|
2246
|
+
}), /* @__PURE__ */ i(H, {
|
|
2016
2247
|
size: "sm",
|
|
2017
2248
|
type: "button",
|
|
2018
2249
|
variant: "ghost",
|
|
2019
|
-
disabled:
|
|
2020
|
-
onClick: () =>
|
|
2250
|
+
disabled: p,
|
|
2251
|
+
onClick: () => w(null),
|
|
2021
2252
|
children: "Keep it"
|
|
2022
2253
|
})]
|
|
2023
2254
|
})
|
|
@@ -2028,21 +2259,21 @@ function St({ title: e = "Passkeys", description: t = "Sign in without a passwor
|
|
|
2028
2259
|
}, e.id);
|
|
2029
2260
|
})
|
|
2030
2261
|
})
|
|
2031
|
-
}) : /* @__PURE__ */
|
|
2262
|
+
}) : /* @__PURE__ */ i("p", {
|
|
2032
2263
|
className: "text-sm text-muted-foreground",
|
|
2033
2264
|
children: "No passkeys registered yet. Add one to sign in without a password."
|
|
2034
2265
|
}),
|
|
2035
|
-
/* @__PURE__ */
|
|
2266
|
+
/* @__PURE__ */ i(H, {
|
|
2036
2267
|
className: "w-full",
|
|
2037
2268
|
type: "button",
|
|
2038
2269
|
variant: "outline",
|
|
2039
|
-
disabled:
|
|
2040
|
-
loading:
|
|
2270
|
+
disabled: p,
|
|
2271
|
+
loading: h,
|
|
2041
2272
|
onClick: () => void O(),
|
|
2042
2273
|
children: "Add a passkey"
|
|
2043
2274
|
})
|
|
2044
2275
|
]
|
|
2045
|
-
}) : /* @__PURE__ */
|
|
2276
|
+
}) : /* @__PURE__ */ i("p", {
|
|
2046
2277
|
className: "text-sm text-muted-foreground",
|
|
2047
2278
|
children: "Passkeys aren't available on this device. You can manage them from a device that supports passkeys."
|
|
2048
2279
|
}) })]
|
|
@@ -2051,39 +2282,39 @@ function St({ title: e = "Passkeys", description: t = "Sign in without a passwor
|
|
|
2051
2282
|
}
|
|
2052
2283
|
//#endregion
|
|
2053
2284
|
//#region src/components/blocks/auth/passkey-sign-in-block.tsx
|
|
2054
|
-
function
|
|
2055
|
-
let [
|
|
2285
|
+
function hn({ 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 }) {
|
|
2286
|
+
let [s, c] = D.useState(null), [l, u] = D.useState(!1);
|
|
2056
2287
|
if (!e) return null;
|
|
2057
|
-
async function
|
|
2058
|
-
if (!
|
|
2059
|
-
|
|
2288
|
+
async function d() {
|
|
2289
|
+
if (!l) {
|
|
2290
|
+
c(null), u(!0);
|
|
2060
2291
|
try {
|
|
2061
2292
|
await n?.();
|
|
2062
2293
|
} catch (e) {
|
|
2063
|
-
|
|
2294
|
+
c(e instanceof Error ? e.message : "Unable to sign in with a passkey.");
|
|
2064
2295
|
} finally {
|
|
2065
|
-
|
|
2296
|
+
u(!1);
|
|
2066
2297
|
}
|
|
2067
2298
|
}
|
|
2068
2299
|
}
|
|
2069
|
-
return /* @__PURE__ */
|
|
2070
|
-
className:
|
|
2300
|
+
return /* @__PURE__ */ a("div", {
|
|
2301
|
+
className: V("flex w-full flex-col gap-2", o),
|
|
2071
2302
|
children: [
|
|
2072
|
-
/* @__PURE__ */
|
|
2303
|
+
/* @__PURE__ */ a(H, {
|
|
2073
2304
|
variant: "outline",
|
|
2074
2305
|
className: "w-full",
|
|
2075
2306
|
type: "button",
|
|
2076
|
-
loading:
|
|
2077
|
-
onClick: () => void
|
|
2078
|
-
children: [/* @__PURE__ */
|
|
2307
|
+
loading: l,
|
|
2308
|
+
onClick: () => void d(),
|
|
2309
|
+
children: [/* @__PURE__ */ i(g, { "aria-hidden": "true" }), /* @__PURE__ */ i("span", {
|
|
2079
2310
|
className: "flex-1",
|
|
2080
2311
|
children: t
|
|
2081
2312
|
})]
|
|
2082
2313
|
}),
|
|
2083
|
-
/* @__PURE__ */
|
|
2084
|
-
/* @__PURE__ */
|
|
2085
|
-
show: !!
|
|
2086
|
-
children: /* @__PURE__ */
|
|
2314
|
+
/* @__PURE__ */ i(X, { message: s }),
|
|
2315
|
+
/* @__PURE__ */ i(Y, {
|
|
2316
|
+
show: !!s && !!r,
|
|
2317
|
+
children: /* @__PURE__ */ i("p", {
|
|
2087
2318
|
className: "text-xs text-muted-foreground",
|
|
2088
2319
|
children: r
|
|
2089
2320
|
})
|
|
@@ -2093,164 +2324,164 @@ function Ct({ available: e = !0, label: t = "Sign in with a passkey", onSignIn:
|
|
|
2093
2324
|
}
|
|
2094
2325
|
//#endregion
|
|
2095
2326
|
//#region src/components/blocks/auth/signup-block.tsx
|
|
2096
|
-
function
|
|
2327
|
+
function gn({ title: e = "Create your account", description: t = "Start exploring manuscripts in minutes", logo: n, accent: o, providers: s = [
|
|
2097
2328
|
"google",
|
|
2098
2329
|
"apple",
|
|
2099
2330
|
"github"
|
|
2100
|
-
], showNameField:
|
|
2101
|
-
let
|
|
2102
|
-
function
|
|
2103
|
-
|
|
2331
|
+
], 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 }) {
|
|
2332
|
+
let y = D.useId(), b = D.useId(), x = D.useId(), S = D.useId(), [C, w] = D.useState("idle"), [T, E] = D.useState(null), [O, k] = D.useState(null), [A, j] = D.useState(""), [M, N] = D.useState(d), P = u ?? M;
|
|
2333
|
+
function ee(e) {
|
|
2334
|
+
u === void 0 && N(e), f?.(e);
|
|
2104
2335
|
}
|
|
2105
|
-
let [
|
|
2106
|
-
async function
|
|
2107
|
-
if (e.preventDefault(),
|
|
2108
|
-
|
|
2336
|
+
let [F, te] = D.useState(!1), [ne, re] = D.useState(!1), I = C === "loading" || O !== null, ie = !p || Ht(A) === Vt.length, ae = A.trim().length > 0 && ie, oe = (!c || ne) && F && ae;
|
|
2337
|
+
async function se(e) {
|
|
2338
|
+
if (e.preventDefault(), E(null), !ie) {
|
|
2339
|
+
E("Please meet all password requirements.");
|
|
2109
2340
|
return;
|
|
2110
2341
|
}
|
|
2111
|
-
if (
|
|
2112
|
-
|
|
2342
|
+
if (l && !P) {
|
|
2343
|
+
E("Please accept the terms to continue.");
|
|
2113
2344
|
return;
|
|
2114
2345
|
}
|
|
2115
2346
|
let t = new FormData(e.currentTarget);
|
|
2116
|
-
|
|
2347
|
+
w("loading");
|
|
2117
2348
|
try {
|
|
2118
|
-
await
|
|
2349
|
+
await m?.({
|
|
2119
2350
|
name: String(t.get("name") ?? ""),
|
|
2120
2351
|
email: String(t.get("email") ?? ""),
|
|
2121
2352
|
password: A
|
|
2122
|
-
}),
|
|
2353
|
+
}), w("success");
|
|
2123
2354
|
} catch (e) {
|
|
2124
|
-
|
|
2355
|
+
w("idle"), E(e instanceof Error ? e.message : "Unable to create account.");
|
|
2125
2356
|
}
|
|
2126
2357
|
}
|
|
2127
|
-
async function
|
|
2128
|
-
|
|
2358
|
+
async function ce(e) {
|
|
2359
|
+
E(null), k(e);
|
|
2129
2360
|
try {
|
|
2130
|
-
await
|
|
2361
|
+
await g?.(e), w("success");
|
|
2131
2362
|
} catch (e) {
|
|
2132
|
-
|
|
2363
|
+
E(e instanceof Error ? e.message : "Unable to create account.");
|
|
2133
2364
|
} finally {
|
|
2134
2365
|
k(null);
|
|
2135
2366
|
}
|
|
2136
2367
|
}
|
|
2137
|
-
return /* @__PURE__ */
|
|
2368
|
+
return /* @__PURE__ */ i(q, {
|
|
2138
2369
|
title: e,
|
|
2139
2370
|
description: t,
|
|
2140
2371
|
logo: n,
|
|
2141
|
-
accent:
|
|
2142
|
-
footer:
|
|
2372
|
+
accent: o,
|
|
2373
|
+
footer: C !== "success" && /* @__PURE__ */ a(r, { children: [
|
|
2143
2374
|
"Already have an account?",
|
|
2144
2375
|
" ",
|
|
2145
|
-
/* @__PURE__ */
|
|
2376
|
+
/* @__PURE__ */ i(H, {
|
|
2146
2377
|
variant: "link",
|
|
2147
|
-
onClick:
|
|
2378
|
+
onClick: _,
|
|
2148
2379
|
children: "Login"
|
|
2149
2380
|
})
|
|
2150
2381
|
] }),
|
|
2151
|
-
children: /* @__PURE__ */
|
|
2152
|
-
step:
|
|
2153
|
-
children:
|
|
2382
|
+
children: /* @__PURE__ */ i(J, {
|
|
2383
|
+
step: C === "success" ? "success" : "form",
|
|
2384
|
+
children: C === "success" ? /* @__PURE__ */ i(Z, {
|
|
2154
2385
|
title: "Account created",
|
|
2155
2386
|
description: "Check your inbox to confirm your email address."
|
|
2156
|
-
}) : /* @__PURE__ */
|
|
2387
|
+
}) : /* @__PURE__ */ a("div", {
|
|
2157
2388
|
className: "flex flex-col gap-4",
|
|
2158
|
-
children: [
|
|
2159
|
-
show: !
|
|
2389
|
+
children: [s.length > 0 && /* @__PURE__ */ a(Y, {
|
|
2390
|
+
show: !oe,
|
|
2160
2391
|
className: "flex flex-col gap-4",
|
|
2161
|
-
children: [/* @__PURE__ */
|
|
2162
|
-
providers:
|
|
2392
|
+
children: [/* @__PURE__ */ i(qt, {
|
|
2393
|
+
providers: s,
|
|
2163
2394
|
action: "signup",
|
|
2164
2395
|
loadingProvider: O,
|
|
2165
|
-
disabled:
|
|
2166
|
-
onSelect:
|
|
2167
|
-
}), /* @__PURE__ */
|
|
2168
|
-
}), /* @__PURE__ */
|
|
2396
|
+
disabled: C === "loading",
|
|
2397
|
+
onSelect: ce
|
|
2398
|
+
}), /* @__PURE__ */ i(Qt, { label: "Or with email" })]
|
|
2399
|
+
}), /* @__PURE__ */ a("form", {
|
|
2169
2400
|
className: "flex flex-col gap-4",
|
|
2170
|
-
onSubmit:
|
|
2401
|
+
onSubmit: se,
|
|
2171
2402
|
children: [
|
|
2172
|
-
|
|
2403
|
+
c && /* @__PURE__ */ a(U, {
|
|
2173
2404
|
name: "name",
|
|
2174
|
-
children: [/* @__PURE__ */
|
|
2175
|
-
htmlFor:
|
|
2405
|
+
children: [/* @__PURE__ */ i(W, {
|
|
2406
|
+
htmlFor: y,
|
|
2176
2407
|
children: "Name"
|
|
2177
|
-
}), /* @__PURE__ */
|
|
2408
|
+
}), /* @__PURE__ */ i(G, {
|
|
2178
2409
|
"aria-label": "Name",
|
|
2179
|
-
id:
|
|
2410
|
+
id: y,
|
|
2180
2411
|
name: "name",
|
|
2181
2412
|
autoComplete: "name",
|
|
2182
2413
|
placeholder: "Your name",
|
|
2183
2414
|
required: !0,
|
|
2184
|
-
disabled:
|
|
2185
|
-
onChange: (e) =>
|
|
2415
|
+
disabled: I,
|
|
2416
|
+
onChange: (e) => re(e.currentTarget.validity.valid)
|
|
2186
2417
|
})]
|
|
2187
2418
|
}),
|
|
2188
|
-
/* @__PURE__ */
|
|
2419
|
+
/* @__PURE__ */ a(U, {
|
|
2189
2420
|
name: "email",
|
|
2190
|
-
children: [/* @__PURE__ */
|
|
2191
|
-
htmlFor:
|
|
2421
|
+
children: [/* @__PURE__ */ i(W, {
|
|
2422
|
+
htmlFor: b,
|
|
2192
2423
|
children: "Email"
|
|
2193
|
-
}), /* @__PURE__ */
|
|
2194
|
-
id:
|
|
2424
|
+
}), /* @__PURE__ */ i(G, {
|
|
2425
|
+
id: b,
|
|
2195
2426
|
name: "email",
|
|
2196
2427
|
type: "email",
|
|
2197
2428
|
"aria-label": "Email",
|
|
2198
2429
|
autoComplete: "email",
|
|
2199
2430
|
placeholder: "you@example.com",
|
|
2200
2431
|
required: !0,
|
|
2201
|
-
disabled:
|
|
2202
|
-
onChange: (e) =>
|
|
2432
|
+
disabled: I,
|
|
2433
|
+
onChange: (e) => te(e.currentTarget.validity.valid)
|
|
2203
2434
|
})]
|
|
2204
2435
|
}),
|
|
2205
|
-
/* @__PURE__ */
|
|
2206
|
-
show:
|
|
2207
|
-
children: /* @__PURE__ */
|
|
2436
|
+
/* @__PURE__ */ i(Y, {
|
|
2437
|
+
show: F,
|
|
2438
|
+
children: /* @__PURE__ */ a(U, {
|
|
2208
2439
|
name: "password",
|
|
2209
|
-
children: [/* @__PURE__ */
|
|
2210
|
-
htmlFor:
|
|
2440
|
+
children: [/* @__PURE__ */ i(W, {
|
|
2441
|
+
htmlFor: x,
|
|
2211
2442
|
children: "Password"
|
|
2212
|
-
}), /* @__PURE__ */
|
|
2213
|
-
id:
|
|
2443
|
+
}), /* @__PURE__ */ i(Wt, {
|
|
2444
|
+
id: x,
|
|
2214
2445
|
name: "password",
|
|
2215
2446
|
"aria-label": "Password",
|
|
2216
2447
|
autoComplete: "new-password",
|
|
2217
2448
|
placeholder: "Create a password",
|
|
2218
2449
|
showStrength: !0,
|
|
2219
2450
|
required: !0,
|
|
2220
|
-
disabled:
|
|
2451
|
+
disabled: I,
|
|
2221
2452
|
value: A,
|
|
2222
2453
|
onChange: (e) => j(e.target.value)
|
|
2223
2454
|
})]
|
|
2224
2455
|
})
|
|
2225
2456
|
}),
|
|
2226
|
-
|
|
2457
|
+
l && /* @__PURE__ */ a("div", {
|
|
2227
2458
|
className: "flex items-center gap-2",
|
|
2228
|
-
children: [/* @__PURE__ */
|
|
2229
|
-
id:
|
|
2230
|
-
checked:
|
|
2231
|
-
onCheckedChange: (e) =>
|
|
2232
|
-
disabled:
|
|
2233
|
-
}), /* @__PURE__ */
|
|
2234
|
-
htmlFor:
|
|
2459
|
+
children: [/* @__PURE__ */ i(Qe, {
|
|
2460
|
+
id: S,
|
|
2461
|
+
checked: P,
|
|
2462
|
+
onCheckedChange: (e) => ee(e === !0),
|
|
2463
|
+
disabled: I
|
|
2464
|
+
}), /* @__PURE__ */ a(_t, {
|
|
2465
|
+
htmlFor: S,
|
|
2235
2466
|
className: "font-normal",
|
|
2236
2467
|
children: [
|
|
2237
2468
|
"I agree to the",
|
|
2238
2469
|
" ",
|
|
2239
|
-
|
|
2470
|
+
h ?? /* @__PURE__ */ i(H, {
|
|
2240
2471
|
variant: "link",
|
|
2241
2472
|
type: "button",
|
|
2242
|
-
onClick:
|
|
2473
|
+
onClick: v,
|
|
2243
2474
|
children: "terms"
|
|
2244
2475
|
})
|
|
2245
2476
|
]
|
|
2246
2477
|
})]
|
|
2247
2478
|
}),
|
|
2248
|
-
/* @__PURE__ */
|
|
2249
|
-
/* @__PURE__ */
|
|
2250
|
-
className:
|
|
2479
|
+
/* @__PURE__ */ i(X, { message: T }),
|
|
2480
|
+
/* @__PURE__ */ i(H, {
|
|
2481
|
+
className: V("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)]"),
|
|
2251
2482
|
type: "submit",
|
|
2252
|
-
loading:
|
|
2253
|
-
disabled:
|
|
2483
|
+
loading: C === "loading",
|
|
2484
|
+
disabled: I,
|
|
2254
2485
|
children: "Create account"
|
|
2255
2486
|
})
|
|
2256
2487
|
]
|
|
@@ -2261,78 +2492,78 @@ function wt({ title: e = "Create your account", description: t = "Start explorin
|
|
|
2261
2492
|
}
|
|
2262
2493
|
//#endregion
|
|
2263
2494
|
//#region src/components/blocks/auth/update-password-block.tsx
|
|
2264
|
-
function
|
|
2265
|
-
let
|
|
2266
|
-
async function
|
|
2267
|
-
if (e.preventDefault(),
|
|
2268
|
-
|
|
2495
|
+
function _n({ 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 }) {
|
|
2496
|
+
let l = D.useId(), u = D.useId(), [d, f] = D.useState("idle"), [p, m] = D.useState(null), [h, g] = D.useState(""), [_, v] = D.useState(""), y = Ht(h) >= o, b = _.length > 0 && _ === h, x = y && b, S = _.length > 0 && !h.startsWith(_);
|
|
2497
|
+
async function C(e) {
|
|
2498
|
+
if (e.preventDefault(), x) {
|
|
2499
|
+
m(null), f("loading");
|
|
2269
2500
|
try {
|
|
2270
|
-
await
|
|
2501
|
+
await s?.({ password: h }), f("success");
|
|
2271
2502
|
} catch (e) {
|
|
2272
|
-
|
|
2503
|
+
f("idle"), m(e instanceof Error ? e.message : "Unable to update password.");
|
|
2273
2504
|
}
|
|
2274
2505
|
}
|
|
2275
2506
|
}
|
|
2276
|
-
return /* @__PURE__ */
|
|
2507
|
+
return /* @__PURE__ */ i(q, {
|
|
2277
2508
|
title: e,
|
|
2278
2509
|
description: t,
|
|
2279
2510
|
logo: n,
|
|
2280
2511
|
accent: r,
|
|
2281
|
-
children: /* @__PURE__ */
|
|
2282
|
-
step:
|
|
2283
|
-
children:
|
|
2512
|
+
children: /* @__PURE__ */ i(J, {
|
|
2513
|
+
step: d === "success" ? "success" : "form",
|
|
2514
|
+
children: d === "success" ? /* @__PURE__ */ i(Z, {
|
|
2284
2515
|
title: "Password updated",
|
|
2285
2516
|
description: "Your password has been changed successfully.",
|
|
2286
|
-
children:
|
|
2517
|
+
children: c && /* @__PURE__ */ i(H, {
|
|
2287
2518
|
variant: "link",
|
|
2288
|
-
onClick:
|
|
2519
|
+
onClick: c,
|
|
2289
2520
|
children: "Continue"
|
|
2290
2521
|
})
|
|
2291
|
-
}) : /* @__PURE__ */
|
|
2522
|
+
}) : /* @__PURE__ */ a("form", {
|
|
2292
2523
|
className: "flex flex-col gap-4",
|
|
2293
|
-
onSubmit:
|
|
2524
|
+
onSubmit: C,
|
|
2294
2525
|
children: [
|
|
2295
|
-
/* @__PURE__ */
|
|
2526
|
+
/* @__PURE__ */ a(U, {
|
|
2296
2527
|
name: "password",
|
|
2297
|
-
children: [/* @__PURE__ */
|
|
2298
|
-
htmlFor:
|
|
2528
|
+
children: [/* @__PURE__ */ i(W, {
|
|
2529
|
+
htmlFor: l,
|
|
2299
2530
|
children: "New password"
|
|
2300
|
-
}), /* @__PURE__ */
|
|
2301
|
-
id:
|
|
2531
|
+
}), /* @__PURE__ */ i(Wt, {
|
|
2532
|
+
id: l,
|
|
2302
2533
|
name: "password",
|
|
2303
2534
|
autoComplete: "new-password",
|
|
2304
2535
|
required: !0,
|
|
2305
2536
|
showStrength: !0,
|
|
2306
|
-
disabled:
|
|
2307
|
-
value:
|
|
2308
|
-
onChange: (e) =>
|
|
2537
|
+
disabled: d === "loading",
|
|
2538
|
+
value: h,
|
|
2539
|
+
onChange: (e) => g(e.target.value)
|
|
2309
2540
|
})]
|
|
2310
2541
|
}),
|
|
2311
|
-
/* @__PURE__ */
|
|
2312
|
-
show:
|
|
2313
|
-
children: /* @__PURE__ */
|
|
2542
|
+
/* @__PURE__ */ i(Y, {
|
|
2543
|
+
show: y,
|
|
2544
|
+
children: /* @__PURE__ */ a(U, {
|
|
2314
2545
|
name: "confirmPassword",
|
|
2315
|
-
children: [/* @__PURE__ */
|
|
2316
|
-
htmlFor:
|
|
2546
|
+
children: [/* @__PURE__ */ i(W, {
|
|
2547
|
+
htmlFor: u,
|
|
2317
2548
|
children: "Confirm new password"
|
|
2318
|
-
}), /* @__PURE__ */
|
|
2319
|
-
id:
|
|
2549
|
+
}), /* @__PURE__ */ i(Wt, {
|
|
2550
|
+
id: u,
|
|
2320
2551
|
name: "confirmPassword",
|
|
2321
2552
|
autoComplete: "new-password",
|
|
2322
2553
|
required: !0,
|
|
2323
|
-
disabled:
|
|
2324
|
-
value:
|
|
2325
|
-
onChange: (e) =>
|
|
2554
|
+
disabled: d === "loading",
|
|
2555
|
+
value: _,
|
|
2556
|
+
onChange: (e) => v(e.target.value)
|
|
2326
2557
|
})]
|
|
2327
2558
|
})
|
|
2328
2559
|
}),
|
|
2329
|
-
/* @__PURE__ */
|
|
2330
|
-
/* @__PURE__ */
|
|
2331
|
-
show:
|
|
2332
|
-
children: /* @__PURE__ */
|
|
2333
|
-
className:
|
|
2560
|
+
/* @__PURE__ */ i(X, { message: p ?? (S ? "Passwords do not match." : null) }),
|
|
2561
|
+
/* @__PURE__ */ i(Y, {
|
|
2562
|
+
show: x,
|
|
2563
|
+
children: /* @__PURE__ */ i(H, {
|
|
2564
|
+
className: V("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)]"),
|
|
2334
2565
|
type: "submit",
|
|
2335
|
-
loading:
|
|
2566
|
+
loading: d === "loading",
|
|
2336
2567
|
children: "Update password"
|
|
2337
2568
|
})
|
|
2338
2569
|
})
|
|
@@ -2342,6 +2573,807 @@ function Tt({ title: e = "Update your password", description: t = "Choose a new
|
|
|
2342
2573
|
});
|
|
2343
2574
|
}
|
|
2344
2575
|
//#endregion
|
|
2345
|
-
|
|
2576
|
+
//#region src/lib/ease.ts
|
|
2577
|
+
var Q = [
|
|
2578
|
+
.16,
|
|
2579
|
+
1,
|
|
2580
|
+
.3,
|
|
2581
|
+
1
|
|
2582
|
+
], vn = [
|
|
2583
|
+
.77,
|
|
2584
|
+
0,
|
|
2585
|
+
.175,
|
|
2586
|
+
1
|
|
2587
|
+
], yn = [
|
|
2588
|
+
.32,
|
|
2589
|
+
.72,
|
|
2590
|
+
0,
|
|
2591
|
+
1
|
|
2592
|
+
], bn = "cubic-bezier(0.16, 1, 0.3, 1)", xn = {
|
|
2593
|
+
type: "spring",
|
|
2594
|
+
stiffness: 500,
|
|
2595
|
+
damping: 30,
|
|
2596
|
+
mass: .6
|
|
2597
|
+
}, Sn = {
|
|
2598
|
+
type: "spring",
|
|
2599
|
+
stiffness: 460,
|
|
2600
|
+
damping: 30,
|
|
2601
|
+
mass: .55
|
|
2602
|
+
}, Cn = {
|
|
2603
|
+
type: "spring",
|
|
2604
|
+
stiffness: 420,
|
|
2605
|
+
damping: 40,
|
|
2606
|
+
mass: .5
|
|
2607
|
+
}, wn = {
|
|
2608
|
+
type: "spring",
|
|
2609
|
+
stiffness: 360,
|
|
2610
|
+
damping: 32,
|
|
2611
|
+
mass: .6
|
|
2612
|
+
}, Tn = {
|
|
2613
|
+
stiffness: 200,
|
|
2614
|
+
damping: 15,
|
|
2615
|
+
mass: .3
|
|
2616
|
+
}, En = {
|
|
2617
|
+
stiffness: 700,
|
|
2618
|
+
damping: 50,
|
|
2619
|
+
mass: .5
|
|
2620
|
+
}, Dn = {
|
|
2621
|
+
initial: {
|
|
2622
|
+
opacity: 0,
|
|
2623
|
+
filter: "blur(6px)"
|
|
2624
|
+
},
|
|
2625
|
+
animate: {
|
|
2626
|
+
opacity: 1,
|
|
2627
|
+
filter: "blur(0px)"
|
|
2628
|
+
},
|
|
2629
|
+
exit: (e) => e ? {} : {
|
|
2630
|
+
opacity: 0,
|
|
2631
|
+
filter: "blur(6px)"
|
|
2632
|
+
}
|
|
2633
|
+
}, On = {
|
|
2634
|
+
initial: { opacity: 0 },
|
|
2635
|
+
animate: { opacity: 1 },
|
|
2636
|
+
exit: (e) => e ? {} : { opacity: 0 }
|
|
2637
|
+
}, kn = M(function({ children: e, as: t = "div", className: n, onMouseLeave: o, pillClassName: s, pillContainerClassName: c, inset: l = 20, ...u }, d) {
|
|
2638
|
+
let [f, p] = I(null), m = te(), h = _e(), g = O.toArray(e).filter(N).map((e, t) => {
|
|
2639
|
+
let n = e, o = n.key ? String(n.key) : `item-${t}`;
|
|
2640
|
+
return k(n, {
|
|
2641
|
+
key: o,
|
|
2642
|
+
className: V("relative", n.props.className),
|
|
2643
|
+
onMouseEnter: () => {
|
|
2644
|
+
n.props.onMouseEnter?.(), p(o);
|
|
2645
|
+
}
|
|
2646
|
+
}, /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i(z, {
|
|
2647
|
+
custom: f !== null,
|
|
2648
|
+
children: f === null ? null : /* @__PURE__ */ i(B.div, {
|
|
2649
|
+
variants: h ? On : Dn,
|
|
2650
|
+
initial: "initial",
|
|
2651
|
+
animate: "animate",
|
|
2652
|
+
exit: "exit",
|
|
2653
|
+
custom: f !== null,
|
|
2654
|
+
className: V("pointer-events-none absolute inset-y-0", c),
|
|
2655
|
+
style: {
|
|
2656
|
+
left: -l,
|
|
2657
|
+
right: -l
|
|
2658
|
+
},
|
|
2659
|
+
children: f === o ? /* @__PURE__ */ i(B.div, {
|
|
2660
|
+
layoutId: `shared-bg-${m}`,
|
|
2661
|
+
transition: h ? { duration: 0 } : wn,
|
|
2662
|
+
className: V("pointer-events-none h-full w-full rounded-2xl bg-primary/[0.06]", s)
|
|
2663
|
+
}) : null
|
|
2664
|
+
})
|
|
2665
|
+
}), /* @__PURE__ */ i("div", {
|
|
2666
|
+
className: "relative z-10",
|
|
2667
|
+
children: n.props.children
|
|
2668
|
+
})] }));
|
|
2669
|
+
}), _ = (e) => {
|
|
2670
|
+
p(null), o?.(e);
|
|
2671
|
+
};
|
|
2672
|
+
return i(t === "ul" ? B.ul : B.div, {
|
|
2673
|
+
...u,
|
|
2674
|
+
ref: d,
|
|
2675
|
+
layoutRoot: !0,
|
|
2676
|
+
onMouseLeave: _,
|
|
2677
|
+
className: V("flex w-full flex-col", n),
|
|
2678
|
+
children: g
|
|
2679
|
+
});
|
|
2680
|
+
}), An = "(max-width: 767px)", jn = "b", Mn = {
|
|
2681
|
+
duration: .36,
|
|
2682
|
+
ease: yn
|
|
2683
|
+
}, Nn = {
|
|
2684
|
+
type: "spring",
|
|
2685
|
+
stiffness: 380,
|
|
2686
|
+
damping: 35,
|
|
2687
|
+
mass: .75
|
|
2688
|
+
}, Pn = {
|
|
2689
|
+
duration: .2,
|
|
2690
|
+
delay: .08,
|
|
2691
|
+
ease: Q
|
|
2692
|
+
}, Fn = {
|
|
2693
|
+
duration: .12,
|
|
2694
|
+
ease: Q
|
|
2695
|
+
}, In = {
|
|
2696
|
+
duration: .18,
|
|
2697
|
+
ease: Q
|
|
2698
|
+
}, Ln = {
|
|
2699
|
+
closed: {
|
|
2700
|
+
opacity: 0,
|
|
2701
|
+
clipPath: "inset(0 0 100% 0 round 8px)",
|
|
2702
|
+
transition: {
|
|
2703
|
+
duration: .14,
|
|
2704
|
+
ease: Q,
|
|
2705
|
+
staggerChildren: .025,
|
|
2706
|
+
staggerDirection: -1
|
|
2707
|
+
}
|
|
2708
|
+
},
|
|
2709
|
+
open: {
|
|
2710
|
+
opacity: 1,
|
|
2711
|
+
clipPath: "inset(0 0 0% 0 round 8px)",
|
|
2712
|
+
transition: {
|
|
2713
|
+
duration: .2,
|
|
2714
|
+
delayChildren: .035,
|
|
2715
|
+
ease: Q,
|
|
2716
|
+
staggerChildren: .045
|
|
2717
|
+
}
|
|
2718
|
+
}
|
|
2719
|
+
}, Rn = {
|
|
2720
|
+
closed: {
|
|
2721
|
+
opacity: 0,
|
|
2722
|
+
y: -6,
|
|
2723
|
+
filter: "blur(3px)"
|
|
2724
|
+
},
|
|
2725
|
+
open: {
|
|
2726
|
+
opacity: 1,
|
|
2727
|
+
y: 0,
|
|
2728
|
+
filter: "blur(0px)",
|
|
2729
|
+
transition: In
|
|
2730
|
+
}
|
|
2731
|
+
}, zn = {
|
|
2732
|
+
duration: .16,
|
|
2733
|
+
ease: Q
|
|
2734
|
+
}, Bn = [
|
|
2735
|
+
"a[href]",
|
|
2736
|
+
"button:not([disabled])",
|
|
2737
|
+
"input:not([disabled])",
|
|
2738
|
+
"select:not([disabled])",
|
|
2739
|
+
"textarea:not([disabled])",
|
|
2740
|
+
"[tabindex]:not([tabindex='-1'])"
|
|
2741
|
+
].join(",");
|
|
2742
|
+
function Vn(e) {
|
|
2743
|
+
let t = window.matchMedia(An);
|
|
2744
|
+
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
2745
|
+
}
|
|
2746
|
+
function Hn() {
|
|
2747
|
+
return window.matchMedia(An).matches;
|
|
2748
|
+
}
|
|
2749
|
+
function Un() {
|
|
2750
|
+
return !1;
|
|
2751
|
+
}
|
|
2752
|
+
function Wn() {
|
|
2753
|
+
return ie(Vn, Hn, Un);
|
|
2754
|
+
}
|
|
2755
|
+
var Gn = A(null), Kn = A(null);
|
|
2756
|
+
function $() {
|
|
2757
|
+
let e = ee(Gn);
|
|
2758
|
+
if (!e) throw Error("useAnimatedSidebar must be used inside AnimatedSidebarProvider.");
|
|
2759
|
+
return e;
|
|
2760
|
+
}
|
|
2761
|
+
function qn() {
|
|
2762
|
+
let e = ee(Kn);
|
|
2763
|
+
if (!e) throw Error("Animated Sidebar parts must be used inside AnimatedSidebar.");
|
|
2764
|
+
return e;
|
|
2765
|
+
}
|
|
2766
|
+
function Jn({ children: e, open: t, defaultOpen: n = !0, onOpenChange: r, openMobile: a, defaultOpenMobile: o = !1, onOpenMobileChange: s, className: c, style: l, ...u }) {
|
|
2767
|
+
let [d, f] = I(n), [p, m] = I(o), h = Wn(), g = _e() ?? !1, _ = te(), v = re(null), y = t ?? d, b = a ?? p, x = P((e) => {
|
|
2768
|
+
t === void 0 && f(e), r?.(e);
|
|
2769
|
+
}, [r, t]), S = P((e) => {
|
|
2770
|
+
a === void 0 && m(e), s?.(e);
|
|
2771
|
+
}, [s, a]), C = P(() => {
|
|
2772
|
+
h ? S(!b) : x(!y);
|
|
2773
|
+
}, [
|
|
2774
|
+
y,
|
|
2775
|
+
h,
|
|
2776
|
+
b,
|
|
2777
|
+
x,
|
|
2778
|
+
S
|
|
2779
|
+
]);
|
|
2780
|
+
return F(() => {
|
|
2781
|
+
let e = (e) => {
|
|
2782
|
+
e.key.toLowerCase() === jn && (e.metaKey || e.ctrlKey) && (e.preventDefault(), C());
|
|
2783
|
+
};
|
|
2784
|
+
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
2785
|
+
}, [C]), /* @__PURE__ */ i(Gn.Provider, {
|
|
2786
|
+
value: {
|
|
2787
|
+
isMobile: h,
|
|
2788
|
+
layoutId: `${_}-active`,
|
|
2789
|
+
open: y,
|
|
2790
|
+
openMobile: b,
|
|
2791
|
+
reduce: g,
|
|
2792
|
+
setOpen: x,
|
|
2793
|
+
setOpenMobile: S,
|
|
2794
|
+
state: y ? "expanded" : "collapsed",
|
|
2795
|
+
toggleSidebar: C,
|
|
2796
|
+
triggerRef: v
|
|
2797
|
+
},
|
|
2798
|
+
children: /* @__PURE__ */ i("div", {
|
|
2799
|
+
...u,
|
|
2800
|
+
"data-slot": "sidebar-wrapper",
|
|
2801
|
+
"data-state": y ? "expanded" : "collapsed",
|
|
2802
|
+
style: {
|
|
2803
|
+
"--sidebar-width": "16rem",
|
|
2804
|
+
"--sidebar-width-icon": "4.25rem",
|
|
2805
|
+
"--sidebar-width-mobile": "18rem",
|
|
2806
|
+
...l
|
|
2807
|
+
},
|
|
2808
|
+
className: V("group/sidebar-wrapper flex min-h-svh w-full min-w-0", c),
|
|
2809
|
+
children: e
|
|
2810
|
+
})
|
|
2811
|
+
});
|
|
2812
|
+
}
|
|
2813
|
+
function Yn({ ariaLabel: e, children: t, className: n, side: r }) {
|
|
2814
|
+
let o = $(), s = re(null), [c, l] = I(!1);
|
|
2815
|
+
return F(() => l(!0), []), F(() => {
|
|
2816
|
+
if (!o.openMobile) return;
|
|
2817
|
+
let e = document.body, t = window.scrollY, n = {
|
|
2818
|
+
left: e.style.left,
|
|
2819
|
+
overflow: e.style.overflow,
|
|
2820
|
+
position: e.style.position,
|
|
2821
|
+
right: e.style.right,
|
|
2822
|
+
top: e.style.top
|
|
2823
|
+
};
|
|
2824
|
+
e.style.position = "fixed", e.style.top = `-${t}px`, e.style.left = "0", e.style.right = "0", e.style.overflow = "hidden";
|
|
2825
|
+
let r = requestAnimationFrame(() => {
|
|
2826
|
+
(s.current?.querySelector(Bn) ?? s.current)?.focus({ preventScroll: !0 });
|
|
2827
|
+
});
|
|
2828
|
+
return () => {
|
|
2829
|
+
cancelAnimationFrame(r), e.style.position = n.position, e.style.top = n.top, e.style.left = n.left, e.style.right = n.right, e.style.overflow = n.overflow, window.scrollTo(0, t), o.triggerRef.current?.focus({ preventScroll: !0 });
|
|
2830
|
+
};
|
|
2831
|
+
}, [o.openMobile, o.triggerRef]), c ? Se(/* @__PURE__ */ a("div", {
|
|
2832
|
+
className: V("pointer-events-none fixed inset-0 z-50 md:hidden", o.openMobile ? "visible" : "invisible"),
|
|
2833
|
+
children: [/* @__PURE__ */ i(B.button, {
|
|
2834
|
+
type: "button",
|
|
2835
|
+
"aria-label": "Close sidebar",
|
|
2836
|
+
tabIndex: o.openMobile ? 0 : -1,
|
|
2837
|
+
initial: !1,
|
|
2838
|
+
animate: { opacity: +!!o.openMobile },
|
|
2839
|
+
transition: o.reduce ? zn : Mn,
|
|
2840
|
+
onClick: () => o.setOpenMobile(!1),
|
|
2841
|
+
className: V("absolute inset-0 bg-black/40", o.openMobile ? "pointer-events-auto" : "pointer-events-none")
|
|
2842
|
+
}), /* @__PURE__ */ i(B.div, {
|
|
2843
|
+
ref: s,
|
|
2844
|
+
role: "dialog",
|
|
2845
|
+
"aria-modal": "true",
|
|
2846
|
+
"aria-label": e,
|
|
2847
|
+
"aria-hidden": !o.openMobile,
|
|
2848
|
+
inert: !o.openMobile,
|
|
2849
|
+
tabIndex: -1,
|
|
2850
|
+
"data-mobile": "true",
|
|
2851
|
+
"data-state": o.openMobile ? "expanded" : "collapsed",
|
|
2852
|
+
"data-side": r,
|
|
2853
|
+
initial: !1,
|
|
2854
|
+
animate: {
|
|
2855
|
+
opacity: o.reduce ? +!!o.openMobile : 1,
|
|
2856
|
+
x: o.reduce ? 0 : o.openMobile ? "0%" : r === "left" ? "-100%" : "100%"
|
|
2857
|
+
},
|
|
2858
|
+
transition: o.reduce ? zn : Mn,
|
|
2859
|
+
onKeyDown: (e) => {
|
|
2860
|
+
if (e.key === "Escape") {
|
|
2861
|
+
e.preventDefault(), o.setOpenMobile(!1);
|
|
2862
|
+
return;
|
|
2863
|
+
}
|
|
2864
|
+
if (e.key !== "Tab") return;
|
|
2865
|
+
let t = s.current ? Array.from(s.current.querySelectorAll(Bn)) : [];
|
|
2866
|
+
if (t.length === 0) {
|
|
2867
|
+
e.preventDefault(), s.current?.focus();
|
|
2868
|
+
return;
|
|
2869
|
+
}
|
|
2870
|
+
let n = t[0], r = t[t.length - 1];
|
|
2871
|
+
e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
|
|
2872
|
+
},
|
|
2873
|
+
className: V("pointer-events-auto absolute inset-y-0 flex h-dvh w-(--sidebar-width-mobile) max-w-[88vw] flex-col overflow-hidden", "border-border bg-background shadow-2xl will-change-transform", r === "left" ? "left-0 border-r" : "right-0 border-l", !o.openMobile && "pointer-events-none", n),
|
|
2874
|
+
children: /* @__PURE__ */ i(Kn.Provider, {
|
|
2875
|
+
value: {
|
|
2876
|
+
collapsed: !1,
|
|
2877
|
+
collapsible: "none",
|
|
2878
|
+
side: r
|
|
2879
|
+
},
|
|
2880
|
+
children: t
|
|
2881
|
+
})
|
|
2882
|
+
})]
|
|
2883
|
+
}), document.body) : null;
|
|
2884
|
+
}
|
|
2885
|
+
var Xn = M(function({ side: e = "left", variant: t = "sidebar", collapsible: n = "icon", ariaLabel: r = "Sidebar", children: a, className: o, panelClassName: s, style: c, ...l }, u) {
|
|
2886
|
+
let d = $(), f = n !== "none" && !d.open, p = f && n === "offcanvas", m = p ? "0px" : f ? "var(--sidebar-width-icon)" : "var(--sidebar-width)";
|
|
2887
|
+
return d.isMobile ? /* @__PURE__ */ i(Yn, {
|
|
2888
|
+
ariaLabel: r,
|
|
2889
|
+
className: o,
|
|
2890
|
+
side: e,
|
|
2891
|
+
children: a
|
|
2892
|
+
}) : /* @__PURE__ */ i(B.aside, {
|
|
2893
|
+
...l,
|
|
2894
|
+
ref: u,
|
|
2895
|
+
initial: !1,
|
|
2896
|
+
"aria-label": r,
|
|
2897
|
+
"data-slot": "sidebar",
|
|
2898
|
+
"data-state": f ? "collapsed" : "expanded",
|
|
2899
|
+
"data-collapsible": n,
|
|
2900
|
+
"data-variant": t,
|
|
2901
|
+
"data-side": e,
|
|
2902
|
+
animate: { width: m },
|
|
2903
|
+
transition: d.reduce ? { duration: 0 } : Nn,
|
|
2904
|
+
style: c,
|
|
2905
|
+
className: V("group/sidebar relative hidden h-auto shrink-0 md:block will-change-[width]", "peer", e === "right" && "order-last", o),
|
|
2906
|
+
children: /* @__PURE__ */ i(B.div, {
|
|
2907
|
+
initial: !1,
|
|
2908
|
+
animate: {
|
|
2909
|
+
opacity: +!p,
|
|
2910
|
+
x: p ? e === "left" ? "-100%" : "100%" : "0%"
|
|
2911
|
+
},
|
|
2912
|
+
transition: d.reduce ? zn : Mn,
|
|
2913
|
+
className: V("sticky top-0 flex h-svh w-full flex-col overflow-hidden bg-background", n === "offcanvas" && "w-[var(--sidebar-width)]", t === "sidebar" && (e === "left" ? "border-border border-r" : "border-border border-l"), t === "floating" && "m-2 h-[calc(100svh-1rem)] rounded-2xl border border-border shadow-sm", t === "inset" && "m-2 h-[calc(100svh-1rem)] rounded-2xl", s),
|
|
2914
|
+
children: /* @__PURE__ */ i(Kn.Provider, {
|
|
2915
|
+
value: {
|
|
2916
|
+
collapsed: f,
|
|
2917
|
+
collapsible: n,
|
|
2918
|
+
side: e
|
|
2919
|
+
},
|
|
2920
|
+
children: a
|
|
2921
|
+
})
|
|
2922
|
+
})
|
|
2923
|
+
});
|
|
2924
|
+
}), Zn = M(function({ className: e, onClick: t, type: n = "button", ...r }, a) {
|
|
2925
|
+
let o = $(), s = o.isMobile ? o.openMobile : o.open;
|
|
2926
|
+
return /* @__PURE__ */ i("button", {
|
|
2927
|
+
...r,
|
|
2928
|
+
ref: (e) => {
|
|
2929
|
+
o.triggerRef.current = e, typeof a == "function" ? a(e) : a && (a.current = e);
|
|
2930
|
+
},
|
|
2931
|
+
type: n,
|
|
2932
|
+
"aria-label": r["aria-label"] ?? "Toggle sidebar",
|
|
2933
|
+
"aria-expanded": s,
|
|
2934
|
+
"data-slot": "sidebar-trigger",
|
|
2935
|
+
"data-state": s ? "expanded" : "collapsed",
|
|
2936
|
+
onClick: (e) => {
|
|
2937
|
+
t?.(e), e.defaultPrevented || o.toggleSidebar();
|
|
2938
|
+
},
|
|
2939
|
+
className: V("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)
|
|
2940
|
+
});
|
|
2941
|
+
}), Qn = M(function({ className: e, onClick: t, type: n = "button", ...r }, a) {
|
|
2942
|
+
let o = $();
|
|
2943
|
+
return /* @__PURE__ */ i("button", {
|
|
2944
|
+
...r,
|
|
2945
|
+
ref: a,
|
|
2946
|
+
type: n,
|
|
2947
|
+
"aria-label": r["aria-label"] ?? "Close sidebar",
|
|
2948
|
+
onClick: (e) => {
|
|
2949
|
+
t?.(e), !e.defaultPrevented && (o.isMobile ? o.setOpenMobile(!1) : o.setOpen(!1));
|
|
2950
|
+
},
|
|
2951
|
+
className: V("inline-flex size-10 shrink-0 items-center justify-center rounded-xl outline-none", "focus-visible:ring-2 focus-visible:ring-ring", e)
|
|
2952
|
+
});
|
|
2953
|
+
}), $n = M(function({ className: e, onClick: t, type: n = "button", ...r }, a) {
|
|
2954
|
+
let o = $(), s = qn();
|
|
2955
|
+
return /* @__PURE__ */ i("button", {
|
|
2956
|
+
...r,
|
|
2957
|
+
ref: a,
|
|
2958
|
+
type: n,
|
|
2959
|
+
"data-side": s.side,
|
|
2960
|
+
"aria-label": r["aria-label"] ?? "Toggle sidebar",
|
|
2961
|
+
title: "Toggle sidebar",
|
|
2962
|
+
tabIndex: -1,
|
|
2963
|
+
onClick: (e) => {
|
|
2964
|
+
t?.(e), e.defaultPrevented || o.toggleSidebar();
|
|
2965
|
+
},
|
|
2966
|
+
className: V("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=right]:right-0 data-[side=right]:translate-x-1/2 data-[side=left]:left-full", e)
|
|
2967
|
+
});
|
|
2968
|
+
}), er = M(function({ className: e, ...t }, n) {
|
|
2969
|
+
return /* @__PURE__ */ i(B.main, {
|
|
2970
|
+
...t,
|
|
2971
|
+
ref: n,
|
|
2972
|
+
"data-slot": "sidebar-inset",
|
|
2973
|
+
className: V("relative flex min-h-svh 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]:rounded-2xl md:peer-data-[variant=inset]:shadow-sm", e)
|
|
2974
|
+
});
|
|
2975
|
+
}), tr = M(function({ className: e, ...t }, n) {
|
|
2976
|
+
return /* @__PURE__ */ i("div", {
|
|
2977
|
+
...t,
|
|
2978
|
+
ref: n,
|
|
2979
|
+
"data-slot": "sidebar-header",
|
|
2980
|
+
className: V("flex shrink-0 flex-col gap-2 p-3", e)
|
|
2981
|
+
});
|
|
2982
|
+
}), nr = M(function({ className: e, ...t }, n) {
|
|
2983
|
+
return /* @__PURE__ */ i("div", {
|
|
2984
|
+
...t,
|
|
2985
|
+
ref: n,
|
|
2986
|
+
"data-slot": "sidebar-content",
|
|
2987
|
+
className: V("flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overflow-x-hidden overscroll-contain px-2 py-2", e)
|
|
2988
|
+
});
|
|
2989
|
+
}), rr = M(function({ className: e, ...t }, n) {
|
|
2990
|
+
return /* @__PURE__ */ i("div", {
|
|
2991
|
+
...t,
|
|
2992
|
+
ref: n,
|
|
2993
|
+
"data-slot": "sidebar-footer",
|
|
2994
|
+
className: V("flex shrink-0 flex-col gap-2 border-border border-t p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]", e)
|
|
2995
|
+
});
|
|
2996
|
+
}), ir = M(function({ className: e, ...t }, n) {
|
|
2997
|
+
return /* @__PURE__ */ i("div", {
|
|
2998
|
+
...t,
|
|
2999
|
+
ref: n,
|
|
3000
|
+
"data-slot": "sidebar-group",
|
|
3001
|
+
className: V("flex w-full min-w-0 flex-col px-1 py-1.5", e)
|
|
3002
|
+
});
|
|
3003
|
+
}), ar = M(function({ children: e, className: t, ...n }, r) {
|
|
3004
|
+
let { collapsed: a } = qn();
|
|
3005
|
+
return /* @__PURE__ */ i("div", {
|
|
3006
|
+
...n,
|
|
3007
|
+
ref: r,
|
|
3008
|
+
"aria-hidden": a,
|
|
3009
|
+
"data-slot": "sidebar-group-label",
|
|
3010
|
+
className: V("mb-1 h-7 overflow-hidden px-2 text-[10px] font-medium uppercase tracking-[0.14em] text-muted-foreground transition-opacity", a ? "opacity-0" : "opacity-100", t),
|
|
3011
|
+
children: e
|
|
3012
|
+
});
|
|
3013
|
+
}), or = M(function({ className: e, ...t }, n) {
|
|
3014
|
+
return /* @__PURE__ */ i("div", {
|
|
3015
|
+
...t,
|
|
3016
|
+
ref: n,
|
|
3017
|
+
"data-slot": "sidebar-group-content",
|
|
3018
|
+
className: V("w-full min-w-0", e)
|
|
3019
|
+
});
|
|
3020
|
+
}), sr = M(function({ children: e, className: t, ...n }, r) {
|
|
3021
|
+
return /* @__PURE__ */ i(kn, {
|
|
3022
|
+
...n,
|
|
3023
|
+
ref: r,
|
|
3024
|
+
as: "ul",
|
|
3025
|
+
inset: 0,
|
|
3026
|
+
pillClassName: "rounded-xl bg-muted/70",
|
|
3027
|
+
pillContainerClassName: "inset-y-auto top-0 h-9",
|
|
3028
|
+
"data-slot": "sidebar-menu",
|
|
3029
|
+
className: V("flex w-full min-w-0 list-none flex-col gap-0.5", t),
|
|
3030
|
+
children: e
|
|
3031
|
+
});
|
|
3032
|
+
}), cr = M(function({ className: e, ...t }, n) {
|
|
3033
|
+
return /* @__PURE__ */ i(B.li, {
|
|
3034
|
+
...t,
|
|
3035
|
+
ref: n,
|
|
3036
|
+
layout: "position",
|
|
3037
|
+
transition: wn,
|
|
3038
|
+
"data-slot": "sidebar-menu-item",
|
|
3039
|
+
className: V("relative", e)
|
|
3040
|
+
});
|
|
3041
|
+
}), lr = M(function({ open: e, children: t, className: n, ...r }, a) {
|
|
3042
|
+
let o = $(), s = qn();
|
|
3043
|
+
return /* @__PURE__ */ i(z, {
|
|
3044
|
+
initial: !1,
|
|
3045
|
+
mode: "popLayout",
|
|
3046
|
+
children: e && !s.collapsed ? /* @__PURE__ */ j(B.ul, {
|
|
3047
|
+
...r,
|
|
3048
|
+
ref: a,
|
|
3049
|
+
key: "sidebar-submenu",
|
|
3050
|
+
variants: o.reduce ? void 0 : Ln,
|
|
3051
|
+
initial: !o.reduce && "closed",
|
|
3052
|
+
animate: o.reduce ? { opacity: 1 } : "open",
|
|
3053
|
+
exit: o.reduce ? { opacity: 0 } : "closed",
|
|
3054
|
+
transition: o.reduce ? { duration: .12 } : void 0,
|
|
3055
|
+
"data-slot": "sidebar-menu-sub",
|
|
3056
|
+
className: V("relative mt-1 ml-5 flex min-w-0 flex-col gap-0.5 border-border border-l pl-3", n)
|
|
3057
|
+
}, t) : null
|
|
3058
|
+
});
|
|
3059
|
+
}), ur = M(function({ className: e, ...t }, n) {
|
|
3060
|
+
return /* @__PURE__ */ i(B.li, {
|
|
3061
|
+
...t,
|
|
3062
|
+
ref: n,
|
|
3063
|
+
variants: Rn,
|
|
3064
|
+
"data-slot": "sidebar-menu-sub-item",
|
|
3065
|
+
className: V("relative min-w-0", e)
|
|
3066
|
+
});
|
|
3067
|
+
});
|
|
3068
|
+
function dr({ children: e, icon: t, href: n, isActive: o = !1, disabled: s = !1, closeOnSelect: c = !0, target: l, rel: u, onSelect: d, className: f }) {
|
|
3069
|
+
let p = $(), m = (e) => {
|
|
3070
|
+
if (s) {
|
|
3071
|
+
e.preventDefault();
|
|
3072
|
+
return;
|
|
3073
|
+
}
|
|
3074
|
+
d?.(), p.isMobile && c && p.setOpenMobile(!1);
|
|
3075
|
+
}, h = /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i("span", {
|
|
3076
|
+
"aria-hidden": "true",
|
|
3077
|
+
className: "grid size-4 shrink-0 place-items-center",
|
|
3078
|
+
children: t ?? /* @__PURE__ */ i("span", { className: "size-1 rounded-full bg-current" })
|
|
3079
|
+
}), /* @__PURE__ */ i("span", {
|
|
3080
|
+
className: "min-w-0 flex-1 truncate",
|
|
3081
|
+
children: e
|
|
3082
|
+
})] }), g = V("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);
|
|
3083
|
+
return n ? /* @__PURE__ */ i(B.a, {
|
|
3084
|
+
href: n,
|
|
3085
|
+
target: l,
|
|
3086
|
+
rel: u ?? (l === "_blank" ? "noreferrer noopener" : void 0),
|
|
3087
|
+
"aria-current": o ? "page" : void 0,
|
|
3088
|
+
"aria-disabled": s || void 0,
|
|
3089
|
+
tabIndex: s ? -1 : void 0,
|
|
3090
|
+
onClick: m,
|
|
3091
|
+
whileTap: p.reduce || s ? void 0 : { scale: .98 },
|
|
3092
|
+
transition: xn,
|
|
3093
|
+
className: g,
|
|
3094
|
+
children: h
|
|
3095
|
+
}) : /* @__PURE__ */ i(B.button, {
|
|
3096
|
+
type: "button",
|
|
3097
|
+
disabled: s,
|
|
3098
|
+
"aria-current": o ? "page" : void 0,
|
|
3099
|
+
onClick: m,
|
|
3100
|
+
whileTap: p.reduce || s ? void 0 : { scale: .98 },
|
|
3101
|
+
transition: xn,
|
|
3102
|
+
className: g,
|
|
3103
|
+
children: h
|
|
3104
|
+
});
|
|
3105
|
+
}
|
|
3106
|
+
function fr({ children: e, icon: t, badge: n, href: o, isActive: s = !1, ariaExpanded: c, disabled: l = !1, closeOnSelect: u, target: f, rel: p, onSelect: m, className: h }) {
|
|
3107
|
+
let g = $(), _ = qn(), v = typeof e == "string" ? e : void 0, y = (e) => {
|
|
3108
|
+
if (l) {
|
|
3109
|
+
e.preventDefault();
|
|
3110
|
+
return;
|
|
3111
|
+
}
|
|
3112
|
+
m?.();
|
|
3113
|
+
let t = u ?? c === void 0;
|
|
3114
|
+
g.isMobile && t && g.setOpenMobile(!1);
|
|
3115
|
+
}, b = /* @__PURE__ */ a(r, { children: [
|
|
3116
|
+
s ? /* @__PURE__ */ i(B.span, {
|
|
3117
|
+
layoutId: g.layoutId,
|
|
3118
|
+
transition: g.reduce ? { duration: 0 } : wn,
|
|
3119
|
+
className: "absolute inset-0 rounded-xl bg-muted"
|
|
3120
|
+
}) : null,
|
|
3121
|
+
t ? /* @__PURE__ */ i("span", {
|
|
3122
|
+
"aria-hidden": "true",
|
|
3123
|
+
className: "relative z-10 grid size-5 shrink-0 place-items-center",
|
|
3124
|
+
children: t
|
|
3125
|
+
}) : null,
|
|
3126
|
+
/* @__PURE__ */ i(B.span, {
|
|
3127
|
+
initial: !1,
|
|
3128
|
+
animate: {
|
|
3129
|
+
opacity: +!_.collapsed,
|
|
3130
|
+
x: _.collapsed ? -4 : 0
|
|
3131
|
+
},
|
|
3132
|
+
transition: g.reduce ? zn : _.collapsed ? Fn : Pn,
|
|
3133
|
+
"aria-hidden": _.collapsed,
|
|
3134
|
+
className: V("relative z-10 min-w-0 flex-1 truncate", _.collapsed && "pointer-events-none"),
|
|
3135
|
+
children: e
|
|
3136
|
+
}),
|
|
3137
|
+
n && !_.collapsed ? /* @__PURE__ */ i("span", {
|
|
3138
|
+
className: "relative z-10 shrink-0 text-xs text-muted-foreground",
|
|
3139
|
+
children: n
|
|
3140
|
+
}) : null,
|
|
3141
|
+
c === void 0 ? null : /* @__PURE__ */ i(B.span, {
|
|
3142
|
+
"aria-hidden": "true",
|
|
3143
|
+
initial: !1,
|
|
3144
|
+
animate: {
|
|
3145
|
+
opacity: +!_.collapsed,
|
|
3146
|
+
rotate: c ? 90 : 0,
|
|
3147
|
+
x: _.collapsed ? 4 : 0
|
|
3148
|
+
},
|
|
3149
|
+
transition: g.reduce ? { duration: 0 } : wn,
|
|
3150
|
+
className: "relative z-10 grid size-4 shrink-0 place-items-center text-muted-foreground",
|
|
3151
|
+
children: /* @__PURE__ */ i(d, { className: "size-3.5" })
|
|
3152
|
+
})
|
|
3153
|
+
] }), x = V("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);
|
|
3154
|
+
return o ? /* @__PURE__ */ i(B.a, {
|
|
3155
|
+
href: o,
|
|
3156
|
+
target: f,
|
|
3157
|
+
rel: p ?? (f === "_blank" ? "noreferrer noopener" : void 0),
|
|
3158
|
+
"aria-current": s ? "page" : void 0,
|
|
3159
|
+
"aria-expanded": c,
|
|
3160
|
+
"aria-disabled": l || void 0,
|
|
3161
|
+
"aria-label": _.collapsed ? v : void 0,
|
|
3162
|
+
title: _.collapsed ? v : void 0,
|
|
3163
|
+
tabIndex: l ? -1 : void 0,
|
|
3164
|
+
onClick: y,
|
|
3165
|
+
whileTap: g.reduce || l ? void 0 : { scale: .98 },
|
|
3166
|
+
transition: xn,
|
|
3167
|
+
className: x,
|
|
3168
|
+
children: b
|
|
3169
|
+
}) : /* @__PURE__ */ i(B.button, {
|
|
3170
|
+
type: "button",
|
|
3171
|
+
disabled: l,
|
|
3172
|
+
"aria-current": s ? "page" : void 0,
|
|
3173
|
+
"aria-expanded": c,
|
|
3174
|
+
"aria-label": _.collapsed ? v : void 0,
|
|
3175
|
+
title: _.collapsed ? v : void 0,
|
|
3176
|
+
onClick: y,
|
|
3177
|
+
whileTap: g.reduce || l ? void 0 : { scale: .98 },
|
|
3178
|
+
transition: xn,
|
|
3179
|
+
className: x,
|
|
3180
|
+
children: b
|
|
3181
|
+
});
|
|
3182
|
+
}
|
|
3183
|
+
//#endregion
|
|
3184
|
+
//#region src/components/blocks/nav/sidebar-block.tsx
|
|
3185
|
+
function pr(e, t) {
|
|
3186
|
+
return t !== void 0 && e === t;
|
|
3187
|
+
}
|
|
3188
|
+
function mr({ item: e, activeId: t, onNavigate: n }) {
|
|
3189
|
+
let r = e.items ?? [], o = r.length > 0, s = r.some((e) => pr(e.id, t)), [c, l] = D.useState(null), [u, d] = D.useState(s);
|
|
3190
|
+
s !== u && (d(s), s && l(null));
|
|
3191
|
+
let f = c ?? e.defaultOpen ?? s;
|
|
3192
|
+
function p(e) {
|
|
3193
|
+
e.onSelect?.(), n?.(e);
|
|
3194
|
+
}
|
|
3195
|
+
return /* @__PURE__ */ a(cr, { children: [/* @__PURE__ */ i(fr, {
|
|
3196
|
+
ariaExpanded: o ? f : void 0,
|
|
3197
|
+
badge: e.badge,
|
|
3198
|
+
disabled: e.disabled,
|
|
3199
|
+
href: o ? void 0 : e.href,
|
|
3200
|
+
icon: e.icon,
|
|
3201
|
+
isActive: pr(e.id, t),
|
|
3202
|
+
onSelect: () => {
|
|
3203
|
+
if (o) {
|
|
3204
|
+
l(!f);
|
|
3205
|
+
return;
|
|
3206
|
+
}
|
|
3207
|
+
p(e);
|
|
3208
|
+
},
|
|
3209
|
+
target: e.target,
|
|
3210
|
+
children: e.label
|
|
3211
|
+
}), o ? /* @__PURE__ */ i(lr, {
|
|
3212
|
+
open: f,
|
|
3213
|
+
children: r.map((e) => /* @__PURE__ */ i(ur, { children: /* @__PURE__ */ i(dr, {
|
|
3214
|
+
disabled: e.disabled,
|
|
3215
|
+
href: e.href,
|
|
3216
|
+
icon: e.icon,
|
|
3217
|
+
isActive: pr(e.id, t),
|
|
3218
|
+
onSelect: () => p(e),
|
|
3219
|
+
target: e.target,
|
|
3220
|
+
children: e.label
|
|
3221
|
+
}) }, e.id))
|
|
3222
|
+
}) : null] });
|
|
3223
|
+
}
|
|
3224
|
+
function hr({ 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: x = "Main", className: S }) {
|
|
3225
|
+
return /* @__PURE__ */ i(Jn, {
|
|
3226
|
+
className: "h-full min-h-0 w-auto",
|
|
3227
|
+
defaultOpen: f,
|
|
3228
|
+
defaultOpenMobile: h,
|
|
3229
|
+
onOpenChange: p,
|
|
3230
|
+
onOpenMobileChange: g,
|
|
3231
|
+
open: d,
|
|
3232
|
+
openMobile: m,
|
|
3233
|
+
style: {
|
|
3234
|
+
..._ ? { "--sidebar-width": _ } : null,
|
|
3235
|
+
...v ? { "--sidebar-width-icon": v } : null,
|
|
3236
|
+
...y ? { "--sidebar-width-mobile": y } : null
|
|
3237
|
+
},
|
|
3238
|
+
children: /* @__PURE__ */ a(Xn, {
|
|
3239
|
+
ariaLabel: x,
|
|
3240
|
+
className: V("h-full", S),
|
|
3241
|
+
collapsible: u,
|
|
3242
|
+
panelClassName: "h-full",
|
|
3243
|
+
role: "navigation",
|
|
3244
|
+
side: c,
|
|
3245
|
+
variant: l,
|
|
3246
|
+
children: [
|
|
3247
|
+
r || s ? /* @__PURE__ */ i(tr, { children: /* @__PURE__ */ a("div", {
|
|
3248
|
+
className: "flex min-w-0 items-center justify-between gap-2",
|
|
3249
|
+
children: [r ? /* @__PURE__ */ i("div", {
|
|
3250
|
+
className: "min-w-0 flex-1",
|
|
3251
|
+
children: r
|
|
3252
|
+
}) : null, s ? /* @__PURE__ */ i(Zn, {
|
|
3253
|
+
className: "text-muted-foreground hover:text-foreground",
|
|
3254
|
+
children: /* @__PURE__ */ i(b, { className: "size-4.5" })
|
|
3255
|
+
}) : null]
|
|
3256
|
+
}) }) : null,
|
|
3257
|
+
/* @__PURE__ */ i(nr, { children: e.map((e) => /* @__PURE__ */ a(ir, { children: [e.label ? /* @__PURE__ */ i(ar, { children: e.label }) : null, /* @__PURE__ */ i(or, { children: /* @__PURE__ */ i(sr, { children: e.items.map((e) => /* @__PURE__ */ i(mr, {
|
|
3258
|
+
activeId: t,
|
|
3259
|
+
item: e,
|
|
3260
|
+
onNavigate: n
|
|
3261
|
+
}, e.id)) }) })] }, e.id)) }),
|
|
3262
|
+
o ? /* @__PURE__ */ i(rr, { children: o }) : null
|
|
3263
|
+
]
|
|
3264
|
+
})
|
|
3265
|
+
});
|
|
3266
|
+
}
|
|
3267
|
+
//#endregion
|
|
3268
|
+
//#region src/components/blocks/profile/profile-card-block.tsx
|
|
3269
|
+
var gr = [
|
|
3270
|
+
{
|
|
3271
|
+
type: "label",
|
|
3272
|
+
label: "Management"
|
|
3273
|
+
},
|
|
3274
|
+
{
|
|
3275
|
+
id: "profile",
|
|
3276
|
+
label: "Profile",
|
|
3277
|
+
icon: /* @__PURE__ */ i(C, { "aria-hidden": "true" })
|
|
3278
|
+
},
|
|
3279
|
+
{
|
|
3280
|
+
id: "settings",
|
|
3281
|
+
label: "Settings",
|
|
3282
|
+
icon: /* @__PURE__ */ i(x, { "aria-hidden": "true" })
|
|
3283
|
+
},
|
|
3284
|
+
{ type: "separator" },
|
|
3285
|
+
{
|
|
3286
|
+
id: "teams",
|
|
3287
|
+
label: "Teams",
|
|
3288
|
+
icon: /* @__PURE__ */ i(T, { "aria-hidden": "true" })
|
|
3289
|
+
},
|
|
3290
|
+
{
|
|
3291
|
+
id: "invite",
|
|
3292
|
+
label: "Invite",
|
|
3293
|
+
icon: /* @__PURE__ */ i(w, { "aria-hidden": "true" })
|
|
3294
|
+
},
|
|
3295
|
+
{ type: "separator" },
|
|
3296
|
+
{
|
|
3297
|
+
id: "sign-out",
|
|
3298
|
+
label: "Log out",
|
|
3299
|
+
icon: /* @__PURE__ */ i(v, { "aria-hidden": "true" }),
|
|
3300
|
+
variant: "destructive"
|
|
3301
|
+
}
|
|
3302
|
+
];
|
|
3303
|
+
function _r(e) {
|
|
3304
|
+
let t = [], n = { actions: [] };
|
|
3305
|
+
for (let r of e) r.type === "separator" ? (t.push(n), n = { actions: [] }) : r.type === "label" ? n.label = r.label : n.actions.push(r);
|
|
3306
|
+
return t.push(n), t.filter((e) => e.actions.length > 0 || e.label !== void 0);
|
|
3307
|
+
}
|
|
3308
|
+
function vr({ user: e, items: t = gr, align: n = "center", side: r = "bottom", sideOffset: o = 8, open: s, defaultOpen: c, onOpenChange: l, sound: u = !0, onError: d, className: f }) {
|
|
3309
|
+
let [m, h] = D.useState(null), g = D.useRef(!0);
|
|
3310
|
+
D.useEffect(() => (g.current = !0, () => {
|
|
3311
|
+
g.current = !1;
|
|
3312
|
+
}), []);
|
|
3313
|
+
let _ = D.useMemo(() => _r(t), [t]);
|
|
3314
|
+
function v(e) {
|
|
3315
|
+
let t = e.onSelect?.();
|
|
3316
|
+
t instanceof Promise && (h(e.id), t.catch((e) => d?.(e)).finally(() => {
|
|
3317
|
+
g.current && h(null);
|
|
3318
|
+
}));
|
|
3319
|
+
}
|
|
3320
|
+
let y = m !== null;
|
|
3321
|
+
return /* @__PURE__ */ a(yt, {
|
|
3322
|
+
defaultOpen: c,
|
|
3323
|
+
onOpenChange: (e, t) => {
|
|
3324
|
+
u && Ze(e ? "bloom" : "droplet"), l?.(e, t);
|
|
3325
|
+
},
|
|
3326
|
+
open: s,
|
|
3327
|
+
children: [/* @__PURE__ */ i(xt, {
|
|
3328
|
+
disabled: y,
|
|
3329
|
+
render: /* @__PURE__ */ a(H, {
|
|
3330
|
+
"aria-label": `${e.name}${e.username ? ` ${e.username}` : ""}, account menu`,
|
|
3331
|
+
className: V("h-auto w-full justify-between py-1.5 pl-1.5 sm:h-auto", f),
|
|
3332
|
+
"data-slot": "profile-card",
|
|
3333
|
+
loading: y,
|
|
3334
|
+
sound: u,
|
|
3335
|
+
variant: "outline",
|
|
3336
|
+
children: [/* @__PURE__ */ a("span", {
|
|
3337
|
+
className: "flex w-full min-w-0 items-center justify-start gap-2",
|
|
3338
|
+
children: [/* @__PURE__ */ i(Yt, {
|
|
3339
|
+
alt: "",
|
|
3340
|
+
initials: e.initials,
|
|
3341
|
+
name: e.name,
|
|
3342
|
+
src: e.avatar
|
|
3343
|
+
}), /* @__PURE__ */ a("span", {
|
|
3344
|
+
className: "flex min-w-0 flex-col text-left",
|
|
3345
|
+
children: [/* @__PURE__ */ i("span", {
|
|
3346
|
+
className: "truncate font-medium",
|
|
3347
|
+
children: e.name
|
|
3348
|
+
}), e.username ? /* @__PURE__ */ i("span", {
|
|
3349
|
+
className: "truncate text-xs font-normal text-muted-foreground",
|
|
3350
|
+
children: e.username
|
|
3351
|
+
}) : null]
|
|
3352
|
+
})]
|
|
3353
|
+
}), /* @__PURE__ */ i(p, {
|
|
3354
|
+
"aria-hidden": "true",
|
|
3355
|
+
className: "size-3.5"
|
|
3356
|
+
})]
|
|
3357
|
+
})
|
|
3358
|
+
}), /* @__PURE__ */ i(St, {
|
|
3359
|
+
align: n,
|
|
3360
|
+
className: "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",
|
|
3361
|
+
side: r,
|
|
3362
|
+
sideOffset: o,
|
|
3363
|
+
children: _.map((e, t) => /* @__PURE__ */ a(D.Fragment, { children: [t > 0 ? /* @__PURE__ */ i(At, {}) : null, /* @__PURE__ */ a(Ct, { children: [e.label ? /* @__PURE__ */ i(kt, { children: e.label }) : null, e.actions.map((e) => /* @__PURE__ */ a(wt, {
|
|
3364
|
+
disabled: e.disabled,
|
|
3365
|
+
onClick: () => v(e),
|
|
3366
|
+
variant: e.variant,
|
|
3367
|
+
children: [
|
|
3368
|
+
e.icon,
|
|
3369
|
+
/* @__PURE__ */ i("span", { children: e.label }),
|
|
3370
|
+
e.shortcut ? /* @__PURE__ */ i(jt, { children: e.shortcut }) : null
|
|
3371
|
+
]
|
|
3372
|
+
}, e.id))] })] }, e.label ?? `group-${e.actions[0]?.id}`))
|
|
3373
|
+
})]
|
|
3374
|
+
});
|
|
3375
|
+
}
|
|
3376
|
+
//#endregion
|
|
3377
|
+
export { Xn as AnimatedSidebar, Qn as AnimatedSidebarClose, nr as AnimatedSidebarContent, rr as AnimatedSidebarFooter, ir as AnimatedSidebarGroup, or as AnimatedSidebarGroupContent, ar as AnimatedSidebarGroupLabel, tr as AnimatedSidebarHeader, er as AnimatedSidebarInset, sr as AnimatedSidebarMenu, fr as AnimatedSidebarMenuButton, cr as AnimatedSidebarMenuItem, lr as AnimatedSidebarMenuSub, dr as AnimatedSidebarMenuSubButton, ur as AnimatedSidebarMenuSubItem, Jn as AnimatedSidebarProvider, $n as AnimatedSidebarRail, Zn as AnimatedSidebarTrigger, q as AuthCard, X as AuthError, Qt as AuthSeparator, Z as AuthSuccess, Ce as Avatar, Te as AvatarFallback, we as AvatarImage, e as AvatarPrimitive, H as Button, Ie as Card, Ke as CardAction, qe as CardContent, qe as CardPanel, Ge as CardDescription, Je as CardFooter, Le as CardFrame, Ve as CardFrameAction, Be as CardFrameDescription, He as CardFrameFooter, Re as CardFrameHeader, ze as CardFrameTitle, Ue as CardHeader, We as CardTitle, Qe as Checkbox, ae as CheckboxPrimitive, en as CodeAuthBlock, ln as DEFAULT_ONBOARDING_STEPS, yt as DropdownMenu, yt as Menu, Et as DropdownMenuCheckboxItem, Et as MenuCheckboxItem, St as DropdownMenuContent, St as MenuPopup, vt as DropdownMenuCreateHandle, vt as MenuCreateHandle, Ct as DropdownMenuGroup, Ct as MenuGroup, wt as DropdownMenuItem, wt as MenuItem, kt as DropdownMenuLabel, kt as MenuGroupLabel, bt as DropdownMenuPortal, bt as MenuPortal, Dt as DropdownMenuRadioGroup, Dt as MenuRadioGroup, Ot as DropdownMenuRadioItem, Ot as MenuRadioItem, At as DropdownMenuSeparator, At as MenuSeparator, jt as DropdownMenuShortcut, jt as MenuShortcut, Mt as DropdownMenuSub, Mt as MenuSub, Pt as DropdownMenuSubContent, Pt as MenuSubPopup, Nt as DropdownMenuSubTrigger, Nt as MenuSubTrigger, xt as DropdownMenuTrigger, xt as MenuTrigger, K as EASE, yn as EASE_DRAWER, vn as EASE_IN_OUT, Q as EASE_OUT, bn as EASE_OUT_CSS, U as Field, nt as FieldControl, et as FieldDescription, tt as FieldError, $e as FieldItem, W as FieldLabel, rt as FieldValidity, tn as ForgotPasswordBlock, it as Frame, ct as FrameDescription, lt as FrameFooter, ot as FrameHeader, at as FramePanel, st as FrameTitle, G as Input, ft as InputGroup, pt as InputGroupAddon, ht as InputGroupInput, mt as InputGroupText, gt as InputGroupTextarea, pe as InputPrimitive, _t as Label, rn as LinkedAccountsBlock, an as LoginBlock, Tt as MenuLinkItem, R as MenuPrimitive, J as MorphStep, It as OTPField, Lt as OTPFieldInput, me as OTPFieldPrimitive, Rt as OTPFieldSeparator, un as OnboardingBlock, mn as PasskeyManagerBlock, hn as PasskeySignInBlock, Wt as PasswordInput, vr as ProfileCardBlock, Y as Reveal, Gt as SOCIAL_PROVIDERS, En as SPRING_GLIDE, wn as SPRING_LAYOUT, Tn as SPRING_MOUSE, Cn as SPRING_PANEL, xn as SPRING_PRESS, Sn as SPRING_SWAP, Ft as Separator, he as SeparatorPrimitive, kn as SharedLayoutBg, hr as SidebarBlock, gn as SignupBlock, zt as Skeleton, qt as SocialProviders, Ee as Spinner, ut as Textarea, _n as UpdatePasswordBlock, Yt as UserAvatar, Zt as authAccentActionStyles, Xt as authAccentVars, Xe as bindSounds, Fe as buttonVariants, V as cn, gr as defaultProfileCardItems, Ht as getPasswordStrength, Jt as initialsFrom, Vt as passwordRequirements, Ze as playCue, ce as playSound, le as setSoundEnabled, ue as setSoundVolume, de as sounds, $ as useAnimatedSidebar, $t as useCountdown };
|
|
2346
3378
|
|
|
2347
3379
|
//# sourceMappingURL=index.js.map
|