@aws-amplify/ui-react 2.15.6 → 2.15.7
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/components/Authenticator/ConfirmSignIn/ConfirmSignIn.js +1 -1
- package/dist/esm/components/Authenticator/ConfirmSignUp/ConfirmSignUp.js +1 -1
- package/dist/esm/components/Authenticator/ForceNewPassword/ForceNewPassword.js +1 -1
- package/dist/esm/components/Authenticator/ResetPassword/ConfirmResetPassword.js +1 -1
- package/dist/esm/components/Authenticator/ResetPassword/ResetPassword.js +1 -1
- package/dist/esm/components/Authenticator/SetupTOTP/SetupTOTP.js +1 -1
- package/dist/esm/components/Authenticator/SignIn/SignIn.js +1 -1
- package/dist/esm/components/Authenticator/SignUp/SignUp.js +1 -1
- package/dist/esm/components/Authenticator/VerifyUser/ConfirmVerifyUser.js +1 -1
- package/dist/esm/components/Authenticator/VerifyUser/VerifyUser.js +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +18 -1
- package/dist/types/components/Authenticator/SetupTOTP/SetupTOTP.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{getActorState as r,translate as n,AuthChallengeNames as i}from"@aws-amplify/ui";import{Flex as t}from"../../../primitives/Flex/Flex.js";import{Heading as s}from"../../../primitives/Heading/Heading.js";import{useAuthenticator as m}from"../hooks/useAuthenticator/index.js";import{useCustomComponents as a}from"../hooks/useCustomComponents/index.js";import{useFormHandlers as
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{getActorState as r,translate as n,AuthChallengeNames as i}from"@aws-amplify/ui";import{Flex as t}from"../../../primitives/Flex/Flex.js";import{Heading as s}from"../../../primitives/Heading/Heading.js";import{useAuthenticator as m}from"../hooks/useAuthenticator/index.js";import{useCustomComponents as a}from"../hooks/useCustomComponents/index.js";import{useFormHandlers as d}from"../hooks/useFormHandlers/useFormHandlers.js";import{FormFields as c}from"../shared/FormFields.js";import{ConfirmSignInFooter as l}from"../shared/ConfirmSignInFooter.js";import{RemoteErrorMessage as f}from"../shared/RemoteErrorMessage.js";const h=()=>{const{isPending:r}=m((e=>[e.isPending])),{handleChange:n,handleSubmit:i}=d(),{components:{ConfirmSignIn:{Header:s=h.Header,Footer:p=h.Footer}}}=a();return e("form",Object.assign({"data-amplify-form":"","data-amplify-authenticator-confirmsignin":"",method:"post",onChange:n,onSubmit:i},{children:o(t,Object.assign({as:"fieldset",direction:"column",isDisabled:r},{children:[e(s,{}),o(t,Object.assign({direction:"column"},{children:[e(c,{route:"confirmSignIn"}),e(f,{})]})),e(l,{}),e(p,{})]}))}))};h.Header=function(){const{_state:o}=m(),t=r(o),{challengeName:a}=t.context;let d;switch(a){case i.SMS_MFA:d=n("Confirm SMS Code");break;case i.SOFTWARE_TOKEN_MFA:d=n("Confirm TOTP Code");break;default:throw new Error(`${n("Unexpected challengeName encountered in ConfirmSignIn:")} ${a}`)}return e(s,Object.assign({level:3},{children:d}))},h.Footer=()=>null;export{h as ConfirmSignIn};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{translate as o}from"@aws-amplify/ui";import{Button as t}from"../../../primitives/Button/Button.js";import{Flex as r}from"../../../primitives/Flex/Flex.js";import{Heading as n}from"../../../primitives/Heading/Heading.js";import{Text as s}from"../../../primitives/Text/Text.js";import{useAuthenticator as a}from"../hooks/useAuthenticator/index.js";import{useCustomComponents as m}from"../hooks/useCustomComponents/index.js";import{useFormHandlers as d}from"../hooks/useFormHandlers/useFormHandlers.js";import{RemoteErrorMessage as l}from"../shared/RemoteErrorMessage.js";import{FormFields as c}from"../shared/FormFields.js";function u(){const{isPending:n,resendCode:p,codeDeliveryDetails:{DeliveryMedium:h,Destination:f}={}}=a((e=>[e.isPending,e.resendCode,e.codeDeliveryDetails])),{handleChange:g,handleSubmit:y}=d(),{components:{ConfirmSignUp:{Header:j=u.Header,Footer:b=u.Footer}}}=m(),v=o("Your code is on the way. To log in, enter the code we emailed to"),D=o("Your code is on the way. To log in, enter the code we texted to"),C=o("Your code is on the way. To log in, enter the code we sent you. It may take a minute to arrive."),x=o("It may take a minute to arrive."),F="EMAIL"===h?`${v} ${f}. ${x}`:"SMS"===h?`${D} ${f}. ${x}`:o(`${C}`);return e("form",Object.assign({"data-amplify-form":"","data-amplify-authenticator-confirmsignup":"",method:"post",onChange:g,onSubmit:y},{children:i(r,Object.assign({as:"fieldset",direction:"column",isDisabled:n},{children:[e(j,{}),i(r,Object.assign({direction:"column"},{children:[e(s,Object.assign({className:"amplify-authenticator__subtitle"},{children:F})),e(c,{route:"confirmSignUp"}),e(l,{}),e(t,Object.assign({variation:"primary",isDisabled:n,type:"submit",loadingText:o("Confirming"),isLoading:n,fontWeight:"normal"},{children:o("Confirm")})),e(t,Object.assign({onClick:p,type:"button",fontWeight:"normal"},{children:o("Resend Code")}))]})),e(b,{})]}))}))}u.Header=()=>{const{codeDeliveryDetails:{DeliveryMedium:i}={}}=a((e=>[e.codeDeliveryDetails])),t=o("EMAIL"===i?"We Emailed You":"SMS"===i?"We Texted You":"We Sent A Code");return e(n,Object.assign({level:4},{children:t}))},u.Footer=()=>null;export{u as ConfirmSignUp};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as i,jsxs as o}from"react/jsx-runtime";import{translate as r}from"@aws-amplify/ui";import{Button as e}from"../../../primitives/Button/Button.js";import{Flex as s}from"../../../primitives/Flex/Flex.js";import{Heading as n}from"../../../primitives/Heading/Heading.js";import{Text as t}from"../../../primitives/Text/Text.js";import{useAuthenticator as a}from"../hooks/useAuthenticator/index.js";import{useCustomComponents as m}from"../hooks/useCustomComponents/index.js";import{useFormHandlers as d}from"../hooks/useFormHandlers/useFormHandlers.js";import{FormFields as l}from"../shared/FormFields.js";const c=()=>{const{error:l,isPending:p,toSignIn:g}=a((i=>[i.error,i.isPending,i.toSignIn])),{handleBlur:h,handleChange:f,handleSubmit:u}=d(),{components:{ForceNewPassword:{FormFields:j=c.FormFields}}}=m();return i("form",Object.assign({"data-amplify-form":"","data-amplify-authenticator-forcenewpassword":"",method:"post",onChange:f,onSubmit:u,onBlur:h},{children:o(s,Object.assign({as:"fieldset",direction:"column",isDisabled:p},{children:[i(n,Object.assign({level:3},{children:r("Change Password")})),i(j,{}),l&&i(t,Object.assign({className:"forceNewPasswordErrorText",variation:"error"},{children:l})),i(e,Object.assign({isDisabled:p,type:"submit",variation:"primary",isLoading:p,loadingText:r("Changing"),fontWeight:"normal"},{children:r("Change Password")})),i(e,Object.assign({onClick:g,type:"button",fontWeight:"normal",variation:"link",size:"small"},{children:r("Back to Sign In")}))]}))}))};c.FormFields=()=>i(l,{route:"forceNewPassword"});export{c as ForceNewPassword};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{translate as r}from"@aws-amplify/ui";import{Flex as s}from"../../../primitives/Flex/Flex.js";import{Heading as t}from"../../../primitives/Heading/Heading.js";import{useAuthenticator as i}from"../hooks/useAuthenticator/index.js";import{useCustomComponents as n}from"../hooks/useCustomComponents/index.js";import{useFormHandlers as m}from"../hooks/useFormHandlers/useFormHandlers.js";import{RemoteErrorMessage as a}from"../shared/RemoteErrorMessage.js";import{TwoButtonSubmitFooter as d}from"../shared/TwoButtonSubmitFooter.js";import{FormFields as l}from"../shared/FormFields.js";const c=()=>{const{isPending:t}=i((e=>[e.isPending])),{handleBlur:
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{translate as r}from"@aws-amplify/ui";import{Flex as s}from"../../../primitives/Flex/Flex.js";import{Heading as t}from"../../../primitives/Heading/Heading.js";import{useAuthenticator as i}from"../hooks/useAuthenticator/index.js";import{useCustomComponents as n}from"../hooks/useCustomComponents/index.js";import{useFormHandlers as m}from"../hooks/useFormHandlers/useFormHandlers.js";import{RemoteErrorMessage as a}from"../shared/RemoteErrorMessage.js";import{TwoButtonSubmitFooter as d}from"../shared/TwoButtonSubmitFooter.js";import{FormFields as l}from"../shared/FormFields.js";const c=()=>{const{isPending:t}=i((e=>[e.isPending])),{handleBlur:u,handleChange:p,handleSubmit:f}=m(),{components:{ConfirmResetPassword:{Header:h=c.Header,Footer:j=c.Footer}}}=n();return e("form",Object.assign({"data-amplify-form":"","data-amplify-authenticator-confirmresetpassword":"",method:"post",onSubmit:f,onChange:p,onBlur:u},{children:o(s,Object.assign({as:"fieldset",direction:"column",isDisabled:t},{children:[e(h,{}),e(s,Object.assign({direction:"column"},{children:e(l,{route:"confirmResetPassword"})})),e(a,{}),e(d,{cancelButtonSendType:"RESEND",cancelButtonText:r("Resend Code")}),e(j,{})]}))}))};c.Header=()=>{const o=r("Reset your password");return e(t,Object.assign({level:3},{children:o}))},c.Footer=()=>null;export{c as ConfirmResetPassword};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o,Fragment as r}from"react/jsx-runtime";import{translate as t}from"@aws-amplify/ui";import{Flex as s}from"../../../primitives/Flex/Flex.js";import{Heading as i}from"../../../primitives/Heading/Heading.js";import{useAuthenticator as n}from"../hooks/useAuthenticator/index.js";import{useCustomComponents as m}from"../hooks/useCustomComponents/index.js";import{useFormHandlers as a}from"../hooks/useFormHandlers/useFormHandlers.js";import{RemoteErrorMessage as d}from"../shared/RemoteErrorMessage.js";import{TwoButtonSubmitFooter as
|
|
1
|
+
import{jsx as e,jsxs as o,Fragment as r}from"react/jsx-runtime";import{translate as t}from"@aws-amplify/ui";import{Flex as s}from"../../../primitives/Flex/Flex.js";import{Heading as i}from"../../../primitives/Heading/Heading.js";import{useAuthenticator as n}from"../hooks/useAuthenticator/index.js";import{useCustomComponents as m}from"../hooks/useCustomComponents/index.js";import{useFormHandlers as a}from"../hooks/useFormHandlers/useFormHandlers.js";import{RemoteErrorMessage as d}from"../shared/RemoteErrorMessage.js";import{TwoButtonSubmitFooter as c}from"../shared/TwoButtonSubmitFooter.js";import{FormFields as l}from"../shared/FormFields.js";const u=()=>{const{isPending:i}=n((e=>[e.isPending])),{handleChange:p,handleSubmit:h}=a(),{components:{ResetPassword:{Header:f=u.Header,Footer:g=u.Footer}}}=m();return e("form",Object.assign({"data-amplify-form":"","data-amplify-authenticator-resetpassword":"",method:"post",onChange:p,onSubmit:h},{children:o(s,Object.assign({as:"fieldset",direction:"column",isDisabled:i},{children:[e(f,{}),e(s,Object.assign({direction:"column"},{children:e(l,{route:"resetPassword"})})),e(d,{}),e(c,{cancelButtonText:t("Back to Sign In"),cancelButtonSendType:"SIGN_IN",submitButtonText:i?o(r,{children:[t("Sending"),"…"]}):e(r,{children:t("Send code")})}),e(g,{})]}))}))};u.Header=()=>e(i,Object.assign({level:3},{children:t("Reset your password")})),u.Footer=()=>null;export{u as ResetPassword};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../../node_modules/tslib/tslib.es6.js";import{jsx as t,jsxs as o}from"react/jsx-runtime";import i from"qrcode";import*as r from"react";import{Logger as s,Auth as a}from"aws-amplify";import{getActorState as n,translate as
|
|
1
|
+
import{__awaiter as e}from"../../../node_modules/tslib/tslib.es6.js";import{jsx as t,jsxs as o}from"react/jsx-runtime";import i from"qrcode";import*as r from"react";import{Logger as s,Auth as a}from"aws-amplify";import{getActorState as n,translate as d}from"@aws-amplify/ui";import{Flex as m}from"../../../primitives/Flex/Flex.js";import{Heading as l}from"../../../primitives/Heading/Heading.js";import{useAuthenticator as p}from"../hooks/useAuthenticator/index.js";import{useCustomComponents as c}from"../hooks/useCustomComponents/index.js";import{useFormHandlers as u}from"../hooks/useFormHandlers/useFormHandlers.js";import{ConfirmSignInFooter as h}from"../shared/ConfirmSignInFooter.js";import{RemoteErrorMessage as f}from"../shared/RemoteErrorMessage.js";import{FormFields as g}from"../shared/FormFields.js";const j=new s("SetupTOTP-logger"),v=(e,t,o)=>`otpauth://totp/${e}:${t}?secret=${o}&issuer=${e}`,O=()=>{var s,l;const{_state:b,isPending:y}=p((e=>[e.isPending])),{handleChange:H,handleSubmit:C}=u(),{components:{SetupTOTP:{Header:T=O.Header,Footer:w=O.Footer}}}=c(),[F,S]=r.useState(!0),[x,P]=r.useState(),[V,k]=r.useState("COPY"),[L,M]=r.useState(""),$=n(b),{formFields:q,user:D}=$.context,{totpIssuer:E="AWSCognito",totpUsername:I=D.username}=null!==(l=null===(s=null==q?void 0:q.setupTOTP)||void 0===s?void 0:s.QR)&&void 0!==l?l:{},R=r.useCallback((t=>e(void 0,void 0,void 0,(function*(){try{const e=yield a.setupTOTP(t);M(e);const o=v(E,I,e),r=yield i.toDataURL(o);P(r)}catch(e){j.error(e)}finally{S(!1)}}))),[E,I]);r.useEffect((()=>{D&&R(D)}),[R,D]);return t("form",Object.assign({"data-amplify-form":"","data-amplify-authenticator-setup-totp":"",method:"post",onChange:H,onSubmit:C},{children:o(m,Object.assign({as:"fieldset",direction:"column",isDisabled:y},{children:[t(T,{}),o(m,Object.assign({direction:"column"},{children:[F?o("p",{children:[d("Loading"),"…"]}):t("img",{"data-amplify-qrcode":!0,src:x,alt:"qr code",width:"228",height:"228"}),o(m,Object.assign({"data-amplify-copy":!0},{children:[t("div",{children:L}),o(m,Object.assign({"data-amplify-copy-svg":!0,onClick:()=>{navigator.clipboard.writeText(L),k(d("COPIED"))}},{children:[t("div",Object.assign({"data-amplify-copy-tooltip":!0},{children:V})),t("svg",Object.assign({width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},{children:t("path",{d:"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM15 5H8C6.9 5 6.01 5.9 6.01 7L6 21C6 22.1 6.89 23 7.99 23H19C20.1 23 21 22.1 21 21V11L15 5ZM8 21V7H14V12H19V21H8Z"})}))]}))]})),t(g,{route:"setupTOTP"}),t(f,{})]})),t(h,{}),t(w,{})]}))}))};O.Header=()=>t(l,Object.assign({level:3},{children:d("Setup TOTP")})),O.Footer=()=>null;export{O as SetupTOTP,v as getTotpCode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as i,jsx as
|
|
1
|
+
import{jsxs as i,jsx as o}from"react/jsx-runtime";import{translate as e,hasTranslation as r}from"@aws-amplify/ui";import{Button as n}from"../../../primitives/Button/Button.js";import{Flex as s}from"../../../primitives/Flex/Flex.js";import{View as t}from"../../../primitives/View/View.js";import{VisuallyHidden as a}from"../../../primitives/VisuallyHidden/VisuallyHidden.js";import{FederatedSignIn as m}from"../FederatedSignIn/FederatedSignIn.js";import{useAuthenticator as d}from"../hooks/useAuthenticator/index.js";import{useCustomComponents as l}from"../hooks/useCustomComponents/index.js";import{useFormHandlers as p}from"../hooks/useFormHandlers/useFormHandlers.js";import{RemoteErrorMessage as c}from"../shared/RemoteErrorMessage.js";import{FormFields as g}from"../shared/FormFields.js";function u(){const{isPending:r}=d((i=>[i.isPending])),{handleChange:h,handleSubmit:f}=p(),{components:{SignIn:{Header:j=u.Header,Footer:F=u.Footer}}}=l();return i(t,{children:[o(j,{}),i("form",Object.assign({"data-amplify-form":"","data-amplify-authenticator-signin":"",method:"post",onSubmit:f,onChange:h},{children:[o(m,{}),i(s,Object.assign({direction:"column"},{children:[i(s,Object.assign({as:"fieldset",direction:"column",isDisabled:r},{children:[o(a,{children:o("legend",{children:e("Sign in")})}),o(g,{route:"signIn"})]})),o(c,{}),o(n,Object.assign({isDisabled:r,isFullWidth:!0,type:"submit",variation:"primary",isLoading:r,loadingText:e("Signing in")},{children:e("Sign in")}))]}))]})),o(F,{})]})}u.Footer=()=>{const{toResetPassword:i}=d((i=>[i.toResetPassword])),s=r("Forgot your password? ")?e("Forgot your password? "):e("Forgot your password?");return o(t,Object.assign({"data-amplify-footer":""},{children:o(n,Object.assign({fontWeight:"normal",onClick:i,size:"small",variation:"link"},{children:s}))}))},u.Header=()=>null;export{u as SignIn};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as i,jsx as e}from"react/jsx-runtime";import{translate as r}from"@aws-amplify/ui";import{Button as o}from"../../../primitives/Button/Button.js";import{Flex as t}from"../../../primitives/Flex/Flex.js";import{View as s}from"../../../primitives/View/View.js";import{FederatedSignIn as n}from"../FederatedSignIn/FederatedSignIn.js";import{useAuthenticator as m}from"../hooks/useAuthenticator/index.js";import{useCustomComponents as a}from"../hooks/useCustomComponents/index.js";import{useFormHandlers as d}from"../hooks/useFormHandlers/useFormHandlers.js";import{RemoteErrorMessage as l}from"../shared/RemoteErrorMessage.js";import{FormFields as u}from"../shared/FormFields.js";function p(){const{hasValidationErrors:u,isPending:c}=m((i=>[i.hasValidationErrors,i.isPending])),{handleChange:h,handleBlur:f,handleSubmit:F}=d(),{components:{SignUp:{Header:g=p.Header,FormFields:j=p.FormFields,Footer:b=p.Footer}}}=a();return i(s,{children:[e(g,{}),i("form",Object.assign({"data-amplify-form":"","data-amplify-authenticator-signup":"",method:"post",onChange:h,onSubmit:F,onBlur:f},{children:[e(n,{}),i(t,Object.assign({as:"fieldset",direction:"column",isDisabled:c},{children:[i(t,Object.assign({direction:"column"},{children:[e(j,{}),e(l,{})]})),e(o,Object.assign({isDisabled:u||c,isFullWidth:!0,type:"submit",variation:"primary",isLoading:c,loadingText:r("Creating Account")},{children:r("Create Account")}))]}))]})),e(b,{})]})}p.Header=()=>null,p.FormFields=()=>e(u,{route:"signUp"}),p.Footer=()=>null;export{p as SignUp};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{translate as r}from"@aws-amplify/ui";import{Flex as i}from"../../../primitives/Flex/Flex.js";import{Heading as t}from"../../../primitives/Heading/Heading.js";import{useAuthenticator as
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{translate as r}from"@aws-amplify/ui";import{Flex as i}from"../../../primitives/Flex/Flex.js";import{Heading as t}from"../../../primitives/Heading/Heading.js";import{useAuthenticator as n}from"../hooks/useAuthenticator/index.js";import{useCustomComponents as s}from"../hooks/useCustomComponents/index.js";import{useFormHandlers as m}from"../hooks/useFormHandlers/useFormHandlers.js";import{RemoteErrorMessage as a}from"../shared/RemoteErrorMessage.js";import{TwoButtonSubmitFooter as d}from"../shared/TwoButtonSubmitFooter.js";import{FormFields as c}from"../shared/FormFields.js";const f=()=>{const{isPending:t}=n((e=>[e.isPending])),{handleChange:l,handleSubmit:u}=m(),{components:{ConfirmVerifyUser:{Header:p=f.Header,Footer:h=f.Footer}}}=s();return e("form",Object.assign({"data-amplify-form":"","data-amplify-authenticator-confirmverifyuser":"",method:"post",onChange:l,onSubmit:u},{children:o(i,Object.assign({as:"fieldset",direction:"column",isDisabled:t},{children:[e(p,{}),e(i,Object.assign({direction:"column"},{children:e(c,{route:"confirmVerifyUser"})})),e(a,{}),e(d,{cancelButtonText:r("Skip"),cancelButtonSendType:"SKIP"}),e(h,{})]}))}))};f.Header=()=>e(t,Object.assign({level:3},{children:r("Account recovery requires verified contact information")})),f.Footer=()=>null;export{f as ConfirmVerifyUser};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as i,jsxs as
|
|
1
|
+
import{jsx as e,Fragment as i,jsxs as r}from"react/jsx-runtime";import{getActorContext as t,translate as o,defaultFormFieldOptions as n,censorPhoneNumber as s,censorAllButFirstAndLast as a}from"@aws-amplify/ui";import{Flex as m}from"../../../primitives/Flex/Flex.js";import{Heading as d}from"../../../primitives/Heading/Heading.js";import{Radio as l}from"../../../primitives/Radio/Radio.js";import{RadioGroupField as c}from"../../../primitives/RadioGroupField/RadioGroupField.js";import{useAuthenticator as u}from"../hooks/useAuthenticator/index.js";import{useCustomComponents as f}from"../hooks/useCustomComponents/index.js";import{useFormHandlers as p}from"../hooks/useFormHandlers/useFormHandlers.js";import{RemoteErrorMessage as h}from"../shared/RemoteErrorMessage.js";import{TwoButtonSubmitFooter as b}from"../shared/TwoButtonSubmitFooter.js";const j=(e,i)=>{const r=o(e);let t=i;if("Phone Number"===e)t=s(i);else if("Email"===e){const e=i.split("@");t=`${a(e[0])}@${e[1]}`}return`${r}: ${t}`},g=i=>{const r=[];for(const[t,o]of Object.entries(i)){const i=e(l,Object.assign({name:"unverifiedAttr",value:t},{children:j(n[t].label,o)}),t);r.push(i)}return r},v=()=>{const{components:{VerifyUser:{Header:n=v.Header,Footer:s=v.Footer}}}=f(),{_state:a,isPending:d}=u((e=>[e.isPending])),{handleChange:l,handleSubmit:j}=p(),y=t(a),F=e(i,d?{children:"Verifying…"}:{children:o("Verify")}),x=e(c,Object.assign({label:o("Verify Contact"),labelHidden:!0,name:"verify_context",isDisabled:d},{children:g(y.unverifiedAttributes)}));return e("form",Object.assign({"data-amplify-form":"","data-amplify-authenticator-verifyuser":"",method:"post",onChange:l,onSubmit:j},{children:r(m,Object.assign({as:"fieldset",direction:"column",isDisabled:d},{children:[e(n,{}),x,e(h,{}),e(b,{cancelButtonText:o("Skip"),cancelButtonSendType:"SKIP",submitButtonText:F}),e(s,{})]}))}))};v.Header=()=>e(d,Object.assign({level:3},{children:o("Account recovery requires verified contact information")})),v.Footer=()=>null;export{v as VerifyUser};
|