@aws-amplify/ui 3.8.3 → 3.9.2
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/esm/helpers/authenticator/facade.js +1 -1
- package/dist/esm/helpers/authenticator/utils.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/machines/authenticator/actors/signIn.js +1 -1
- package/dist/esm/machines/authenticator/index.js +1 -1
- package/dist/esm/machines/authenticator/signUp.js +1 -1
- package/dist/esm/theme/defaultDarkModeOverride.js +1 -0
- package/dist/esm/theme/tokens/colors.js +1 -1
- package/dist/esm/theme/tokens/components/sliderField.js +1 -1
- package/dist/esm/theme/tokens/components/toggleButton.js +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +116 -124
- package/dist/theme.css +21 -9
- package/dist/types/helpers/authenticator/utils.d.ts +3 -2
- package/dist/types/theme/defaultDarkModeOverride.d.ts +6 -0
- package/dist/types/theme/index.d.ts +1 -0
- package/dist/types/theme/tokens/colors.d.ts +1 -0
- package/dist/types/theme/tokens/components/sliderField.d.ts +1 -0
- package/dist/types/theme/tokens/components/toggleButton.d.ts +13 -0
- package/dist/types/types/authenticator/stateMachine/authMachine.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"../../node_modules/tslib/tslib.es6.js";import{getActorState as t,getActorContext as r}from"./actor.js";var n=function(e){var t=function(t){return function(r){return e({type:t,data:r})}};return{resendCode:t("RESEND"),signOut:t("SIGN_OUT"),submitForm:t("SUBMIT"),updateForm:t("CHANGE"),updateBlur:t("BLUR"),toFederatedSignIn:t("FEDERATED_SIGN_IN"),toResetPassword:t("RESET_PASSWORD"),toSignIn:t("SIGN_IN"),toSignUp:t("SIGN_UP"),skipVerification:t("SKIP")}},s=function(n){var s,i,a=null===(s=n.context)||void 0===s?void 0:s.user,
|
|
1
|
+
import{__assign as e}from"../../node_modules/tslib/tslib.es6.js";import{getActorState as t,getActorContext as r}from"./actor.js";var n=function(e){var t=function(t){return function(r){return e({type:t,data:r})}};return{resendCode:t("RESEND"),signOut:t("SIGN_OUT"),submitForm:t("SUBMIT"),updateForm:t("CHANGE"),updateBlur:t("BLUR"),toFederatedSignIn:t("FEDERATED_SIGN_IN"),toResetPassword:t("RESET_PASSWORD"),toSignIn:t("SIGN_IN"),toSignUp:t("SIGN_UP"),skipVerification:t("SKIP")}},s=function(n){var s,i,a=null===(s=n.context)||void 0===s?void 0:s.user,u=t(n),o=r(n),c=null==o?void 0:o.remoteError,d=e({},null==o?void 0:o.validationError),l=null==o?void 0:o.codeDeliveryDetails,m=Object.keys(d).length>0,f=n.hasTag("pending")||(null===(i=t(n))||void 0===i?void 0:i.hasTag("pending")),v=function(){switch(!0){case n.matches("idle"):return"idle";case n.matches("setup"):return"setup";case n.matches("signOut"):return"signOut";case n.matches("authenticated"):return"authenticated";case null==u?void 0:u.matches("autoSignIn"):return"autoSignIn";case null==u?void 0:u.matches("confirmSignUp"):return"confirmSignUp";case null==u?void 0:u.matches("confirmSignIn"):return"confirmSignIn";case null==u?void 0:u.matches("setupTOTP"):return"setupTOTP";case null==u?void 0:u.matches("signIn"):return"signIn";case null==u?void 0:u.matches("signUp"):return"signUp";case null==u?void 0:u.matches("forceNewPassword"):return"forceNewPassword";case null==u?void 0:u.matches("resetPassword"):return"resetPassword";case null==u?void 0:u.matches("confirmResetPassword"):return"confirmResetPassword";case null==u?void 0:u.matches("verifyUser"):return"verifyUser";case null==u?void 0:u.matches("confirmVerifyUser"):return"confirmVerifyUser";default:return console.debug("Cannot infer `route` from Authenticator state:",n.value),null}}(),h=function(e){switch(e){case"idle":case"setup":return"configuring";case"authenticated":return"authenticated";default:return"unauthenticated"}}(v);return{error:c,hasValidationErrors:m,isPending:f,route:v,authStatus:h,user:a,validationErrors:d,codeDeliveryDetails:l}},i=function(t){var r=t.send,i=t.state,a=n(r),u=s(i);return e(e({},a),u)};export{n as getSendEventAliases,s as getServiceContextFacade,i as getServiceFacade};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Hub as t}from"aws-amplify";var e=function(t){for(var e=t.trim().split(""),n=0;n<e.length;n++)n>0&&n<e.length-1&&(e[n]="*");return e.join("")},n=function(t){if(t.length<4)return t;for(var e=t.split(""),n=0;n<e.length-4;n++)e[n]="*";return e.join("")},
|
|
1
|
+
import{Hub as t}from"aws-amplify";var e=function(t){for(var e=t.trim().split(""),n=0;n<e.length;n++)n>0&&n<e.length-1&&(e[n]="*");return e.join("")},n=function(t){if(t.length<4)return t;for(var e=t.split(""),n=0;n<e.length-4;n++)e[n]="*";return e.join("")},i=function(t,e){var n=e.send,i=e.getSnapshot();switch(t.payload.event){case"tokenRefresh":i.matches("authenticated.idle")&&n("TOKEN_REFRESH");break;case"signOut":case"tokenRefresh_failure":i.matches("authenticated.idle")&&n("SIGN_OUT")}},r=function(e,n){return void 0===n&&(n=i),t.listen("auth",(function(t){n(t,e)}))};export{e as censorAllButFirstAndLast,n as censorPhoneNumber,i as defaultAuthHubHandler,r as listenToAuthHub};
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{getActorContext,getActorState}from"./helpers/authenticator/actor.js";export{getConfiguredAliases,getPrimaryAlias}from"./helpers/authenticator/context.js";export{getSendEventAliases,getServiceContextFacade,getServiceFacade}from"./helpers/authenticator/facade.js";export{defaultFormFieldOptions}from"./helpers/authenticator/constants.js";export{getErrors,getFormDataFromEvent,isAuthFieldWithDefaults,setFormOrder}from"./helpers/authenticator/form.js";export{censorAllButFirstAndLast,censorPhoneNumber,listenToAuthHub}from"./helpers/authenticator/utils.js";export{getDefaultFormFields,getFormFields,getSortedFormFields}from"./helpers/authenticator/formFields/formFields.js";export{defaultFormFieldsGetters}from"./helpers/authenticator/formFields/defaults.js";export{applyDefaults,applyTranslation,sortFormFields}from"./helpers/authenticator/formFields/util.js";export{countryDialCodes}from"./i18n/country-dial-codes.js";export{DefaultTexts,hasTranslation,translate,translations}from"./i18n/translations.js";export{createAuthenticatorMachine}from"./machines/authenticator/index.js";export{createTheme}from"./theme/createTheme.js";export{defaultTheme}from"./theme/defaultTheme.js";export{isDesignToken}from"./theme/tokens/types/designToken.js";export{AuthChallengeNames,FederatedIdentityProviders}from"./types/authenticator/user.js";export{LoginMechanismArray,authFieldsWithDefaults,signUpFieldsWithDefault,signUpFieldsWithoutDefault}from"./types/authenticator/attributes.js";
|
|
1
|
+
export{getActorContext,getActorState}from"./helpers/authenticator/actor.js";export{getConfiguredAliases,getPrimaryAlias}from"./helpers/authenticator/context.js";export{getSendEventAliases,getServiceContextFacade,getServiceFacade}from"./helpers/authenticator/facade.js";export{defaultFormFieldOptions}from"./helpers/authenticator/constants.js";export{getErrors,getFormDataFromEvent,isAuthFieldWithDefaults,setFormOrder}from"./helpers/authenticator/form.js";export{censorAllButFirstAndLast,censorPhoneNumber,defaultAuthHubHandler,listenToAuthHub}from"./helpers/authenticator/utils.js";export{getDefaultFormFields,getFormFields,getSortedFormFields}from"./helpers/authenticator/formFields/formFields.js";export{defaultFormFieldsGetters}from"./helpers/authenticator/formFields/defaults.js";export{applyDefaults,applyTranslation,sortFormFields}from"./helpers/authenticator/formFields/util.js";export{countryDialCodes}from"./i18n/country-dial-codes.js";export{DefaultTexts,hasTranslation,translate,translations}from"./i18n/translations.js";export{createAuthenticatorMachine}from"./machines/authenticator/index.js";export{createTheme}from"./theme/createTheme.js";export{defaultTheme}from"./theme/defaultTheme.js";export{defaultDarkModeOverride}from"./theme/defaultDarkModeOverride.js";export{isDesignToken}from"./theme/tokens/types/designToken.js";export{AuthChallengeNames,FederatedIdentityProviders}from"./types/authenticator/user.js";export{LoginMechanismArray,authFieldsWithDefaults,signUpFieldsWithDefault,signUpFieldsWithoutDefault}from"./types/authenticator/attributes.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t,__rest as r,__assign as n}from"../../../node_modules/tslib/tslib.es6.js";import{Auth as i}from"aws-amplify";import s from"lodash/get";import o from"lodash/isEmpty";import{createMachine as a,sendUpdate as c}from"xstate";import{AuthChallengeNames as d}from"../../../types/authenticator/user.js";import"../../../types/authenticator/attributes.js";import{runValidators as u}from"../../../validators/index.js";import{clearAttributeToVerify as l,clearChallengeName as f,clearRequiredAttributes as g,clearError as m,clearFormValues as h,clearTouched as p,clearUnverifiedAttributes as v,clearValidationError as I,handleInput as E,handleSubmit as U,handleBlur as A,parsePhoneNumber as b,setChallengeName as y,setConfirmResetPasswordIntent as S,setConfirmSignUpIntent as T,setRequiredAttributes as C,setCredentials as N,setFieldErrors as w,setRemoteError as R,setUnverifiedAttributes as V,setUser as P,setUsernameAuthAttributes as _}from"../actions.js";import{defaultServices as F}from"../defaultServices.js";function k(k){var D=k.services;return a({initial:"init",id:"signInActor",states:{init:{always:[{target:"signIn"}]},signIn:{initial:"edit",exit:["clearFormValues","clearTouched"],states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},CHANGE:{actions:"handleInput"},FEDERATED_SIGN_IN:"federatedSignIn"}},federatedSignIn:{tags:["pending"],entry:["sendUpdate","clearError"],invoke:{src:"federatedSignIn",onError:{actions:"setRemoteError"}}},submit:{tags:["pending"],entry:["parsePhoneNumber","clearError","sendUpdate"],invoke:{src:"signIn",onDone:[{cond:"shouldSetupTOTP",actions:["setUser","setChallengeName"],target:"#signInActor.setupTOTP"},{cond:"shouldConfirmSignIn",actions:["setUser","setChallengeName"],target:"#signInActor.confirmSignIn"},{cond:"shouldForceChangePassword",actions:["setUser","setChallengeName","setRequiredAttributes"],target:"#signInActor.forceNewPassword"},{actions:"setUser",target:"verifying"}],onError:[{cond:"shouldRedirectToConfirmSignUp",actions:["setCredentials","setConfirmSignUpIntent"],target:"rejected"},{cond:"shouldRedirectToConfirmResetPassword",actions:["setUsernameAuthAttributes","setConfirmResetPasswordIntent"],target:"rejected"},{actions:"setRemoteError",target:"edit"}]}},verifying:{tags:["pending"],entry:["clearError","sendUpdate"],invoke:{src:"checkVerifiedContact",onDone:[{cond:"shouldRequestVerification",target:"#signInActor.verifyUser",actions:"setUnverifiedAttributes"},{target:"resolved"}],onError:{actions:"setRemoteError",target:"edit"}}},resolved:{always:"#signInActor.resolved"},rejected:{always:"#signInActor.rejected"}}},confirmSignIn:{initial:"edit",exit:["clearFormValues","clearError","clearTouched"],states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},SIGN_IN:"#signInActor.signIn",CHANGE:{actions:"handleInput"}}},submit:{tags:["pending"],entry:["clearError","sendUpdate"],invoke:{src:"confirmSignIn",onDone:{target:"#signInActor.resolved",actions:["setUser","clearChallengeName","clearRequiredAttributes"]},onError:{target:"edit",actions:"setRemoteError"}}}}},forceNewPassword:{type:"parallel",exit:["clearFormValues","clearError","clearTouched"],states:{validation:{initial:"pending",states:{pending:{invoke:{src:"validateFields",onDone:{target:"valid",actions:"clearValidationError"},onError:{target:"invalid",actions:"setFieldErrors"}}},valid:{entry:"sendUpdate"},invalid:{entry:"sendUpdate"}},on:{SIGN_IN:"#signInActor.signIn",CHANGE:{actions:"handleInput",target:".pending"},BLUR:{actions:"handleBlur",target:".pending"}}},submit:{initial:"idle",entry:"clearError",states:{idle:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"validate"}}},validate:{entry:"sendUpdate",invoke:{src:"validateFields",onDone:{target:"pending",actions:"clearValidationError"},onError:{target:"idle",actions:"setFieldErrors"}}},pending:{tags:["pending"],entry:["sendUpdate","clearError"],invoke:{src:"forceNewPassword",onDone:[{cond:"shouldConfirmSignIn",actions:["setUser","setChallengeName"],target:"#signInActor.confirmSignIn"},{cond:"shouldSetupTOTP",actions:["setUser","setChallengeName"],target:"#signInActor.setupTOTP"},{target:"resolved",actions:["setUser","setCredentials"]}],onError:{target:"idle",actions:"setRemoteError"}}},resolved:{type:"final",always:"#signInActor.resolved"}}}}},setupTOTP:{initial:"edit",exit:["clearFormValues","clearError","clearTouched"],states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},SIGN_IN:"#signInActor.signIn",CHANGE:{actions:"handleInput"}}},submit:{tags:["pending"],entry:["sendUpdate","clearError"],invoke:{src:"verifyTotpToken",onDone:{actions:["setUser","clearChallengeName","clearRequiredAttributes"],target:"#signInActor.resolved"},onError:{actions:"setRemoteError",target:"edit"}}}}},verifyUser:{initial:"edit",exit:["clearFormValues","clearError","clearTouched"],states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},SKIP:"#signInActor.resolved",CHANGE:{actions:"handleInput"}}},submit:{tags:["pending"],entry:"clearError",invoke:{src:"verifyUser",onDone:{target:"#signInActor.confirmVerifyUser"},onError:{actions:"setRemoteError",target:"edit"}}}}},confirmVerifyUser:{initial:"edit",exit:["clearFormValues","clearError","clearUnverifiedAttributes","clearAttributeToVerify","clearTouched"],states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},SKIP:"#signInActor.resolved",CHANGE:{actions:"handleInput"}}},submit:{tags:["pending"],entry:"clearError",invoke:{src:"confirmVerifyUser",onDone:{target:"#signInActor.resolved"},onError:{actions:"setRemoteError",target:"edit"}}}}},resolved:{type:"final",data:function(e){return{user:e.user}}},rejected:{type:"final",data:function(e,t){return{intent:e.redirectIntent,authAttributes:e.authAttributes}}}}},{actions:{clearAttributeToVerify:l,clearChallengeName:f,clearRequiredAttributes:g,clearError:m,clearFormValues:h,clearTouched:p,clearUnverifiedAttributes:v,clearValidationError:I,handleInput:E,handleSubmit:U,handleBlur:A,parsePhoneNumber:b,setChallengeName:y,setConfirmResetPasswordIntent:S,setConfirmSignUpIntent:T,setRequiredAttributes:C,setCredentials:N,setFieldErrors:w,setRemoteError:R,setUnverifiedAttributes:V,setUser:P,setUsernameAuthAttributes:_,sendUpdate:c()},guards:{shouldConfirmSignIn:function(e,t){var r=s(t,"data.challengeName");return[d.SMS_MFA,d.SOFTWARE_TOKEN_MFA].includes(r)},shouldRedirectToConfirmSignUp:function(e,t){return"UserNotConfirmedException"===t.data.code},shouldRedirectToConfirmResetPassword:function(e,t){return"PasswordResetRequiredException"===t.data.code},shouldSetupTOTP:function(e,t){return s(t,"data.challengeName")===d.MFA_SETUP},shouldForceChangePassword:function(e,t){return s(t,"data.challengeName")===d.NEW_PASSWORD_REQUIRED},shouldRequestVerification:function(e,t){var r=t.data,n=r.unverified,i=r.verified;return o(i)&&!o(n)}},services:{signIn:function(r){return e(this,void 0,void 0,(function(){var e,n,i;return t(this,(function(t){switch(t.label){case 0:return e=r.formValues,n=e.username,i=e.password,[4,D.handleSignIn({username:n,password:i})];case 1:return[2,t.sent()]}}))}))},confirmSignIn:function(r,n){return e(this,void 0,void 0,(function(){var e,n,s,o;return t(this,(function(t){switch(t.label){case 0:return e=r.challengeName,n=r.user,s=r.formValues.confirmation_code,e!==d.SMS_MFA&&e!==d.SOFTWARE_TOKEN_MFA||(o=e),[4,D.handleConfirmSignIn({user:n,code:s,mfaType:o})];case 1:return t.sent(),[4,i.currentAuthenticatedUser()];case 2:return[2,t.sent()]}}))}))},forceNewPassword:function(s,o){return e(this,void 0,void 0,(function(){var e,o,a,c,d,u,l,f,g;return t(this,(function(t){switch(t.label){case 0:e=s.user,o=s.formValues,a=o.password,c=o.phone_number,d=o.country_code,u=r(o,["password","confirm_password","phone_number","country_code"]),c&&(l="".concat(d).concat(c).replace(/[^A-Z0-9+]/gi,""),u=n(n({},u),{phone_number:l})),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,i.completeNewPassword(e,a,u)];case 2:return(f=t.sent()).challengeName?[2,f]:[2,i.currentAuthenticatedUser()];case 3:return g=t.sent(),[2,Promise.reject(g)];case 4:return[2]}}))}))},verifyTotpToken:function(r,n){return e(this,void 0,void 0,(function(){var e,n;return t(this,(function(t){return e=r.user,n=r.formValues.confirmation_code,[2,i.verifyTotpToken(e,n)]}))}))},federatedSignIn:function(r,n){return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return e=n.data.provider,[4,i.federatedSignIn({provider:e})];case 1:return[2,t.sent()]}}))}))},checkVerifiedContact:function(r,n){return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return e=r.user,[4,i.verifiedContact(e)];case 1:return[2,t.sent()]}}))}))},verifyUser:function(r,n){return e(this,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:return e=r.formValues.unverifiedAttr,[4,i.verifyCurrentUserAttribute(e)];case 1:return n=t.sent(),r.attributeToVerify=e,[2,n]}}))}))},confirmVerifyUser:function(r,n){return e(this,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:return e=r.attributeToVerify,n=r.formValues.confirmation_code,[4,i.verifyCurrentUserAttributeSubmit(e,n)];case 1:return[2,t.sent()]}}))}))},validateFields:function(r,n){return e(this,void 0,void 0,(function(){return t(this,(function(e){return[2,u(r.formValues,r.touched,r.passwordSettings,[F.validateConfirmPassword])]}))}))}}})}export{k as signInActor};
|
|
1
|
+
import{__awaiter as e,__generator as t,__assign as r,__rest as n}from"../../../node_modules/tslib/tslib.es6.js";import{Auth as i}from"aws-amplify";import s from"lodash/get";import o from"lodash/isEmpty";import{createMachine as a,sendUpdate as c}from"xstate";import{AuthChallengeNames as d}from"../../../types/authenticator/user.js";import"../../../types/authenticator/attributes.js";import{runValidators as u}from"../../../validators/index.js";import{clearAttributeToVerify as l,clearChallengeName as g,clearRequiredAttributes as f,clearError as m,clearFormValues as h,clearTouched as p,clearUnverifiedAttributes as v,clearValidationError as I,handleInput as A,handleSubmit as U,handleBlur as E,parsePhoneNumber as S,setChallengeName as b,setConfirmResetPasswordIntent as y,setConfirmSignUpIntent as T,setRequiredAttributes as C,setCredentials as N,setFieldErrors as w,setRemoteError as R,setUnverifiedAttributes as P,setUser as V,setUsernameAuthAttributes as F}from"../actions.js";import{defaultServices as _}from"../defaultServices.js";function k(k){var j=k.services;return a({initial:"init",id:"signInActor",states:{init:{always:[{target:"autoSignIn",cond:"shouldAutoSignIn"},{target:"signIn"}]},signIn:{initial:"edit",exit:["clearFormValues","clearTouched"],states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},CHANGE:{actions:"handleInput"},FEDERATED_SIGN_IN:"federatedSignIn"}},federatedSignIn:{tags:["pending"],entry:["sendUpdate","clearError"],invoke:{src:"federatedSignIn",onError:{actions:"setRemoteError"}}},submit:{tags:["pending"],entry:["parsePhoneNumber","clearError","sendUpdate"],invoke:{src:"signIn",onDone:[{cond:"shouldSetupTOTP",actions:["setUser","setChallengeName"],target:"#signInActor.setupTOTP"},{cond:"shouldConfirmSignIn",actions:["setUser","setChallengeName"],target:"#signInActor.confirmSignIn"},{cond:"shouldForceChangePassword",actions:["setUser","setChallengeName","setRequiredAttributes"],target:"#signInActor.forceNewPassword"},{actions:"setUser",target:"verifying"}],onError:[{cond:"shouldRedirectToConfirmSignUp",actions:["setCredentials","setConfirmSignUpIntent"],target:"rejected"},{cond:"shouldRedirectToConfirmResetPassword",actions:["setUsernameAuthAttributes","setConfirmResetPasswordIntent"],target:"rejected"},{actions:"setRemoteError",target:"edit"}]}},verifying:{tags:["pending"],entry:["clearError","sendUpdate"],invoke:{src:"checkVerifiedContact",onDone:[{cond:"shouldRequestVerification",target:"#signInActor.verifyUser",actions:"setUnverifiedAttributes"},{target:"resolved"}],onError:{actions:"setRemoteError",target:"edit"}}},resolved:{always:"#signInActor.resolved"},rejected:{always:"#signInActor.rejected"}}},autoSignIn:{initial:"submit",states:{submit:{tags:["pending"],entry:["clearError","sendUpdate"],invoke:{src:"signIn",onDone:[{cond:"shouldSetupTOTP",actions:["setUser","setChallengeName"],target:"#signInActor.setupTOTP"},{cond:"shouldConfirmSignIn",actions:["setUser","setChallengeName"],target:"#signInActor.confirmSignIn"},{cond:"shouldForceChangePassword",actions:["setUser","setChallengeName","setRequiredAttributes"],target:"#signInActor.forceNewPassword"},{actions:"setUser",target:"#signInActor.resolved"}],onError:[{cond:"shouldRedirectToConfirmSignUp",actions:["setCredentials","setConfirmSignUpIntent"],target:"#signInActor.rejected"},{cond:"shouldRedirectToConfirmResetPassword",actions:["setUsernameAuthAttributes","setConfirmResetPasswordIntent"],target:"#signInActor.rejected"},{actions:"setRemoteError",target:"#signInActor.signIn"}]}}}},confirmSignIn:{initial:"edit",exit:["clearFormValues","clearError","clearTouched"],states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},SIGN_IN:"#signInActor.signIn",CHANGE:{actions:"handleInput"}}},submit:{tags:["pending"],entry:["clearError","sendUpdate"],invoke:{src:"confirmSignIn",onDone:{target:"#signInActor.resolved",actions:["setUser","clearChallengeName","clearRequiredAttributes"]},onError:{target:"edit",actions:"setRemoteError"}}}}},forceNewPassword:{type:"parallel",exit:["clearFormValues","clearError","clearTouched"],states:{validation:{initial:"pending",states:{pending:{invoke:{src:"validateFields",onDone:{target:"valid",actions:"clearValidationError"},onError:{target:"invalid",actions:"setFieldErrors"}}},valid:{entry:"sendUpdate"},invalid:{entry:"sendUpdate"}},on:{SIGN_IN:"#signInActor.signIn",CHANGE:{actions:"handleInput",target:".pending"},BLUR:{actions:"handleBlur",target:".pending"}}},submit:{initial:"idle",entry:"clearError",states:{idle:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"validate"}}},validate:{entry:"sendUpdate",invoke:{src:"validateFields",onDone:{target:"pending",actions:"clearValidationError"},onError:{target:"idle",actions:"setFieldErrors"}}},pending:{tags:["pending"],entry:["sendUpdate","clearError"],invoke:{src:"forceNewPassword",onDone:[{cond:"shouldConfirmSignIn",actions:["setUser","setChallengeName"],target:"#signInActor.confirmSignIn"},{cond:"shouldSetupTOTP",actions:["setUser","setChallengeName"],target:"#signInActor.setupTOTP"},{target:"resolved",actions:["setUser","setCredentials"]}],onError:{target:"idle",actions:"setRemoteError"}}},resolved:{type:"final",always:"#signInActor.resolved"}}}}},setupTOTP:{initial:"edit",exit:["clearFormValues","clearError","clearTouched"],states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},SIGN_IN:"#signInActor.signIn",CHANGE:{actions:"handleInput"}}},submit:{tags:["pending"],entry:["sendUpdate","clearError"],invoke:{src:"verifyTotpToken",onDone:{actions:["setUser","clearChallengeName","clearRequiredAttributes"],target:"#signInActor.resolved"},onError:{actions:"setRemoteError",target:"edit"}}}}},verifyUser:{initial:"edit",exit:["clearFormValues","clearError","clearTouched"],states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},SKIP:"#signInActor.resolved",CHANGE:{actions:"handleInput"}}},submit:{tags:["pending"],entry:"clearError",invoke:{src:"verifyUser",onDone:{target:"#signInActor.confirmVerifyUser"},onError:{actions:"setRemoteError",target:"edit"}}}}},confirmVerifyUser:{initial:"edit",exit:["clearFormValues","clearError","clearUnverifiedAttributes","clearAttributeToVerify","clearTouched"],states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},SKIP:"#signInActor.resolved",CHANGE:{actions:"handleInput"}}},submit:{tags:["pending"],entry:"clearError",invoke:{src:"confirmVerifyUser",onDone:{target:"#signInActor.resolved"},onError:{actions:"setRemoteError",target:"edit"}}}}},resolved:{type:"final",data:function(e){return{user:e.user}}},rejected:{type:"final",data:function(e,t){return{intent:e.redirectIntent,authAttributes:e.authAttributes}}}}},{actions:{clearAttributeToVerify:l,clearChallengeName:g,clearRequiredAttributes:f,clearError:m,clearFormValues:h,clearTouched:p,clearUnverifiedAttributes:v,clearValidationError:I,handleInput:A,handleSubmit:U,handleBlur:E,parsePhoneNumber:S,setChallengeName:b,setConfirmResetPasswordIntent:y,setConfirmSignUpIntent:T,setRequiredAttributes:C,setCredentials:N,setFieldErrors:w,setRemoteError:R,setUnverifiedAttributes:P,setUser:V,setUsernameAuthAttributes:F,sendUpdate:c()},guards:{shouldConfirmSignIn:function(e,t){var r=s(t,"data.challengeName");return[d.SMS_MFA,d.SOFTWARE_TOKEN_MFA].includes(r)},shouldAutoSignIn:function(e){return"autoSignIn"===(null==e?void 0:e.intent)},shouldRedirectToConfirmSignUp:function(e,t){return"UserNotConfirmedException"===t.data.code},shouldRedirectToConfirmResetPassword:function(e,t){return"PasswordResetRequiredException"===t.data.code},shouldSetupTOTP:function(e,t){return s(t,"data.challengeName")===d.MFA_SETUP},shouldForceChangePassword:function(e,t){return s(t,"data.challengeName")===d.NEW_PASSWORD_REQUIRED},shouldRequestVerification:function(e,t){var r=t.data,n=r.unverified,i=r.verified;return o(i)&&!o(n)}},services:{signIn:function(n){return e(this,void 0,void 0,(function(){var e,i,s,o,a,c,d;return t(this,(function(t){switch(t.label){case 0:return e=n.authAttributes,i=void 0===e?{}:e,s=n.formValues,o=void 0===s?{}:s,a=r(r({},i),o),c=a.username,d=a.password,[4,j.handleSignIn({username:c,password:d})];case 1:return[2,t.sent()]}}))}))},confirmSignIn:function(r,n){return e(this,void 0,void 0,(function(){var e,n,s,o;return t(this,(function(t){switch(t.label){case 0:return e=r.challengeName,n=r.user,s=r.formValues.confirmation_code,e!==d.SMS_MFA&&e!==d.SOFTWARE_TOKEN_MFA||(o=e),[4,j.handleConfirmSignIn({user:n,code:s,mfaType:o})];case 1:return t.sent(),[4,i.currentAuthenticatedUser()];case 2:return[2,t.sent()]}}))}))},forceNewPassword:function(s,o){return e(this,void 0,void 0,(function(){var e,o,a,c,d,u,l,g,f;return t(this,(function(t){switch(t.label){case 0:e=s.user,o=s.formValues,a=o.password,c=o.phone_number,d=o.country_code,u=n(o,["password","confirm_password","phone_number","country_code"]),c&&(l="".concat(d).concat(c).replace(/[^A-Z0-9+]/gi,""),u=r(r({},u),{phone_number:l})),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,i.completeNewPassword(e,a,u)];case 2:return(g=t.sent()).challengeName?[2,g]:[2,i.currentAuthenticatedUser()];case 3:return f=t.sent(),[2,Promise.reject(f)];case 4:return[2]}}))}))},verifyTotpToken:function(r,n){return e(this,void 0,void 0,(function(){var e,n;return t(this,(function(t){return e=r.user,n=r.formValues.confirmation_code,[2,i.verifyTotpToken(e,n)]}))}))},federatedSignIn:function(r,n){return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return e=n.data.provider,[4,i.federatedSignIn({provider:e})];case 1:return[2,t.sent()]}}))}))},checkVerifiedContact:function(r,n){return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return e=r.user,[4,i.verifiedContact(e)];case 1:return[2,t.sent()]}}))}))},verifyUser:function(r,n){return e(this,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:return e=r.formValues.unverifiedAttr,[4,i.verifyCurrentUserAttribute(e)];case 1:return n=t.sent(),r.attributeToVerify=e,[2,n]}}))}))},confirmVerifyUser:function(r,n){return e(this,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:return e=r.attributeToVerify,n=r.formValues.confirmation_code,[4,i.verifyCurrentUserAttributeSubmit(e,n)];case 1:return[2,t.sent()]}}))}))},validateFields:function(r,n){return e(this,void 0,void 0,(function(){return t(this,(function(e){return[2,u(r.formValues,r.touched,r.passwordSettings,[_.validateConfirmPassword])]}))}))}}})}export{k as signInActor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t,__spreadArray as o,__rest as n}from"../../node_modules/tslib/tslib.es6.js";import{createMachine as r,forwardTo as i,assign as e,spawn as a}from"xstate";import{choose as s}from"xstate/lib/actions";import{stopActor as c}from"./actions.js";import{signInActor as u}from"./actors/signIn.js";import{signOutActor as d}from"./actors/signOut.js";import{resetPasswordActor as l}from"./actors/resetPassword.js";import{defaultServices as g}from"./defaultServices.js";import{createSignUpMachine as v}from"./signUp.js";function f(){return r({id:"authenticator",initial:"idle",context:{user:void 0,config:{},services:g,actorRef:void 0,hasSetup:!1},states:{idle:{invoke:{src:"getCurrentUser",onDone:{actions:"setUser",target:"authenticated"},onError:{target:"setup"}}},setup:{initial:"waitConfig",states:{waitConfig:{on:{INIT:{actions:["configure","setHasSetup"],target:"applyConfig"}}},applyConfig:{invoke:{src:"getAmplifyConfig",onDone:{actions:"applyAmplifyConfig",target:"goToInitialState"}}},goToInitialState:{always:[{target:"#authenticator.signUp",cond:"isInitialStateSignUp"},{target:"#authenticator.resetPassword",cond:"isInitialStateResetPassword"},{target:"#authenticator.signIn"}]}}},signIn:{initial:"spawnActor",states:{spawnActor:{always:{actions:"spawnSignInActor",target:"runActor"}},runActor:{entry:"clearActorDoneData",exit:"stopSignInActor"}},on:{SIGN_UP:"signUp",RESET_PASSWORD:"resetPassword","done.invoke.signInActor":[{target:"signUp",actions:"setActorDoneData",cond:"shouldRedirectToSignUp"},{target:"resetPassword",actions:"setActorDoneData",cond:"shouldRedirectToResetPassword"},{target:"authenticated",actions:"setActorDoneData"}]}},signUp:{initial:"spawnActor",states:{spawnActor:{always:{actions:"spawnSignUpActor",target:"runActor"}},runActor:{entry:"clearActorDoneData",exit:"stopSignUpActor"},autoSignIn:{invoke:{src:"getCurrentUser",onDone:"#authenticator.authenticated",onError:"#authenticator.setup.goToInitialState"}}},on:{SIGN_IN:"signIn","done.invoke.signUpActor":{target:"
|
|
1
|
+
import{__assign as t,__spreadArray as o,__rest as n}from"../../node_modules/tslib/tslib.es6.js";import{createMachine as r,forwardTo as i,assign as e,spawn as a}from"xstate";import{choose as s}from"xstate/lib/actions";import{stopActor as c}from"./actions.js";import{signInActor as u}from"./actors/signIn.js";import{signOutActor as d}from"./actors/signOut.js";import{resetPasswordActor as l}from"./actors/resetPassword.js";import{defaultServices as g}from"./defaultServices.js";import{createSignUpMachine as v}from"./signUp.js";function f(){return r({id:"authenticator",initial:"idle",context:{user:void 0,config:{},services:g,actorRef:void 0,hasSetup:!1},states:{idle:{invoke:{src:"getCurrentUser",onDone:{actions:"setUser",target:"authenticated"},onError:{target:"setup"}}},setup:{initial:"waitConfig",states:{waitConfig:{on:{INIT:{actions:["configure","setHasSetup"],target:"applyConfig"}}},applyConfig:{invoke:{src:"getAmplifyConfig",onDone:{actions:"applyAmplifyConfig",target:"goToInitialState"}}},goToInitialState:{always:[{target:"#authenticator.signUp",cond:"isInitialStateSignUp"},{target:"#authenticator.resetPassword",cond:"isInitialStateResetPassword"},{target:"#authenticator.signIn"}]}}},signIn:{initial:"spawnActor",states:{spawnActor:{always:{actions:"spawnSignInActor",target:"runActor"}},runActor:{entry:"clearActorDoneData",exit:"stopSignInActor"}},on:{SIGN_UP:"signUp",RESET_PASSWORD:"resetPassword","done.invoke.signInActor":[{target:"signUp",actions:"setActorDoneData",cond:"shouldRedirectToSignUp"},{target:"resetPassword",actions:"setActorDoneData",cond:"shouldRedirectToResetPassword"},{target:"authenticated",actions:"setActorDoneData"}]}},signUp:{initial:"spawnActor",states:{spawnActor:{always:{actions:"spawnSignUpActor",target:"runActor"}},runActor:{entry:"clearActorDoneData",exit:"stopSignUpActor"},autoSignIn:{invoke:{src:"getCurrentUser",onDone:"#authenticator.authenticated",onError:"#authenticator.setup.goToInitialState"}}},on:{SIGN_IN:"signIn","done.invoke.signUpActor":{target:"#authenticator.signIn",actions:"setActorDoneData",cond:"shouldAutoSignIn"}}},resetPassword:{initial:"spawnActor",states:{spawnActor:{always:{actions:"spawnResetPasswordActor",target:"runActor"}},runActor:{entry:"clearActorDoneData",exit:"stopResetPasswordActor"}},on:{SIGN_IN:"signIn","done.invoke.resetPasswordActor":{target:"signIn",actions:"setActorDoneData"}}},signOut:{initial:"spawnActor",states:{spawnActor:{always:{actions:"spawnSignOutActor",target:"runActor"}},runActor:{entry:"clearActorDoneData",exit:["stopSignOutActor","clearUser"]}},on:{"done.invoke.signOutActor":[{target:"setup",cond:"shouldSetup"},{target:"setup.goToInitialState"}]}},authenticated:{initial:"idle",states:{idle:{on:{TOKEN_REFRESH:"refreshUser"}},refreshUser:{invoke:{src:"getCurrentUser",onDone:{actions:"setUser",target:"idle"},onError:{target:"#authenticator.signOut"}}}},on:{SIGN_OUT:"signOut"}}},on:{CHANGE:{actions:"forwardToActor"},BLUR:{actions:"forwardToActor"},SUBMIT:{actions:"forwardToActor"},FEDERATED_SIGN_IN:{actions:"forwardToActor"},RESEND:{actions:"forwardToActor"},SIGN_IN:{actions:"forwardToActor"},SKIP:{actions:"forwardToActor"}}},{actions:{forwardToActor:s([{cond:"hasActor",actions:i((function(t){return t.actorRef}))}]),setUser:e({user:function(t,o){return o.data}}),setActorDoneData:e({actorDoneData:function(o,n){var r,i;return{authAttributes:t({},null===(r=n.data)||void 0===r?void 0:r.authAttributes),intent:null===(i=n.data)||void 0===i?void 0:i.intent}},user:function(t,o){var n;return null===(n=o.data)||void 0===n?void 0:n.user}}),clearUser:e({user:void 0}),clearActorDoneData:e({actorDoneData:void 0}),applyAmplifyConfig:e({config:function(t,n){var r,i,e,a,s,c,u,d,l,g=null!==(i=null===(r=n.data.aws_cognito_username_attributes)||void 0===r?void 0:r.map((function(t){return t.toLowerCase()})))&&void 0!==i?i:[],v=null!==(a=null===(e=n.data.aws_cognito_verification_mechanisms)||void 0===e?void 0:e.map((function(t){return t.toLowerCase()})))&&void 0!==a?a:[],f=null!==(c=null===(s=n.data.aws_cognito_signup_attributes)||void 0===s?void 0:s.map((function(t){return t.toLowerCase()})))&&void 0!==c?c:[],A=null!==(d=null===(u=n.data.aws_cognito_social_providers)||void 0===u?void 0:u.map((function(t){return t.toLowerCase()})))&&void 0!==d?d:[],w=n.data.aws_cognito_password_protection_settings||{};0===g.length&&g.push("username");var m=t.config,S=m.loginMechanisms,h=m.signUpAttributes,D=m.socialProviders,I=m.initialState;return{loginMechanisms:null!=S?S:g,formFields:null!==(l=p(m.formFields))&&void 0!==l?l:{},passwordSettings:w,signUpAttributes:null!=h?h:Array.from(new Set(o(o([],v,!0),f,!0))),socialProviders:null!=D?D:A.sort(),initialState:I}}}),spawnSignInActor:e({actorRef:function(t,o){var n,r,i,e,s,c,d=t.services,l=u({services:d}).withContext({authAttributes:null!==(r=null===(n=t.actorDoneData)||void 0===n?void 0:n.authAttributes)&&void 0!==r?r:{},user:t.user,intent:null===(i=t.actorDoneData)||void 0===i?void 0:i.intent,country_code:"+1",formValues:{},touched:{},validationError:{},loginMechanisms:null===(e=t.config)||void 0===e?void 0:e.loginMechanisms,socialProviders:null===(s=t.config)||void 0===s?void 0:s.socialProviders,formFields:null===(c=t.config)||void 0===c?void 0:c.formFields});return a(l,{name:"signInActor"})}}),spawnSignUpActor:e({actorRef:function(t,o){var n,r,i,e,s,c,u,d=t.services,l=v({services:d}).withContext({authAttributes:null!==(r=null===(n=t.actorDoneData)||void 0===n?void 0:n.authAttributes)&&void 0!==r?r:{},country_code:"+1",intent:null===(i=t.actorDoneData)||void 0===i?void 0:i.intent,formValues:{},touched:{},validationError:{},loginMechanisms:null===(e=t.config)||void 0===e?void 0:e.loginMechanisms,socialProviders:null===(s=t.config)||void 0===s?void 0:s.socialProviders,formFields:null===(c=t.config)||void 0===c?void 0:c.formFields,passwordSettings:null===(u=t.config)||void 0===u?void 0:u.passwordSettings});return a(l,{name:"signUpActor"})}}),spawnResetPasswordActor:e({actorRef:function(t,o){var n,r,i,e,s=t.services,c=l({services:s}).withContext({formValues:{},touched:{},intent:null===(n=t.actorDoneData)||void 0===n?void 0:n.intent,username:null===(i=null===(r=t.actorDoneData)||void 0===r?void 0:r.authAttributes)||void 0===i?void 0:i.username,formFields:null===(e=t.config)||void 0===e?void 0:e.formFields,validationError:{}});return a(c,{name:"resetPasswordActor"})}}),spawnSignOutActor:e({actorRef:function(t){var o=d.withContext({user:t.user});return a(o,{name:"signOutActor"})}}),stopSignInActor:c("signInActor"),stopSignUpActor:c("signUpActor"),stopResetPasswordActor:c("resetPasswordActor"),stopSignOutActor:c("signOutActor"),configure:e((function(o,r){var i=r.data,e=i.services,a=n(i,["services"]);return{services:t(t({},g),e),config:a}})),setHasSetup:e({hasSetup:!0})},guards:{isInitialStateSignUp:function(t){return"signUp"===t.config.initialState},isInitialStateResetPassword:function(t){return"resetPassword"===t.config.initialState},shouldRedirectToSignUp:function(t,o){var n;return"confirmSignUp"===(null===(n=o.data)||void 0===n?void 0:n.intent)},shouldRedirectToResetPassword:function(t,o){var n;return"confirmPasswordReset"===(null===(n=o.data)||void 0===n?void 0:n.intent)},shouldAutoSignIn:function(t,o){var n;return"autoSignIn"===(null===(n=o.data)||void 0===n?void 0:n.intent)},shouldSetup:function(t){return!1===t.hasSetup},hasActor:function(t){return!!t.actorRef}},services:{getCurrentUser:function(t,o){return t.services.getCurrentUser()},getAmplifyConfig:function(t,o){return t.services.getAmplifyConfig()}}})}function p(t){return t&&Object.keys(t).forEach((function(o){Object.keys(t[o]).forEach((function(n){var r=t[o][n];r.required=r.isRequired}))})),t}export{f as createAuthenticatorMachine};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as
|
|
1
|
+
import{__awaiter as e,__generator as n}from"../../node_modules/tslib/tslib.es6.js";import{Auth as t}from"aws-amplify";import r from"lodash/get";import i from"lodash/pickBy";import{createMachine as a,sendUpdate as s,assign as o}from"xstate";import{runValidators as d}from"../../validators/index.js";import{clearError as c,clearFormValues as u,clearTouched as l,clearValidationError as m,handleInput as p,handleSubmit as g,handleBlur as f,parsePhoneNumber as v,setCredentials as U,setFieldErrors as h,setRemoteError as S,setCodeDeliveryDetails as E,setUser as y}from"./actions.js";function I(I){var C=I.services;return a({id:"signUpActor",initial:"init",states:{init:{always:[{target:"confirmSignUp",cond:"shouldInitConfirmSignUp"},{target:"signUp"}]},signUp:{type:"parallel",exit:["clearError","clearFormValues","clearTouched"],states:{validation:{initial:"pending",states:{pending:{invoke:{src:"validateSignUp",onDone:{target:"valid",actions:"clearValidationError"},onError:{target:"invalid",actions:"setFieldErrors"}}},valid:{entry:"sendUpdate"},invalid:{entry:"sendUpdate"}},on:{CHANGE:{actions:"handleInput",target:".pending"},BLUR:{actions:"handleBlur",target:".pending"}}},submission:{initial:"idle",states:{idle:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"validate"},FEDERATED_SIGN_IN:"federatedSignIn"}},federatedSignIn:{tags:["pending"],entry:["sendUpdate","clearError"],invoke:{src:"federatedSignIn",onDone:"#signUpActor.resolved",onError:{actions:"setRemoteError"}}},validate:{entry:"sendUpdate",invoke:{src:"validateSignUp",onDone:{target:"pending",actions:"clearValidationError"},onError:{target:"idle",actions:"setFieldErrors"}}},pending:{tags:["pending"],entry:["parsePhoneNumber","sendUpdate","clearError"],invoke:{src:"signUp",onDone:[{cond:"shouldSkipConfirm",target:"skipConfirm",actions:["setUser"]},{target:"resolved",actions:["setUser","setCredentials","setCodeDeliveryDetails"]}],onError:{target:"idle",actions:"setRemoteError"}}},skipConfirm:{always:{target:"#signUpActor.resolved",actions:"setAutoSignInIntent"}},resolved:{type:"final",always:"#signUpActor.confirmSignUp"}}}}},confirmSignUp:{initial:"edit",states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},CHANGE:{actions:"handleInput"},BLUR:{actions:"handleBlur"},RESEND:"resend"}},resend:{tags:["pending"],entry:"sendUpdate",invoke:{src:"resendConfirmationCode",onDone:{target:"edit"},onError:[{target:"#signUpActor.resolved",actions:"setAutoSignInIntent",cond:"isUserAlreadyConfirmed"},{target:"edit",actions:"setRemoteError"}]}},submit:{tags:["pending"],entry:["sendUpdate","clearError"],invoke:{src:"confirmSignUp",onDone:{target:"#signUpActor.resolved",actions:"setAutoSignInIntent"},onError:{target:"edit",actions:"setRemoteError"}}}}},resolved:{type:"final",data:function(e,n){var t=e.authAttributes,i=t.username,a=t.password;return{user:r(n,"data.user")||e.user,authAttributes:{username:i,password:a},intent:e.intent}}}}},{guards:{isUserAlreadyConfirmed:function(e,n){return"User is already confirmed."===n.data.message},shouldInitConfirmSignUp:function(e){return e.intent&&"confirmSignUp"===e.intent},shouldSkipConfirm:function(e,n){return n.data.userConfirmed}},actions:{clearError:c,clearFormValues:u,clearTouched:l,clearValidationError:m,handleInput:p,handleSubmit:g,handleBlur:f,parsePhoneNumber:v,setCredentials:U,setFieldErrors:h,setRemoteError:S,setCodeDeliveryDetails:E,setUser:y,sendUpdate:s(),setAutoSignInIntent:o({intent:function(e){return"autoSignIn"}})},services:{confirmSignUp:function(t,i){return e(this,void 0,void 0,(function(){var e,i,a,s,o;return n(this,(function(n){switch(n.label){case 0:return e=t.user,i=t.authAttributes,a=t.formValues,s=a.confirmation_code,o=r(e,"username")||r(i,"username"),[4,C.handleConfirmSignUp({username:o,code:s})];case 1:return[2,n.sent()]}}))}))},resendConfirmationCode:function(i,a){return e(this,void 0,void 0,(function(){var e,a,s;return n(this,(function(n){return e=i.user,a=i.authAttributes,s=r(e,"username")||r(a,"username"),[2,t.resendSignUp(s)]}))}))},federatedSignIn:function(r,i){return e(this,void 0,void 0,(function(){var e;return n(this,(function(n){switch(n.label){case 0:return e=i.data.provider,[4,t.federatedSignIn({provider:e})];case 1:return[2,n.sent()]}}))}))},signUp:function(t,r){return e(this,void 0,void 0,(function(){var e,r,a,s,o,d,c;return n(this,(function(n){switch(n.label){case 0:return e=t.formValues,r=t.loginMechanisms,a=r[0],o=(s=e)[void 0===a?"username":a],d=s.password,c=i(e,(function(e,n){switch(n){case"address":case"birthdate":case"email":case"family_name":case"gender":case"given_name":case"locale":case"middle_name":case"name":case"nickname":case"phone_number":case"picture":case"preferred_username":case"profile":case"updated_at":case"website":case"zoneinfo":return!0;default:return n.startsWith("custom:")}})),[4,C.handleSignUp({username:o,password:d,attributes:c})];case 1:return[2,n.sent()]}}))}))},validateSignUp:function(t,r){return e(this,void 0,void 0,(function(){return n(this,(function(e){return[2,d(t.formValues,t.touched,t.passwordSettings,[C.validateFormPassword,C.validateConfirmPassword,C.validatePreferredUsername,C.validateCustomSignUp])]}))}))}}})}export{I as createSignUpMachine};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{tokens as l}from"./tokens/index.js";var e={colorMode:"dark",tokens:{colors:{red:{10:{value:l.colors.red[100].value},20:{value:l.colors.red[90].value},40:{value:l.colors.red[80].value},80:{value:l.colors.red[40].value},90:{value:l.colors.red[20].value},100:{value:l.colors.red[10].value}},orange:{10:{value:l.colors.orange[100].value},20:{value:l.colors.orange[90].value},40:{value:l.colors.orange[80].value},80:{value:l.colors.orange[40].value},90:{value:l.colors.orange[20].value},100:{value:l.colors.orange[10].value}},yellow:{10:{value:l.colors.yellow[100].value},20:{value:l.colors.yellow[90].value},40:{value:l.colors.yellow[80].value},80:{value:l.colors.yellow[40].value},90:{value:l.colors.yellow[20].value},100:{value:l.colors.yellow[10].value}},green:{10:{value:l.colors.green[100].value},20:{value:l.colors.green[90].value},40:{value:l.colors.green[80].value},80:{value:l.colors.green[40].value},90:{value:l.colors.green[20].value},100:{value:l.colors.green[10].value}},teal:{10:{value:l.colors.teal[100].value},20:{value:l.colors.teal[90].value},40:{value:l.colors.teal[80].value},80:{value:l.colors.teal[40].value},90:{value:l.colors.teal[20].value},100:{value:l.colors.teal[10].value}},blue:{10:{value:l.colors.blue[100].value},20:{value:l.colors.blue[90].value},40:{value:l.colors.blue[80].value},80:{value:l.colors.blue[40].value},90:{value:l.colors.blue[20].value},100:{value:l.colors.blue[10].value}},purple:{10:{value:l.colors.purple[100].value},20:{value:l.colors.purple[90].value},40:{value:l.colors.purple[80].value},80:{value:l.colors.purple[40].value},90:{value:l.colors.purple[20].value},100:{value:l.colors.purple[10].value}},pink:{10:{value:l.colors.pink[100].value},20:{value:l.colors.pink[90].value},40:{value:l.colors.pink[80].value},80:{value:l.colors.pink[40].value},90:{value:l.colors.pink[20].value},100:{value:l.colors.pink[10].value}},neutral:{10:{value:l.colors.neutral[100].value},20:{value:l.colors.neutral[90].value},40:{value:l.colors.neutral[80].value},80:{value:l.colors.neutral[40].value},90:{value:l.colors.neutral[20].value},100:{value:l.colors.neutral[10].value}},black:{value:"#fff"},white:{value:"#000"},border:{primary:{value:"{colors.neutral.40.value}"},secondary:{value:"{colors.neutral.20.value}"},tertiary:{value:"{colors.neutral.10.value}"}},overlay:{10:{value:"hsla(0, 0%, 100%, 0.1)"},20:{value:"hsla(0, 0%, 100%, 0.2)"},30:{value:"hsla(0, 0%, 100%, 0.3)"},40:{value:"hsla(0, 0%, 100%, 0.4)"},50:{value:"hsla(0, 0%, 100%, 0.5)"},60:{value:"hsla(0, 0%, 100%, 0.6)"},70:{value:"hsla(0, 0%, 100%, 0.7)"},80:{value:"hsla(0, 0%, 100%, 0.8)"},90:{value:"hsla(0, 0%, 100%, 0.9)"}}}}};export{e as defaultDarkModeOverride};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var l={red:{10:{value:"hsl(0, 75%, 95%)"},20:{value:"hsl(0, 75%, 85%)"},40:{value:"hsl(0, 75%, 75%)"},60:{value:"hsl(0, 50%, 50%)"},80:{value:"hsl(0, 95%, 30%)"},90:{value:"hsl(0, 100%, 20%)"},100:{value:"hsl(0, 100%, 15%)"}},orange:{10:{value:"hsl(30, 75%, 95%)"},20:{value:"hsl(30, 75%, 85%)"},40:{value:"hsl(30, 75%, 75%)"},60:{value:"hsl(30, 50%, 50%)"},80:{value:"hsl(30, 95%, 30%)"},90:{value:"hsl(30, 100%, 20%)"},100:{value:"hsl(30, 100%, 15%)"}},yellow:{10:{value:"hsl(60, 75%, 95%)"},20:{value:"hsl(60, 75%, 85%)"},40:{value:"hsl(60, 75%, 75%)"},60:{value:"hsl(60, 50%, 50%)"},80:{value:"hsl(60, 95%, 30%)"},90:{value:"hsl(60, 100%, 20%)"},100:{value:"hsl(60, 100%, 15%)"}},green:{10:{value:"hsl(130, 60%, 95%)"},20:{value:"hsl(130, 60%, 90%)"},40:{value:"hsl(130, 44%, 63%)"},60:{value:"hsl(130, 43%, 46%)"},80:{value:"hsl(130, 33%, 37%)"},90:{value:"hsl(130, 27%, 29%)"},100:{value:"hsl(130, 22%, 23%)"}},teal:{10:{value:"hsl(190, 75%, 95%)"},20:{value:"hsl(190, 75%, 85%)"},40:{value:"hsl(190, 70%, 70%)"},60:{value:"hsl(190, 50%, 50%)"},80:{value:"hsl(190, 95%, 30%)"},90:{value:"hsl(190, 100%, 20%)"},100:{value:"hsl(190, 100%, 15%)"}},blue:{10:{value:"hsl(220, 95%, 95%)"},20:{value:"hsl(220, 85%, 85%)"},40:{value:"hsl(220, 70%, 70%)"},60:{value:"hsl(220, 50%, 50%)"},80:{value:"hsl(220, 95%, 30%)"},90:{value:"hsl(220, 100%, 20%)"},100:{value:"hsl(220, 100%, 15%)"}},purple:{10:{value:"hsl(300, 95%, 95%)"},20:{value:"hsl(300, 85%, 85%)"},40:{value:"hsl(300, 70%, 70%)"},60:{value:"hsl(300, 50%, 50%)"},80:{value:"hsl(300, 95%, 30%)"},90:{value:"hsl(300, 100%, 20%)"},100:{value:"hsl(300, 100%, 15%)"}},pink:{10:{value:"hsl(340, 95%, 95%)"},20:{value:"hsl(340, 90%, 85%)"},40:{value:"hsl(340, 70%, 70%)"},60:{value:"hsl(340, 50%, 50%)"},80:{value:"hsl(340, 95%, 30%)"},90:{value:"hsl(340, 100%, 20%)"},100:{value:"hsl(340, 100%, 15%)"}},neutral:{10:{value:"hsl(210, 5%, 98%)"},20:{value:"hsl(210, 5%, 94%)"},40:{value:"hsl(210, 5%, 87%)"},60:{value:"hsl(210, 8%, 55%)"},80:{value:"hsl(210, 10%, 40%)"},90:{value:"hsl(210, 25%, 25%)"},100:{value:"hsl(210, 50%, 10%)"}},brand:{primary:{10:{value:"{colors.teal.10.value}"},20:{value:"{colors.teal.20.value}"},40:{value:"{colors.teal.40.value}"},60:{value:"{colors.teal.60.value}"},80:{value:"{colors.teal.80.value}"},90:{value:"{colors.teal.90.value}"},100:{value:"{colors.teal.100.value}"}},secondary:{10:{value:"{colors.purple.10.value}"},20:{value:"{colors.purple.20.value}"},40:{value:"{colors.purple.40.value}"},60:{value:"{colors.purple.60.value}"},80:{value:"{colors.purple.80.value}"},90:{value:"{colors.purple.90.value}"},100:{value:"{colors.purple.100.value}"}}},font:{primary:{value:"{colors.neutral.100.value}"},secondary:{value:"{colors.neutral.90.value}"},tertiary:{value:"{colors.neutral.80.value}"},disabled:{value:"{colors.font.tertiary.value}"},inverse:{value:"{colors.white.value}"},interactive:{value:"{colors.brand.primary.80.value}"},hover:{value:"{colors.brand.primary.90.value}"},focus:{value:"{colors.brand.primary.100.value}"},active:{value:"{colors.brand.primary.100.value}"},info:{value:"{colors.blue.90.value}"},warning:{value:"{colors.orange.90.value}"},error:{value:"{colors.red.90.value}"},success:{value:"{colors.green.90.value}"}},background:{primary:{value:"{colors.white.value}"},secondary:{value:"{colors.neutral.10.value}"},tertiary:{value:"{colors.neutral.20.value}"},quaternary:{value:"{colors.neutral.60.value}"},disabled:{value:"{colors.background.tertiary.value}"},info:{value:"{colors.blue.20.value}"},warning:{value:"{colors.orange.20.value}"},error:{value:"{colors.red.20.value}"},success:{value:"{colors.green.20.value}"}},border:{primary:{value:"{colors.neutral.60.value}"},secondary:{value:"{colors.neutral.40.value}"},tertiary:{value:"{colors.neutral.20.value}"},disabled:{value:"{colors.border.tertiary.value}"},focus:{value:"{colors.brand.primary.100.value}"},error:{value:"{colors.red.80.value}"}},shadow:{primary:{value:"hsla(210, 50%, 10%, 0.25)"},secondary:{value:"hsla(210, 50%, 10%, 0.15)"},tertiary:{value:"hsla(210, 50%, 10%, 0.05)"}},overlay:{10:{value:"hsla(0, 0%, 0%, 0.1)"},20:{value:"hsla(0, 0%, 0%, 0.2)"},30:{value:"hsla(0, 0%, 0%, 0.3)"},40:{value:"hsla(0, 0%, 0%, 0.4)"},50:{value:"hsla(0, 0%, 0%, 0.5)"},60:{value:"hsla(0, 0%, 0%, 0.6)"},70:{value:"hsla(0, 0%, 0%, 0.7)"},80:{value:"hsla(0, 0%, 0%, 0.8)"},90:{value:"hsla(0, 0%, 0%, 0.9)"}},black:{value:"hsl(0, 0%, 0%)"},white:{value:"hsl(0, 0%, 100%)"},transparent:{value:"transparent"}};export{l as colors};
|
|
1
|
+
var l={red:{10:{value:"hsl(0, 75%, 95%)"},20:{value:"hsl(0, 75%, 85%)"},40:{value:"hsl(0, 75%, 75%)"},60:{value:"hsl(0, 50%, 50%)"},80:{value:"hsl(0, 95%, 30%)"},90:{value:"hsl(0, 100%, 20%)"},100:{value:"hsl(0, 100%, 15%)"}},orange:{10:{value:"hsl(30, 75%, 95%)"},20:{value:"hsl(30, 75%, 85%)"},40:{value:"hsl(30, 75%, 75%)"},60:{value:"hsl(30, 50%, 50%)"},80:{value:"hsl(30, 95%, 30%)"},90:{value:"hsl(30, 100%, 20%)"},100:{value:"hsl(30, 100%, 15%)"}},yellow:{10:{value:"hsl(60, 75%, 95%)"},20:{value:"hsl(60, 75%, 85%)"},40:{value:"hsl(60, 75%, 75%)"},60:{value:"hsl(60, 50%, 50%)"},80:{value:"hsl(60, 95%, 30%)"},90:{value:"hsl(60, 100%, 20%)"},100:{value:"hsl(60, 100%, 15%)"}},green:{10:{value:"hsl(130, 60%, 95%)"},20:{value:"hsl(130, 60%, 90%)"},40:{value:"hsl(130, 44%, 63%)"},60:{value:"hsl(130, 43%, 46%)"},80:{value:"hsl(130, 33%, 37%)"},90:{value:"hsl(130, 27%, 29%)"},100:{value:"hsl(130, 22%, 23%)"}},teal:{10:{value:"hsl(190, 75%, 95%)"},20:{value:"hsl(190, 75%, 85%)"},40:{value:"hsl(190, 70%, 70%)"},60:{value:"hsl(190, 50%, 50%)"},80:{value:"hsl(190, 95%, 30%)"},90:{value:"hsl(190, 100%, 20%)"},100:{value:"hsl(190, 100%, 15%)"}},blue:{10:{value:"hsl(220, 95%, 95%)"},20:{value:"hsl(220, 85%, 85%)"},40:{value:"hsl(220, 70%, 70%)"},60:{value:"hsl(220, 50%, 50%)"},80:{value:"hsl(220, 95%, 30%)"},90:{value:"hsl(220, 100%, 20%)"},100:{value:"hsl(220, 100%, 15%)"}},purple:{10:{value:"hsl(300, 95%, 95%)"},20:{value:"hsl(300, 85%, 85%)"},40:{value:"hsl(300, 70%, 70%)"},60:{value:"hsl(300, 50%, 50%)"},80:{value:"hsl(300, 95%, 30%)"},90:{value:"hsl(300, 100%, 20%)"},100:{value:"hsl(300, 100%, 15%)"}},pink:{10:{value:"hsl(340, 95%, 95%)"},20:{value:"hsl(340, 90%, 85%)"},40:{value:"hsl(340, 70%, 70%)"},60:{value:"hsl(340, 50%, 50%)"},80:{value:"hsl(340, 95%, 30%)"},90:{value:"hsl(340, 100%, 20%)"},100:{value:"hsl(340, 100%, 15%)"}},neutral:{10:{value:"hsl(210, 5%, 98%)"},20:{value:"hsl(210, 5%, 94%)"},40:{value:"hsl(210, 5%, 87%)"},60:{value:"hsl(210, 8%, 55%)"},80:{value:"hsl(210, 10%, 40%)"},90:{value:"hsl(210, 25%, 25%)"},100:{value:"hsl(210, 50%, 10%)"}},brand:{primary:{10:{value:"{colors.teal.10.value}"},20:{value:"{colors.teal.20.value}"},40:{value:"{colors.teal.40.value}"},60:{value:"{colors.teal.60.value}"},80:{value:"{colors.teal.80.value}"},90:{value:"{colors.teal.90.value}"},100:{value:"{colors.teal.100.value}"}},secondary:{10:{value:"{colors.purple.10.value}"},20:{value:"{colors.purple.20.value}"},40:{value:"{colors.purple.40.value}"},60:{value:"{colors.purple.60.value}"},80:{value:"{colors.purple.80.value}"},90:{value:"{colors.purple.90.value}"},100:{value:"{colors.purple.100.value}"}}},font:{primary:{value:"{colors.neutral.100.value}"},secondary:{value:"{colors.neutral.90.value}"},tertiary:{value:"{colors.neutral.80.value}"},disabled:{value:"{colors.font.tertiary.value}"},inverse:{value:"{colors.white.value}"},interactive:{value:"{colors.brand.primary.80.value}"},hover:{value:"{colors.brand.primary.90.value}"},focus:{value:"{colors.brand.primary.100.value}"},active:{value:"{colors.brand.primary.100.value}"},info:{value:"{colors.blue.90.value}"},warning:{value:"{colors.orange.90.value}"},error:{value:"{colors.red.90.value}"},success:{value:"{colors.green.90.value}"}},background:{primary:{value:"{colors.white.value}"},secondary:{value:"{colors.neutral.10.value}"},tertiary:{value:"{colors.neutral.20.value}"},quaternary:{value:"{colors.neutral.60.value}"},disabled:{value:"{colors.background.tertiary.value}"},info:{value:"{colors.blue.20.value}"},warning:{value:"{colors.orange.20.value}"},error:{value:"{colors.red.20.value}"},success:{value:"{colors.green.20.value}"}},border:{primary:{value:"{colors.neutral.60.value}"},secondary:{value:"{colors.neutral.40.value}"},tertiary:{value:"{colors.neutral.20.value}"},disabled:{value:"{colors.border.tertiary.value}"},pressed:{value:"{colors.brand.primary.100.value}"},focus:{value:"{colors.brand.primary.100.value}"},error:{value:"{colors.red.80.value}"}},shadow:{primary:{value:"hsla(210, 50%, 10%, 0.25)"},secondary:{value:"hsla(210, 50%, 10%, 0.15)"},tertiary:{value:"hsla(210, 50%, 10%, 0.05)"}},overlay:{10:{value:"hsla(0, 0%, 0%, 0.1)"},20:{value:"hsla(0, 0%, 0%, 0.2)"},30:{value:"hsla(0, 0%, 0%, 0.3)"},40:{value:"hsla(0, 0%, 0%, 0.4)"},50:{value:"hsla(0, 0%, 0%, 0.5)"},60:{value:"hsla(0, 0%, 0%, 0.6)"},70:{value:"hsla(0, 0%, 0%, 0.7)"},80:{value:"hsla(0, 0%, 0%, 0.8)"},90:{value:"hsla(0, 0%, 0%, 0.9)"}},black:{value:"hsl(0, 0%, 0%)"},white:{value:"hsl(0, 0%, 100%)"},transparent:{value:"transparent"}};export{l as colors};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var r={paddingBlock:{value:"{space.xs.value}"},track:{backgroundColor:{value:"{colors.background.quaternary.value}"},borderRadius:{value:"9999px"},height:{value:"0.375rem"},minWidth:{value:"10rem"}},range:{backgroundColor:{value:"{colors.brand.primary.80.value}"},borderRadius:{value:"9999px"},_disabled:{backgroundColor:{value:"{colors.background.disabled.value}"}}},thumb:{width:{value:"1.25rem"},height:{value:"1.25rem"},backgroundColor:{value:"{colors.background.primary.value}"},boxShadow:{value:"{shadows.small.value}"},borderRadius:{value:"50%"},borderWidth:{value:"{borderWidths.
|
|
1
|
+
var r={paddingBlock:{value:"{space.xs.value}"},track:{backgroundColor:{value:"{colors.background.quaternary.value}"},borderRadius:{value:"9999px"},height:{value:"0.375rem"},minWidth:{value:"10rem"}},range:{backgroundColor:{value:"{colors.brand.primary.80.value}"},borderRadius:{value:"9999px"},_disabled:{backgroundColor:{value:"{colors.background.disabled.value}"}}},thumb:{width:{value:"1.25rem"},height:{value:"1.25rem"},backgroundColor:{value:"{colors.background.primary.value}"},boxShadow:{value:"{shadows.small.value}"},borderRadius:{value:"50%"},borderWidth:{value:"{borderWidths.medium.value}"},borderColor:{value:"{colors.border.primary.value}"},borderStyle:{value:"solid"},_disabled:{backgroundColor:{value:"{colors.background.disabled.value}"},borderColor:{value:"transparent"},boxShadow:{value:"none"}},_hover:{backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"{colors.border.focus.value}"}},_focus:{borderColor:{value:"{colors.border.focus.value}"},boxShadow:{value:{offsetX:"0",offsetY:"0",blurRadius:"0",spreadRadius:"2px",color:"{colors.border.focus.value}"}}}},small:{track:{height:{value:"0.25rem"}},thumb:{width:{value:"1rem"},height:{value:"1rem"}}},large:{track:{height:{value:"0.625rem"}},thumb:{width:{value:"1.5rem"},height:{value:"1.5rem"}}}};export{r as sliderfield};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var o={borderColor:{value:"{colors.border.primary.value}"},color:{value:"{colors.
|
|
1
|
+
var o={borderColor:{value:"{colors.border.primary.value}"},color:{value:"{colors.font.primary.value}"},_hover:{backgroundColor:{value:"{colors.overlay.10.value}"}},_focus:{borderColor:{value:"{colors.border.focus.value}"},color:{value:"{colors.font.primary.value}"}},_active:{backgroundColor:{value:"{colors.transparent.value}"}},_disabled:{backgroundColor:{value:"{colors.transparent.value}"},borderColor:{value:"{colors.border.disabled.value}"},color:{value:"{colors.font.disabled.value}"}},_pressed:{borderColor:{value:"{colors.border.pressed.value}"},color:{value:"{colors.font.primary.value}"},backgroundColor:{value:"{colors.overlay.20.value}"},_hover:{backgroundColor:{value:"{colors.overlay.30.value}"}}},primary:{backgroundColor:{value:"{colors.transparent.value}"},borderWidth:{value:"{borderWidths.small.value}"},_focus:{borderColor:{value:"{colors.border.focus.value}"},backgroundColor:{value:"{colors.transparent.value}"},boxShadow:{value:"{components.fieldcontrol._focus.boxShadow.value}"},color:{value:"{colors.font.primary.value}"}},_hover:{backgroundColor:{value:"{colors.overlay.10.value}"},color:{value:"{colors.font.primary.value}"}},_disabled:{borderColor:{value:"{colors.border.disabled.value}"},backgroundColor:{value:"{colors.background.disabled.value}"},color:{value:"{colors.font.disabled.value}"}},_pressed:{backgroundColor:{value:"{colors.brand.primary.80.value}"},borderColor:{value:"{colors.brand.primary.80.value}"},color:{value:"{colors.white.value}"},_focus:{backgroundColor:{value:"{colors.border.focus.value}"},borderColor:{value:"{colors.border.focus.value}"},color:{value:"{colors.white.value}"}},_hover:{borderColor:{value:"{colors.brand.primary.60.value}"},backgroundColor:{value:"{colors.brand.primary.60.value}"},boxShadow:{value:"{colors.brand.primary.60.value}"},color:{value:"{colors.white.value}"}}}},link:{backgroundColor:{value:"{colors.transparent.value}"},color:{value:"{colors.overlay.50.value}"},_hover:{backgroundColor:{value:"{colors.transparent.value}"},color:{value:"{colors.overlay.50.value}"}},_focus:{backgroundColor:{value:"{colors.transparent.value}"},color:{value:"{colors.overlay.50.value}"}},_disabled:{backgroundColor:{value:"{colors.transparent.value}"},color:{value:"{colors.font.disabled.value}"}},_pressed:{backgroundColor:{value:"{colors.transparent.value}"},color:{value:"{colors.overlay.90.value}"},_focus:{backgroundColor:{value:"{colors.transparent.value}"},color:{value:"{colors.overlay.90.value}"}},_hover:{color:{value:"{colors.overlay.90.value}"},backgroundColor:{value:"{colors.transparent.value}"}}}}};export{o as togglebutton};
|