@skroz/frontend 0.0.6 → 0.0.8

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 (75) hide show
  1. package/dist/auth/Auth.js +19 -36
  2. package/dist/auth/AuthButtons.d.ts +22 -0
  3. package/dist/auth/AuthButtons.js +29 -0
  4. package/dist/auth/AuthFooterLinks.js +9 -25
  5. package/dist/auth/AuthModal.d.ts +9 -0
  6. package/dist/auth/AuthModal.js +5 -0
  7. package/dist/auth/Forgot.js +47 -59
  8. package/dist/auth/Login.js +33 -48
  9. package/dist/auth/LoginForm.js +18 -47
  10. package/dist/auth/LogoutButton.d.ts +3 -0
  11. package/dist/auth/LogoutButton.js +39 -0
  12. package/dist/auth/RecoverPassword.js +64 -80
  13. package/dist/auth/Register.js +47 -55
  14. package/dist/auth/ResendLinkButton.d.ts +3 -3
  15. package/dist/auth/ResendLinkButton.js +39 -40
  16. package/dist/auth/__tests__/Login.test.d.ts +1 -0
  17. package/dist/auth/__tests__/Login.test.js +75 -0
  18. package/dist/auth/index.d.ts +3 -0
  19. package/dist/auth/index.js +11 -22
  20. package/dist/graphql/ForgotMutation.graphql.d.ts +2 -2
  21. package/dist/graphql/ForgotMutation.graphql.js +5 -7
  22. package/dist/graphql/LoginMutation.graphql.d.ts +5 -5
  23. package/dist/graphql/LoginMutation.graphql.js +6 -8
  24. package/dist/graphql/LogoutButtonMutation.graphql.d.ts +18 -0
  25. package/dist/graphql/LogoutButtonMutation.graphql.js +55 -0
  26. package/dist/graphql/RecoverPasswordMutation.graphql.d.ts +2 -2
  27. package/dist/graphql/RecoverPasswordMutation.graphql.js +5 -7
  28. package/dist/graphql/RegisterMutation.graphql.d.ts +7 -6
  29. package/dist/graphql/RegisterMutation.graphql.js +15 -10
  30. package/dist/graphql/ResendLinkButtonMutation.graphql.d.ts +2 -2
  31. package/dist/graphql/ResendLinkButtonMutation.graphql.js +5 -7
  32. package/dist/index.d.ts +0 -1
  33. package/dist/index.js +3 -20
  34. package/dist/ui/AreYouSure.js +9 -23
  35. package/dist/ui/FormError.js +9 -14
  36. package/dist/ui/FormItem.js +8 -22
  37. package/dist/ui/H.d.ts +1 -1
  38. package/dist/ui/H.js +15 -32
  39. package/dist/ui/Panel.d.ts +1 -1
  40. package/dist/ui/Panel.js +6 -23
  41. package/dist/ui/SeoHead.js +7 -13
  42. package/dist/ui/index.js +6 -18
  43. package/dist/utils/FrontendContext.js +6 -25
  44. package/dist/utils/getError.js +12 -20
  45. package/dist/utils/handleFormErrors.js +20 -29
  46. package/dist/utils/index.js +5 -28
  47. package/dist/utils/isObject.js +2 -6
  48. package/dist/utils/limitExpiresAt.js +9 -12
  49. package/package.json +8 -6
  50. package/src/auth/Auth.tsx +2 -2
  51. package/src/auth/AuthButtons.tsx +127 -0
  52. package/src/auth/AuthModal.tsx +28 -0
  53. package/src/auth/Forgot.tsx +29 -22
  54. package/src/auth/Login.tsx +25 -10
  55. package/src/auth/LoginForm.tsx +4 -4
  56. package/src/auth/LogoutButton.tsx +53 -0
  57. package/src/auth/RecoverPassword.tsx +34 -24
  58. package/src/auth/Register.tsx +29 -13
  59. package/src/auth/ResendLinkButton.tsx +34 -23
  60. package/src/auth/__tests__/Login.test.tsx +99 -0
  61. package/src/auth/index.ts +3 -0
  62. package/src/graphql/ForgotMutation.graphql.ts +77 -77
  63. package/src/graphql/LoginMutation.graphql.ts +73 -73
  64. package/src/graphql/LogoutButtonMutation.graphql.ts +74 -0
  65. package/src/graphql/RecoverPasswordMutation.graphql.ts +70 -74
  66. package/src/graphql/RegisterMutation.graphql.ts +81 -73
  67. package/src/graphql/ResendLinkButtonMutation.graphql.ts +77 -77
  68. package/src/index.ts +0 -1
  69. package/src/styles/auth.less +22 -7
  70. package/src/ui/H.tsx +1 -1
  71. package/src/ui/Panel.tsx +1 -1
  72. package/src/utils/limitExpiresAt.ts +3 -1
  73. package/dist/graphql/index.d.ts +0 -5
  74. package/dist/graphql/index.js +0 -16
  75. package/src/graphql/index.ts +0 -5
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @generated SignedSource<<13b4d04002f461d3c131f16f81e940a0>>
2
+ * @generated SignedSource<<0f3dfefe3a2565ec72f2043bace633b9>>
3
3
  * @lightSyntaxTransform
4
4
  * @nogrep
5
5
  */
@@ -8,93 +8,93 @@
8
8
  /* eslint-disable */
9
9
  // @ts-nocheck
10
10
 
11
- import { ConcreteRequest, Mutation } from 'relay-runtime';
11
+ import { ConcreteRequest } from 'relay-runtime';
12
12
  export type SendTokenInput = {
13
- email: string;
13
+ email: string;
14
14
  };
15
15
  export type ForgotMutation$variables = {
16
- input: SendTokenInput;
16
+ input: SendTokenInput;
17
17
  };
18
18
  export type ForgotMutation$data = {
19
- readonly sendToken: {
20
- readonly codeIsSent: boolean;
21
- readonly limitExpiresAt: number | null;
22
- };
19
+ readonly sendToken: {
20
+ readonly codeIsSent: boolean;
21
+ readonly limitExpiresAt: number;
22
+ };
23
23
  };
24
24
  export type ForgotMutation = {
25
- response: ForgotMutation$data;
26
- variables: ForgotMutation$variables;
25
+ response: ForgotMutation$data;
26
+ variables: ForgotMutation$variables;
27
27
  };
28
28
 
29
- const node: ConcreteRequest = (function () {
30
- var v0 = [
31
- {
32
- "defaultValue": null,
33
- "kind": "LocalArgument",
34
- "name": "input"
35
- }
29
+ const node: ConcreteRequest = (function(){
30
+ var v0 = [
31
+ {
32
+ "defaultValue": null,
33
+ "kind": "LocalArgument",
34
+ "name": "input"
35
+ }
36
+ ],
37
+ v1 = [
38
+ {
39
+ "alias": null,
40
+ "args": [
41
+ {
42
+ "kind": "Variable",
43
+ "name": "input",
44
+ "variableName": "input"
45
+ }
36
46
  ],
37
- v1 = [
38
- {
39
- "alias": null,
40
- "args": [
41
- {
42
- "kind": "Variable",
43
- "name": "input",
44
- "variableName": "input"
45
- }
46
- ],
47
- "concreteType": "SendTokenPayload",
48
- "kind": "LinkedField",
49
- "name": "sendToken",
50
- "plural": false,
51
- "selections": [
52
- {
53
- "alias": null,
54
- "args": null,
55
- "kind": "ScalarField",
56
- "name": "codeIsSent",
57
- "storageKey": null
58
- },
59
- {
60
- "alias": null,
61
- "args": null,
62
- "kind": "ScalarField",
63
- "name": "limitExpiresAt",
64
- "storageKey": null
65
- }
66
- ],
67
- "storageKey": null
68
- }
69
- ];
70
- return {
71
- "fragment": {
72
- "argumentDefinitions": (v0/*: any*/),
73
- "kind": "Fragment",
74
- "metadata": null,
75
- "name": "ForgotMutation",
76
- "selections": (v1/*: any*/),
77
- "type": "Mutation",
78
- "abstractKey": null
79
- },
80
- "kind": "Request",
81
- "operation": {
82
- "argumentDefinitions": (v0/*: any*/),
83
- "kind": "Operation",
84
- "name": "ForgotMutation",
85
- "selections": (v1/*: any*/)
86
- },
87
- "params": {
88
- "cacheID": "5e5512b2a837741f90fc5a83dacf437f",
89
- "id": null,
90
- "metadata": {},
91
- "name": "ForgotMutation",
92
- "operationKind": "mutation",
93
- "text": "mutation ForgotMutation(\n $input: SendTokenInput!\n) {\n sendToken(input: $input) {\n codeIsSent\n limitExpiresAt\n }\n}\n"
94
- }
95
- };
47
+ "concreteType": "SendTokenPayload",
48
+ "kind": "LinkedField",
49
+ "name": "sendToken",
50
+ "plural": false,
51
+ "selections": [
52
+ {
53
+ "alias": null,
54
+ "args": null,
55
+ "kind": "ScalarField",
56
+ "name": "codeIsSent",
57
+ "storageKey": null
58
+ },
59
+ {
60
+ "alias": null,
61
+ "args": null,
62
+ "kind": "ScalarField",
63
+ "name": "limitExpiresAt",
64
+ "storageKey": null
65
+ }
66
+ ],
67
+ "storageKey": null
68
+ }
69
+ ];
70
+ return {
71
+ "fragment": {
72
+ "argumentDefinitions": (v0/*: any*/),
73
+ "kind": "Fragment",
74
+ "metadata": null,
75
+ "name": "ForgotMutation",
76
+ "selections": (v1/*: any*/),
77
+ "type": "Mutation",
78
+ "abstractKey": null
79
+ },
80
+ "kind": "Request",
81
+ "operation": {
82
+ "argumentDefinitions": (v0/*: any*/),
83
+ "kind": "Operation",
84
+ "name": "ForgotMutation",
85
+ "selections": (v1/*: any*/)
86
+ },
87
+ "params": {
88
+ "cacheID": "0a93b8a190804d04b6fb46be655df5d1",
89
+ "id": null,
90
+ "metadata": {},
91
+ "name": "ForgotMutation",
92
+ "operationKind": "mutation",
93
+ "text": "mutation ForgotMutation(\n $input: SendTokenInput!\n) {\n sendToken(input: $input) {\n codeIsSent\n limitExpiresAt\n }\n}\n"
94
+ }
95
+ };
96
96
  })();
97
97
 
98
- (node as any).hash = "13b4d04002f461d3c131f16f81e940a0";
98
+ (node as any).hash = "45c1fe91d41e8ab4b3aaadcfe395e427";
99
99
 
100
100
  export default node;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @generated SignedSource<<e749189577dbf72aa098e36b518ad0c2>>
2
+ * @generated SignedSource<<8ce2f64475e3177e54e08ae251d8f602>>
3
3
  * @lightSyntaxTransform
4
4
  * @nogrep
5
5
  */
@@ -8,88 +8,88 @@
8
8
  /* eslint-disable */
9
9
  // @ts-nocheck
10
10
 
11
- import { ConcreteRequest, Mutation } from 'relay-runtime';
12
- export type RegisterInput = {
13
- email: string;
14
- isPrivacyPolicyAgree?: boolean | null;
15
- isUserAgreementAgree?: boolean | null;
16
- password: string;
11
+ import { ConcreteRequest } from 'relay-runtime';
12
+ export type AuthInput = {
13
+ email: string;
14
+ isPrivacyPolicyAgree?: boolean | null | undefined;
15
+ isUserAgreementAgree?: boolean | null | undefined;
16
+ password: string;
17
17
  };
18
18
  export type LoginMutation$variables = {
19
- input: RegisterInput;
19
+ input: AuthInput;
20
20
  };
21
21
  export type LoginMutation$data = {
22
- readonly login: {
23
- readonly ok: boolean;
24
- };
22
+ readonly login: {
23
+ readonly ok: boolean;
24
+ };
25
25
  };
26
26
  export type LoginMutation = {
27
- response: LoginMutation$data;
28
- variables: LoginMutation$variables;
27
+ response: LoginMutation$data;
28
+ variables: LoginMutation$variables;
29
29
  };
30
30
 
31
- const node: ConcreteRequest = (function () {
32
- var v0 = [
33
- {
34
- "defaultValue": null,
35
- "kind": "LocalArgument",
36
- "name": "input"
37
- }
31
+ const node: ConcreteRequest = (function(){
32
+ var v0 = [
33
+ {
34
+ "defaultValue": null,
35
+ "kind": "LocalArgument",
36
+ "name": "input"
37
+ }
38
+ ],
39
+ v1 = [
40
+ {
41
+ "alias": null,
42
+ "args": [
43
+ {
44
+ "kind": "Variable",
45
+ "name": "input",
46
+ "variableName": "input"
47
+ }
38
48
  ],
39
- v1 = [
40
- {
41
- "alias": null,
42
- "args": [
43
- {
44
- "kind": "Variable",
45
- "name": "input",
46
- "variableName": "input"
47
- }
48
- ],
49
- "concreteType": "StatusPayload",
50
- "kind": "LinkedField",
51
- "name": "login",
52
- "plural": false,
53
- "selections": [
54
- {
55
- "alias": null,
56
- "args": null,
57
- "kind": "ScalarField",
58
- "name": "ok",
59
- "storageKey": null
60
- }
61
- ],
62
- "storageKey": null
63
- }
64
- ];
65
- return {
66
- "fragment": {
67
- "argumentDefinitions": (v0/*: any*/),
68
- "kind": "Fragment",
69
- "metadata": null,
70
- "name": "LoginMutation",
71
- "selections": (v1/*: any*/),
72
- "type": "Mutation",
73
- "abstractKey": null
74
- },
75
- "kind": "Request",
76
- "operation": {
77
- "argumentDefinitions": (v0/*: any*/),
78
- "kind": "Operation",
79
- "name": "LoginMutation",
80
- "selections": (v1/*: any*/)
81
- },
82
- "params": {
83
- "cacheID": "5ef263953ba0aafb287d05aacf35c065",
84
- "id": null,
85
- "metadata": {},
86
- "name": "LoginMutation",
87
- "operationKind": "mutation",
88
- "text": "mutation LoginMutation(\n $input: RegisterInput!\n) {\n login(input: $input) {\n ok\n }\n}\n"
89
- }
90
- };
49
+ "concreteType": "StatusPayload",
50
+ "kind": "LinkedField",
51
+ "name": "login",
52
+ "plural": false,
53
+ "selections": [
54
+ {
55
+ "alias": null,
56
+ "args": null,
57
+ "kind": "ScalarField",
58
+ "name": "ok",
59
+ "storageKey": null
60
+ }
61
+ ],
62
+ "storageKey": null
63
+ }
64
+ ];
65
+ return {
66
+ "fragment": {
67
+ "argumentDefinitions": (v0/*: any*/),
68
+ "kind": "Fragment",
69
+ "metadata": null,
70
+ "name": "LoginMutation",
71
+ "selections": (v1/*: any*/),
72
+ "type": "Mutation",
73
+ "abstractKey": null
74
+ },
75
+ "kind": "Request",
76
+ "operation": {
77
+ "argumentDefinitions": (v0/*: any*/),
78
+ "kind": "Operation",
79
+ "name": "LoginMutation",
80
+ "selections": (v1/*: any*/)
81
+ },
82
+ "params": {
83
+ "cacheID": "b6ca3a0d29a942f6960d926303f27880",
84
+ "id": null,
85
+ "metadata": {},
86
+ "name": "LoginMutation",
87
+ "operationKind": "mutation",
88
+ "text": "mutation LoginMutation(\n $input: AuthInput!\n) {\n login(input: $input) {\n ok\n }\n}\n"
89
+ }
90
+ };
91
91
  })();
92
92
 
93
- (node as any).hash = "8aa42da7b9249db347cbcedf54b7eb58";
93
+ (node as any).hash = "2f0dca7d2511d3f382e757d7385d7186";
94
94
 
95
95
  export default node;
@@ -0,0 +1,74 @@
1
+ /**
2
+ * @generated SignedSource<<0e00d78b9dbe72301e5564672e1ebaf8>>
3
+ * @lightSyntaxTransform
4
+ * @nogrep
5
+ */
6
+
7
+ /* tslint:disable */
8
+ /* eslint-disable */
9
+ // @ts-nocheck
10
+
11
+ import { ConcreteRequest } from 'relay-runtime';
12
+ export type LogoutButtonMutation$variables = Record<PropertyKey, never>;
13
+ export type LogoutButtonMutation$data = {
14
+ readonly logout: {
15
+ readonly ok: boolean;
16
+ };
17
+ };
18
+ export type LogoutButtonMutation = {
19
+ response: LogoutButtonMutation$data;
20
+ variables: LogoutButtonMutation$variables;
21
+ };
22
+
23
+ const node: ConcreteRequest = (function(){
24
+ var v0 = [
25
+ {
26
+ "alias": null,
27
+ "args": null,
28
+ "concreteType": "StatusPayload",
29
+ "kind": "LinkedField",
30
+ "name": "logout",
31
+ "plural": false,
32
+ "selections": [
33
+ {
34
+ "alias": null,
35
+ "args": null,
36
+ "kind": "ScalarField",
37
+ "name": "ok",
38
+ "storageKey": null
39
+ }
40
+ ],
41
+ "storageKey": null
42
+ }
43
+ ];
44
+ return {
45
+ "fragment": {
46
+ "argumentDefinitions": [],
47
+ "kind": "Fragment",
48
+ "metadata": null,
49
+ "name": "LogoutButtonMutation",
50
+ "selections": (v0/*: any*/),
51
+ "type": "Mutation",
52
+ "abstractKey": null
53
+ },
54
+ "kind": "Request",
55
+ "operation": {
56
+ "argumentDefinitions": [],
57
+ "kind": "Operation",
58
+ "name": "LogoutButtonMutation",
59
+ "selections": (v0/*: any*/)
60
+ },
61
+ "params": {
62
+ "cacheID": "4349d31ea654d6713af74f438573be99",
63
+ "id": null,
64
+ "metadata": {},
65
+ "name": "LogoutButtonMutation",
66
+ "operationKind": "mutation",
67
+ "text": "mutation LogoutButtonMutation {\n logout {\n ok\n }\n}\n"
68
+ }
69
+ };
70
+ })();
71
+
72
+ (node as any).hash = "072aaaeef565631da910887beb9d4d13";
73
+
74
+ export default node;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @generated SignedSource<<recoveryMutationManualReconstruction>>
2
+ * @generated SignedSource<<09cfd9f3f44e668868cb83191d247311>>
3
3
  * @lightSyntaxTransform
4
4
  * @nogrep
5
5
  */
@@ -8,90 +8,86 @@
8
8
  /* eslint-disable */
9
9
  // @ts-nocheck
10
10
 
11
- import { ConcreteRequest, Mutation } from 'relay-runtime';
12
-
11
+ import { ConcreteRequest } from 'relay-runtime';
13
12
  export type RecoverPasswordInput = {
14
- token: string;
15
- password: string;
13
+ password: string;
14
+ token: string;
16
15
  };
17
-
18
16
  export type RecoverPasswordMutation$variables = {
19
- input: RecoverPasswordInput;
17
+ input: RecoverPasswordInput;
20
18
  };
21
-
22
19
  export type RecoverPasswordMutation$data = {
23
- readonly recoverPassword: {
24
- readonly ok: boolean;
25
- };
20
+ readonly recoverPassword: {
21
+ readonly ok: boolean;
22
+ };
26
23
  };
27
-
28
24
  export type RecoverPasswordMutation = {
29
- response: RecoverPasswordMutation$data;
30
- variables: RecoverPasswordMutation$variables;
25
+ response: RecoverPasswordMutation$data;
26
+ variables: RecoverPasswordMutation$variables;
31
27
  };
32
28
 
33
- const node: ConcreteRequest = (function () {
34
- var v0 = [
35
- {
36
- "defaultValue": null,
37
- "kind": "LocalArgument",
38
- "name": "input"
39
- }
29
+ const node: ConcreteRequest = (function(){
30
+ var v0 = [
31
+ {
32
+ "defaultValue": null,
33
+ "kind": "LocalArgument",
34
+ "name": "input"
35
+ }
36
+ ],
37
+ v1 = [
38
+ {
39
+ "alias": null,
40
+ "args": [
41
+ {
42
+ "kind": "Variable",
43
+ "name": "input",
44
+ "variableName": "input"
45
+ }
46
+ ],
47
+ "concreteType": "StatusPayload",
48
+ "kind": "LinkedField",
49
+ "name": "recoverPassword",
50
+ "plural": false,
51
+ "selections": [
52
+ {
53
+ "alias": null,
54
+ "args": null,
55
+ "kind": "ScalarField",
56
+ "name": "ok",
57
+ "storageKey": null
58
+ }
40
59
  ],
41
- v1 = [
42
- {
43
- "alias": null,
44
- "args": [
45
- {
46
- "kind": "Variable",
47
- "name": "input",
48
- "variableName": "input"
49
- }
50
- ],
51
- "concreteType": "StatusPayload",
52
- "kind": "LinkedField",
53
- "name": "recoverPassword",
54
- "plural": false,
55
- "selections": [
56
- {
57
- "alias": null,
58
- "args": null,
59
- "kind": "ScalarField",
60
- "name": "ok",
61
- "storageKey": null
62
- }
63
- ],
64
- "storageKey": null
65
- }
66
- ];
67
- return {
68
- "fragment": {
69
- "argumentDefinitions": (v0/*: any*/),
70
- "kind": "Fragment",
71
- "metadata": null,
72
- "name": "RecoverPasswordMutation",
73
- "selections": (v1/*: any*/),
74
- "type": "Mutation",
75
- "abstractKey": null
76
- },
77
- "kind": "Request",
78
- "operation": {
79
- "argumentDefinitions": (v0/*: any*/),
80
- "kind": "Operation",
81
- "name": "RecoverPasswordMutation",
82
- "selections": (v1/*: any*/)
83
- },
84
- "params": {
85
- "cacheID": "recoveryMutationManualReconstruction",
86
- "id": null,
87
- "metadata": {},
88
- "name": "RecoverPasswordMutation",
89
- "operationKind": "mutation",
90
- "text": "mutation RecoverPasswordMutation(\n $input: RecoverPasswordInput!\n) {\n recoverPassword(input: $input) {\n ok\n }\n}\n"
91
- }
92
- };
60
+ "storageKey": null
61
+ }
62
+ ];
63
+ return {
64
+ "fragment": {
65
+ "argumentDefinitions": (v0/*: any*/),
66
+ "kind": "Fragment",
67
+ "metadata": null,
68
+ "name": "RecoverPasswordMutation",
69
+ "selections": (v1/*: any*/),
70
+ "type": "Mutation",
71
+ "abstractKey": null
72
+ },
73
+ "kind": "Request",
74
+ "operation": {
75
+ "argumentDefinitions": (v0/*: any*/),
76
+ "kind": "Operation",
77
+ "name": "RecoverPasswordMutation",
78
+ "selections": (v1/*: any*/)
79
+ },
80
+ "params": {
81
+ "cacheID": "5a20d8c281268245bd3b8b962e6f2b59",
82
+ "id": null,
83
+ "metadata": {},
84
+ "name": "RecoverPasswordMutation",
85
+ "operationKind": "mutation",
86
+ "text": "mutation RecoverPasswordMutation(\n $input: RecoverPasswordInput!\n) {\n recoverPassword(input: $input) {\n ok\n }\n}\n"
87
+ }
88
+ };
93
89
  })();
94
90
 
95
- (node as any).hash = "recoveryMutationHash";
91
+ (node as any).hash = "6f76c8915e55f836557903a4bcb54c1c";
96
92
 
97
93
  export default node;