@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/atoms.js
CHANGED
|
@@ -543,7 +543,6 @@ function AuthOAuthProviders({
|
|
|
543
543
|
function AuthVerificationCodeInput({
|
|
544
544
|
length = 6,
|
|
545
545
|
value,
|
|
546
|
-
email,
|
|
547
546
|
onChange,
|
|
548
547
|
disabled = false,
|
|
549
548
|
onComplete
|
|
@@ -591,33 +590,25 @@ function AuthVerificationCodeInput({
|
|
|
591
590
|
}
|
|
592
591
|
}
|
|
593
592
|
};
|
|
594
|
-
return /* @__PURE__ */
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
". Enter it below to proceed."
|
|
600
|
-
] }),
|
|
601
|
-
/* @__PURE__ */ jsx("div", { className: "if-verificationCode-inputContainer", children: Array.from({ length }).map((_, index) => /* @__PURE__ */ jsx(
|
|
602
|
-
"input",
|
|
603
|
-
{
|
|
604
|
-
ref: (el) => {
|
|
605
|
-
inputRefs.current[index] = el;
|
|
606
|
-
},
|
|
607
|
-
type: "text",
|
|
608
|
-
inputMode: "numeric",
|
|
609
|
-
maxLength: 1,
|
|
610
|
-
value: value[index] || "",
|
|
611
|
-
onChange: (e) => handleChange(index, e.target.value),
|
|
612
|
-
onKeyDown: (e) => handleKeyDown(index, e),
|
|
613
|
-
onPaste: handlePaste,
|
|
614
|
-
disabled,
|
|
615
|
-
className: "if-verificationCode-input",
|
|
616
|
-
autoComplete: "one-time-code"
|
|
593
|
+
return /* @__PURE__ */ jsx("div", { className: "if-verificationCode-inputContainer", children: Array.from({ length }).map((_, index) => /* @__PURE__ */ jsx(
|
|
594
|
+
"input",
|
|
595
|
+
{
|
|
596
|
+
ref: (el) => {
|
|
597
|
+
inputRefs.current[index] = el;
|
|
617
598
|
},
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
599
|
+
type: "text",
|
|
600
|
+
inputMode: "numeric",
|
|
601
|
+
maxLength: 1,
|
|
602
|
+
value: value[index] || "",
|
|
603
|
+
onChange: (e) => handleChange(index, e.target.value),
|
|
604
|
+
onKeyDown: (e) => handleKeyDown(index, e),
|
|
605
|
+
onPaste: handlePaste,
|
|
606
|
+
disabled,
|
|
607
|
+
className: "if-verificationCode-input",
|
|
608
|
+
autoComplete: "one-time-code"
|
|
609
|
+
},
|
|
610
|
+
index
|
|
611
|
+
)) });
|
|
621
612
|
}
|
|
622
613
|
var InsforgeContext = createContext(void 0);
|
|
623
614
|
function useInsforge() {
|
|
@@ -638,7 +629,8 @@ function AuthEmailVerificationStep({
|
|
|
638
629
|
const [isSending, setIsSending] = useState(false);
|
|
639
630
|
const [verificationCode, setVerificationCode] = useState("");
|
|
640
631
|
const [isVerifying, setIsVerifying] = useState(false);
|
|
641
|
-
const
|
|
632
|
+
const isLinkMethod = method === "link";
|
|
633
|
+
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.";
|
|
642
634
|
useEffect(() => {
|
|
643
635
|
const sendInitialEmail = async () => {
|
|
644
636
|
try {
|
|
@@ -688,23 +680,29 @@ function AuthEmailVerificationStep({
|
|
|
688
680
|
setVerificationCode("");
|
|
689
681
|
}
|
|
690
682
|
};
|
|
691
|
-
const displayDescription = defaultDescription;
|
|
692
|
-
const isLinkMethod = method === "link";
|
|
693
683
|
return /* @__PURE__ */ jsxs("div", { className: "if-verificationStep", children: [
|
|
694
|
-
/* @__PURE__ */
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
684
|
+
isLinkMethod && /* @__PURE__ */ jsxs("div", { className: "if-verificationStep-descriptionContainer", children: [
|
|
685
|
+
/* @__PURE__ */ jsx("p", { className: "if-verificationStep-descriptionTitle", children: "Verify Your Email" }),
|
|
686
|
+
/* @__PURE__ */ jsx("p", { className: "if-verificationStep-description", children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxs("span", { children: [
|
|
687
|
+
part,
|
|
688
|
+
index < array.length - 1 && /* @__PURE__ */ jsx("span", { className: "if-verificationLink-email", children: email })
|
|
689
|
+
] }, index)) })
|
|
690
|
+
] }),
|
|
698
691
|
!isLinkMethod && /* @__PURE__ */ jsxs("div", { className: "if-verificationStep-codeContainer", children: [
|
|
699
|
-
/* @__PURE__ */
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
692
|
+
/* @__PURE__ */ jsxs("div", { className: "if-verificationStep-codeInputWrapper", children: [
|
|
693
|
+
/* @__PURE__ */ jsx("p", { className: "if-verificationStep-codeDescription", children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxs("span", { children: [
|
|
694
|
+
part,
|
|
695
|
+
index < array.length - 1 && /* @__PURE__ */ jsx("span", { className: "if-verificationCode-email", children: email })
|
|
696
|
+
] }, index)) }),
|
|
697
|
+
/* @__PURE__ */ jsx(
|
|
698
|
+
AuthVerificationCodeInput,
|
|
699
|
+
{
|
|
700
|
+
value: verificationCode,
|
|
701
|
+
onChange: setVerificationCode,
|
|
702
|
+
disabled: isVerifying
|
|
703
|
+
}
|
|
704
|
+
)
|
|
705
|
+
] }),
|
|
708
706
|
/* @__PURE__ */ jsx(
|
|
709
707
|
AuthSubmitButton,
|
|
710
708
|
{
|
|
@@ -714,7 +712,7 @@ function AuthEmailVerificationStep({
|
|
|
714
712
|
onClick: () => {
|
|
715
713
|
void handleSubmit();
|
|
716
714
|
},
|
|
717
|
-
children: isVerifying ? "Verifying..." : "
|
|
715
|
+
children: isVerifying ? "Verifying..." : "Continue"
|
|
718
716
|
}
|
|
719
717
|
)
|
|
720
718
|
] }),
|
|
@@ -746,6 +744,8 @@ function AuthResetPasswordVerificationStep({
|
|
|
746
744
|
const [isSending, setIsSending] = useState(false);
|
|
747
745
|
const [verificationCode, setVerificationCode] = useState("");
|
|
748
746
|
const [isVerifying, setIsVerifying] = useState(false);
|
|
747
|
+
const isLinkMethod = method === "link";
|
|
748
|
+
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.";
|
|
749
749
|
useEffect(() => {
|
|
750
750
|
if (resendCountdown > 0) {
|
|
751
751
|
const timer = setInterval(() => {
|
|
@@ -785,17 +785,20 @@ function AuthResetPasswordVerificationStep({
|
|
|
785
785
|
setVerificationCode("");
|
|
786
786
|
}
|
|
787
787
|
};
|
|
788
|
-
const isLinkMethod = method === "link";
|
|
789
|
-
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.`;
|
|
790
788
|
return /* @__PURE__ */ jsxs("div", { className: "if-verificationStep", children: [
|
|
791
|
-
/* @__PURE__ */
|
|
789
|
+
isLinkMethod && /* @__PURE__ */ jsxs("div", { className: "if-verificationStep-descriptionContainer", children: [
|
|
790
|
+
/* @__PURE__ */ jsx("p", { className: "if-verificationStep-descriptionTitle", children: "Check Your Email" }),
|
|
791
|
+
/* @__PURE__ */ jsx("p", { className: "if-verificationStep-description", children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxs("span", { children: [
|
|
792
|
+
part,
|
|
793
|
+
index < array.length - 1 && /* @__PURE__ */ jsx("span", { className: "if-verificationLink-email", children: email })
|
|
794
|
+
] }, index)) })
|
|
795
|
+
] }),
|
|
792
796
|
!isLinkMethod && /* @__PURE__ */ jsxs("div", { className: "if-verificationStep-codeContainer", children: [
|
|
793
797
|
/* @__PURE__ */ jsx("div", { className: "if-verificationStep-codeInputWrapper", children: /* @__PURE__ */ jsx(
|
|
794
798
|
AuthVerificationCodeInput,
|
|
795
799
|
{
|
|
796
800
|
value: verificationCode,
|
|
797
801
|
onChange: setVerificationCode,
|
|
798
|
-
email,
|
|
799
802
|
disabled: isVerifying
|
|
800
803
|
}
|
|
801
804
|
) }),
|