@insforge/react 0.2.10 → 0.3.1
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/README.md +71 -32
- package/dist/atoms.d.mts +23 -2
- package/dist/atoms.d.ts +23 -2
- package/dist/atoms.js +138 -0
- package/dist/atoms.js.map +1 -1
- package/dist/atoms.mjs +139 -2
- package/dist/atoms.mjs.map +1 -1
- package/dist/components.d.mts +120 -3
- package/dist/components.d.ts +120 -3
- package/dist/components.js +993 -393
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +991 -395
- package/dist/components.mjs.map +1 -1
- package/dist/forms.d.mts +2 -2
- package/dist/forms.d.ts +2 -2
- package/dist/forms.js +318 -71
- package/dist/forms.js.map +1 -1
- package/dist/forms.mjs +319 -72
- package/dist/forms.mjs.map +1 -1
- package/dist/hooks.d.mts +4 -0
- package/dist/hooks.d.ts +4 -0
- package/dist/hooks.js.map +1 -1
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.d.mts +6 -11
- package/dist/index.d.ts +6 -11
- package/dist/index.js +986 -472
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +983 -473
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types.d.mts +12 -1
- package/dist/types.d.ts +12 -1
- package/package.json +2 -2
package/dist/forms.d.mts
CHANGED
|
@@ -37,7 +37,7 @@ import '@insforge/shared-schemas';
|
|
|
37
37
|
* />
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
|
-
declare function SignInForm({ email, password, onEmailChange, onPasswordChange, onSubmit, error, loading, oauthLoading, availableProviders, onOAuthClick, emailAuthConfig, appearance, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, forgotPasswordText, forgotPasswordUrl, submitButtonText, loadingButtonText, signUpText, signUpLinkText, signUpUrl, dividerText, }: SignInFormProps): react_jsx_runtime.JSX.Element;
|
|
40
|
+
declare function SignInForm({ email, password, onEmailChange, onPasswordChange, onSubmit, error, loading, oauthLoading, availableProviders, onOAuthClick, emailAuthConfig, appearance, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, forgotPasswordText, forgotPasswordUrl, submitButtonText, loadingButtonText, signUpText, signUpLinkText, signUpUrl, dividerText, showVerificationStep, onVerifyCode, verificationDescription, }: SignInFormProps): react_jsx_runtime.JSX.Element;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Pre-built sign-up form component (UI only, no business logic).
|
|
@@ -73,7 +73,7 @@ declare function SignInForm({ email, password, onEmailChange, onPasswordChange,
|
|
|
73
73
|
* />
|
|
74
74
|
* ```
|
|
75
75
|
*/
|
|
76
|
-
declare function SignUpForm({ email, password, onEmailChange, onPasswordChange, onSubmit, error, loading, oauthLoading, availableProviders, onOAuthClick, emailAuthConfig, appearance, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, submitButtonText, loadingButtonText, signInText, signInLinkText, signInUrl, dividerText, }: SignUpFormProps): react_jsx_runtime.JSX.Element;
|
|
76
|
+
declare function SignUpForm({ email, password, onEmailChange, onPasswordChange, onSubmit, error, loading, oauthLoading, availableProviders, onOAuthClick, emailAuthConfig, appearance, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, submitButtonText, loadingButtonText, signInText, signInLinkText, signInUrl, dividerText, showVerificationStep, onVerifyCode, verificationDescription, }: SignUpFormProps): react_jsx_runtime.JSX.Element;
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* Pre-built forgot password form component (UI only, no business logic).
|
package/dist/forms.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ import '@insforge/shared-schemas';
|
|
|
37
37
|
* />
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
|
-
declare function SignInForm({ email, password, onEmailChange, onPasswordChange, onSubmit, error, loading, oauthLoading, availableProviders, onOAuthClick, emailAuthConfig, appearance, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, forgotPasswordText, forgotPasswordUrl, submitButtonText, loadingButtonText, signUpText, signUpLinkText, signUpUrl, dividerText, }: SignInFormProps): react_jsx_runtime.JSX.Element;
|
|
40
|
+
declare function SignInForm({ email, password, onEmailChange, onPasswordChange, onSubmit, error, loading, oauthLoading, availableProviders, onOAuthClick, emailAuthConfig, appearance, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, forgotPasswordText, forgotPasswordUrl, submitButtonText, loadingButtonText, signUpText, signUpLinkText, signUpUrl, dividerText, showVerificationStep, onVerifyCode, verificationDescription, }: SignInFormProps): react_jsx_runtime.JSX.Element;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Pre-built sign-up form component (UI only, no business logic).
|
|
@@ -73,7 +73,7 @@ declare function SignInForm({ email, password, onEmailChange, onPasswordChange,
|
|
|
73
73
|
* />
|
|
74
74
|
* ```
|
|
75
75
|
*/
|
|
76
|
-
declare function SignUpForm({ email, password, onEmailChange, onPasswordChange, onSubmit, error, loading, oauthLoading, availableProviders, onOAuthClick, emailAuthConfig, appearance, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, submitButtonText, loadingButtonText, signInText, signInLinkText, signInUrl, dividerText, }: SignUpFormProps): react_jsx_runtime.JSX.Element;
|
|
76
|
+
declare function SignUpForm({ email, password, onEmailChange, onPasswordChange, onSubmit, error, loading, oauthLoading, availableProviders, onOAuthClick, emailAuthConfig, appearance, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, submitButtonText, loadingButtonText, signInText, signInLinkText, signInUrl, dividerText, showVerificationStep, onVerifyCode, verificationDescription, }: SignUpFormProps): react_jsx_runtime.JSX.Element;
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* Pre-built forgot password form component (UI only, no business logic).
|
package/dist/forms.js
CHANGED
|
@@ -5,6 +5,7 @@ var clsx = require('clsx');
|
|
|
5
5
|
var tailwindMerge = require('tailwind-merge');
|
|
6
6
|
var lucideReact = require('lucide-react');
|
|
7
7
|
var react = require('react');
|
|
8
|
+
var sdk = require('@insforge/sdk');
|
|
8
9
|
|
|
9
10
|
function AuthBranding() {
|
|
10
11
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-[#FAFAFA] px-2 py-4 flex flex-row justify-center items-center gap-1", children: [
|
|
@@ -644,6 +645,221 @@ function AuthOAuthProviders({
|
|
|
644
645
|
provider
|
|
645
646
|
)) });
|
|
646
647
|
}
|
|
648
|
+
function AuthVerificationCodeInput({
|
|
649
|
+
length = 6,
|
|
650
|
+
value,
|
|
651
|
+
email,
|
|
652
|
+
onChange,
|
|
653
|
+
disabled = false,
|
|
654
|
+
onComplete,
|
|
655
|
+
appearance = {}
|
|
656
|
+
}) {
|
|
657
|
+
const inputRefs = react.useRef([]);
|
|
658
|
+
const handleChange = (index, digit) => {
|
|
659
|
+
if (digit.length > 1) return;
|
|
660
|
+
if (digit && !/^\d$/.test(digit)) return;
|
|
661
|
+
const newValue = value.split("");
|
|
662
|
+
newValue[index] = digit;
|
|
663
|
+
const updatedValue = newValue.join("");
|
|
664
|
+
onChange(updatedValue);
|
|
665
|
+
if (digit && index < length - 1) {
|
|
666
|
+
inputRefs.current[index + 1]?.focus();
|
|
667
|
+
}
|
|
668
|
+
if (digit && index === length - 1 && updatedValue.length === length && onComplete) {
|
|
669
|
+
onComplete(updatedValue);
|
|
670
|
+
}
|
|
671
|
+
};
|
|
672
|
+
const handleKeyDown = (index, e) => {
|
|
673
|
+
if (e.key === "Backspace") {
|
|
674
|
+
if (!value[index] && index > 0) {
|
|
675
|
+
inputRefs.current[index - 1]?.focus();
|
|
676
|
+
} else {
|
|
677
|
+
handleChange(index, "");
|
|
678
|
+
}
|
|
679
|
+
} else if (e.key === "ArrowLeft" && index > 0) {
|
|
680
|
+
inputRefs.current[index - 1]?.focus();
|
|
681
|
+
} else if (e.key === "ArrowRight" && index < length - 1) {
|
|
682
|
+
inputRefs.current[index + 1]?.focus();
|
|
683
|
+
}
|
|
684
|
+
};
|
|
685
|
+
const handlePaste = (e) => {
|
|
686
|
+
e.preventDefault();
|
|
687
|
+
const pastedData = e.clipboardData.getData("text/plain").trim();
|
|
688
|
+
if (/^\d+$/.test(pastedData) && pastedData.length === length) {
|
|
689
|
+
onChange(pastedData);
|
|
690
|
+
inputRefs.current[length - 1]?.focus();
|
|
691
|
+
if (onComplete) {
|
|
692
|
+
onComplete(pastedData);
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(
|
|
697
|
+
"flex flex-col justify-center items-center gap-6",
|
|
698
|
+
appearance.containerClassName
|
|
699
|
+
), children: [
|
|
700
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm font-normal text-[#525252] leading-5", children: [
|
|
701
|
+
"We've sent a verification code to your inbox at",
|
|
702
|
+
" ",
|
|
703
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-black leading-5", children: email }),
|
|
704
|
+
". Enter it below to proceed."
|
|
705
|
+
] }),
|
|
706
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row gap-3 justify-center items-center", children: Array.from({ length }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
707
|
+
"input",
|
|
708
|
+
{
|
|
709
|
+
ref: (el) => {
|
|
710
|
+
inputRefs.current[index] = el;
|
|
711
|
+
},
|
|
712
|
+
type: "text",
|
|
713
|
+
inputMode: "numeric",
|
|
714
|
+
maxLength: 1,
|
|
715
|
+
value: value[index] || "",
|
|
716
|
+
onChange: (e) => handleChange(index, e.target.value),
|
|
717
|
+
onKeyDown: (e) => handleKeyDown(index, e),
|
|
718
|
+
onPaste: handlePaste,
|
|
719
|
+
disabled,
|
|
720
|
+
className: cn(
|
|
721
|
+
"w-full h-12 px-3 py-2 rounded border border-[#E0E0E0] bg-white",
|
|
722
|
+
"text-center text-base font-semibold leading-5 text-black",
|
|
723
|
+
"transition-all duration-200 outline-none",
|
|
724
|
+
"focus:border-black focus:shadow-[0_0_0_2px_rgba(0,0,0,0.1)]",
|
|
725
|
+
"disabled:bg-[#F5F5F5] disabled:cursor-not-allowed disabled:opacity-60",
|
|
726
|
+
appearance.inputClassName
|
|
727
|
+
),
|
|
728
|
+
autoComplete: "one-time-code"
|
|
729
|
+
},
|
|
730
|
+
index
|
|
731
|
+
)) })
|
|
732
|
+
] });
|
|
733
|
+
}
|
|
734
|
+
var InsforgeContext = react.createContext(
|
|
735
|
+
void 0
|
|
736
|
+
);
|
|
737
|
+
function useInsforge() {
|
|
738
|
+
const context = react.useContext(InsforgeContext);
|
|
739
|
+
if (!context) {
|
|
740
|
+
throw new Error("useInsforge must be used within InsforgeProvider");
|
|
741
|
+
}
|
|
742
|
+
return context;
|
|
743
|
+
}
|
|
744
|
+
function AuthEmailVerificationStep({
|
|
745
|
+
email,
|
|
746
|
+
description,
|
|
747
|
+
method = "code",
|
|
748
|
+
onVerifyCode
|
|
749
|
+
}) {
|
|
750
|
+
const { baseUrl } = useInsforge();
|
|
751
|
+
const [insforge] = react.useState(() => sdk.createClient({ baseUrl }));
|
|
752
|
+
const [resendDisabled, setResendDisabled] = react.useState(true);
|
|
753
|
+
const [resendCountdown, setResendCountdown] = react.useState(60);
|
|
754
|
+
const [isSending, setIsSending] = react.useState(false);
|
|
755
|
+
const [verificationCode, setVerificationCode] = react.useState("");
|
|
756
|
+
const [isVerifying, setIsVerifying] = react.useState(false);
|
|
757
|
+
const [verificationError, setVerificationError] = react.useState("");
|
|
758
|
+
const defaultDescription = method === "code" ? "We've sent a 6-digit verification code to {email}. Please enter it below to verify your account. The code will expire in 10 minutes." : "We've sent a verification link to {email}. Please check your email and click the link to verify your account. The link will expire in 10 minutes.";
|
|
759
|
+
react.useEffect(() => {
|
|
760
|
+
const sendInitialEmail = async () => {
|
|
761
|
+
try {
|
|
762
|
+
if (method === "code") {
|
|
763
|
+
await insforge.auth.sendVerificationCode({ email });
|
|
764
|
+
} else {
|
|
765
|
+
await insforge.auth.sendVerificationLink({ email });
|
|
766
|
+
}
|
|
767
|
+
} catch {
|
|
768
|
+
}
|
|
769
|
+
};
|
|
770
|
+
void sendInitialEmail();
|
|
771
|
+
}, [email, method, insforge.auth]);
|
|
772
|
+
react.useEffect(() => {
|
|
773
|
+
if (resendCountdown > 0) {
|
|
774
|
+
const timer = setInterval(() => {
|
|
775
|
+
setResendCountdown((prev) => {
|
|
776
|
+
if (prev <= 1) {
|
|
777
|
+
setResendDisabled(false);
|
|
778
|
+
return 0;
|
|
779
|
+
}
|
|
780
|
+
return prev - 1;
|
|
781
|
+
});
|
|
782
|
+
}, 1e3);
|
|
783
|
+
return () => clearInterval(timer);
|
|
784
|
+
}
|
|
785
|
+
}, [resendCountdown]);
|
|
786
|
+
const handleResend = async () => {
|
|
787
|
+
setResendDisabled(true);
|
|
788
|
+
setResendCountdown(60);
|
|
789
|
+
setIsSending(true);
|
|
790
|
+
setVerificationError("");
|
|
791
|
+
try {
|
|
792
|
+
if (method === "code") {
|
|
793
|
+
await insforge.auth.sendVerificationCode({ email });
|
|
794
|
+
} else {
|
|
795
|
+
await insforge.auth.sendVerificationLink({ email });
|
|
796
|
+
}
|
|
797
|
+
} catch {
|
|
798
|
+
setResendDisabled(false);
|
|
799
|
+
setResendCountdown(0);
|
|
800
|
+
} finally {
|
|
801
|
+
setIsSending(false);
|
|
802
|
+
}
|
|
803
|
+
};
|
|
804
|
+
const handleVerifyCode = async (code) => {
|
|
805
|
+
if (!onVerifyCode) {
|
|
806
|
+
return;
|
|
807
|
+
}
|
|
808
|
+
setIsVerifying(true);
|
|
809
|
+
setVerificationError("");
|
|
810
|
+
try {
|
|
811
|
+
await onVerifyCode(code);
|
|
812
|
+
} catch (error) {
|
|
813
|
+
setVerificationError(
|
|
814
|
+
error instanceof Error ? error.message : "Invalid verification code. Please try again."
|
|
815
|
+
);
|
|
816
|
+
setVerificationCode("");
|
|
817
|
+
} finally {
|
|
818
|
+
setIsVerifying(false);
|
|
819
|
+
}
|
|
820
|
+
};
|
|
821
|
+
const displayDescription = description || defaultDescription;
|
|
822
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-6 items-stretch", children: [
|
|
823
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-neutral-600 dark:text-neutral-400 leading-relaxed", children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
824
|
+
part,
|
|
825
|
+
index < array.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-black dark:text-white", children: email })
|
|
826
|
+
] }, index)) }),
|
|
827
|
+
verificationError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pl-3 py-2 pr-2 bg-red-50 border-2 border-red-600 rounded", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
828
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-6 h-6 text-red-500 shrink-0", fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }),
|
|
829
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-red-600 flex-1", children: verificationError })
|
|
830
|
+
] }) }),
|
|
831
|
+
method === "code" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full bg-neutral-100 dark:bg-neutral-800 rounded-lg px-4 pt-4 pb-6 flex flex-col gap-4", children: [
|
|
832
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
833
|
+
AuthVerificationCodeInput,
|
|
834
|
+
{
|
|
835
|
+
value: verificationCode,
|
|
836
|
+
onChange: setVerificationCode,
|
|
837
|
+
email,
|
|
838
|
+
disabled: isVerifying,
|
|
839
|
+
onComplete: (code) => {
|
|
840
|
+
void handleVerifyCode(code);
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
),
|
|
844
|
+
isVerifying && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-neutral-600 dark:text-neutral-400 text-center", children: "Verifying..." })
|
|
845
|
+
] }),
|
|
846
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full text-sm text-center text-neutral-600 dark:text-neutral-400", children: [
|
|
847
|
+
"Didn't receive the email?",
|
|
848
|
+
" ",
|
|
849
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
850
|
+
"button",
|
|
851
|
+
{
|
|
852
|
+
onClick: () => {
|
|
853
|
+
void handleResend();
|
|
854
|
+
},
|
|
855
|
+
disabled: resendDisabled || isSending,
|
|
856
|
+
className: "text-black dark:text-white font-medium transition-colors disabled:cursor-not-allowed cursor-pointer hover:underline disabled:no-underline disabled:opacity-50",
|
|
857
|
+
children: isSending ? "Sending..." : resendDisabled ? `Retry in (${resendCountdown}s)` : "Click to resend"
|
|
858
|
+
}
|
|
859
|
+
)
|
|
860
|
+
] })
|
|
861
|
+
] });
|
|
862
|
+
}
|
|
647
863
|
function SignInForm({
|
|
648
864
|
email,
|
|
649
865
|
password,
|
|
@@ -670,7 +886,11 @@ function SignInForm({
|
|
|
670
886
|
signUpText = "Don't have an account?",
|
|
671
887
|
signUpLinkText = "Sign Up Now",
|
|
672
888
|
signUpUrl = "/sign-up",
|
|
673
|
-
dividerText = "or"
|
|
889
|
+
dividerText = "or",
|
|
890
|
+
// Email verification step props
|
|
891
|
+
showVerificationStep = false,
|
|
892
|
+
onVerifyCode,
|
|
893
|
+
verificationDescription
|
|
674
894
|
}) {
|
|
675
895
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
676
896
|
AuthContainer,
|
|
@@ -683,8 +903,8 @@ function SignInForm({
|
|
|
683
903
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
684
904
|
AuthHeader,
|
|
685
905
|
{
|
|
686
|
-
title,
|
|
687
|
-
subtitle,
|
|
906
|
+
title: showVerificationStep ? "Verify Your Email" : title,
|
|
907
|
+
subtitle: showVerificationStep ? "" : subtitle,
|
|
688
908
|
appearance: {
|
|
689
909
|
containerClassName: appearance.header?.container,
|
|
690
910
|
titleClassName: appearance.header?.title,
|
|
@@ -699,7 +919,14 @@ function SignInForm({
|
|
|
699
919
|
className: appearance.errorBanner
|
|
700
920
|
}
|
|
701
921
|
),
|
|
702
|
-
/* @__PURE__ */ jsxRuntime.
|
|
922
|
+
showVerificationStep ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
923
|
+
AuthEmailVerificationStep,
|
|
924
|
+
{
|
|
925
|
+
email,
|
|
926
|
+
description: verificationDescription,
|
|
927
|
+
onVerifyCode
|
|
928
|
+
}
|
|
929
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
703
930
|
"form",
|
|
704
931
|
{
|
|
705
932
|
onSubmit,
|
|
@@ -758,39 +985,41 @@ function SignInForm({
|
|
|
758
985
|
]
|
|
759
986
|
}
|
|
760
987
|
),
|
|
761
|
-
/* @__PURE__ */ jsxRuntime.
|
|
762
|
-
AuthLink,
|
|
763
|
-
{
|
|
764
|
-
text: signUpText,
|
|
765
|
-
linkText: signUpLinkText,
|
|
766
|
-
href: signUpUrl,
|
|
767
|
-
appearance: {
|
|
768
|
-
containerClassName: appearance.link?.container,
|
|
769
|
-
linkClassName: appearance.link?.link
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
),
|
|
773
|
-
availableProviders.length > 0 && onOAuthClick && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
774
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
775
|
-
AuthDivider,
|
|
776
|
-
{
|
|
777
|
-
text: dividerText,
|
|
778
|
-
className: appearance.divider
|
|
779
|
-
}
|
|
780
|
-
),
|
|
988
|
+
!showVerificationStep && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
781
989
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
782
|
-
|
|
990
|
+
AuthLink,
|
|
783
991
|
{
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
loading: oauthLoading,
|
|
992
|
+
text: signUpText,
|
|
993
|
+
linkText: signUpLinkText,
|
|
994
|
+
href: signUpUrl,
|
|
788
995
|
appearance: {
|
|
789
|
-
containerClassName: appearance.
|
|
790
|
-
|
|
996
|
+
containerClassName: appearance.link?.container,
|
|
997
|
+
linkClassName: appearance.link?.link
|
|
791
998
|
}
|
|
792
999
|
}
|
|
793
|
-
)
|
|
1000
|
+
),
|
|
1001
|
+
availableProviders.length > 0 && onOAuthClick && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1002
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1003
|
+
AuthDivider,
|
|
1004
|
+
{
|
|
1005
|
+
text: dividerText,
|
|
1006
|
+
className: appearance.divider
|
|
1007
|
+
}
|
|
1008
|
+
),
|
|
1009
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1010
|
+
AuthOAuthProviders,
|
|
1011
|
+
{
|
|
1012
|
+
providers: availableProviders,
|
|
1013
|
+
onClick: onOAuthClick,
|
|
1014
|
+
disabled: loading || oauthLoading !== null,
|
|
1015
|
+
loading: oauthLoading,
|
|
1016
|
+
appearance: {
|
|
1017
|
+
containerClassName: appearance.oauth?.container,
|
|
1018
|
+
buttonClassName: appearance.oauth?.button
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
)
|
|
1022
|
+
] })
|
|
794
1023
|
] })
|
|
795
1024
|
]
|
|
796
1025
|
}
|
|
@@ -820,7 +1049,11 @@ function SignUpForm({
|
|
|
820
1049
|
signInText = "Already have an account?",
|
|
821
1050
|
signInLinkText = "Login Now",
|
|
822
1051
|
signInUrl = "/sign-in",
|
|
823
|
-
dividerText = "or"
|
|
1052
|
+
dividerText = "or",
|
|
1053
|
+
// Email verification step props
|
|
1054
|
+
showVerificationStep = false,
|
|
1055
|
+
onVerifyCode,
|
|
1056
|
+
verificationDescription
|
|
824
1057
|
}) {
|
|
825
1058
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
826
1059
|
AuthContainer,
|
|
@@ -833,8 +1066,8 @@ function SignUpForm({
|
|
|
833
1066
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
834
1067
|
AuthHeader,
|
|
835
1068
|
{
|
|
836
|
-
title,
|
|
837
|
-
subtitle,
|
|
1069
|
+
title: showVerificationStep ? "Verify Your Email" : title,
|
|
1070
|
+
subtitle: showVerificationStep ? "" : subtitle,
|
|
838
1071
|
appearance: {
|
|
839
1072
|
containerClassName: appearance.header?.container,
|
|
840
1073
|
titleClassName: appearance.header?.title,
|
|
@@ -849,7 +1082,14 @@ function SignUpForm({
|
|
|
849
1082
|
className: appearance.errorBanner
|
|
850
1083
|
}
|
|
851
1084
|
),
|
|
852
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1085
|
+
showVerificationStep ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1086
|
+
AuthEmailVerificationStep,
|
|
1087
|
+
{
|
|
1088
|
+
email,
|
|
1089
|
+
description: verificationDescription,
|
|
1090
|
+
onVerifyCode
|
|
1091
|
+
}
|
|
1092
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
853
1093
|
"form",
|
|
854
1094
|
{
|
|
855
1095
|
onSubmit,
|
|
@@ -906,39 +1146,41 @@ function SignUpForm({
|
|
|
906
1146
|
]
|
|
907
1147
|
}
|
|
908
1148
|
),
|
|
909
|
-
/* @__PURE__ */ jsxRuntime.
|
|
910
|
-
AuthLink,
|
|
911
|
-
{
|
|
912
|
-
text: signInText,
|
|
913
|
-
linkText: signInLinkText,
|
|
914
|
-
href: signInUrl,
|
|
915
|
-
appearance: {
|
|
916
|
-
containerClassName: appearance.link?.container,
|
|
917
|
-
linkClassName: appearance.link?.link
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
),
|
|
921
|
-
availableProviders.length > 0 && onOAuthClick && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1149
|
+
!showVerificationStep && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
922
1150
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
923
|
-
|
|
1151
|
+
AuthLink,
|
|
924
1152
|
{
|
|
925
|
-
text:
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
),
|
|
929
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
930
|
-
AuthOAuthProviders,
|
|
931
|
-
{
|
|
932
|
-
providers: availableProviders,
|
|
933
|
-
onClick: onOAuthClick,
|
|
934
|
-
disabled: loading || oauthLoading !== null,
|
|
935
|
-
loading: oauthLoading,
|
|
1153
|
+
text: signInText,
|
|
1154
|
+
linkText: signInLinkText,
|
|
1155
|
+
href: signInUrl,
|
|
936
1156
|
appearance: {
|
|
937
|
-
containerClassName: appearance.
|
|
938
|
-
|
|
1157
|
+
containerClassName: appearance.link?.container,
|
|
1158
|
+
linkClassName: appearance.link?.link
|
|
939
1159
|
}
|
|
940
1160
|
}
|
|
941
|
-
)
|
|
1161
|
+
),
|
|
1162
|
+
availableProviders.length > 0 && onOAuthClick && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1163
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1164
|
+
AuthDivider,
|
|
1165
|
+
{
|
|
1166
|
+
text: dividerText,
|
|
1167
|
+
className: appearance.divider
|
|
1168
|
+
}
|
|
1169
|
+
),
|
|
1170
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1171
|
+
AuthOAuthProviders,
|
|
1172
|
+
{
|
|
1173
|
+
providers: availableProviders,
|
|
1174
|
+
onClick: onOAuthClick,
|
|
1175
|
+
disabled: loading || oauthLoading !== null,
|
|
1176
|
+
loading: oauthLoading,
|
|
1177
|
+
appearance: {
|
|
1178
|
+
containerClassName: appearance.oauth?.container,
|
|
1179
|
+
buttonClassName: appearance.oauth?.button
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
)
|
|
1183
|
+
] })
|
|
942
1184
|
] })
|
|
943
1185
|
]
|
|
944
1186
|
}
|
|
@@ -1164,13 +1406,18 @@ function ResetPasswordForm({
|
|
|
1164
1406
|
]
|
|
1165
1407
|
}
|
|
1166
1408
|
),
|
|
1167
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1409
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1410
|
+
AuthLink,
|
|
1411
|
+
{
|
|
1412
|
+
text: backToSignInText,
|
|
1413
|
+
linkText: "Back to Sign In",
|
|
1414
|
+
href: backToSignInUrl,
|
|
1415
|
+
appearance: {
|
|
1416
|
+
containerClassName: appearance.link?.container,
|
|
1417
|
+
linkClassName: appearance.link?.link
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
)
|
|
1174
1421
|
]
|
|
1175
1422
|
}
|
|
1176
1423
|
);
|