@cellarnode/auth 0.4.0 → 0.6.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/react/input-otp-slots.d.ts +2 -2
- package/dist/react/input-otp-slots.d.ts.map +1 -1
- package/dist/react/input-otp-slots.js +68 -7
- package/dist/react/input-otp-slots.js.map +1 -1
- package/dist/react/login-form.d.ts +11 -2
- package/dist/react/login-form.d.ts.map +1 -1
- package/dist/react/login-form.js +52 -38
- package/dist/react/login-form.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,9 +4,9 @@ export type InputOTPProps = React.ComponentProps<typeof OTPInput> & {
|
|
|
4
4
|
containerClassName?: string;
|
|
5
5
|
};
|
|
6
6
|
export declare function InputOTP({ containerClassName, ...props }: InputOTPProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare function InputOTPGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function InputOTPGroup({ className, style, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export declare function InputOTPSlot({ index, className, ...props }: React.ComponentProps<"div"> & {
|
|
9
9
|
index: number;
|
|
10
10
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
-
export declare function InputOTPSeparator(props: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function InputOTPSeparator({ style, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
//# sourceMappingURL=input-otp-slots.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-otp-slots.d.ts","sourceRoot":"","sources":["../../src/react/input-otp-slots.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAmB,MAAM,WAAW,CAAC;AAItD,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,GAAG;IAClE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,wBAAgB,QAAQ,CAAC,EAAE,kBAAkB,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,2CAWvE;AAED,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"input-otp-slots.d.ts","sourceRoot":"","sources":["../../src/react/input-otp-slots.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAmB,MAAM,WAAW,CAAC;AAItD,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,GAAG;IAClE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,wBAAgB,QAAQ,CAAC,EAAE,kBAAkB,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,2CAWvE;AAED,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAS7B;AAED,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,kDA2FjD;AAED,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAkB7B"}
|
|
@@ -3,12 +3,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { OTPInput, OTPInputContext } from "input-otp";
|
|
5
5
|
import { clsx } from "clsx";
|
|
6
|
-
import {
|
|
6
|
+
import { Dot } from "lucide-react";
|
|
7
7
|
export function InputOTP({ containerClassName, ...props }) {
|
|
8
|
-
return (_jsx(OTPInput, { "data-slot": "input-otp", containerClassName: clsx("flex items-center
|
|
8
|
+
return (_jsx(OTPInput, { "data-slot": "input-otp", containerClassName: clsx("flex items-center has-disabled:opacity-50", containerClassName), ...props }));
|
|
9
9
|
}
|
|
10
|
-
export function InputOTPGroup({ className, ...props }) {
|
|
11
|
-
return (_jsx("div", { "data-slot": "input-otp-group",
|
|
10
|
+
export function InputOTPGroup({ className, style, ...props }) {
|
|
11
|
+
return (_jsx("div", { "data-slot": "input-otp-group", style: { display: "flex", alignItems: "center", gap: "8px", ...style }, className: className, ...props }));
|
|
12
12
|
}
|
|
13
13
|
export function InputOTPSlot({ index, className, ...props }) {
|
|
14
14
|
const inputOTPContext = React.useContext(OTPInputContext);
|
|
@@ -16,9 +16,70 @@ export function InputOTPSlot({ index, className, ...props }) {
|
|
|
16
16
|
if (!slot)
|
|
17
17
|
return null;
|
|
18
18
|
const { char, hasFakeCaret, isActive } = slot;
|
|
19
|
-
return (_jsxs("div", { "data-slot": "input-otp-slot", "data-active": isActive
|
|
19
|
+
return (_jsxs("div", { "data-slot": "input-otp-slot", "data-active": isActive || undefined, "data-filled": !!char || undefined, style: {
|
|
20
|
+
position: "relative",
|
|
21
|
+
display: "flex",
|
|
22
|
+
alignItems: "center",
|
|
23
|
+
justifyContent: "center",
|
|
24
|
+
width: "52px",
|
|
25
|
+
height: "60px",
|
|
26
|
+
borderRadius: "12px",
|
|
27
|
+
fontSize: "24px",
|
|
28
|
+
fontWeight: 600,
|
|
29
|
+
lineHeight: 1,
|
|
30
|
+
transition: "all 150ms ease",
|
|
31
|
+
border: isActive
|
|
32
|
+
? "2px solid var(--primary, #2d6a5e)"
|
|
33
|
+
: char
|
|
34
|
+
? "2px solid var(--border, #d1d5db)"
|
|
35
|
+
: "2px solid var(--border, #d1d5db)",
|
|
36
|
+
background: char
|
|
37
|
+
? "var(--accent, #f1f5f9)"
|
|
38
|
+
: "var(--background, #ffffff)",
|
|
39
|
+
color: "var(--foreground, #0f172a)",
|
|
40
|
+
boxShadow: isActive
|
|
41
|
+
? "0 0 0 3px color-mix(in oklab, var(--primary, #2d6a5e) 20%, transparent), 0 1px 2px 0 rgba(0,0,0,0.05)"
|
|
42
|
+
: "0 1px 2px 0 rgba(0,0,0,0.05)",
|
|
43
|
+
}, className: className, ...props, children: [char && (_jsx("span", { style: { animation: "fadeInSlot 150ms ease" }, children: char })), !char && !hasFakeCaret && !isActive && (_jsx("span", { style: {
|
|
44
|
+
width: "8px",
|
|
45
|
+
height: "8px",
|
|
46
|
+
borderRadius: "50%",
|
|
47
|
+
background: "var(--muted-foreground, #94a3b8)",
|
|
48
|
+
opacity: 0.25,
|
|
49
|
+
} })), hasFakeCaret && (_jsx("div", { style: {
|
|
50
|
+
position: "absolute",
|
|
51
|
+
inset: 0,
|
|
52
|
+
display: "flex",
|
|
53
|
+
alignItems: "center",
|
|
54
|
+
justifyContent: "center",
|
|
55
|
+
pointerEvents: "none",
|
|
56
|
+
}, children: _jsx("div", { style: {
|
|
57
|
+
width: "2px",
|
|
58
|
+
height: "24px",
|
|
59
|
+
borderRadius: "1px",
|
|
60
|
+
background: "var(--primary, #2d6a5e)",
|
|
61
|
+
animation: "caretBlink 1.1s ease infinite",
|
|
62
|
+
} }) })), _jsx("style", { dangerouslySetInnerHTML: {
|
|
63
|
+
__html: `
|
|
64
|
+
@keyframes caretBlink {
|
|
65
|
+
0%, 70% { opacity: 1; }
|
|
66
|
+
71%, 100% { opacity: 0; }
|
|
67
|
+
}
|
|
68
|
+
@keyframes fadeInSlot {
|
|
69
|
+
from { opacity: 0; transform: scale(0.8); }
|
|
70
|
+
to { opacity: 1; transform: scale(1); }
|
|
71
|
+
}
|
|
72
|
+
`,
|
|
73
|
+
} })] }));
|
|
20
74
|
}
|
|
21
|
-
export function InputOTPSeparator(props) {
|
|
22
|
-
return (_jsx("div", { "data-slot": "input-otp-separator", role: "separator",
|
|
75
|
+
export function InputOTPSeparator({ style, ...props }) {
|
|
76
|
+
return (_jsx("div", { "data-slot": "input-otp-separator", role: "separator", style: {
|
|
77
|
+
display: "flex",
|
|
78
|
+
alignItems: "center",
|
|
79
|
+
justifyContent: "center",
|
|
80
|
+
width: "16px",
|
|
81
|
+
color: "var(--muted-foreground, #94a3b8)",
|
|
82
|
+
...style,
|
|
83
|
+
}, ...props, children: _jsx(Dot, { style: { width: "24px", height: "24px" } }) }));
|
|
23
84
|
}
|
|
24
85
|
//# sourceMappingURL=input-otp-slots.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-otp-slots.js","sourceRoot":"","sources":["../../src/react/input-otp-slots.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"input-otp-slots.js","sourceRoot":"","sources":["../../src/react/input-otp-slots.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAMnC,MAAM,UAAU,QAAQ,CAAC,EAAE,kBAAkB,EAAE,GAAG,KAAK,EAAiB;IACtE,OAAO,CACL,KAAC,QAAQ,iBACG,WAAW,EACrB,kBAAkB,EAAE,IAAI,CACtB,2CAA2C,EAC3C,kBAAkB,CACnB,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC;A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IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAI,GAC7C,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { AuthApi, AuthStore } from "../types.js";
|
|
2
3
|
export interface LoginFormProps {
|
|
3
4
|
userType: "importer" | "producer";
|
|
@@ -12,12 +13,20 @@ export interface LoginFormProps {
|
|
|
12
13
|
initialEmail?: string;
|
|
13
14
|
theme?: "light" | "dark";
|
|
14
15
|
onResendSuccess?: () => void;
|
|
15
|
-
/** Static footer text. Defaults to "Need an account? Contact your CellarNode representative." */
|
|
16
|
+
/** Static footer text shown on the email step. Defaults to "Need an account? Contact your CellarNode representative." */
|
|
16
17
|
footerText?: string;
|
|
17
18
|
/** When true, footer shows a clickable register link (uses onNavigateRegister). When false, shows static footerText. Default: false */
|
|
18
19
|
showRegisterInFooter?: boolean;
|
|
19
20
|
/** Optional "Back" button handler shown in top-right corner */
|
|
20
21
|
onBack?: () => void;
|
|
22
|
+
/** Error callback — receives structured error info for external handling (e.g. toast notifications). When provided, only a brief inline hint shows near the input; the full message goes through this callback. */
|
|
23
|
+
onError?: (error: {
|
|
24
|
+
code: string;
|
|
25
|
+
message: string;
|
|
26
|
+
remainingAttempts?: number;
|
|
27
|
+
}) => void;
|
|
28
|
+
/** Custom content shown below the input when the email is not found (USER_NOT_FOUND). Replaces the default "Create an account instead" link. Pass ReactNode for full control. */
|
|
29
|
+
notFoundContent?: React.ReactNode;
|
|
21
30
|
}
|
|
22
|
-
export declare function LoginForm({ userType, brandName,
|
|
31
|
+
export declare function LoginForm({ userType, brandName, authApi, authStore, onLoginSuccess, onNavigateRegister, logoSrc, inviteMode, initialEmail, theme, onResendSuccess, footerText, showRegisterInFooter, onBack, onError, notFoundContent, }: LoginFormProps): import("react/jsx-runtime").JSX.Element;
|
|
23
32
|
//# sourceMappingURL=login-form.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-form.d.ts","sourceRoot":"","sources":["../../src/react/login-form.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"login-form.d.ts","sourceRoot":"","sources":["../../src/react/login-form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAW7D,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAatD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,UAAU,GAAG,UAAU,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,yHAAyH;IACzH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uIAAuI;IACvI,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,mNAAmN;IACnN,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,KAAK,IAAI,CAAC;IACX,iLAAiL;IACjL,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACnC;AAoBD,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,SAAS,EACT,OAAO,EACP,SAAS,EACT,cAAc,EACd,kBAAkB,EAClB,OAAO,EACP,UAAkB,EAClB,YAAiB,EACjB,KAAe,EACf,eAAe,EACf,UAAuE,EACvE,oBAA4B,EAC5B,MAAM,EACN,OAAO,EACP,eAAe,GAChB,EAAE,cAAc,2CA0WhB"}
|
package/dist/react/login-form.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import React, { Suspense, useEffect, useState } from "react";
|
|
4
4
|
import { REGEXP_ONLY_DIGITS } from "input-otp";
|
|
5
|
-
import { ArrowLeft, ArrowRight, CheckCircle2, Clock3, Loader2, } from "lucide-react";
|
|
5
|
+
import { AlertCircle, ArrowLeft, ArrowRight, CheckCircle2, Clock3, Loader2, } from "lucide-react";
|
|
6
6
|
import { clsx } from "clsx";
|
|
7
7
|
import { AuthError } from "../types.js";
|
|
8
8
|
import { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, } from "./input-otp-slots.js";
|
|
@@ -15,12 +15,19 @@ function formatCountdown(expiresAt) {
|
|
|
15
15
|
const seconds = String(Math.floor((diff % 60_000) / 1000)).padStart(2, "0");
|
|
16
16
|
return `${minutes}:${seconds}`;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
const ERROR_MESSAGES = {
|
|
19
|
+
USER_NOT_FOUND: "No account found with this email.",
|
|
20
|
+
OTP_RATE_LIMIT: "Too many code requests. Please wait before trying again.",
|
|
21
|
+
OTP_NOT_FOUND: "Code expired. Please request a new one.",
|
|
22
|
+
OTP_MAX_ATTEMPTS: "Too many failed attempts. Please request a new code.",
|
|
23
|
+
USER_DELETED: "This account has been deactivated. Contact support.",
|
|
24
|
+
};
|
|
25
|
+
export function LoginForm({ userType, brandName, authApi, authStore, onLoginSuccess, onNavigateRegister, logoSrc, inviteMode = false, initialEmail = "", theme = "light", onResendSuccess, footerText = "Need an account? Contact your CellarNode representative.", showRegisterInFooter = false, onBack, onError, notFoundContent, }) {
|
|
19
26
|
const [step, setStep] = useState("email");
|
|
20
27
|
const [email, setEmail] = useState(initialEmail);
|
|
21
28
|
const [code, setCode] = useState("");
|
|
22
29
|
const [error, setError] = useState("");
|
|
23
|
-
const [
|
|
30
|
+
const [isNotFound, setIsNotFound] = useState(false);
|
|
24
31
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
25
32
|
const [expiresAt, setExpiresAt] = useState(null);
|
|
26
33
|
const [countdown, setCountdown] = useState("15:00");
|
|
@@ -40,41 +47,42 @@ export function LoginForm({ userType, brandName, brandDescription, authApi, auth
|
|
|
40
47
|
const normalizedEmail = email.trim();
|
|
41
48
|
function handleAuthError(err, fallbackMessage) {
|
|
42
49
|
if (err instanceof AuthError) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
break;
|
|
66
|
-
default:
|
|
67
|
-
setError(err.message || "Something went wrong");
|
|
50
|
+
const msg = err.code === "OTP_INVALID"
|
|
51
|
+
? `Invalid code. ${err.remainingAttempts ?? 0} attempt(s) remaining.`
|
|
52
|
+
: ERROR_MESSAGES[err.code] ?? err.message ?? "Something went wrong";
|
|
53
|
+
// Side effects for specific error codes
|
|
54
|
+
if (err.code === "USER_NOT_FOUND") {
|
|
55
|
+
setIsNotFound(true);
|
|
56
|
+
}
|
|
57
|
+
if (err.code === "OTP_NOT_FOUND" || err.code === "OTP_MAX_ATTEMPTS") {
|
|
58
|
+
setExpiresAt(new Date(0).toISOString());
|
|
59
|
+
}
|
|
60
|
+
// Route error to callback if provided
|
|
61
|
+
if (onError) {
|
|
62
|
+
onError({
|
|
63
|
+
code: err.code,
|
|
64
|
+
message: msg,
|
|
65
|
+
remainingAttempts: err.remainingAttempts,
|
|
66
|
+
});
|
|
67
|
+
// Still show brief inline hint for context
|
|
68
|
+
setError(msg);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
setError(msg);
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
74
|
else {
|
|
71
|
-
|
|
75
|
+
const msg = err instanceof Error ? err.message : fallbackMessage;
|
|
76
|
+
if (onError) {
|
|
77
|
+
onError({ code: "UNKNOWN", message: msg });
|
|
78
|
+
}
|
|
79
|
+
setError(msg);
|
|
72
80
|
}
|
|
73
81
|
}
|
|
74
82
|
async function handleEmailSubmit(e) {
|
|
75
83
|
e.preventDefault();
|
|
76
84
|
setError("");
|
|
77
|
-
|
|
85
|
+
setIsNotFound(false);
|
|
78
86
|
setIsSubmitting(true);
|
|
79
87
|
try {
|
|
80
88
|
const response = await authApi.requestOtp(normalizedEmail);
|
|
@@ -92,12 +100,15 @@ export function LoginForm({ userType, brandName, brandDescription, authApi, auth
|
|
|
92
100
|
async function handleOtpSubmit(e) {
|
|
93
101
|
e.preventDefault();
|
|
94
102
|
setError("");
|
|
95
|
-
|
|
103
|
+
setIsNotFound(false);
|
|
96
104
|
setIsSubmitting(true);
|
|
97
105
|
try {
|
|
98
106
|
const result = await authApi.verifyOtp(normalizedEmail, code);
|
|
99
107
|
if (result.user.userType !== userType) {
|
|
100
|
-
|
|
108
|
+
const msg = `This portal is for ${userType} accounts only.`;
|
|
109
|
+
setError(msg);
|
|
110
|
+
if (onError)
|
|
111
|
+
onError({ code: "USER_TYPE_MISMATCH", message: msg });
|
|
101
112
|
authStore.clearAccessToken();
|
|
102
113
|
return;
|
|
103
114
|
}
|
|
@@ -113,7 +124,7 @@ export function LoginForm({ userType, brandName, brandDescription, authApi, auth
|
|
|
113
124
|
}
|
|
114
125
|
async function handleResend() {
|
|
115
126
|
setError("");
|
|
116
|
-
|
|
127
|
+
setIsNotFound(false);
|
|
117
128
|
setIsSubmitting(true);
|
|
118
129
|
try {
|
|
119
130
|
const response = await authApi.requestOtp(normalizedEmail);
|
|
@@ -128,15 +139,18 @@ export function LoginForm({ userType, brandName, brandDescription, authApi, auth
|
|
|
128
139
|
setIsSubmitting(false);
|
|
129
140
|
}
|
|
130
141
|
}
|
|
131
|
-
return (_jsxs("div", { className: "grid min-h-dvh lg:grid-cols-2", children: [_jsxs("div", { className: "flex flex-col px-6 py-6 sm:px-10 sm:py-8 lg:px-14 lg:py-10", children: [_jsxs("div", { className: "flex items-center justify-between gap-4", children: [_jsxs("div", { className: "inline-flex items-center gap-3", children: [logoSrc ? (_jsx("img", { src: logoSrc, alt: brandName, width: 36, height: 36, className: "size-9 rounded-full" })) : (_jsx("div", { className: "flex size-9 items-center justify-center rounded-full bg-primary text-sm font-bold text-primary-foreground", children: brandName.charAt(0) })), _jsx("span", { className: "font-semibold text-foreground", children: brandName })] }), onBack && (_jsxs("button", { type: "button", onClick: onBack, className: "inline-flex items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground", children: [_jsx(ArrowLeft, { className: "size-3.5" }), "Back"] }))] }), _jsx("div", { className: "flex flex-1 items-center justify-center py-12", children: _jsxs("div", { className: "w-full max-w-sm", children: [_jsx("div", { className: "mb-8 flex items-center gap-2.5", children: [0, 1].map((i) => (_jsx("div", { className: clsx("size-2.5 rounded-full transition-colors", stepIndex >= i
|
|
132
|
-
? "bg-primary"
|
|
133
|
-
: "bg-border") }, i))) }), inviteMode && step === "email" && (_jsx("div", { className: "mb-4 rounded-lg border border-primary/20 bg-primary/5 px-4 py-3 text-sm/6 text-foreground", children: "Signing in to accept your organization invitation." })), _jsx("h1", { className: "text-2xl font-semibold tracking-tight text-foreground", children: step === "email" ? "Sign in to your account" : "Check your email" }), _jsx("p", { className: "mt-2 text-sm/6 text-muted-foreground", children: step === "email"
|
|
142
|
+
return (_jsxs("div", { className: "grid min-h-dvh lg:grid-cols-2", children: [_jsxs("div", { className: "flex flex-col px-6 py-6 sm:px-10 sm:py-8 lg:px-14 lg:py-10", children: [_jsxs("div", { className: "flex items-center justify-between gap-4", children: [_jsxs("div", { className: "inline-flex items-center gap-3", children: [logoSrc ? (_jsx("img", { src: logoSrc, alt: brandName, width: 36, height: 36, className: "size-9 rounded-full" })) : (_jsx("div", { className: "flex size-9 items-center justify-center rounded-full bg-primary text-sm font-bold text-primary-foreground", children: brandName.charAt(0) })), _jsx("span", { className: "font-semibold text-foreground", children: brandName })] }), onBack && (_jsxs("button", { type: "button", onClick: onBack, className: "inline-flex items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground", children: [_jsx(ArrowLeft, { className: "size-3.5" }), "Back"] }))] }), _jsx("div", { className: "flex flex-1 items-center justify-center py-12", children: _jsxs("div", { className: "w-full max-w-sm", children: [_jsx("div", { className: "mb-8 flex items-center gap-2.5", children: [0, 1].map((i) => (_jsx("div", { className: clsx("size-2.5 rounded-full transition-colors", stepIndex >= i ? "bg-primary" : "bg-border") }, i))) }), inviteMode && step === "email" && (_jsx("div", { className: "mb-4 rounded-lg border border-primary/20 bg-primary/5 px-4 py-3 text-sm/6 text-foreground", children: "Signing in to accept your organization invitation." })), _jsx("h1", { className: "text-2xl font-semibold tracking-tight text-foreground", children: step === "email" ? "Sign in to your account" : "Check your email" }), _jsx("p", { className: "mt-2 text-sm/6 text-muted-foreground", children: step === "email"
|
|
134
143
|
? "Enter your work email to receive a one-time access code."
|
|
135
|
-
: `We sent a 6-digit code to ${normalizedEmail}.` }), _jsx("div", { className: "mt-8", children: step === "email" ? (_jsxs("form", { onSubmit: handleEmailSubmit, className: "grid gap-5", children: [_jsxs("div", { className: "grid gap-2", children: [_jsx("label", { htmlFor: "email", className: "text-sm font-medium leading-none", children: "Email address" }), _jsx("input", { id: "email", type: "email", placeholder: "you@company.com", value: email, onChange: (event) => setEmail(event.target.value), required: true, autoFocus: true, "aria-invalid": !!error || undefined, className: "flex h-10 w-full rounded-md border
|
|
144
|
+
: `We sent a 6-digit code to ${normalizedEmail}.` }), _jsx("div", { className: "mt-8", children: step === "email" ? (_jsxs("form", { onSubmit: handleEmailSubmit, className: "grid gap-5", children: [_jsxs("div", { className: "grid gap-2", children: [_jsx("label", { htmlFor: "email", className: "text-sm font-medium leading-none", children: "Email address" }), _jsx("input", { id: "email", type: "email", placeholder: "you@company.com", value: email, onChange: (event) => setEmail(event.target.value), required: true, autoFocus: true, "aria-invalid": !!error || undefined, className: clsx("flex h-10 w-full rounded-md border bg-background px-3 py-2 text-sm shadow-xs placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 transition-colors", error
|
|
145
|
+
? "border-destructive focus-visible:ring-destructive/30 focus-visible:border-destructive"
|
|
146
|
+
: "border-input focus-visible:ring-ring/50 focus-visible:border-ring") }), error && !onError && (_jsxs("div", { className: "flex items-start gap-2 text-sm text-destructive", children: [_jsx(AlertCircle, { className: "size-4 shrink-0 mt-0.5" }), _jsx("span", { children: error })] })), isNotFound && notFoundContent && (_jsx("div", { className: "mt-1 text-sm text-muted-foreground", children: notFoundContent }))] }), _jsxs("button", { type: "submit", className: "inline-flex h-11 w-full items-center justify-center gap-2 rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground shadow-xs transition-colors hover:bg-primary/90 disabled:pointer-events-none disabled:opacity-50", disabled: isSubmitting || !normalizedEmail, children: [isSubmitting ? (_jsx(Loader2, { className: "mr-2 size-4 animate-spin" })) : (_jsx(ArrowRight, { className: "mr-2 size-4" })), "Continue"] })] })) : (_jsxs("form", { id: "otp-form", onSubmit: handleOtpSubmit, className: "grid gap-5", children: [_jsxs("div", { className: "inline-flex w-fit items-center gap-1.5 rounded-full border border-border bg-muted/50 px-3 py-1 text-xs font-medium text-muted-foreground", children: [_jsx(Clock3, { className: "size-3" }), "Expires in ", countdown] }), _jsxs("div", { className: "grid gap-2", children: [_jsxs(InputOTP, { id: "otp", value: code, onChange: (value) => setCode(value), onComplete: () => {
|
|
147
|
+
const form = document.getElementById("otp-form");
|
|
148
|
+
form?.requestSubmit();
|
|
149
|
+
}, maxLength: 6, pattern: REGEXP_ONLY_DIGITS, autoFocus: true, "data-invalid": !!error || undefined, containerClassName: "justify-center", children: [_jsxs(InputOTPGroup, { children: [_jsx(InputOTPSlot, { index: 0 }), _jsx(InputOTPSlot, { index: 1 }), _jsx(InputOTPSlot, { index: 2 })] }), _jsx(InputOTPSeparator, {}), _jsxs(InputOTPGroup, { children: [_jsx(InputOTPSlot, { index: 3 }), _jsx(InputOTPSlot, { index: 4 }), _jsx(InputOTPSlot, { index: 5 })] })] }), error && !onError && (_jsxs("div", { className: "flex items-center justify-center gap-2 text-sm text-destructive", children: [_jsx(AlertCircle, { className: "size-4 shrink-0" }), _jsx("span", { children: error })] }))] }), _jsxs("button", { type: "submit", className: "inline-flex h-11 w-full items-center justify-center gap-2 rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground shadow-xs transition-colors hover:bg-primary/90 disabled:pointer-events-none disabled:opacity-50", disabled: isSubmitting || code.length !== 6, children: [isSubmitting ? (_jsx(Loader2, { className: "mr-2 size-4 animate-spin" })) : (_jsx(CheckCircle2, { className: "mr-2 size-4" })), "Verify"] }), _jsxs("div", { className: "flex items-center justify-between text-sm", children: [_jsx("button", { type: "button", className: "text-muted-foreground transition-colors hover:text-foreground", onClick: () => {
|
|
136
150
|
setStep("email");
|
|
137
151
|
setCode("");
|
|
138
152
|
setError("");
|
|
139
|
-
|
|
153
|
+
setIsNotFound(false);
|
|
140
154
|
}, children: _jsxs("span", { className: "inline-flex items-center gap-1", children: [_jsx(ArrowLeft, { className: "size-3.5" }), "Change email"] }) }), _jsx("button", { type: "button", className: "text-primary transition-colors hover:text-primary/80 disabled:text-muted-foreground/50", onClick: handleResend, disabled: isSubmitting || !canResend, children: "Resend code" })] })] })) }), step === "email" && (_jsx("p", { className: "mt-8 text-center text-sm text-muted-foreground", children: showRegisterInFooter && onNavigateRegister ? (_jsxs(_Fragment, { children: ["Need an account?", " ", _jsx("button", { type: "button", onClick: onNavigateRegister, className: "text-primary transition-colors hover:text-primary/80", children: "Register here" })] })) : (footerText) }))] }) })] }), _jsx("div", { className: "hidden lg:block", children: _jsx(Suspense, { fallback: _jsx("div", { className: "size-full bg-muted" }), children: _jsx(LazySquircleShift, { className: "size-full", theme: theme }) }) })] }));
|
|
141
155
|
}
|
|
142
156
|
//# sourceMappingURL=login-form.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-form.js","sourceRoot":"","sources":["../../src/react/login-form.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,MAAM,EACN,OAAO,GACR,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EACL,QAAQ,EACR,aAAa,EACb,iBAAiB,EACjB,YAAY,GACb,MAAM,sBAAsB,CAAC;AAE9B,MAAM,iBAAiB,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CACxC,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,CAC1E,CAAC;
|
|
1
|
+
{"version":3,"file":"login-form.js","sourceRoot":"","sources":["../../src/react/login-form.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,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