@webiny/cognito 6.3.0 → 6.4.0-beta.1

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.
Files changed (148) hide show
  1. package/Cognito.js +23 -24
  2. package/Cognito.js.map +1 -1
  3. package/admin/Cognito.js +35 -41
  4. package/admin/Cognito.js.map +1 -1
  5. package/admin/CognitoLogin.js +8 -13
  6. package/admin/CognitoLogin.js.map +1 -1
  7. package/admin/Extension.js +17 -16
  8. package/admin/Extension.js.map +1 -1
  9. package/admin/SecurityPermission.js +11 -14
  10. package/admin/SecurityPermission.js.map +1 -1
  11. package/admin/domain/permissionsSchema.js +14 -9
  12. package/admin/domain/permissionsSchema.js.map +1 -1
  13. package/admin/features/permissions/abstractions.js +2 -1
  14. package/admin/features/permissions/abstractions.js.map +1 -1
  15. package/admin/features/permissions/feature.js +2 -1
  16. package/admin/features/permissions/feature.js.map +1 -1
  17. package/admin/federatedIdentityProviders.js +7 -6
  18. package/admin/federatedIdentityProviders.js.map +1 -1
  19. package/admin/presentation/Cognito/CognitoLoginScreen.js +39 -42
  20. package/admin/presentation/Cognito/CognitoLoginScreen.js.map +1 -1
  21. package/admin/presentation/Cognito/CognitoPresenter.js +250 -275
  22. package/admin/presentation/Cognito/CognitoPresenter.js.map +1 -1
  23. package/admin/presentation/Cognito/abstractions.js +2 -1
  24. package/admin/presentation/Cognito/abstractions.js.map +1 -1
  25. package/admin/presentation/Cognito/components/Divider.js +12 -13
  26. package/admin/presentation/Cognito/components/Divider.js.map +1 -1
  27. package/admin/presentation/Cognito/components/FederatedLogin.js +24 -29
  28. package/admin/presentation/Cognito/components/FederatedLogin.js.map +1 -1
  29. package/admin/presentation/Cognito/components/FederatedProviders.js +7 -10
  30. package/admin/presentation/Cognito/components/FederatedProviders.js.map +1 -1
  31. package/admin/presentation/Cognito/components/FooterSignIn.js +9 -12
  32. package/admin/presentation/Cognito/components/FooterSignIn.js.map +1 -1
  33. package/admin/presentation/Cognito/components/PasswordResetCodeSent.js +33 -37
  34. package/admin/presentation/Cognito/components/PasswordResetCodeSent.js.map +1 -1
  35. package/admin/presentation/Cognito/components/RequestPasswordResetCode.js +35 -39
  36. package/admin/presentation/Cognito/components/RequestPasswordResetCode.js.map +1 -1
  37. package/admin/presentation/Cognito/components/RequireNewPassword.js +44 -48
  38. package/admin/presentation/Cognito/components/RequireNewPassword.js.map +1 -1
  39. package/admin/presentation/Cognito/components/SetNewPassword.js +70 -71
  40. package/admin/presentation/Cognito/components/SetNewPassword.js.map +1 -1
  41. package/admin/presentation/Cognito/components/SignIn.js +52 -59
  42. package/admin/presentation/Cognito/components/SignIn.js.map +1 -1
  43. package/admin/presentation/Cognito/components/View.js +41 -60
  44. package/admin/presentation/Cognito/components/View.js.map +1 -1
  45. package/admin/presentation/Cognito/feature.js +12 -11
  46. package/admin/presentation/Cognito/feature.js.map +1 -1
  47. package/admin/presentation/shared/createPasswordValidator.js +13 -24
  48. package/admin/presentation/shared/createPasswordValidator.js.map +1 -1
  49. package/admin/presentation/shared/usePasswordValidator.js +11 -10
  50. package/admin/presentation/shared/usePasswordValidator.js.map +1 -1
  51. package/admin/presentation/userMenu/AccountDetails.js +15 -18
  52. package/admin/presentation/userMenu/AccountDetails.js.map +1 -1
  53. package/admin/presentation/userMenu/useIsDefaultTenant.js +5 -11
  54. package/admin/presentation/userMenu/useIsDefaultTenant.js.map +1 -1
  55. package/admin/routes.js +16 -17
  56. package/admin/routes.js.map +1 -1
  57. package/admin/ui/UserItem.js +0 -3
  58. package/admin/ui/components/AvatarImage/AvatarImage.js +25 -37
  59. package/admin/ui/components/AvatarImage/AvatarImage.js.map +1 -1
  60. package/admin/ui/components/AvatarImage/AvatarImagePreview.js +49 -51
  61. package/admin/ui/components/AvatarImage/AvatarImagePreview.js.map +1 -1
  62. package/admin/ui/components/AvatarImage/AvatarImageTrigger.js +25 -26
  63. package/admin/ui/components/AvatarImage/AvatarImageTrigger.js.map +1 -1
  64. package/admin/ui/components/AvatarImage/index.js +0 -2
  65. package/admin/ui/views/Account/Account.js +117 -130
  66. package/admin/ui/views/Account/Account.js.map +1 -1
  67. package/admin/ui/views/Account/graphql.js +5 -4
  68. package/admin/ui/views/Account/graphql.js.map +1 -1
  69. package/admin/ui/views/Account/index.js +0 -2
  70. package/admin/ui/views/Users/UsersDataList.js +146 -159
  71. package/admin/ui/views/Users/UsersDataList.js.map +1 -1
  72. package/admin/ui/views/Users/UsersForm.js +151 -162
  73. package/admin/ui/views/Users/UsersForm.js.map +1 -1
  74. package/admin/ui/views/Users/UsersView.js +9 -9
  75. package/admin/ui/views/Users/UsersView.js.map +1 -1
  76. package/admin/ui/views/Users/components/DeleteAction.js +23 -30
  77. package/admin/ui/views/Users/components/DeleteAction.js.map +1 -1
  78. package/admin/ui/views/Users/graphql.js +9 -10
  79. package/admin/ui/views/Users/graphql.js.map +1 -1
  80. package/admin/ui/views/Users/hooks/useUserForm.js +104 -114
  81. package/admin/ui/views/Users/hooks/useUserForm.js.map +1 -1
  82. package/admin/ui/views/Users/search.js +21 -0
  83. package/admin/ui/views/Users/search.js.map +1 -0
  84. package/admin/ui/views/utils.js +9 -7
  85. package/admin/ui/views/utils.js.map +1 -1
  86. package/api/CognitoApiFeature.js +15 -17
  87. package/api/CognitoApiFeature.js.map +1 -1
  88. package/api/domain/Username.js +5 -4
  89. package/api/domain/Username.js.map +1 -1
  90. package/api/domain/errors.js +37 -56
  91. package/api/domain/errors.js.map +1 -1
  92. package/api/features/CognitoIdp/CognitoIdentityProvider.js +49 -51
  93. package/api/features/CognitoIdp/CognitoIdentityProvider.js.map +1 -1
  94. package/api/features/CognitoIdp/abstractions.js +2 -1
  95. package/api/features/CognitoIdp/abstractions.js.map +1 -1
  96. package/api/features/CognitoIdp/feature.js +6 -5
  97. package/api/features/CognitoIdp/feature.js.map +1 -1
  98. package/api/features/CognitoIdp/index.js +0 -2
  99. package/api/features/CognitoService/CognitoService.js +93 -83
  100. package/api/features/CognitoService/CognitoService.js.map +1 -1
  101. package/api/features/CognitoService/abstractions.js +3 -5
  102. package/api/features/CognitoService/abstractions.js.map +1 -1
  103. package/api/features/CognitoService/feature.js +7 -6
  104. package/api/features/CognitoService/feature.js.map +1 -1
  105. package/api/features/CognitoService/index.js +0 -2
  106. package/api/features/CreateUser/CreateUserUseCase.js +62 -88
  107. package/api/features/CreateUser/CreateUserUseCase.js.map +1 -1
  108. package/api/features/CreateUser/abstractions.js +2 -1
  109. package/api/features/CreateUser/abstractions.js.map +1 -1
  110. package/api/features/CreateUser/feature.js +6 -5
  111. package/api/features/CreateUser/feature.js.map +1 -1
  112. package/api/features/CreateUser/index.js +0 -2
  113. package/api/features/CreateUser/schema.js +14 -13
  114. package/api/features/CreateUser/schema.js.map +1 -1
  115. package/api/features/DeleteUser/DeleteUserUseCase.js +34 -41
  116. package/api/features/DeleteUser/DeleteUserUseCase.js.map +1 -1
  117. package/api/features/DeleteUser/abstractions.js +2 -1
  118. package/api/features/DeleteUser/abstractions.js.map +1 -1
  119. package/api/features/DeleteUser/feature.js +6 -5
  120. package/api/features/DeleteUser/feature.js.map +1 -1
  121. package/api/features/DeleteUser/index.js +0 -2
  122. package/api/features/UpdateUser/UpdateUserUseCase.js +49 -71
  123. package/api/features/UpdateUser/UpdateUserUseCase.js.map +1 -1
  124. package/api/features/UpdateUser/abstractions.js +2 -1
  125. package/api/features/UpdateUser/abstractions.js.map +1 -1
  126. package/api/features/UpdateUser/feature.js +6 -5
  127. package/api/features/UpdateUser/feature.js.map +1 -1
  128. package/api/features/UpdateUser/index.js +0 -2
  129. package/api/features/UpdateUser/schema.js +13 -12
  130. package/api/features/UpdateUser/schema.js.map +1 -1
  131. package/api/features/UserInstaller/UserInstaller.js +36 -36
  132. package/api/features/UserInstaller/UserInstaller.js.map +1 -1
  133. package/api/features/UserInstaller/feature.js +6 -5
  134. package/api/features/UserInstaller/feature.js.map +1 -1
  135. package/api/graphql/user.gql.js +83 -107
  136. package/api/graphql/user.gql.js.map +1 -1
  137. package/index.js +0 -2
  138. package/package.json +23 -24
  139. package/static/svg/search.43fa797c.svg +20 -0
  140. package/admin/ui/UserItem.js.map +0 -1
  141. package/admin/ui/components/AvatarImage/index.js.map +0 -1
  142. package/admin/ui/views/Account/index.js.map +0 -1
  143. package/api/features/CognitoIdp/index.js.map +0 -1
  144. package/api/features/CognitoService/index.js.map +0 -1
  145. package/api/features/CreateUser/index.js.map +0 -1
  146. package/api/features/DeleteUser/index.js.map +0 -1
  147. package/api/features/UpdateUser/index.js.map +0 -1
  148. package/index.js.map +0 -1
@@ -1,79 +1,78 @@
1
- import React from "react";
2
- import { Button, Grid, Input, Alert } from "@webiny/admin-ui";
3
- import { Form, Bind, useForm } from "@webiny/form";
1
+ import react from "react";
2
+ import { Alert, Button, Grid, Input } from "@webiny/admin-ui";
3
+ import { Bind, Form, useForm } from "@webiny/form";
4
4
  import { validation } from "@webiny/validation";
5
5
  import { View } from "./View.js";
6
6
  import { FooterSignIn } from "./FooterSignIn.js";
7
7
  import { usePasswordValidator } from "../../shared/usePasswordValidator.js";
8
- export const SetNewPassword = props => {
9
- const {
10
- vm,
11
- onSetNewPassword,
12
- onCancel
13
- } = props;
14
- const passwordValidator = usePasswordValidator();
15
- return /*#__PURE__*/React.createElement(View.Container, null, /*#__PURE__*/React.createElement(Form, {
16
- onSubmit: data => onSetNewPassword(data.code, data.password),
17
- submitOnEnter: true
18
- }, ({
19
- submit
20
- }) => /*#__PURE__*/React.createElement(View.Content, null, /*#__PURE__*/React.createElement(View.Title, {
21
- title: "Set new password"
22
- }), vm.message && /*#__PURE__*/React.createElement("div", {
23
- className: "mb-lg"
24
- }, /*#__PURE__*/React.createElement(Alert, {
25
- title: vm.message.title,
26
- type: vm.message.type
27
- }, vm.message.text)), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Grid.Column, {
28
- span: 12
29
- }, /*#__PURE__*/React.createElement(Bind, {
30
- name: "code",
31
- validators: validation.create("required")
32
- }, /*#__PURE__*/React.createElement(Input, {
33
- label: "Verification Code",
34
- description: "Enter the code we sent to your email.",
35
- autoComplete: "new-password"
36
- }))), /*#__PURE__*/React.createElement(Grid.Column, {
37
- span: 12
38
- }, /*#__PURE__*/React.createElement(Bind, {
39
- name: "password",
40
- validators: [validation.create("required"), passwordValidator]
41
- }, /*#__PURE__*/React.createElement(Input, {
42
- type: "password",
43
- label: "New Password",
44
- description: "Enter your new password.",
45
- autoComplete: "new-password"
46
- }))), /*#__PURE__*/React.createElement(Grid.Column, {
47
- span: 12
48
- }, /*#__PURE__*/React.createElement(RetypePassword, null)), /*#__PURE__*/React.createElement(Grid.Column, {
49
- span: 12
50
- }, /*#__PURE__*/React.createElement("div", {
51
- className: "flex items-center justify-between"
52
- }, /*#__PURE__*/React.createElement(FooterSignIn, {
53
- onSignIn: onCancel
54
- }), /*#__PURE__*/React.createElement(Button, {
55
- text: "Reset Password",
56
- onClick: submit,
57
- containerClassName: "ml-auto",
58
- disabled: vm.isLoading
59
- })))))));
8
+ const SetNewPassword = (props)=>{
9
+ const { vm, onSetNewPassword, onCancel } = props;
10
+ const passwordValidator = usePasswordValidator();
11
+ return /*#__PURE__*/ react.createElement(View.Container, null, /*#__PURE__*/ react.createElement(Form, {
12
+ onSubmit: (data)=>onSetNewPassword(data.code, data.password),
13
+ submitOnEnter: true
14
+ }, ({ submit })=>/*#__PURE__*/ react.createElement(View.Content, null, /*#__PURE__*/ react.createElement(View.Title, {
15
+ title: "Set new password"
16
+ }), vm.message && /*#__PURE__*/ react.createElement("div", {
17
+ className: "mb-lg"
18
+ }, /*#__PURE__*/ react.createElement(Alert, {
19
+ title: vm.message.title,
20
+ type: vm.message.type
21
+ }, vm.message.text)), /*#__PURE__*/ react.createElement(Grid, null, /*#__PURE__*/ react.createElement(Grid.Column, {
22
+ span: 12
23
+ }, /*#__PURE__*/ react.createElement(Bind, {
24
+ name: "code",
25
+ validators: validation.create("required")
26
+ }, /*#__PURE__*/ react.createElement(Input, {
27
+ label: "Verification Code",
28
+ description: "Enter the code we sent to your email.",
29
+ autoComplete: "new-password"
30
+ }))), /*#__PURE__*/ react.createElement(Grid.Column, {
31
+ span: 12
32
+ }, /*#__PURE__*/ react.createElement(Bind, {
33
+ name: "password",
34
+ validators: [
35
+ validation.create("required"),
36
+ passwordValidator
37
+ ]
38
+ }, /*#__PURE__*/ react.createElement(Input, {
39
+ type: "password",
40
+ label: "New Password",
41
+ description: "Enter your new password.",
42
+ autoComplete: "new-password"
43
+ }))), /*#__PURE__*/ react.createElement(Grid.Column, {
44
+ span: 12
45
+ }, /*#__PURE__*/ react.createElement(RetypePassword, null)), /*#__PURE__*/ react.createElement(Grid.Column, {
46
+ span: 12
47
+ }, /*#__PURE__*/ react.createElement("div", {
48
+ className: "flex items-center justify-between"
49
+ }, /*#__PURE__*/ react.createElement(FooterSignIn, {
50
+ onSignIn: onCancel
51
+ }), /*#__PURE__*/ react.createElement(Button, {
52
+ text: "Reset Password",
53
+ onClick: submit,
54
+ containerClassName: "ml-auto",
55
+ disabled: vm.isLoading
56
+ })))))));
60
57
  };
61
- const RetypePassword = () => {
62
- const form = useForm();
63
- const matchOriginalValidator = value => {
64
- if (value !== form.getValue("password")) {
65
- throw Error(`Passwords do not match.`);
66
- }
67
- };
68
- return /*#__PURE__*/React.createElement(Bind, {
69
- name: "confirmPassword",
70
- validators: [validation.create("required"), matchOriginalValidator]
71
- }, /*#__PURE__*/React.createElement(Input, {
72
- type: "password",
73
- label: "Retype Password",
74
- description: "Enter your new password once more.",
75
- autoComplete: "new-password"
76
- }));
58
+ const RetypePassword = ()=>{
59
+ const form = useForm();
60
+ const matchOriginalValidator = (value)=>{
61
+ if (value !== form.getValue("password")) throw Error("Passwords do not match.");
62
+ };
63
+ return /*#__PURE__*/ react.createElement(Bind, {
64
+ name: "confirmPassword",
65
+ validators: [
66
+ validation.create("required"),
67
+ matchOriginalValidator
68
+ ]
69
+ }, /*#__PURE__*/ react.createElement(Input, {
70
+ type: "password",
71
+ label: "Retype Password",
72
+ description: "Enter your new password once more.",
73
+ autoComplete: "new-password"
74
+ }));
77
75
  };
76
+ export { SetNewPassword };
78
77
 
79
78
  //# sourceMappingURL=SetNewPassword.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Button","Grid","Input","Alert","Form","Bind","useForm","validation","View","FooterSignIn","usePasswordValidator","SetNewPassword","props","vm","onSetNewPassword","onCancel","passwordValidator","createElement","Container","onSubmit","data","code","password","submitOnEnter","submit","Content","Title","title","message","className","type","text","Column","span","name","validators","create","label","description","autoComplete","RetypePassword","onSignIn","onClick","containerClassName","disabled","isLoading","form","matchOriginalValidator","value","getValue","Error"],"sources":["SetNewPassword.tsx"],"sourcesContent":["import React from \"react\";\nimport { Button, Grid, Input, Alert } from \"@webiny/admin-ui\";\nimport { Form, Bind, useForm } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { View } from \"./View.js\";\nimport type { SetNewPasswordVM } from \"~/admin/presentation/Cognito/abstractions.js\";\nimport { FooterSignIn } from \"~/admin/presentation/Cognito/components/FooterSignIn.js\";\nimport { usePasswordValidator } from \"~/admin/presentation/shared/usePasswordValidator.js\";\n\nexport interface SetNewPasswordProps {\n vm: SetNewPasswordVM;\n onSetNewPassword: (code: string, password: string) => void;\n onCancel: () => void;\n}\n\nexport const SetNewPassword = (props: SetNewPasswordProps) => {\n const { vm, onSetNewPassword, onCancel } = props;\n const passwordValidator = usePasswordValidator();\n\n return (\n <View.Container>\n <Form\n onSubmit={(data: any) => onSetNewPassword(data.code, data.password)}\n submitOnEnter\n >\n {({ submit }) => (\n <View.Content>\n <View.Title title={\"Set new password\"} />\n\n {vm.message && (\n <div className={\"mb-lg\"}>\n <Alert title={vm.message.title} type={vm.message.type}>\n {vm.message.text}\n </Alert>\n </div>\n )}\n\n <Grid>\n <Grid.Column span={12}>\n <Bind name=\"code\" validators={validation.create(\"required\")}>\n <Input\n label={\"Verification Code\"}\n description={\"Enter the code we sent to your email.\"}\n autoComplete={\"new-password\"}\n />\n </Bind>\n </Grid.Column>\n <Grid.Column span={12}>\n <Bind\n name=\"password\"\n validators={[validation.create(\"required\"), passwordValidator]}\n >\n <Input\n type={\"password\"}\n label={\"New Password\"}\n description={\"Enter your new password.\"}\n autoComplete={\"new-password\"}\n />\n </Bind>\n </Grid.Column>\n <Grid.Column span={12}>\n <RetypePassword />\n </Grid.Column>\n <Grid.Column span={12}>\n <div className={\"flex items-center justify-between\"}>\n <FooterSignIn onSignIn={onCancel} />\n <Button\n text={\"Reset Password\"}\n onClick={submit}\n containerClassName={\"ml-auto\"}\n disabled={vm.isLoading}\n />\n </div>\n </Grid.Column>\n </Grid>\n </View.Content>\n )}\n </Form>\n </View.Container>\n );\n};\n\nconst RetypePassword = () => {\n const form = useForm();\n const matchOriginalValidator = (value: string) => {\n if (value !== form.getValue(\"password\")) {\n throw Error(`Passwords do not match.`);\n }\n };\n\n return (\n <Bind\n name=\"confirmPassword\"\n validators={[validation.create(\"required\"), matchOriginalValidator]}\n >\n <Input\n type={\"password\"}\n label={\"Retype Password\"}\n description={\"Enter your new password once more.\"}\n autoComplete={\"new-password\"}\n />\n </Bind>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAEC,KAAK,QAAQ,kBAAkB;AAC7D,SAASC,IAAI,EAAEC,IAAI,EAAEC,OAAO,QAAQ,cAAc;AAClD,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,IAAI;AAEb,SAASC,YAAY;AACrB,SAASC,oBAAoB;AAQ7B,OAAO,MAAMC,cAAc,GAAIC,KAA0B,IAAK;EAC1D,MAAM;IAAEC,EAAE;IAAEC,gBAAgB;IAAEC;EAAS,CAAC,GAAGH,KAAK;EAChD,MAAMI,iBAAiB,GAAGN,oBAAoB,CAAC,CAAC;EAEhD,oBACIX,KAAA,CAAAkB,aAAA,CAACT,IAAI,CAACU,SAAS,qBACXnB,KAAA,CAAAkB,aAAA,CAACb,IAAI;IACDe,Q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W,EAAE,oCAAqC;IAClDC,YAAY,EAAE;EAAe,CAChC,CACC,CAAC;AAEf,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"admin/presentation/Cognito/components/SetNewPassword.js","sources":["../../../../../src/admin/presentation/Cognito/components/SetNewPassword.tsx"],"sourcesContent":["import React from \"react\";\nimport { Button, Grid, Input, Alert } from \"@webiny/admin-ui\";\nimport { Form, Bind, useForm } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { View } from \"./View.js\";\nimport type { SetNewPasswordVM } from \"~/admin/presentation/Cognito/abstractions.js\";\nimport { FooterSignIn } from \"~/admin/presentation/Cognito/components/FooterSignIn.js\";\nimport { usePasswordValidator } from \"~/admin/presentation/shared/usePasswordValidator.js\";\n\nexport interface SetNewPasswordProps {\n vm: SetNewPasswordVM;\n onSetNewPassword: (code: string, password: string) => void;\n onCancel: () => void;\n}\n\nexport const SetNewPassword = (props: SetNewPasswordProps) => {\n const { vm, onSetNewPassword, onCancel } = props;\n const passwordValidator = usePasswordValidator();\n\n return (\n <View.Container>\n <Form\n onSubmit={(data: any) => onSetNewPassword(data.code, data.password)}\n submitOnEnter\n >\n {({ submit }) => (\n <View.Content>\n <View.Title title={\"Set new password\"} />\n\n {vm.message && (\n <div className={\"mb-lg\"}>\n <Alert title={vm.message.title} type={vm.message.type}>\n {vm.message.text}\n </Alert>\n </div>\n )}\n\n <Grid>\n <Grid.Column span={12}>\n <Bind name=\"code\" validators={validation.create(\"required\")}>\n <Input\n label={\"Verification Code\"}\n description={\"Enter the code we sent to your email.\"}\n autoComplete={\"new-password\"}\n />\n </Bind>\n </Grid.Column>\n <Grid.Column span={12}>\n <Bind\n name=\"password\"\n validators={[validation.create(\"required\"), passwordValidator]}\n >\n <Input\n type={\"password\"}\n label={\"New Password\"}\n description={\"Enter your new password.\"}\n autoComplete={\"new-password\"}\n />\n </Bind>\n </Grid.Column>\n <Grid.Column span={12}>\n <RetypePassword />\n </Grid.Column>\n <Grid.Column span={12}>\n <div className={\"flex items-center justify-between\"}>\n <FooterSignIn onSignIn={onCancel} />\n <Button\n text={\"Reset Password\"}\n onClick={submit}\n containerClassName={\"ml-auto\"}\n disabled={vm.isLoading}\n />\n </div>\n </Grid.Column>\n </Grid>\n </View.Content>\n )}\n </Form>\n </View.Container>\n );\n};\n\nconst RetypePassword = () => {\n const form = useForm();\n const matchOriginalValidator = (value: string) => {\n if (value !== form.getValue(\"password\")) {\n throw Error(`Passwords do not match.`);\n }\n };\n\n return (\n <Bind\n name=\"confirmPassword\"\n validators={[validation.create(\"required\"), matchOriginalValidator]}\n >\n <Input\n type={\"password\"}\n label={\"Retype Password\"}\n description={\"Enter your new password once more.\"}\n autoComplete={\"new-password\"}\n />\n </Bind>\n );\n};\n"],"names":["SetNewPassword","props","vm","onSetNewPassword","onCancel","passwordValidator","usePasswordValidator","View","Form","data","submit","Alert","Grid","Bind","validation","Input","RetypePassword","FooterSignIn","Button","form","useForm","matchOriginalValidator","value","Error"],"mappings":";;;;;;;AAeO,MAAMA,iBAAiB,CAACC;IAC3B,MAAM,EAAEC,EAAE,EAAEC,gBAAgB,EAAEC,QAAQ,EAAE,GAAGH;IAC3C,MAAMI,oBAAoBC;IAE1B,OAAO,WAAP,GACI,oBAACC,KAAK,SAAS,sBACX,oBAACC,MAAIA;QACD,UAAU,CAACC,OAAcN,iBAAiBM,KAAK,IAAI,EAAEA,KAAK,QAAQ;QAClE;OAEC,CAAC,EAAEC,MAAM,EAAE,iBACR,oBAACH,KAAK,OAAO,sBACT,oBAACA,KAAK,KAAK;YAAC,OAAO;YAElBL,GAAG,OAAO,IAAI,WAAJ,GACP,oBAAC;YAAI,WAAW;yBACZ,oBAACS,OAAKA;YAAC,OAAOT,GAAG,OAAO,CAAC,KAAK;YAAE,MAAMA,GAAG,OAAO,CAAC,IAAI;WAChDA,GAAG,OAAO,CAAC,IAAI,kBAK5B,oBAACU,MAAIA,MAAAA,WAAAA,GACD,oBAACA,KAAK,MAAM;YAAC,MAAM;yBACf,oBAACC,MAAIA;YAAC,MAAK;YAAO,YAAYC,WAAW,MAAM,CAAC;yBAC5C,oBAACC,OAAKA;YACF,OAAO;YACP,aAAa;YACb,cAAc;4BAI1B,oBAACH,KAAK,MAAM;YAAC,MAAM;yBACf,oBAACC,MAAIA;YACD,MAAK;YACL,YAAY;gBAACC,WAAW,MAAM,CAAC;gBAAaT;aAAkB;yBAE9D,oBAACU,OAAKA;YACF,MAAM;YACN,OAAO;YACP,aAAa;YACb,cAAc;4BAI1B,oBAACH,KAAK,MAAM;YAAC,MAAM;yBACf,oBAACI,gBAAcA,QAAAA,WAAAA,GAEnB,oBAACJ,KAAK,MAAM;YAAC,MAAM;yBACf,oBAAC;YAAI,WAAW;yBACZ,oBAACK,cAAYA;YAAC,UAAUb;0BACxB,oBAACc,QAAMA;YACH,MAAM;YACN,SAASR;YACT,oBAAoB;YACpB,UAAUR,GAAG,SAAS;;AAU9D;AAEA,MAAMc,iBAAiB;IACnB,MAAMG,OAAOC;IACb,MAAMC,yBAAyB,CAACC;QAC5B,IAAIA,UAAUH,KAAK,QAAQ,CAAC,aACxB,MAAMI,MAAM;IAEpB;IAEA,OAAO,WAAP,GACI,oBAACV,MAAIA;QACD,MAAK;QACL,YAAY;YAACC,WAAW,MAAM,CAAC;YAAaO;SAAuB;qBAEnE,oBAACN,OAAKA;QACF,MAAM;QACN,OAAO;QACP,aAAa;QACb,cAAc;;AAI9B"}
@@ -1,64 +1,57 @@
1
- import React from "react";
2
- import { Grid, Input, Alert, Link, Button, Text, OverlayLoader } from "@webiny/admin-ui";
3
- import { Form, Bind } from "@webiny/form";
1
+ import react from "react";
2
+ import { Alert, Button, Grid, Input, Link, OverlayLoader, Text } from "@webiny/admin-ui";
3
+ import { Bind, Form } from "@webiny/form";
4
4
  import { validation } from "@webiny/validation";
5
5
  import { View } from "./View.js";
6
- export const SignIn = props => {
7
- const {
8
- vm,
9
- onSubmit,
10
- onForgotPassword,
11
- title = "Sign in",
12
- description
13
- } = props;
14
- return /*#__PURE__*/React.createElement(View.Container, null, /*#__PURE__*/React.createElement(Form, {
15
- onSubmit: data => onSubmit(data.username, data.password),
16
- submitOnEnter: true
17
- }, ({
18
- submit
19
- }) => /*#__PURE__*/React.createElement(View.Content, null, vm.isLoading ? /*#__PURE__*/React.createElement(OverlayLoader, {
20
- text: "Authenticating..."
21
- }) : null, /*#__PURE__*/React.createElement(View.Title, {
22
- title: title,
23
- description: description
24
- }), vm.message && /*#__PURE__*/React.createElement("div", {
25
- className: "mb-lg"
26
- }, /*#__PURE__*/React.createElement(Alert, {
27
- title: vm.message.title,
28
- type: vm.message.type
29
- }, vm.message.text)), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Grid.Column, {
30
- span: 12
31
- }, /*#__PURE__*/React.createElement(Bind, {
32
- name: "username",
33
- validators: validation.create("required,email"),
34
- beforeChange: (val, cb) => cb(val.toLowerCase())
35
- }, /*#__PURE__*/React.createElement(Input, {
36
- label: "Email"
37
- }))), /*#__PURE__*/React.createElement(Grid.Column, {
38
- span: 12
39
- }, /*#__PURE__*/React.createElement(Bind, {
40
- name: "password",
41
- validators: validation.create("required")
42
- }, /*#__PURE__*/React.createElement(Input, {
43
- type: "password",
44
- label: "Password",
45
- autoComplete: "off"
46
- }))), /*#__PURE__*/React.createElement(Grid.Column, {
47
- span: 12
48
- }, /*#__PURE__*/React.createElement("div", {
49
- className: "flex flex-row-reverse items-center justify-between"
50
- }, /*#__PURE__*/React.createElement(Button, {
51
- text: "Submit",
52
- "data-testid": "submit-sign-in-form-button",
53
- onClick: submit,
54
- disabled: vm.isLoading
55
- }), /*#__PURE__*/React.createElement(Text, {
56
- as: "div",
57
- size: "sm"
58
- }, /*#__PURE__*/React.createElement(Link, {
59
- to: "#",
60
- onClick: onForgotPassword
61
- }, "Forgot password?"))))))));
6
+ const SignIn = (props)=>{
7
+ const { vm, onSubmit, onForgotPassword, title = "Sign in", description } = props;
8
+ return /*#__PURE__*/ react.createElement(View.Container, null, /*#__PURE__*/ react.createElement(Form, {
9
+ onSubmit: (data)=>onSubmit(data.username, data.password),
10
+ submitOnEnter: true
11
+ }, ({ submit })=>/*#__PURE__*/ react.createElement(View.Content, null, vm.isLoading ? /*#__PURE__*/ react.createElement(OverlayLoader, {
12
+ text: "Authenticating..."
13
+ }) : null, /*#__PURE__*/ react.createElement(View.Title, {
14
+ title: title,
15
+ description: description
16
+ }), vm.message && /*#__PURE__*/ react.createElement("div", {
17
+ className: "mb-lg"
18
+ }, /*#__PURE__*/ react.createElement(Alert, {
19
+ title: vm.message.title,
20
+ type: vm.message.type
21
+ }, vm.message.text)), /*#__PURE__*/ react.createElement(Grid, null, /*#__PURE__*/ react.createElement(Grid.Column, {
22
+ span: 12
23
+ }, /*#__PURE__*/ react.createElement(Bind, {
24
+ name: "username",
25
+ validators: validation.create("required,email"),
26
+ beforeChange: (val, cb)=>cb(val.toLowerCase())
27
+ }, /*#__PURE__*/ react.createElement(Input, {
28
+ label: "Email"
29
+ }))), /*#__PURE__*/ react.createElement(Grid.Column, {
30
+ span: 12
31
+ }, /*#__PURE__*/ react.createElement(Bind, {
32
+ name: "password",
33
+ validators: validation.create("required")
34
+ }, /*#__PURE__*/ react.createElement(Input, {
35
+ type: "password",
36
+ label: "Password",
37
+ autoComplete: "off"
38
+ }))), /*#__PURE__*/ react.createElement(Grid.Column, {
39
+ span: 12
40
+ }, /*#__PURE__*/ react.createElement("div", {
41
+ className: "flex flex-row-reverse items-center justify-between"
42
+ }, /*#__PURE__*/ react.createElement(Button, {
43
+ text: "Submit",
44
+ "data-testid": "submit-sign-in-form-button",
45
+ onClick: submit,
46
+ disabled: vm.isLoading
47
+ }), /*#__PURE__*/ react.createElement(Text, {
48
+ as: "div",
49
+ size: "sm"
50
+ }, /*#__PURE__*/ react.createElement(Link, {
51
+ to: "#",
52
+ onClick: onForgotPassword
53
+ }, "Forgot password?"))))))));
62
54
  };
55
+ export { SignIn };
63
56
 
64
57
  //# sourceMappingURL=SignIn.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Grid","Input","Alert","Link","Button","Text","OverlayLoader","Form","Bind","validation","View","SignIn","props","vm","onSubmit","onForgotPassword","title","description","createElement","Container","data","username","password","submitOnEnter","submit","Content","isLoading","text","Title","message","className","type","Column","span","name","validators","create","beforeChange","val","cb","toLowerCase","label","autoComplete","onClick","disabled","as","size","to"],"sources":["SignIn.tsx"],"sourcesContent":["import React from \"react\";\nimport { Grid, Input, Alert, Link, Button, Text, OverlayLoader } from \"@webiny/admin-ui\";\nimport { Form, Bind } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { View } from \"./View.js\";\nimport type { SignInVM } from \"~/admin/presentation/Cognito/abstractions.js\";\n\nexport interface SignInProps {\n vm: SignInVM;\n onSubmit: (username: string, password: string) => void;\n onForgotPassword: () => void;\n title?: string;\n description?: React.ReactNode;\n}\n\nexport const SignIn = (props: SignInProps) => {\n const { vm, onSubmit, onForgotPassword, title = \"Sign in\", description } = props;\n\n return (\n <View.Container>\n <Form onSubmit={(data: any) => onSubmit(data.username, data.password)} submitOnEnter>\n {({ submit }) => (\n <View.Content>\n {vm.isLoading ? <OverlayLoader text={\"Authenticating...\"} /> : null}\n <View.Title title={title} description={description} />\n\n {vm.message && (\n <div className={\"mb-lg\"}>\n <Alert title={vm.message.title} type={vm.message.type}>\n {vm.message.text}\n </Alert>\n </div>\n )}\n\n <Grid>\n <Grid.Column span={12}>\n <Bind\n name=\"username\"\n validators={validation.create(\"required,email\")}\n beforeChange={(val: string, cb: (value: string) => void) =>\n cb(val.toLowerCase())\n }\n >\n <Input label={\"Email\"} />\n </Bind>\n </Grid.Column>\n <Grid.Column span={12}>\n <Bind name=\"password\" validators={validation.create(\"required\")}>\n <Input\n type={\"password\"}\n label={\"Password\"}\n autoComplete={\"off\"}\n />\n </Bind>\n </Grid.Column>\n <Grid.Column span={12}>\n <div\n className={\"flex flex-row-reverse items-center justify-between\"}\n >\n <Button\n text={\"Submit\"}\n data-testid=\"submit-sign-in-form-button\"\n onClick={submit}\n disabled={vm.isLoading}\n />\n <Text as={\"div\"} size={\"sm\"}>\n <Link to=\"#\" onClick={onForgotPassword}>\n Forgot password?\n </Link>\n </Text>\n </div>\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,IAAI,EAAEC,KAAK,EAAEC,KAAK,EAAEC,IAAI,EAAEC,MAAM,EAAEC,IAAI,EAAEC,aAAa,QAAQ,kBAAkB;AACxF,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,IAAI;AAWb,OAAO,MAAMC,MAAM,GAAIC,KAAkB,IAAK;EAC1C,MAAM;IAAEC,EAAE;IAAEC,QAAQ;IAAEC,gBAAgB;IAAEC,KAAK,GAAG,SAAS;IAAEC;EAAY,CAAC,GAAGL,KAAK;EAEhF,oBACIb,KAAA,CAAAmB,aAAA,CAACR,IAAI,CAACS,SAAS,qBACXpB,KAAA,CAAAmB,aAAA,CAACX,IAAI;IAACO,QAAQ,EAAGM,IAAS,IAAKN,QAAQ,CAACM,IAAI,CAACC,QAAQ,EAAED,IAAI,CAACE,QAAQ,CAAE;IAACC,aAAa;EAAA,GAC/E,CAAC;IAAEC;EAAO,CAAC,kBACRzB,KAAA,CAAAmB,aAAA,CAACR,IAAI,CAACe,OAAO,QACRZ,EAAE,CAACa,SAAS,gBAAG3B,KAAA,CAAAmB,aAAA,CAACZ,aAAa;IAACqB,IAAI,EAAE;EAAoB,CAAE,CAAC,GAAG,IAAI,eACnE5B,KAAA,CAAAmB,aAAA,CAACR,IAAI,CAACkB,KAAK;IAACZ,KAAK,EAAEA,KAAM;IAACC,WAAW,EAAEA;EAAY,CAAE,CAAC,EAErDJ,EAAE,CAACgB,OAAO,iBACP9B,KAAA,CAAAmB,aAAA;IAAKY,SAAS,EAAE;EAAQ,gBACpB/B,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QAAQ,EAAE/B,EAAE,CAACa;EAAU,CAC1B,CAAC,eACF3B,KAAA,CAAAmB,aAAA,CAACb,IAAI;IAACwC,EAAE,EAAE,KAAM;IAACC,IAAI,EAAE;EAAK,gBACxB/C,KAAA,CAAAmB,aAAA,CAACf,IAAI;IAAC4C,EAAE,EAAC,GAAG;IAACJ,OAAO,EAAE5B;EAAiB,GAAC,kBAElC,CACJ,CACL,CACI,CACX,CACI,CAEhB,CACM,CAAC;AAEzB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"admin/presentation/Cognito/components/SignIn.js","sources":["../../../../../src/admin/presentation/Cognito/components/SignIn.tsx"],"sourcesContent":["import React from \"react\";\nimport { Grid, Input, Alert, Link, Button, Text, OverlayLoader } from \"@webiny/admin-ui\";\nimport { Form, Bind } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { View } from \"./View.js\";\nimport type { SignInVM } from \"~/admin/presentation/Cognito/abstractions.js\";\n\nexport interface SignInProps {\n vm: SignInVM;\n onSubmit: (username: string, password: string) => void;\n onForgotPassword: () => void;\n title?: string;\n description?: React.ReactNode;\n}\n\nexport const SignIn = (props: SignInProps) => {\n const { vm, onSubmit, onForgotPassword, title = \"Sign in\", description } = props;\n\n return (\n <View.Container>\n <Form onSubmit={(data: any) => onSubmit(data.username, data.password)} submitOnEnter>\n {({ submit }) => (\n <View.Content>\n {vm.isLoading ? <OverlayLoader text={\"Authenticating...\"} /> : null}\n <View.Title title={title} description={description} />\n\n {vm.message && (\n <div className={\"mb-lg\"}>\n <Alert title={vm.message.title} type={vm.message.type}>\n {vm.message.text}\n </Alert>\n </div>\n )}\n\n <Grid>\n <Grid.Column span={12}>\n <Bind\n name=\"username\"\n validators={validation.create(\"required,email\")}\n beforeChange={(val: string, cb: (value: string) => void) =>\n cb(val.toLowerCase())\n }\n >\n <Input label={\"Email\"} />\n </Bind>\n </Grid.Column>\n <Grid.Column span={12}>\n <Bind name=\"password\" validators={validation.create(\"required\")}>\n <Input\n type={\"password\"}\n label={\"Password\"}\n autoComplete={\"off\"}\n />\n </Bind>\n </Grid.Column>\n <Grid.Column span={12}>\n <div\n className={\"flex flex-row-reverse items-center justify-between\"}\n >\n <Button\n text={\"Submit\"}\n data-testid=\"submit-sign-in-form-button\"\n onClick={submit}\n disabled={vm.isLoading}\n />\n <Text as={\"div\"} size={\"sm\"}>\n <Link to=\"#\" onClick={onForgotPassword}>\n Forgot password?\n </Link>\n </Text>\n </div>\n </Grid.Column>\n </Grid>\n </View.Content>\n )}\n </Form>\n </View.Container>\n );\n};\n"],"names":["SignIn","props","vm","onSubmit","onForgotPassword","title","description","View","Form","data","submit","OverlayLoader","Alert","Grid","Bind","validation","val","cb","Input","Button","Text","Link"],"mappings":";;;;;AAeO,MAAMA,SAAS,CAACC;IACnB,MAAM,EAAEC,EAAE,EAAEC,QAAQ,EAAEC,gBAAgB,EAAEC,QAAQ,SAAS,EAAEC,WAAW,EAAE,GAAGL;IAE3E,OAAO,WAAP,GACI,oBAACM,KAAK,SAAS,sBACX,oBAACC,MAAIA;QAAC,UAAU,CAACC,OAAcN,SAASM,KAAK,QAAQ,EAAEA,KAAK,QAAQ;QAAG;OAClE,CAAC,EAAEC,MAAM,EAAE,iBACR,oBAACH,KAAK,OAAO,QACRL,GAAG,SAAS,GAAG,WAAH,GAAG,oBAACS,eAAaA;YAAC,MAAM;aAA0B,oBAC/D,oBAACJ,KAAK,KAAK;YAAC,OAAOF;YAAO,aAAaC;YAEtCJ,GAAG,OAAO,IAAI,WAAJ,GACP,oBAAC;YAAI,WAAW;yBACZ,oBAACU,OAAKA;YAAC,OAAOV,GAAG,OAAO,CAAC,KAAK;YAAE,MAAMA,GAAG,OAAO,CAAC,IAAI;WAChDA,GAAG,OAAO,CAAC,IAAI,kBAK5B,oBAACW,MAAIA,MAAAA,WAAAA,GACD,oBAACA,KAAK,MAAM;YAAC,MAAM;yBACf,oBAACC,MAAIA;YACD,MAAK;YACL,YAAYC,WAAW,MAAM,CAAC;YAC9B,cAAc,CAACC,KAAaC,KACxBA,GAAGD,IAAI,WAAW;yBAGtB,oBAACE,OAAKA;YAAC,OAAO;4BAGtB,oBAACL,KAAK,MAAM;YAAC,MAAM;yBACf,oBAACC,MAAIA;YAAC,MAAK;YAAW,YAAYC,WAAW,MAAM,CAAC;yBAChD,oBAACG,OAAKA;YACF,MAAM;YACN,OAAO;YACP,cAAc;4BAI1B,oBAACL,KAAK,MAAM;YAAC,MAAM;yBACf,oBAAC;YACG,WAAW;yBAEX,oBAACM,QAAMA;YACH,MAAM;YACN,eAAY;YACZ,SAAST;YACT,UAAUR,GAAG,SAAS;0BAE1B,oBAACkB,MAAIA;YAAC,IAAI;YAAO,MAAM;yBACnB,oBAACC,MAAIA;YAAC,IAAG;YAAI,SAASjB;WAAkB;AAYhF"}
@@ -1,67 +1,48 @@
1
- import * as React from "react";
2
1
  import capitalize from "lodash/capitalize";
3
2
  import { Logo, makeDecoratable } from "@webiny/app-admin";
4
3
  import { Alert, Grid, Heading, Text } from "@webiny/admin-ui";
5
- const Container = makeDecoratable("ViewContainer", ({
6
- children
7
- }) => {
8
- return /*#__PURE__*/React.createElement("div", {
9
- className: "w-full h-screen bg-neutral-light flex-1"
10
- }, /*#__PURE__*/React.createElement("section", {
11
- className: "m-auto flex flex-col justify-center min-h-screen"
12
- }, /*#__PURE__*/React.createElement("div", {
13
- className: "mx-auto"
14
- }, /*#__PURE__*/React.createElement(Logo, null)), /*#__PURE__*/React.createElement("div", {
15
- className: "w-full max-w-[480px] mx-auto my-lg"
16
- }, children)));
17
- });
18
- const Content = makeDecoratable("ViewContent", ({
19
- children
20
- }) => /*#__PURE__*/React.createElement("div", {
21
- className: "relative p-lg pt-md bg-neutral-base rounded-xl"
22
- }, children));
23
- const Footer = makeDecoratable("ViewFooter", ({
24
- children
25
- }) => {
26
- return /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Grid.Column, {
27
- span: 12,
28
- className: "text-center mt-lg"
29
- }, children));
30
- });
31
- const Title = makeDecoratable("ViewTitle", ({
32
- title,
33
- description
34
- }) => {
35
- return /*#__PURE__*/React.createElement("div", {
36
- className: "mb-md"
37
- }, /*#__PURE__*/React.createElement(Heading, {
38
- level: 4
39
- }, capitalize(title)), description && /*#__PURE__*/React.createElement(Text, {
40
- as: "div",
41
- size: "sm",
42
- className: "text-neutral-strong"
43
- }, description));
44
- });
45
- export const Error = ({
46
- title = "Something went wrong",
47
- description
48
- }) => {
49
- if (!description) {
50
- return null;
51
- }
52
- return /*#__PURE__*/React.createElement("div", {
53
- className: "mb-lg"
54
- }, /*#__PURE__*/React.createElement(Alert, {
55
- title: title,
56
- type: "danger"
57
- }, description));
4
+ import * as __rspack_external_react from "react";
5
+ const Container = makeDecoratable("ViewContainer", ({ children })=>/*#__PURE__*/ __rspack_external_react.createElement("div", {
6
+ className: "w-full h-screen bg-neutral-light flex-1"
7
+ }, /*#__PURE__*/ __rspack_external_react.createElement("section", {
8
+ className: "m-auto flex flex-col justify-center min-h-screen"
9
+ }, /*#__PURE__*/ __rspack_external_react.createElement("div", {
10
+ className: "mx-auto"
11
+ }, /*#__PURE__*/ __rspack_external_react.createElement(Logo, null)), /*#__PURE__*/ __rspack_external_react.createElement("div", {
12
+ className: "w-full max-w-[480px] mx-auto my-lg"
13
+ }, children))));
14
+ const Content = makeDecoratable("ViewContent", ({ children })=>/*#__PURE__*/ __rspack_external_react.createElement("div", {
15
+ className: "relative p-lg pt-md bg-neutral-base rounded-xl"
16
+ }, children));
17
+ const Footer = makeDecoratable("ViewFooter", ({ children })=>/*#__PURE__*/ __rspack_external_react.createElement(Grid, null, /*#__PURE__*/ __rspack_external_react.createElement(Grid.Column, {
18
+ span: 12,
19
+ className: "text-center mt-lg"
20
+ }, children)));
21
+ const Title = makeDecoratable("ViewTitle", ({ title, description })=>/*#__PURE__*/ __rspack_external_react.createElement("div", {
22
+ className: "mb-md"
23
+ }, /*#__PURE__*/ __rspack_external_react.createElement(Heading, {
24
+ level: 4
25
+ }, capitalize(title)), description && /*#__PURE__*/ __rspack_external_react.createElement(Text, {
26
+ as: "div",
27
+ size: "sm",
28
+ className: "text-neutral-strong"
29
+ }, description)));
30
+ const Error = ({ title = "Something went wrong", description })=>{
31
+ if (!description) return null;
32
+ return /*#__PURE__*/ __rspack_external_react.createElement("div", {
33
+ className: "mb-lg"
34
+ }, /*#__PURE__*/ __rspack_external_react.createElement(Alert, {
35
+ title: title,
36
+ type: "danger"
37
+ }, description));
58
38
  };
59
- export const View = {
60
- Container,
61
- Content,
62
- Title,
63
- Footer,
64
- Error
39
+ const View = {
40
+ Container: Container,
41
+ Content: Content,
42
+ Title: Title,
43
+ Footer: Footer,
44
+ Error: Error
65
45
  };
46
+ export { Error, View };
66
47
 
67
48
  //# sourceMappingURL=View.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","capitalize","Logo","makeDecoratable","Alert","Grid","Heading","Text","Container","children","createElement","className","Content","Footer","Column","span","Title","title","description","level","as","size","Error","type","View"],"sources":["View.tsx"],"sourcesContent":["import * as React from \"react\";\nimport capitalize from \"lodash/capitalize\";\nimport { Logo, makeDecoratable } from \"@webiny/app-admin\";\nimport { Alert, Grid, Heading, Text } from \"@webiny/admin-ui\";\n\nexport interface ContainerProps {\n children: React.ReactNode;\n}\n\nconst Container = makeDecoratable(\"ViewContainer\", ({ children }: ContainerProps) => {\n return (\n <div className={\"w-full h-screen bg-neutral-light flex-1\"}>\n <section className={\"m-auto flex flex-col justify-center min-h-screen\"}>\n <div className={\"mx-auto\"}>\n <Logo />\n </div>\n <div className={\"w-full max-w-[480px] mx-auto my-lg\"}>{children}</div>\n </section>\n </div>\n );\n});\n\nexport interface ContentProps {\n children: React.ReactNode;\n}\n\nconst Content = makeDecoratable(\"ViewContent\", ({ children }: ContentProps) => (\n <div className={\"relative p-lg pt-md bg-neutral-base rounded-xl\"}>{children}</div>\n));\n\nexport interface FooterProps {\n children: React.ReactNode;\n}\n\nconst Footer = makeDecoratable(\"ViewFooter\", ({ children }: FooterProps) => {\n return (\n <Grid>\n <Grid.Column span={12} className={\"text-center mt-lg\"}>\n {children}\n </Grid.Column>\n </Grid>\n );\n});\n\nexport interface TitleProps {\n title: string;\n description?: React.ReactNode;\n}\n\nconst Title = makeDecoratable(\"ViewTitle\", ({ title, description }: TitleProps) => {\n return (\n <div className={\"mb-md\"}>\n <Heading level={4}>{capitalize(title)}</Heading>\n {description && (\n <Text as={\"div\"} size={\"sm\"} className={\"text-neutral-strong\"}>\n {description}\n </Text>\n )}\n </div>\n );\n});\n\nexport interface ErrorProps {\n title?: string;\n description?: string | null;\n}\n\nexport const Error = ({ title = \"Something went wrong\", description }: ErrorProps) => {\n if (!description) {\n return null;\n }\n\n return (\n <div className={\"mb-lg\"}>\n <Alert title={title} type={\"danger\"}>\n {description}\n </Alert>\n </div>\n );\n};\n\nexport const View = {\n Container,\n Content,\n Title,\n Footer,\n Error\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,UAAU,MAAM,mBAAmB;AAC1C,SAASC,IAAI,EAAEC,eAAe,QAAQ,mBAAmB;AACzD,SAASC,KAAK,EAAEC,IAAI,EAAEC,OAAO,EAAEC,IAAI,QAAQ,kBAAkB;AAM7D,MAAMC,SAAS,GAAGL,eAAe,CAAC,eAAe,EAAE,CAAC;EAAEM;AAAyB,CAAC,KAAK;EACjF,oBACIT,KAAA,CAAAU,aAAA;IAAKC,SAAS,EAAE;EAA0C,gBACtDX,KAAA,CAAAU,aAAA;IAASC,SAAS,EAAE;EAAmD,gBACnEX,KAAA,CAAAU,aAAA;IAAKC,SAAS,EAAE;EAAU,gBACtBX,KAAA,CAAAU,aAAA,CAACR,IAAI,MAAE,CACN,CAAC,eACNF,KAAA,CAAAU,aAAA;IAAKC,SAAS,EAAE;EAAqC,GAAEF,QAAc,CAChE,CACR,CAAC;AAEd,CAAC,CAAC;AAMF,MAAMG,OAAO,GAAGT,eAAe,CAAC,aAAa,EAAE,CAAC;EAAEM;AAAuB,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version":3,"file":"admin/presentation/Cognito/components/View.js","sources":["../../../../../src/admin/presentation/Cognito/components/View.tsx"],"sourcesContent":["import * as React from \"react\";\nimport capitalize from \"lodash/capitalize\";\nimport { Logo, makeDecoratable } from \"@webiny/app-admin\";\nimport { Alert, Grid, Heading, Text } from \"@webiny/admin-ui\";\n\nexport interface ContainerProps {\n children: React.ReactNode;\n}\n\nconst Container = makeDecoratable(\"ViewContainer\", ({ children }: ContainerProps) => {\n return (\n <div className={\"w-full h-screen bg-neutral-light flex-1\"}>\n <section className={\"m-auto flex flex-col justify-center min-h-screen\"}>\n <div className={\"mx-auto\"}>\n <Logo />\n </div>\n <div className={\"w-full max-w-[480px] mx-auto my-lg\"}>{children}</div>\n </section>\n </div>\n );\n});\n\nexport interface ContentProps {\n children: React.ReactNode;\n}\n\nconst Content = makeDecoratable(\"ViewContent\", ({ children }: ContentProps) => (\n <div className={\"relative p-lg pt-md bg-neutral-base rounded-xl\"}>{children}</div>\n));\n\nexport interface FooterProps {\n children: React.ReactNode;\n}\n\nconst Footer = makeDecoratable(\"ViewFooter\", ({ children }: FooterProps) => {\n return (\n <Grid>\n <Grid.Column span={12} className={\"text-center mt-lg\"}>\n {children}\n </Grid.Column>\n </Grid>\n );\n});\n\nexport interface TitleProps {\n title: string;\n description?: React.ReactNode;\n}\n\nconst Title = makeDecoratable(\"ViewTitle\", ({ title, description }: TitleProps) => {\n return (\n <div className={\"mb-md\"}>\n <Heading level={4}>{capitalize(title)}</Heading>\n {description && (\n <Text as={\"div\"} size={\"sm\"} className={\"text-neutral-strong\"}>\n {description}\n </Text>\n )}\n </div>\n );\n});\n\nexport interface ErrorProps {\n title?: string;\n description?: string | null;\n}\n\nexport const Error = ({ title = \"Something went wrong\", description }: ErrorProps) => {\n if (!description) {\n return null;\n }\n\n return (\n <div className={\"mb-lg\"}>\n <Alert title={title} type={\"danger\"}>\n {description}\n </Alert>\n </div>\n );\n};\n\nexport const View = {\n Container,\n Content,\n Title,\n Footer,\n Error\n};\n"],"names":["Container","makeDecoratable","children","Logo","Content","Footer","Grid","Title","title","description","Heading","capitalize","Text","Error","Alert","View"],"mappings":";;;;AASA,MAAMA,YAAYC,gBAAgB,iBAAiB,CAAC,EAAEC,QAAQ,EAAkB,GACrE,WAAP,GACI,sCAAC;QAAI,WAAW;qBACZ,sCAAC;QAAQ,WAAW;qBAChB,sCAAC;QAAI,WAAW;qBACZ,sCAACC,MAAIA,QAAAA,WAAAA,GAET,sCAAC;QAAI,WAAW;OAAuCD;AAUvE,MAAME,UAAUH,gBAAgB,eAAe,CAAC,EAAEC,QAAQ,EAAgB,iBACtE,sCAAC;QAAI,WAAW;OAAmDA;AAOvE,MAAMG,SAASJ,gBAAgB,cAAc,CAAC,EAAEC,QAAQ,EAAe,GAC5D,WAAP,GACI,sCAACI,MAAIA,MAAAA,WAAAA,GACD,sCAACA,KAAK,MAAM;QAAC,MAAM;QAAI,WAAW;OAC7BJ;AAWjB,MAAMK,QAAQN,gBAAgB,aAAa,CAAC,EAAEO,KAAK,EAAEC,WAAW,EAAc,GACnE,WAAP,GACI,sCAAC;QAAI,WAAW;qBACZ,sCAACC,SAAOA;QAAC,OAAO;OAAIC,WAAWH,SAC9BC,eAAe,WAAfA,GACG,sCAACG,MAAIA;QAAC,IAAI;QAAO,MAAM;QAAM,WAAW;OACnCH;AAYd,MAAMI,QAAQ,CAAC,EAAEL,QAAQ,sBAAsB,EAAEC,WAAW,EAAc;IAC7E,IAAI,CAACA,aACD,OAAO;IAGX,OAAO,WAAP,GACI,sCAAC;QAAI,WAAW;qBACZ,sCAACK,OAAKA;QAAC,OAAON;QAAO,MAAM;OACtBC;AAIjB;AAEO,MAAMM,OAAO;IAChBf,WAAAA;IACAI,SAAAA;IACAG,OAAAA;IACAF,QAAAA;IACAQ,OAAAA;AACJ"}
@@ -1,16 +1,17 @@
1
1
  import { createFeature } from "@webiny/feature/admin";
2
2
  import { CognitoPresenter } from "./CognitoPresenter.js";
3
- import { CognitoPresenter as Presenter } from "./abstractions.js";
4
- export const CognitoFeature = createFeature({
5
- name: "Cognito",
6
- register(container) {
7
- container.register(CognitoPresenter).inSingletonScope();
8
- },
9
- resolve(container) {
10
- return {
11
- presenter: container.resolve(Presenter)
12
- };
13
- }
3
+ import { CognitoPresenter as external_abstractions_js_CognitoPresenter } from "./abstractions.js";
4
+ const CognitoFeature = createFeature({
5
+ name: "Cognito",
6
+ register (container) {
7
+ container.register(CognitoPresenter).inSingletonScope();
8
+ },
9
+ resolve (container) {
10
+ return {
11
+ presenter: container.resolve(external_abstractions_js_CognitoPresenter)
12
+ };
13
+ }
14
14
  });
15
+ export { CognitoFeature };
15
16
 
16
17
  //# sourceMappingURL=feature.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createFeature","CognitoPresenter","Presenter","CognitoFeature","name","register","container","inSingletonScope","resolve","presenter"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { CognitoPresenter } from \"./CognitoPresenter.js\";\nimport { CognitoPresenter as Presenter } from \"./abstractions.js\";\n\nexport const CognitoFeature = createFeature({\n name: \"Cognito\",\n register(container) {\n container.register(CognitoPresenter).inSingletonScope();\n },\n resolve(container) {\n return {\n presenter: container.resolve(Presenter)\n };\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,uBAAuB;AACrD,SAASC,gBAAgB;AACzB,SAASA,gBAAgB,IAAIC,SAAS;AAEtC,OAAO,MAAMC,cAAc,GAAGH,aAAa,CAAC;EACxCI,IAAI,EAAE,SAAS;EACfC,QAAQA,CAACC,SAAS,EAAE;IAChBA,SAAS,CAACD,QAAQ,CAACJ,gBAAgB,CAAC,CAACM,gBAAgB,CAAC,CAAC;EAC3D,CAAC;EACDC,OAAOA,CAACF,SAAS,EAAE;IACf,OAAO;MACHG,SAAS,EAAEH,SAAS,CAACE,OAAO,CAACN,SAAS;IAC1C,CAAC;EACL;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"admin/presentation/Cognito/feature.js","sources":["../../../../src/admin/presentation/Cognito/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { CognitoPresenter } from \"./CognitoPresenter.js\";\nimport { CognitoPresenter as Presenter } from \"./abstractions.js\";\n\nexport const CognitoFeature = createFeature({\n name: \"Cognito\",\n register(container) {\n container.register(CognitoPresenter).inSingletonScope();\n },\n resolve(container) {\n return {\n presenter: container.resolve(Presenter)\n };\n }\n});\n"],"names":["CognitoFeature","createFeature","container","CognitoPresenter","Presenter"],"mappings":";;;AAIO,MAAMA,iBAAiBC,cAAc;IACxC,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC,kBAAkB,gBAAgB;IACzD;IACA,SAAQD,SAAS;QACb,OAAO;YACH,WAAWA,UAAU,OAAO,CAACE;QACjC;IACJ;AACJ"}
@@ -1,27 +1,16 @@
1
1
  import { ValidationError } from "@webiny/validation";
2
- export const createPasswordValidator = policy => value => {
3
- if (!value) {
4
- return;
5
- }
6
- const requireSymbols = /([=+\-^$*.[\]{}()?"!@#%&/,><':;|_~`])+/;
7
- const requireNumber = /[0-9]/;
8
- const requireLowercase = /[a-z]/;
9
- const requireUppercase = /[A-Z]/;
10
- if (policy.minimumLength !== undefined && value.length < policy.minimumLength) {
11
- throw new ValidationError(`Value requires at least ${policy.minimumLength} characters.`);
12
- }
13
- if (policy.requireLowercase && !requireLowercase.test(value)) {
14
- throw new ValidationError("Value must contain a lowercase character.");
15
- }
16
- if (policy.requireNumbers && !requireNumber.test(value)) {
17
- throw new ValidationError("Value must contain a number.");
18
- }
19
- if (policy.requireUppercase && !requireUppercase.test(value)) {
20
- throw new ValidationError("Value must contain an uppercase character.");
21
- }
22
- if (policy.requireSymbols && !requireSymbols.test(value)) {
23
- throw new ValidationError("Value must contain a special character.");
24
- }
25
- };
2
+ const createPasswordValidator = (policy)=>(value)=>{
3
+ if (!value) return;
4
+ const requireSymbols = /([=+\-^$*.[\]{}()?"!@#%&/,><':;|_~`])+/;
5
+ const requireNumber = /[0-9]/;
6
+ const requireLowercase = /[a-z]/;
7
+ const requireUppercase = /[A-Z]/;
8
+ if (void 0 !== policy.minimumLength && value.length < policy.minimumLength) throw new ValidationError(`Value requires at least ${policy.minimumLength} characters.`);
9
+ if (policy.requireLowercase && !requireLowercase.test(value)) throw new ValidationError("Value must contain a lowercase character.");
10
+ if (policy.requireNumbers && !requireNumber.test(value)) throw new ValidationError("Value must contain a number.");
11
+ if (policy.requireUppercase && !requireUppercase.test(value)) throw new ValidationError("Value must contain an uppercase character.");
12
+ if (policy.requireSymbols && !requireSymbols.test(value)) throw new ValidationError("Value must contain a special character.");
13
+ };
14
+ export { createPasswordValidator };
26
15
 
27
16
  //# sourceMappingURL=createPasswordValidator.js.map