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