@webiny/app-admin-cognito 5.43.2 → 6.0.0-alpha.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/components/Divider.d.ts +2 -5
- package/components/Divider.js +14 -23
- package/components/Divider.js.map +1 -1
- package/components/FederatedProviders.js +10 -30
- package/components/FederatedProviders.js.map +1 -1
- package/components/View.d.ts +6 -19
- package/components/View.js +58 -42
- package/components/View.js.map +1 -1
- package/federatedIdentityProviders.js +1 -7
- package/federatedIdentityProviders.js.map +1 -1
- package/index.d.ts +1 -19
- package/index.js +92 -101
- package/index.js.map +1 -1
- package/package.json +12 -14
- package/types.js +1 -1
- package/views/FederatedLogin.js +17 -22
- package/views/FederatedLogin.js.map +1 -1
- package/views/ForgotPassword.js +94 -98
- package/views/ForgotPassword.js.map +1 -1
- package/views/LoggingIn.js +5 -12
- package/views/LoggingIn.js.map +1 -1
- package/views/RequireNewPassword.js +62 -71
- package/views/RequireNewPassword.js.map +1 -1
- package/views/SetNewPassword.js +61 -68
- package/views/SetNewPassword.js.map +1 -1
- package/views/SignIn.js +78 -96
- package/views/SignIn.js.map +1 -1
- package/views/SignedIn.js +7 -11
- package/views/SignedIn.js.map +1 -1
- package/components/StyledComponents.d.ts +0 -28
- package/components/StyledComponents.js +0 -105
- package/components/StyledComponents.js.map +0 -1
|
@@ -1,80 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _form = require("@webiny/form");
|
|
10
|
-
var _validation = require("@webiny/validation");
|
|
11
|
-
var _Button = require("@webiny/ui/Button");
|
|
12
|
-
var _Input = require("@webiny/ui/Input");
|
|
13
|
-
var _Grid = require("@webiny/ui/Grid");
|
|
14
|
-
var _Typography = require("@webiny/ui/Typography");
|
|
15
|
-
var _useRequireNewPassword = require("@webiny/app-cognito-authenticator/hooks/useRequireNewPassword");
|
|
16
|
-
var _View = require("../components/View");
|
|
17
|
-
var _StyledComponents = require("../components/StyledComponents");
|
|
18
|
-
var sentenceCase = function sentenceCase(str) {
|
|
19
|
-
var lower = str.toLowerCase();
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Button, Grid, Heading, Input } from "@webiny/admin-ui";
|
|
3
|
+
import { Form } from "@webiny/form";
|
|
4
|
+
import { validation } from "@webiny/validation";
|
|
5
|
+
import { useRequireNewPassword } from "@webiny/app-cognito-authenticator/hooks/useRequireNewPassword";
|
|
6
|
+
import { View } from "../components/View";
|
|
7
|
+
const sentenceCase = str => {
|
|
8
|
+
const lower = str.toLowerCase();
|
|
20
9
|
return lower[0].toUpperCase() + lower.substring(1);
|
|
21
10
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
shouldRender
|
|
25
|
-
requiredAttributes
|
|
26
|
-
confirm
|
|
11
|
+
export const RequireNewPassword = () => {
|
|
12
|
+
const {
|
|
13
|
+
shouldRender,
|
|
14
|
+
requiredAttributes,
|
|
15
|
+
confirm
|
|
16
|
+
} = useRequireNewPassword();
|
|
27
17
|
if (!shouldRender) {
|
|
28
18
|
return null;
|
|
29
19
|
}
|
|
30
|
-
return /*#__PURE__*/
|
|
31
|
-
onSubmit:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
20
|
+
return /*#__PURE__*/React.createElement(View.Container, null, /*#__PURE__*/React.createElement(Form, {
|
|
21
|
+
onSubmit: ({
|
|
22
|
+
password,
|
|
23
|
+
requiredAttributes
|
|
24
|
+
}) => confirm({
|
|
25
|
+
password,
|
|
26
|
+
requiredAttributes
|
|
27
|
+
}),
|
|
39
28
|
submitOnEnter: true
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
29
|
+
}, ({
|
|
30
|
+
Bind,
|
|
31
|
+
submit
|
|
32
|
+
}) => /*#__PURE__*/React.createElement(View.Content, null, /*#__PURE__*/React.createElement(View.Title, {
|
|
33
|
+
title: "Set new password"
|
|
34
|
+
}), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Grid.Column, {
|
|
35
|
+
span: 12
|
|
36
|
+
}, /*#__PURE__*/React.createElement(Bind, {
|
|
37
|
+
name: "password",
|
|
38
|
+
validators: validation.create("required")
|
|
39
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
40
|
+
type: "password",
|
|
41
|
+
label: "New password",
|
|
42
|
+
size: "lg",
|
|
43
|
+
autoComplete: "off"
|
|
44
|
+
}))), /*#__PURE__*/React.createElement(React.Fragment, null, requiredAttributes.length > 0 && /*#__PURE__*/React.createElement(Grid.Column, {
|
|
45
|
+
span: 12
|
|
46
|
+
}, /*#__PURE__*/React.createElement(Heading, {
|
|
47
|
+
level: 6,
|
|
48
|
+
className: "wby-text-center"
|
|
49
|
+
}, "Please enter additional information"))), /*#__PURE__*/React.createElement(React.Fragment, null, requiredAttributes.map(name => /*#__PURE__*/React.createElement(Grid.Column, {
|
|
50
|
+
key: name,
|
|
51
|
+
span: 12
|
|
52
|
+
}, /*#__PURE__*/React.createElement(Bind, {
|
|
53
|
+
name: name,
|
|
54
|
+
validators: validation.create("required")
|
|
55
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
56
|
+
label: sentenceCase(name),
|
|
57
|
+
size: "lg"
|
|
58
|
+
}))))), /*#__PURE__*/React.createElement(Grid.Column, {
|
|
59
|
+
span: 12,
|
|
60
|
+
className: "wby-text-right"
|
|
61
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
62
|
+
text: "Set password",
|
|
63
|
+
"data-testid": "submit-sign-in-form-button",
|
|
64
|
+
onClick: ev => {
|
|
65
|
+
submit(ev);
|
|
66
|
+
},
|
|
67
|
+
size: "lg"
|
|
68
|
+
}))))));
|
|
78
69
|
};
|
|
79
70
|
|
|
80
71
|
//# sourceMappingURL=RequireNewPassword.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["React","Button","Grid","Heading","Input","Form","validation","useRequireNewPassword","View","sentenceCase","str","lower","toLowerCase","toUpperCase","substring","RequireNewPassword","shouldRender","requiredAttributes","confirm","createElement","Container","onSubmit","password","submitOnEnter","Bind","submit","Content","Title","title","Column","span","name","validators","create","type","label","size","autoComplete","Fragment","length","level","className","map","key","text","onClick","ev"],"sources":["RequireNewPassword.tsx"],"sourcesContent":["import React from \"react\";\nimport { Button, Grid, Heading, Input } from \"@webiny/admin-ui\";\nimport { Form } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { useRequireNewPassword } from \"@webiny/app-cognito-authenticator/hooks/useRequireNewPassword\";\nimport { View } from \"~/components/View\";\n\nconst sentenceCase = (str: string) => {\n const lower = str.toLowerCase();\n return lower[0].toUpperCase() + lower.substring(1);\n};\n\nexport const RequireNewPassword = () => {\n const { shouldRender, requiredAttributes, confirm } = useRequireNewPassword();\n\n if (!shouldRender) {\n return null;\n }\n\n return (\n <View.Container>\n <Form\n onSubmit={({ password, requiredAttributes }) =>\n confirm({ password, requiredAttributes })\n }\n submitOnEnter\n >\n {({ Bind, submit }) => (\n <View.Content>\n <View.Title title={\"Set new password\"} />\n <Grid>\n <Grid.Column span={12}>\n <Bind name=\"password\" validators={validation.create(\"required\")}>\n <Input\n type={\"password\"}\n label={\"New password\"}\n size={\"lg\"}\n autoComplete={\"off\"}\n />\n </Bind>\n </Grid.Column>\n\n <>\n {requiredAttributes.length > 0 && (\n <Grid.Column span={12}>\n <Heading level={6} className={\"wby-text-center\"}>\n Please enter additional information\n </Heading>\n </Grid.Column>\n )}\n </>\n\n <>\n {requiredAttributes.map(name => (\n <Grid.Column key={name} span={12}>\n <Bind\n name={name}\n validators={validation.create(\"required\")}\n >\n <Input label={sentenceCase(name)} size={\"lg\"} />\n </Bind>\n </Grid.Column>\n ))}\n </>\n\n <Grid.Column span={12} className={\"wby-text-right\"}>\n <Button\n text={\"Set password\"}\n data-testid=\"submit-sign-in-form-button\"\n onClick={ev => {\n submit(ev);\n }}\n size={\"lg\"}\n />\n </Grid.Column>\n </Grid>\n </View.Content>\n )}\n </Form>\n </View.Container>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,KAAK,QAAQ,kBAAkB;AAC/D,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,qBAAqB,QAAQ,+DAA+D;AACrG,SAASC,IAAI;AAEb,MAAMC,YAAY,GAAIC,GAAW,IAAK;EAClC,MAAMC,KAAK,GAAGD,GAAG,CAACE,WAAW,CAAC,CAAC;EAC/B,OAAOD,KAAK,CAAC,CAAC,CAAC,CAACE,WAAW,CAAC,CAAC,GAAGF,KAAK,CAACG,SAAS,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,OAAO,MAAMC,kBAAkB,GAAGA,CAAA,KAAM;EACpC,MAAM;IAAEC,YAAY;IAAEC,kBAAkB;IAAEC;EAAQ,CAAC,GAAGX,qBAAqB,CAAC,CAAC;EAE7E,IAAI,CAACS,YAAY,EAAE;IACf,OAAO,IAAI;EACf;EAEA,oBACIhB,KAAA,CAAAmB,aAAA,CAACX,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,aAAA,CAACjB,IAAI,CAAC2B,MAAM;IAACc,GAAG,EAAEZ,IAAK;IAACD,IAAI,EAAE;EAAG,gBAC7B9B,KAAA,CAAAmB,aAAA,CAACK,IAAI;IACDO,IAAI,EAAEA,IAAK;IACXC,UAAU,EAAE1B,UAAU,CAAC2B,MAAM,CAAC,UAAU;EAAE,gBAE1CjC,KAAA,CAAAmB,aAAA,CAACf,KAAK;IAAC+B,KAAK,EAAE1B,YAAY,CAACsB,IAAI,CAAE;IAACK,IAAI,EAAE;EAAK,CAAE,CAC7C,CACG,CAChB,CACH,CAAC,eAEHpC,KAAA,CAAAmB,aAAA,CAACjB,IAAI,CAAC2B,MAAM;IAACC,IAAI,EAAE,EAAG;IAACW,SAAS,EAAE;EAAiB,gBAC/CzC,KAAA,CAAAmB,aAAA,CAAClB,MAAM;IACH2C,IAAI,EAAE,cAAe;IACrB,eAAY,4BAA4B;IACxCC,OAAO,EAAEC,EAAE,IAAI;MACXrB,MAAM,CAACqB,EAAE,CAAC;IACd,CAAE;IACFV,IAAI,EAAE;EAAK,CACd,CACQ,CACX,CACI,CAEhB,CACM,CAAC;AAEzB,CAAC","ignoreList":[]}
|
package/views/SetNewPassword.js
CHANGED
|
@@ -1,101 +1,94 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var _useSetNewPassword2 = require("@webiny/app-cognito-authenticator/hooks/useSetNewPassword");
|
|
19
|
-
var SetNewPassword = exports.SetNewPassword = function SetNewPassword() {
|
|
20
|
-
var _useAuthenticator = (0, _useAuthenticator2.useAuthenticator)(),
|
|
21
|
-
changeState = _useAuthenticator.changeState;
|
|
22
|
-
var _useSetNewPassword = (0, _useSetNewPassword2.useSetNewPassword)(),
|
|
23
|
-
shouldRender = _useSetNewPassword.shouldRender,
|
|
24
|
-
setPassword = _useSetNewPassword.setPassword,
|
|
25
|
-
error = _useSetNewPassword.error,
|
|
26
|
-
loading = _useSetNewPassword.loading;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Form } from "@webiny/form";
|
|
3
|
+
import { validation } from "@webiny/validation";
|
|
4
|
+
import { View } from "../components/View";
|
|
5
|
+
import { useAuthenticator } from "@webiny/app-cognito-authenticator/hooks/useAuthenticator";
|
|
6
|
+
import { useSetNewPassword } from "@webiny/app-cognito-authenticator/hooks/useSetNewPassword";
|
|
7
|
+
import { Button, Grid, Input, Link, OverlayLoader, Text } from "@webiny/admin-ui";
|
|
8
|
+
export const SetNewPassword = () => {
|
|
9
|
+
const {
|
|
10
|
+
changeState
|
|
11
|
+
} = useAuthenticator();
|
|
12
|
+
const {
|
|
13
|
+
shouldRender,
|
|
14
|
+
setPassword,
|
|
15
|
+
error,
|
|
16
|
+
loading
|
|
17
|
+
} = useSetNewPassword();
|
|
27
18
|
if (!shouldRender) {
|
|
28
19
|
return null;
|
|
29
20
|
}
|
|
30
|
-
return /*#__PURE__*/
|
|
31
|
-
onSubmit:
|
|
32
|
-
return setPassword(data);
|
|
33
|
-
},
|
|
21
|
+
return /*#__PURE__*/React.createElement(View.Container, null, /*#__PURE__*/React.createElement(Form, {
|
|
22
|
+
onSubmit: data => setPassword(data),
|
|
34
23
|
submitOnEnter: true
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
24
|
+
}, ({
|
|
25
|
+
Bind,
|
|
26
|
+
submit,
|
|
27
|
+
data
|
|
28
|
+
}) => {
|
|
29
|
+
const retypePasswordValidator = value => {
|
|
40
30
|
if (value !== data.password) {
|
|
41
31
|
throw Error("Passwords do not match!");
|
|
42
32
|
}
|
|
43
33
|
};
|
|
44
|
-
return /*#__PURE__*/
|
|
45
|
-
title: "Set
|
|
46
|
-
}),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, error)), /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
34
|
+
return /*#__PURE__*/React.createElement(View.Content, null, loading && /*#__PURE__*/React.createElement(OverlayLoader, null), /*#__PURE__*/React.createElement(View.Title, {
|
|
35
|
+
title: "Set new password"
|
|
36
|
+
}), /*#__PURE__*/React.createElement(View.Error, {
|
|
37
|
+
description: error
|
|
38
|
+
}), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Grid.Column, {
|
|
50
39
|
span: 12,
|
|
51
40
|
"data-testid": "password-reset-code"
|
|
52
|
-
}, /*#__PURE__*/
|
|
41
|
+
}, /*#__PURE__*/React.createElement(Bind, {
|
|
53
42
|
name: "code",
|
|
54
|
-
validators:
|
|
55
|
-
}, /*#__PURE__*/
|
|
43
|
+
validators: validation.create("required")
|
|
44
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
45
|
+
size: "lg",
|
|
56
46
|
autoComplete: "off",
|
|
57
47
|
label: "Password reset code",
|
|
58
|
-
outlined: true,
|
|
59
48
|
description: "Enter the code we sent to your email."
|
|
60
|
-
}))), /*#__PURE__*/
|
|
49
|
+
}))), /*#__PURE__*/React.createElement(Grid.Column, {
|
|
61
50
|
span: 12,
|
|
62
51
|
"data-testid": "new-password-input"
|
|
63
|
-
}, /*#__PURE__*/
|
|
52
|
+
}, /*#__PURE__*/React.createElement(Bind, {
|
|
64
53
|
name: "password",
|
|
65
|
-
validators:
|
|
66
|
-
}, /*#__PURE__*/
|
|
54
|
+
validators: validation.create("required")
|
|
55
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
56
|
+
size: "lg",
|
|
67
57
|
autoComplete: "off",
|
|
68
58
|
type: "password",
|
|
69
59
|
label: "New password",
|
|
70
|
-
outlined: true,
|
|
71
60
|
description: "Enter your new password."
|
|
72
|
-
}))), /*#__PURE__*/
|
|
61
|
+
}))), /*#__PURE__*/React.createElement(Grid.Column, {
|
|
73
62
|
span: 12,
|
|
74
63
|
"data-testid": "retype-password-input"
|
|
75
|
-
}, /*#__PURE__*/
|
|
64
|
+
}, /*#__PURE__*/React.createElement(Bind, {
|
|
76
65
|
name: "retypePassword",
|
|
77
|
-
validators: [
|
|
78
|
-
}, /*#__PURE__*/
|
|
66
|
+
validators: [validation.create("required"), retypePasswordValidator]
|
|
67
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
79
68
|
autoComplete: "off",
|
|
69
|
+
size: "lg",
|
|
80
70
|
type: "password",
|
|
81
71
|
label: "Retype password",
|
|
82
|
-
outlined: true,
|
|
83
72
|
description: "Enter your new password once more."
|
|
84
|
-
}))), /*#__PURE__*/
|
|
85
|
-
span: 12
|
|
86
|
-
|
|
87
|
-
|
|
73
|
+
}))), /*#__PURE__*/React.createElement(Grid.Column, {
|
|
74
|
+
span: 12
|
|
75
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
76
|
+
className: "wby-flex wby-flex-row-reverse wby-items-center wby-justify-between"
|
|
77
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
78
|
+
text: "Set new password",
|
|
88
79
|
"data-testid": "submit-btn-new-psw",
|
|
89
|
-
onClick:
|
|
80
|
+
onClick: ev => {
|
|
90
81
|
submit(ev);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
82
|
+
},
|
|
83
|
+
size: "lg"
|
|
84
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
85
|
+
as: "div",
|
|
86
|
+
size: "sm"
|
|
87
|
+
}, "Want to sign in?\xA0", /*#__PURE__*/React.createElement(Link, {
|
|
88
|
+
to: "#",
|
|
89
|
+
onClick: () => changeState("signIn")
|
|
90
|
+
}, "Sign in"), ".")))));
|
|
91
|
+
}));
|
|
99
92
|
};
|
|
100
93
|
|
|
101
94
|
//# sourceMappingURL=SetNewPassword.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["React","Form","validation","View","useAuthenticator","useSetNewPassword","Button","Grid","Input","Link","OverlayLoader","Text","SetNewPassword","changeState","shouldRender","setPassword","error","loading","createElement","Container","onSubmit","data","submitOnEnter","Bind","submit","retypePasswordValidator","value","password","Error","Content","Title","title","description","Column","span","name","validators","create","size","autoComplete","label","type","className","text","onClick","ev","as","to"],"sources":["SetNewPassword.tsx"],"sourcesContent":["import React from \"react\";\nimport { Form } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { View } from \"~/components/View\";\nimport { useAuthenticator } from \"@webiny/app-cognito-authenticator/hooks/useAuthenticator\";\nimport {\n useSetNewPassword,\n UseSetNewPasswordCallableParams\n} from \"@webiny/app-cognito-authenticator/hooks/useSetNewPassword\";\nimport { Button, Grid, Input, Link, OverlayLoader, Text } from \"@webiny/admin-ui\";\n\nexport const SetNewPassword = () => {\n const { changeState } = useAuthenticator();\n const { shouldRender, setPassword, error, loading } = useSetNewPassword();\n\n if (!shouldRender) {\n return null;\n }\n\n return (\n <View.Container>\n <Form<UseSetNewPasswordCallableParams>\n onSubmit={data => setPassword(data)}\n submitOnEnter\n >\n {({ Bind, submit, data }) => {\n const retypePasswordValidator = (value: string) => {\n if (value !== data.password) {\n throw Error(\"Passwords do not match!\");\n }\n };\n\n return (\n <View.Content>\n {loading && <OverlayLoader />}\n <View.Title title={\"Set new password\"} />\n <View.Error description={error} />\n\n <Grid>\n <Grid.Column span={12} data-testid=\"password-reset-code\">\n <Bind name=\"code\" validators={validation.create(\"required\")}>\n <Input\n size={\"lg\"}\n autoComplete=\"off\"\n label={\"Password reset code\"}\n description={\"Enter the code we sent to your email.\"}\n />\n </Bind>\n </Grid.Column>\n <Grid.Column span={12} data-testid=\"new-password-input\">\n <Bind\n name=\"password\"\n validators={validation.create(\"required\")}\n >\n <Input\n size={\"lg\"}\n autoComplete={\"off\"}\n type={\"password\"}\n label={\"New password\"}\n description={\"Enter your new password.\"}\n />\n </Bind>\n </Grid.Column>\n <Grid.Column span={12} data-testid=\"retype-password-input\">\n <Bind\n name=\"retypePassword\"\n validators={[\n validation.create(\"required\"),\n retypePasswordValidator\n ]}\n >\n <Input\n autoComplete={\"off\"}\n size={\"lg\"}\n type={\"password\"}\n label={\"Retype password\"}\n description={\"Enter your new password once more.\"}\n />\n </Bind>\n </Grid.Column>\n <Grid.Column span={12}>\n <div\n className={\n \"wby-flex wby-flex-row-reverse wby-items-center wby-justify-between\"\n }\n >\n <Button\n text={\"Set new password\"}\n data-testid=\"submit-btn-new-psw\"\n onClick={ev => {\n submit(ev);\n }}\n size={\"lg\"}\n />\n <Text as={\"div\"} size={\"sm\"}>\n Want to sign in? \n <Link to={\"#\"} onClick={() => changeState(\"signIn\")}>\n Sign in\n </Link>\n .\n </Text>\n </div>\n </Grid.Column>\n </Grid>\n </View.Content>\n );\n }}\n </Form>\n </View.Container>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,IAAI;AACb,SAASC,gBAAgB,QAAQ,0DAA0D;AAC3F,SACIC,iBAAiB,QAEd,2DAA2D;AAClE,SAASC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,aAAa,EAAEC,IAAI,QAAQ,kBAAkB;AAEjF,OAAO,MAAMC,cAAc,GAAGA,CAAA,KAAM;EAChC,MAAM;IAAEC;EAAY,CAAC,GAAGT,gBAAgB,CAAC,CAAC;EAC1C,MAAM;IAAEU,YAAY;IAAEC,WAAW;IAAEC,KAAK;IAAEC;EAAQ,CAAC,GAAGZ,iBAAiB,CAAC,CAAC;EAEzE,IAAI,CAACS,YAAY,EAAE;IACf,OAAO,IAAI;EACf;EAEA,oBACId,KAAA,CAAAkB,aAAA,CAACf,IAAI,CAACgB,SAAS,qBACX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