@insforge/react 0.4.7 → 0.4.9
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 +55 -95
- package/dist/atoms.cjs +81 -93
- package/dist/atoms.cjs.map +1 -1
- package/dist/atoms.d.cts +4 -4
- package/dist/atoms.d.ts +4 -4
- package/dist/atoms.js +81 -93
- package/dist/atoms.js.map +1 -1
- package/dist/components.cjs +128 -130
- package/dist/components.cjs.map +1 -1
- package/dist/components.js +128 -130
- package/dist/components.js.map +1 -1
- package/dist/forms.cjs +108 -124
- package/dist/forms.cjs.map +1 -1
- package/dist/forms.d.cts +2 -4
- package/dist/forms.d.ts +2 -4
- package/dist/forms.js +108 -124
- package/dist/forms.js.map +1 -1
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +148 -155
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -4
- package/dist/index.d.ts +1 -4
- package/dist/index.js +148 -155
- 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 -71
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ if (typeof document !== 'undefined' && typeof window !== 'undefined') {
|
|
|
5
5
|
if (!document.getElementById(styleId)) {
|
|
6
6
|
const style = document.createElement('style');
|
|
7
7
|
style.id = styleId;
|
|
8
|
-
style.textContent = "/**\n * InsForge React Component Library Styles\n * Traditional CSS with scoped class names (no Tailwind)\n */\n\n/* ============================================\n FONTS\n ============================================ */\n@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');\n@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&display=swap');\n\n/* ============================================\n CSS VARIABLES\n ============================================ */\n:root {\n /* Colors */\n --if-color-primary: #000000;\n --if-color-primary-hover: #1f1f1f;\n --if-color-text: #000000;\n --if-color-text-secondary: #828282;\n --if-color-text-muted: #a3a3a3;\n --if-color-border: #d4d4d4;\n --if-color-border-focus: #000000;\n --if-color-bg-white: #ffffff;\n --if-color-bg-light: #fafafa;\n --if-color-bg-hover: #f9fafb;\n --if-color-error: #dc2626;\n --if-color-error-bg: #fee2e2;\n --if-color-success: #16a34a;\n\n /* Spacing */\n --if-space-1: 0.25rem; /* 4px */\n --if-space-2: 0.5rem; /* 8px */\n --if-space-3: 0.75rem; /* 12px */\n --if-space-4: 1rem; /* 16px */\n --if-space-6: 1.5rem; /* 24px */\n --if-space-8: 2rem; /* 32px */\n\n /* Border Radius */\n --if-radius-xs: 0.125rem; /* 2px */\n --if-radius-sm: 0.25rem; /* 4px */\n --if-radius-md: 0.375rem; /* 6px */\n --if-radius-lg: 0.5rem; /* 8px */\n --if-radius-xl: 0.75rem; /* 12px */\n\n /* Typography */\n --if-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;\n --if-font-family-manrope:\n 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;\n --if-font-size-xs: 0.75rem; /* 12px */\n --if-font-size-sm: 0.875rem; /* 14px */\n --if-font-size-base: 1rem; /* 16px */\n --if-font-size-lg: 1.125rem; /* 18px */\n --if-font-size-xl: 1.25rem; /* 20px */\n --if-font-size-2xl: 1.5rem; /* 24px */\n\n /* Shadows */\n --if-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n --if-shadow-md: 0 1px 2px 0 rgba(0, 0, 0, 0.1);\n --if-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n\n /* Transitions */\n --if-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);\n --if-transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n/* ============================================\n AUTH CONTAINER\n ============================================ */\n.if-authContainer {\n width: 100%;\n max-width: 400px;\n border-radius: var(--if-radius-xl);\n overflow: hidden;\n box-shadow: var(--if-shadow-lg);\n}\n\n.if-authCard {\n background-color: var(--if-color-bg-white);\n padding: var(--if-space-6);\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: stretch;\n gap: var(--if-space-6);\n}\n\n/* ============================================\n AUTH HEADER\n ============================================ */\n.if-authHeader {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n gap: var(--if-space-2);\n}\n\n.if-authHeader-title {\n font-size: var(--if-font-size-2xl);\n font-weight: 600;\n color: var(--if-color-text);\n line-height: 2rem;\n margin: 0;\n font-family: var(--if-font-family);\n}\n\n.if-authHeader-subtitle {\n font-size: var(--if-font-size-sm);\n font-weight: 400;\n color: var(--if-color-text-secondary);\n line-height: 1.5rem;\n margin: 0;\n font-family: var(--if-font-family);\n}\n\n/* ============================================\n FORM FIELD\n ============================================ */\n.if-formField {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: stretch;\n gap: var(--if-space-1);\n}\n\n.if-formField-label {\n font-size: var(--if-font-size-sm);\n font-weight: 400;\n color: var(--if-color-text);\n line-height: 1.5rem;\n font-family: var(--if-font-family);\n}\n\n.if-formField-input {\n width: 100%;\n display: flex;\n align-items: center;\n gap: var(--if-space-2);\n align-self: stretch;\n padding: var(--if-space-2) var(--if-space-3);\n border-radius: var(--if-radius-sm);\n border: 1px solid var(--if-color-border);\n background-color: var(--if-color-bg-white);\n font-size: var(--if-font-size-sm);\n font-weight: 400;\n line-height: 1.25rem;\n color: var(--if-color-text);\n font-family: var(--if-font-family);\n transition: border-color var(--if-transition-base);\n}\n\n.if-formField-input::placeholder {\n color: var(--if-color-text-muted);\n font-size: var(--if-font-size-sm);\n font-weight: 400;\n}\n\n.if-formField-input:focus {\n outline: none;\n border-color: var(--if-color-border-focus);\n}\n\n/* ============================================\n PASSWORD FIELD\n ============================================ */\n.if-passwordField {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: stretch;\n gap: var(--if-space-1);\n}\n\n.if-passwordField-labelRow {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.if-passwordField-label {\n font-size: var(--if-font-size-sm);\n font-weight: 400;\n color: var(--if-color-text);\n line-height: 1.5rem;\n font-family: var(--if-font-family);\n}\n\n.if-passwordField-forgotLink {\n font-size: var(--if-font-size-sm);\n font-weight: 400;\n color: var(--if-color-text-secondary);\n text-decoration: none;\n transition: color var(--if-transition-fast);\n font-family: var(--if-font-family);\n}\n\n.if-passwordField-inputWrapper {\n position: relative;\n width: 100%;\n}\n\n.if-passwordField-input {\n width: 100%;\n display: flex;\n align-items: center;\n align-self: stretch;\n padding: var(--if-space-2) var(--if-space-3);\n padding-right: 2.5rem; /* Space for toggle button */\n border-radius: var(--if-radius-sm);\n border: 1px solid var(--if-color-border);\n background-color: var(--if-color-bg-white);\n font-size: var(--if-font-size-sm);\n font-weight: 400;\n line-height: 1.25rem;\n color: var(--if-color-text);\n font-family: var(--if-font-family);\n transition: border-color var(--if-transition-base);\n}\n\n.if-passwordField-input::placeholder {\n color: var(--if-color-text-muted);\n}\n\n.if-passwordField-input:focus {\n outline: none;\n border-color: var(--if-color-border-focus);\n}\n\n.if-passwordField-toggleButton {\n position: absolute;\n right: var(--if-space-1);\n top: 50%;\n transform: translateY(-50%);\n background: none;\n border: none;\n cursor: pointer;\n padding: var(--if-space-1);\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--if-color-text-secondary);\n transition: color var(--if-transition-fast);\n}\n\n/* ============================================\n SUBMIT BUTTON\n ============================================ */\n.if-submitButton {\n border-radius: var(--if-radius-sm);\n background-color: var(--if-color-primary);\n height: 2.5rem;\n width: 100%;\n display: flex;\n margin-top: var(--if-space-4);\n padding: var(--if-space-2) var(--if-space-4);\n justify-content: center;\n align-items: center;\n gap: 0.625rem;\n align-self: stretch;\n color: var(--if-color-bg-white);\n font-weight: 600;\n font-family: var(--if-font-family-manrope);\n font-size: var(--if-font-size-base);\n line-height: normal;\n border: none;\n cursor: pointer;\n transition: background-color var(--if-transition-base);\n}\n\n.if-submitButton:hover:not(:disabled) {\n background-color: var(--if-color-primary-hover);\n}\n\n.if-submitButton:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.if-submitButton-icon {\n width: 1.25rem;\n height: 1.25rem;\n}\n\n/* Spinner animation */\n@keyframes if-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n.if-submitButton-spinner {\n animation: if-spin 1s linear infinite;\n}\n\n/* ============================================\n OAUTH BUTTON\n ============================================ */\n.if-oauthButton {\n display: flex;\n width: 100%;\n height: 2.25rem;\n padding: var(--if-space-2) var(--if-space-3);\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: var(--if-space-3);\n border-radius: var(--if-radius-md);\n border: 1px solid #e4e4e7;\n background-color: var(--if-color-bg-white);\n box-shadow: var(--if-shadow-md);\n color: #09090b;\n text-align: center;\n font-size: var(--if-font-size-sm);\n font-weight: 500;\n line-height: 1.25rem;\n cursor: pointer;\n transition: all var(--if-transition-base);\n font-family: var(--if-font-family);\n}\n\n.if-oauthButton:hover:not(:disabled) {\n background-color: var(--if-color-bg-hover);\n border-color: #9ca3af;\n}\n\n.if-oauthButton:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.if-oauthButton-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 1.125rem;\n height: 1.125rem;\n}\n\n.if-oauthButton-full {\n justify-content: center;\n}\n\n.if-oauthButton-short {\n justify-content: center;\n padding: var(--if-space-2);\n gap: var(--if-space-2);\n}\n\n.if-oauthButton-icon-only {\n justify-content: center;\n gap: 0;\n}\n\n/* ============================================\n OAUTH PROVIDERS CONTAINER\n ============================================ */\n.if-oauthProviders {\n display: flex;\n flex-direction: column;\n gap: var(--if-space-3);\n width: 100%;\n}\n\n/* ============================================\n AUTH LINK\n ============================================ */\n.if-authLink {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: var(--if-space-1);\n font-size: var(--if-font-size-sm);\n color: var(--if-color-text-secondary);\n font-family: var(--if-font-family);\n}\n\n.if-authLink-text {\n font-weight: 400;\n}\n\n.if-authLink-link {\n font-weight: 600;\n color: var(--if-color-text);\n text-decoration: none;\n transition: opacity var(--if-transition-fast);\n}\n\n/* ============================================\n AUTH DIVIDER\n ============================================ */\n.if-authDivider {\n display: flex;\n align-items: center;\n text-align: center;\n width: 100%;\n gap: var(--if-space-3);\n}\n\n.if-authDivider-line {\n flex: 1;\n border-top: 1px solid var(--if-color-border);\n}\n\n.if-authDivider-text {\n font-size: var(--if-font-size-sm);\n color: var(--if-color-text-secondary);\n font-weight: 400;\n font-family: var(--if-font-family-manrope);\n}\n\n/* ============================================\n ERROR BANNER\n ============================================ */\n.if-errorBanner {\n padding: var(--if-space-3);\n background-color: var(--if-color-error-bg);\n border-radius: var(--if-radius-md);\n border: 1px solid var(--if-color-error);\n}\n\n.if-errorBanner-content {\n display: flex;\n align-items: center;\n gap: var(--if-space-2);\n}\n\n.if-errorBanner-icon {\n width: 1.5rem;\n height: 1.5rem;\n flex-shrink: 0;\n color: var(--if-color-error);\n}\n\n.if-errorBanner-text {\n font-size: var(--if-font-size-sm);\n color: var(--if-color-error);\n font-weight: 400;\n font-family: var(--if-font-family);\n margin: 0;\n}\n\n/* ============================================\n AUTH BRANDING\n ============================================ */\n.if-authBranding {\n background-color: var(--if-color-bg-light);\n padding: var(--if-space-4) var(--if-space-2);\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: var(--if-space-1);\n}\n\n.if-authBranding-text {\n font-size: var(--if-font-size-xs);\n font-weight: 500;\n color: var(--if-color-text);\n font-family: var(--if-font-family-manrope);\n margin: 0;\n}\n\n/* ============================================\n VERIFICATION CODE INPUT\n ============================================ */\n.if-verificationCode {\n display: flex;\n flex-direction: column;\n gap: var(--if-space-4);\n}\n\n.if-verificationCode-description {\n font-size: var(--if-font-size-sm);\n color: var(--if-color-text-secondary);\n text-align: center;\n font-family: var(--if-font-family);\n}\n\n.if-verificationCode-email {\n font-weight: 600;\n color: var(--if-color-text);\n}\n\n.if-verificationCode-inputContainer {\n display: flex;\n gap: var(--if-space-2);\n justify-content: center;\n}\n\n.if-verificationCode-input {\n width: 3rem;\n height: 3rem;\n text-align: center;\n font-size: var(--if-font-size-xl);\n font-weight: 600;\n border: 2px solid var(--if-color-border);\n border-radius: var(--if-radius-md);\n transition: border-color var(--if-transition-base);\n font-family: var(--if-font-family);\n}\n\n.if-verificationCode-input:focus {\n outline: none;\n border-color: var(--if-color-border-focus);\n}\n\n/* ============================================\n VERIFICATION STEP\n ============================================ */\n.if-verificationStep {\n display: flex;\n flex-direction: column;\n gap: var(--if-space-6);\n align-items: stretch;\n}\n\n.if-verificationStep-description {\n font-size: var(--if-font-size-sm);\n color: var(--if-color-text-secondary);\n text-align: center;\n margin: 0;\n font-family: var(--if-font-family);\n}\n\n.if-verificationStep-codeContainer {\n width: 100%;\n background-color: #f5f5f5;\n border-radius: var(--if-radius-lg);\n padding: var(--if-space-4) var(--if-space-4) var(--if-space-6);\n display: flex;\n flex-direction: column;\n gap: var(--if-space-4);\n}\n\n.if-verificationStep-codeInputWrapper {\n display: flex;\n flex-direction: column;\n gap: var(--if-space-3);\n margin-top: var(--if-space-2);\n}\n\n.if-verificationStep-verifyingText {\n font-size: var(--if-font-size-sm);\n color: var(--if-color-text-secondary);\n text-align: center;\n font-family: var(--if-font-family);\n}\n\n.if-verificationStep-resendContainer {\n width: 100%;\n font-size: var(--if-font-size-sm);\n text-align: center;\n color: var(--if-color-text-secondary);\n font-family: var(--if-font-family);\n}\n\n.if-verificationStep-resendButton {\n color: var(--if-color-text);\n font-weight: 500;\n transition: all var(--if-transition-base);\n background: none;\n border: none;\n padding: 0;\n font-family: var(--if-font-family);\n font-size: var(--if-font-size-sm);\n}\n\n.if-verificationStep-resendButton:not(:disabled) {\n cursor: pointer;\n text-decoration: underline;\n}\n\n.if-verificationStep-resendButton:disabled {\n cursor: not-allowed;\n text-decoration: none;\n opacity: 0.5;\n}\n\n/* ============================================\n PASSWORD STRENGTH INDICATOR\n ============================================ */\n.if-passwordStrength {\n margin-top: var(--if-space-2);\n}\n\n.if-passwordStrength-bar {\n height: 4px;\n background-color: #e5e7eb;\n border-radius: 2px;\n overflow: hidden;\n margin-bottom: var(--if-space-2);\n}\n\n.if-passwordStrength-fill {\n height: 100%;\n transition:\n width var(--if-transition-base),\n background-color var(--if-transition-base);\n}\n\n.if-passwordStrength-fill.weak {\n background-color: #ef4444;\n width: 33%;\n}\n\n.if-passwordStrength-fill.medium {\n background-color: #f59e0b;\n width: 66%;\n}\n\n.if-passwordStrength-fill.strong {\n background-color: var(--if-color-success);\n width: 100%;\n}\n\n.if-passwordStrength-text {\n font-size: var(--if-font-size-xs);\n color: var(--if-color-text-secondary);\n font-family: var(--if-font-family);\n}\n\n.if-passwordStrength-requirements {\n margin-top: var(--if-space-2);\n font-size: var(--if-font-size-xs);\n color: var(--if-color-text-secondary);\n font-family: var(--if-font-family);\n}\n\n.if-passwordStrength-requirement {\n display: flex;\n align-items: center;\n gap: var(--if-space-1);\n margin-bottom: var(--if-space-1);\n}\n\n.if-passwordStrength-requirement.met {\n color: var(--if-color-success);\n}\n\n.if-passwordStrength-requirement.unmet {\n color: var(--if-color-text-muted);\n}\n\n/* ============================================\n FORM CONTAINER\n ============================================ */\n.if-form {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n justify-content: center;\n gap: var(--if-space-6);\n}\n\n/* ============================================\n USER BUTTON\n ============================================ */\n.if-userButton-container {\n position: relative;\n display: inline-block;\n}\n\n.if-userButton {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--if-space-2);\n padding: var(--if-space-2);\n border-radius: 9999px;\n background-color: transparent;\n border: none;\n cursor: pointer;\n transition: all var(--if-transition-base);\n}\n\n.if-userButton:hover {\n opacity: 0.8;\n}\n\n.if-userButton-detailed {\n background-color: var(--if-color-bg-white);\n border: 1px solid var(--if-color-border);\n border-radius: var(--if-radius-sm);\n padding: var(--if-space-2);\n}\n\n.if-userButton-detailed:hover {\n background-color: var(--if-color-bg-light);\n opacity: 1;\n}\n\n.if-userButton-avatar {\n width: 2rem;\n height: 2rem;\n border-radius: 9999px;\n background-color: var(--if-color-primary);\n color: var(--if-color-bg-white);\n display: flex;\n align-items: center;\n justify-content: center;\n font-weight: 600;\n font-size: var(--if-font-size-sm);\n font-family: var(--if-font-family);\n overflow: hidden;\n}\n\n.if-userButton-avatarImage {\n border-radius: 9999px;\n object-fit: cover;\n width: 100%;\n height: 100%;\n}\n\n.if-userButton-avatarInitials {\n color: var(--if-color-bg-white);\n font-weight: 600;\n font-size: var(--if-font-size-sm);\n}\n\n.if-userButton-info {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 0.125rem;\n}\n\n.if-userButton-name {\n font-size: var(--if-font-size-sm);\n font-weight: 600;\n color: var(--if-color-text);\n line-height: 1.25rem;\n text-align: left;\n font-family: var(--if-font-family);\n}\n\n.if-userButton-email {\n font-size: var(--if-font-size-xs);\n color: var(--if-color-text-secondary);\n line-height: 1rem;\n text-align: left;\n font-family: var(--if-font-family);\n}\n\n.if-userButton-menu {\n position: absolute;\n margin-top: var(--if-space-2);\n background-color: var(--if-color-bg-white);\n border: 1px solid var(--if-color-border);\n border-radius: var(--if-radius-md);\n box-shadow: var(--if-shadow-lg);\n padding: var(--if-space-2);\n min-width: 200px;\n z-index: 50;\n}\n\n.if-userButton-menuItem {\n display: flex;\n align-items: center;\n gap: var(--if-space-2);\n padding: var(--if-space-2);\n border-radius: var(--if-radius-sm);\n cursor: pointer;\n transition: background-color var(--if-transition-fast);\n font-size: var(--if-font-size-sm);\n color: var(--if-color-text);\n font-family: var(--if-font-family);\n background: none;\n border: none;\n width: 100%;\n text-align: left;\n}\n\n.if-userButton-menuItem:hover {\n background-color: var(--if-color-bg-light);\n}\n\n.if-userButton-menuItem-signout {\n color: var(--if-color-error);\n}\n\n.if-userButton-menuItem-icon {\n width: 1.25rem;\n height: 1.25rem;\n}\n\n/* ============================================\n EMAIL VERIFICATION STATUS\n ============================================ */\n.if-verifyStatus-container {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--if-space-6);\n}\n\n.if-verifyStatus-container-stretch {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: stretch;\n justify-content: center;\n gap: var(--if-space-6);\n}\n\n.if-verifyStatus-spinner {\n border-radius: 9999px;\n height: 3rem;\n width: 3rem;\n border-bottom: 2px solid var(--if-color-primary);\n}\n\n.if-verifyStatus-successContent {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--if-space-4);\n}\n\n.if-verifyStatus-successIcon {\n width: 4rem;\n height: 4rem;\n border-radius: 9999px;\n background-color: #d1fae5;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.if-verifyStatus-successIconSvg {\n width: 2rem;\n height: 2rem;\n color: #059669;\n}\n\n.if-verifyStatus-textCenter {\n text-align: center;\n}\n\n/* ============================================\n UTILITY CLASSES\n ============================================ */\n.if-hidden {\n display: none;\n}\n\n.if-visuallyHidden {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n";
|
|
8
|
+
style.textContent = "/**\n * InsForge React Component Library Styles\n * Traditional CSS with scoped class names (no Tailwind)\n */\n\n/* ============================================\n FONTS\n ============================================ */\n@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');\n@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&display=swap');\n\n/* ============================================\n CSS VARIABLES\n ============================================ */\n:root {\n /* Colors */\n --if-color-primary: #000000;\n --if-color-primary-hover: #1f1f1f;\n --if-color-text: #000000;\n --if-color-text-secondary: #828282;\n --if-color-text-muted: #a3a3a3;\n --if-color-border: #d4d4d4;\n --if-color-border-focus: #000000;\n --if-color-bg-white: #ffffff;\n --if-color-bg-light: #fafafa;\n --if-color-bg-hover: #f9fafb;\n --if-color-error: #dc2626;\n --if-color-error-bg: #fee2e2;\n --if-color-success: #16a34a;\n\n /* Spacing */\n --if-space-1: 0.25rem; /* 4px */\n --if-space-2: 0.5rem; /* 8px */\n --if-space-3: 0.75rem; /* 12px */\n --if-space-4: 1rem; /* 16px */\n --if-space-6: 1.5rem; /* 24px */\n --if-space-8: 2rem; /* 32px */\n\n /* Border Radius */\n --if-radius-xs: 0.125rem; /* 2px */\n --if-radius-sm: 0.25rem; /* 4px */\n --if-radius-md: 0.375rem; /* 6px */\n --if-radius-lg: 0.5rem; /* 8px */\n --if-radius-xl: 0.75rem; /* 12px */\n\n /* Typography */\n --if-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;\n --if-font-family-manrope:\n 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;\n --if-font-size-xs: 0.75rem; /* 12px */\n --if-font-size-sm: 0.875rem; /* 14px */\n --if-font-size-base: 1rem; /* 16px */\n --if-font-size-lg: 1.125rem; /* 18px */\n --if-font-size-xl: 1.25rem; /* 20px */\n --if-font-size-2xl: 1.5rem; /* 24px */\n\n /* Shadows */\n --if-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n --if-shadow-md: 0 1px 2px 0 rgba(0, 0, 0, 0.1);\n --if-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n\n /* Transitions */\n --if-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);\n --if-transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n/* ============================================\n AUTH CONTAINER\n ============================================ */\n.if-authContainer {\n width: 100%;\n max-width: 400px;\n border-radius: var(--if-radius-xl);\n overflow: hidden;\n box-shadow: var(--if-shadow-lg);\n}\n\n.if-authCard {\n background-color: var(--if-color-bg-white);\n padding: var(--if-space-6);\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: stretch;\n gap: var(--if-space-6);\n}\n\n/* ============================================\n AUTH HEADER\n ============================================ */\n.if-authHeader {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n gap: var(--if-space-2);\n}\n\n.if-authHeader-title {\n font-size: var(--if-font-size-2xl);\n font-weight: 600;\n color: var(--if-color-text);\n line-height: 2rem;\n margin: 0;\n font-family: var(--if-font-family);\n}\n\n.if-authHeader-subtitle {\n font-size: var(--if-font-size-sm);\n font-weight: 400;\n color: var(--if-color-text-secondary);\n line-height: 1.5rem;\n margin: 0;\n font-family: var(--if-font-family);\n}\n\n/* ============================================\n FORM FIELD\n ============================================ */\n.if-formField {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: stretch;\n gap: var(--if-space-1);\n}\n\n.if-formField-label {\n font-size: var(--if-font-size-sm);\n font-weight: 400;\n color: var(--if-color-text);\n line-height: 1.5rem;\n font-family: var(--if-font-family);\n}\n\n.if-formField-input {\n width: 100%;\n display: flex;\n align-items: center;\n gap: var(--if-space-2);\n align-self: stretch;\n padding: var(--if-space-2) var(--if-space-3);\n border-radius: var(--if-radius-sm);\n border: 1px solid var(--if-color-border);\n background-color: var(--if-color-bg-white);\n font-size: var(--if-font-size-sm);\n font-weight: 400;\n line-height: 1.25rem;\n color: var(--if-color-text);\n font-family: var(--if-font-family);\n transition: border-color var(--if-transition-base);\n}\n\n.if-formField-input::placeholder {\n color: var(--if-color-text-muted);\n font-size: var(--if-font-size-sm);\n font-weight: 400;\n}\n\n.if-formField-input:focus {\n outline: none;\n border-color: var(--if-color-border-focus);\n}\n\n/* ============================================\n PASSWORD FIELD\n ============================================ */\n.if-passwordField {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: stretch;\n gap: var(--if-space-1);\n}\n\n.if-passwordField-labelRow {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.if-passwordField-label {\n font-size: var(--if-font-size-sm);\n font-weight: 400;\n color: var(--if-color-text);\n line-height: 1.5rem;\n font-family: var(--if-font-family);\n}\n\n.if-passwordField-forgotLink {\n font-size: var(--if-font-size-sm);\n font-weight: 400;\n color: var(--if-color-text-secondary);\n text-decoration: none;\n transition: color var(--if-transition-fast);\n font-family: var(--if-font-family);\n}\n\n.if-passwordField-inputWrapper {\n position: relative;\n width: 100%;\n}\n\n.if-passwordField-input {\n width: 100%;\n display: flex;\n align-items: center;\n align-self: stretch;\n padding: var(--if-space-2) var(--if-space-3);\n padding-right: 2.5rem; /* Space for toggle button */\n border-radius: var(--if-radius-sm);\n border: 1px solid var(--if-color-border);\n background-color: var(--if-color-bg-white);\n font-size: var(--if-font-size-sm);\n font-weight: 400;\n line-height: 1.25rem;\n color: var(--if-color-text);\n font-family: var(--if-font-family);\n transition: border-color var(--if-transition-base);\n}\n\n.if-passwordField-input::placeholder {\n color: var(--if-color-text-muted);\n}\n\n.if-passwordField-input:focus {\n outline: none;\n border-color: var(--if-color-border-focus);\n}\n\n.if-passwordField-toggleButton {\n position: absolute;\n right: var(--if-space-1);\n top: 50%;\n transform: translateY(-50%);\n background: none;\n border: none;\n cursor: pointer;\n padding: var(--if-space-1);\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--if-color-text-secondary);\n transition: color var(--if-transition-fast);\n}\n\n/* ============================================\n SUBMIT BUTTON\n ============================================ */\n.if-submitButton {\n border-radius: var(--if-radius-sm);\n background-color: var(--if-color-primary);\n height: 2.5rem;\n width: 100%;\n display: flex;\n margin-top: var(--if-space-4);\n padding: var(--if-space-2) var(--if-space-4);\n justify-content: center;\n align-items: center;\n gap: 0.625rem;\n align-self: stretch;\n color: var(--if-color-bg-white);\n font-weight: 600;\n font-family: var(--if-font-family-manrope);\n font-size: var(--if-font-size-base);\n line-height: normal;\n border: none;\n cursor: pointer;\n transition: background-color var(--if-transition-base);\n}\n\n.if-submitButton:hover:not(:disabled) {\n background-color: var(--if-color-primary-hover);\n}\n\n.if-submitButton:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.if-submitButton-icon {\n width: 1.25rem;\n height: 1.25rem;\n}\n\n/* Spinner animation */\n@keyframes if-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n.if-submitButton-spinner {\n animation: if-spin 1s linear infinite;\n}\n\n/* ============================================\n OAUTH BUTTON\n ============================================ */\n.if-oauthButton {\n display: flex;\n width: 100%;\n height: 2.25rem;\n padding: var(--if-space-2) var(--if-space-3);\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: var(--if-space-3);\n border-radius: var(--if-radius-md);\n border: 1px solid #e4e4e7;\n background-color: var(--if-color-bg-white);\n box-shadow: var(--if-shadow-md);\n color: #09090b;\n text-align: center;\n font-size: var(--if-font-size-sm);\n font-weight: 500;\n line-height: 1.25rem;\n cursor: pointer;\n transition: all var(--if-transition-base);\n font-family: var(--if-font-family);\n}\n\n.if-oauthButton:hover:not(:disabled) {\n background-color: var(--if-color-bg-hover);\n border-color: #9ca3af;\n}\n\n.if-oauthButton:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.if-oauthButton-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 1.125rem;\n height: 1.125rem;\n}\n\n.if-oauthButton-full {\n justify-content: center;\n}\n\n.if-oauthButton-short {\n justify-content: center;\n padding: var(--if-space-2);\n gap: var(--if-space-2);\n}\n\n.if-oauthButton-icon-only {\n justify-content: center;\n gap: 0;\n}\n\n/* ============================================\n OAUTH PROVIDERS CONTAINER\n ============================================ */\n.if-oauthProviders {\n display: flex;\n flex-direction: column;\n gap: var(--if-space-3);\n width: 100%;\n}\n\n/* ============================================\n AUTH LINK\n ============================================ */\n.if-authLink {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: var(--if-space-1);\n font-size: var(--if-font-size-sm);\n color: var(--if-color-text-secondary);\n font-family: var(--if-font-family);\n}\n\n.if-authLink-text {\n font-weight: 400;\n}\n\n.if-authLink-link {\n font-weight: 600;\n color: var(--if-color-text);\n text-decoration: none;\n transition: opacity var(--if-transition-fast);\n}\n\n/* ============================================\n AUTH DIVIDER\n ============================================ */\n.if-authDivider {\n display: flex;\n align-items: center;\n text-align: center;\n width: 100%;\n gap: var(--if-space-3);\n}\n\n.if-authDivider-line {\n flex: 1;\n border-top: 1px solid var(--if-color-border);\n}\n\n.if-authDivider-text {\n font-size: var(--if-font-size-sm);\n color: var(--if-color-text-secondary);\n font-weight: 400;\n font-family: var(--if-font-family-manrope);\n}\n\n/* ============================================\n ERROR BANNER\n ============================================ */\n.if-errorBanner {\n padding: var(--if-space-3);\n background-color: var(--if-color-error-bg);\n border-radius: var(--if-radius-md);\n border: 1px solid var(--if-color-error);\n}\n\n.if-errorBanner-content {\n display: flex;\n align-items: center;\n gap: var(--if-space-2);\n}\n\n.if-errorBanner-icon {\n width: 1.5rem;\n height: 1.5rem;\n flex-shrink: 0;\n color: var(--if-color-error);\n}\n\n.if-errorBanner-text {\n font-size: var(--if-font-size-sm);\n color: var(--if-color-error);\n font-weight: 400;\n font-family: var(--if-font-family);\n margin: 0;\n}\n\n/* ============================================\n AUTH BRANDING\n ============================================ */\n.if-authBranding {\n background-color: var(--if-color-bg-light);\n padding: var(--if-space-4) var(--if-space-2);\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: var(--if-space-1);\n}\n\n.if-authBranding-text {\n font-size: var(--if-font-size-xs);\n font-weight: 500;\n color: var(--if-color-text);\n font-family: var(--if-font-family-manrope);\n margin: 0;\n}\n\n/* ============================================\n VERIFICATION CODE INPUT\n ============================================ */\n.if-verificationCode-inputContainer {\n display: flex;\n gap: var(--if-space-3);\n justify-content: center;\n}\n\n.if-verificationCode-input {\n width: 3rem;\n height: 3rem;\n text-align: center;\n font-size: var(--if-font-size-base);\n font-weight: 600;\n border: 1px solid var(--if-color-border);\n border-radius: var(--if-radius-sm);\n transition: border-color var(--if-transition-base);\n font-family: var(--if-font-family-manrope);\n}\n\n.if-verificationCode-input:focus {\n outline: none;\n border-color: var(--if-color-border-focus);\n}\n\n/* ============================================\n VERIFICATION STEP\n ============================================ */\n.if-verificationStep {\n display: flex;\n flex-direction: column;\n gap: var(--if-space-6);\n align-items: stretch;\n}\n\n.if-verificationStep-descriptionContainer {\n width: 100%;\n background-color: #f5f5f5;\n border-radius: var(--if-radius-lg);\n padding: var(--if-space-3) var(--if-space-3) var(--if-space-6) var(--if-space-3);\n display: flex;\n flex-direction: column;\n gap: var(--if-space-3);\n}\n\n.if-verificationStep-descriptionTitle {\n color: var(--black, #000);\n font-family: var(--if-font-family);\n font-size: var(--if-font-size-base);\n font-style: normal;\n font-weight: 600;\n line-height: 24px;\n}\n\n.if-verificationStep-description,\n.if-verificationStep-codeDescription {\n font-size: var(--if-font-size-sm);\n color: #525252;\n text-align: left;\n font-family: var(--if-font-family);\n margin: 0;\n}\n\n.if-verificationLink-email,\n.if-verificationCode-email {\n font-weight: 500;\n color: var(--if-color-text);\n}\n\n.if-verificationStep-codeContainer {\n width: 100%;\n display: flex;\n flex-direction: column;\n gap: 40px;\n}\n\n.if-verificationStep-codeInputWrapper {\n display: flex;\n flex-direction: column;\n gap: var(--if-space-6);\n}\n\n.if-verificationStep-verifyingText {\n font-size: var(--if-font-size-sm);\n color: var(--if-color-text-secondary);\n text-align: center;\n font-family: var(--if-font-family);\n}\n\n.if-verificationStep-resendContainer {\n width: 100%;\n font-size: var(--if-font-size-sm);\n text-align: center;\n color: var(--if-color-text-secondary);\n font-family: var(--if-font-family);\n}\n\n.if-verificationStep-resendButton {\n color: var(--if-color-text);\n font-weight: 500;\n transition: all var(--if-transition-base);\n background: none;\n border: none;\n padding: 0;\n font-family: var(--if-font-family);\n font-size: var(--if-font-size-sm);\n}\n\n.if-verificationStep-resendButton:not(:disabled) {\n cursor: pointer;\n}\n\n.if-verificationStep-resendButton:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n/* ============================================\n PASSWORD STRENGTH INDICATOR\n ============================================ */\n.if-passwordStrength {\n margin-top: var(--if-space-2);\n}\n\n.if-passwordStrength-fill {\n height: 100%;\n transition:\n width var(--if-transition-base),\n background-color var(--if-transition-base);\n}\n\n.if-passwordStrength-text {\n font-size: var(--if-font-size-xs);\n color: var(--if-color-text-secondary);\n font-family: var(--if-font-family);\n}\n\n.if-passwordStrength-requirements {\n display: flex;\n flex-direction: column;\n gap: var(--if-space-2);\n font-size: var(--if-font-size-sm);\n color: #525252;\n font-family: var(--if-font-family);\n}\n\n.if-passwordStrength-requirement {\n display: flex;\n align-items: center;\n gap: var(--if-space-2);\n}\n\n/* ============================================\n FORM CONTAINER\n ============================================ */\n.if-form {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n justify-content: center;\n gap: var(--if-space-6);\n}\n\n/* ============================================\n USER BUTTON\n ============================================ */\n.if-userButton-container {\n position: relative;\n display: inline-block;\n}\n\n.if-userButton {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--if-space-2);\n padding: var(--if-space-2);\n border-radius: 9999px;\n background-color: transparent;\n border: none;\n cursor: pointer;\n transition: all var(--if-transition-base);\n}\n\n.if-userButton:hover {\n opacity: 0.8;\n}\n\n.if-userButton-detailed {\n background-color: var(--if-color-bg-white);\n border: 1px solid var(--if-color-border);\n border-radius: var(--if-radius-sm);\n padding: var(--if-space-2);\n}\n\n.if-userButton-detailed:hover {\n background-color: var(--if-color-bg-light);\n opacity: 1;\n}\n\n.if-userButton-avatar {\n width: 2rem;\n height: 2rem;\n border-radius: 9999px;\n background-color: var(--if-color-primary);\n color: var(--if-color-bg-white);\n display: flex;\n align-items: center;\n justify-content: center;\n font-weight: 600;\n font-size: var(--if-font-size-sm);\n font-family: var(--if-font-family);\n overflow: hidden;\n}\n\n.if-userButton-avatarImage {\n border-radius: 9999px;\n object-fit: cover;\n width: 100%;\n height: 100%;\n}\n\n.if-userButton-avatarInitials {\n color: var(--if-color-bg-white);\n font-weight: 600;\n font-size: var(--if-font-size-sm);\n}\n\n.if-userButton-info {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 0.125rem;\n}\n\n.if-userButton-name {\n font-size: var(--if-font-size-sm);\n font-weight: 600;\n color: var(--if-color-text);\n line-height: 1.25rem;\n text-align: left;\n font-family: var(--if-font-family);\n}\n\n.if-userButton-email {\n font-size: var(--if-font-size-xs);\n color: var(--if-color-text-secondary);\n line-height: 1rem;\n text-align: left;\n font-family: var(--if-font-family);\n}\n\n.if-userButton-menu {\n position: absolute;\n margin-top: var(--if-space-2);\n background-color: var(--if-color-bg-white);\n border: 1px solid var(--if-color-border);\n border-radius: var(--if-radius-md);\n box-shadow: var(--if-shadow-lg);\n padding: var(--if-space-2);\n min-width: 200px;\n z-index: 50;\n}\n\n.if-userButton-menuItem {\n display: flex;\n align-items: center;\n gap: var(--if-space-2);\n padding: var(--if-space-2);\n border-radius: var(--if-radius-sm);\n cursor: pointer;\n transition: background-color var(--if-transition-fast);\n font-size: var(--if-font-size-sm);\n color: var(--if-color-text);\n font-family: var(--if-font-family);\n background: none;\n border: none;\n width: 100%;\n text-align: left;\n}\n\n.if-userButton-menuItem:hover {\n background-color: var(--if-color-bg-light);\n}\n\n.if-userButton-menuItem-signout {\n color: var(--if-color-error);\n}\n\n.if-userButton-menuItem-icon {\n width: 1.25rem;\n height: 1.25rem;\n}\n\n/* ============================================\n EMAIL VERIFICATION STATUS\n ============================================ */\n.if-verifyStatus-container {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--if-space-6);\n}\n\n.if-verifyStatus-container-stretch {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: stretch;\n justify-content: center;\n gap: var(--if-space-6);\n}\n\n.if-verifyStatus-spinner {\n border-radius: 9999px;\n height: 3rem;\n width: 3rem;\n border-bottom: 2px solid var(--if-color-primary);\n}\n\n.if-verifyStatus-successContent {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--if-space-4);\n}\n\n.if-verifyStatus-successIcon {\n width: 4rem;\n height: 4rem;\n border-radius: 9999px;\n background-color: #d1fae5;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.if-verifyStatus-successIconSvg {\n width: 2rem;\n height: 2rem;\n color: #059669;\n}\n\n.if-verifyStatus-textCenter {\n text-align: center;\n}\n\n/* ============================================\n UTILITY CLASSES\n ============================================ */\n.if-hidden {\n display: none;\n}\n\n.if-visuallyHidden {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n";
|
|
9
9
|
if (document.head) {
|
|
10
10
|
document.head.appendChild(style);
|
|
11
11
|
}
|
|
@@ -336,10 +336,15 @@ function InsforgeProvider({
|
|
|
336
336
|
);
|
|
337
337
|
const loginWithOAuth = useCallback(
|
|
338
338
|
async (provider, redirectTo) => {
|
|
339
|
-
const sdkResult = await insforge.auth.signInWithOAuth({
|
|
340
|
-
|
|
339
|
+
const sdkResult = await insforge.auth.signInWithOAuth({
|
|
340
|
+
provider,
|
|
341
|
+
redirectTo: redirectTo || afterSignInUrl
|
|
342
|
+
});
|
|
343
|
+
if (sdkResult.error) {
|
|
344
|
+
throw new Error(sdkResult.error.message);
|
|
345
|
+
}
|
|
341
346
|
},
|
|
342
|
-
[insforge]
|
|
347
|
+
[insforge, afterSignInUrl]
|
|
343
348
|
);
|
|
344
349
|
return /* @__PURE__ */ jsx(
|
|
345
350
|
InsforgeContext.Provider,
|
|
@@ -495,34 +500,27 @@ function AuthPasswordStrengthIndicator({
|
|
|
495
500
|
config
|
|
496
501
|
}) {
|
|
497
502
|
const requirements = createRequirements(config);
|
|
498
|
-
return /* @__PURE__ */ jsx("div", { className: "if-passwordStrength if-internal-ps6w3k", children: /* @__PURE__ */ jsx("div", { className: "if-passwordStrength-requirements", children: requirements.map((req) => /* @__PURE__ */ jsxs(
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
"
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
}
|
|
520
|
-
),
|
|
521
|
-
/* @__PURE__ */ jsx("span", { children: req.label })
|
|
522
|
-
]
|
|
523
|
-
},
|
|
524
|
-
req.label
|
|
525
|
-
)) }) });
|
|
503
|
+
return /* @__PURE__ */ jsx("div", { className: "if-passwordStrength if-internal-ps6w3k", children: /* @__PURE__ */ jsx("div", { className: "if-passwordStrength-requirements", children: requirements.map((req) => /* @__PURE__ */ jsxs("div", { className: "if-passwordStrength-requirement", children: [
|
|
504
|
+
/* @__PURE__ */ jsx(
|
|
505
|
+
"div",
|
|
506
|
+
{
|
|
507
|
+
style: {
|
|
508
|
+
display: "flex",
|
|
509
|
+
alignItems: "center",
|
|
510
|
+
justifyContent: "center",
|
|
511
|
+
width: "1rem",
|
|
512
|
+
height: "1rem",
|
|
513
|
+
borderRadius: "50%",
|
|
514
|
+
border: "2px solid",
|
|
515
|
+
borderColor: req.test(password) ? "transparent" : "#9ca3af",
|
|
516
|
+
backgroundColor: req.test(password) ? "#059669" : "white",
|
|
517
|
+
transition: "all 0.2s"
|
|
518
|
+
},
|
|
519
|
+
children: req.test(password) && /* @__PURE__ */ jsx(Check, { style: { width: "0.75rem", height: "0.75rem", color: "white" } })
|
|
520
|
+
}
|
|
521
|
+
),
|
|
522
|
+
/* @__PURE__ */ jsx("span", { children: req.label })
|
|
523
|
+
] }, req.label)) }) });
|
|
526
524
|
}
|
|
527
525
|
function createRequirements(config) {
|
|
528
526
|
const requirements = [];
|
|
@@ -590,11 +588,12 @@ function AuthPasswordField({
|
|
|
590
588
|
onFocus,
|
|
591
589
|
...props
|
|
592
590
|
}) {
|
|
591
|
+
const [searchParams] = useSearchParams();
|
|
593
592
|
const [showPassword, setShowPassword] = useState(false);
|
|
594
593
|
const [showStrength, setShowStrength] = useState(false);
|
|
595
594
|
const resolvedForgotPasswordHref = useMemo(
|
|
596
|
-
() => forgotPasswordLink ?
|
|
597
|
-
[forgotPasswordLink]
|
|
595
|
+
() => forgotPasswordLink ? resolveAuthUrl(forgotPasswordLink.href, searchParams) : void 0,
|
|
596
|
+
[forgotPasswordLink, searchParams]
|
|
598
597
|
);
|
|
599
598
|
const handleFocus = (e) => {
|
|
600
599
|
if (showStrengthIndicator) {
|
|
@@ -935,7 +934,6 @@ function AuthOAuthProviders({
|
|
|
935
934
|
function AuthVerificationCodeInput({
|
|
936
935
|
length = 6,
|
|
937
936
|
value,
|
|
938
|
-
email,
|
|
939
937
|
onChange,
|
|
940
938
|
disabled = false,
|
|
941
939
|
onComplete
|
|
@@ -983,58 +981,42 @@ function AuthVerificationCodeInput({
|
|
|
983
981
|
}
|
|
984
982
|
}
|
|
985
983
|
};
|
|
986
|
-
return /* @__PURE__ */
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
". Enter it below to proceed."
|
|
992
|
-
] }),
|
|
993
|
-
/* @__PURE__ */ jsx("div", { className: "if-verificationCode-inputContainer", children: Array.from({ length }).map((_, index) => /* @__PURE__ */ jsx(
|
|
994
|
-
"input",
|
|
995
|
-
{
|
|
996
|
-
ref: (el) => {
|
|
997
|
-
inputRefs.current[index] = el;
|
|
998
|
-
},
|
|
999
|
-
type: "text",
|
|
1000
|
-
inputMode: "numeric",
|
|
1001
|
-
maxLength: 1,
|
|
1002
|
-
value: value[index] || "",
|
|
1003
|
-
onChange: (e) => handleChange(index, e.target.value),
|
|
1004
|
-
onKeyDown: (e) => handleKeyDown(index, e),
|
|
1005
|
-
onPaste: handlePaste,
|
|
1006
|
-
disabled,
|
|
1007
|
-
className: "if-verificationCode-input",
|
|
1008
|
-
autoComplete: "one-time-code"
|
|
984
|
+
return /* @__PURE__ */ jsx("div", { className: "if-verificationCode-inputContainer", children: Array.from({ length }).map((_, index) => /* @__PURE__ */ jsx(
|
|
985
|
+
"input",
|
|
986
|
+
{
|
|
987
|
+
ref: (el) => {
|
|
988
|
+
inputRefs.current[index] = el;
|
|
1009
989
|
},
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
990
|
+
type: "text",
|
|
991
|
+
inputMode: "numeric",
|
|
992
|
+
maxLength: 1,
|
|
993
|
+
value: value[index] || "",
|
|
994
|
+
onChange: (e) => handleChange(index, e.target.value),
|
|
995
|
+
onKeyDown: (e) => handleKeyDown(index, e),
|
|
996
|
+
onPaste: handlePaste,
|
|
997
|
+
disabled,
|
|
998
|
+
className: "if-verificationCode-input",
|
|
999
|
+
autoComplete: "one-time-code"
|
|
1000
|
+
},
|
|
1001
|
+
index
|
|
1002
|
+
)) });
|
|
1013
1003
|
}
|
|
1014
1004
|
function AuthEmailVerificationStep({
|
|
1015
1005
|
email,
|
|
1016
|
-
method
|
|
1017
|
-
onVerifyCode
|
|
1006
|
+
method,
|
|
1007
|
+
onVerifyCode,
|
|
1008
|
+
emailSent = false
|
|
1018
1009
|
}) {
|
|
1019
1010
|
const { sendVerificationEmail } = useInsforge();
|
|
1020
1011
|
const [resendDisabled, setResendDisabled] = useState(true);
|
|
1021
|
-
const [resendCountdown, setResendCountdown] = useState(60);
|
|
1012
|
+
const [resendCountdown, setResendCountdown] = useState(emailSent ? 60 : 0);
|
|
1022
1013
|
const [isSending, setIsSending] = useState(false);
|
|
1023
1014
|
const [verificationCode, setVerificationCode] = useState("");
|
|
1024
1015
|
const [isVerifying, setIsVerifying] = useState(false);
|
|
1025
|
-
const
|
|
1026
|
-
|
|
1027
|
-
const sendInitialEmail = async () => {
|
|
1028
|
-
try {
|
|
1029
|
-
await sendVerificationEmail(email);
|
|
1030
|
-
} catch (error) {
|
|
1031
|
-
console.error("Failed to send verification email:", error);
|
|
1032
|
-
}
|
|
1033
|
-
};
|
|
1034
|
-
void sendInitialEmail();
|
|
1035
|
-
}, [email, sendVerificationEmail]);
|
|
1016
|
+
const isLinkMethod = method === "link";
|
|
1017
|
+
const displayDescription = isLinkMethod ? "We've 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.";
|
|
1036
1018
|
useEffect(() => {
|
|
1037
|
-
if (resendCountdown > 0) {
|
|
1019
|
+
if (emailSent && resendCountdown > 0) {
|
|
1038
1020
|
const timer = setInterval(() => {
|
|
1039
1021
|
setResendCountdown((prev) => {
|
|
1040
1022
|
if (prev <= 1) {
|
|
@@ -1046,7 +1028,7 @@ function AuthEmailVerificationStep({
|
|
|
1046
1028
|
}, 1e3);
|
|
1047
1029
|
return () => clearInterval(timer);
|
|
1048
1030
|
}
|
|
1049
|
-
}, [resendCountdown]);
|
|
1031
|
+
}, [emailSent, resendCountdown]);
|
|
1050
1032
|
const handleResend = async () => {
|
|
1051
1033
|
setResendDisabled(true);
|
|
1052
1034
|
setResendCountdown(60);
|
|
@@ -1072,23 +1054,29 @@ function AuthEmailVerificationStep({
|
|
|
1072
1054
|
setVerificationCode("");
|
|
1073
1055
|
}
|
|
1074
1056
|
};
|
|
1075
|
-
const displayDescription = defaultDescription;
|
|
1076
|
-
const isLinkMethod = method === "link";
|
|
1077
1057
|
return /* @__PURE__ */ jsxs("div", { className: "if-verificationStep", children: [
|
|
1078
|
-
/* @__PURE__ */
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1058
|
+
isLinkMethod && /* @__PURE__ */ jsxs("div", { className: "if-verificationStep-descriptionContainer", children: [
|
|
1059
|
+
/* @__PURE__ */ jsx("p", { className: "if-verificationStep-descriptionTitle", children: "Verify Your Email" }),
|
|
1060
|
+
/* @__PURE__ */ jsx("p", { className: "if-verificationStep-description", children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxs("span", { children: [
|
|
1061
|
+
part,
|
|
1062
|
+
index < array.length - 1 && /* @__PURE__ */ jsx("span", { className: "if-verificationLink-email", children: email })
|
|
1063
|
+
] }, index)) })
|
|
1064
|
+
] }),
|
|
1082
1065
|
!isLinkMethod && /* @__PURE__ */ jsxs("div", { className: "if-verificationStep-codeContainer", children: [
|
|
1083
|
-
/* @__PURE__ */
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1066
|
+
/* @__PURE__ */ jsxs("div", { className: "if-verificationStep-codeInputWrapper", children: [
|
|
1067
|
+
/* @__PURE__ */ jsx("p", { className: "if-verificationStep-codeDescription", children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxs("span", { children: [
|
|
1068
|
+
part,
|
|
1069
|
+
index < array.length - 1 && /* @__PURE__ */ jsx("span", { className: "if-verificationCode-email", children: email })
|
|
1070
|
+
] }, index)) }),
|
|
1071
|
+
/* @__PURE__ */ jsx(
|
|
1072
|
+
AuthVerificationCodeInput,
|
|
1073
|
+
{
|
|
1074
|
+
value: verificationCode,
|
|
1075
|
+
onChange: setVerificationCode,
|
|
1076
|
+
disabled: isVerifying
|
|
1077
|
+
}
|
|
1078
|
+
)
|
|
1079
|
+
] }),
|
|
1092
1080
|
/* @__PURE__ */ jsx(
|
|
1093
1081
|
AuthSubmitButton,
|
|
1094
1082
|
{
|
|
@@ -1098,7 +1086,7 @@ function AuthEmailVerificationStep({
|
|
|
1098
1086
|
onClick: () => {
|
|
1099
1087
|
void handleSubmit();
|
|
1100
1088
|
},
|
|
1101
|
-
children: isVerifying ? "Verifying..." : "
|
|
1089
|
+
children: isVerifying ? "Verifying..." : "Continue"
|
|
1102
1090
|
}
|
|
1103
1091
|
)
|
|
1104
1092
|
] }),
|
|
@@ -1130,6 +1118,8 @@ function AuthResetPasswordVerificationStep({
|
|
|
1130
1118
|
const [isSending, setIsSending] = useState(false);
|
|
1131
1119
|
const [verificationCode, setVerificationCode] = useState("");
|
|
1132
1120
|
const [isVerifying, setIsVerifying] = useState(false);
|
|
1121
|
+
const isLinkMethod = method === "link";
|
|
1122
|
+
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.";
|
|
1133
1123
|
useEffect(() => {
|
|
1134
1124
|
if (resendCountdown > 0) {
|
|
1135
1125
|
const timer = setInterval(() => {
|
|
@@ -1169,17 +1159,20 @@ function AuthResetPasswordVerificationStep({
|
|
|
1169
1159
|
setVerificationCode("");
|
|
1170
1160
|
}
|
|
1171
1161
|
};
|
|
1172
|
-
const isLinkMethod = method === "link";
|
|
1173
|
-
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.`;
|
|
1174
1162
|
return /* @__PURE__ */ jsxs("div", { className: "if-verificationStep", children: [
|
|
1175
|
-
/* @__PURE__ */
|
|
1163
|
+
isLinkMethod && /* @__PURE__ */ jsxs("div", { className: "if-verificationStep-descriptionContainer", children: [
|
|
1164
|
+
/* @__PURE__ */ jsx("p", { className: "if-verificationStep-descriptionTitle", children: "Check Your Email" }),
|
|
1165
|
+
/* @__PURE__ */ jsx("p", { className: "if-verificationStep-description", children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxs("span", { children: [
|
|
1166
|
+
part,
|
|
1167
|
+
index < array.length - 1 && /* @__PURE__ */ jsx("span", { className: "if-verificationLink-email", children: email })
|
|
1168
|
+
] }, index)) })
|
|
1169
|
+
] }),
|
|
1176
1170
|
!isLinkMethod && /* @__PURE__ */ jsxs("div", { className: "if-verificationStep-codeContainer", children: [
|
|
1177
1171
|
/* @__PURE__ */ jsx("div", { className: "if-verificationStep-codeInputWrapper", children: /* @__PURE__ */ jsx(
|
|
1178
1172
|
AuthVerificationCodeInput,
|
|
1179
1173
|
{
|
|
1180
1174
|
value: verificationCode,
|
|
1181
1175
|
onChange: setVerificationCode,
|
|
1182
|
-
email,
|
|
1183
1176
|
disabled: isVerifying
|
|
1184
1177
|
}
|
|
1185
1178
|
) }),
|
|
@@ -1222,7 +1215,6 @@ function SignInForm({
|
|
|
1222
1215
|
error,
|
|
1223
1216
|
loading = false,
|
|
1224
1217
|
oauthLoading = null,
|
|
1225
|
-
availableProviders = [],
|
|
1226
1218
|
onOAuthClick,
|
|
1227
1219
|
authConfig,
|
|
1228
1220
|
title = "Welcome Back",
|
|
@@ -1232,7 +1224,7 @@ function SignInForm({
|
|
|
1232
1224
|
passwordLabel = "Password",
|
|
1233
1225
|
passwordPlaceholder = "\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
1234
1226
|
forgotPasswordText = "Forget Password?",
|
|
1235
|
-
forgotPasswordUrl,
|
|
1227
|
+
forgotPasswordUrl = "/forgot-password",
|
|
1236
1228
|
submitButtonText = "Sign In",
|
|
1237
1229
|
loadingButtonText = "Signing in...",
|
|
1238
1230
|
signUpText = "Don't have an account?",
|
|
@@ -1243,15 +1235,17 @@ function SignInForm({
|
|
|
1243
1235
|
onVerifyCode
|
|
1244
1236
|
}) {
|
|
1245
1237
|
return /* @__PURE__ */ jsxs(AuthContainer, { children: [
|
|
1246
|
-
/* @__PURE__ */ jsx(
|
|
1247
|
-
|
|
1238
|
+
/* @__PURE__ */ jsx(AuthHeader, { title, subtitle }),
|
|
1239
|
+
/* @__PURE__ */ jsx(AuthErrorBanner, { error: error || "" }),
|
|
1240
|
+
showVerificationStep ? /* @__PURE__ */ jsx(
|
|
1241
|
+
AuthEmailVerificationStep,
|
|
1248
1242
|
{
|
|
1249
|
-
|
|
1250
|
-
|
|
1243
|
+
email,
|
|
1244
|
+
method: authConfig.verifyEmailMethod,
|
|
1245
|
+
onVerifyCode,
|
|
1246
|
+
emailSent: false
|
|
1251
1247
|
}
|
|
1252
|
-
),
|
|
1253
|
-
/* @__PURE__ */ jsx(AuthErrorBanner, { error: error || "" }),
|
|
1254
|
-
showVerificationStep ? /* @__PURE__ */ jsx(AuthEmailVerificationStep, { email, onVerifyCode }) : /* @__PURE__ */ jsxs("form", { onSubmit, noValidate: true, className: "if-form if-internal-fm9k2p", children: [
|
|
1248
|
+
) : /* @__PURE__ */ jsxs("form", { onSubmit, noValidate: true, className: "if-form if-internal-fm9k2p", children: [
|
|
1255
1249
|
/* @__PURE__ */ jsx(
|
|
1256
1250
|
AuthFormField,
|
|
1257
1251
|
{
|
|
@@ -1286,12 +1280,12 @@ function SignInForm({
|
|
|
1286
1280
|
] }),
|
|
1287
1281
|
!showVerificationStep && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1288
1282
|
/* @__PURE__ */ jsx(AuthLink, { text: signUpText, linkText: signUpLinkText, href: signUpUrl }),
|
|
1289
|
-
|
|
1283
|
+
authConfig.oAuthProviders.length > 0 && onOAuthClick && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1290
1284
|
/* @__PURE__ */ jsx(AuthDivider, { text: dividerText }),
|
|
1291
1285
|
/* @__PURE__ */ jsx(
|
|
1292
1286
|
AuthOAuthProviders,
|
|
1293
1287
|
{
|
|
1294
|
-
providers:
|
|
1288
|
+
providers: authConfig.oAuthProviders,
|
|
1295
1289
|
onClick: onOAuthClick,
|
|
1296
1290
|
disabled: loading || oauthLoading !== null,
|
|
1297
1291
|
loading: oauthLoading
|
|
@@ -1348,7 +1342,7 @@ function SignIn({ onError, ...uiProps }) {
|
|
|
1348
1342
|
async function handleVerifyCode(code) {
|
|
1349
1343
|
setError("");
|
|
1350
1344
|
try {
|
|
1351
|
-
const result = await verifyEmail(
|
|
1345
|
+
const result = await verifyEmail(code, email);
|
|
1352
1346
|
if (result?.error) {
|
|
1353
1347
|
throw new Error(result.error.message || "Verification failed");
|
|
1354
1348
|
}
|
|
@@ -1366,7 +1360,15 @@ function SignIn({ onError, ...uiProps }) {
|
|
|
1366
1360
|
}
|
|
1367
1361
|
}
|
|
1368
1362
|
function handleOAuth(provider) {
|
|
1369
|
-
|
|
1363
|
+
try {
|
|
1364
|
+
loginWithOAuth(provider, redirectUrl || "");
|
|
1365
|
+
} catch (err) {
|
|
1366
|
+
const errorMessage = err instanceof Error ? err.message : "OAuth login failed";
|
|
1367
|
+
setError(errorMessage);
|
|
1368
|
+
if (onError) {
|
|
1369
|
+
onError(new Error(errorMessage));
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1370
1372
|
}
|
|
1371
1373
|
if (!authConfig) {
|
|
1372
1374
|
return null;
|
|
@@ -1382,7 +1384,6 @@ function SignIn({ onError, ...uiProps }) {
|
|
|
1382
1384
|
error,
|
|
1383
1385
|
loading,
|
|
1384
1386
|
oauthLoading,
|
|
1385
|
-
availableProviders: authConfig?.oAuthProviders || [],
|
|
1386
1387
|
onOAuthClick: handleOAuth,
|
|
1387
1388
|
authConfig,
|
|
1388
1389
|
showVerificationStep: step === "awaiting-verification",
|
|
@@ -1400,7 +1401,6 @@ function SignUpForm({
|
|
|
1400
1401
|
error,
|
|
1401
1402
|
loading = false,
|
|
1402
1403
|
oauthLoading = null,
|
|
1403
|
-
availableProviders = [],
|
|
1404
1404
|
onOAuthClick,
|
|
1405
1405
|
authConfig,
|
|
1406
1406
|
title = "Get Started",
|
|
@@ -1419,15 +1419,17 @@ function SignUpForm({
|
|
|
1419
1419
|
onVerifyCode
|
|
1420
1420
|
}) {
|
|
1421
1421
|
return /* @__PURE__ */ jsxs(AuthContainer, { children: [
|
|
1422
|
-
/* @__PURE__ */ jsx(
|
|
1423
|
-
|
|
1422
|
+
/* @__PURE__ */ jsx(AuthHeader, { title, subtitle }),
|
|
1423
|
+
/* @__PURE__ */ jsx(AuthErrorBanner, { error: error || "" }),
|
|
1424
|
+
showVerificationStep ? /* @__PURE__ */ jsx(
|
|
1425
|
+
AuthEmailVerificationStep,
|
|
1424
1426
|
{
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
+
email,
|
|
1428
|
+
method: authConfig.verifyEmailMethod,
|
|
1429
|
+
onVerifyCode,
|
|
1430
|
+
emailSent: true
|
|
1427
1431
|
}
|
|
1428
|
-
),
|
|
1429
|
-
/* @__PURE__ */ jsx(AuthErrorBanner, { error: error || "" }),
|
|
1430
|
-
showVerificationStep ? /* @__PURE__ */ jsx(AuthEmailVerificationStep, { email, onVerifyCode }) : /* @__PURE__ */ jsxs("form", { onSubmit, noValidate: true, className: "if-form if-internal-fm9k2p", children: [
|
|
1432
|
+
) : /* @__PURE__ */ jsxs("form", { onSubmit, noValidate: true, className: "if-form if-internal-fm9k2p", children: [
|
|
1431
1433
|
/* @__PURE__ */ jsx(
|
|
1432
1434
|
AuthFormField,
|
|
1433
1435
|
{
|
|
@@ -1450,7 +1452,6 @@ function SignUpForm({
|
|
|
1450
1452
|
value: password,
|
|
1451
1453
|
onChange: (e) => onPasswordChange(e.target.value),
|
|
1452
1454
|
required: true,
|
|
1453
|
-
minLength: authConfig.passwordMinLength,
|
|
1454
1455
|
autoComplete: "new-password",
|
|
1455
1456
|
showStrengthIndicator: true,
|
|
1456
1457
|
authConfig
|
|
@@ -1460,12 +1461,12 @@ function SignUpForm({
|
|
|
1460
1461
|
] }),
|
|
1461
1462
|
!showVerificationStep && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1462
1463
|
/* @__PURE__ */ jsx(AuthLink, { text: signInText, linkText: signInLinkText, href: signInUrl }),
|
|
1463
|
-
|
|
1464
|
+
authConfig.oAuthProviders.length > 0 && onOAuthClick && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1464
1465
|
/* @__PURE__ */ jsx(AuthDivider, { text: dividerText }),
|
|
1465
1466
|
/* @__PURE__ */ jsx(
|
|
1466
1467
|
AuthOAuthProviders,
|
|
1467
1468
|
{
|
|
1468
|
-
providers:
|
|
1469
|
+
providers: authConfig.oAuthProviders,
|
|
1469
1470
|
onClick: onOAuthClick,
|
|
1470
1471
|
disabled: loading || oauthLoading !== null,
|
|
1471
1472
|
loading: oauthLoading
|
|
@@ -1618,7 +1619,7 @@ function SignUp({ onError, ...uiProps }) {
|
|
|
1618
1619
|
async function handleVerifyCode(code) {
|
|
1619
1620
|
setError("");
|
|
1620
1621
|
try {
|
|
1621
|
-
const result = await verifyEmail(
|
|
1622
|
+
const result = await verifyEmail(code, email);
|
|
1622
1623
|
if (result?.error) {
|
|
1623
1624
|
throw new Error(result.error.message || "Verification failed");
|
|
1624
1625
|
}
|
|
@@ -1636,7 +1637,15 @@ function SignUp({ onError, ...uiProps }) {
|
|
|
1636
1637
|
}
|
|
1637
1638
|
}
|
|
1638
1639
|
function handleOAuth(provider) {
|
|
1639
|
-
|
|
1640
|
+
try {
|
|
1641
|
+
loginWithOAuth(provider, redirectUrl || "");
|
|
1642
|
+
} catch (err) {
|
|
1643
|
+
const errorMessage = err instanceof Error ? err.message : "OAuth login failed";
|
|
1644
|
+
setError(errorMessage);
|
|
1645
|
+
if (onError) {
|
|
1646
|
+
onError(new Error(errorMessage));
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1640
1649
|
}
|
|
1641
1650
|
if (!authConfig) {
|
|
1642
1651
|
return null;
|
|
@@ -1652,7 +1661,6 @@ function SignUp({ onError, ...uiProps }) {
|
|
|
1652
1661
|
error,
|
|
1653
1662
|
loading,
|
|
1654
1663
|
oauthLoading,
|
|
1655
|
-
availableProviders: authConfig?.oAuthProviders || [],
|
|
1656
1664
|
onOAuthClick: handleOAuth,
|
|
1657
1665
|
authConfig,
|
|
1658
1666
|
showVerificationStep: step === "awaiting-verification",
|
|
@@ -1668,10 +1676,10 @@ function ForgotPasswordForm({
|
|
|
1668
1676
|
error,
|
|
1669
1677
|
loading = false,
|
|
1670
1678
|
title = "Forgot Password?",
|
|
1671
|
-
subtitle = "Enter your email address and we'll send you a
|
|
1679
|
+
subtitle = "Enter your email address and we'll send you a {method} to reset your password.",
|
|
1672
1680
|
emailLabel = "Email",
|
|
1673
1681
|
emailPlaceholder = "example@email.com",
|
|
1674
|
-
submitButtonText = "
|
|
1682
|
+
submitButtonText = "Reset Password",
|
|
1675
1683
|
loadingButtonText = "Sending...",
|
|
1676
1684
|
backToSignInText = "Remember your password?",
|
|
1677
1685
|
backToSignInUrl = "/sign-in",
|
|
@@ -1680,14 +1688,9 @@ function ForgotPasswordForm({
|
|
|
1680
1688
|
onVerifyCode,
|
|
1681
1689
|
onResendEmail
|
|
1682
1690
|
}) {
|
|
1691
|
+
const displaySubtitle = subtitle.replace("{method}", resetPasswordMethod);
|
|
1683
1692
|
return /* @__PURE__ */ jsxs(AuthContainer, { children: [
|
|
1684
|
-
/* @__PURE__ */ jsx(
|
|
1685
|
-
AuthHeader,
|
|
1686
|
-
{
|
|
1687
|
-
title: showVerificationStep ? resetPasswordMethod === "link" ? "Check Your Email" : "Enter Reset Code" : title,
|
|
1688
|
-
subtitle: showVerificationStep ? "" : subtitle
|
|
1689
|
-
}
|
|
1690
|
-
),
|
|
1693
|
+
/* @__PURE__ */ jsx(AuthHeader, { title, subtitle: displaySubtitle }),
|
|
1691
1694
|
/* @__PURE__ */ jsx(AuthErrorBanner, { error: error || "" }),
|
|
1692
1695
|
showVerificationStep ? /* @__PURE__ */ jsx(
|
|
1693
1696
|
AuthResetPasswordVerificationStep,
|
|
@@ -2395,46 +2398,36 @@ function useUser() {
|
|
|
2395
2398
|
const { user, isLoaded, updateUser, setUser } = useInsforge();
|
|
2396
2399
|
return { user, isLoaded, updateUser, setUser };
|
|
2397
2400
|
}
|
|
2398
|
-
function RedirectToAuth({
|
|
2401
|
+
function RedirectToAuth({
|
|
2402
|
+
baseUrl,
|
|
2403
|
+
path,
|
|
2404
|
+
afterSignInUrl
|
|
2405
|
+
}) {
|
|
2399
2406
|
useEffect(() => {
|
|
2400
|
-
const currentUrl = window.location.
|
|
2407
|
+
const currentUrl = window.location.origin + afterSignInUrl;
|
|
2401
2408
|
const authUrl = new URL(path, baseUrl);
|
|
2402
2409
|
authUrl.searchParams.set("redirect", currentUrl);
|
|
2403
2410
|
window.location.replace(authUrl.toString());
|
|
2404
|
-
}, [baseUrl, path]);
|
|
2411
|
+
}, [baseUrl, path, afterSignInUrl]);
|
|
2405
2412
|
return null;
|
|
2406
2413
|
}
|
|
2407
2414
|
function getInsforgeRoutes(config) {
|
|
2408
|
-
const { baseUrl, builtInAuth = true, paths = {} } = config;
|
|
2409
|
-
const {
|
|
2410
|
-
signIn = "/sign-in",
|
|
2411
|
-
signUp = "/sign-up",
|
|
2412
|
-
verifyEmail = "/verify-email",
|
|
2413
|
-
forgotPassword = "/forgot-password",
|
|
2414
|
-
resetPassword = "/reset-password"
|
|
2415
|
-
} = paths;
|
|
2415
|
+
const { baseUrl, builtInAuth = true, paths = {}, afterSignInUrl = "/" } = config;
|
|
2416
|
+
const { signIn = "/sign-in", signUp = "/sign-up", forgotPassword = "/forgot-password" } = paths;
|
|
2416
2417
|
const routes = [];
|
|
2417
2418
|
if (builtInAuth) {
|
|
2418
2419
|
routes.push(
|
|
2419
2420
|
{
|
|
2420
2421
|
path: signIn,
|
|
2421
|
-
element: /* @__PURE__ */ jsx(RedirectToAuth, { baseUrl, path: "/auth/sign-in" })
|
|
2422
|
+
element: /* @__PURE__ */ jsx(RedirectToAuth, { baseUrl, path: "/auth/sign-in", afterSignInUrl })
|
|
2422
2423
|
},
|
|
2423
2424
|
{
|
|
2424
2425
|
path: signUp,
|
|
2425
|
-
element: /* @__PURE__ */ jsx(RedirectToAuth, { baseUrl, path: "/auth/sign-up" })
|
|
2426
|
-
},
|
|
2427
|
-
{
|
|
2428
|
-
path: verifyEmail,
|
|
2429
|
-
element: /* @__PURE__ */ jsx(RedirectToAuth, { baseUrl, path: "/auth/verify-email" })
|
|
2426
|
+
element: /* @__PURE__ */ jsx(RedirectToAuth, { baseUrl, path: "/auth/sign-up", afterSignInUrl })
|
|
2430
2427
|
},
|
|
2431
2428
|
{
|
|
2432
2429
|
path: forgotPassword,
|
|
2433
2430
|
element: /* @__PURE__ */ jsx(RedirectToAuth, { baseUrl, path: "/auth/forgot-password" })
|
|
2434
|
-
},
|
|
2435
|
-
{
|
|
2436
|
-
path: resetPassword,
|
|
2437
|
-
element: /* @__PURE__ */ jsx(RedirectToAuth, { baseUrl, path: "/auth/reset-password" })
|
|
2438
2431
|
}
|
|
2439
2432
|
);
|
|
2440
2433
|
}
|