@insforge/react 0.4.7 → 0.4.8
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/atoms.cjs +51 -48
- package/dist/atoms.cjs.map +1 -1
- package/dist/atoms.d.cts +1 -2
- package/dist/atoms.d.ts +1 -2
- package/dist/atoms.js +51 -48
- package/dist/atoms.js.map +1 -1
- package/dist/components.cjs +60 -74
- package/dist/components.cjs.map +1 -1
- package/dist/components.js +60 -74
- package/dist/components.js.map +1 -1
- package/dist/forms.cjs +58 -72
- package/dist/forms.cjs.map +1 -1
- package/dist/forms.js +58 -72
- package/dist/forms.js.map +1 -1
- package/dist/index.cjs +72 -96
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +72 -96
- package/dist/index.js.map +1 -1
- package/dist/router.cjs +11 -21
- package/dist/router.cjs.map +1 -1
- package/dist/router.d.cts +5 -4
- package/dist/router.d.ts +5 -4
- package/dist/router.js +11 -21
- package/dist/router.js.map +1 -1
- package/dist/styles.css +43 -63
- package/package.json +1 -1
package/dist/components.cjs
CHANGED
|
@@ -573,7 +573,6 @@ function AuthOAuthProviders({
|
|
|
573
573
|
function AuthVerificationCodeInput({
|
|
574
574
|
length = 6,
|
|
575
575
|
value,
|
|
576
|
-
email,
|
|
577
576
|
onChange,
|
|
578
577
|
disabled = false,
|
|
579
578
|
onComplete
|
|
@@ -621,33 +620,25 @@ function AuthVerificationCodeInput({
|
|
|
621
620
|
}
|
|
622
621
|
}
|
|
623
622
|
};
|
|
624
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
". Enter it below to proceed."
|
|
630
|
-
] }),
|
|
631
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "if-verificationCode-inputContainer", children: Array.from({ length }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
632
|
-
"input",
|
|
633
|
-
{
|
|
634
|
-
ref: (el) => {
|
|
635
|
-
inputRefs.current[index] = el;
|
|
636
|
-
},
|
|
637
|
-
type: "text",
|
|
638
|
-
inputMode: "numeric",
|
|
639
|
-
maxLength: 1,
|
|
640
|
-
value: value[index] || "",
|
|
641
|
-
onChange: (e) => handleChange(index, e.target.value),
|
|
642
|
-
onKeyDown: (e) => handleKeyDown(index, e),
|
|
643
|
-
onPaste: handlePaste,
|
|
644
|
-
disabled,
|
|
645
|
-
className: "if-verificationCode-input",
|
|
646
|
-
autoComplete: "one-time-code"
|
|
623
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "if-verificationCode-inputContainer", children: Array.from({ length }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
624
|
+
"input",
|
|
625
|
+
{
|
|
626
|
+
ref: (el) => {
|
|
627
|
+
inputRefs.current[index] = el;
|
|
647
628
|
},
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
629
|
+
type: "text",
|
|
630
|
+
inputMode: "numeric",
|
|
631
|
+
maxLength: 1,
|
|
632
|
+
value: value[index] || "",
|
|
633
|
+
onChange: (e) => handleChange(index, e.target.value),
|
|
634
|
+
onKeyDown: (e) => handleKeyDown(index, e),
|
|
635
|
+
onPaste: handlePaste,
|
|
636
|
+
disabled,
|
|
637
|
+
className: "if-verificationCode-input",
|
|
638
|
+
autoComplete: "one-time-code"
|
|
639
|
+
},
|
|
640
|
+
index
|
|
641
|
+
)) });
|
|
651
642
|
}
|
|
652
643
|
function AuthEmailVerificationStep({
|
|
653
644
|
email,
|
|
@@ -660,7 +651,8 @@ function AuthEmailVerificationStep({
|
|
|
660
651
|
const [isSending, setIsSending] = react.useState(false);
|
|
661
652
|
const [verificationCode, setVerificationCode] = react.useState("");
|
|
662
653
|
const [isVerifying, setIsVerifying] = react.useState(false);
|
|
663
|
-
const
|
|
654
|
+
const isLinkMethod = method === "link";
|
|
655
|
+
const displayDescription = isLinkMethod ? "We have sent an email to {email}. Please check your email to confirm your account before signing in. The confirmation link expires in 10 minutes." : "We've sent a verification code to your inbox at {email}. Enter it below to proceed.";
|
|
664
656
|
react.useEffect(() => {
|
|
665
657
|
const sendInitialEmail = async () => {
|
|
666
658
|
try {
|
|
@@ -710,23 +702,29 @@ function AuthEmailVerificationStep({
|
|
|
710
702
|
setVerificationCode("");
|
|
711
703
|
}
|
|
712
704
|
};
|
|
713
|
-
const displayDescription = defaultDescription;
|
|
714
|
-
const isLinkMethod = method === "link";
|
|
715
705
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "if-verificationStep", children: [
|
|
716
|
-
/* @__PURE__ */ jsxRuntime.
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
706
|
+
isLinkMethod && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "if-verificationStep-descriptionContainer", children: [
|
|
707
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "if-verificationStep-descriptionTitle", children: "Verify Your Email" }),
|
|
708
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "if-verificationStep-description", children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
709
|
+
part,
|
|
710
|
+
index < array.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "if-verificationLink-email", children: email })
|
|
711
|
+
] }, index)) })
|
|
712
|
+
] }),
|
|
720
713
|
!isLinkMethod && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "if-verificationStep-codeContainer", children: [
|
|
721
|
-
/* @__PURE__ */ jsxRuntime.
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
714
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "if-verificationStep-codeInputWrapper", children: [
|
|
715
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "if-verificationStep-codeDescription", children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
716
|
+
part,
|
|
717
|
+
index < array.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "if-verificationCode-email", children: email })
|
|
718
|
+
] }, index)) }),
|
|
719
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
720
|
+
AuthVerificationCodeInput,
|
|
721
|
+
{
|
|
722
|
+
value: verificationCode,
|
|
723
|
+
onChange: setVerificationCode,
|
|
724
|
+
disabled: isVerifying
|
|
725
|
+
}
|
|
726
|
+
)
|
|
727
|
+
] }),
|
|
730
728
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
731
729
|
AuthSubmitButton,
|
|
732
730
|
{
|
|
@@ -736,7 +734,7 @@ function AuthEmailVerificationStep({
|
|
|
736
734
|
onClick: () => {
|
|
737
735
|
void handleSubmit();
|
|
738
736
|
},
|
|
739
|
-
children: isVerifying ? "Verifying..." : "
|
|
737
|
+
children: isVerifying ? "Verifying..." : "Continue"
|
|
740
738
|
}
|
|
741
739
|
)
|
|
742
740
|
] }),
|
|
@@ -768,6 +766,8 @@ function AuthResetPasswordVerificationStep({
|
|
|
768
766
|
const [isSending, setIsSending] = react.useState(false);
|
|
769
767
|
const [verificationCode, setVerificationCode] = react.useState("");
|
|
770
768
|
const [isVerifying, setIsVerifying] = react.useState(false);
|
|
769
|
+
const isLinkMethod = method === "link";
|
|
770
|
+
const displayDescription = isLinkMethod ? "We have sent an email to {email}. Please check your email to reset your password. The link expires in 10 minutes." : "We've sent a reset password code to your inbox at {email}. Enter it below to proceed.";
|
|
771
771
|
react.useEffect(() => {
|
|
772
772
|
if (resendCountdown > 0) {
|
|
773
773
|
const timer = setInterval(() => {
|
|
@@ -807,17 +807,20 @@ function AuthResetPasswordVerificationStep({
|
|
|
807
807
|
setVerificationCode("");
|
|
808
808
|
}
|
|
809
809
|
};
|
|
810
|
-
const isLinkMethod = method === "link";
|
|
811
|
-
const description = isLinkMethod ? `We've sent a password reset link to ${email}. Please check your email and click the link to reset your password. The link will expire in 10 minutes.` : `We've sent a 6-digit verification code to ${email}. Please enter it below to reset your password. The code will expire in 10 minutes.`;
|
|
812
810
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "if-verificationStep", children: [
|
|
813
|
-
/* @__PURE__ */ jsxRuntime.
|
|
811
|
+
isLinkMethod && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "if-verificationStep-descriptionContainer", children: [
|
|
812
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "if-verificationStep-descriptionTitle", children: "Check Your Email" }),
|
|
813
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "if-verificationStep-description", children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
814
|
+
part,
|
|
815
|
+
index < array.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "if-verificationLink-email", children: email })
|
|
816
|
+
] }, index)) })
|
|
817
|
+
] }),
|
|
814
818
|
!isLinkMethod && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "if-verificationStep-codeContainer", children: [
|
|
815
819
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "if-verificationStep-codeInputWrapper", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
816
820
|
AuthVerificationCodeInput,
|
|
817
821
|
{
|
|
818
822
|
value: verificationCode,
|
|
819
823
|
onChange: setVerificationCode,
|
|
820
|
-
email,
|
|
821
824
|
disabled: isVerifying
|
|
822
825
|
}
|
|
823
826
|
) }),
|
|
@@ -870,7 +873,7 @@ function SignInForm({
|
|
|
870
873
|
passwordLabel = "Password",
|
|
871
874
|
passwordPlaceholder = "\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
872
875
|
forgotPasswordText = "Forget Password?",
|
|
873
|
-
forgotPasswordUrl,
|
|
876
|
+
forgotPasswordUrl = "/forgot-password",
|
|
874
877
|
submitButtonText = "Sign In",
|
|
875
878
|
loadingButtonText = "Signing in...",
|
|
876
879
|
signUpText = "Don't have an account?",
|
|
@@ -881,13 +884,7 @@ function SignInForm({
|
|
|
881
884
|
onVerifyCode
|
|
882
885
|
}) {
|
|
883
886
|
return /* @__PURE__ */ jsxRuntime.jsxs(AuthContainer, { children: [
|
|
884
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
885
|
-
AuthHeader,
|
|
886
|
-
{
|
|
887
|
-
title: showVerificationStep ? "Verify Your Email" : title,
|
|
888
|
-
subtitle: showVerificationStep ? "" : subtitle
|
|
889
|
-
}
|
|
890
|
-
),
|
|
887
|
+
/* @__PURE__ */ jsxRuntime.jsx(AuthHeader, { title, subtitle }),
|
|
891
888
|
/* @__PURE__ */ jsxRuntime.jsx(AuthErrorBanner, { error: error || "" }),
|
|
892
889
|
showVerificationStep ? /* @__PURE__ */ jsxRuntime.jsx(AuthEmailVerificationStep, { email, onVerifyCode }) : /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit, noValidate: true, className: "if-form if-internal-fm9k2p", children: [
|
|
893
890
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -986,7 +983,7 @@ function SignIn({ onError, ...uiProps }) {
|
|
|
986
983
|
async function handleVerifyCode(code) {
|
|
987
984
|
setError("");
|
|
988
985
|
try {
|
|
989
|
-
const result = await verifyEmail(
|
|
986
|
+
const result = await verifyEmail(code, email);
|
|
990
987
|
if (result?.error) {
|
|
991
988
|
throw new Error(result.error.message || "Verification failed");
|
|
992
989
|
}
|
|
@@ -1057,13 +1054,7 @@ function SignUpForm({
|
|
|
1057
1054
|
onVerifyCode
|
|
1058
1055
|
}) {
|
|
1059
1056
|
return /* @__PURE__ */ jsxRuntime.jsxs(AuthContainer, { children: [
|
|
1060
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1061
|
-
AuthHeader,
|
|
1062
|
-
{
|
|
1063
|
-
title: showVerificationStep ? "Verify Your Email" : title,
|
|
1064
|
-
subtitle: showVerificationStep ? "" : subtitle
|
|
1065
|
-
}
|
|
1066
|
-
),
|
|
1057
|
+
/* @__PURE__ */ jsxRuntime.jsx(AuthHeader, { title, subtitle }),
|
|
1067
1058
|
/* @__PURE__ */ jsxRuntime.jsx(AuthErrorBanner, { error: error || "" }),
|
|
1068
1059
|
showVerificationStep ? /* @__PURE__ */ jsxRuntime.jsx(AuthEmailVerificationStep, { email, onVerifyCode }) : /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit, noValidate: true, className: "if-form if-internal-fm9k2p", children: [
|
|
1069
1060
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1213,7 +1204,7 @@ function SignUp({ onError, ...uiProps }) {
|
|
|
1213
1204
|
async function handleVerifyCode(code) {
|
|
1214
1205
|
setError("");
|
|
1215
1206
|
try {
|
|
1216
|
-
const result = await verifyEmail(
|
|
1207
|
+
const result = await verifyEmail(code, email);
|
|
1217
1208
|
if (result?.error) {
|
|
1218
1209
|
throw new Error(result.error.message || "Verification failed");
|
|
1219
1210
|
}
|
|
@@ -1263,10 +1254,10 @@ function ForgotPasswordForm({
|
|
|
1263
1254
|
error,
|
|
1264
1255
|
loading = false,
|
|
1265
1256
|
title = "Forgot Password?",
|
|
1266
|
-
subtitle = "Enter your email address and we'll send you a
|
|
1257
|
+
subtitle = "Enter your email address and we'll send you a {method} to reset your password.",
|
|
1267
1258
|
emailLabel = "Email",
|
|
1268
1259
|
emailPlaceholder = "example@email.com",
|
|
1269
|
-
submitButtonText = "
|
|
1260
|
+
submitButtonText = "Reset Password",
|
|
1270
1261
|
loadingButtonText = "Sending...",
|
|
1271
1262
|
backToSignInText = "Remember your password?",
|
|
1272
1263
|
backToSignInUrl = "/sign-in",
|
|
@@ -1275,14 +1266,9 @@ function ForgotPasswordForm({
|
|
|
1275
1266
|
onVerifyCode,
|
|
1276
1267
|
onResendEmail
|
|
1277
1268
|
}) {
|
|
1269
|
+
const displaySubtitle = subtitle.replace("{method}", resetPasswordMethod);
|
|
1278
1270
|
return /* @__PURE__ */ jsxRuntime.jsxs(AuthContainer, { children: [
|
|
1279
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1280
|
-
AuthHeader,
|
|
1281
|
-
{
|
|
1282
|
-
title: showVerificationStep ? resetPasswordMethod === "link" ? "Check Your Email" : "Enter Reset Code" : title,
|
|
1283
|
-
subtitle: showVerificationStep ? "" : subtitle
|
|
1284
|
-
}
|
|
1285
|
-
),
|
|
1271
|
+
/* @__PURE__ */ jsxRuntime.jsx(AuthHeader, { title, subtitle: displaySubtitle }),
|
|
1286
1272
|
/* @__PURE__ */ jsxRuntime.jsx(AuthErrorBanner, { error: error || "" }),
|
|
1287
1273
|
showVerificationStep ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1288
1274
|
AuthResetPasswordVerificationStep,
|