@webiny/app-admin-cognito 5.29.0 → 5.30.0-beta.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-admin-cognito",
3
- "version": "5.29.0",
3
+ "version": "5.30.0-beta.0",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,16 +13,16 @@
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
15
  "@apollo/react-hooks": "3.1.5",
16
- "@aws-amplify/auth": "4.5.8",
16
+ "@aws-amplify/auth": "4.5.9",
17
17
  "@emotion/styled": "10.3.0",
18
- "@webiny/app": "5.29.0",
19
- "@webiny/app-admin": "5.29.0",
20
- "@webiny/app-cognito-authenticator": "5.29.0",
21
- "@webiny/app-security": "5.29.0",
22
- "@webiny/form": "5.29.0",
23
- "@webiny/plugins": "5.29.0",
24
- "@webiny/ui": "5.29.0",
25
- "@webiny/validation": "5.29.0",
18
+ "@webiny/app": "5.30.0-beta.0",
19
+ "@webiny/app-admin": "5.30.0-beta.0",
20
+ "@webiny/app-cognito-authenticator": "5.30.0-beta.0",
21
+ "@webiny/app-security": "5.30.0-beta.0",
22
+ "@webiny/form": "5.30.0-beta.0",
23
+ "@webiny/plugins": "5.30.0-beta.0",
24
+ "@webiny/ui": "5.30.0-beta.0",
25
+ "@webiny/validation": "5.30.0-beta.0",
26
26
  "apollo-client": "2.6.10",
27
27
  "apollo-link-context": "1.0.20",
28
28
  "emotion": "10.0.27",
@@ -37,12 +37,12 @@
37
37
  "@babel/preset-env": "^7.16.4",
38
38
  "@babel/preset-react": "^7.16.0",
39
39
  "@babel/preset-typescript": "^7.16.0",
40
- "@webiny/cli": "^5.29.0",
41
- "@webiny/project-utils": "^5.29.0",
40
+ "@webiny/cli": "^5.30.0-beta.0",
41
+ "@webiny/project-utils": "^5.30.0-beta.0",
42
42
  "babel-plugin-lodash": "^3.3.4",
43
43
  "rimraf": "^3.0.2",
44
44
  "ttypescript": "^1.5.12",
45
- "typescript": "4.5.5"
45
+ "typescript": "4.7.4"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public",
@@ -59,5 +59,5 @@
59
59
  ]
60
60
  }
61
61
  },
62
- "gitHead": "8cf3d623d56105ad5a4bacbcb4140959e11477e6"
62
+ "gitHead": "622d120f5637e3ca807b8bfc9ed2cd034ac85fb7"
63
63
  }
@@ -103,7 +103,8 @@ var ForgotPassword = function ForgotPassword() {
103
103
  }, /*#__PURE__*/React.createElement(_Button.ButtonPrimary, {
104
104
  onClick: function onClick(ev) {
105
105
  submit(ev);
106
- }
106
+ },
107
+ "data-testid": "send-code"
107
108
  }, "Send me the code")))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Grid.Grid, null, /*#__PURE__*/React.createElement(_Grid.Cell, {
108
109
  span: 12
109
110
  }, /*#__PURE__*/React.createElement(_Typography.Typography, {
@@ -1 +1 @@
1
- {"version":3,"names":["ForgotPassword","useAuthenticator","authData","changeState","useForgotPassword","loading","codeSent","shouldRender","setPassword","requestCode","error","username","Bind","submit","data","validation","create","val","cb","toLowerCase","alignRight","ev","textAlign"],"sources":["ForgotPassword.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Form } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { ButtonPrimary, ButtonDefault } from \"@webiny/ui/Button\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { Grid, Cell } from \"@webiny/ui/Grid\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { Alert } from \"@webiny/ui/Alert\";\nimport { Elevation } from \"@webiny/ui/Elevation\";\nimport StateContainer from \"./StateContainer\";\nimport { alignRight, InnerContent, Title } from \"./StyledComponents\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\nimport { useAuthenticator } from \"@webiny/app-cognito-authenticator/hooks/useAuthenticator\";\nimport { useForgotPassword } from \"@webiny/app-cognito-authenticator/hooks/useForgotPassword\";\n\nconst ForgotPassword: React.FC = () => {\n const { authData, changeState } = useAuthenticator();\n const { loading, codeSent, shouldRender, setPassword, requestCode, error } =\n useForgotPassword();\n\n if (!shouldRender) {\n return null;\n }\n\n const { username = \"\" } = authData || {};\n\n return (\n <StateContainer>\n <Form\n data={{ username }}\n onSubmit={({ username }) =>\n codeSent ? setPassword({ username }) : requestCode({ username })\n }\n submitOnEnter\n >\n {({ Bind, submit, data }) => (\n <>\n <Elevation z={2}>\n <InnerContent>\n {loading && <CircularProgress />}\n <Title>\n <h1>\n <Typography use=\"headline4\">Password Recovery</Typography>\n </h1>\n <p>\n <Typography use=\"subtitle2\">\n request a password reset code\n </Typography>\n </p>\n </Title>\n\n {error && (\n <Grid>\n <Cell span={12}>\n <Alert title={\"Something went wrong\"} type={\"danger\"}>\n {error}\n </Alert>\n </Cell>\n </Grid>\n )}\n\n {!codeSent ? (\n <>\n <Grid>\n <Cell span={12}>\n <Bind\n name=\"username\"\n validators={validation.create(\"required\")}\n beforeChange={(\n val: string,\n cb: (value: string) => void\n ) => cb(val.toLowerCase())}\n >\n <Input\n label={\"Email\"}\n description={\n \"A reset code will be sent to your email.\"\n }\n />\n </Bind>\n </Cell>\n </Grid>\n\n <Grid>\n <Cell span={12} className={alignRight}>\n <ButtonPrimary\n onClick={ev => {\n submit(ev);\n }}\n >\n {\"Send me the code\"}\n </ButtonPrimary>\n </Cell>\n </Grid>\n </>\n ) : (\n <>\n <Grid>\n <Cell span={12}>\n <Typography use=\"body1\">\n We have sent you a code to reset your password!\n <br />\n <br />\n Click the &quot;Resend code&quot; button below\n to resend the code in case you haven&apos;t\n received it the first time.\n </Typography>\n </Cell>\n </Grid>\n <Grid>\n <Cell span={12} className={alignRight}>\n <ButtonDefault\n onClick={() => {\n requestCode({ username: data.username });\n }}\n >\n {\"Resend code\"}\n </ButtonDefault>\n <ButtonPrimary\n onClick={ev => {\n submit(ev);\n }}\n >\n I got the code!\n </ButtonPrimary>\n </Cell>\n </Grid>\n </>\n )}\n </InnerContent>\n </Elevation>\n <Grid>\n <Cell span={12} style={{ textAlign: \"center\" }}>\n Want to sign in? {/* eslint-disable-next-line */}\n <a href={\"#\"} onClick={() => changeState(\"signIn\")}>\n Sign in\n </a>\n </Cell>\n </Grid>\n </>\n )}\n </Form>\n </StateContainer>\n );\n};\n\nexport default ForgotPassword;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA,IAAMA,cAAwB,GAAG,SAA3BA,cAA2B,GAAM;EACnC,wBAAkC,IAAAC,mCAAA,GAAlC;EAAA,IAAQC,QAAR,qBAAQA,QAAR;EAAA,IAAkBC,WAAlB,qBAAkBA,WAAlB;;EACA,yBACI,IAAAC,qCAAA,GADJ;EAAA,IAAQC,OAAR,sBAAQA,OAAR;EAAA,IAAiBC,QAAjB,sBAAiBA,QAAjB;EAAA,IAA2BC,YAA3B,sBAA2BA,YAA3B;EAAA,IAAyCC,WAAzC,sBAAyCA,WAAzC;EAAA,IAAsDC,WAAtD,sBAAsDA,WAAtD;EAAA,IAAmEC,KAAnE,sBAAmEA,KAAnE;;EAGA,IAAI,CAACH,YAAL,EAAmB;IACf,OAAO,IAAP;EACH;;EAED,WAA0BL,QAAQ,IAAI,EAAtC;EAAA,yBAAQS,QAAR;EAAA,IAAQA,QAAR,8BAAmB,EAAnB;;EAEA,oBACI,oBAAC,uBAAD,qBACI,oBAAC,UAAD;IACI,IAAI,EAAE;MAAEA,QAAQ,EAARA;IAAF,CADV;IAEI,QAAQ,EAAE;MAAA,IAAGA,QAAH,SAAGA,QAAH;MAAA,OACNL,QAAQ,GAAGE,WAAW,CAAC;QAAEG,QAAQ,EAARA;MAAF,CAAD,CAAd,GAA+BF,WAAW,CAAC;QAAEE,QAAQ,EAARA;MAAF,CAAD,CAD5C;IAAA,CAFd;IAKI,aAAa;EALjB,GAOK;IA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AE;IAAZ,gBACI,oBAAC,sBAAD;MAAY,GAAG,EAAC;IAAhB,mEAEI,+BAFJ,eAGI,+BAHJ,8GADJ,CADJ,CADJ,eAaI,oBAAC,UAAD,qBACI,oBAAC,UAAD;MAAM,IAAI,EAAE,EAAZ;MAAgB,SAAS,EAAED;IAA3B,gBACI,oBAAC,qBAAD;MACI,OAAO,EAAE,mBAAM;QACXX,WAAW,CAAC;UAAEE,QAAQ,EAAEG,IAAI,CAACH;QAAjB,CAAD,CAAX;MACH;IAHL,GAKK,aALL,CADJ,eAQI,oBAAC,qBAAD;MACI,OAAO,EAAE,iBAAAU,EAAE,EAAI;QACXR,MAAM,CAACQ,EAAD,CAAN;MACH;IAHL,qBARJ,CADJ,CAbJ,CA1DR,CADJ,CADJ,eA+FI,oBAAC,UAAD,qBACI,oBAAC,UAAD;MAAM,IAAI,EAAE,EAAZ;MAAgB,KAAK,EAAE;QAAEC,SAAS,EAAE;MAAb;IAAvB,qCAEI;MAAG,IAAI,EAAE,GAAT;MAAc,OAAO,EAAE;QAAA,OAAMnB,WAAW,CAAC,QAAD,CAAjB;MAAA;IAAvB,aAFJ,CADJ,CA/FJ,CADH;EAAA,CAPL,CADJ,CADJ;AAsHH,CAjID;;eAmIeH,c"}
1
+ {"version":3,"names":["ForgotPassword","useAuthenticator","authData","changeState","useForgotPassword","loading","codeSent","shouldRender","setPassword","requestCode","error","username","Bind","submit","data","validation","create","val","cb","toLowerCase","alignRight","ev","textAlign"],"sources":["ForgotPassword.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Form } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { ButtonPrimary, ButtonDefault } from \"@webiny/ui/Button\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { Grid, Cell } from \"@webiny/ui/Grid\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { Alert } from \"@webiny/ui/Alert\";\nimport { Elevation } from \"@webiny/ui/Elevation\";\nimport StateContainer from \"./StateContainer\";\nimport { alignRight, InnerContent, Title } from \"./StyledComponents\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\nimport { useAuthenticator } from \"@webiny/app-cognito-authenticator/hooks/useAuthenticator\";\nimport { useForgotPassword } from \"@webiny/app-cognito-authenticator/hooks/useForgotPassword\";\n\nconst ForgotPassword: React.FC = () => {\n const { authData, changeState } = useAuthenticator();\n const { loading, codeSent, shouldRender, setPassword, requestCode, error } =\n useForgotPassword();\n\n if (!shouldRender) {\n return null;\n }\n\n const { username = \"\" } = authData || {};\n\n return (\n <StateContainer>\n <Form\n data={{ username }}\n onSubmit={({ username }) =>\n codeSent ? setPassword({ username }) : requestCode({ username })\n }\n submitOnEnter\n >\n {({ Bind, submit, data }) => (\n <>\n <Elevation z={2}>\n <InnerContent>\n {loading && <CircularProgress />}\n <Title>\n <h1>\n <Typography use=\"headline4\">Password Recovery</Typography>\n </h1>\n <p>\n <Typography use=\"subtitle2\">\n request a password reset code\n </Typography>\n </p>\n </Title>\n\n {error && (\n <Grid>\n <Cell span={12}>\n <Alert title={\"Something went wrong\"} type={\"danger\"}>\n {error}\n </Alert>\n </Cell>\n </Grid>\n )}\n\n {!codeSent ? (\n <>\n <Grid>\n <Cell span={12}>\n <Bind\n name=\"username\"\n validators={validation.create(\"required\")}\n beforeChange={(\n val: string,\n cb: (value: string) => void\n ) => cb(val.toLowerCase())}\n >\n <Input\n label={\"Email\"}\n description={\n \"A reset code will be sent to your email.\"\n }\n />\n </Bind>\n </Cell>\n </Grid>\n\n <Grid>\n <Cell span={12} className={alignRight}>\n <ButtonPrimary\n onClick={ev => {\n submit(ev);\n }}\n data-testid=\"send-code\"\n >\n {\"Send me the code\"}\n </ButtonPrimary>\n </Cell>\n </Grid>\n </>\n ) : (\n <>\n <Grid>\n <Cell span={12}>\n <Typography use=\"body1\">\n We have sent you a code to reset your password!\n <br />\n <br />\n Click the &quot;Resend code&quot; button below\n to resend the code in case you haven&apos;t\n received it the first time.\n </Typography>\n </Cell>\n </Grid>\n <Grid>\n <Cell span={12} className={alignRight}>\n <ButtonDefault\n onClick={() => {\n requestCode({ username: data.username });\n }}\n >\n {\"Resend code\"}\n </ButtonDefault>\n <ButtonPrimary\n onClick={ev => {\n submit(ev);\n }}\n >\n I got the code!\n </ButtonPrimary>\n </Cell>\n </Grid>\n </>\n )}\n </InnerContent>\n </Elevation>\n <Grid>\n <Cell span={12} style={{ textAlign: \"center\" }}>\n Want to sign in? {/* eslint-disable-next-line */}\n <a href={\"#\"} onClick={() => changeState(\"signIn\")}>\n Sign in\n </a>\n </Cell>\n </Grid>\n </>\n )}\n </Form>\n </StateContainer>\n );\n};\n\nexport default ForgotPassword;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA,IAAMA,cAAwB,GAAG,SAA3BA,cAA2B,GAAM;EACnC,wBAAkC,IAAAC,mCAAA,GAAlC;EAAA,IAAQC,QAAR,qBAAQA,QAAR;EAAA,IAAkBC,WAAlB,qBAAkBA,WAAlB;;EACA,yBACI,IAAAC,qCAAA,GADJ;EAAA,IAAQC,OAAR,sBAAQA,OAAR;EAAA,IAAiBC,QAAjB,sBAAiBA,QAAjB;EAAA,IAA2BC,YAA3B,sBAA2BA,YAA3B;EAAA,IAAyCC,WAAzC,sBAAyCA,WAAzC;EAAA,IAAsDC,WAAtD,sBAAsDA,WAAtD;EAAA,IAAmEC,KAAnE,sBAAmEA,KAAnE;;EAGA,IAAI,CAACH,YAAL,EAAmB;IACf,OAAO,IAAP;EACH;;EAED,WAA0BL,QAAQ,IAAI,EAAtC;EAAA,yBAAQS,QAAR;EAAA,IAAQA,QAAR,8BAAmB,EAAnB;;EAEA,oBACI,oBAAC,uBAAD,qBACI,oBAAC,UAAD;IACI,IAAI,EAAE;MAAEA,QAAQ,EAARA;IAAF,CADV;IAEI,QAAQ,EAAE;MAAA,IAAGA,QAAH,SAAGA,QAAH;MAAA,OACNL,Q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E,iBAAAC,EAAE,EAAI;QACXR,MAAM,CAACQ,EAAD,CAAN;MACH,CAHL;MAII,eAAY;IAJhB,GAMK,kBANL,CADJ,CADJ,CArBJ,CADH,gBAoCG,uDACI,oBAAC,UAAD,qBACI,oBAAC,UAAD;MAAM,IAAI,EAAE;IAAZ,gBACI,oBAAC,sBAAD;MAAY,GAAG,EAAC;IAAhB,mEAEI,+BAFJ,eAGI,+BAHJ,8GADJ,CADJ,CADJ,eAaI,oBAAC,UAAD,qBACI,oBAAC,UAAD;MAAM,IAAI,EAAE,EAAZ;MAAgB,SAAS,EAAED;IAA3B,gBACI,oBAAC,qBAAD;MACI,OAAO,EAAE,mBAAM;QACXX,WAAW,CAAC;UAAEE,QAAQ,EAAEG,IAAI,CAACH;QAAjB,CAAD,CAAX;MACH;IAHL,GAKK,aALL,CADJ,eAQI,oBAAC,qBAAD;MACI,OAAO,EAAE,iBAAAU,EAAE,EAAI;QACXR,MAAM,CAACQ,EAAD,CAAN;MACH;IAHL,qBARJ,CADJ,CAbJ,CA3DR,CADJ,CADJ,eAgGI,oBAAC,UAAD,qBACI,oBAAC,UAAD;MAAM,IAAI,EAAE,EAAZ;MAAgB,KAAK,EAAE;QAAEC,SAAS,EAAE;MAAb;IAAvB,qCAEI;MAAG,IAAI,EAAE,GAAT;MAAc,OAAO,EAAE;QAAA,OAAMnB,WAAW,CAAC,QAAD,CAAjB;MAAA;IAAvB,aAFJ,CADJ,CAhGJ,CADH;EAAA,CAPL,CADJ,CADJ;AAuHH,CAlID;;eAoIeH,c"}
@@ -87,6 +87,7 @@ var RequireNewPassword = function RequireNewPassword() {
87
87
  span: 12,
88
88
  className: _StyledComponents.alignRight
89
89
  }, /*#__PURE__*/_react.default.createElement(_Button.ButtonPrimary, {
90
+ "data-testid": "submit-sign-in-form-button",
90
91
  onClick: function onClick(ev) {
91
92
  submit(ev);
92
93
  }
@@ -1 +1 @@
1
- {"version":3,"names":["sentenceCase","str","lower","toLowerCase","toUpperCase","substring","RequireNewPassword","useRequireNewPassword","shouldRender","requiredAttributes","confirm","password","Bind","submit","validation","create","length","map","name","alignRight","ev"],"sources":["RequireNewPassword.tsx"],"sourcesContent":["import React from \"react\";\nimport { Form } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { ButtonPrimary } from \"@webiny/ui/Button\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { Grid, Cell } from \"@webiny/ui/Grid\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { Elevation } from \"@webiny/ui/Elevation\";\nimport { useRequireNewPassword } from \"@webiny/app-cognito-authenticator/hooks/useRequireNewPassword\";\nimport StateContainer from \"./StateContainer\";\nimport { alignRight, InnerContent, Title } from \"./StyledComponents\";\n\nconst sentenceCase = (str: string) => {\n const lower = str.toLowerCase();\n return lower[0].toUpperCase() + lower.substring(1);\n};\n\nconst RequireNewPassword: React.FC = () => {\n const { shouldRender, requiredAttributes, confirm } = useRequireNewPassword();\n\n if (!shouldRender) {\n return null;\n }\n\n return (\n <StateContainer>\n <Form\n onSubmit={({ password, requiredAttributes }) =>\n confirm({ password, requiredAttributes })\n }\n submitOnEnter\n >\n {({ Bind, submit }) => (\n <Elevation z={2}>\n <InnerContent>\n <Title>\n <Typography use=\"headline4\">Set New Password</Typography>\n </Title>\n\n <Grid>\n <Cell span={12}>\n <Bind\n name=\"password\"\n validators={validation.create(\"required\")}\n >\n <Input\n type={\"password\"}\n label={\"New password\"}\n outlined={true}\n />\n </Bind>\n </Cell>\n </Grid>\n {requiredAttributes.length > 0 && (\n <Title>\n <Typography use=\"headline6\">\n Please enter additional information\n </Typography>\n </Title>\n )}\n <Grid>\n {requiredAttributes.map(name => (\n <Cell key={name} span={12}>\n <Bind\n name={name}\n validators={validation.create(\"required\")}\n >\n <Input label={sentenceCase(name)} outlined={true} />\n </Bind>\n </Cell>\n ))}\n </Grid>\n\n <Grid>\n <Cell span={12} className={alignRight}>\n <ButtonPrimary\n onClick={ev => {\n submit(ev);\n }}\n >\n {\"Set password\"}\n </ButtonPrimary>\n </Cell>\n </Grid>\n </InnerContent>\n </Elevation>\n )}\n </Form>\n </StateContainer>\n );\n};\n\nexport default RequireNewPassword;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA,IAAMA,YAAY,GAAG,SAAfA,YAAe,CAACC,GAAD,EAAiB;EAClC,IAAMC,KAAK,GAAGD,GAAG,CAACE,WAAJ,EAAd;EACA,OAAOD,KAAK,CAAC,CAAD,CAAL,CAASE,WAAT,KAAyBF,KAAK,CAACG,SAAN,CAAgB,CAAhB,CAAhC;AACH,CAHD;;AAKA,IAAMC,kBAA4B,GAAG,SAA/BA,kBAA+B,GAAM;EACvC,4BAAsD,IAAAC,4CAAA,GAAtD;EAAA,IAAQC,YAAR,yBAAQA,YAAR;EAAA,IAAsBC,kBAAtB,yBAAsBA,kBAAtB;EAAA,IAA0CC,OAA1C,yBAA0CA,OAA1C;;EAEA,IAAI,CAACF,YAAL,EAAmB;IACf,OAAO,IAAP;EACH;;EAED,oBACI,6BAAC,uBAAD,qBACI,6BAAC,UAAD;IACI,QAAQ,EAAE;MAAA,IAAGG,QAAH,QAAGA,QAAH;MAAA,IAAaF,kBAAb,QAAaA,kBAAb;MAAA,OACNC,OAAO,CAAC;QAAEC,QAAQ,EAARA,QAAF;QAAYF,kBAAkB,EAAlBA;MAAZ,CAAD,CADD;IAAA,CADd;IAII,aAAa;EAJjB,GAMK;IAAA,IAAGG,IAAH,SAAGA,IAAH;IAAA,IAASC,MAAT,SAASA,MAAT;IAAA,oBACG,6BAAC,oBAAD;MAAW,CAAC,EAAE;IAAd,gBACI,6BAAC,8BAAD,qBACI,6BAAC,uBAAD,qBACI,6BAAC,sBAAD;MAAY,GAAG,EAAC;IAAhB,sBADJ,CADJ,eAKI,6BAAC,UAAD,qBACI,6BAAC,UAAD;MAAM,IAAI,EAAE;IAAZ,gBACI,6BAAC,IAAD;MACI,IAAI,EAAC,UADT;MAEI,UAAU,EAAEC,sBAAA,CAAWC,MAAX,CAAkB,UAAlB;IAFhB,gBAII,6BAAC,YAAD;MACI,IAAI,EAAE,UADV;MAEI,KAAK,EAAE,cAFX;MAGI,QAAQ,EAAE;IAHd,EAJJ,CADJ,CADJ,CALJ,EAmBKN,kBAAkB,CAACO,MAAnB,GAA4B,CAA5B,iBACG,6BAAC,uBAAD,qBACI,6BAAC,sBAAD;MAAY,GAAG,EAAC;IAAhB,yCADJ,CApBR,eA0BI,6BAAC,UAAD,QACKP,kBAAkB,CAACQ,GAAnB,CAAuB,UAAAC,IAAI;MAAA,oBACxB,6BAAC,UAAD;QAAM,GAAG,EAAEA,IAAX;QAAiB,IAAI,EAAE;MAAvB,gBACI,6BAAC,IAAD;QACI,IAAI,EAAEA,IADV;QAEI,UAAU,EAAEJ,sBAAA,CAAWC,MAAX,CAAkB,UAAlB;MAFhB,gBAII,6BAAC,YAAD;QAAO,KAAK,EAAEf,YAAY,CAACkB,IAAD,CAA1B;QAAkC,QAAQ,EAAE;MAA5C,EAJJ,CADJ,CADwB;IAAA,CAA3B,CADL,CA1BJ,eAuCI,6BAAC,UAAD,qBACI,6BAAC,UAAD;MAAM,IAAI,EAAE,EAAZ;MAAgB,SAAS,EAAEC;IAA3B,gBACI,6BAAC,qBAAD;MACI,OAAO,EAAE,iBAAAC,EAAE,EAAI;QACXP,MAAM,CAACO,EAAD,CAAN;MACH;IAHL,GAKK,cALL,CADJ,CADJ,CAvCJ,CADJ,CADH;EAAA,CANL,CADJ,CADJ;AAkEH,CAzED;;eA2Eed,kB"}
1
+ {"version":3,"names":["sentenceCase","str","lower","toLowerCase","toUpperCase","substring","RequireNewPassword","useRequireNewPassword","shouldRender","requiredAttributes","confirm","password","Bind","submit","validation","create","length","map","name","alignRight","ev"],"sources":["RequireNewPassword.tsx"],"sourcesContent":["import React from \"react\";\nimport { Form } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { ButtonPrimary } from \"@webiny/ui/Button\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { Grid, Cell } from \"@webiny/ui/Grid\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { Elevation } from \"@webiny/ui/Elevation\";\nimport { useRequireNewPassword } from \"@webiny/app-cognito-authenticator/hooks/useRequireNewPassword\";\nimport StateContainer from \"./StateContainer\";\nimport { alignRight, InnerContent, Title } from \"./StyledComponents\";\n\nconst sentenceCase = (str: string) => {\n const lower = str.toLowerCase();\n return lower[0].toUpperCase() + lower.substring(1);\n};\n\nconst RequireNewPassword: React.FC = () => {\n const { shouldRender, requiredAttributes, confirm } = useRequireNewPassword();\n\n if (!shouldRender) {\n return null;\n }\n\n return (\n <StateContainer>\n <Form\n onSubmit={({ password, requiredAttributes }) =>\n confirm({ password, requiredAttributes })\n }\n submitOnEnter\n >\n {({ Bind, submit }) => (\n <Elevation z={2}>\n <InnerContent>\n <Title>\n <Typography use=\"headline4\">Set New Password</Typography>\n </Title>\n\n <Grid>\n <Cell span={12}>\n <Bind\n name=\"password\"\n validators={validation.create(\"required\")}\n >\n <Input\n type={\"password\"}\n label={\"New password\"}\n outlined={true}\n />\n </Bind>\n </Cell>\n </Grid>\n {requiredAttributes.length > 0 && (\n <Title>\n <Typography use=\"headline6\">\n Please enter additional information\n </Typography>\n </Title>\n )}\n <Grid>\n {requiredAttributes.map(name => (\n <Cell key={name} span={12}>\n <Bind\n name={name}\n validators={validation.create(\"required\")}\n >\n <Input label={sentenceCase(name)} outlined={true} />\n </Bind>\n </Cell>\n ))}\n </Grid>\n\n <Grid>\n <Cell span={12} className={alignRight}>\n <ButtonPrimary\n data-testid=\"submit-sign-in-form-button\"\n onClick={ev => {\n submit(ev);\n }}\n >\n {\"Set password\"}\n </ButtonPrimary>\n </Cell>\n </Grid>\n </InnerContent>\n </Elevation>\n )}\n </Form>\n </StateContainer>\n );\n};\n\nexport default RequireNewPassword;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;A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