@@ -400,7 +400,9 @@ var defaultLabels = {
400400 footerSigninPrompt : "Don't have an account yet?" ,
401401 footerSignupPrompt : "Already have an account?" ,
402402 footerForgotPrompt : "Remember your password?" ,
403- noAuthMethods : "No authentication methods are enabled for this screen."
403+ noAuthMethods : "No authentication methods are enabled for this screen." ,
404+ forgotSubtitle : "Welcome back" ,
405+ resetSubtitle : "Enter the code sent to {email}"
404406} ;
405407var defaultThemeColors = {
406408 light : {
@@ -430,6 +432,28 @@ var defaultThemeColors = {
430432 socialButtonBackground : "#2a2a2a"
431433 }
432434} ;
435+ var adjustColor = ( color , percent ) => {
436+ try {
437+ if ( color . startsWith ( "#" ) ) {
438+ let hex = color . replace ( "#" , "" ) ;
439+ if ( hex . length === 3 ) {
440+ hex = hex [ 0 ] + hex [ 0 ] + hex [ 1 ] + hex [ 1 ] + hex [ 2 ] + hex [ 2 ] ;
441+ }
442+ let r = parseInt ( hex . substring ( 0 , 2 ) , 16 ) ;
443+ let g = parseInt ( hex . substring ( 2 , 4 ) , 16 ) ;
444+ let b = parseInt ( hex . substring ( 4 , 6 ) , 16 ) ;
445+ r = Math . min ( 255 , Math . max ( 0 , r + percent ) ) ;
446+ g = Math . min ( 255 , Math . max ( 0 , g + percent ) ) ;
447+ b = Math . min ( 255 , Math . max ( 0 , b + percent ) ) ;
448+ const rr = r . toString ( 16 ) . padStart ( 2 , "0" ) ;
449+ const gg = g . toString ( 16 ) . padStart ( 2 , "0" ) ;
450+ const bb = b . toString ( 16 ) . padStart ( 2 , "0" ) ;
451+ return `#${ rr } ${ gg } ${ bb } ` ;
452+ }
453+ } catch ( e ) {
454+ }
455+ return color ;
456+ } ;
433457var UrAuth = ( {
434458 providers = [ "google" , "github" ] ,
435459 enableEmailPassword = true ,
@@ -449,15 +473,16 @@ var UrAuth = ({
449473 const text = {
450474 ...defaultLabels ,
451475 ...labels ,
452- loginTab : labels ?. signInTab || labels ?. loginTab || defaultLabels . loginTab ,
453- loginTitle : labels ?. signInTitle || labels ?. loginTitle || defaultLabels . loginTitle ,
454- loginButton : labels ?. signInButton || labels ?. loginButton || defaultLabels . loginButton ,
455- signupTab : labels ?. signUpTab || labels ?. signupTab || defaultLabels . signupTab ,
456- signupTitle : labels ?. signUpTitle || labels ?. signupTitle || defaultLabels . signupTitle ,
457- signupButton : labels ?. signUpButton || labels ?. signupButton || defaultLabels . signupButton
476+ loginTab : labels ?. signInTab ?? labels ?. loginTab ?? defaultLabels . loginTab ,
477+ loginTitle : labels ?. signInTitle ?? labels ?. loginTitle ?? defaultLabels . loginTitle ,
478+ loginButton : labels ?. signInButton ?? labels ?. loginButton ?? defaultLabels . loginButton ,
479+ signupTab : labels ?. signUpTab ?? labels ?. signupTab ?? defaultLabels . signupTab ,
480+ signupTitle : labels ?. signUpTitle ?? labels ?. signupTitle ?? defaultLabels . signupTitle ,
481+ signupButton : labels ?. signUpButton ?? labels ?. signupButton ?? defaultLabels . signupButton
458482 } ;
459483 const themeColors = { ...defaultThemeColors [ theme ] , ...colors } ;
460484 const primaryColor = branding ?. primaryColor || themeColors . primary ;
485+ const secondStopColor = adjustColor ( primaryColor , - 15 ) ;
461486 let isGoogleEnabled = true ;
462487 let isGithubEnabled = true ;
463488 let isEmailPasswordEnabled = enableEmailPassword ;
@@ -468,7 +493,7 @@ var UrAuth = ({
468493 } else if ( typeof providers === "object" ) {
469494 isGoogleEnabled = ! ! providers . google ;
470495 isGithubEnabled = ! ! providers . github ;
471- isEmailPasswordEnabled = providers . emailPassword !== void 0 ? providers . emailPassword : false ;
496+ isEmailPasswordEnabled = providers . emailPassword !== void 0 ? providers . emailPassword : enableEmailPassword ;
472497 }
473498 }
474499 const hasPasswordAuth = isEmailPasswordEnabled ;
@@ -632,7 +657,7 @@ var UrAuth = ({
632657 width : "100%" ,
633658 padding : "14px" ,
634659 borderRadius : "0" ,
635- background : `linear-gradient(180deg, ${ primaryColor } 0%, ${ theme === "dark" ? "#111111" : "#111111" } 100%)` ,
660+ background : `linear-gradient(180deg, ${ primaryColor } 0%, ${ secondStopColor } 100%)` ,
636661 color : themeColors . primaryText ,
637662 fontSize : "15px" ,
638663 fontWeight : 600 ,
@@ -788,7 +813,7 @@ var UrAuth = ({
788813 ] } ) } ) ,
789814 ( mode === "forgot" || mode === "reset" ) && /* @__PURE__ */ jsxs2 ( "div" , { style : { marginBottom : "24px" , textAlign : "center" } , children : [
790815 /* @__PURE__ */ jsx4 ( "h2" , { style : { margin : "0 0 8px" , fontSize : "20px" , fontWeight : 700 , color : themeColors . text } , children : mode === "forgot" ? text . forgotTitle : text . resetTitle } ) ,
791- /* @__PURE__ */ jsx4 ( "p" , { style : { margin : 0 , fontSize : "14px" , color : themeColors . textMuted } , children : mode === "forgot" ? text . loginTitle : `Enter the code sent to $ {email } ` } )
816+ /* @__PURE__ */ jsx4 ( "p" , { style : { margin : 0 , fontSize : "14px" , color : themeColors . textMuted } , children : mode === "forgot" ? text . forgotSubtitle : text . resetSubtitle . replace ( " {email}" , email ) } )
792817 ] } ) ,
793818 ! hasPasswordAuth && ! hasSocialAuth && /* @__PURE__ */ jsx4 ( "div" , { style : { textAlign : "center" , color : themeColors . textMuted , fontSize : "14px" , lineHeight : 1.5 } , children : text . noAuthMethods } ) ,
794819 hasPasswordAuth && /* @__PURE__ */ jsxs2 ( "form" , { onSubmit : handleSubmit , children : [
0 commit comments