@skroz/frontend 0.0.2

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 (95) hide show
  1. package/LICENCE.md +21 -0
  2. package/dist/auth/Auth.d.ts +8 -0
  3. package/dist/auth/Auth.js +52 -0
  4. package/dist/auth/AuthFooterLinks.d.ts +4 -0
  5. package/dist/auth/AuthFooterLinks.js +26 -0
  6. package/dist/auth/Forgot.d.ts +7 -0
  7. package/dist/auth/Forgot.js +68 -0
  8. package/dist/auth/Login.d.ts +8 -0
  9. package/dist/auth/Login.js +65 -0
  10. package/dist/auth/LoginForm.d.ts +6 -0
  11. package/dist/auth/LoginForm.js +48 -0
  12. package/dist/auth/RecoverPassword.d.ts +2 -0
  13. package/dist/auth/RecoverPassword.js +96 -0
  14. package/dist/auth/Register.d.ts +8 -0
  15. package/dist/auth/Register.js +68 -0
  16. package/dist/auth/ResendLinkButton.d.ts +11 -0
  17. package/dist/auth/ResendLinkButton.js +50 -0
  18. package/dist/auth/index.d.ts +8 -0
  19. package/dist/auth/index.js +22 -0
  20. package/dist/graphql/ForgotPasswordMutation.graphql.d.ts +24 -0
  21. package/dist/graphql/ForgotPasswordMutation.graphql.js +76 -0
  22. package/dist/graphql/LoginMutation.graphql.d.ts +26 -0
  23. package/dist/graphql/LoginMutation.graphql.js +69 -0
  24. package/dist/graphql/RegisterMutation.graphql.d.ts +26 -0
  25. package/dist/graphql/RegisterMutation.graphql.js +69 -0
  26. package/dist/graphql/ResendLinkButtonMutation.graphql.d.ts +25 -0
  27. package/dist/graphql/ResendLinkButtonMutation.graphql.js +76 -0
  28. package/dist/graphql/index.d.ts +5 -0
  29. package/dist/graphql/index.js +16 -0
  30. package/dist/graphql/recoveryMutation.graphql.d.ts +19 -0
  31. package/dist/graphql/recoveryMutation.graphql.js +67 -0
  32. package/dist/index.d.ts +4 -0
  33. package/dist/index.js +20 -0
  34. package/dist/ui/AreYouSure.d.ts +10 -0
  35. package/dist/ui/AreYouSure.js +43 -0
  36. package/dist/ui/FormError.d.ts +3 -0
  37. package/dist/ui/FormError.js +15 -0
  38. package/dist/ui/FormItem.d.ts +12 -0
  39. package/dist/ui/FormItem.js +27 -0
  40. package/dist/ui/H.d.ts +16 -0
  41. package/dist/ui/H.js +39 -0
  42. package/dist/ui/Panel.d.ts +16 -0
  43. package/dist/ui/Panel.js +24 -0
  44. package/dist/ui/SeoHead.d.ts +13 -0
  45. package/dist/ui/SeoHead.js +14 -0
  46. package/dist/ui/index.d.ts +6 -0
  47. package/dist/ui/index.js +18 -0
  48. package/dist/utils/FrontendContext.d.ts +14 -0
  49. package/dist/utils/FrontendContext.js +30 -0
  50. package/dist/utils/getError.d.ts +11 -0
  51. package/dist/utils/getError.js +73 -0
  52. package/dist/utils/handleFormErrors.d.ts +15 -0
  53. package/dist/utils/handleFormErrors.js +62 -0
  54. package/dist/utils/index.d.ts +5 -0
  55. package/dist/utils/index.js +28 -0
  56. package/dist/utils/isObject.d.ts +2 -0
  57. package/dist/utils/isObject.js +6 -0
  58. package/dist/utils/limitExpiresAt.d.ts +3 -0
  59. package/dist/utils/limitExpiresAt.js +19 -0
  60. package/package.json +48 -0
  61. package/src/auth/Auth.tsx +76 -0
  62. package/src/auth/AuthFooterLinks.tsx +27 -0
  63. package/src/auth/Forgot.tsx +122 -0
  64. package/src/auth/Login.tsx +115 -0
  65. package/src/auth/LoginForm.tsx +74 -0
  66. package/src/auth/RecoverPassword.tsx +185 -0
  67. package/src/auth/Register.tsx +174 -0
  68. package/src/auth/ResendLinkButton.tsx +71 -0
  69. package/src/auth/index.ts +8 -0
  70. package/src/graphql/ForgotPasswordMutation.graphql.ts +100 -0
  71. package/src/graphql/LoginMutation.graphql.ts +95 -0
  72. package/src/graphql/RegisterMutation.graphql.ts +95 -0
  73. package/src/graphql/ResendLinkButtonMutation.graphql.ts +101 -0
  74. package/src/graphql/index.ts +5 -0
  75. package/src/graphql/recoveryMutation.graphql.ts +91 -0
  76. package/src/index.ts +4 -0
  77. package/src/locales/ru/common.json +271 -0
  78. package/src/styles/auth.less +142 -0
  79. package/src/styles/colors.less +55 -0
  80. package/src/styles/components.less +2 -0
  81. package/src/styles/panels.less +61 -0
  82. package/src/styles/sizes.less +92 -0
  83. package/src/ui/AreYouSure.tsx +55 -0
  84. package/src/ui/FormError.tsx +21 -0
  85. package/src/ui/FormItem.tsx +60 -0
  86. package/src/ui/H.tsx +76 -0
  87. package/src/ui/Panel.tsx +44 -0
  88. package/src/ui/SeoHead.tsx +69 -0
  89. package/src/ui/index.ts +6 -0
  90. package/src/utils/FrontendContext.tsx +30 -0
  91. package/src/utils/getError.ts +101 -0
  92. package/src/utils/handleFormErrors.ts +77 -0
  93. package/src/utils/index.ts +5 -0
  94. package/src/utils/isObject.ts +4 -0
  95. package/src/utils/limitExpiresAt.ts +14 -0
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @generated SignedSource<<fa5d43293d27c101facae2d958971c83>>
3
+ * @lightSyntaxTransform
4
+ * @nogrep
5
+ */
6
+ import { ConcreteRequest } from 'relay-runtime';
7
+ export type ForgotPasswordInput = {
8
+ email: string;
9
+ };
10
+ export type ForgotPasswordMutation$variables = {
11
+ input: ForgotPasswordInput;
12
+ };
13
+ export type ForgotPasswordMutation$data = {
14
+ readonly forgotPassword: {
15
+ readonly limitExpiresAt: number;
16
+ readonly recoveryLinkIsSent: boolean;
17
+ };
18
+ };
19
+ export type ForgotPasswordMutation = {
20
+ response: ForgotPasswordMutation$data;
21
+ variables: ForgotPasswordMutation$variables;
22
+ };
23
+ declare const node: ConcreteRequest;
24
+ export default node;
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ /**
3
+ * @generated SignedSource<<fa5d43293d27c101facae2d958971c83>>
4
+ * @lightSyntaxTransform
5
+ * @nogrep
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ var node = (function () {
9
+ var v0 = [
10
+ {
11
+ "defaultValue": null,
12
+ "kind": "LocalArgument",
13
+ "name": "input"
14
+ }
15
+ ], v1 = [
16
+ {
17
+ "alias": null,
18
+ "args": [
19
+ {
20
+ "kind": "Variable",
21
+ "name": "input",
22
+ "variableName": "input"
23
+ }
24
+ ],
25
+ "concreteType": "ForgotPasswordPayload",
26
+ "kind": "LinkedField",
27
+ "name": "forgotPassword",
28
+ "plural": false,
29
+ "selections": [
30
+ {
31
+ "alias": null,
32
+ "args": null,
33
+ "kind": "ScalarField",
34
+ "name": "recoveryLinkIsSent",
35
+ "storageKey": null
36
+ },
37
+ {
38
+ "alias": null,
39
+ "args": null,
40
+ "kind": "ScalarField",
41
+ "name": "limitExpiresAt",
42
+ "storageKey": null
43
+ }
44
+ ],
45
+ "storageKey": null
46
+ }
47
+ ];
48
+ return {
49
+ "fragment": {
50
+ "argumentDefinitions": (v0 /*: any*/),
51
+ "kind": "Fragment",
52
+ "metadata": null,
53
+ "name": "ForgotPasswordMutation",
54
+ "selections": (v1 /*: any*/),
55
+ "type": "Mutation",
56
+ "abstractKey": null
57
+ },
58
+ "kind": "Request",
59
+ "operation": {
60
+ "argumentDefinitions": (v0 /*: any*/),
61
+ "kind": "Operation",
62
+ "name": "ForgotPasswordMutation",
63
+ "selections": (v1 /*: any*/)
64
+ },
65
+ "params": {
66
+ "cacheID": "5e5512b2a837741f90fc5a83dacf437f",
67
+ "id": null,
68
+ "metadata": {},
69
+ "name": "ForgotPasswordMutation",
70
+ "operationKind": "mutation",
71
+ "text": "mutation ForgotPasswordMutation(\n $input: ForgotPasswordInput!\n) {\n forgotPassword(input: $input) {\n recoveryLinkIsSent\n limitExpiresAt\n }\n}\n"
72
+ }
73
+ };
74
+ })();
75
+ node.hash = "13b4d04002f461d3c131f16f81e940a0";
76
+ exports.default = node;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @generated SignedSource<<e749189577dbf72aa098e36b518ad0c2>>
3
+ * @lightSyntaxTransform
4
+ * @nogrep
5
+ */
6
+ import { ConcreteRequest } from 'relay-runtime';
7
+ export type RegisterInput = {
8
+ email: string;
9
+ isPrivacyPolicyAgree?: boolean | null;
10
+ isUserAgreementAgree?: boolean | null;
11
+ password: string;
12
+ };
13
+ export type LoginMutation$variables = {
14
+ input: RegisterInput;
15
+ };
16
+ export type LoginMutation$data = {
17
+ readonly login: {
18
+ readonly ok: boolean;
19
+ };
20
+ };
21
+ export type LoginMutation = {
22
+ response: LoginMutation$data;
23
+ variables: LoginMutation$variables;
24
+ };
25
+ declare const node: ConcreteRequest;
26
+ export default node;
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ /**
3
+ * @generated SignedSource<<e749189577dbf72aa098e36b518ad0c2>>
4
+ * @lightSyntaxTransform
5
+ * @nogrep
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ var node = (function () {
9
+ var v0 = [
10
+ {
11
+ "defaultValue": null,
12
+ "kind": "LocalArgument",
13
+ "name": "input"
14
+ }
15
+ ], v1 = [
16
+ {
17
+ "alias": null,
18
+ "args": [
19
+ {
20
+ "kind": "Variable",
21
+ "name": "input",
22
+ "variableName": "input"
23
+ }
24
+ ],
25
+ "concreteType": "StatusPayload",
26
+ "kind": "LinkedField",
27
+ "name": "login",
28
+ "plural": false,
29
+ "selections": [
30
+ {
31
+ "alias": null,
32
+ "args": null,
33
+ "kind": "ScalarField",
34
+ "name": "ok",
35
+ "storageKey": null
36
+ }
37
+ ],
38
+ "storageKey": null
39
+ }
40
+ ];
41
+ return {
42
+ "fragment": {
43
+ "argumentDefinitions": (v0 /*: any*/),
44
+ "kind": "Fragment",
45
+ "metadata": null,
46
+ "name": "LoginMutation",
47
+ "selections": (v1 /*: any*/),
48
+ "type": "Mutation",
49
+ "abstractKey": null
50
+ },
51
+ "kind": "Request",
52
+ "operation": {
53
+ "argumentDefinitions": (v0 /*: any*/),
54
+ "kind": "Operation",
55
+ "name": "LoginMutation",
56
+ "selections": (v1 /*: any*/)
57
+ },
58
+ "params": {
59
+ "cacheID": "5ef263953ba0aafb287d05aacf35c065",
60
+ "id": null,
61
+ "metadata": {},
62
+ "name": "LoginMutation",
63
+ "operationKind": "mutation",
64
+ "text": "mutation LoginMutation(\n $input: RegisterInput!\n) {\n login(input: $input) {\n ok\n }\n}\n"
65
+ }
66
+ };
67
+ })();
68
+ node.hash = "8aa42da7b9249db347cbcedf54b7eb58";
69
+ exports.default = node;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @generated SignedSource<<b6e62c629f517274528baab804aebf79>>
3
+ * @lightSyntaxTransform
4
+ * @nogrep
5
+ */
6
+ import { ConcreteRequest } from 'relay-runtime';
7
+ export type RegisterInput = {
8
+ email: string;
9
+ isPrivacyPolicyAgree?: boolean | null;
10
+ isUserAgreementAgree?: boolean | null;
11
+ password: string;
12
+ };
13
+ export type RegisterMutation$variables = {
14
+ input: RegisterInput;
15
+ };
16
+ export type RegisterMutation$data = {
17
+ readonly register: {
18
+ readonly ok: boolean;
19
+ };
20
+ };
21
+ export type RegisterMutation = {
22
+ response: RegisterMutation$data;
23
+ variables: RegisterMutation$variables;
24
+ };
25
+ declare const node: ConcreteRequest;
26
+ export default node;
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ /**
3
+ * @generated SignedSource<<b6e62c629f517274528baab804aebf79>>
4
+ * @lightSyntaxTransform
5
+ * @nogrep
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ var node = (function () {
9
+ var v0 = [
10
+ {
11
+ "defaultValue": null,
12
+ "kind": "LocalArgument",
13
+ "name": "input"
14
+ }
15
+ ], v1 = [
16
+ {
17
+ "alias": null,
18
+ "args": [
19
+ {
20
+ "kind": "Variable",
21
+ "name": "input",
22
+ "variableName": "input"
23
+ }
24
+ ],
25
+ "concreteType": "StatusPayload",
26
+ "kind": "LinkedField",
27
+ "name": "register",
28
+ "plural": false,
29
+ "selections": [
30
+ {
31
+ "alias": null,
32
+ "args": null,
33
+ "kind": "ScalarField",
34
+ "name": "ok",
35
+ "storageKey": null
36
+ }
37
+ ],
38
+ "storageKey": null
39
+ }
40
+ ];
41
+ return {
42
+ "fragment": {
43
+ "argumentDefinitions": (v0 /*: any*/),
44
+ "kind": "Fragment",
45
+ "metadata": null,
46
+ "name": "RegisterMutation",
47
+ "selections": (v1 /*: any*/),
48
+ "type": "Mutation",
49
+ "abstractKey": null
50
+ },
51
+ "kind": "Request",
52
+ "operation": {
53
+ "argumentDefinitions": (v0 /*: any*/),
54
+ "kind": "Operation",
55
+ "name": "RegisterMutation",
56
+ "selections": (v1 /*: any*/)
57
+ },
58
+ "params": {
59
+ "cacheID": "b634d0db622dc1c41a4c41ba173483ed",
60
+ "id": null,
61
+ "metadata": {},
62
+ "name": "RegisterMutation",
63
+ "operationKind": "mutation",
64
+ "text": "mutation RegisterMutation(\n $input: RegisterInput!\n) {\n register(input: $input) {\n ok\n }\n}\n"
65
+ }
66
+ };
67
+ })();
68
+ node.hash = "95ef334f9a12340ab240e613480b0a51";
69
+ exports.default = node;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @generated SignedSource<<0b4534d6e64b9e483cc3dceaa7d594ac>>
3
+ * @lightSyntaxTransform
4
+ * @nogrep
5
+ */
6
+ import { ConcreteRequest } from 'relay-runtime';
7
+ export type ResendLinkInput = {
8
+ email: string;
9
+ type: string;
10
+ };
11
+ export type ResendLinkButtonMutation$variables = {
12
+ input: ResendLinkInput;
13
+ };
14
+ export type ResendLinkButtonMutation$data = {
15
+ readonly resendLink: {
16
+ readonly limitExpiresAt: number;
17
+ readonly ok: boolean;
18
+ };
19
+ };
20
+ export type ResendLinkButtonMutation = {
21
+ response: ResendLinkButtonMutation$data;
22
+ variables: ResendLinkButtonMutation$variables;
23
+ };
24
+ declare const node: ConcreteRequest;
25
+ export default node;
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ /**
3
+ * @generated SignedSource<<0b4534d6e64b9e483cc3dceaa7d594ac>>
4
+ * @lightSyntaxTransform
5
+ * @nogrep
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ var node = (function () {
9
+ var v0 = [
10
+ {
11
+ "defaultValue": null,
12
+ "kind": "LocalArgument",
13
+ "name": "input"
14
+ }
15
+ ], v1 = [
16
+ {
17
+ "alias": null,
18
+ "args": [
19
+ {
20
+ "kind": "Variable",
21
+ "name": "input",
22
+ "variableName": "input"
23
+ }
24
+ ],
25
+ "concreteType": "ResendLinkPayload",
26
+ "kind": "LinkedField",
27
+ "name": "resendLink",
28
+ "plural": false,
29
+ "selections": [
30
+ {
31
+ "alias": null,
32
+ "args": null,
33
+ "kind": "ScalarField",
34
+ "name": "ok",
35
+ "storageKey": null
36
+ },
37
+ {
38
+ "alias": null,
39
+ "args": null,
40
+ "kind": "ScalarField",
41
+ "name": "limitExpiresAt",
42
+ "storageKey": null
43
+ }
44
+ ],
45
+ "storageKey": null
46
+ }
47
+ ];
48
+ return {
49
+ "fragment": {
50
+ "argumentDefinitions": (v0 /*: any*/),
51
+ "kind": "Fragment",
52
+ "metadata": null,
53
+ "name": "ResendLinkButtonMutation",
54
+ "selections": (v1 /*: any*/),
55
+ "type": "Mutation",
56
+ "abstractKey": null
57
+ },
58
+ "kind": "Request",
59
+ "operation": {
60
+ "argumentDefinitions": (v0 /*: any*/),
61
+ "kind": "Operation",
62
+ "name": "ResendLinkButtonMutation",
63
+ "selections": (v1 /*: any*/)
64
+ },
65
+ "params": {
66
+ "cacheID": "cddddaa297ce04eecaf79a4bfa5eb769",
67
+ "id": null,
68
+ "metadata": {},
69
+ "name": "ResendLinkButtonMutation",
70
+ "operationKind": "mutation",
71
+ "text": "mutation ResendLinkButtonMutation(\n $input: ResendLinkInput!\n) {\n resendLink(input: $input) {\n ok\n limitExpiresAt\n }\n}\n"
72
+ }
73
+ };
74
+ })();
75
+ node.hash = "4610277a9b30028acecc73fe6465f17d";
76
+ exports.default = node;
@@ -0,0 +1,5 @@
1
+ export { default as LoginMutation } from './LoginMutation.graphql';
2
+ export { default as RegisterMutation } from './RegisterMutation.graphql';
3
+ export { default as ForgotPasswordMutation } from './ForgotPasswordMutation.graphql';
4
+ export { default as ResendLinkButtonMutation } from './ResendLinkButtonMutation.graphql';
5
+ export { default as recoveryMutation } from './recoveryMutation.graphql';
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.recoveryMutation = exports.ResendLinkButtonMutation = exports.ForgotPasswordMutation = exports.RegisterMutation = exports.LoginMutation = void 0;
7
+ var LoginMutation_graphql_1 = require("./LoginMutation.graphql");
8
+ Object.defineProperty(exports, "LoginMutation", { enumerable: true, get: function () { return __importDefault(LoginMutation_graphql_1).default; } });
9
+ var RegisterMutation_graphql_1 = require("./RegisterMutation.graphql");
10
+ Object.defineProperty(exports, "RegisterMutation", { enumerable: true, get: function () { return __importDefault(RegisterMutation_graphql_1).default; } });
11
+ var ForgotPasswordMutation_graphql_1 = require("./ForgotPasswordMutation.graphql");
12
+ Object.defineProperty(exports, "ForgotPasswordMutation", { enumerable: true, get: function () { return __importDefault(ForgotPasswordMutation_graphql_1).default; } });
13
+ var ResendLinkButtonMutation_graphql_1 = require("./ResendLinkButtonMutation.graphql");
14
+ Object.defineProperty(exports, "ResendLinkButtonMutation", { enumerable: true, get: function () { return __importDefault(ResendLinkButtonMutation_graphql_1).default; } });
15
+ var recoveryMutation_graphql_1 = require("./recoveryMutation.graphql");
16
+ Object.defineProperty(exports, "recoveryMutation", { enumerable: true, get: function () { return __importDefault(recoveryMutation_graphql_1).default; } });
@@ -0,0 +1,19 @@
1
+ import { ConcreteRequest } from 'relay-runtime';
2
+ export type RecoverPasswordInput = {
3
+ token: string;
4
+ password: string;
5
+ };
6
+ export type recoveryMutation$variables = {
7
+ input: RecoverPasswordInput;
8
+ };
9
+ export type recoveryMutation$data = {
10
+ readonly recoverPassword: {
11
+ readonly ok: boolean;
12
+ };
13
+ };
14
+ export type recoveryMutation = {
15
+ response: recoveryMutation$data;
16
+ variables: recoveryMutation$variables;
17
+ };
18
+ declare const node: ConcreteRequest;
19
+ export default node;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ // @ts-nocheck
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var node = (function () {
7
+ var v0 = [
8
+ {
9
+ "defaultValue": null,
10
+ "kind": "LocalArgument",
11
+ "name": "input"
12
+ }
13
+ ], v1 = [
14
+ {
15
+ "alias": null,
16
+ "args": [
17
+ {
18
+ "kind": "Variable",
19
+ "name": "input",
20
+ "variableName": "input"
21
+ }
22
+ ],
23
+ "concreteType": "StatusPayload",
24
+ "kind": "LinkedField",
25
+ "name": "recoverPassword",
26
+ "plural": false,
27
+ "selections": [
28
+ {
29
+ "alias": null,
30
+ "args": null,
31
+ "kind": "ScalarField",
32
+ "name": "ok",
33
+ "storageKey": null
34
+ }
35
+ ],
36
+ "storageKey": null
37
+ }
38
+ ];
39
+ return {
40
+ "fragment": {
41
+ "argumentDefinitions": (v0 /*: any*/),
42
+ "kind": "Fragment",
43
+ "metadata": null,
44
+ "name": "recoveryMutation",
45
+ "selections": (v1 /*: any*/),
46
+ "type": "Mutation",
47
+ "abstractKey": null
48
+ },
49
+ "kind": "Request",
50
+ "operation": {
51
+ "argumentDefinitions": (v0 /*: any*/),
52
+ "kind": "Operation",
53
+ "name": "recoveryMutation",
54
+ "selections": (v1 /*: any*/)
55
+ },
56
+ "params": {
57
+ "cacheID": "recoveryMutationManualReconstruction",
58
+ "id": null,
59
+ "metadata": {},
60
+ "name": "recoveryMutation",
61
+ "operationKind": "mutation",
62
+ "text": "mutation recoveryMutation(\n $input: RecoverPasswordInput!\n) {\n recoverPassword(input: $input) {\n ok\n }\n}\n"
63
+ }
64
+ };
65
+ })();
66
+ node.hash = "recoveryMutationHash";
67
+ exports.default = node;
@@ -0,0 +1,4 @@
1
+ export * from './auth';
2
+ export * from './ui';
3
+ export * from './utils';
4
+ export * from './graphql';
package/dist/index.js ADDED
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./auth"), exports);
18
+ __exportStar(require("./ui"), exports);
19
+ __exportStar(require("./utils"), exports);
20
+ __exportStar(require("./graphql"), exports);
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface AreYouSureProps {
3
+ children: React.ReactNode;
4
+ onYes: () => void;
5
+ yesLabel?: React.ReactNode;
6
+ onNo?: () => void;
7
+ danger?: boolean;
8
+ }
9
+ declare const AreYouSure: React.FC<AreYouSureProps>;
10
+ export default AreYouSure;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ var jsx_runtime_1 = require("react/jsx-runtime");
15
+ var antd_1 = require("antd");
16
+ var next_i18next_1 = require("next-i18next");
17
+ var AreYouSure = function (_a) {
18
+ var children = _a.children, yesLabel = _a.yesLabel, onYes = _a.onYes, onNo = _a.onNo, danger = _a.danger;
19
+ var t = (0, next_i18next_1.useTranslation)().t;
20
+ return ((0, jsx_runtime_1.jsx)(antd_1.Dropdown, __assign({ overlayClassName: 'no-text-selection', menu: {
21
+ items: [
22
+ {
23
+ key: 'group',
24
+ label: t('common:areYouSure.title'),
25
+ type: 'group',
26
+ children: [
27
+ {
28
+ key: 'yes',
29
+ label: yesLabel || t('common:areYouSure.Yes'),
30
+ danger: danger,
31
+ onClick: onYes,
32
+ },
33
+ {
34
+ key: 'no',
35
+ label: t('common:areYouSure.No'),
36
+ onClick: onNo,
37
+ },
38
+ ],
39
+ },
40
+ ],
41
+ }, trigger: ['click'], placement: 'topLeft' }, { children: children })));
42
+ };
43
+ exports.default = AreYouSure;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const FormError: React.FC;
3
+ export default FormError;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var jsx_runtime_1 = require("react/jsx-runtime");
7
+ var form_1 = require("@os-design/form");
8
+ var antd_1 = require("antd");
9
+ var FormItem_1 = __importDefault(require("./FormItem"));
10
+ var FormError = function () {
11
+ var useError = (0, form_1.useExistingForm)().useError;
12
+ var error = useError('_error'); // Use any name that is not used by any field
13
+ return error ? ((0, jsx_runtime_1.jsx)(FormItem_1.default, { children: (0, jsx_runtime_1.jsx)(antd_1.Alert, { type: 'error', message: error, style: { whiteSpace: 'break-spaces' }, className: 'allow-text-selection' }) })) : null;
14
+ };
15
+ exports.default = FormError;
@@ -0,0 +1,12 @@
1
+ import React, { CSSProperties } from 'react';
2
+ interface FormItemProps {
3
+ children?: React.ReactNode;
4
+ label?: React.ReactNode;
5
+ className?: string;
6
+ error?: string | undefined;
7
+ help?: React.ReactNode;
8
+ isRequired?: boolean;
9
+ style?: CSSProperties;
10
+ }
11
+ declare const FormItem: React.FC<FormItemProps>;
12
+ export default FormItem;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ var jsx_runtime_1 = require("react/jsx-runtime");
15
+ var antd_1 = require("antd");
16
+ var next_i18next_1 = require("next-i18next");
17
+ var FormItem = function (_a) {
18
+ var children = _a.children, label = _a.label, error = _a.error, help = _a.help, className = _a.className, _b = _a.isRequired, isRequired = _b === void 0 ? false : _b, style = _a.style;
19
+ var t = (0, next_i18next_1.useTranslation)('common').t;
20
+ return ((0, jsx_runtime_1.jsx)(antd_1.Form.Item, __assign({ style: style, className: className, label: label ? ((0, jsx_runtime_1.jsxs)("span", __assign({ style: {
21
+ width: '100%',
22
+ display: 'flex',
23
+ justifyContent: 'space-between',
24
+ alignItems: 'center',
25
+ } }, { children: [(0, jsx_runtime_1.jsxs)("span", { children: [label, isRequired && ((0, jsx_runtime_1.jsx)("span", __assign({ style: { color: 'red', marginLeft: 5 }, title: t('formItem.required') }, { children: "*" })))] }), (0, jsx_runtime_1.jsx)("span", { children: help })] }))) : null, help: error, validateStatus: error !== undefined ? 'error' : undefined }, { children: children })));
26
+ };
27
+ exports.default = FormItem;