@exegia/corpora-ui 0.6.0 → 0.8.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/auth/__tests__/linked-accounts-block.test.d.ts +1 -0
- package/dist-lib/components/blocks/auth/__tests__/onboarding-block.test.d.ts +1 -0
- package/dist-lib/components/blocks/auth/__tests__/passkey-manager-block.test.d.ts +1 -0
- package/dist-lib/components/blocks/auth/__tests__/passkey-sign-in-block.test.d.ts +1 -0
- package/dist-lib/components/blocks/auth/__tests__/signup-block.test.d.ts +1 -0
- package/dist-lib/components/blocks/auth/__tests__/update-password-block.test.d.ts +1 -0
- package/dist-lib/components/blocks/auth/linked-accounts-block.d.ts +30 -0
- package/dist-lib/components/blocks/auth/onboarding/profile-step.d.ts +19 -0
- package/dist-lib/components/blocks/auth/onboarding-block.d.ts +69 -0
- package/dist-lib/components/blocks/auth/passkey-manager-block.d.ts +38 -0
- package/dist-lib/components/blocks/auth/passkey-sign-in-block.d.ts +27 -0
- package/dist-lib/components/blocks/auth/signup-block.d.ts +16 -1
- package/dist-lib/components/blocks/auth/update-password-block.d.ts +28 -0
- package/dist-lib/components/composed/social-providers.d.ts +7 -0
- package/dist-lib/index.d.ts +5 -0
- package/dist-lib/index.js +1122 -392
- package/dist-lib/index.js.map +1 -1
- package/package.json +5 -1
- package/src/components/blocks/auth/__tests__/linked-accounts-block.test.tsx +110 -0
- package/src/components/blocks/auth/__tests__/onboarding-block.test.tsx +156 -0
- package/src/components/blocks/auth/__tests__/passkey-manager-block.test.tsx +131 -0
- package/src/components/blocks/auth/__tests__/passkey-sign-in-block.test.tsx +59 -0
- package/src/components/blocks/auth/__tests__/signup-block.test.tsx +176 -0
- package/src/components/blocks/auth/__tests__/update-password-block.test.tsx +95 -0
- package/src/components/blocks/auth/linked-accounts-block.tsx +223 -0
- package/src/components/blocks/auth/onboarding/profile-step.tsx +227 -0
- package/src/components/blocks/auth/onboarding-block.tsx +240 -0
- package/src/components/blocks/auth/passkey-manager-block.tsx +334 -0
- package/src/components/blocks/auth/passkey-sign-in-block.tsx +81 -0
- package/src/components/blocks/auth/signup-block.tsx +43 -10
- package/src/components/blocks/auth/update-password-block.tsx +157 -0
- package/src/components/composed/social-providers.tsx +3 -2
- package/src/index.ts +5 -0
package/dist-lib/index.js
CHANGED
|
@@ -3,44 +3,44 @@ import { useRender as t } from "@base-ui/react/use-render";
|
|
|
3
3
|
import { cva as n } from "class-variance-authority";
|
|
4
4
|
import { clsx as r } from "clsx";
|
|
5
5
|
import { twMerge as i } from "tailwind-merge";
|
|
6
|
-
import { ArrowLeftIcon as a, CheckIcon as o, EyeIcon as s, EyeOffIcon as c,
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import * as
|
|
9
|
-
import { forwardRef as
|
|
10
|
-
import { Checkbox as
|
|
11
|
-
import { bind as
|
|
12
|
-
import { Field as
|
|
13
|
-
import { Input as
|
|
14
|
-
import { OTPField as
|
|
15
|
-
import { Separator as
|
|
16
|
-
import { AnimatePresence as F, MotionConfig as
|
|
17
|
-
import { RiAppleFill as
|
|
6
|
+
import { ArrowLeftIcon as a, CheckIcon as o, EyeIcon as s, EyeOffIcon as c, FingerprintIcon as l, Loader2Icon as u, MailIcon as d, SmartphoneIcon as f, XIcon as p } from "lucide-react";
|
|
7
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
8
|
+
import * as _ from "react";
|
|
9
|
+
import { forwardRef as v, useCallback as y, useEffect as b, useId as x, useMemo as S, useRef as C, useState as w } from "react";
|
|
10
|
+
import { Checkbox as T } from "@base-ui/react/checkbox";
|
|
11
|
+
import { bind as E, play as D, play as O, setEnabled as k, setVolume as A, sounds as j } from "cuelume";
|
|
12
|
+
import { Field as ee, Field as M } from "@base-ui/react/field";
|
|
13
|
+
import { Input as N } from "@base-ui/react/input";
|
|
14
|
+
import { OTPField as P } from "@base-ui/react/otp-field";
|
|
15
|
+
import { Separator as te } from "@base-ui/react/separator";
|
|
16
|
+
import { AnimatePresence as F, MotionConfig as ne, motion as I } from "motion/react";
|
|
17
|
+
import { RiAppleFill as L, RiGithubFill as re, RiGoogleFill as ie, RiTwitterXFill as ae } from "@remixicon/react";
|
|
18
18
|
//#region src/lib/utils.ts
|
|
19
|
-
function
|
|
19
|
+
function R(...e) {
|
|
20
20
|
return i(r(e));
|
|
21
21
|
}
|
|
22
22
|
//#endregion
|
|
23
23
|
//#region src/components/ui/spinner.tsx
|
|
24
|
-
function
|
|
25
|
-
return /* @__PURE__ */
|
|
24
|
+
function z({ className: e, ...t }) {
|
|
25
|
+
return /* @__PURE__ */ h(u, {
|
|
26
26
|
"aria-label": "Loading",
|
|
27
|
-
className:
|
|
27
|
+
className: R("animate-spin", e),
|
|
28
28
|
role: "status",
|
|
29
29
|
...t
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/components/ui/glasscn/liquid-glass.tsx
|
|
34
|
-
var
|
|
35
|
-
function
|
|
34
|
+
var oe = 480, se = 1.25, ce = /* @__PURE__ */ new Map();
|
|
35
|
+
function le() {
|
|
36
36
|
if (typeof navigator > "u") return !1;
|
|
37
37
|
let e = navigator.userAgent;
|
|
38
38
|
return (/Chrom(e|ium)/.test(e) || /Edg\//.test(e)) && !/Firefox/.test(e);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
let i = `${e}:${t}:${n}:${r}`, a =
|
|
40
|
+
function ue({ width: e, height: t, radius: n, bezel: r }) {
|
|
41
|
+
let i = `${e}:${t}:${n}:${r}`, a = ce.get(i);
|
|
42
42
|
if (a !== void 0) return a;
|
|
43
|
-
let o = Math.min(1,
|
|
43
|
+
let o = Math.min(1, oe / 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
44
|
l.width = s, l.height = c;
|
|
45
45
|
let u = l.getContext("2d");
|
|
46
46
|
if (!u) return "";
|
|
@@ -56,30 +56,30 @@ function de({ width: e, height: t, radius: n, bezel: r }) {
|
|
|
56
56
|
f[v] = 128, f[v + 1] = 128, f[v + 2] = 128, f[v + 3] = 255;
|
|
57
57
|
continue;
|
|
58
58
|
}
|
|
59
|
-
let b = 1 -
|
|
60
|
-
b *= Math.min(1, y /
|
|
59
|
+
let b = 1 - de(Math.min(1, y / g));
|
|
60
|
+
b *= Math.min(1, y / se), 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
61
|
}
|
|
62
62
|
u.putImageData(d, 0, 0);
|
|
63
63
|
let _ = l.toDataURL("image/png");
|
|
64
|
-
return
|
|
64
|
+
return ce.set(i, _), _;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function de(e) {
|
|
67
67
|
return (1 - (1 - e) ** 4) ** .25;
|
|
68
68
|
}
|
|
69
|
-
var
|
|
70
|
-
let u =
|
|
69
|
+
var fe = v(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .34, saturation: i = 1.28, className: a, style: o, children: s, ...c }, l) {
|
|
70
|
+
let u = x(), d = S(() => `liquid-glass-${u.replace(/:/g, "")}`, [u]);
|
|
71
71
|
console.log(n);
|
|
72
|
-
let f =
|
|
72
|
+
let f = C(null), p = y((e) => {
|
|
73
73
|
f.current = e, typeof l == "function" ? l(e) : l && (l.current = e);
|
|
74
|
-
}, [l]), [_,
|
|
75
|
-
|
|
74
|
+
}, [l]), [_, v] = w(null);
|
|
75
|
+
b(() => {
|
|
76
76
|
let e = f.current;
|
|
77
77
|
if (!e) return;
|
|
78
78
|
let t = () => {
|
|
79
79
|
let t = e.getBoundingClientRect(), n = Math.round(t.width), i = Math.round(t.height);
|
|
80
80
|
if (!n || !i) return;
|
|
81
81
|
let a = Number.parseFloat(getComputedStyle(e).borderTopLeftRadius), o = Math.min(Number.isFinite(a) ? a : Math.min(n, i) / 2, n / 2, i / 2);
|
|
82
|
-
|
|
82
|
+
v((e) => e && e.width === n && e.height === i && e.radius === o && e.bezel === r ? e : {
|
|
83
83
|
width: n,
|
|
84
84
|
height: i,
|
|
85
85
|
radius: o,
|
|
@@ -90,21 +90,21 @@ var pe = _(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .3
|
|
|
90
90
|
let n = new ResizeObserver(t);
|
|
91
91
|
return n.observe(e), () => n.disconnect();
|
|
92
92
|
}, [r]);
|
|
93
|
-
let T =
|
|
94
|
-
|
|
95
|
-
D(
|
|
93
|
+
let T = S(() => _ ? ue(_) : "", [_]), [E, D] = w(!1);
|
|
94
|
+
b(() => {
|
|
95
|
+
D(le());
|
|
96
96
|
}, []);
|
|
97
97
|
let O = E && T !== "", k = O ? `url(#${d}) blur(${e}px) saturate(${i})` : `blur(${e + 2}px) saturate(${i})`;
|
|
98
|
-
return /* @__PURE__ */
|
|
99
|
-
ref:
|
|
100
|
-
className:
|
|
98
|
+
return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g("div", {
|
|
99
|
+
ref: p,
|
|
100
|
+
className: R("relative overflow-hidden rounded-full bg-white/[0.08]", a),
|
|
101
101
|
style: {
|
|
102
102
|
...o,
|
|
103
103
|
backdropFilter: k,
|
|
104
104
|
WebkitBackdropFilter: k
|
|
105
105
|
},
|
|
106
106
|
...c,
|
|
107
|
-
children: [s, /* @__PURE__ */
|
|
107
|
+
children: [s, /* @__PURE__ */ h("span", {
|
|
108
108
|
"aria-hidden": !0,
|
|
109
109
|
className: "pointer-events-none absolute inset-0 rounded-[inherit]",
|
|
110
110
|
style: {
|
|
@@ -115,10 +115,10 @@ var pe = _(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .3
|
|
|
115
115
|
mask: "linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0)"
|
|
116
116
|
}
|
|
117
117
|
})]
|
|
118
|
-
}), O && /* @__PURE__ */
|
|
118
|
+
}), O && /* @__PURE__ */ h("svg", {
|
|
119
119
|
className: "absolute size-0 overflow-hidden",
|
|
120
120
|
"aria-hidden": !0,
|
|
121
|
-
children: /* @__PURE__ */
|
|
121
|
+
children: /* @__PURE__ */ g("filter", {
|
|
122
122
|
id: d,
|
|
123
123
|
x: "0",
|
|
124
124
|
y: "0",
|
|
@@ -126,7 +126,7 @@ var pe = _(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .3
|
|
|
126
126
|
height: "100%",
|
|
127
127
|
colorInterpolationFilters: "sRGB",
|
|
128
128
|
children: [
|
|
129
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ h("feImage", {
|
|
130
130
|
href: T,
|
|
131
131
|
x: "0",
|
|
132
132
|
y: "0",
|
|
@@ -135,7 +135,7 @@ var pe = _(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .3
|
|
|
135
135
|
preserveAspectRatio: "none",
|
|
136
136
|
result: "map"
|
|
137
137
|
}),
|
|
138
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ h("feDisplacementMap", {
|
|
139
139
|
in: "SourceGraphic",
|
|
140
140
|
in2: "map",
|
|
141
141
|
scale: t,
|
|
@@ -143,14 +143,14 @@ var pe = _(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .3
|
|
|
143
143
|
yChannelSelector: "G",
|
|
144
144
|
result: "displaced"
|
|
145
145
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ h("feGaussianBlur", {
|
|
147
147
|
in: "displaced",
|
|
148
148
|
stdDeviation: "0.15"
|
|
149
149
|
})
|
|
150
150
|
]
|
|
151
151
|
})
|
|
152
152
|
})] });
|
|
153
|
-
}),
|
|
153
|
+
}), pe = {
|
|
154
154
|
clear: [
|
|
155
155
|
"backdrop-blur-[2px] backdrop-saturate-[1.9]",
|
|
156
156
|
"bg-white/[0.25] dark:bg-black/[0.25]",
|
|
@@ -184,7 +184,7 @@ var pe = _(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .3
|
|
|
184
184
|
"[will-change:background-position]"
|
|
185
185
|
].join(" "),
|
|
186
186
|
"liquid-refract": ""
|
|
187
|
-
},
|
|
187
|
+
}, me = n("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
188
|
compoundVariants: [{
|
|
189
189
|
class: "h-auto border-0 px-0 align-middle sm:h-auto",
|
|
190
190
|
size: [
|
|
@@ -225,27 +225,27 @@ var pe = _(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .3
|
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
});
|
|
228
|
-
function
|
|
229
|
-
let f = !!(s || c),
|
|
228
|
+
function B({ className: n, variant: r, size: i, render: a, children: o, loading: s = !1, disabled: c, glassVariant: l, sound: u = !0, ...d }) {
|
|
229
|
+
let f = !!(s || c), p = a ? void 0 : "button", _ = r === "glass" ? l ?? "liquid-refract" : void 0, v = _ === "liquid-refract", y = (i ?? "default").startsWith("icon"), b = t({
|
|
230
230
|
defaultTagName: "button",
|
|
231
231
|
props: e({
|
|
232
|
-
children: /* @__PURE__ */
|
|
233
|
-
!y && /* @__PURE__ */
|
|
232
|
+
children: /* @__PURE__ */ g(m, { children: [
|
|
233
|
+
!y && /* @__PURE__ */ h("span", {
|
|
234
234
|
"aria-hidden": !s || void 0,
|
|
235
235
|
"data-slot": "button-loading-indicator",
|
|
236
|
-
className:
|
|
237
|
-
children: /* @__PURE__ */
|
|
236
|
+
className: R("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", s ? "max-w-6" : R("max-w-0 opacity-0 blur-[2px]", i === "xs" ? "-ms-1" : i === "sm" ? "-ms-1.5" : "-ms-2")),
|
|
237
|
+
children: /* @__PURE__ */ h(z, { className: s ? void 0 : "animate-none" })
|
|
238
238
|
}),
|
|
239
239
|
o,
|
|
240
|
-
s && y && /* @__PURE__ */
|
|
240
|
+
s && y && /* @__PURE__ */ h(z, {
|
|
241
241
|
className: "pointer-events-none absolute",
|
|
242
242
|
"data-slot": "button-loading-indicator"
|
|
243
243
|
})
|
|
244
244
|
] }),
|
|
245
|
-
className:
|
|
245
|
+
className: R(me({
|
|
246
246
|
size: i,
|
|
247
247
|
variant: r
|
|
248
|
-
}), !y && "hover:[&_svg:not([class*='animate-'])]:scale-110 motion-reduce:hover:[&_svg]:scale-100", s && y && "data-loading:text-transparent", _ &&
|
|
248
|
+
}), !y && "hover:[&_svg:not([class*='animate-'])]:scale-110 motion-reduce:hover:[&_svg]:scale-100", s && y && "data-loading:text-transparent", _ && pe[_], v && "bg-transparent border-0 shadow-none", n),
|
|
249
249
|
"aria-disabled": s || void 0,
|
|
250
250
|
"data-cuelume-press": u ? "" : void 0,
|
|
251
251
|
"data-cuelume-release": u ? "" : void 0,
|
|
@@ -253,139 +253,139 @@ function R({ className: n, variant: r, size: i, render: a, children: o, loading:
|
|
|
253
253
|
"data-glass-variant": _,
|
|
254
254
|
"data-slot": "button",
|
|
255
255
|
disabled: f,
|
|
256
|
-
type:
|
|
256
|
+
type: p
|
|
257
257
|
}, d),
|
|
258
258
|
render: a
|
|
259
259
|
});
|
|
260
|
-
return v ? /* @__PURE__ */
|
|
260
|
+
return v ? /* @__PURE__ */ h(fe, { children: b }) : b;
|
|
261
261
|
}
|
|
262
262
|
//#endregion
|
|
263
263
|
//#region src/components/ui/card.tsx
|
|
264
|
-
function
|
|
264
|
+
function he({ className: n, render: r, ...i }) {
|
|
265
265
|
return t({
|
|
266
266
|
defaultTagName: "div",
|
|
267
267
|
props: e({
|
|
268
|
-
className:
|
|
268
|
+
className: R("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%)]", n),
|
|
269
269
|
"data-slot": "card"
|
|
270
270
|
}, i),
|
|
271
271
|
render: r
|
|
272
272
|
});
|
|
273
273
|
}
|
|
274
|
-
function
|
|
274
|
+
function ge({ className: n, render: r, ...i }) {
|
|
275
275
|
return t({
|
|
276
276
|
defaultTagName: "div",
|
|
277
277
|
props: e({
|
|
278
|
-
className:
|
|
278
|
+
className: R("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]", n),
|
|
279
279
|
"data-slot": "card-frame"
|
|
280
280
|
}, i),
|
|
281
281
|
render: r
|
|
282
282
|
});
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function _e({ className: n, render: r, ...i }) {
|
|
285
285
|
return t({
|
|
286
286
|
defaultTagName: "div",
|
|
287
287
|
props: e({
|
|
288
|
-
className:
|
|
288
|
+
className: R("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]", n),
|
|
289
289
|
"data-slot": "card-frame-header"
|
|
290
290
|
}, i),
|
|
291
291
|
render: r
|
|
292
292
|
});
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function ve({ className: n, render: r, ...i }) {
|
|
295
295
|
return t({
|
|
296
296
|
defaultTagName: "div",
|
|
297
297
|
props: e({
|
|
298
|
-
className:
|
|
298
|
+
className: R("self-center font-semibold text-sm", n),
|
|
299
299
|
"data-slot": "card-frame-title"
|
|
300
300
|
}, i),
|
|
301
301
|
render: r
|
|
302
302
|
});
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function ye({ className: n, render: r, ...i }) {
|
|
305
305
|
return t({
|
|
306
306
|
defaultTagName: "div",
|
|
307
307
|
props: e({
|
|
308
|
-
className:
|
|
308
|
+
className: R("self-center text-muted-foreground text-sm", n),
|
|
309
309
|
"data-slot": "card-frame-description"
|
|
310
310
|
}, i),
|
|
311
311
|
render: r
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function be({ className: n, render: r, ...i }) {
|
|
315
315
|
return t({
|
|
316
316
|
defaultTagName: "div",
|
|
317
317
|
props: e({
|
|
318
|
-
className:
|
|
318
|
+
className: R("col-start-2 nth-3:row-span-2 nth-3:row-start-1 inline-flex self-center justify-self-end", n),
|
|
319
319
|
"data-slot": "card-frame-action"
|
|
320
320
|
}, i),
|
|
321
321
|
render: r
|
|
322
322
|
});
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function xe({ className: n, render: r, ...i }) {
|
|
325
325
|
return t({
|
|
326
326
|
defaultTagName: "div",
|
|
327
327
|
props: e({
|
|
328
|
-
className:
|
|
328
|
+
className: R("px-6 py-4", n),
|
|
329
329
|
"data-slot": "card-frame-footer"
|
|
330
330
|
}, i),
|
|
331
331
|
render: r
|
|
332
332
|
});
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function Se({ className: n, render: r, ...i }) {
|
|
335
335
|
return t({
|
|
336
336
|
defaultTagName: "div",
|
|
337
337
|
props: e({
|
|
338
|
-
className:
|
|
338
|
+
className: R("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]", n),
|
|
339
339
|
"data-slot": "card-header"
|
|
340
340
|
}, i),
|
|
341
341
|
render: r
|
|
342
342
|
});
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function V({ className: n, render: r, ...i }) {
|
|
345
345
|
return t({
|
|
346
346
|
defaultTagName: "div",
|
|
347
347
|
props: e({
|
|
348
|
-
className:
|
|
348
|
+
className: R("font-heading font-semibold text-lg leading-none", n),
|
|
349
349
|
"data-slot": "card-title"
|
|
350
350
|
}, i),
|
|
351
351
|
render: r
|
|
352
352
|
});
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function Ce({ className: n, render: r, ...i }) {
|
|
355
355
|
return t({
|
|
356
356
|
defaultTagName: "div",
|
|
357
357
|
props: e({
|
|
358
|
-
className:
|
|
358
|
+
className: R("text-muted-foreground text-sm", n),
|
|
359
359
|
"data-slot": "card-description"
|
|
360
360
|
}, i),
|
|
361
361
|
render: r
|
|
362
362
|
});
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function we({ className: n, render: r, ...i }) {
|
|
365
365
|
return t({
|
|
366
366
|
defaultTagName: "div",
|
|
367
367
|
props: e({
|
|
368
|
-
className:
|
|
368
|
+
className: R("col-start-2 row-span-2 row-start-1 inline-flex self-start justify-self-end", n),
|
|
369
369
|
"data-slot": "card-action"
|
|
370
370
|
}, i),
|
|
371
371
|
render: r
|
|
372
372
|
});
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function H({ className: n, render: r, ...i }) {
|
|
375
375
|
return t({
|
|
376
376
|
defaultTagName: "div",
|
|
377
377
|
props: e({
|
|
378
|
-
className:
|
|
378
|
+
className: R("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", n),
|
|
379
379
|
"data-slot": "card-panel"
|
|
380
380
|
}, i),
|
|
381
381
|
render: r
|
|
382
382
|
});
|
|
383
383
|
}
|
|
384
|
-
function
|
|
384
|
+
function Te({ className: n, render: r, ...i }) {
|
|
385
385
|
return t({
|
|
386
386
|
defaultTagName: "div",
|
|
387
387
|
props: e({
|
|
388
|
-
className:
|
|
388
|
+
className: R("flex items-center p-6 in-[[data-slot=card]:has(>[data-slot=card-panel])]:pt-4", n),
|
|
389
389
|
"data-slot": "card-footer"
|
|
390
390
|
}, i),
|
|
391
391
|
render: r
|
|
@@ -393,29 +393,29 @@ function De({ className: n, render: r, ...i }) {
|
|
|
393
393
|
}
|
|
394
394
|
//#endregion
|
|
395
395
|
//#region src/lib/sound.ts
|
|
396
|
-
var
|
|
397
|
-
function
|
|
398
|
-
|
|
396
|
+
var Ee = !1;
|
|
397
|
+
function De(e) {
|
|
398
|
+
Ee = !0, E(e);
|
|
399
399
|
}
|
|
400
|
-
function
|
|
401
|
-
|
|
400
|
+
function Oe(e, t) {
|
|
401
|
+
Ee && D(e, t);
|
|
402
402
|
}
|
|
403
403
|
//#endregion
|
|
404
404
|
//#region src/components/ui/checkbox.tsx
|
|
405
|
-
function
|
|
406
|
-
return /* @__PURE__ */
|
|
405
|
+
function ke({ className: e, sound: t = !0, onCheckedChange: n, ...r }) {
|
|
406
|
+
return /* @__PURE__ */ h(T.Root, {
|
|
407
407
|
onCheckedChange: (e, r) => {
|
|
408
|
-
t &&
|
|
408
|
+
t && Oe("toggle"), n?.(e, r);
|
|
409
409
|
},
|
|
410
|
-
className:
|
|
410
|
+
className: R("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
411
|
"data-slot": "checkbox",
|
|
412
412
|
...r,
|
|
413
|
-
children: /* @__PURE__ */
|
|
413
|
+
children: /* @__PURE__ */ h(T.Indicator, {
|
|
414
414
|
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
415
|
"data-slot": "checkbox-indicator",
|
|
416
|
-
render: (e, t) => /* @__PURE__ */
|
|
416
|
+
render: (e, t) => /* @__PURE__ */ h("span", {
|
|
417
417
|
...e,
|
|
418
|
-
children: t.indeterminate ? /* @__PURE__ */
|
|
418
|
+
children: t.indeterminate ? /* @__PURE__ */ h("svg", {
|
|
419
419
|
"aria-hidden": "true",
|
|
420
420
|
className: "size-3.5 sm:size-3",
|
|
421
421
|
fill: "none",
|
|
@@ -427,8 +427,8 @@ function V({ className: e, sound: t = !0, onCheckedChange: n, ...r }) {
|
|
|
427
427
|
viewBox: "0 0 24 24",
|
|
428
428
|
width: "24",
|
|
429
429
|
xmlns: "http://www.w3.org/2000/svg",
|
|
430
|
-
children: /* @__PURE__ */
|
|
431
|
-
}) : /* @__PURE__ */
|
|
430
|
+
children: /* @__PURE__ */ h("path", { d: "M5.252 12h13.496" })
|
|
431
|
+
}) : /* @__PURE__ */ h("svg", {
|
|
432
432
|
"aria-hidden": "true",
|
|
433
433
|
className: "size-3.5 sm:size-3",
|
|
434
434
|
fill: "none",
|
|
@@ -440,7 +440,7 @@ function V({ className: e, sound: t = !0, onCheckedChange: n, ...r }) {
|
|
|
440
440
|
viewBox: "0 0 24 24",
|
|
441
441
|
width: "24",
|
|
442
442
|
xmlns: "http://www.w3.org/2000/svg",
|
|
443
|
-
children: /* @__PURE__ */
|
|
443
|
+
children: /* @__PURE__ */ h("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
|
|
444
444
|
})
|
|
445
445
|
})
|
|
446
446
|
})
|
|
@@ -448,101 +448,101 @@ function V({ className: e, sound: t = !0, onCheckedChange: n, ...r }) {
|
|
|
448
448
|
}
|
|
449
449
|
//#endregion
|
|
450
450
|
//#region src/components/ui/field.tsx
|
|
451
|
-
function
|
|
452
|
-
return /* @__PURE__ */
|
|
453
|
-
className:
|
|
451
|
+
function U({ className: e, ...t }) {
|
|
452
|
+
return /* @__PURE__ */ h(M.Root, {
|
|
453
|
+
className: R("flex flex-col items-start gap-2", e),
|
|
454
454
|
"data-slot": "field",
|
|
455
455
|
...t
|
|
456
456
|
});
|
|
457
457
|
}
|
|
458
|
-
function
|
|
459
|
-
return /* @__PURE__ */
|
|
460
|
-
className:
|
|
458
|
+
function W({ className: e, ...t }) {
|
|
459
|
+
return /* @__PURE__ */ h(M.Label, {
|
|
460
|
+
className: R("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
461
|
"data-slot": "field-label",
|
|
462
462
|
...t
|
|
463
463
|
});
|
|
464
464
|
}
|
|
465
465
|
function Ae({ className: e, ...t }) {
|
|
466
|
-
return /* @__PURE__ */
|
|
467
|
-
className:
|
|
466
|
+
return /* @__PURE__ */ h(M.Item, {
|
|
467
|
+
className: R("flex", e),
|
|
468
468
|
"data-slot": "field-item",
|
|
469
469
|
...t
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
472
|
function je({ className: e, ...t }) {
|
|
473
|
-
return /* @__PURE__ */
|
|
474
|
-
className:
|
|
473
|
+
return /* @__PURE__ */ h(M.Description, {
|
|
474
|
+
className: R("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
475
|
"data-slot": "field-description",
|
|
476
476
|
...t
|
|
477
477
|
});
|
|
478
478
|
}
|
|
479
479
|
function Me({ className: e, ...t }) {
|
|
480
|
-
return /* @__PURE__ */
|
|
481
|
-
className:
|
|
480
|
+
return /* @__PURE__ */ h(M.Error, {
|
|
481
|
+
className: R("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
482
|
"data-slot": "field-error",
|
|
483
483
|
...t
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
|
-
var Ne =
|
|
486
|
+
var Ne = M.Control, Pe = M.Validity;
|
|
487
487
|
//#endregion
|
|
488
488
|
//#region src/components/ui/frame.tsx
|
|
489
489
|
function Fe({ className: e, ...t }) {
|
|
490
|
-
return /* @__PURE__ */
|
|
491
|
-
className:
|
|
490
|
+
return /* @__PURE__ */ h("div", {
|
|
491
|
+
className: R("relative flex flex-col rounded-2xl bg-muted/72 p-1", "*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-1", e),
|
|
492
492
|
"data-slot": "frame",
|
|
493
493
|
...t
|
|
494
494
|
});
|
|
495
495
|
}
|
|
496
496
|
function Ie({ className: e, ...t }) {
|
|
497
|
-
return /* @__PURE__ */
|
|
498
|
-
className:
|
|
497
|
+
return /* @__PURE__ */ h("div", {
|
|
498
|
+
className: R("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
499
|
"data-slot": "frame-panel",
|
|
500
500
|
...t
|
|
501
501
|
});
|
|
502
502
|
}
|
|
503
503
|
function Le({ className: e, ...t }) {
|
|
504
|
-
return /* @__PURE__ */
|
|
505
|
-
className:
|
|
504
|
+
return /* @__PURE__ */ h("header", {
|
|
505
|
+
className: R("flex flex-col px-5 py-4", e),
|
|
506
506
|
"data-slot": "frame-panel-header",
|
|
507
507
|
...t
|
|
508
508
|
});
|
|
509
509
|
}
|
|
510
510
|
function Re({ className: e, ...t }) {
|
|
511
|
-
return /* @__PURE__ */
|
|
512
|
-
className:
|
|
511
|
+
return /* @__PURE__ */ h("div", {
|
|
512
|
+
className: R("font-semibold text-sm", e),
|
|
513
513
|
"data-slot": "frame-panel-title",
|
|
514
514
|
...t
|
|
515
515
|
});
|
|
516
516
|
}
|
|
517
517
|
function ze({ className: e, ...t }) {
|
|
518
|
-
return /* @__PURE__ */
|
|
519
|
-
className:
|
|
518
|
+
return /* @__PURE__ */ h("div", {
|
|
519
|
+
className: R("text-muted-foreground text-sm", e),
|
|
520
520
|
"data-slot": "frame-panel-description",
|
|
521
521
|
...t
|
|
522
522
|
});
|
|
523
523
|
}
|
|
524
524
|
function Be({ className: e, ...t }) {
|
|
525
|
-
return /* @__PURE__ */
|
|
526
|
-
className:
|
|
525
|
+
return /* @__PURE__ */ h("footer", {
|
|
526
|
+
className: R("px-5 py-4", e),
|
|
527
527
|
"data-slot": "frame-panel-footer",
|
|
528
528
|
...t
|
|
529
529
|
});
|
|
530
530
|
}
|
|
531
531
|
//#endregion
|
|
532
532
|
//#region src/components/ui/input.tsx
|
|
533
|
-
function
|
|
534
|
-
let o =
|
|
535
|
-
return /* @__PURE__ */
|
|
536
|
-
className:
|
|
533
|
+
function G({ className: e, size: t = "default", unstyled: n = !1, nativeInput: r = !1, style: i, ...a }) {
|
|
534
|
+
let o = R("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", a.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", a.type === "file" && "text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm");
|
|
535
|
+
return /* @__PURE__ */ h("span", {
|
|
536
|
+
className: R(!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
537
|
"data-size": t,
|
|
538
538
|
"data-slot": "input-control",
|
|
539
|
-
children: r ? /* @__PURE__ */
|
|
539
|
+
children: r ? /* @__PURE__ */ h("input", {
|
|
540
540
|
className: o,
|
|
541
541
|
"data-slot": "input",
|
|
542
542
|
size: typeof t == "number" ? t : void 0,
|
|
543
543
|
style: typeof i == "function" ? void 0 : i,
|
|
544
544
|
...a
|
|
545
|
-
}) : /* @__PURE__ */
|
|
545
|
+
}) : /* @__PURE__ */ h(N, {
|
|
546
546
|
className: o,
|
|
547
547
|
"data-slot": "input",
|
|
548
548
|
size: typeof t == "number" ? t : void 0,
|
|
@@ -554,19 +554,19 @@ function W({ className: e, size: t = "default", unstyled: n = !1, nativeInput: r
|
|
|
554
554
|
//#endregion
|
|
555
555
|
//#region src/components/ui/textarea.tsx
|
|
556
556
|
function Ve({ className: t, size: n = "default", unstyled: r = !1, ref: i, ...a }) {
|
|
557
|
-
return /* @__PURE__ */
|
|
558
|
-
className:
|
|
557
|
+
return /* @__PURE__ */ h("span", {
|
|
558
|
+
className: R(!r && "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%)]", t) || void 0,
|
|
559
559
|
"data-size": n,
|
|
560
560
|
"data-slot": "textarea-control",
|
|
561
|
-
children: /* @__PURE__ */
|
|
561
|
+
children: /* @__PURE__ */ h(ee.Control, {
|
|
562
562
|
ref: i,
|
|
563
563
|
value: a.value,
|
|
564
564
|
defaultValue: a.defaultValue,
|
|
565
565
|
disabled: a.disabled,
|
|
566
566
|
id: a.id,
|
|
567
567
|
name: a.name,
|
|
568
|
-
render: (t) => /* @__PURE__ */
|
|
569
|
-
className:
|
|
568
|
+
render: (t) => /* @__PURE__ */ h("textarea", {
|
|
569
|
+
className: R("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", n === "sm" && "min-h-16.5 px-[calc(--spacing(2.5)-1px)] py-[calc(--spacing(1)-1px)] max-sm:min-h-19.5", n === "lg" && "min-h-18.5 py-[calc(--spacing(2)-1px)] max-sm:min-h-21.5"),
|
|
570
570
|
"data-slot": "textarea",
|
|
571
571
|
...e(t, a)
|
|
572
572
|
})
|
|
@@ -585,16 +585,16 @@ var He = n("flex h-auto cursor-text select-none items-center justify-center gap-
|
|
|
585
585
|
} }
|
|
586
586
|
});
|
|
587
587
|
function Ue({ className: e, ...t }) {
|
|
588
|
-
return /* @__PURE__ */
|
|
589
|
-
className:
|
|
588
|
+
return /* @__PURE__ */ h("div", {
|
|
589
|
+
className: R("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
590
|
"data-slot": "input-group",
|
|
591
591
|
role: "group",
|
|
592
592
|
...t
|
|
593
593
|
});
|
|
594
594
|
}
|
|
595
595
|
function We({ className: e, align: t = "inline-start", ...n }) {
|
|
596
|
-
return /* @__PURE__ */
|
|
597
|
-
className:
|
|
596
|
+
return /* @__PURE__ */ h("div", {
|
|
597
|
+
className: R(He({ align: t }), e),
|
|
598
598
|
"data-align": t,
|
|
599
599
|
"data-slot": "input-group-addon",
|
|
600
600
|
onMouseDown: (e) => {
|
|
@@ -607,20 +607,20 @@ function We({ className: e, align: t = "inline-start", ...n }) {
|
|
|
607
607
|
});
|
|
608
608
|
}
|
|
609
609
|
function Ge({ className: e, ...t }) {
|
|
610
|
-
return /* @__PURE__ */
|
|
611
|
-
className:
|
|
610
|
+
return /* @__PURE__ */ h("span", {
|
|
611
|
+
className: R("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
612
|
...t
|
|
613
613
|
});
|
|
614
614
|
}
|
|
615
615
|
function Ke({ className: e, ...t }) {
|
|
616
|
-
return /* @__PURE__ */
|
|
616
|
+
return /* @__PURE__ */ h(G, {
|
|
617
617
|
className: e,
|
|
618
618
|
unstyled: !0,
|
|
619
619
|
...t
|
|
620
620
|
});
|
|
621
621
|
}
|
|
622
622
|
function qe({ className: e, ...t }) {
|
|
623
|
-
return /* @__PURE__ */
|
|
623
|
+
return /* @__PURE__ */ h(Ve, {
|
|
624
624
|
className: e,
|
|
625
625
|
unstyled: !0,
|
|
626
626
|
...t
|
|
@@ -632,7 +632,7 @@ function Je({ className: n, render: r, sound: i = !1, ...a }) {
|
|
|
632
632
|
return t({
|
|
633
633
|
defaultTagName: "label",
|
|
634
634
|
props: e({
|
|
635
|
-
className:
|
|
635
|
+
className: R("inline-flex cursor-pointer items-center gap-2 font-medium text-base/4.5 text-foreground sm:text-sm/4", n),
|
|
636
636
|
"data-cuelume-hover": i ? "tick" : void 0,
|
|
637
637
|
"data-slot": "label"
|
|
638
638
|
}, a),
|
|
@@ -641,9 +641,9 @@ function Je({ className: n, render: r, sound: i = !1, ...a }) {
|
|
|
641
641
|
}
|
|
642
642
|
//#endregion
|
|
643
643
|
//#region src/components/ui/separator.tsx
|
|
644
|
-
function
|
|
645
|
-
return /* @__PURE__ */
|
|
646
|
-
className:
|
|
644
|
+
function Ye({ className: e, orientation: t = "horizontal", ...n }) {
|
|
645
|
+
return /* @__PURE__ */ h(te, {
|
|
646
|
+
className: R("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
647
|
"data-slot": "separator",
|
|
648
648
|
orientation: t,
|
|
649
649
|
...n
|
|
@@ -651,41 +651,41 @@ function G({ className: e, orientation: t = "horizontal", ...n }) {
|
|
|
651
651
|
}
|
|
652
652
|
//#endregion
|
|
653
653
|
//#region src/components/ui/otp-field.tsx
|
|
654
|
-
function
|
|
655
|
-
let a =
|
|
656
|
-
return /* @__PURE__ */
|
|
657
|
-
className:
|
|
654
|
+
function Xe({ className: e, size: t = "default", sound: n = !0, onValueChange: r, ...i }) {
|
|
655
|
+
let a = _.useRef(String(i.value ?? i.defaultValue ?? "").length);
|
|
656
|
+
return /* @__PURE__ */ h(P.Root, {
|
|
657
|
+
className: R("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
658
|
"data-size": t,
|
|
659
659
|
"data-slot": "otp-field",
|
|
660
660
|
onValueChange: (e, ...t) => {
|
|
661
|
-
n && e.length > a.current &&
|
|
661
|
+
n && e.length > a.current && Oe("tick"), a.current = e.length, r?.(e, ...t);
|
|
662
662
|
},
|
|
663
663
|
...i
|
|
664
664
|
});
|
|
665
665
|
}
|
|
666
|
-
function
|
|
667
|
-
return /* @__PURE__ */
|
|
668
|
-
className:
|
|
666
|
+
function Ze({ className: e, ...t }) {
|
|
667
|
+
return /* @__PURE__ */ h(P.Input, {
|
|
668
|
+
className: R("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
669
|
"data-slot": "otp-field-input",
|
|
670
670
|
spellCheck: !1,
|
|
671
671
|
...t
|
|
672
672
|
});
|
|
673
673
|
}
|
|
674
|
-
function
|
|
675
|
-
return /* @__PURE__ */
|
|
676
|
-
className:
|
|
674
|
+
function Qe({ className: e, ...t }) {
|
|
675
|
+
return /* @__PURE__ */ h(P.Separator, { render: /* @__PURE__ */ h(Ye, {
|
|
676
|
+
className: R("rounded-full bg-input data-[orientation=horizontal]:h-0.5 data-[orientation=horizontal]:w-3", e),
|
|
677
677
|
orientation: "horizontal",
|
|
678
678
|
...t
|
|
679
679
|
}) });
|
|
680
680
|
}
|
|
681
681
|
//#endregion
|
|
682
682
|
//#region src/components/composed/password-input.tsx
|
|
683
|
-
var
|
|
683
|
+
var $e = [
|
|
684
684
|
.22,
|
|
685
685
|
1,
|
|
686
686
|
.36,
|
|
687
687
|
1
|
|
688
|
-
],
|
|
688
|
+
], et = [
|
|
689
689
|
{
|
|
690
690
|
regex: /.{8,}/,
|
|
691
691
|
text: "At least 8 characters"
|
|
@@ -703,21 +703,21 @@ var Qe = [
|
|
|
703
703
|
text: "At least 1 uppercase letter"
|
|
704
704
|
}
|
|
705
705
|
];
|
|
706
|
-
function
|
|
707
|
-
return
|
|
706
|
+
function tt(e) {
|
|
707
|
+
return et.filter((t) => t.regex.test(e)).length;
|
|
708
708
|
}
|
|
709
|
-
var
|
|
709
|
+
var nt = [
|
|
710
710
|
"bg-border",
|
|
711
711
|
"bg-red-500",
|
|
712
712
|
"bg-orange-500",
|
|
713
713
|
"bg-amber-500",
|
|
714
714
|
"bg-emerald-500"
|
|
715
715
|
];
|
|
716
|
-
function
|
|
717
|
-
let [d,
|
|
718
|
-
return /* @__PURE__ */
|
|
719
|
-
className:
|
|
720
|
-
children: [/* @__PURE__ */
|
|
716
|
+
function K({ visibilityToggle: e = !0, showStrength: t = !1, sound: n = !0, className: r, value: i, defaultValue: a, onChange: l, ...u }) {
|
|
717
|
+
let [d, f] = _.useState(!1), [m, v] = _.useState(String(a ?? "")), y = i === void 0 ? m : String(i), b = tt(y);
|
|
718
|
+
return /* @__PURE__ */ g("div", {
|
|
719
|
+
className: R("flex w-full flex-col gap-3", r),
|
|
720
|
+
children: [/* @__PURE__ */ g(Ue, { children: [/* @__PURE__ */ h(Ke, {
|
|
721
721
|
placeholder: "Enter your password",
|
|
722
722
|
...u,
|
|
723
723
|
type: d ? "text" : "password",
|
|
@@ -725,20 +725,20 @@ function tt({ visibilityToggle: e = !0, showStrength: t = !1, sound: n = !0, cla
|
|
|
725
725
|
onChange: (e) => {
|
|
726
726
|
v(e.target.value), l?.(e);
|
|
727
727
|
}
|
|
728
|
-
}), e && /* @__PURE__ */
|
|
728
|
+
}), e && /* @__PURE__ */ h(We, {
|
|
729
729
|
align: "inline-end",
|
|
730
|
-
children: /* @__PURE__ */
|
|
730
|
+
children: /* @__PURE__ */ h(B, {
|
|
731
731
|
"aria-label": d ? "Hide password" : "Show password",
|
|
732
732
|
onClick: () => {
|
|
733
|
-
n &&
|
|
733
|
+
n && Oe(d ? "droplet" : "bloom"), f((e) => !e);
|
|
734
734
|
},
|
|
735
735
|
size: "icon-xs",
|
|
736
736
|
variant: "ghost",
|
|
737
737
|
sound: !1,
|
|
738
|
-
children: /* @__PURE__ */
|
|
738
|
+
children: /* @__PURE__ */ h(F, {
|
|
739
739
|
mode: "wait",
|
|
740
740
|
initial: !1,
|
|
741
|
-
children: /* @__PURE__ */
|
|
741
|
+
children: /* @__PURE__ */ h(I.span, {
|
|
742
742
|
className: "inline-flex",
|
|
743
743
|
initial: {
|
|
744
744
|
opacity: 0,
|
|
@@ -757,15 +757,15 @@ function tt({ visibilityToggle: e = !0, showStrength: t = !1, sound: n = !0, cla
|
|
|
757
757
|
},
|
|
758
758
|
transition: {
|
|
759
759
|
duration: .15,
|
|
760
|
-
ease:
|
|
760
|
+
ease: $e
|
|
761
761
|
},
|
|
762
|
-
children:
|
|
762
|
+
children: h(d ? c : s, { "aria-hidden": "true" })
|
|
763
763
|
}, d ? "off" : "on")
|
|
764
764
|
})
|
|
765
765
|
})
|
|
766
|
-
})] }), /* @__PURE__ */
|
|
766
|
+
})] }), /* @__PURE__ */ h(F, {
|
|
767
767
|
initial: !1,
|
|
768
|
-
children: t && /* @__PURE__ */
|
|
768
|
+
children: t && /* @__PURE__ */ g(I.div, {
|
|
769
769
|
className: "flex flex-col gap-2 overflow-hidden",
|
|
770
770
|
initial: {
|
|
771
771
|
height: 0,
|
|
@@ -781,39 +781,39 @@ function tt({ visibilityToggle: e = !0, showStrength: t = !1, sound: n = !0, cla
|
|
|
781
781
|
},
|
|
782
782
|
transition: {
|
|
783
783
|
duration: .25,
|
|
784
|
-
ease:
|
|
784
|
+
ease: $e
|
|
785
785
|
},
|
|
786
|
-
children: [/* @__PURE__ */
|
|
786
|
+
children: [/* @__PURE__ */ h("div", {
|
|
787
787
|
"aria-label": "Password strength",
|
|
788
788
|
"aria-valuemax": 4,
|
|
789
789
|
"aria-valuemin": 0,
|
|
790
790
|
"aria-valuenow": b,
|
|
791
791
|
className: "h-1 w-full overflow-hidden rounded-full bg-border",
|
|
792
792
|
role: "progressbar",
|
|
793
|
-
children: /* @__PURE__ */
|
|
794
|
-
className:
|
|
793
|
+
children: /* @__PURE__ */ h(I.div, {
|
|
794
|
+
className: R("h-full rounded-full", nt[b]),
|
|
795
795
|
animate: { width: `${b / 4 * 100}%` },
|
|
796
796
|
transition: {
|
|
797
797
|
duration: .4,
|
|
798
|
-
ease:
|
|
798
|
+
ease: $e
|
|
799
799
|
}
|
|
800
800
|
})
|
|
801
|
-
}), /* @__PURE__ */
|
|
801
|
+
}), /* @__PURE__ */ h("ul", {
|
|
802
802
|
"aria-label": "Password requirements",
|
|
803
803
|
className: "flex flex-col gap-1",
|
|
804
|
-
children:
|
|
804
|
+
children: et.map((e) => {
|
|
805
805
|
let t = e.regex.test(y);
|
|
806
|
-
return /* @__PURE__ */
|
|
806
|
+
return /* @__PURE__ */ g("li", {
|
|
807
807
|
className: "flex items-center gap-2 text-xs",
|
|
808
|
-
children: [t ? /* @__PURE__ */
|
|
808
|
+
children: [t ? /* @__PURE__ */ h(o, {
|
|
809
809
|
"aria-hidden": "true",
|
|
810
810
|
className: "size-3.5 text-emerald-500"
|
|
811
|
-
}) : /* @__PURE__ */
|
|
811
|
+
}) : /* @__PURE__ */ h(p, {
|
|
812
812
|
"aria-hidden": "true",
|
|
813
813
|
className: "size-3.5 text-muted-foreground/80"
|
|
814
|
-
}), /* @__PURE__ */
|
|
814
|
+
}), /* @__PURE__ */ g("span", {
|
|
815
815
|
className: t ? "text-emerald-600" : "text-muted-foreground",
|
|
816
|
-
children: [e.text, /* @__PURE__ */
|
|
816
|
+
children: [e.text, /* @__PURE__ */ h("span", {
|
|
817
817
|
className: "sr-only",
|
|
818
818
|
children: t ? " - met" : " - not met"
|
|
819
819
|
})]
|
|
@@ -827,14 +827,14 @@ function tt({ visibilityToggle: e = !0, showStrength: t = !1, sound: n = !0, cla
|
|
|
827
827
|
}
|
|
828
828
|
//#endregion
|
|
829
829
|
//#region src/components/composed/social-providers.tsx
|
|
830
|
-
var
|
|
830
|
+
var q = {
|
|
831
831
|
google: {
|
|
832
832
|
label: "Google",
|
|
833
833
|
Icon: ie
|
|
834
834
|
},
|
|
835
835
|
apple: {
|
|
836
836
|
label: "Apple",
|
|
837
|
-
Icon:
|
|
837
|
+
Icon: L
|
|
838
838
|
},
|
|
839
839
|
github: {
|
|
840
840
|
label: "GitHub",
|
|
@@ -855,11 +855,11 @@ function it({ providers: e = [
|
|
|
855
855
|
"github"
|
|
856
856
|
], action: t = "continue", layout: n = "stack", loadingProvider: r = null, disabled: i = !1, onSelect: a, className: o }) {
|
|
857
857
|
let s = n === "row";
|
|
858
|
-
return /* @__PURE__ */
|
|
859
|
-
className:
|
|
858
|
+
return /* @__PURE__ */ h("div", {
|
|
859
|
+
className: R("flex w-full gap-2", s ? "flex-row justify-center" : "flex-col", o),
|
|
860
860
|
children: e.map((e) => {
|
|
861
|
-
let { label: n, Icon: o } =
|
|
862
|
-
return /* @__PURE__ */
|
|
861
|
+
let { label: n, Icon: o } = q[e];
|
|
862
|
+
return /* @__PURE__ */ g(B, {
|
|
863
863
|
variant: "outline",
|
|
864
864
|
size: s ? "icon" : "default",
|
|
865
865
|
className: s ? void 0 : "w-full",
|
|
@@ -867,7 +867,7 @@ function it({ providers: e = [
|
|
|
867
867
|
loading: r === e,
|
|
868
868
|
disabled: i || r !== null && r !== e,
|
|
869
869
|
onClick: () => a?.(e),
|
|
870
|
-
children: [/* @__PURE__ */
|
|
870
|
+
children: [/* @__PURE__ */ h(o, { "aria-hidden": "true" }), !s && /* @__PURE__ */ g("span", {
|
|
871
871
|
className: "flex-1",
|
|
872
872
|
children: [
|
|
873
873
|
rt[t],
|
|
@@ -892,38 +892,38 @@ var at = {
|
|
|
892
892
|
"--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
893
|
"--auth-accent-foreground": "oklch(0.985 0 0)"
|
|
894
894
|
}
|
|
895
|
-
}, ot = "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)]",
|
|
895
|
+
}, ot = "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)]", J = [
|
|
896
896
|
.22,
|
|
897
897
|
1,
|
|
898
898
|
.36,
|
|
899
899
|
1
|
|
900
900
|
];
|
|
901
|
-
function
|
|
902
|
-
return /* @__PURE__ */
|
|
901
|
+
function Y({ title: e, description: t, children: n, footer: r, className: i, logo: a, accent: o }) {
|
|
902
|
+
return /* @__PURE__ */ h(ne, {
|
|
903
903
|
reducedMotion: "user",
|
|
904
|
-
children: /* @__PURE__ */
|
|
905
|
-
className:
|
|
904
|
+
children: /* @__PURE__ */ h(Fe, {
|
|
905
|
+
className: R("w-full max-w-sm", i),
|
|
906
906
|
"data-accent": o,
|
|
907
907
|
style: o ? at[o] : void 0,
|
|
908
|
-
children: /* @__PURE__ */
|
|
908
|
+
children: /* @__PURE__ */ g(I.div, {
|
|
909
909
|
layout: !0,
|
|
910
910
|
transition: {
|
|
911
911
|
duration: .3,
|
|
912
|
-
ease:
|
|
912
|
+
ease: J
|
|
913
913
|
},
|
|
914
914
|
className: "flex flex-col",
|
|
915
|
-
children: [/* @__PURE__ */
|
|
916
|
-
a && /* @__PURE__ */
|
|
915
|
+
children: [/* @__PURE__ */ g(he, { children: [/* @__PURE__ */ g(Se, { children: [
|
|
916
|
+
a && /* @__PURE__ */ h("div", {
|
|
917
917
|
className: "mb-1.5 flex items-center [&_img:not([class*='h-'])]:h-8 [&_img]:w-auto [&_svg:not([class*='size-'])]:size-8",
|
|
918
918
|
"data-slot": "auth-logo",
|
|
919
919
|
children: a
|
|
920
920
|
}),
|
|
921
|
-
/* @__PURE__ */
|
|
922
|
-
t && /* @__PURE__ */
|
|
923
|
-
] }), /* @__PURE__ */
|
|
921
|
+
/* @__PURE__ */ h(V, { children: e }),
|
|
922
|
+
t && /* @__PURE__ */ h(Ce, { children: t })
|
|
923
|
+
] }), /* @__PURE__ */ h(H, {
|
|
924
924
|
className: "overflow-hidden",
|
|
925
925
|
children: n
|
|
926
|
-
})] }), r && /* @__PURE__ */
|
|
926
|
+
})] }), r && /* @__PURE__ */ h(Be, {
|
|
927
927
|
className: "text-center text-sm text-muted-foreground",
|
|
928
928
|
children: r
|
|
929
929
|
})]
|
|
@@ -931,11 +931,11 @@ function J({ title: e, description: t, children: n, footer: r, className: i, log
|
|
|
931
931
|
})
|
|
932
932
|
});
|
|
933
933
|
}
|
|
934
|
-
function
|
|
935
|
-
return /* @__PURE__ */
|
|
934
|
+
function X({ step: e, children: t, className: n }) {
|
|
935
|
+
return /* @__PURE__ */ h(F, {
|
|
936
936
|
mode: "popLayout",
|
|
937
937
|
initial: !1,
|
|
938
|
-
children: /* @__PURE__ */
|
|
938
|
+
children: /* @__PURE__ */ h(I.div, {
|
|
939
939
|
className: n,
|
|
940
940
|
initial: {
|
|
941
941
|
opacity: 0,
|
|
@@ -954,24 +954,24 @@ function Y({ step: e, children: t, className: n }) {
|
|
|
954
954
|
},
|
|
955
955
|
transition: {
|
|
956
956
|
duration: .25,
|
|
957
|
-
ease:
|
|
957
|
+
ease: J
|
|
958
958
|
},
|
|
959
959
|
children: t
|
|
960
960
|
}, e)
|
|
961
961
|
});
|
|
962
962
|
}
|
|
963
|
-
function
|
|
964
|
-
let [r, i] =
|
|
963
|
+
function Z({ show: e, children: t, className: n }) {
|
|
964
|
+
let [r, i] = _.useState({
|
|
965
965
|
show: e,
|
|
966
966
|
settled: e
|
|
967
967
|
});
|
|
968
968
|
return r.show !== e && i({
|
|
969
969
|
show: e,
|
|
970
970
|
settled: !1
|
|
971
|
-
}), /* @__PURE__ */
|
|
971
|
+
}), /* @__PURE__ */ h(F, {
|
|
972
972
|
initial: !1,
|
|
973
|
-
children: e && /* @__PURE__ */
|
|
974
|
-
className:
|
|
973
|
+
children: e && /* @__PURE__ */ h(I.div, {
|
|
974
|
+
className: R(!r.settled && "overflow-hidden", n),
|
|
975
975
|
initial: {
|
|
976
976
|
height: 0,
|
|
977
977
|
opacity: 0,
|
|
@@ -992,7 +992,7 @@ function X({ show: e, children: t, className: n }) {
|
|
|
992
992
|
},
|
|
993
993
|
transition: {
|
|
994
994
|
duration: .25,
|
|
995
|
-
ease:
|
|
995
|
+
ease: J
|
|
996
996
|
},
|
|
997
997
|
onAnimationComplete: () => i((e) => ({
|
|
998
998
|
...e,
|
|
@@ -1002,10 +1002,10 @@ function X({ show: e, children: t, className: n }) {
|
|
|
1002
1002
|
})
|
|
1003
1003
|
});
|
|
1004
1004
|
}
|
|
1005
|
-
function
|
|
1006
|
-
return /* @__PURE__ */
|
|
1005
|
+
function Q({ message: e }) {
|
|
1006
|
+
return /* @__PURE__ */ h(F, {
|
|
1007
1007
|
initial: !1,
|
|
1008
|
-
children: e && /* @__PURE__ */
|
|
1008
|
+
children: e && /* @__PURE__ */ h(I.p, {
|
|
1009
1009
|
role: "alert",
|
|
1010
1010
|
className: "text-sm text-destructive-foreground",
|
|
1011
1011
|
initial: {
|
|
@@ -1030,7 +1030,7 @@ function Z({ message: e }) {
|
|
|
1030
1030
|
},
|
|
1031
1031
|
transition: {
|
|
1032
1032
|
duration: .25,
|
|
1033
|
-
ease:
|
|
1033
|
+
ease: J,
|
|
1034
1034
|
x: {
|
|
1035
1035
|
duration: .4,
|
|
1036
1036
|
ease: "easeInOut"
|
|
@@ -1040,11 +1040,11 @@ function Z({ message: e }) {
|
|
|
1040
1040
|
}, e)
|
|
1041
1041
|
});
|
|
1042
1042
|
}
|
|
1043
|
-
function
|
|
1044
|
-
return /* @__PURE__ */
|
|
1043
|
+
function $({ title: e, description: t, children: n }) {
|
|
1044
|
+
return /* @__PURE__ */ g("div", {
|
|
1045
1045
|
className: "flex flex-col items-center gap-3 py-4 text-center",
|
|
1046
1046
|
children: [
|
|
1047
|
-
/* @__PURE__ */
|
|
1047
|
+
/* @__PURE__ */ h(I.span, {
|
|
1048
1048
|
className: "flex size-12 items-center justify-center rounded-full bg-emerald-500/12 text-emerald-600",
|
|
1049
1049
|
initial: {
|
|
1050
1050
|
scale: .6,
|
|
@@ -1056,9 +1056,9 @@ function Q({ title: e, description: t, children: n }) {
|
|
|
1056
1056
|
},
|
|
1057
1057
|
transition: {
|
|
1058
1058
|
duration: .4,
|
|
1059
|
-
ease:
|
|
1059
|
+
ease: J
|
|
1060
1060
|
},
|
|
1061
|
-
children: /* @__PURE__ */
|
|
1061
|
+
children: /* @__PURE__ */ h("svg", {
|
|
1062
1062
|
"aria-hidden": "true",
|
|
1063
1063
|
viewBox: "0 0 24 24",
|
|
1064
1064
|
className: "size-6",
|
|
@@ -1067,24 +1067,24 @@ function Q({ title: e, description: t, children: n }) {
|
|
|
1067
1067
|
strokeWidth: "2.5",
|
|
1068
1068
|
strokeLinecap: "round",
|
|
1069
1069
|
strokeLinejoin: "round",
|
|
1070
|
-
children: /* @__PURE__ */
|
|
1070
|
+
children: /* @__PURE__ */ h(I.path, {
|
|
1071
1071
|
d: "M4 12.5l5 5L20 6.5",
|
|
1072
1072
|
initial: { pathLength: 0 },
|
|
1073
1073
|
animate: { pathLength: 1 },
|
|
1074
1074
|
transition: {
|
|
1075
1075
|
duration: .4,
|
|
1076
1076
|
delay: .15,
|
|
1077
|
-
ease:
|
|
1077
|
+
ease: J
|
|
1078
1078
|
}
|
|
1079
1079
|
})
|
|
1080
1080
|
})
|
|
1081
1081
|
}),
|
|
1082
|
-
/* @__PURE__ */
|
|
1082
|
+
/* @__PURE__ */ g("div", {
|
|
1083
1083
|
className: "flex flex-col gap-1",
|
|
1084
|
-
children: [/* @__PURE__ */
|
|
1084
|
+
children: [/* @__PURE__ */ h("p", {
|
|
1085
1085
|
className: "font-medium",
|
|
1086
1086
|
children: e
|
|
1087
|
-
}), t && /* @__PURE__ */
|
|
1087
|
+
}), t && /* @__PURE__ */ h("p", {
|
|
1088
1088
|
className: "text-sm text-muted-foreground",
|
|
1089
1089
|
children: t
|
|
1090
1090
|
})]
|
|
@@ -1093,21 +1093,21 @@ function Q({ title: e, description: t, children: n }) {
|
|
|
1093
1093
|
]
|
|
1094
1094
|
});
|
|
1095
1095
|
}
|
|
1096
|
-
function
|
|
1097
|
-
return /* @__PURE__ */
|
|
1096
|
+
function st({ label: e = "Or" }) {
|
|
1097
|
+
return /* @__PURE__ */ g("div", {
|
|
1098
1098
|
className: "flex items-center gap-3",
|
|
1099
1099
|
children: [
|
|
1100
|
-
/* @__PURE__ */
|
|
1101
|
-
/* @__PURE__ */
|
|
1100
|
+
/* @__PURE__ */ h(Ye, { className: "flex-1" }),
|
|
1101
|
+
/* @__PURE__ */ h("span", {
|
|
1102
1102
|
className: "text-xs text-muted-foreground uppercase",
|
|
1103
1103
|
children: e
|
|
1104
1104
|
}),
|
|
1105
|
-
/* @__PURE__ */
|
|
1105
|
+
/* @__PURE__ */ h(Ye, { className: "flex-1" })
|
|
1106
1106
|
]
|
|
1107
1107
|
});
|
|
1108
1108
|
}
|
|
1109
|
-
function
|
|
1110
|
-
let [n, r] =
|
|
1109
|
+
function ct(e, t) {
|
|
1110
|
+
let [n, r] = _.useState({
|
|
1111
1111
|
restartKey: t,
|
|
1112
1112
|
seconds: e,
|
|
1113
1113
|
remaining: e
|
|
@@ -1116,7 +1116,7 @@ function st(e, t) {
|
|
|
1116
1116
|
restartKey: t,
|
|
1117
1117
|
seconds: e,
|
|
1118
1118
|
remaining: e
|
|
1119
|
-
}),
|
|
1119
|
+
}), _.useEffect(() => {
|
|
1120
1120
|
if (e <= 0) return;
|
|
1121
1121
|
let t = window.setInterval(() => {
|
|
1122
1122
|
r((e) => e.remaining <= 0 ? e : {
|
|
@@ -1129,53 +1129,53 @@ function st(e, t) {
|
|
|
1129
1129
|
}
|
|
1130
1130
|
//#endregion
|
|
1131
1131
|
//#region src/components/blocks/auth/code-auth-block.tsx
|
|
1132
|
-
function
|
|
1133
|
-
let [
|
|
1134
|
-
y(null),
|
|
1132
|
+
function lt({ channel: e = "email", logo: t, accent: n, destination: r, length: i = 6, autoSubmit: a = !0, resendSeconds: o = 30, onVerify: s, onResend: c, onBack: l }) {
|
|
1133
|
+
let [u, p] = _.useState("idle"), [v, y] = _.useState(null), [b, x] = _.useState(""), [S, C] = _.useState(0), w = ct(o, S), T = e === "sms" ? f : d, E = e === "sms" ? "phone" : "email", D = _.useCallback(async (e) => {
|
|
1134
|
+
y(null), p("loading");
|
|
1135
1135
|
try {
|
|
1136
|
-
await s?.(e),
|
|
1136
|
+
await s?.(e), p("success");
|
|
1137
1137
|
} catch (e) {
|
|
1138
|
-
|
|
1138
|
+
p("idle"), x(""), y(e instanceof Error ? e.message : "Invalid code.");
|
|
1139
1139
|
}
|
|
1140
1140
|
}, [s]);
|
|
1141
1141
|
function O(e) {
|
|
1142
|
-
x(e), v && y(null), a && e.length === i &&
|
|
1142
|
+
x(e), v && y(null), a && e.length === i && u === "idle" && D(e);
|
|
1143
1143
|
}
|
|
1144
1144
|
async function k() {
|
|
1145
1145
|
C((e) => e + 1), x(""), y(null), await c?.();
|
|
1146
1146
|
}
|
|
1147
|
-
return /* @__PURE__ */
|
|
1147
|
+
return /* @__PURE__ */ h(Y, {
|
|
1148
1148
|
title: "Enter verification code",
|
|
1149
1149
|
logo: t,
|
|
1150
1150
|
accent: n,
|
|
1151
|
-
description: /* @__PURE__ */
|
|
1151
|
+
description: /* @__PURE__ */ g("span", {
|
|
1152
1152
|
className: "inline-flex items-center gap-1.5",
|
|
1153
|
-
children: [/* @__PURE__ */
|
|
1153
|
+
children: [/* @__PURE__ */ h(T, { className: "size-3.5 shrink-0" }), /* @__PURE__ */ g("span", { children: [
|
|
1154
1154
|
"We sent a ",
|
|
1155
1155
|
i,
|
|
1156
1156
|
"-digit code to your ",
|
|
1157
1157
|
E,
|
|
1158
|
-
r ? /* @__PURE__ */
|
|
1158
|
+
r ? /* @__PURE__ */ g(m, { children: [" ", /* @__PURE__ */ h("span", {
|
|
1159
1159
|
className: "font-medium text-foreground",
|
|
1160
1160
|
children: r
|
|
1161
1161
|
})] }) : null,
|
|
1162
1162
|
"."
|
|
1163
1163
|
] })]
|
|
1164
1164
|
}),
|
|
1165
|
-
footer:
|
|
1165
|
+
footer: u !== "success" && /* @__PURE__ */ g(B, {
|
|
1166
1166
|
variant: "link",
|
|
1167
1167
|
onClick: l,
|
|
1168
1168
|
children: ["Use a different ", E]
|
|
1169
1169
|
}),
|
|
1170
|
-
children: /* @__PURE__ */
|
|
1171
|
-
step:
|
|
1172
|
-
children:
|
|
1170
|
+
children: /* @__PURE__ */ h(X, {
|
|
1171
|
+
step: u === "success" ? "success" : "form",
|
|
1172
|
+
children: u === "success" ? /* @__PURE__ */ h($, {
|
|
1173
1173
|
title: "Verified",
|
|
1174
1174
|
description: "Your identity has been confirmed."
|
|
1175
|
-
}) : /* @__PURE__ */
|
|
1175
|
+
}) : /* @__PURE__ */ g("div", {
|
|
1176
1176
|
className: "flex flex-col items-center gap-4",
|
|
1177
1177
|
children: [
|
|
1178
|
-
/* @__PURE__ */
|
|
1178
|
+
/* @__PURE__ */ h(I.div, {
|
|
1179
1179
|
animate: v ? { x: [
|
|
1180
1180
|
0,
|
|
1181
1181
|
-8,
|
|
@@ -1188,42 +1188,42 @@ function ct({ channel: e = "email", logo: t, accent: n, destination: r, length:
|
|
|
1188
1188
|
duration: .4,
|
|
1189
1189
|
ease: "easeInOut"
|
|
1190
1190
|
},
|
|
1191
|
-
children: /* @__PURE__ */
|
|
1191
|
+
children: /* @__PURE__ */ h(Xe, {
|
|
1192
1192
|
length: i,
|
|
1193
1193
|
value: b,
|
|
1194
1194
|
onValueChange: O,
|
|
1195
|
-
disabled:
|
|
1196
|
-
children: Array.from({ length: i }, (e, t) => /* @__PURE__ */
|
|
1195
|
+
disabled: u === "loading",
|
|
1196
|
+
children: Array.from({ length: i }, (e, t) => /* @__PURE__ */ h(Ze, {
|
|
1197
1197
|
"aria-invalid": v ? !0 : void 0,
|
|
1198
1198
|
"aria-label": `Digit ${t + 1} of ${i}`
|
|
1199
1199
|
}, `slot-${t}`))
|
|
1200
1200
|
})
|
|
1201
1201
|
}, v ?? "steady"),
|
|
1202
|
-
/* @__PURE__ */
|
|
1203
|
-
!a && /* @__PURE__ */
|
|
1204
|
-
className:
|
|
1205
|
-
loading:
|
|
1202
|
+
/* @__PURE__ */ h(Q, { message: v }),
|
|
1203
|
+
!a && /* @__PURE__ */ h(B, {
|
|
1204
|
+
className: R("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)]"),
|
|
1205
|
+
loading: u === "loading",
|
|
1206
1206
|
disabled: b.length !== i,
|
|
1207
1207
|
onClick: () => void D(b),
|
|
1208
1208
|
children: "Verify"
|
|
1209
1209
|
}),
|
|
1210
|
-
/* @__PURE__ */
|
|
1210
|
+
/* @__PURE__ */ h(I.p, {
|
|
1211
1211
|
layout: !0,
|
|
1212
1212
|
transition: {
|
|
1213
1213
|
duration: .25,
|
|
1214
|
-
ease:
|
|
1214
|
+
ease: J
|
|
1215
1215
|
},
|
|
1216
1216
|
className: "text-center text-sm text-muted-foreground",
|
|
1217
|
-
children: w > 0 ? /* @__PURE__ */
|
|
1217
|
+
children: w > 0 ? /* @__PURE__ */ g(m, { children: [
|
|
1218
1218
|
"Resend code in",
|
|
1219
1219
|
" ",
|
|
1220
|
-
/* @__PURE__ */
|
|
1220
|
+
/* @__PURE__ */ g("span", {
|
|
1221
1221
|
className: "font-medium tabular-nums text-foreground",
|
|
1222
1222
|
children: [w, "s"]
|
|
1223
1223
|
})
|
|
1224
|
-
] }) : /* @__PURE__ */
|
|
1224
|
+
] }) : /* @__PURE__ */ h(B, {
|
|
1225
1225
|
variant: "link",
|
|
1226
|
-
disabled:
|
|
1226
|
+
disabled: u === "loading",
|
|
1227
1227
|
onClick: () => void k(),
|
|
1228
1228
|
children: "Resend code"
|
|
1229
1229
|
})
|
|
@@ -1235,8 +1235,8 @@ function ct({ channel: e = "email", logo: t, accent: n, destination: r, length:
|
|
|
1235
1235
|
}
|
|
1236
1236
|
//#endregion
|
|
1237
1237
|
//#region src/components/blocks/auth/forgot-password-block.tsx
|
|
1238
|
-
function
|
|
1239
|
-
let s =
|
|
1238
|
+
function ut({ title: e = "Reset your password", logo: t, accent: n, description: r = "Enter your email and we will send you a reset link", onSubmit: i, onBackToLogin: o }) {
|
|
1239
|
+
let s = _.useId(), [c, l] = _.useState("idle"), [u, d] = _.useState(null), [f, p] = _.useState("");
|
|
1240
1240
|
async function v(e) {
|
|
1241
1241
|
e.preventDefault(), d(null), l("loading");
|
|
1242
1242
|
try {
|
|
@@ -1245,46 +1245,46 @@ function lt({ title: e = "Reset your password", logo: t, accent: n, description:
|
|
|
1245
1245
|
l("idle"), d(e instanceof Error ? e.message : "Unable to send reset link.");
|
|
1246
1246
|
}
|
|
1247
1247
|
}
|
|
1248
|
-
return /* @__PURE__ */
|
|
1248
|
+
return /* @__PURE__ */ h(Y, {
|
|
1249
1249
|
title: e,
|
|
1250
1250
|
description: r,
|
|
1251
1251
|
logo: t,
|
|
1252
1252
|
accent: n,
|
|
1253
|
-
footer: /* @__PURE__ */
|
|
1253
|
+
footer: /* @__PURE__ */ g(B, {
|
|
1254
1254
|
variant: "link",
|
|
1255
1255
|
className: "gap-1",
|
|
1256
1256
|
onClick: o,
|
|
1257
|
-
children: [/* @__PURE__ */
|
|
1257
|
+
children: [/* @__PURE__ */ h(a, { className: "size-3.5" }), "Back to login"]
|
|
1258
1258
|
}),
|
|
1259
|
-
children: /* @__PURE__ */
|
|
1259
|
+
children: /* @__PURE__ */ h(X, {
|
|
1260
1260
|
step: c === "success" ? "success" : "form",
|
|
1261
|
-
children: c === "success" ? /* @__PURE__ */
|
|
1261
|
+
children: c === "success" ? /* @__PURE__ */ h($, {
|
|
1262
1262
|
title: "Check your inbox",
|
|
1263
|
-
description: /* @__PURE__ */
|
|
1263
|
+
description: /* @__PURE__ */ g(m, { children: [
|
|
1264
1264
|
"We sent a password reset link to",
|
|
1265
1265
|
" ",
|
|
1266
|
-
/* @__PURE__ */
|
|
1266
|
+
/* @__PURE__ */ h("span", {
|
|
1267
1267
|
className: "font-medium text-foreground",
|
|
1268
1268
|
children: f
|
|
1269
1269
|
}),
|
|
1270
1270
|
"."
|
|
1271
1271
|
] }),
|
|
1272
|
-
children: /* @__PURE__ */
|
|
1272
|
+
children: /* @__PURE__ */ h(B, {
|
|
1273
1273
|
variant: "link",
|
|
1274
1274
|
className: "text-xs sm:text-xs",
|
|
1275
1275
|
onClick: () => l("idle"),
|
|
1276
1276
|
children: "Use a different email"
|
|
1277
1277
|
})
|
|
1278
|
-
}) : /* @__PURE__ */
|
|
1278
|
+
}) : /* @__PURE__ */ g("form", {
|
|
1279
1279
|
className: "flex flex-col gap-4",
|
|
1280
1280
|
onSubmit: v,
|
|
1281
1281
|
children: [
|
|
1282
|
-
/* @__PURE__ */
|
|
1282
|
+
/* @__PURE__ */ g(U, {
|
|
1283
1283
|
name: "email",
|
|
1284
|
-
children: [/* @__PURE__ */
|
|
1284
|
+
children: [/* @__PURE__ */ h(W, {
|
|
1285
1285
|
htmlFor: s,
|
|
1286
1286
|
children: "Email"
|
|
1287
|
-
}), /* @__PURE__ */
|
|
1287
|
+
}), /* @__PURE__ */ h(G, {
|
|
1288
1288
|
id: s,
|
|
1289
1289
|
name: "email",
|
|
1290
1290
|
type: "email",
|
|
@@ -1293,12 +1293,12 @@ function lt({ title: e = "Reset your password", logo: t, accent: n, description:
|
|
|
1293
1293
|
required: !0,
|
|
1294
1294
|
disabled: c === "loading",
|
|
1295
1295
|
value: f,
|
|
1296
|
-
onChange: (e) =>
|
|
1296
|
+
onChange: (e) => p(e.target.value)
|
|
1297
1297
|
})]
|
|
1298
1298
|
}),
|
|
1299
|
-
/* @__PURE__ */
|
|
1300
|
-
/* @__PURE__ */
|
|
1301
|
-
className:
|
|
1299
|
+
/* @__PURE__ */ h(Q, { message: u }),
|
|
1300
|
+
/* @__PURE__ */ h(B, {
|
|
1301
|
+
className: R("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
1302
|
type: "submit",
|
|
1303
1303
|
loading: c === "loading",
|
|
1304
1304
|
children: "Send reset link"
|
|
@@ -1309,13 +1309,148 @@ function lt({ title: e = "Reset your password", logo: t, accent: n, description:
|
|
|
1309
1309
|
});
|
|
1310
1310
|
}
|
|
1311
1311
|
//#endregion
|
|
1312
|
+
//#region src/components/blocks/auth/linked-accounts-block.tsx
|
|
1313
|
+
var dt = "This is your only way to sign in, so it can't be disconnected.";
|
|
1314
|
+
function ft({ title: e = "Connected accounts", description: t = "Manage the accounts you can use to sign in.", identities: n = [], providers: r = [
|
|
1315
|
+
"google",
|
|
1316
|
+
"apple",
|
|
1317
|
+
"github"
|
|
1318
|
+
], loading: i = !1, onLink: a, onUnlink: o, className: s }) {
|
|
1319
|
+
let c = _.useId(), [l, u] = _.useState(null), [d, f] = _.useState(null), [p, m] = _.useState(null), v = new Set(n.map((e) => e.provider)), y = r.filter((e) => !v.has(e)), b = d !== null || p !== null, x = n.length <= 1;
|
|
1320
|
+
async function S(e) {
|
|
1321
|
+
if (!b) {
|
|
1322
|
+
u(null), f(e);
|
|
1323
|
+
try {
|
|
1324
|
+
await a?.(e);
|
|
1325
|
+
} catch (e) {
|
|
1326
|
+
u(e instanceof Error ? e.message : "Unable to connect account.");
|
|
1327
|
+
} finally {
|
|
1328
|
+
f(null);
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
async function C(e) {
|
|
1333
|
+
if (!(b || x)) {
|
|
1334
|
+
u(null), m(e);
|
|
1335
|
+
try {
|
|
1336
|
+
await o?.(e);
|
|
1337
|
+
} catch (e) {
|
|
1338
|
+
u(e instanceof Error ? e.message : "Unable to disconnect account.");
|
|
1339
|
+
} finally {
|
|
1340
|
+
m(null);
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
return /* @__PURE__ */ h(ne, {
|
|
1345
|
+
reducedMotion: "user",
|
|
1346
|
+
children: /* @__PURE__ */ g(he, {
|
|
1347
|
+
className: R("w-full", s),
|
|
1348
|
+
"data-slot": "auth-block",
|
|
1349
|
+
children: [/* @__PURE__ */ g(Se, { children: [/* @__PURE__ */ h(V, { children: e }), /* @__PURE__ */ h(Ce, { children: t })] }), /* @__PURE__ */ h(H, { children: i ? /* @__PURE__ */ g("div", {
|
|
1350
|
+
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
1351
|
+
children: [/* @__PURE__ */ h(z, { className: "size-4" }), "Loading connected accounts…"]
|
|
1352
|
+
}) : /* @__PURE__ */ g(I.div, {
|
|
1353
|
+
layout: !0,
|
|
1354
|
+
transition: {
|
|
1355
|
+
duration: .3,
|
|
1356
|
+
ease: J
|
|
1357
|
+
},
|
|
1358
|
+
className: "flex flex-col gap-3",
|
|
1359
|
+
children: [
|
|
1360
|
+
/* @__PURE__ */ h(Q, { message: l }),
|
|
1361
|
+
n.length > 0 ? /* @__PURE__ */ h("ul", {
|
|
1362
|
+
"aria-label": "Connected accounts",
|
|
1363
|
+
className: "flex flex-col gap-2",
|
|
1364
|
+
children: /* @__PURE__ */ h(F, {
|
|
1365
|
+
initial: !1,
|
|
1366
|
+
children: n.map((e, t) => {
|
|
1367
|
+
let { label: n, Icon: r } = q[e.provider];
|
|
1368
|
+
return /* @__PURE__ */ g(I.li, {
|
|
1369
|
+
layout: !0,
|
|
1370
|
+
className: "flex items-center justify-between gap-3 rounded-lg border px-3 py-2",
|
|
1371
|
+
initial: {
|
|
1372
|
+
opacity: 0,
|
|
1373
|
+
y: -4
|
|
1374
|
+
},
|
|
1375
|
+
animate: {
|
|
1376
|
+
opacity: 1,
|
|
1377
|
+
y: 0
|
|
1378
|
+
},
|
|
1379
|
+
exit: {
|
|
1380
|
+
opacity: 0,
|
|
1381
|
+
y: -4
|
|
1382
|
+
},
|
|
1383
|
+
transition: {
|
|
1384
|
+
duration: .25,
|
|
1385
|
+
ease: J,
|
|
1386
|
+
delay: Math.min(t, 5) * .04
|
|
1387
|
+
},
|
|
1388
|
+
children: [/* @__PURE__ */ g("div", {
|
|
1389
|
+
className: "flex min-w-0 items-center gap-2.5",
|
|
1390
|
+
children: [/* @__PURE__ */ h(r, {
|
|
1391
|
+
"aria-hidden": "true",
|
|
1392
|
+
className: "size-4 text-muted-foreground"
|
|
1393
|
+
}), /* @__PURE__ */ g("div", {
|
|
1394
|
+
className: "flex min-w-0 flex-col",
|
|
1395
|
+
children: [/* @__PURE__ */ h("span", {
|
|
1396
|
+
className: "font-medium text-sm",
|
|
1397
|
+
children: n
|
|
1398
|
+
}), e.email && /* @__PURE__ */ h("span", {
|
|
1399
|
+
className: "truncate text-xs text-muted-foreground",
|
|
1400
|
+
children: e.email
|
|
1401
|
+
})]
|
|
1402
|
+
})]
|
|
1403
|
+
}), /* @__PURE__ */ h(B, {
|
|
1404
|
+
"aria-describedby": x ? c : void 0,
|
|
1405
|
+
"aria-label": `Disconnect ${n}`,
|
|
1406
|
+
size: "sm",
|
|
1407
|
+
type: "button",
|
|
1408
|
+
variant: "destructive-outline",
|
|
1409
|
+
disabled: b || x,
|
|
1410
|
+
loading: p === e.id,
|
|
1411
|
+
onClick: () => void C(e.id),
|
|
1412
|
+
children: "Disconnect"
|
|
1413
|
+
})]
|
|
1414
|
+
}, e.id);
|
|
1415
|
+
})
|
|
1416
|
+
})
|
|
1417
|
+
}) : /* @__PURE__ */ h("p", {
|
|
1418
|
+
className: "text-sm text-muted-foreground",
|
|
1419
|
+
children: "No sign-in methods connected yet."
|
|
1420
|
+
}),
|
|
1421
|
+
x && n.length > 0 && /* @__PURE__ */ h("p", {
|
|
1422
|
+
className: "text-xs text-muted-foreground",
|
|
1423
|
+
id: c,
|
|
1424
|
+
children: dt
|
|
1425
|
+
}),
|
|
1426
|
+
y.map((e) => {
|
|
1427
|
+
let { label: t, Icon: n } = q[e];
|
|
1428
|
+
return /* @__PURE__ */ g(B, {
|
|
1429
|
+
className: "w-full",
|
|
1430
|
+
type: "button",
|
|
1431
|
+
variant: "outline",
|
|
1432
|
+
disabled: b,
|
|
1433
|
+
loading: d === e,
|
|
1434
|
+
onClick: () => void S(e),
|
|
1435
|
+
children: [/* @__PURE__ */ h(n, { "aria-hidden": "true" }), /* @__PURE__ */ g("span", {
|
|
1436
|
+
className: "flex-1",
|
|
1437
|
+
children: ["Connect ", t]
|
|
1438
|
+
})]
|
|
1439
|
+
}, e);
|
|
1440
|
+
})
|
|
1441
|
+
]
|
|
1442
|
+
}) })]
|
|
1443
|
+
})
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
//#endregion
|
|
1312
1447
|
//#region src/components/blocks/auth/login-block.tsx
|
|
1313
|
-
function
|
|
1448
|
+
function pt({ title: e = "Login to your account", description: t = "Enter your email and password to login", logo: n, accent: r, providers: i = [
|
|
1314
1449
|
"google",
|
|
1315
1450
|
"apple",
|
|
1316
1451
|
"github"
|
|
1317
1452
|
], showRememberMe: a = !0, showForgotPassword: o = !0, onSubmit: s, onProviderSelect: c, onForgotPassword: l, onSignup: u }) {
|
|
1318
|
-
let d =
|
|
1453
|
+
let d = _.useId(), f = _.useId(), [p, v] = _.useState("idle"), [y, b] = _.useState(null), [x, S] = _.useState(null), [C, w] = _.useState(!1), [T, E] = _.useState(""), [D, O] = _.useState(!1), [k, A] = _.useState(""), j = p === "loading" || x !== null, ee = k.trim().length > 0, M = D && ee;
|
|
1319
1454
|
async function N(e) {
|
|
1320
1455
|
if (e.preventDefault(), !M) return;
|
|
1321
1456
|
let t = new FormData(e.currentTarget);
|
|
@@ -1340,37 +1475,37 @@ function ut({ title: e = "Login to your account", description: t = "Enter your e
|
|
|
1340
1475
|
S(null);
|
|
1341
1476
|
}
|
|
1342
1477
|
}
|
|
1343
|
-
return /* @__PURE__ */
|
|
1478
|
+
return /* @__PURE__ */ h(Y, {
|
|
1344
1479
|
title: e,
|
|
1345
1480
|
description: t,
|
|
1346
1481
|
logo: n,
|
|
1347
1482
|
accent: r,
|
|
1348
|
-
footer:
|
|
1483
|
+
footer: p !== "success" && /* @__PURE__ */ g(m, { children: [
|
|
1349
1484
|
"Don't have an account?",
|
|
1350
1485
|
" ",
|
|
1351
|
-
/* @__PURE__ */
|
|
1486
|
+
/* @__PURE__ */ h(B, {
|
|
1352
1487
|
variant: "link",
|
|
1353
1488
|
onClick: u,
|
|
1354
1489
|
children: "Sign up"
|
|
1355
1490
|
})
|
|
1356
1491
|
] }),
|
|
1357
|
-
children: /* @__PURE__ */
|
|
1358
|
-
step:
|
|
1359
|
-
children:
|
|
1492
|
+
children: /* @__PURE__ */ h(X, {
|
|
1493
|
+
step: p === "success" ? "success" : "form",
|
|
1494
|
+
children: p === "success" ? /* @__PURE__ */ h($, {
|
|
1360
1495
|
title: "Welcome back",
|
|
1361
1496
|
description: "You are now logged in."
|
|
1362
|
-
}) : /* @__PURE__ */
|
|
1497
|
+
}) : /* @__PURE__ */ g("div", {
|
|
1363
1498
|
className: "flex flex-col gap-4",
|
|
1364
|
-
children: [/* @__PURE__ */
|
|
1499
|
+
children: [/* @__PURE__ */ g("form", {
|
|
1365
1500
|
className: "flex flex-col gap-4",
|
|
1366
1501
|
onSubmit: N,
|
|
1367
1502
|
children: [
|
|
1368
|
-
/* @__PURE__ */
|
|
1503
|
+
/* @__PURE__ */ g(U, {
|
|
1369
1504
|
name: "email",
|
|
1370
|
-
children: [/* @__PURE__ */
|
|
1505
|
+
children: [/* @__PURE__ */ h(W, {
|
|
1371
1506
|
htmlFor: d,
|
|
1372
1507
|
children: "Email"
|
|
1373
|
-
}), /* @__PURE__ */
|
|
1508
|
+
}), /* @__PURE__ */ h(G, {
|
|
1374
1509
|
id: d,
|
|
1375
1510
|
"aria-label": "Email",
|
|
1376
1511
|
name: "email",
|
|
@@ -1378,32 +1513,32 @@ function ut({ title: e = "Login to your account", description: t = "Enter your e
|
|
|
1378
1513
|
autoComplete: "email",
|
|
1379
1514
|
placeholder: "you@example.com",
|
|
1380
1515
|
required: !0,
|
|
1381
|
-
disabled:
|
|
1516
|
+
disabled: j,
|
|
1382
1517
|
value: T,
|
|
1383
1518
|
onChange: (e) => {
|
|
1384
1519
|
E(e.currentTarget.value), O(e.currentTarget.validity.valid);
|
|
1385
1520
|
}
|
|
1386
1521
|
})]
|
|
1387
1522
|
}),
|
|
1388
|
-
/* @__PURE__ */
|
|
1523
|
+
/* @__PURE__ */ h(Z, {
|
|
1389
1524
|
show: D,
|
|
1390
|
-
children: /* @__PURE__ */
|
|
1525
|
+
children: /* @__PURE__ */ g(U, {
|
|
1391
1526
|
name: "password",
|
|
1392
1527
|
children: [
|
|
1393
|
-
/* @__PURE__ */
|
|
1528
|
+
/* @__PURE__ */ h(W, {
|
|
1394
1529
|
htmlFor: "password",
|
|
1395
1530
|
children: "Password"
|
|
1396
1531
|
}),
|
|
1397
|
-
/* @__PURE__ */
|
|
1532
|
+
/* @__PURE__ */ h(K, {
|
|
1398
1533
|
id: "password",
|
|
1399
1534
|
name: "password",
|
|
1400
1535
|
autoComplete: "current-password",
|
|
1401
1536
|
required: !0,
|
|
1402
|
-
disabled:
|
|
1537
|
+
disabled: j,
|
|
1403
1538
|
value: k,
|
|
1404
|
-
onChange: (e) =>
|
|
1539
|
+
onChange: (e) => A(e.target.value)
|
|
1405
1540
|
}),
|
|
1406
|
-
o && /* @__PURE__ */
|
|
1541
|
+
o && /* @__PURE__ */ h(B, {
|
|
1407
1542
|
variant: "link",
|
|
1408
1543
|
type: "button",
|
|
1409
1544
|
className: "self-end font-normal text-muted-foreground text-xs hover:text-foreground sm:text-xs",
|
|
@@ -1413,39 +1548,39 @@ function ut({ title: e = "Login to your account", description: t = "Enter your e
|
|
|
1413
1548
|
]
|
|
1414
1549
|
})
|
|
1415
1550
|
}),
|
|
1416
|
-
a && /* @__PURE__ */
|
|
1551
|
+
a && /* @__PURE__ */ g("div", {
|
|
1417
1552
|
className: "flex items-center gap-2",
|
|
1418
|
-
children: [/* @__PURE__ */
|
|
1553
|
+
children: [/* @__PURE__ */ h(ke, {
|
|
1419
1554
|
id: f,
|
|
1420
1555
|
checked: C,
|
|
1421
1556
|
onCheckedChange: (e) => w(e),
|
|
1422
|
-
disabled:
|
|
1423
|
-
}), /* @__PURE__ */
|
|
1557
|
+
disabled: j
|
|
1558
|
+
}), /* @__PURE__ */ h(Je, {
|
|
1424
1559
|
htmlFor: f,
|
|
1425
1560
|
className: "font-normal",
|
|
1426
1561
|
children: "Remember me"
|
|
1427
1562
|
})]
|
|
1428
1563
|
}),
|
|
1429
|
-
/* @__PURE__ */
|
|
1430
|
-
/* @__PURE__ */
|
|
1564
|
+
/* @__PURE__ */ h(Q, { message: y }),
|
|
1565
|
+
/* @__PURE__ */ h(Z, {
|
|
1431
1566
|
show: M,
|
|
1432
|
-
children: /* @__PURE__ */
|
|
1433
|
-
className:
|
|
1567
|
+
children: /* @__PURE__ */ h(B, {
|
|
1568
|
+
className: R("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)]"),
|
|
1434
1569
|
type: "submit",
|
|
1435
|
-
loading:
|
|
1436
|
-
disabled:
|
|
1570
|
+
loading: p === "loading",
|
|
1571
|
+
disabled: j,
|
|
1437
1572
|
children: "Login"
|
|
1438
1573
|
})
|
|
1439
1574
|
})
|
|
1440
1575
|
]
|
|
1441
|
-
}), i.length > 0 && /* @__PURE__ */
|
|
1576
|
+
}), i.length > 0 && /* @__PURE__ */ g(Z, {
|
|
1442
1577
|
show: !M,
|
|
1443
1578
|
className: "flex flex-col gap-4",
|
|
1444
|
-
children: [/* @__PURE__ */
|
|
1579
|
+
children: [/* @__PURE__ */ h(st, { label: "Or continue with" }), /* @__PURE__ */ h(it, {
|
|
1445
1580
|
providers: i,
|
|
1446
1581
|
action: "login",
|
|
1447
1582
|
loadingProvider: x,
|
|
1448
|
-
disabled:
|
|
1583
|
+
disabled: p === "loading",
|
|
1449
1584
|
onSelect: P
|
|
1450
1585
|
})]
|
|
1451
1586
|
})]
|
|
@@ -1454,155 +1589,668 @@ function ut({ title: e = "Login to your account", description: t = "Enter your e
|
|
|
1454
1589
|
});
|
|
1455
1590
|
}
|
|
1456
1591
|
//#endregion
|
|
1592
|
+
//#region src/components/blocks/auth/onboarding/profile-step.tsx
|
|
1593
|
+
function mt(e, t) {
|
|
1594
|
+
return e.kind === "checkbox" ? typeof t == "boolean" && t : typeof t == "string" ? t : "";
|
|
1595
|
+
}
|
|
1596
|
+
function ht(e, t) {
|
|
1597
|
+
let n = e.required === !0;
|
|
1598
|
+
if (e.kind === "checkbox") return n && t !== !0 ? `${e.label} is required` : null;
|
|
1599
|
+
let r = typeof t == "string" ? t.trim() : "";
|
|
1600
|
+
if (n && r.length === 0) return `${e.label} is required`;
|
|
1601
|
+
if (e.kind === "url" && r.length > 0) try {
|
|
1602
|
+
new URL(r);
|
|
1603
|
+
} catch {
|
|
1604
|
+
return "Enter a valid URL";
|
|
1605
|
+
}
|
|
1606
|
+
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
|
+
}
|
|
1608
|
+
function gt({ step: e, values: t, submitting: n = !1, submitLabel: r, onSubmit: i, onBack: a, onDraftChange: o }) {
|
|
1609
|
+
let s = _.useId(), [c, l] = _.useState(() => Object.fromEntries(e.fields.map((e) => [e.name, mt(e, t[e.name])]))), [u, d] = _.useState({});
|
|
1610
|
+
function f(e, t) {
|
|
1611
|
+
l((n) => ({
|
|
1612
|
+
...n,
|
|
1613
|
+
[e]: t
|
|
1614
|
+
})), o?.(e, t), d((t) => t[e] ? {
|
|
1615
|
+
...t,
|
|
1616
|
+
[e]: ""
|
|
1617
|
+
} : t);
|
|
1618
|
+
}
|
|
1619
|
+
async function p(t) {
|
|
1620
|
+
if (t.preventDefault(), n) return;
|
|
1621
|
+
let r = {};
|
|
1622
|
+
for (let t of e.fields) {
|
|
1623
|
+
let e = ht(t, c[t.name]);
|
|
1624
|
+
e && (r[t.name] = e);
|
|
1625
|
+
}
|
|
1626
|
+
if (Object.keys(r).length > 0) {
|
|
1627
|
+
d(r);
|
|
1628
|
+
return;
|
|
1629
|
+
}
|
|
1630
|
+
d({});
|
|
1631
|
+
let a = {};
|
|
1632
|
+
for (let t of e.fields) {
|
|
1633
|
+
let e = c[t.name];
|
|
1634
|
+
a[t.name] = typeof e == "string" ? e.trim() : e;
|
|
1635
|
+
}
|
|
1636
|
+
await i(a);
|
|
1637
|
+
}
|
|
1638
|
+
return /* @__PURE__ */ g("form", {
|
|
1639
|
+
className: "flex flex-col gap-4",
|
|
1640
|
+
noValidate: !0,
|
|
1641
|
+
onSubmit: p,
|
|
1642
|
+
children: [e.fields.map((e) => {
|
|
1643
|
+
let t = u[e.name] || void 0, r = `${s}-${e.name}`, i = c[e.name];
|
|
1644
|
+
return e.kind === "checkbox" ? /* @__PURE__ */ g(U, {
|
|
1645
|
+
name: e.name,
|
|
1646
|
+
invalid: !!t,
|
|
1647
|
+
className: "gap-1.5",
|
|
1648
|
+
children: [/* @__PURE__ */ g("div", {
|
|
1649
|
+
className: "flex items-center gap-2",
|
|
1650
|
+
children: [/* @__PURE__ */ h(ke, {
|
|
1651
|
+
id: r,
|
|
1652
|
+
checked: i === !0,
|
|
1653
|
+
disabled: n,
|
|
1654
|
+
onCheckedChange: (t) => f(e.name, t)
|
|
1655
|
+
}), /* @__PURE__ */ h(Je, {
|
|
1656
|
+
htmlFor: r,
|
|
1657
|
+
className: "font-normal",
|
|
1658
|
+
children: e.label
|
|
1659
|
+
})]
|
|
1660
|
+
}), t && /* @__PURE__ */ h(Me, {
|
|
1661
|
+
match: !0,
|
|
1662
|
+
children: t
|
|
1663
|
+
})]
|
|
1664
|
+
}, e.name) : /* @__PURE__ */ g(U, {
|
|
1665
|
+
name: e.name,
|
|
1666
|
+
invalid: !!t,
|
|
1667
|
+
children: [
|
|
1668
|
+
/* @__PURE__ */ h(W, {
|
|
1669
|
+
htmlFor: r,
|
|
1670
|
+
children: e.label
|
|
1671
|
+
}),
|
|
1672
|
+
e.kind === "textarea" ? /* @__PURE__ */ h(Ve, {
|
|
1673
|
+
id: r,
|
|
1674
|
+
"aria-invalid": t ? !0 : void 0,
|
|
1675
|
+
disabled: n,
|
|
1676
|
+
placeholder: e.placeholder,
|
|
1677
|
+
value: String(i ?? ""),
|
|
1678
|
+
onChange: (t) => f(e.name, t.target.value)
|
|
1679
|
+
}) : e.kind === "select" ? /* @__PURE__ */ g("select", {
|
|
1680
|
+
id: r,
|
|
1681
|
+
"aria-invalid": t ? !0 : void 0,
|
|
1682
|
+
className: R("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
|
+
disabled: n,
|
|
1684
|
+
value: String(i ?? ""),
|
|
1685
|
+
onChange: (t) => f(e.name, t.target.value),
|
|
1686
|
+
children: [/* @__PURE__ */ h("option", {
|
|
1687
|
+
value: "",
|
|
1688
|
+
children: e.placeholder ?? "Choose an option"
|
|
1689
|
+
}), e.options.map((e) => /* @__PURE__ */ h("option", {
|
|
1690
|
+
value: e.value,
|
|
1691
|
+
children: e.label
|
|
1692
|
+
}, e.value))]
|
|
1693
|
+
}) : /* @__PURE__ */ h(G, {
|
|
1694
|
+
id: r,
|
|
1695
|
+
"aria-invalid": t ? !0 : void 0,
|
|
1696
|
+
disabled: n,
|
|
1697
|
+
placeholder: e.placeholder,
|
|
1698
|
+
type: e.kind === "url" ? "url" : "text",
|
|
1699
|
+
value: String(i ?? ""),
|
|
1700
|
+
onChange: (t) => f(e.name, t.target.value)
|
|
1701
|
+
}),
|
|
1702
|
+
t && /* @__PURE__ */ h(Me, {
|
|
1703
|
+
match: !0,
|
|
1704
|
+
children: t
|
|
1705
|
+
})
|
|
1706
|
+
]
|
|
1707
|
+
}, e.name);
|
|
1708
|
+
}), /* @__PURE__ */ g("div", {
|
|
1709
|
+
className: "flex gap-2",
|
|
1710
|
+
children: [a && /* @__PURE__ */ h(B, {
|
|
1711
|
+
type: "button",
|
|
1712
|
+
variant: "outline",
|
|
1713
|
+
disabled: n,
|
|
1714
|
+
onClick: a,
|
|
1715
|
+
children: "Back"
|
|
1716
|
+
}), /* @__PURE__ */ h(B, {
|
|
1717
|
+
className: "flex-1",
|
|
1718
|
+
type: "submit",
|
|
1719
|
+
loading: n,
|
|
1720
|
+
children: r
|
|
1721
|
+
})]
|
|
1722
|
+
})]
|
|
1723
|
+
});
|
|
1724
|
+
}
|
|
1725
|
+
//#endregion
|
|
1726
|
+
//#region src/components/blocks/auth/onboarding-block.tsx
|
|
1727
|
+
var _t = [{
|
|
1728
|
+
id: "profile",
|
|
1729
|
+
title: "Your profile",
|
|
1730
|
+
fields: [{
|
|
1731
|
+
kind: "text",
|
|
1732
|
+
name: "display_name",
|
|
1733
|
+
label: "Display name",
|
|
1734
|
+
required: !0
|
|
1735
|
+
}]
|
|
1736
|
+
}];
|
|
1737
|
+
function vt({ steps: e = _t, logo: t, accent: n, onStepSubmit: r, onComplete: i, showCompleteScreen: a = !0, className: o }) {
|
|
1738
|
+
let s = _.useRef(null), c = _.useRef({}), [l, u] = _.useState({}), [d, f] = _.useState(0), [p, m] = _.useState({}), [v, y] = _.useState("idle"), [b, x] = _.useState(null), S = v === "success", C = e[d], w = d >= e.length - 1;
|
|
1739
|
+
_.useEffect(() => {
|
|
1740
|
+
b || s.current?.focus();
|
|
1741
|
+
}, [
|
|
1742
|
+
d,
|
|
1743
|
+
S,
|
|
1744
|
+
b
|
|
1745
|
+
]);
|
|
1746
|
+
async function T(e) {
|
|
1747
|
+
if (!C) return;
|
|
1748
|
+
let t = {
|
|
1749
|
+
...p,
|
|
1750
|
+
...e
|
|
1751
|
+
};
|
|
1752
|
+
x(null), y("loading");
|
|
1753
|
+
try {
|
|
1754
|
+
await r?.(C.id, e), w && await i?.(t), m(t), delete c.current[C.id], u({ ...c.current }), y(w ? "success" : "idle"), w || f((e) => e + 1);
|
|
1755
|
+
} catch (e) {
|
|
1756
|
+
y("idle"), x(e instanceof Error ? e.message : "Unable to save your profile.");
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
return S && !a ? null : /* @__PURE__ */ h(Y, {
|
|
1760
|
+
title: S ? "You're all set" : C?.title ?? "Your profile",
|
|
1761
|
+
description: S ? void 0 : C?.description,
|
|
1762
|
+
logo: t,
|
|
1763
|
+
accent: n,
|
|
1764
|
+
className: o,
|
|
1765
|
+
children: /* @__PURE__ */ h(X, {
|
|
1766
|
+
step: S ? "done" : `step-${d}`,
|
|
1767
|
+
children: S ? /* @__PURE__ */ h($, {
|
|
1768
|
+
title: "Profile saved",
|
|
1769
|
+
description: "Your account is ready and your profile has been saved."
|
|
1770
|
+
}) : C ? /* @__PURE__ */ g("div", {
|
|
1771
|
+
className: "flex flex-col gap-4",
|
|
1772
|
+
children: [
|
|
1773
|
+
/* @__PURE__ */ h("nav", {
|
|
1774
|
+
"aria-label": "Onboarding progress",
|
|
1775
|
+
children: /* @__PURE__ */ h("ol", {
|
|
1776
|
+
className: "flex flex-wrap gap-x-3 gap-y-1 text-xs",
|
|
1777
|
+
children: e.map((e, t) => /* @__PURE__ */ g("li", {
|
|
1778
|
+
"aria-current": t === d ? "step" : void 0,
|
|
1779
|
+
className: R("text-muted-foreground", t === d && "font-medium text-foreground"),
|
|
1780
|
+
children: [e.title, t < d && /* @__PURE__ */ h("span", {
|
|
1781
|
+
className: "sr-only",
|
|
1782
|
+
children: " (completed)"
|
|
1783
|
+
})]
|
|
1784
|
+
}, e.id))
|
|
1785
|
+
})
|
|
1786
|
+
}),
|
|
1787
|
+
/* @__PURE__ */ h("h3", {
|
|
1788
|
+
ref: s,
|
|
1789
|
+
tabIndex: -1,
|
|
1790
|
+
className: "sr-only",
|
|
1791
|
+
children: C.title
|
|
1792
|
+
}),
|
|
1793
|
+
/* @__PURE__ */ h(Q, { message: b }),
|
|
1794
|
+
/* @__PURE__ */ h(gt, {
|
|
1795
|
+
step: C,
|
|
1796
|
+
values: {
|
|
1797
|
+
...p,
|
|
1798
|
+
...l[C.id]
|
|
1799
|
+
},
|
|
1800
|
+
submitting: v === "loading",
|
|
1801
|
+
submitLabel: w ? "Finish" : "Continue",
|
|
1802
|
+
onBack: d > 0 ? () => {
|
|
1803
|
+
x(null), u({ ...c.current }), f((e) => e - 1);
|
|
1804
|
+
} : void 0,
|
|
1805
|
+
onDraftChange: (e, t) => {
|
|
1806
|
+
c.current[C.id] = {
|
|
1807
|
+
...c.current[C.id],
|
|
1808
|
+
[e]: t
|
|
1809
|
+
};
|
|
1810
|
+
},
|
|
1811
|
+
onSubmit: T
|
|
1812
|
+
}, C.id)
|
|
1813
|
+
]
|
|
1814
|
+
}) : null
|
|
1815
|
+
})
|
|
1816
|
+
});
|
|
1817
|
+
}
|
|
1818
|
+
//#endregion
|
|
1819
|
+
//#region src/components/blocks/auth/passkey-manager-block.tsx
|
|
1820
|
+
var yt = 120, bt = "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.";
|
|
1821
|
+
function xt(e) {
|
|
1822
|
+
if (!e) return null;
|
|
1823
|
+
let t = new Date(e);
|
|
1824
|
+
return Number.isNaN(t.getTime()) ? null : t.toLocaleDateString();
|
|
1825
|
+
}
|
|
1826
|
+
function St({ title: e = "Passkeys", description: t = "Sign in without a password using your device's biometrics or security key.", passkeys: n = [], available: r = !0, loading: i = !1, onRegister: a, onRename: o, onDelete: s, className: c }) {
|
|
1827
|
+
let [l, u] = _.useState(null), [d, f] = _.useState(!1), [p, m] = _.useState(!1), [v, y] = _.useState(null), [b, x] = _.useState(""), [S, C] = _.useState(null), [w, T] = _.useState(null), E = n.length === 1;
|
|
1828
|
+
async function D(e) {
|
|
1829
|
+
if (d) return { ok: !1 };
|
|
1830
|
+
u(null), f(!0);
|
|
1831
|
+
try {
|
|
1832
|
+
return {
|
|
1833
|
+
ok: !0,
|
|
1834
|
+
result: await e()
|
|
1835
|
+
};
|
|
1836
|
+
} catch (e) {
|
|
1837
|
+
return u(e instanceof Error ? e.message : "Something went wrong."), { ok: !1 };
|
|
1838
|
+
} finally {
|
|
1839
|
+
f(!1);
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
async function O() {
|
|
1843
|
+
m(!0), await D(() => a?.()), m(!1);
|
|
1844
|
+
}
|
|
1845
|
+
function k(e) {
|
|
1846
|
+
T(null), y(e.id), x(e.name ?? ""), C(null);
|
|
1847
|
+
}
|
|
1848
|
+
async function A(e) {
|
|
1849
|
+
let t = b.trim();
|
|
1850
|
+
if (t.length < 1 || t.length > yt) {
|
|
1851
|
+
C(`Name must be between 1 and ${yt} characters.`);
|
|
1852
|
+
return;
|
|
1853
|
+
}
|
|
1854
|
+
(await D(() => o?.(e, t))).ok && (y(null), C(null));
|
|
1855
|
+
}
|
|
1856
|
+
async function j(e) {
|
|
1857
|
+
let t = await D(() => s?.(e));
|
|
1858
|
+
T(null), t.ok && v === e && y(null);
|
|
1859
|
+
}
|
|
1860
|
+
return /* @__PURE__ */ h(ne, {
|
|
1861
|
+
reducedMotion: "user",
|
|
1862
|
+
children: /* @__PURE__ */ g(he, {
|
|
1863
|
+
className: R("w-full", c),
|
|
1864
|
+
"data-slot": "auth-block",
|
|
1865
|
+
children: [/* @__PURE__ */ g(Se, { children: [/* @__PURE__ */ h(V, { children: e }), /* @__PURE__ */ h(Ce, { children: t })] }), /* @__PURE__ */ h(H, { children: r ? i ? /* @__PURE__ */ g("div", {
|
|
1866
|
+
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
1867
|
+
children: [/* @__PURE__ */ h(z, { className: "size-4" }), "Loading passkeys…"]
|
|
1868
|
+
}) : /* @__PURE__ */ g(I.div, {
|
|
1869
|
+
layout: !0,
|
|
1870
|
+
transition: {
|
|
1871
|
+
duration: .3,
|
|
1872
|
+
ease: J
|
|
1873
|
+
},
|
|
1874
|
+
className: "flex flex-col gap-3",
|
|
1875
|
+
children: [
|
|
1876
|
+
/* @__PURE__ */ h(Q, { message: l }),
|
|
1877
|
+
n.length > 0 ? /* @__PURE__ */ h("ul", {
|
|
1878
|
+
"aria-label": "Passkeys",
|
|
1879
|
+
className: "flex flex-col gap-2",
|
|
1880
|
+
children: /* @__PURE__ */ h(F, {
|
|
1881
|
+
initial: !1,
|
|
1882
|
+
children: n.map((e, t) => {
|
|
1883
|
+
let n = e.name ?? "Passkey", r = xt(e.createdAt), i = xt(e.lastUsedAt);
|
|
1884
|
+
return /* @__PURE__ */ g(I.li, {
|
|
1885
|
+
layout: !0,
|
|
1886
|
+
className: "flex flex-col gap-2 rounded-lg border px-3 py-2",
|
|
1887
|
+
initial: {
|
|
1888
|
+
opacity: 0,
|
|
1889
|
+
y: -4
|
|
1890
|
+
},
|
|
1891
|
+
animate: {
|
|
1892
|
+
opacity: 1,
|
|
1893
|
+
y: 0
|
|
1894
|
+
},
|
|
1895
|
+
exit: {
|
|
1896
|
+
opacity: 0,
|
|
1897
|
+
y: -4
|
|
1898
|
+
},
|
|
1899
|
+
transition: {
|
|
1900
|
+
duration: .25,
|
|
1901
|
+
ease: J,
|
|
1902
|
+
delay: Math.min(t, 5) * .04
|
|
1903
|
+
},
|
|
1904
|
+
children: [
|
|
1905
|
+
/* @__PURE__ */ g("div", {
|
|
1906
|
+
className: "flex items-center justify-between gap-3",
|
|
1907
|
+
children: [/* @__PURE__ */ g("div", {
|
|
1908
|
+
className: "flex min-w-0 flex-col",
|
|
1909
|
+
children: [/* @__PURE__ */ h("span", {
|
|
1910
|
+
className: "truncate font-medium text-sm",
|
|
1911
|
+
children: n
|
|
1912
|
+
}), /* @__PURE__ */ g("span", {
|
|
1913
|
+
className: "text-xs text-muted-foreground",
|
|
1914
|
+
children: [
|
|
1915
|
+
r ? `Added ${r}` : null,
|
|
1916
|
+
r && i ? " · " : null,
|
|
1917
|
+
i ? `Last used ${i}` : null
|
|
1918
|
+
]
|
|
1919
|
+
})]
|
|
1920
|
+
}), /* @__PURE__ */ g("div", {
|
|
1921
|
+
className: "flex shrink-0 gap-2",
|
|
1922
|
+
children: [/* @__PURE__ */ h(B, {
|
|
1923
|
+
"aria-label": `Rename ${n}`,
|
|
1924
|
+
size: "sm",
|
|
1925
|
+
type: "button",
|
|
1926
|
+
variant: "outline",
|
|
1927
|
+
disabled: d,
|
|
1928
|
+
onClick: () => k(e),
|
|
1929
|
+
children: "Rename"
|
|
1930
|
+
}), /* @__PURE__ */ h(B, {
|
|
1931
|
+
"aria-label": `Delete ${n}`,
|
|
1932
|
+
size: "sm",
|
|
1933
|
+
type: "button",
|
|
1934
|
+
variant: "destructive-outline",
|
|
1935
|
+
disabled: d,
|
|
1936
|
+
onClick: () => {
|
|
1937
|
+
y(null), T(e.id);
|
|
1938
|
+
},
|
|
1939
|
+
children: "Delete"
|
|
1940
|
+
})]
|
|
1941
|
+
})]
|
|
1942
|
+
}),
|
|
1943
|
+
/* @__PURE__ */ h(Z, {
|
|
1944
|
+
show: v === e.id,
|
|
1945
|
+
children: /* @__PURE__ */ g("form", {
|
|
1946
|
+
className: "flex items-start gap-2 pt-1",
|
|
1947
|
+
onSubmit: (t) => {
|
|
1948
|
+
t.preventDefault(), A(e.id);
|
|
1949
|
+
},
|
|
1950
|
+
children: [
|
|
1951
|
+
/* @__PURE__ */ g(U, {
|
|
1952
|
+
className: "min-w-0 grow",
|
|
1953
|
+
invalid: !!S,
|
|
1954
|
+
children: [
|
|
1955
|
+
/* @__PURE__ */ h(W, {
|
|
1956
|
+
className: "sr-only",
|
|
1957
|
+
children: "Passkey name"
|
|
1958
|
+
}),
|
|
1959
|
+
/* @__PURE__ */ h(G, {
|
|
1960
|
+
"aria-label": "Passkey name",
|
|
1961
|
+
"aria-invalid": S ? !0 : void 0,
|
|
1962
|
+
autoFocus: !0,
|
|
1963
|
+
disabled: d,
|
|
1964
|
+
maxLength: 121,
|
|
1965
|
+
value: b,
|
|
1966
|
+
onChange: (e) => x(e.target.value)
|
|
1967
|
+
}),
|
|
1968
|
+
S && /* @__PURE__ */ h(Me, {
|
|
1969
|
+
match: !0,
|
|
1970
|
+
children: S
|
|
1971
|
+
})
|
|
1972
|
+
]
|
|
1973
|
+
}),
|
|
1974
|
+
/* @__PURE__ */ h(B, {
|
|
1975
|
+
size: "sm",
|
|
1976
|
+
type: "submit",
|
|
1977
|
+
loading: d,
|
|
1978
|
+
children: "Save"
|
|
1979
|
+
}),
|
|
1980
|
+
/* @__PURE__ */ h(B, {
|
|
1981
|
+
size: "sm",
|
|
1982
|
+
type: "button",
|
|
1983
|
+
variant: "ghost",
|
|
1984
|
+
disabled: d,
|
|
1985
|
+
onClick: () => y(null),
|
|
1986
|
+
children: "Cancel"
|
|
1987
|
+
})
|
|
1988
|
+
]
|
|
1989
|
+
})
|
|
1990
|
+
}),
|
|
1991
|
+
/* @__PURE__ */ h(Z, {
|
|
1992
|
+
show: w === e.id,
|
|
1993
|
+
children: /* @__PURE__ */ g("div", {
|
|
1994
|
+
className: "flex flex-col gap-2 rounded-lg bg-muted/50 p-2",
|
|
1995
|
+
role: "alertdialog",
|
|
1996
|
+
"aria-label": `Confirm deleting ${n}`,
|
|
1997
|
+
children: [
|
|
1998
|
+
/* @__PURE__ */ h("p", {
|
|
1999
|
+
className: "text-sm",
|
|
2000
|
+
children: "Delete this passkey? It can no longer be used to sign in."
|
|
2001
|
+
}),
|
|
2002
|
+
E && /* @__PURE__ */ h("p", {
|
|
2003
|
+
className: "text-xs text-destructive-foreground",
|
|
2004
|
+
children: bt
|
|
2005
|
+
}),
|
|
2006
|
+
/* @__PURE__ */ g("div", {
|
|
2007
|
+
className: "flex gap-2",
|
|
2008
|
+
children: [/* @__PURE__ */ h(B, {
|
|
2009
|
+
size: "sm",
|
|
2010
|
+
type: "button",
|
|
2011
|
+
variant: "destructive",
|
|
2012
|
+
loading: d,
|
|
2013
|
+
onClick: () => void j(e.id),
|
|
2014
|
+
children: "Delete passkey"
|
|
2015
|
+
}), /* @__PURE__ */ h(B, {
|
|
2016
|
+
size: "sm",
|
|
2017
|
+
type: "button",
|
|
2018
|
+
variant: "ghost",
|
|
2019
|
+
disabled: d,
|
|
2020
|
+
onClick: () => T(null),
|
|
2021
|
+
children: "Keep it"
|
|
2022
|
+
})]
|
|
2023
|
+
})
|
|
2024
|
+
]
|
|
2025
|
+
})
|
|
2026
|
+
})
|
|
2027
|
+
]
|
|
2028
|
+
}, e.id);
|
|
2029
|
+
})
|
|
2030
|
+
})
|
|
2031
|
+
}) : /* @__PURE__ */ h("p", {
|
|
2032
|
+
className: "text-sm text-muted-foreground",
|
|
2033
|
+
children: "No passkeys registered yet. Add one to sign in without a password."
|
|
2034
|
+
}),
|
|
2035
|
+
/* @__PURE__ */ h(B, {
|
|
2036
|
+
className: "w-full",
|
|
2037
|
+
type: "button",
|
|
2038
|
+
variant: "outline",
|
|
2039
|
+
disabled: d,
|
|
2040
|
+
loading: p,
|
|
2041
|
+
onClick: () => void O(),
|
|
2042
|
+
children: "Add a passkey"
|
|
2043
|
+
})
|
|
2044
|
+
]
|
|
2045
|
+
}) : /* @__PURE__ */ h("p", {
|
|
2046
|
+
className: "text-sm text-muted-foreground",
|
|
2047
|
+
children: "Passkeys aren't available on this device. You can manage them from a device that supports passkeys."
|
|
2048
|
+
}) })]
|
|
2049
|
+
})
|
|
2050
|
+
});
|
|
2051
|
+
}
|
|
2052
|
+
//#endregion
|
|
2053
|
+
//#region src/components/blocks/auth/passkey-sign-in-block.tsx
|
|
2054
|
+
function Ct({ 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: i }) {
|
|
2055
|
+
let [a, o] = _.useState(null), [s, c] = _.useState(!1);
|
|
2056
|
+
if (!e) return null;
|
|
2057
|
+
async function u() {
|
|
2058
|
+
if (!s) {
|
|
2059
|
+
o(null), c(!0);
|
|
2060
|
+
try {
|
|
2061
|
+
await n?.();
|
|
2062
|
+
} catch (e) {
|
|
2063
|
+
o(e instanceof Error ? e.message : "Unable to sign in with a passkey.");
|
|
2064
|
+
} finally {
|
|
2065
|
+
c(!1);
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
return /* @__PURE__ */ g("div", {
|
|
2070
|
+
className: R("flex w-full flex-col gap-2", i),
|
|
2071
|
+
children: [
|
|
2072
|
+
/* @__PURE__ */ g(B, {
|
|
2073
|
+
variant: "outline",
|
|
2074
|
+
className: "w-full",
|
|
2075
|
+
type: "button",
|
|
2076
|
+
loading: s,
|
|
2077
|
+
onClick: () => void u(),
|
|
2078
|
+
children: [/* @__PURE__ */ h(l, { "aria-hidden": "true" }), /* @__PURE__ */ h("span", {
|
|
2079
|
+
className: "flex-1",
|
|
2080
|
+
children: t
|
|
2081
|
+
})]
|
|
2082
|
+
}),
|
|
2083
|
+
/* @__PURE__ */ h(Q, { message: a }),
|
|
2084
|
+
/* @__PURE__ */ h(Z, {
|
|
2085
|
+
show: !!a && !!r,
|
|
2086
|
+
children: /* @__PURE__ */ h("p", {
|
|
2087
|
+
className: "text-xs text-muted-foreground",
|
|
2088
|
+
children: r
|
|
2089
|
+
})
|
|
2090
|
+
})
|
|
2091
|
+
]
|
|
2092
|
+
});
|
|
2093
|
+
}
|
|
2094
|
+
//#endregion
|
|
1457
2095
|
//#region src/components/blocks/auth/signup-block.tsx
|
|
1458
|
-
function
|
|
2096
|
+
function wt({ title: e = "Create your account", description: t = "Start exploring manuscripts in minutes", logo: n, accent: r, providers: i = [
|
|
1459
2097
|
"google",
|
|
1460
2098
|
"apple",
|
|
1461
2099
|
"github"
|
|
1462
|
-
], showNameField: a = !0, showTerms: o = !0,
|
|
1463
|
-
let
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
2100
|
+
], showNameField: a = !0, showTerms: o = !0, termsChecked: s, defaultTermsChecked: c = !1, onTermsCheckedChange: l, enforceStrongPassword: u = !0, onSubmit: d, termsComponent: f, onProviderSelect: p, onLogin: v, onTerms: y }) {
|
|
2101
|
+
let b = _.useId(), x = _.useId(), S = _.useId(), C = _.useId(), [w, T] = _.useState("idle"), [E, D] = _.useState(null), [O, k] = _.useState(null), [A, j] = _.useState(""), [ee, M] = _.useState(c), N = s ?? ee;
|
|
2102
|
+
function P(e) {
|
|
2103
|
+
s === void 0 && M(e), l?.(e);
|
|
2104
|
+
}
|
|
2105
|
+
let [te, F] = _.useState(!1), [ne, I] = _.useState(!1), L = w === "loading" || O !== null, re = !u || tt(A) === et.length, ie = A.trim().length > 0 && re, ae = (!a || ne) && te && ie;
|
|
2106
|
+
async function z(e) {
|
|
2107
|
+
if (e.preventDefault(), D(null), !re) {
|
|
2108
|
+
D("Please meet all password requirements.");
|
|
1467
2109
|
return;
|
|
1468
2110
|
}
|
|
1469
|
-
if (o && !
|
|
1470
|
-
|
|
2111
|
+
if (o && !N) {
|
|
2112
|
+
D("Please accept the terms to continue.");
|
|
1471
2113
|
return;
|
|
1472
2114
|
}
|
|
1473
2115
|
let t = new FormData(e.currentTarget);
|
|
1474
|
-
|
|
2116
|
+
T("loading");
|
|
1475
2117
|
try {
|
|
1476
|
-
await
|
|
2118
|
+
await d?.({
|
|
1477
2119
|
name: String(t.get("name") ?? ""),
|
|
1478
2120
|
email: String(t.get("email") ?? ""),
|
|
1479
|
-
password:
|
|
1480
|
-
}),
|
|
2121
|
+
password: A
|
|
2122
|
+
}), T("success");
|
|
1481
2123
|
} catch (e) {
|
|
1482
|
-
|
|
2124
|
+
T("idle"), D(e instanceof Error ? e.message : "Unable to create account.");
|
|
1483
2125
|
}
|
|
1484
2126
|
}
|
|
1485
|
-
async function
|
|
1486
|
-
|
|
2127
|
+
async function oe(e) {
|
|
2128
|
+
D(null), k(e);
|
|
1487
2129
|
try {
|
|
1488
|
-
await
|
|
2130
|
+
await p?.(e), T("success");
|
|
1489
2131
|
} catch (e) {
|
|
1490
|
-
|
|
2132
|
+
D(e instanceof Error ? e.message : "Unable to create account.");
|
|
1491
2133
|
} finally {
|
|
1492
|
-
|
|
2134
|
+
k(null);
|
|
1493
2135
|
}
|
|
1494
2136
|
}
|
|
1495
|
-
return /* @__PURE__ */
|
|
2137
|
+
return /* @__PURE__ */ h(Y, {
|
|
1496
2138
|
title: e,
|
|
1497
2139
|
description: t,
|
|
1498
2140
|
logo: n,
|
|
1499
2141
|
accent: r,
|
|
1500
|
-
footer:
|
|
2142
|
+
footer: w !== "success" && /* @__PURE__ */ g(m, { children: [
|
|
1501
2143
|
"Already have an account?",
|
|
1502
2144
|
" ",
|
|
1503
|
-
/* @__PURE__ */
|
|
2145
|
+
/* @__PURE__ */ h(B, {
|
|
1504
2146
|
variant: "link",
|
|
1505
|
-
onClick:
|
|
2147
|
+
onClick: v,
|
|
1506
2148
|
children: "Login"
|
|
1507
2149
|
})
|
|
1508
2150
|
] }),
|
|
1509
|
-
children: /* @__PURE__ */
|
|
1510
|
-
step:
|
|
1511
|
-
children:
|
|
2151
|
+
children: /* @__PURE__ */ h(X, {
|
|
2152
|
+
step: w === "success" ? "success" : "form",
|
|
2153
|
+
children: w === "success" ? /* @__PURE__ */ h($, {
|
|
1512
2154
|
title: "Account created",
|
|
1513
2155
|
description: "Check your inbox to confirm your email address."
|
|
1514
|
-
}) : /* @__PURE__ */
|
|
2156
|
+
}) : /* @__PURE__ */ g("div", {
|
|
1515
2157
|
className: "flex flex-col gap-4",
|
|
1516
|
-
children: [i.length > 0 && /* @__PURE__ */
|
|
1517
|
-
show: !
|
|
2158
|
+
children: [i.length > 0 && /* @__PURE__ */ g(Z, {
|
|
2159
|
+
show: !ae,
|
|
1518
2160
|
className: "flex flex-col gap-4",
|
|
1519
|
-
children: [/* @__PURE__ */
|
|
2161
|
+
children: [/* @__PURE__ */ h(it, {
|
|
1520
2162
|
providers: i,
|
|
1521
2163
|
action: "signup",
|
|
1522
|
-
loadingProvider:
|
|
1523
|
-
disabled:
|
|
1524
|
-
onSelect:
|
|
1525
|
-
}), /* @__PURE__ */
|
|
1526
|
-
}), /* @__PURE__ */
|
|
2164
|
+
loadingProvider: O,
|
|
2165
|
+
disabled: w === "loading",
|
|
2166
|
+
onSelect: oe
|
|
2167
|
+
}), /* @__PURE__ */ h(st, { label: "Or with email" })]
|
|
2168
|
+
}), /* @__PURE__ */ g("form", {
|
|
1527
2169
|
className: "flex flex-col gap-4",
|
|
1528
|
-
onSubmit:
|
|
2170
|
+
onSubmit: z,
|
|
1529
2171
|
children: [
|
|
1530
|
-
a && /* @__PURE__ */
|
|
2172
|
+
a && /* @__PURE__ */ g(U, {
|
|
1531
2173
|
name: "name",
|
|
1532
|
-
children: [/* @__PURE__ */
|
|
1533
|
-
htmlFor:
|
|
2174
|
+
children: [/* @__PURE__ */ h(W, {
|
|
2175
|
+
htmlFor: b,
|
|
1534
2176
|
children: "Name"
|
|
1535
|
-
}), /* @__PURE__ */
|
|
2177
|
+
}), /* @__PURE__ */ h(G, {
|
|
1536
2178
|
"aria-label": "Name",
|
|
1537
|
-
id:
|
|
2179
|
+
id: b,
|
|
1538
2180
|
name: "name",
|
|
1539
2181
|
autoComplete: "name",
|
|
1540
2182
|
placeholder: "Your name",
|
|
1541
2183
|
required: !0,
|
|
1542
|
-
disabled:
|
|
1543
|
-
onChange: (e) =>
|
|
2184
|
+
disabled: L,
|
|
2185
|
+
onChange: (e) => I(e.currentTarget.validity.valid)
|
|
1544
2186
|
})]
|
|
1545
2187
|
}),
|
|
1546
|
-
/* @__PURE__ */
|
|
2188
|
+
/* @__PURE__ */ g(U, {
|
|
1547
2189
|
name: "email",
|
|
1548
|
-
children: [/* @__PURE__ */
|
|
1549
|
-
htmlFor:
|
|
2190
|
+
children: [/* @__PURE__ */ h(W, {
|
|
2191
|
+
htmlFor: x,
|
|
1550
2192
|
children: "Email"
|
|
1551
|
-
}), /* @__PURE__ */
|
|
1552
|
-
id:
|
|
2193
|
+
}), /* @__PURE__ */ h(G, {
|
|
2194
|
+
id: x,
|
|
1553
2195
|
name: "email",
|
|
1554
2196
|
type: "email",
|
|
2197
|
+
"aria-label": "Email",
|
|
1555
2198
|
autoComplete: "email",
|
|
1556
2199
|
placeholder: "you@example.com",
|
|
1557
2200
|
required: !0,
|
|
1558
|
-
disabled:
|
|
1559
|
-
onChange: (e) =>
|
|
2201
|
+
disabled: L,
|
|
2202
|
+
onChange: (e) => F(e.currentTarget.validity.valid)
|
|
1560
2203
|
})]
|
|
1561
2204
|
}),
|
|
1562
|
-
/* @__PURE__ */
|
|
1563
|
-
show:
|
|
1564
|
-
children: /* @__PURE__ */
|
|
2205
|
+
/* @__PURE__ */ h(Z, {
|
|
2206
|
+
show: te,
|
|
2207
|
+
children: /* @__PURE__ */ g(U, {
|
|
1565
2208
|
name: "password",
|
|
1566
|
-
children: [/* @__PURE__ */
|
|
2209
|
+
children: [/* @__PURE__ */ h(W, {
|
|
2210
|
+
htmlFor: S,
|
|
2211
|
+
children: "Password"
|
|
2212
|
+
}), /* @__PURE__ */ h(K, {
|
|
2213
|
+
id: S,
|
|
1567
2214
|
name: "password",
|
|
2215
|
+
"aria-label": "Password",
|
|
1568
2216
|
autoComplete: "new-password",
|
|
1569
2217
|
placeholder: "Create a password",
|
|
1570
2218
|
showStrength: !0,
|
|
1571
2219
|
required: !0,
|
|
1572
|
-
disabled:
|
|
1573
|
-
value:
|
|
1574
|
-
onChange: (e) =>
|
|
2220
|
+
disabled: L,
|
|
2221
|
+
value: A,
|
|
2222
|
+
onChange: (e) => j(e.target.value)
|
|
1575
2223
|
})]
|
|
1576
2224
|
})
|
|
1577
2225
|
}),
|
|
1578
|
-
o && /* @__PURE__ */
|
|
2226
|
+
o && /* @__PURE__ */ g("div", {
|
|
1579
2227
|
className: "flex items-center gap-2",
|
|
1580
|
-
children: [/* @__PURE__ */
|
|
1581
|
-
id:
|
|
1582
|
-
checked:
|
|
1583
|
-
onCheckedChange: (e) =>
|
|
1584
|
-
disabled:
|
|
1585
|
-
}), /* @__PURE__ */
|
|
1586
|
-
htmlFor:
|
|
2228
|
+
children: [/* @__PURE__ */ h(ke, {
|
|
2229
|
+
id: C,
|
|
2230
|
+
checked: N,
|
|
2231
|
+
onCheckedChange: (e) => P(e === !0),
|
|
2232
|
+
disabled: L
|
|
2233
|
+
}), /* @__PURE__ */ g(Je, {
|
|
2234
|
+
htmlFor: C,
|
|
1587
2235
|
className: "font-normal",
|
|
1588
2236
|
children: [
|
|
1589
2237
|
"I agree to the",
|
|
1590
2238
|
" ",
|
|
1591
|
-
/* @__PURE__ */
|
|
2239
|
+
f ?? /* @__PURE__ */ h(B, {
|
|
1592
2240
|
variant: "link",
|
|
1593
2241
|
type: "button",
|
|
1594
|
-
onClick:
|
|
2242
|
+
onClick: y,
|
|
1595
2243
|
children: "terms"
|
|
1596
2244
|
})
|
|
1597
2245
|
]
|
|
1598
2246
|
})]
|
|
1599
2247
|
}),
|
|
1600
|
-
/* @__PURE__ */
|
|
1601
|
-
/* @__PURE__ */
|
|
1602
|
-
className:
|
|
2248
|
+
/* @__PURE__ */ h(Q, { message: E }),
|
|
2249
|
+
/* @__PURE__ */ h(B, {
|
|
2250
|
+
className: R("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)]"),
|
|
1603
2251
|
type: "submit",
|
|
1604
|
-
loading:
|
|
1605
|
-
disabled:
|
|
2252
|
+
loading: w === "loading",
|
|
2253
|
+
disabled: L,
|
|
1606
2254
|
children: "Create account"
|
|
1607
2255
|
})
|
|
1608
2256
|
]
|
|
@@ -1612,6 +2260,88 @@ function dt({ title: e = "Create your account", description: t = "Start explorin
|
|
|
1612
2260
|
});
|
|
1613
2261
|
}
|
|
1614
2262
|
//#endregion
|
|
1615
|
-
|
|
2263
|
+
//#region src/components/blocks/auth/update-password-block.tsx
|
|
2264
|
+
function Tt({ title: e = "Update your password", description: t = "Choose a new password for your account", logo: n, accent: r, minStrength: i = 4, onSubmit: a, onDone: o }) {
|
|
2265
|
+
let s = _.useId(), c = _.useId(), [l, u] = _.useState("idle"), [d, f] = _.useState(null), [p, m] = _.useState(""), [v, y] = _.useState(""), b = tt(p) >= i, x = v.length > 0 && v === p, S = b && x, C = v.length > 0 && !p.startsWith(v);
|
|
2266
|
+
async function w(e) {
|
|
2267
|
+
if (e.preventDefault(), S) {
|
|
2268
|
+
f(null), u("loading");
|
|
2269
|
+
try {
|
|
2270
|
+
await a?.({ password: p }), u("success");
|
|
2271
|
+
} catch (e) {
|
|
2272
|
+
u("idle"), f(e instanceof Error ? e.message : "Unable to update password.");
|
|
2273
|
+
}
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
|
+
return /* @__PURE__ */ h(Y, {
|
|
2277
|
+
title: e,
|
|
2278
|
+
description: t,
|
|
2279
|
+
logo: n,
|
|
2280
|
+
accent: r,
|
|
2281
|
+
children: /* @__PURE__ */ h(X, {
|
|
2282
|
+
step: l === "success" ? "success" : "form",
|
|
2283
|
+
children: l === "success" ? /* @__PURE__ */ h($, {
|
|
2284
|
+
title: "Password updated",
|
|
2285
|
+
description: "Your password has been changed successfully.",
|
|
2286
|
+
children: o && /* @__PURE__ */ h(B, {
|
|
2287
|
+
variant: "link",
|
|
2288
|
+
onClick: o,
|
|
2289
|
+
children: "Continue"
|
|
2290
|
+
})
|
|
2291
|
+
}) : /* @__PURE__ */ g("form", {
|
|
2292
|
+
className: "flex flex-col gap-4",
|
|
2293
|
+
onSubmit: w,
|
|
2294
|
+
children: [
|
|
2295
|
+
/* @__PURE__ */ g(U, {
|
|
2296
|
+
name: "password",
|
|
2297
|
+
children: [/* @__PURE__ */ h(W, {
|
|
2298
|
+
htmlFor: s,
|
|
2299
|
+
children: "New password"
|
|
2300
|
+
}), /* @__PURE__ */ h(K, {
|
|
2301
|
+
id: s,
|
|
2302
|
+
name: "password",
|
|
2303
|
+
autoComplete: "new-password",
|
|
2304
|
+
required: !0,
|
|
2305
|
+
showStrength: !0,
|
|
2306
|
+
disabled: l === "loading",
|
|
2307
|
+
value: p,
|
|
2308
|
+
onChange: (e) => m(e.target.value)
|
|
2309
|
+
})]
|
|
2310
|
+
}),
|
|
2311
|
+
/* @__PURE__ */ h(Z, {
|
|
2312
|
+
show: b,
|
|
2313
|
+
children: /* @__PURE__ */ g(U, {
|
|
2314
|
+
name: "confirmPassword",
|
|
2315
|
+
children: [/* @__PURE__ */ h(W, {
|
|
2316
|
+
htmlFor: c,
|
|
2317
|
+
children: "Confirm new password"
|
|
2318
|
+
}), /* @__PURE__ */ h(K, {
|
|
2319
|
+
id: c,
|
|
2320
|
+
name: "confirmPassword",
|
|
2321
|
+
autoComplete: "new-password",
|
|
2322
|
+
required: !0,
|
|
2323
|
+
disabled: l === "loading",
|
|
2324
|
+
value: v,
|
|
2325
|
+
onChange: (e) => y(e.target.value)
|
|
2326
|
+
})]
|
|
2327
|
+
})
|
|
2328
|
+
}),
|
|
2329
|
+
/* @__PURE__ */ h(Q, { message: d ?? (C ? "Passwords do not match." : null) }),
|
|
2330
|
+
/* @__PURE__ */ h(Z, {
|
|
2331
|
+
show: S,
|
|
2332
|
+
children: /* @__PURE__ */ h(B, {
|
|
2333
|
+
className: R("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
|
+
type: "submit",
|
|
2335
|
+
loading: l === "loading",
|
|
2336
|
+
children: "Update password"
|
|
2337
|
+
})
|
|
2338
|
+
})
|
|
2339
|
+
]
|
|
2340
|
+
})
|
|
2341
|
+
})
|
|
2342
|
+
});
|
|
2343
|
+
}
|
|
2344
|
+
//#endregion
|
|
2345
|
+
export { Y as AuthCard, Q as AuthError, st as AuthSeparator, $ as AuthSuccess, B as Button, he as Card, we as CardAction, H as CardContent, H as CardPanel, Ce as CardDescription, Te as CardFooter, ge as CardFrame, be as CardFrameAction, ye as CardFrameDescription, xe as CardFrameFooter, _e as CardFrameHeader, ve as CardFrameTitle, Se as CardHeader, V as CardTitle, ke as Checkbox, T as CheckboxPrimitive, lt as CodeAuthBlock, _t as DEFAULT_ONBOARDING_STEPS, J as EASE, U as Field, Ne as FieldControl, je as FieldDescription, Me as FieldError, Ae as FieldItem, W as FieldLabel, Pe as FieldValidity, ut as ForgotPasswordBlock, Fe as Frame, ze as FrameDescription, Be as FrameFooter, Le as FrameHeader, Ie as FramePanel, Re as FrameTitle, G as Input, Ue as InputGroup, We as InputGroupAddon, Ke as InputGroupInput, Ge as InputGroupText, qe as InputGroupTextarea, N as InputPrimitive, Je as Label, ft as LinkedAccountsBlock, pt as LoginBlock, X as MorphStep, Xe as OTPField, Ze as OTPFieldInput, P as OTPFieldPrimitive, Qe as OTPFieldSeparator, vt as OnboardingBlock, St as PasskeyManagerBlock, Ct as PasskeySignInBlock, K as PasswordInput, Z as Reveal, q as SOCIAL_PROVIDERS, Ye as Separator, te as SeparatorPrimitive, wt as SignupBlock, it as SocialProviders, z as Spinner, Ve as Textarea, Tt as UpdatePasswordBlock, ot as authAccentActionStyles, at as authAccentVars, De as bindSounds, me as buttonVariants, R as cn, tt as getPasswordStrength, et as passwordRequirements, Oe as playCue, O as playSound, k as setSoundEnabled, A as setSoundVolume, j as sounds, ct as useCountdown };
|
|
1616
2346
|
|
|
1617
2347
|
//# sourceMappingURL=index.js.map
|