@insforge/nextjs 0.7.3 → 0.7.4
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/index.d.mts +43 -17
- package/dist/index.d.ts +43 -17
- package/dist/index.js +419 -197
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +418 -197
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +2 -0
- package/package.json +8 -3
- package/src/styles.css +9 -732
- package/dist/Manrope-VariableFont_wght-OKHRIJEM.ttf +0 -0
- package/dist/index.css +0 -612
- package/dist/index.css.map +0 -1
- package/src/fonts/Manrope-VariableFont_wght.ttf +0 -0
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ if (typeof document !== 'undefined' && typeof window !== 'undefined') {
|
|
|
6
6
|
if (!document.getElementById(styleId)) {
|
|
7
7
|
const style = document.createElement('style');
|
|
8
8
|
style.id = styleId;
|
|
9
|
-
style.textContent = "/**\n * InsForge Next.js Component Library Styles\n * A standalone CSS file for auth components - no Tailwind required!\n */\n\n/* Font Face Declaration */\n@font-face {\n font-family: 'Manrope';\n src: url('./fonts/Manrope-VariableFont_wght.ttf') format('truetype');\n font-weight: 100 900;\n font-style: normal;\n font-display: swap;\n}\n\n/* CSS Variables */\n:root {\n --font-manrope: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n}\n\n/* Reset and Base Styles */\n.insforge-auth-container * {\n box-sizing: border-box;\n}\n\n/* Main Container - App handles layout, we just provide the card */\n.insforge-auth-container {\n width: 100%;\n max-width: 400px;\n background: white;\n}\n\n.insforge-branding {\n background: #FAFAFA;\n padding: 8px 8px 16px 8px;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 4px;\n}\n\n.insforge-branding-text {\n color: #000;\n font-family: var(--font-manrope);\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: normal;\n}\n\n/* Form Card */\n.insforge-auth-card {\n width: 100%;\n border-radius: 12px;\n overflow: hidden;\n box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.25);\n}\n\n.insforge-auth-content {\n padding: 24px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: stretch;\n gap: 24px;\n}\n\n/* Header */\n.insforge-auth-header {\n display: flex;\n flex-direction: column;\n justify-content: start;\n align-items: start;\n gap: 8px;\n}\n\n.insforge-auth-title {\n color: #000;\n font-family: Inter;\n font-size: 24px;\n font-style: normal;\n font-weight: 600;\n line-height: 32px; /* 133.333% */\n}\n\n.insforge-auth-subtitle {\n color: #828282;\n font-family: Inter;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 24px; /* 171.429% */\n}\n\n/* Error Banner */\n.insforge-error-banner {\n display: flex;\n padding: 8px 8px 8px 12px;\n margin-bottom: 16px;\n align-items: center;\n gap: 8px;\n align-self: stretch;\n border-radius: 4px;\n border: 2px solid #DC2626;\n background: #FEF2F2;\n color: #DC2626;\n font-family: Inter;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px; /* 142.857% */\n}\n\n.insforge-error-icon {\n color: #EF4444;\n flex-shrink: 0;\n width: 24px;\n height: 24px;\n}\n\n/* Form Elements */\n.insforge-form {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: stretch;\n gap: 24px;\n}\n\n.insforge-form-group {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: stretch;\n gap: 4px;\n}\n\n.insforge-form-label-row {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.insforge-form-label {\n color: #000;\n font-family: Inter;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 24px;\n}\n\n.insforge-form-link {\n color: #828282;\n text-align: right;\n font-family: Inter;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 24px;\n}\n\n.insforge-form-link:hover {\n color: #828282;\n text-decoration: underline;\n}\n\n/* Input Container for Password (with icon) */\n.insforge-input-wrapper {\n position: relative;\n}\n\n.insforge-input {\n width: 100%;\n display: flex;\n padding: 8px 8px 10px 12px;\n align-items: center;\n gap: 8px;\n align-self: stretch;\n border-radius: 4px;\n border: 1px solid #BCBCBC;\n background: #FFF;\n font-family: Inter;\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n}\n\n.insforge-input::placeholder {\n color: #A6A6A6;\n}\n\n.insforge-input:focus {\n outline: none;\n}\n\n.insforge-input-with-icon {\n padding-right: 3rem;\n}\n\n.insforge-input-icon-btn {\n position: absolute;\n right: 8px;\n top: 50%;\n transform: translateY(-50%);\n background: transparent;\n border: none;\n color: #A6A6A6;\n cursor: pointer;\n transition: color 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.insforge-input-icon-btn:hover {\n color: #6b7280;\n}\n\n/* Primary Button */\n.insforge-btn-primary {\n border-radius: 4px;\n background: #000;\n width: 100%;\n display: flex;\n margin: 16px 0 0 0;\n padding: 8px 16px;\n justify-content: center;\n align-items: center;\n gap: 10px;\n align-self: stretch;\n color: #FFF;\n font-family: Manrope;\n font-size: 16px;\n font-style: normal;\n font-weight: 600;\n line-height: normal;\n border: none;\n cursor: pointer;\n}\n\n.insforge-btn-primary:hover {\n background: #303030;\n}\n\n.insforge-btn-primary:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.insforge-btn-primary .insforge-btn-loader {\n display: none;\n animation: insforge-spin 1s linear infinite;\n}\n\n.insforge-btn-primary[data-loading] .insforge-btn-loader {\n display: block;\n}\n\n.insforge-btn-primary .insforge-btn-check {\n display: none;\n}\n\n.insforge-btn-primary[data-confirmed] .insforge-btn-check {\n display: block;\n}\n\n/* Text Link Section */\n.insforge-text-center {\n text-align: center;\n color: #828282;\n font-family: Inter;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 24px;\n}\n\n.insforge-link-primary {\n color: #000;\n font-family: Inter;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px;\n}\n\n/* Divider */\n.insforge-divider {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 24px;\n align-self: stretch;\n}\n\n.insforge-divider::before,\n.insforge-divider::after {\n content: '';\n flex: 1;\n height: 1px;\n background: #C6C6C6;\n}\n\n.insforge-divider-text {\n color: #C6C6C6;\n font-family: Manrope;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: normal;\n}\n\n/* OAuth Section */\n.insforge-oauth-container {\n display: grid;\n gap: 12px;\n width: 100%;\n}\n\n/* ============================================================================\n SMART OAUTH GRID LAYOUT SYSTEM\n Pattern: 1→1x1, 2→1x2, 3→1x3, 4→2x2, 5+→auto (3 per row, last row centered)\n ============================================================================ */\n\n/* 1 provider: single column, full width - displays \"Continue with Provider\" */\n.insforge-oauth-container[data-provider-count=\"1\"] {\n grid-template-columns: 1fr;\n}\n\n/* 2 providers: two columns - displays \"Provider\" */\n.insforge-oauth-container[data-provider-count=\"2\"] {\n grid-template-columns: repeat(2, 1fr);\n}\n\n/* 3 providers: three columns - icon only */\n.insforge-oauth-container[data-provider-count=\"3\"] {\n grid-template-columns: repeat(3, 1fr);\n}\n\n/* 4 providers: 2x2 grid - displays \"Provider\" */\n.insforge-oauth-container[data-provider-count=\"4\"] {\n grid-template-columns: repeat(2, 1fr);\n}\n\n/* 5+ providers: Universal 6-column grid system\n - Grid columns managed by OAuthProviderList component via inline styles\n - This provides precise control over button positioning */\n.insforge-oauth-container:not([data-provider-count=\"1\"]):not([data-provider-count=\"2\"]):not([data-provider-count=\"3\"]):not([data-provider-count=\"4\"]) {\n grid-template-columns: repeat(6, 1fr);\n}\n\n/* OAuth Button */\n.insforge-oauth-btn {\n display: flex;\n width: 100%;\n height: 36px;\n padding: 8px 12px;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 12px;\n border-radius: 6px;\n border: 1px solid #E4E4E7;\n background: #FFF;\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.10);\n color: #09090B;\n text-align: center;\n font-family: Inter;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 20px;\n cursor: pointer;\n transition: all 0.2s ease;\n}\n\n/* Full mode: show icon + \"Continue with Provider\" */\n.insforge-oauth-btn[data-display-mode=\"full\"] {\n justify-content: center;\n}\n\n/* Short mode: show icon + \"Provider\" */\n.insforge-oauth-btn[data-display-mode=\"short\"] {\n justify-content: center;\n padding: 8px;\n gap: 8px;\n}\n\n/* Icon only mode: show only icon */\n.insforge-oauth-btn[data-display-mode=\"icon\"] {\n justify-content: center;\n gap: 0;\n}\n\n.insforge-oauth-btn[data-display-mode=\"icon\"] .insforge-oauth-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.insforge-oauth-btn:hover {\n background: #f9fafb;\n border-color: #9ca3af;\n}\n\n.insforge-oauth-btn:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.insforge-oauth-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n\n.insforge-oauth-loader {\n display: none;\n animation: insforge-spin 1s linear infinite;\n}\n\n.insforge-oauth-btn[data-loading] .insforge-oauth-icon {\n display: none;\n}\n\n.insforge-oauth-btn[data-loading] .insforge-oauth-loader {\n display: block;\n}\n\n/* Spin Animation */\n@keyframes insforge-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n/* UserButton Styles */\n.insforge-user-button-container {\n position: relative;\n display: inline-block;\n}\n\n.insforge-user-button {\n padding: 0.25rem;\n background: transparent;\n border: none;\n border-radius: 9999px;\n cursor: pointer;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n}\n\n.insforge-user-button:hover {\n background: rgba(0, 0, 0, 0.05);\n}\n\n.insforge-user-button-detailed {\n border-radius: 0.5rem;\n padding: 0.5rem;\n}\n\n.insforge-user-button-info {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 0.125rem;\n}\n\n.insforge-user-button-name {\n font-size: 0.875rem;\n font-weight: 600;\n color: #111827;\n line-height: 1.25rem;\n text-align: left;\n}\n\n.insforge-user-button-email {\n font-size: 0.75rem;\n color: #6b7280;\n line-height: 1rem;\n text-align: left;\n}\n\n.insforge-user-avatar {\n width: 2.5rem;\n height: 2.5rem;\n border-radius: 9999px;\n object-fit: cover;\n}\n\n.insforge-user-avatar-placeholder {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 2.5rem;\n height: 2.5rem;\n background: #3b82f6;\n color: white;\n font-weight: 600;\n font-size: 0.875rem;\n border-radius: 9999px;\n}\n\n.insforge-user-dropdown {\n position: absolute;\n top: 100%;\n right: 0;\n margin-top: 0.5rem;\n min-width: 10rem;\n background: white;\n border: 1px solid #e5e7eb;\n border-radius: 0.5rem;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n z-index: 50;\n overflow: hidden;\n padding: 0.25rem;\n}\n\n.insforge-sign-out-button {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: 0.5rem;\n width: 100%;\n padding: 0.5rem 0.75rem;\n font-size: 0.875rem;\n font-family: inherit;\n color: #dc2626;\n background: transparent;\n border: none;\n border-radius: 0.375rem;\n cursor: pointer;\n transition: background 0.2s;\n text-align: left;\n}\n\n.insforge-sign-out-button:hover {\n background: #fef2f2;\n}\n\n/* Loading State */\n.insforge-loading {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 2rem;\n color: #6b7280;\n font-size: 0.875rem;\n}\n\n/* Password Strength Indicator */\n.insforge-password-strength {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n margin-top: 0.5rem;\n}\n\n.insforge-password-requirement {\n height: 1.5rem;\n display: flex;\n align-items: center;\n gap: 0.25rem;\n}\n\n.insforge-password-check {\n width: 1.25rem;\n height: 1.25rem;\n border-radius: 9999px;\n display: flex;\n border-width: 2px;\n border-style: solid;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease-in-out;\n background-color: transparent;\n border-color: #a3a3a3;\n flex-shrink: 0;\n}\n\n.insforge-password-check-valid {\n background-color: #22c55e;\n border-color: transparent;\n}\n\n.insforge-password-check-icon {\n color: #fff;\n stroke-width: 3;\n}\n\n.insforge-password-requirement-label {\n color:#000;\n font-family: Inter;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 24px;\n}\n\n/* Verification Code Input */\n.insforge-verification-code-container {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 24px;\n}\n\n.insforge-verification-instructions {\n color: #525252;\n font-family: Inter;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n}\n\n.insforge-verification-instructions > span {\n color: #000;\n font-family: Inter;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: 20px;\n}\n\n.insforge-verification-code-inputs {\n display: flex;\n flex-direction: row;\n gap: 12px;\n justify-content: center;\n align-items: center;\n}\n\n.insforge-verification-code-input {\n width: 100%;\n height: 48px;\n padding: 8px 12px;\n border-radius: 4px;\n border: 1px solid #E0E0E0;\n background: #FFF;\n text-align: center;\n font-size: 16px;\n font-style: normal;\n line-height: 20px;\n font-weight: 600;\n font-family: var(--font-manrope);\n color: #000;\n transition: all 0.2s ease-in-out;\n outline: none;\n}\n\n.insforge-verification-code-input:focus {\n border-color: #000;\n box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);\n}\n\n.insforge-verification-code-input:disabled {\n background-color: #F5F5F5;\n cursor: not-allowed;\n opacity: 0.6;\n}\n\n/* Verification Instructions */\n.insforge-verification-instructions {\n color: #4F4F4F;\n font-family: Inter;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 24px;\n margin-bottom: 8px;\n}\n\n.insforge-verification-email {\n color: #000;\n font-weight: 600;\n}\n\n.insforge-resend-code {\n color: #525252;\n font-family: Inter;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 24px;\n text-align: center;\n}\n\n.insforge-resend-link {\n color: #000;\n font-family: Inter;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px;\n}\n\n.insforge-resend-link:hover {\n text-decoration: underline;\n}\n\n.insforge-resend-link:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n/* Responsive adjustments */\n@media (max-width: 640px) {\n .insforge-auth-card {\n padding: 2rem 1.5rem;\n }\n\n .insforge-auth-title {\n font-size: 1.75rem;\n }\n\n .insforge-verification-code-container {\n gap: 8px;\n }\n\n .insforge-verification-code-input {\n width: 40px;\n height: 48px;\n font-size: 20px;\n }\n}\n\n";
|
|
9
|
+
style.textContent = "/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n@import \"https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&display=swap\";@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial;--tw-content:\"\"}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-green-500:oklch(72.3% .219 149.579);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-neutral-400:oklch(70.8% 0 0);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height:calc(1.5/1);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--leading-normal:1.5;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--font-manrope:\"Manrope\",sans-serif}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.relative{position:relative}.top-1\\/2{top:50%}.top-full{top:100%}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.z-50{z-index:50}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-4{margin-top:calc(var(--spacing)*4)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.flex{display:flex}.grid{display:grid}.inline-block{display:inline-block}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-\\[18px\\]{height:18px}.min-h-screen{min-height:100vh}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-\\[18px\\]{width:18px}.w-full{width:100%}.max-w-\\[400px\\]{max-width:400px}.min-w-40{min-width:calc(var(--spacing)*40)}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1/2*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.items-center{align-items:center}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-start{justify-content:flex-start}.gap-0{gap:calc(var(--spacing)*0)}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-6{gap:calc(var(--spacing)*6)}.self-stretch{align-self:stretch}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-none{--tw-border-style:none;border-style:none}.border-\\[\\#D4D4D4\\]{border-color:#d4d4d4}.border-\\[\\#E0E0E0\\]{border-color:#e0e0e0}.border-\\[\\#E4E4E7\\]{border-color:#e4e4e7}.border-blue-600{border-color:var(--color-blue-600)}.border-gray-200{border-color:var(--color-gray-200)}.border-neutral-400{border-color:var(--color-neutral-400)}.border-red-600{border-color:var(--color-red-600)}.border-transparent{border-color:#0000}.bg-\\[\\#FAFAFA\\]{background-color:#fafafa}.bg-black{background-color:var(--color-black)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-green-500{background-color:var(--color-green-500)}.bg-red-50{background-color:var(--color-red-50)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.stroke-\\[3\\]{stroke-width:3px}.object-cover{object-fit:cover}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-6{padding:calc(var(--spacing)*6)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-2{padding-block:calc(var(--spacing)*2)}.py-4{padding-block:calc(var(--spacing)*4)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-8{padding-right:calc(var(--spacing)*8)}.pl-3{padding-left:calc(var(--spacing)*3)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-manrope{font-family:var(--font-manrope)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-4{--tw-leading:calc(var(--spacing)*4);line-height:calc(var(--spacing)*4)}.leading-5{--tw-leading:calc(var(--spacing)*5);line-height:calc(var(--spacing)*5)}.leading-6{--tw-leading:calc(var(--spacing)*6);line-height:calc(var(--spacing)*6)}.leading-8{--tw-leading:calc(var(--spacing)*8);line-height:calc(var(--spacing)*8)}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-\\[\\#09090B\\]{color:#09090b}.text-\\[\\#525252\\]{color:#525252}.text-\\[\\#737373\\]{color:#737373}.text-\\[\\#828282\\]{color:#828282}.text-\\[\\#A3A3A3\\]{color:#a3a3a3}.text-\\[\\#A6A6A6\\]{color:#a6a6a6}.text-black{color:var(--color-black)}.text-gray-500{color:var(--color-gray-500)}.text-gray-900{color:var(--color-gray-900)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.shadow-\\[0_1px_2px_0_rgba\\(0\\,0\\,0\\,0\\.10\\)\\]{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.placeholder\\:font-normal::placeholder{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.placeholder\\:text-\\[\\#A3A3A3\\]::placeholder{color:#a3a3a3}.before\\:h-px:before{content:var(--tw-content);height:1px}.before\\:flex-1:before{content:var(--tw-content);flex:1}.before\\:bg-\\[\\#E5E5E5\\]:before{content:var(--tw-content);background-color:#e5e5e5}.before\\:content-\\[\\'\\'\\]:before{--tw-content:\"\";content:var(--tw-content)}.after\\:h-px:after{content:var(--tw-content);height:1px}.after\\:flex-1:after{content:var(--tw-content);flex:1}.after\\:bg-\\[\\#E5E5E5\\]:after{content:var(--tw-content);background-color:#e5e5e5}.after\\:content-\\[\\'\\'\\]:after{--tw-content:\"\";content:var(--tw-content)}@media (hover:hover){.hover\\:border-\\[\\#9ca3af\\]:hover{border-color:#9ca3af}.hover\\:bg-\\[\\#f9fafb\\]:hover{background-color:#f9fafb}.hover\\:bg-black\\/5:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-black\\/5:hover{background-color:color-mix(in oklab,var(--color-black)5%,transparent)}}.hover\\:bg-gray-800:hover{background-color:var(--color-gray-800)}.hover\\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\\:text-gray-600:hover{color:var(--color-gray-600)}}.focus\\:border-black:focus{border-color:var(--color-black)}.focus\\:shadow-\\[0_0_0_2px_rgba\\(0\\,0\\,0\\,0\\.1\\)\\]:focus{--tw-shadow:0 0 0 2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-\\[\\#F5F5F5\\]:disabled{background-color:#f5f5f5}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:opacity-60:disabled{opacity:.6}}@property --tw-translate-x{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-y{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-z{syntax:\"*\";inherits:false;initial-value:0}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:\"*\";inherits:false}@property --tw-content{syntax:\"*\";inherits:false;initial-value:\"\"}@keyframes spin{to{transform:rotate(360deg)}}";
|
|
10
10
|
if (document.head) {
|
|
11
11
|
document.head.appendChild(style);
|
|
12
12
|
}
|
|
@@ -401,12 +401,22 @@ function useEmailAuthConfig() {
|
|
|
401
401
|
return { config, isLoaded };
|
|
402
402
|
}
|
|
403
403
|
|
|
404
|
+
// src/lib/utils.ts
|
|
405
|
+
import { clsx } from "clsx";
|
|
406
|
+
import { twMerge } from "tailwind-merge";
|
|
407
|
+
function cn(...inputs) {
|
|
408
|
+
return twMerge(clsx(inputs));
|
|
409
|
+
}
|
|
410
|
+
|
|
404
411
|
// src/components/auth/AuthBranding.tsx
|
|
405
412
|
import Link from "next/link";
|
|
406
413
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
407
|
-
function AuthBranding({ text = "Secured by", href = "https://insforge.dev" }) {
|
|
408
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
409
|
-
|
|
414
|
+
function AuthBranding({ text = "Secured by", href = "https://insforge.dev", className }) {
|
|
415
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(
|
|
416
|
+
"bg-[#FAFAFA] px-2 py-4 flex flex-row justify-center items-center gap-1",
|
|
417
|
+
className
|
|
418
|
+
), children: [
|
|
419
|
+
/* @__PURE__ */ jsx2("p", { className: "text-xs font-medium text-black font-manrope", children: text }),
|
|
410
420
|
/* @__PURE__ */ jsx2(Link, { href, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsxs("svg", { width: "83", height: "20", viewBox: "0 0 83 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
411
421
|
/* @__PURE__ */ jsx2(
|
|
412
422
|
"path",
|
|
@@ -467,43 +477,98 @@ function AuthBranding({ text = "Secured by", href = "https://insforge.dev" }) {
|
|
|
467
477
|
|
|
468
478
|
// src/components/auth/AuthContainer.tsx
|
|
469
479
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
470
|
-
function AuthContainer({
|
|
471
|
-
|
|
472
|
-
|
|
480
|
+
function AuthContainer({
|
|
481
|
+
children,
|
|
482
|
+
style,
|
|
483
|
+
className
|
|
484
|
+
}) {
|
|
485
|
+
return /* @__PURE__ */ jsx3("div", { className: cn("w-full max-w-[400px]", className), style, children: /* @__PURE__ */ jsxs2("div", { className: "w-full rounded-xl overflow-hidden shadow-lg", children: [
|
|
486
|
+
/* @__PURE__ */ jsx3("div", { className: "bg-white p-6 flex flex-col justify-center items-stretch gap-6", children }),
|
|
473
487
|
/* @__PURE__ */ jsx3(AuthBranding, {})
|
|
474
488
|
] }) });
|
|
475
489
|
}
|
|
476
490
|
|
|
477
491
|
// src/components/auth/AuthHeader.tsx
|
|
478
492
|
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
479
|
-
function AuthHeader({
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
493
|
+
function AuthHeader({
|
|
494
|
+
title,
|
|
495
|
+
subtitle,
|
|
496
|
+
className,
|
|
497
|
+
titleClassName,
|
|
498
|
+
subtitleClassName
|
|
499
|
+
}) {
|
|
500
|
+
return /* @__PURE__ */ jsxs3("div", { className: cn(
|
|
501
|
+
"flex flex-col justify-start items-start gap-2",
|
|
502
|
+
className
|
|
503
|
+
), children: [
|
|
504
|
+
/* @__PURE__ */ jsx4("h1", { className: cn(
|
|
505
|
+
"text-2xl font-semibold text-black leading-8",
|
|
506
|
+
titleClassName
|
|
507
|
+
), children: title }),
|
|
508
|
+
subtitle && /* @__PURE__ */ jsx4("p", { className: cn(
|
|
509
|
+
"text-sm font-normal text-[#828282] leading-6",
|
|
510
|
+
subtitleClassName
|
|
511
|
+
), children: subtitle })
|
|
483
512
|
] });
|
|
484
513
|
}
|
|
485
514
|
|
|
486
515
|
// src/components/auth/AuthErrorBanner.tsx
|
|
487
516
|
import { AlertTriangle } from "lucide-react";
|
|
488
517
|
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
489
|
-
function AuthErrorBanner({ error }) {
|
|
518
|
+
function AuthErrorBanner({ error, className }) {
|
|
490
519
|
if (!error) return null;
|
|
491
|
-
return /* @__PURE__ */ jsxs4(
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
520
|
+
return /* @__PURE__ */ jsxs4(
|
|
521
|
+
"div",
|
|
522
|
+
{
|
|
523
|
+
className: cn(
|
|
524
|
+
"flex items-center gap-2 mb-4 pl-3 py-2 pr-2 bg-red-50 border-2 border-red-600 rounded",
|
|
525
|
+
className
|
|
526
|
+
),
|
|
527
|
+
children: [
|
|
528
|
+
/* @__PURE__ */ jsx5(AlertTriangle, { className: "w-6 h-6 text-red-500 flex-shrink-0" }),
|
|
529
|
+
/* @__PURE__ */ jsx5("span", { className: "text-sm text-red-600 flex-1", children: error })
|
|
530
|
+
]
|
|
531
|
+
}
|
|
532
|
+
);
|
|
495
533
|
}
|
|
496
534
|
|
|
497
535
|
// src/components/auth/AuthFormField.tsx
|
|
498
536
|
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
499
|
-
function AuthFormField({
|
|
500
|
-
|
|
501
|
-
|
|
537
|
+
function AuthFormField({
|
|
538
|
+
label,
|
|
539
|
+
id,
|
|
540
|
+
className = "",
|
|
541
|
+
labelClassName,
|
|
542
|
+
inputClassName,
|
|
543
|
+
...props
|
|
544
|
+
}) {
|
|
545
|
+
return /* @__PURE__ */ jsxs5("div", { className: cn(
|
|
546
|
+
"flex flex-col justify-center items-stretch gap-1",
|
|
547
|
+
className
|
|
548
|
+
), children: [
|
|
549
|
+
/* @__PURE__ */ jsx6(
|
|
550
|
+
"label",
|
|
551
|
+
{
|
|
552
|
+
htmlFor: id,
|
|
553
|
+
className: cn(
|
|
554
|
+
"text-sm font-normal text-black leading-6",
|
|
555
|
+
labelClassName
|
|
556
|
+
),
|
|
557
|
+
children: label
|
|
558
|
+
}
|
|
559
|
+
),
|
|
502
560
|
/* @__PURE__ */ jsx6(
|
|
503
561
|
"input",
|
|
504
562
|
{
|
|
505
563
|
id,
|
|
506
|
-
className:
|
|
564
|
+
className: cn(
|
|
565
|
+
"w-full flex items-center gap-2 self-stretch",
|
|
566
|
+
"pl-3 pr-2 py-2 rounded-sm border border-[#D4D4D4] bg-white",
|
|
567
|
+
"text-sm font-normal leading-5",
|
|
568
|
+
"placeholder:text-[#A3A3A3] placeholder:font-sm placeholder:font-normal",
|
|
569
|
+
"focus:outline-none focus:border-black",
|
|
570
|
+
inputClassName
|
|
571
|
+
),
|
|
507
572
|
...props
|
|
508
573
|
}
|
|
509
574
|
)
|
|
@@ -561,20 +626,25 @@ function validatePasswordStrength(password, config) {
|
|
|
561
626
|
}
|
|
562
627
|
function AuthPasswordStrengthIndicator({
|
|
563
628
|
password,
|
|
564
|
-
config
|
|
629
|
+
config,
|
|
630
|
+
className
|
|
565
631
|
}) {
|
|
566
632
|
const requirements = createRequirements(config);
|
|
567
|
-
return /* @__PURE__ */ jsx7("div", { className: "
|
|
633
|
+
return /* @__PURE__ */ jsx7("div", { className: cn("flex flex-col gap-1 mt-2", className), children: requirements.map((requirement, index) => {
|
|
568
634
|
const isValid = requirement.test(password);
|
|
569
|
-
return /* @__PURE__ */ jsxs6("div", { className: "
|
|
635
|
+
return /* @__PURE__ */ jsxs6("div", { className: "h-6 flex items-center gap-1", children: [
|
|
570
636
|
/* @__PURE__ */ jsx7(
|
|
571
637
|
"div",
|
|
572
638
|
{
|
|
573
|
-
className:
|
|
574
|
-
|
|
639
|
+
className: cn(
|
|
640
|
+
"w-5 h-5 rounded-full flex items-center justify-center transition-all duration-200",
|
|
641
|
+
"border-2 flex-shrink-0",
|
|
642
|
+
isValid ? "bg-green-500 border-transparent" : "bg-transparent border-neutral-400"
|
|
643
|
+
),
|
|
644
|
+
children: isValid && /* @__PURE__ */ jsx7(Check, { className: "text-white stroke-[3]", size: 12 })
|
|
575
645
|
}
|
|
576
646
|
),
|
|
577
|
-
/* @__PURE__ */ jsx7("span", { className: "
|
|
647
|
+
/* @__PURE__ */ jsx7("span", { className: "text-sm font-normal text-black leading-6", children: requirement.label })
|
|
578
648
|
] }, index);
|
|
579
649
|
}) });
|
|
580
650
|
}
|
|
@@ -589,6 +659,8 @@ function AuthPasswordField({
|
|
|
589
659
|
forgotPasswordLink,
|
|
590
660
|
value,
|
|
591
661
|
className = "",
|
|
662
|
+
labelClassName,
|
|
663
|
+
inputClassName,
|
|
592
664
|
onFocus,
|
|
593
665
|
...props
|
|
594
666
|
}) {
|
|
@@ -600,42 +672,75 @@ function AuthPasswordField({
|
|
|
600
672
|
}
|
|
601
673
|
onFocus?.(e);
|
|
602
674
|
};
|
|
603
|
-
return /* @__PURE__ */ jsxs7(
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
/* @__PURE__ */ jsx8(
|
|
610
|
-
"input",
|
|
611
|
-
{
|
|
612
|
-
id,
|
|
613
|
-
type: showPassword ? "text" : "password",
|
|
614
|
-
className: `insforge-input insforge-input-with-icon ${className}`,
|
|
615
|
-
value,
|
|
616
|
-
onFocus: handleFocus,
|
|
617
|
-
...props
|
|
618
|
-
}
|
|
675
|
+
return /* @__PURE__ */ jsxs7(
|
|
676
|
+
"div",
|
|
677
|
+
{
|
|
678
|
+
className: cn(
|
|
679
|
+
"flex flex-col justify-center items-stretch gap-1",
|
|
680
|
+
className
|
|
619
681
|
),
|
|
620
|
-
|
|
621
|
-
"
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
682
|
+
children: [
|
|
683
|
+
(label || forgotPasswordLink) && /* @__PURE__ */ jsxs7("div", { className: "flex justify-between items-center", children: [
|
|
684
|
+
/* @__PURE__ */ jsx8(
|
|
685
|
+
"label",
|
|
686
|
+
{
|
|
687
|
+
htmlFor: id,
|
|
688
|
+
className: cn(
|
|
689
|
+
"text-sm font-normal text-black leading-6",
|
|
690
|
+
labelClassName
|
|
691
|
+
),
|
|
692
|
+
children: label
|
|
693
|
+
}
|
|
694
|
+
),
|
|
695
|
+
forgotPasswordLink && /* @__PURE__ */ jsx8(
|
|
696
|
+
"a",
|
|
697
|
+
{
|
|
698
|
+
href: forgotPasswordLink.href,
|
|
699
|
+
className: "text-right text-sm font-normal text-[#737373] leading-6",
|
|
700
|
+
children: forgotPasswordLink.text || "Forget Password?"
|
|
701
|
+
}
|
|
702
|
+
)
|
|
703
|
+
] }),
|
|
704
|
+
/* @__PURE__ */ jsxs7("div", { className: "relative", children: [
|
|
705
|
+
/* @__PURE__ */ jsx8(
|
|
706
|
+
"input",
|
|
707
|
+
{
|
|
708
|
+
id,
|
|
709
|
+
type: showPassword ? "text" : "password",
|
|
710
|
+
className: cn(
|
|
711
|
+
"w-full flex items-center gap-2 self-stretch",
|
|
712
|
+
"pl-3 py-2 pr-8 rounded border border-[#D4D4D4] bg-white",
|
|
713
|
+
"text-sm font-normal leading-5",
|
|
714
|
+
"placeholder:text-[#A3A3A3] placeholder:font-sm placeholder:font-normal",
|
|
715
|
+
"focus:outline-none focus:border-black",
|
|
716
|
+
inputClassName
|
|
717
|
+
),
|
|
718
|
+
value,
|
|
719
|
+
onFocus: handleFocus,
|
|
720
|
+
...props
|
|
721
|
+
}
|
|
722
|
+
),
|
|
723
|
+
/* @__PURE__ */ jsx8(
|
|
724
|
+
"button",
|
|
725
|
+
{
|
|
726
|
+
type: "button",
|
|
727
|
+
onClick: () => setShowPassword(!showPassword),
|
|
728
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2 bg-transparent border-none text-[#A6A6A6] cursor-pointer transition-colors hover:text-gray-600 flex items-center justify-center",
|
|
729
|
+
"aria-label": showPassword ? "Hide password" : "Show password",
|
|
730
|
+
children: showPassword ? /* @__PURE__ */ jsx8(EyeOff, { size: 20 }) : /* @__PURE__ */ jsx8(Eye, { size: 20 })
|
|
731
|
+
}
|
|
732
|
+
)
|
|
733
|
+
] }),
|
|
734
|
+
showStrengthIndicator && showStrength && /* @__PURE__ */ jsx8(
|
|
735
|
+
AuthPasswordStrengthIndicator,
|
|
736
|
+
{
|
|
737
|
+
password: String(value || ""),
|
|
738
|
+
config: emailAuthConfig
|
|
739
|
+
}
|
|
740
|
+
)
|
|
741
|
+
]
|
|
742
|
+
}
|
|
743
|
+
);
|
|
639
744
|
}
|
|
640
745
|
|
|
641
746
|
// src/components/auth/AuthSubmitButton.tsx
|
|
@@ -646,20 +751,27 @@ function AuthSubmitButton({
|
|
|
646
751
|
isLoading = false,
|
|
647
752
|
confirmed = false,
|
|
648
753
|
disabled = false,
|
|
649
|
-
style
|
|
754
|
+
style,
|
|
755
|
+
className
|
|
650
756
|
}) {
|
|
651
757
|
return /* @__PURE__ */ jsxs8(
|
|
652
758
|
"button",
|
|
653
759
|
{
|
|
654
760
|
type: "submit",
|
|
655
|
-
className:
|
|
761
|
+
className: cn(
|
|
762
|
+
"rounded-sm bg-black w-full flex mt-4 px-4 py-2",
|
|
763
|
+
"justify-center items-center gap-2.5 self-stretch",
|
|
764
|
+
"text-white font-semibold font-manrope text-base leading-normal",
|
|
765
|
+
"border-none cursor-pointer transition-colors",
|
|
766
|
+
"hover:bg-gray-800",
|
|
767
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
768
|
+
className
|
|
769
|
+
),
|
|
656
770
|
style,
|
|
657
771
|
disabled: disabled || isLoading || confirmed,
|
|
658
|
-
"data-loading": isLoading || void 0,
|
|
659
|
-
"data-confirmed": confirmed || void 0,
|
|
660
772
|
children: [
|
|
661
|
-
isLoading && /* @__PURE__ */ jsx9(Loader2, { className: "
|
|
662
|
-
confirmed && /* @__PURE__ */ jsx9(CircleCheck, { className: "
|
|
773
|
+
isLoading && /* @__PURE__ */ jsx9(Loader2, { className: "w-5 h-5 animate-spin", size: 20 }),
|
|
774
|
+
confirmed && /* @__PURE__ */ jsx9(CircleCheck, { className: "w-5 h-5", size: 20 }),
|
|
663
775
|
children
|
|
664
776
|
]
|
|
665
777
|
}
|
|
@@ -668,17 +780,35 @@ function AuthSubmitButton({
|
|
|
668
780
|
|
|
669
781
|
// src/components/auth/AuthDivider.tsx
|
|
670
782
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
671
|
-
function AuthDivider({ text = "or" }) {
|
|
672
|
-
return /* @__PURE__ */ jsx10("div", { className:
|
|
783
|
+
function AuthDivider({ text = "or", className }) {
|
|
784
|
+
return /* @__PURE__ */ jsx10("div", { className: cn(
|
|
785
|
+
"flex justify-center items-center gap-6 self-stretch",
|
|
786
|
+
"before:content-[''] before:flex-1 before:h-px before:bg-[#E5E5E5]",
|
|
787
|
+
"after:content-[''] after:flex-1 after:h-px after:bg-[#E5E5E5]",
|
|
788
|
+
className
|
|
789
|
+
), children: /* @__PURE__ */ jsx10("span", { className: "text-sm font-semibold font-manrope text-[#A3A3A3] leading-normal", children: text }) });
|
|
673
790
|
}
|
|
674
791
|
|
|
675
792
|
// src/components/auth/AuthLink.tsx
|
|
676
793
|
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
677
|
-
function AuthLink({ text, linkText, href }) {
|
|
678
|
-
return /* @__PURE__ */ jsxs9("p", { className:
|
|
794
|
+
function AuthLink({ text, linkText, href, className, linkClassName }) {
|
|
795
|
+
return /* @__PURE__ */ jsxs9("p", { className: cn(
|
|
796
|
+
"text-center text-sm font-normal text-[#828282] leading-6",
|
|
797
|
+
className
|
|
798
|
+
), children: [
|
|
679
799
|
text,
|
|
680
800
|
" ",
|
|
681
|
-
/* @__PURE__ */ jsx11(
|
|
801
|
+
/* @__PURE__ */ jsx11(
|
|
802
|
+
"a",
|
|
803
|
+
{
|
|
804
|
+
href,
|
|
805
|
+
className: cn(
|
|
806
|
+
"text-sm font-medium text-black leading-6",
|
|
807
|
+
linkClassName
|
|
808
|
+
),
|
|
809
|
+
children: linkText
|
|
810
|
+
}
|
|
811
|
+
)
|
|
682
812
|
] });
|
|
683
813
|
}
|
|
684
814
|
|
|
@@ -839,7 +969,8 @@ function AuthOAuthButton({
|
|
|
839
969
|
disabled,
|
|
840
970
|
loading,
|
|
841
971
|
displayMode = "full",
|
|
842
|
-
style
|
|
972
|
+
style,
|
|
973
|
+
className
|
|
843
974
|
}) {
|
|
844
975
|
const config = getProviderConfig(provider);
|
|
845
976
|
if (!config) {
|
|
@@ -856,15 +987,25 @@ function AuthOAuthButton({
|
|
|
856
987
|
{
|
|
857
988
|
type: "button",
|
|
858
989
|
onClick: () => onClick(provider),
|
|
859
|
-
className:
|
|
990
|
+
className: cn(
|
|
991
|
+
"flex w-full h-9 px-3 py-2",
|
|
992
|
+
"flex-row justify-center items-center gap-3",
|
|
993
|
+
"rounded-md border border-[#E4E4E7] bg-white",
|
|
994
|
+
"shadow-[0_1px_2px_0_rgba(0,0,0,0.10)]",
|
|
995
|
+
"text-[#09090B] text-center text-sm font-medium leading-5",
|
|
996
|
+
"cursor-pointer transition-all duration-200",
|
|
997
|
+
"hover:bg-[#f9fafb] hover:border-[#9ca3af]",
|
|
998
|
+
"disabled:opacity-60 disabled:cursor-not-allowed",
|
|
999
|
+
displayMode === "full" && "justify-center",
|
|
1000
|
+
displayMode === "short" && "justify-center px-2 gap-2",
|
|
1001
|
+
displayMode === "icon" && "justify-center gap-0",
|
|
1002
|
+
className
|
|
1003
|
+
),
|
|
860
1004
|
disabled: disabled || loading,
|
|
861
|
-
"data-loading": loading || void 0,
|
|
862
|
-
"data-display-mode": displayMode,
|
|
863
1005
|
style,
|
|
864
1006
|
children: [
|
|
865
|
-
/* @__PURE__ */ jsx13(Loader22, { className: "
|
|
866
|
-
/* @__PURE__ */ jsx13("span", {
|
|
867
|
-
getButtonText() && /* @__PURE__ */ jsx13("span", { className: "insforge-oauth-text", children: getButtonText() })
|
|
1007
|
+
loading ? /* @__PURE__ */ jsx13(Loader22, { className: "w-[18px] h-[18px] animate-spin", size: 18 }) : /* @__PURE__ */ jsx13("span", { className: "flex items-center justify-center flex-shrink-0", children: config.svg }),
|
|
1008
|
+
getButtonText() && /* @__PURE__ */ jsx13("span", { children: getButtonText() })
|
|
868
1009
|
]
|
|
869
1010
|
}
|
|
870
1011
|
);
|
|
@@ -876,7 +1017,8 @@ function AuthOAuthProviders({
|
|
|
876
1017
|
providers,
|
|
877
1018
|
onClick,
|
|
878
1019
|
disabled,
|
|
879
|
-
loading
|
|
1020
|
+
loading,
|
|
1021
|
+
className
|
|
880
1022
|
}) {
|
|
881
1023
|
if (!providers || providers.length === 0) {
|
|
882
1024
|
return null;
|
|
@@ -911,7 +1053,18 @@ function AuthOAuthProviders({
|
|
|
911
1053
|
return { gridColumn: "span 2" };
|
|
912
1054
|
}
|
|
913
1055
|
};
|
|
914
|
-
|
|
1056
|
+
const getGridClass = () => {
|
|
1057
|
+
if (count === 1) return "grid-cols-1";
|
|
1058
|
+
if (count === 2) return "grid-cols-2";
|
|
1059
|
+
if (count === 3) return "grid-cols-3";
|
|
1060
|
+
if (count === 4) return "grid-cols-2";
|
|
1061
|
+
return "grid-cols-6";
|
|
1062
|
+
};
|
|
1063
|
+
return /* @__PURE__ */ jsx14("div", { className: cn(
|
|
1064
|
+
"grid gap-3 w-full",
|
|
1065
|
+
getGridClass(),
|
|
1066
|
+
className
|
|
1067
|
+
), children: providers.map((provider, index) => /* @__PURE__ */ jsx14(
|
|
915
1068
|
AuthOAuthButton,
|
|
916
1069
|
{
|
|
917
1070
|
provider,
|
|
@@ -935,7 +1088,9 @@ function AuthVerificationCodeInput({
|
|
|
935
1088
|
value,
|
|
936
1089
|
email,
|
|
937
1090
|
onChange,
|
|
938
|
-
disabled = false
|
|
1091
|
+
disabled = false,
|
|
1092
|
+
className,
|
|
1093
|
+
inputClassName
|
|
939
1094
|
}) {
|
|
940
1095
|
const inputRefs = useRef2([]);
|
|
941
1096
|
const handleChange = (index, digit) => {
|
|
@@ -970,13 +1125,17 @@ function AuthVerificationCodeInput({
|
|
|
970
1125
|
inputRefs.current[length - 1]?.focus();
|
|
971
1126
|
}
|
|
972
1127
|
};
|
|
973
|
-
return /* @__PURE__ */ jsxs12("div", { className:
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
1128
|
+
return /* @__PURE__ */ jsxs12("div", { className: cn(
|
|
1129
|
+
"flex flex-col justify-center items-center gap-6",
|
|
1130
|
+
className
|
|
1131
|
+
), children: [
|
|
1132
|
+
/* @__PURE__ */ jsxs12("p", { className: "text-sm font-normal text-[#525252] leading-5", children: [
|
|
1133
|
+
"We've sent a verification code to your inbox at",
|
|
1134
|
+
" ",
|
|
1135
|
+
/* @__PURE__ */ jsx15("span", { className: "text-sm font-semibold text-black leading-5", children: email }),
|
|
977
1136
|
". Enter it below to proceed."
|
|
978
1137
|
] }),
|
|
979
|
-
/* @__PURE__ */ jsx15("div", { className: "
|
|
1138
|
+
/* @__PURE__ */ jsx15("div", { className: "flex flex-row gap-3 justify-center items-center", children: Array.from({ length }).map((_, index) => /* @__PURE__ */ jsx15(
|
|
980
1139
|
"input",
|
|
981
1140
|
{
|
|
982
1141
|
ref: (el) => {
|
|
@@ -990,7 +1149,14 @@ function AuthVerificationCodeInput({
|
|
|
990
1149
|
onKeyDown: (e) => handleKeyDown(index, e),
|
|
991
1150
|
onPaste: handlePaste,
|
|
992
1151
|
disabled,
|
|
993
|
-
className:
|
|
1152
|
+
className: cn(
|
|
1153
|
+
"w-full h-12 px-3 py-2 rounded border border-[#E0E0E0] bg-white",
|
|
1154
|
+
"text-center text-base font-semibold leading-5 text-black",
|
|
1155
|
+
"transition-all duration-200 outline-none",
|
|
1156
|
+
"focus:border-black focus:shadow-[0_0_0_2px_rgba(0,0,0,0.1)]",
|
|
1157
|
+
"disabled:bg-[#F5F5F5] disabled:cursor-not-allowed disabled:opacity-60",
|
|
1158
|
+
inputClassName
|
|
1159
|
+
),
|
|
994
1160
|
autoComplete: "one-time-code"
|
|
995
1161
|
},
|
|
996
1162
|
index
|
|
@@ -1026,7 +1192,9 @@ function SignIn({
|
|
|
1026
1192
|
const [password, setPassword] = useState5("");
|
|
1027
1193
|
const [error, setError] = useState5("");
|
|
1028
1194
|
const [loading, setLoading] = useState5(false);
|
|
1029
|
-
const [oauthLoading, setOauthLoading] = useState5(
|
|
1195
|
+
const [oauthLoading, setOauthLoading] = useState5(
|
|
1196
|
+
null
|
|
1197
|
+
);
|
|
1030
1198
|
const insforge = useState5(() => createClient4({ baseUrl }))[0];
|
|
1031
1199
|
async function handleSubmit(e) {
|
|
1032
1200
|
e.preventDefault();
|
|
@@ -1066,50 +1234,58 @@ function SignIn({
|
|
|
1066
1234
|
return /* @__PURE__ */ jsxs13(AuthContainer, { style: appearance.container, children: [
|
|
1067
1235
|
/* @__PURE__ */ jsx16(AuthHeader, { title, subtitle }),
|
|
1068
1236
|
/* @__PURE__ */ jsx16(AuthErrorBanner, { error }),
|
|
1069
|
-
/* @__PURE__ */ jsxs13(
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1237
|
+
/* @__PURE__ */ jsxs13(
|
|
1238
|
+
"form",
|
|
1239
|
+
{
|
|
1240
|
+
onSubmit: handleSubmit,
|
|
1241
|
+
noValidate: true,
|
|
1242
|
+
className: "flex flex-col items-stretch justify-center gap-6",
|
|
1243
|
+
children: [
|
|
1244
|
+
/* @__PURE__ */ jsx16(
|
|
1245
|
+
AuthFormField,
|
|
1246
|
+
{
|
|
1247
|
+
id: "email",
|
|
1248
|
+
type: "email",
|
|
1249
|
+
label: emailLabel,
|
|
1250
|
+
placeholder: emailPlaceholder,
|
|
1251
|
+
value: email,
|
|
1252
|
+
onChange: (e) => setEmail(e.target.value),
|
|
1253
|
+
required: true,
|
|
1254
|
+
autoComplete: "email"
|
|
1255
|
+
}
|
|
1256
|
+
),
|
|
1257
|
+
/* @__PURE__ */ jsx16(
|
|
1258
|
+
AuthPasswordField,
|
|
1259
|
+
{
|
|
1260
|
+
id: "password",
|
|
1261
|
+
label: passwordLabel,
|
|
1262
|
+
placeholder: passwordPlaceholder,
|
|
1263
|
+
value: password,
|
|
1264
|
+
onChange: (e) => setPassword(e.target.value),
|
|
1265
|
+
required: true,
|
|
1266
|
+
autoComplete: "current-password",
|
|
1267
|
+
emailAuthConfig: emailAuthConfig || {
|
|
1268
|
+
requireEmailVerification: false,
|
|
1269
|
+
passwordMinLength: 6,
|
|
1270
|
+
requireNumber: false,
|
|
1271
|
+
requireLowercase: false,
|
|
1272
|
+
requireUppercase: false,
|
|
1273
|
+
requireSpecialChar: false
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
),
|
|
1277
|
+
/* @__PURE__ */ jsx16(
|
|
1278
|
+
AuthSubmitButton,
|
|
1279
|
+
{
|
|
1280
|
+
isLoading: loading,
|
|
1281
|
+
disabled: loading || oauthLoading !== null,
|
|
1282
|
+
style: appearance.button,
|
|
1283
|
+
children: loading ? loadingButtonText : submitButtonText
|
|
1284
|
+
}
|
|
1285
|
+
)
|
|
1286
|
+
]
|
|
1287
|
+
}
|
|
1288
|
+
),
|
|
1113
1289
|
/* @__PURE__ */ jsx16(AuthLink, { text: signUpText, linkText: signUpLinkText, href: signUpUrl }),
|
|
1114
1290
|
oauthProviders.length > 0 && /* @__PURE__ */ jsxs13(Fragment, { children: [
|
|
1115
1291
|
/* @__PURE__ */ jsx16(AuthDivider, { text: dividerText }),
|
|
@@ -1158,7 +1334,9 @@ function SignUp({
|
|
|
1158
1334
|
const [password, setPassword] = useState6("");
|
|
1159
1335
|
const [error, setError] = useState6("");
|
|
1160
1336
|
const [loading, setLoading] = useState6(false);
|
|
1161
|
-
const [oauthLoading, setOauthLoading] = useState6(
|
|
1337
|
+
const [oauthLoading, setOauthLoading] = useState6(
|
|
1338
|
+
null
|
|
1339
|
+
);
|
|
1162
1340
|
const insforge = useState6(() => createClient5({ baseUrl }))[0];
|
|
1163
1341
|
async function handleCredentialsSubmit(e) {
|
|
1164
1342
|
e.preventDefault();
|
|
@@ -1206,60 +1384,61 @@ function SignUp({
|
|
|
1206
1384
|
return /* @__PURE__ */ jsxs14(AuthContainer, { style: appearance.container, children: [
|
|
1207
1385
|
/* @__PURE__ */ jsx17(AuthHeader, { title, subtitle }),
|
|
1208
1386
|
/* @__PURE__ */ jsx17(AuthErrorBanner, { error }),
|
|
1209
|
-
/* @__PURE__ */ jsxs14(
|
|
1210
|
-
|
|
1211
|
-
AuthFormField,
|
|
1212
|
-
{
|
|
1213
|
-
id: "email",
|
|
1214
|
-
type: "email",
|
|
1215
|
-
label: emailLabel,
|
|
1216
|
-
placeholder: emailPlaceholder,
|
|
1217
|
-
value: email,
|
|
1218
|
-
onChange: (e) => setEmail(e.target.value),
|
|
1219
|
-
required: true,
|
|
1220
|
-
autoComplete: "email"
|
|
1221
|
-
}
|
|
1222
|
-
),
|
|
1223
|
-
/* @__PURE__ */ jsx17(
|
|
1224
|
-
AuthPasswordField,
|
|
1225
|
-
{
|
|
1226
|
-
id: "password",
|
|
1227
|
-
label: passwordLabel,
|
|
1228
|
-
placeholder: passwordPlaceholder,
|
|
1229
|
-
value: password,
|
|
1230
|
-
onChange: (e) => setPassword(e.target.value),
|
|
1231
|
-
required: true,
|
|
1232
|
-
minLength: emailAuthConfig?.passwordMinLength ?? 8,
|
|
1233
|
-
autoComplete: "new-password",
|
|
1234
|
-
showStrengthIndicator: true,
|
|
1235
|
-
emailAuthConfig: emailAuthConfig || {
|
|
1236
|
-
requireEmailVerification: false,
|
|
1237
|
-
passwordMinLength: 6,
|
|
1238
|
-
requireNumber: false,
|
|
1239
|
-
requireLowercase: false,
|
|
1240
|
-
requireUppercase: false,
|
|
1241
|
-
requireSpecialChar: false
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
),
|
|
1245
|
-
/* @__PURE__ */ jsx17(
|
|
1246
|
-
AuthSubmitButton,
|
|
1247
|
-
{
|
|
1248
|
-
isLoading: loading,
|
|
1249
|
-
disabled: loading || oauthLoading !== null,
|
|
1250
|
-
style: appearance.button,
|
|
1251
|
-
children: loading ? loadingButtonText : submitButtonText
|
|
1252
|
-
}
|
|
1253
|
-
)
|
|
1254
|
-
] }),
|
|
1255
|
-
/* @__PURE__ */ jsx17(
|
|
1256
|
-
AuthLink,
|
|
1387
|
+
/* @__PURE__ */ jsxs14(
|
|
1388
|
+
"form",
|
|
1257
1389
|
{
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1390
|
+
onSubmit: handleCredentialsSubmit,
|
|
1391
|
+
noValidate: true,
|
|
1392
|
+
className: "flex flex-col items-stretch justify-center gap-6",
|
|
1393
|
+
children: [
|
|
1394
|
+
/* @__PURE__ */ jsx17(
|
|
1395
|
+
AuthFormField,
|
|
1396
|
+
{
|
|
1397
|
+
id: "email",
|
|
1398
|
+
type: "email",
|
|
1399
|
+
label: emailLabel,
|
|
1400
|
+
placeholder: emailPlaceholder,
|
|
1401
|
+
value: email,
|
|
1402
|
+
onChange: (e) => setEmail(e.target.value),
|
|
1403
|
+
required: true,
|
|
1404
|
+
autoComplete: "email"
|
|
1405
|
+
}
|
|
1406
|
+
),
|
|
1407
|
+
/* @__PURE__ */ jsx17(
|
|
1408
|
+
AuthPasswordField,
|
|
1409
|
+
{
|
|
1410
|
+
id: "password",
|
|
1411
|
+
label: passwordLabel,
|
|
1412
|
+
placeholder: passwordPlaceholder,
|
|
1413
|
+
value: password,
|
|
1414
|
+
onChange: (e) => setPassword(e.target.value),
|
|
1415
|
+
required: true,
|
|
1416
|
+
minLength: emailAuthConfig?.passwordMinLength ?? 8,
|
|
1417
|
+
autoComplete: "new-password",
|
|
1418
|
+
showStrengthIndicator: true,
|
|
1419
|
+
emailAuthConfig: emailAuthConfig || {
|
|
1420
|
+
requireEmailVerification: false,
|
|
1421
|
+
passwordMinLength: 6,
|
|
1422
|
+
requireNumber: false,
|
|
1423
|
+
requireLowercase: false,
|
|
1424
|
+
requireUppercase: false,
|
|
1425
|
+
requireSpecialChar: false
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
),
|
|
1429
|
+
/* @__PURE__ */ jsx17(
|
|
1430
|
+
AuthSubmitButton,
|
|
1431
|
+
{
|
|
1432
|
+
isLoading: loading,
|
|
1433
|
+
disabled: loading || oauthLoading !== null,
|
|
1434
|
+
style: appearance.button,
|
|
1435
|
+
children: loading ? loadingButtonText : submitButtonText
|
|
1436
|
+
}
|
|
1437
|
+
)
|
|
1438
|
+
]
|
|
1261
1439
|
}
|
|
1262
1440
|
),
|
|
1441
|
+
/* @__PURE__ */ jsx17(AuthLink, { text: signInText, linkText: signInLinkText, href: signInUrl }),
|
|
1263
1442
|
oauthProviders.length > 0 && /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
1264
1443
|
/* @__PURE__ */ jsx17(AuthDivider, { text: dividerText }),
|
|
1265
1444
|
/* @__PURE__ */ jsx17(
|
|
@@ -1282,7 +1461,8 @@ import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
|
1282
1461
|
function UserButton({
|
|
1283
1462
|
afterSignOutUrl = "/",
|
|
1284
1463
|
mode = "detailed",
|
|
1285
|
-
appearance = {}
|
|
1464
|
+
appearance = {},
|
|
1465
|
+
className
|
|
1286
1466
|
}) {
|
|
1287
1467
|
const { user, signOut } = useInsforge();
|
|
1288
1468
|
const [isOpen, setIsOpen] = useState7(false);
|
|
@@ -1307,29 +1487,69 @@ function UserButton({
|
|
|
1307
1487
|
}
|
|
1308
1488
|
if (!user) return null;
|
|
1309
1489
|
const initials = user.nickname ? user.nickname.charAt(0).toUpperCase() : user.email.split("@")[0].slice(0, 2).toUpperCase();
|
|
1310
|
-
|
|
1311
|
-
return /* @__PURE__ */ jsxs15("div", { className: "insforge-user-button-container", ref: dropdownRef, children: [
|
|
1490
|
+
return /* @__PURE__ */ jsxs15("div", { className: cn("relative inline-block", className), ref: dropdownRef, children: [
|
|
1312
1491
|
/* @__PURE__ */ jsxs15(
|
|
1313
1492
|
"button",
|
|
1314
1493
|
{
|
|
1315
|
-
className:
|
|
1494
|
+
className: cn(
|
|
1495
|
+
// Base styles
|
|
1496
|
+
"p-1 bg-transparent border-0 rounded-full cursor-pointer transition-all duration-200",
|
|
1497
|
+
"flex items-center justify-center gap-2",
|
|
1498
|
+
"hover:bg-black/5",
|
|
1499
|
+
// Detailed mode styles
|
|
1500
|
+
mode === "detailed" && "rounded-lg p-2",
|
|
1501
|
+
// User override
|
|
1502
|
+
appearance.buttonClassName
|
|
1503
|
+
),
|
|
1316
1504
|
onClick: () => setIsOpen(!isOpen),
|
|
1317
1505
|
style: appearance.button,
|
|
1318
1506
|
"aria-expanded": isOpen,
|
|
1319
1507
|
"aria-haspopup": "true",
|
|
1320
1508
|
children: [
|
|
1321
|
-
avatarUrl ? /* @__PURE__ */ jsx18(
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1509
|
+
user.avatarUrl ? /* @__PURE__ */ jsx18(
|
|
1510
|
+
"img",
|
|
1511
|
+
{
|
|
1512
|
+
src: user.avatarUrl,
|
|
1513
|
+
alt: user.email,
|
|
1514
|
+
className: "w-10 h-10 rounded-full object-cover"
|
|
1515
|
+
}
|
|
1516
|
+
) : /* @__PURE__ */ jsx18("div", { className: "flex items-center justify-center w-10 h-10 bg-blue-500 text-white font-semibold text-sm rounded-full", children: initials }),
|
|
1517
|
+
mode === "detailed" && /* @__PURE__ */ jsxs15("div", { className: "flex flex-col items-start gap-0.5", children: [
|
|
1518
|
+
user.nickname && /* @__PURE__ */ jsx18("div", { className: cn(
|
|
1519
|
+
"text-sm font-semibold text-gray-900 leading-5 text-left",
|
|
1520
|
+
appearance.nameClassName
|
|
1521
|
+
), children: user.nickname }),
|
|
1522
|
+
/* @__PURE__ */ jsx18("div", { className: cn(
|
|
1523
|
+
"text-xs text-gray-500 leading-4 text-left",
|
|
1524
|
+
appearance.emailClassName
|
|
1525
|
+
), children: user.email })
|
|
1325
1526
|
] })
|
|
1326
1527
|
]
|
|
1327
1528
|
}
|
|
1328
1529
|
),
|
|
1329
|
-
isOpen && /* @__PURE__ */ jsx18(
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1530
|
+
isOpen && /* @__PURE__ */ jsx18(
|
|
1531
|
+
"div",
|
|
1532
|
+
{
|
|
1533
|
+
className: cn(
|
|
1534
|
+
"absolute top-full right-0 mt-2 min-w-40",
|
|
1535
|
+
"bg-white border border-gray-200 rounded-lg",
|
|
1536
|
+
"shadow-lg z-50 overflow-hidden p-1",
|
|
1537
|
+
appearance.dropdownClassName
|
|
1538
|
+
),
|
|
1539
|
+
style: appearance.dropdown,
|
|
1540
|
+
children: /* @__PURE__ */ jsxs15(
|
|
1541
|
+
"button",
|
|
1542
|
+
{
|
|
1543
|
+
onClick: handleSignOut,
|
|
1544
|
+
className: "flex items-center justify-start gap-2 w-full px-3 py-2 text-sm font-normal text-red-600 bg-transparent border-0 rounded-md cursor-pointer transition-colors hover:bg-red-50 text-left",
|
|
1545
|
+
children: [
|
|
1546
|
+
/* @__PURE__ */ jsx18(LogOut, { className: "w-5 h-5" }),
|
|
1547
|
+
"Sign out"
|
|
1548
|
+
]
|
|
1549
|
+
}
|
|
1550
|
+
)
|
|
1551
|
+
}
|
|
1552
|
+
)
|
|
1333
1553
|
] });
|
|
1334
1554
|
}
|
|
1335
1555
|
|
|
@@ -1405,6 +1625,7 @@ export {
|
|
|
1405
1625
|
SignedIn,
|
|
1406
1626
|
SignedOut,
|
|
1407
1627
|
UserButton,
|
|
1628
|
+
cn,
|
|
1408
1629
|
getProviderConfig,
|
|
1409
1630
|
getProviderName,
|
|
1410
1631
|
isProviderSupported,
|