@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.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__ */ jsxs("div", { className: "if-verificationCode if-internal-vc8m4p", children: [
595
- /* @__PURE__ */ jsxs("p", { className: "if-verificationCode-description", children: [
596
- "We've sent a verification code to your inbox at",
597
- " ",
598
- /* @__PURE__ */ jsx("span", { className: "if-verificationCode-email", children: email }),
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
- index
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 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.";
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__ */ jsx("p", { className: "if-verificationStep-description", children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxs("span", { children: [
695
- part,
696
- index < array.length - 1 && /* @__PURE__ */ jsx("span", { className: "if-verificationCode-email", children: email })
697
- ] }, index)) }),
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__ */ jsx("div", { className: "if-verificationStep-codeInputWrapper", children: /* @__PURE__ */ jsx(
700
- AuthVerificationCodeInput,
701
- {
702
- value: verificationCode,
703
- onChange: setVerificationCode,
704
- email,
705
- disabled: isVerifying
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..." : "Verify Code"
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__ */ jsx("p", { className: "if-verificationStep-description", children: description }),
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
  ) }),