@proteinjs/user-ui 1.4.2 → 1.5.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.
- package/CHANGELOG.md +19 -0
- package/dist/generated/index.d.ts +0 -9
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +0 -9
- package/dist/generated/index.js.map +1 -1
- package/dist/src/auth/AuthApi.d.ts +12 -0
- package/dist/src/auth/AuthApi.d.ts.map +1 -0
- package/dist/src/auth/AuthApi.js +151 -0
- package/dist/src/auth/AuthApi.js.map +1 -0
- package/dist/src/auth/AuthButton.d.ts +13 -0
- package/dist/src/auth/AuthButton.d.ts.map +1 -0
- package/dist/src/auth/AuthButton.js +21 -0
- package/dist/src/auth/AuthButton.js.map +1 -0
- package/dist/src/auth/AuthFormError.d.ts +6 -0
- package/dist/src/auth/AuthFormError.d.ts.map +1 -0
- package/dist/src/auth/AuthFormError.js +18 -0
- package/dist/src/auth/AuthFormError.js.map +1 -0
- package/dist/src/auth/AuthLayout.d.ts +17 -0
- package/dist/src/auth/AuthLayout.d.ts.map +1 -0
- package/dist/src/auth/AuthLayout.js +52 -0
- package/dist/src/auth/AuthLayout.js.map +1 -0
- package/dist/src/auth/AuthMessagePanel.d.ts +13 -0
- package/dist/src/auth/AuthMessagePanel.d.ts.map +1 -0
- package/dist/src/auth/AuthMessagePanel.js +22 -0
- package/dist/src/auth/AuthMessagePanel.js.map +1 -0
- package/dist/src/auth/AuthTextField.d.ts +21 -0
- package/dist/src/auth/AuthTextField.d.ts.map +1 -0
- package/dist/src/auth/AuthTextField.js +60 -0
- package/dist/src/auth/AuthTextField.js.map +1 -0
- package/dist/src/auth/AuthValidation.d.ts +18 -0
- package/dist/src/auth/AuthValidation.d.ts.map +1 -0
- package/dist/src/auth/AuthValidation.js +38 -0
- package/dist/src/auth/AuthValidation.js.map +1 -0
- package/dist/src/pages/ForgotPassword.d.ts.map +1 -1
- package/dist/src/pages/ForgotPassword.js +77 -75
- package/dist/src/pages/ForgotPassword.js.map +1 -1
- package/dist/src/pages/Login.d.ts.map +1 -1
- package/dist/src/pages/Login.js +79 -97
- package/dist/src/pages/Login.js.map +1 -1
- package/dist/src/pages/PasswordReset.d.ts.map +1 -1
- package/dist/src/pages/PasswordReset.js +86 -134
- package/dist/src/pages/PasswordReset.js.map +1 -1
- package/dist/src/pages/Signup.d.ts.map +1 -1
- package/dist/src/pages/Signup.js +88 -148
- package/dist/src/pages/Signup.js.map +1 -1
- package/dist/test/authApi.test.d.ts +2 -0
- package/dist/test/authApi.test.d.ts.map +1 -0
- package/dist/test/authApi.test.js +188 -0
- package/dist/test/authApi.test.js.map +1 -0
- package/dist/test/authPages.test.d.ts +2 -0
- package/dist/test/authPages.test.d.ts.map +1 -0
- package/dist/test/authPages.test.js +52 -0
- package/dist/test/authPages.test.js.map +1 -0
- package/dist/test/authValidation.test.d.ts +2 -0
- package/dist/test/authValidation.test.d.ts.map +1 -0
- package/dist/test/authValidation.test.js +52 -0
- package/dist/test/authValidation.test.js.map +1 -0
- package/generated/index.ts +0 -9
- package/package.json +4 -4
- package/src/auth/AuthApi.ts +67 -0
- package/src/auth/AuthButton.tsx +38 -0
- package/src/auth/AuthFormError.tsx +15 -0
- package/src/auth/AuthLayout.tsx +69 -0
- package/src/auth/AuthMessagePanel.tsx +28 -0
- package/src/auth/AuthTextField.tsx +75 -0
- package/src/auth/AuthValidation.ts +39 -0
- package/src/pages/ForgotPassword.tsx +77 -56
- package/src/pages/Login.tsx +74 -78
- package/src/pages/PasswordReset.tsx +118 -124
- package/src/pages/Signup.tsx +117 -136
- package/test/authApi.test.ts +92 -0
- package/test/authPages.test.tsx +51 -0
- package/test/authValidation.test.ts +56 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.5.1](https://github.com/proteinjs/user/compare/@proteinjs/user-ui@1.5.0...@proteinjs/user-ui@1.5.1) (2026-08-19)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @proteinjs/user-ui
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [1.5.0](https://github.com/proteinjs/user/compare/@proteinjs/user-ui@1.4.2...@proteinjs/user-ui@1.5.0) (2026-08-14)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* modernize the logged-out auth surfaces (login, signup, forgot/reset password) ([215002e](https://github.com/proteinjs/user/commit/215002eb59cc71061bd07accd8750d801d51c4f4))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [1.4.2](https://github.com/proteinjs/user/compare/@proteinjs/user-ui@1.4.1...@proteinjs/user-ui@1.4.2) (2026-08-14)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @proteinjs/user-ui
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
/** Load Dependency Source Graphs */
|
|
2
|
-
import '@mui/icons-material';
|
|
3
|
-
import '@mui/material';
|
|
4
2
|
import '@proteinjs/db';
|
|
5
3
|
import '@proteinjs/db-ui';
|
|
6
|
-
import '@proteinjs/reflection';
|
|
7
4
|
import '@proteinjs/server-api';
|
|
8
5
|
import '@proteinjs/ui';
|
|
9
6
|
import '@proteinjs/user';
|
|
10
|
-
import '@proteinjs/util';
|
|
11
|
-
import 'moment';
|
|
12
|
-
import 'react';
|
|
13
|
-
import 'react-dom';
|
|
14
|
-
import 'react-helmet';
|
|
15
|
-
import 'react-router-dom';
|
|
16
7
|
export * from '../index';
|
|
17
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AAEpC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AAEpC,OAAO,eAAe,CAAC;AACvB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,eAAe,CAAC;AACvB,OAAO,iBAAiB,CAAC;AA+BzB,cAAc,UAAU,CAAC"}
|
package/dist/generated/index.js
CHANGED
|
@@ -15,20 +15,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
16
|
};
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
require("@mui/icons-material");
|
|
19
|
-
require("@mui/material");
|
|
20
18
|
require("@proteinjs/db");
|
|
21
19
|
require("@proteinjs/db-ui");
|
|
22
|
-
require("@proteinjs/reflection");
|
|
23
20
|
require("@proteinjs/server-api");
|
|
24
21
|
require("@proteinjs/ui");
|
|
25
22
|
require("@proteinjs/user");
|
|
26
|
-
require("@proteinjs/util");
|
|
27
|
-
require("moment");
|
|
28
|
-
require("react");
|
|
29
|
-
require("react-dom");
|
|
30
|
-
require("react-helmet");
|
|
31
|
-
require("react-router-dom");
|
|
32
23
|
/** Generate Source Graph */
|
|
33
24
|
var sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"/Omit\"},{\"v\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"InviteRecordFormCustomization\",\"filePath\":\"/home/runner/work/user/user/packages/ui/src/form/InviteRecordFormCustomization.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"table\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[{\"name\":\"getFieldLayout\",\"returnType\":{\"packageName\":\"\",\"name\":\"string[] | string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[] | string[][]\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"defaultFieldLayout\",\"type\":{\"packageName\":\"\",\"name\":\"string[] | string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[] | string[][]\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getFormButtons\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButtons<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButtons<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"defaultFormButtons\",\"type\":{\"packageName\":\"\",\"name\":\"FormButtons<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButtons<any>\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"sendButton\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButton<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButton<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"revokeButton\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButton<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButton<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"canManageUsers\",\"returnType\":{\"packageName\":\"\",\"name\":\"boolean\",\"filePath\":null,\"qualifiedName\":\"/boolean\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[]}],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[{\"packageName\":\"@proteinjs/db-ui\",\"name\":\"RecordFormCustomization\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db-ui/RecordFormCustomization\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[]}],\"sourceType\":2}},{\"v\":\"@proteinjs/db-ui/RecordFormCustomization\"},{\"v\":\"@proteinjs/user-ui/forgotPasswordPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"forgotPasswordPage\",\"filePath\":\"/home/runner/work/user/user/packages/ui/src/pages/ForgotPassword.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/forgotPasswordPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/ui/Page\"},{\"v\":\"@proteinjs/user-ui/loginPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"loginPage\",\"filePath\":\"/home/runner/work/user/user/packages/ui/src/pages/Login.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/loginPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/user-ui/passwordResetPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"passwordResetPage\",\"filePath\":\"/home/runner/work/user/user/packages/ui/src/pages/PasswordReset.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/passwordResetPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/user-ui/signupPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"signupPage\",\"filePath\":\"/home/runner/work/user/user/packages/ui/src/pages/Signup.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/signupPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}}],\"edges\":[{\"v\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"w\":\"@proteinjs/db-ui/RecordFormCustomization\",\"value\":\"extends class\"},{\"v\":\"@proteinjs/user-ui/forgotPasswordPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/loginPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/passwordResetPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/signupPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"}]}";
|
|
34
25
|
/** Generate Source Links */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAEpC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAEpC,yBAAuB;AACvB,4BAA0B;AAC1B,iCAA+B;AAC/B,yBAAuB;AACvB,2BAAyB;AAGzB,4BAA4B;AAE5B,IAAM,WAAW,GAAG,y4NAAy4N,CAAC;AAG95N,4BAA4B;AAE5B,2FAA0F;AAC1F,8DAAiE;AACjE,4CAA+C;AAC/C,4DAA+D;AAC/D,8CAAiD;AAEjD,IAAM,WAAW,GAAG;IACnB,kDAAkD,EAAE,6DAA6B;IACjF,uCAAuC,EAAE,mCAAkB;IAC3D,8BAA8B,EAAE,iBAAS;IACzC,sCAAsC,EAAE,iCAAiB;IACzD,+BAA+B,EAAE,mBAAU;CAC3C,CAAC;AAGF,kCAAkC;AAElC,oDAAyD;AACzD,6BAAgB,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAGjD,2CAAyB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The auth flows' server calls, in one place so the pages hold presentation only.
|
|
3
|
+
* Methods resolve on success and throw an `Error` whose message is user-readable.
|
|
4
|
+
*/
|
|
5
|
+
export declare class AuthApi {
|
|
6
|
+
login(email: string, password: string): Promise<void>;
|
|
7
|
+
initiatePasswordReset(email: string): Promise<void>;
|
|
8
|
+
/** Resolves with an error message when the token is invalid; undefined when it's valid. */
|
|
9
|
+
validateResetToken(token: string): Promise<string | undefined>;
|
|
10
|
+
executePasswordReset(token: string, newPassword: string): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=AuthApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthApi.d.ts","sourceRoot":"","sources":["../../../src/auth/AuthApi.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,qBAAa,OAAO;IACZ,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBrD,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBzD,2FAA2F;IACrF,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAW9D,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAW9E"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.AuthApi = void 0;
|
|
40
|
+
var user_1 = require("@proteinjs/user");
|
|
41
|
+
/**
|
|
42
|
+
* The auth flows' server calls, in one place so the pages hold presentation only.
|
|
43
|
+
* Methods resolve on success and throw an `Error` whose message is user-readable.
|
|
44
|
+
*/
|
|
45
|
+
var AuthApi = /** @class */ (function () {
|
|
46
|
+
function AuthApi() {
|
|
47
|
+
}
|
|
48
|
+
AuthApi.prototype.login = function (email, password) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
50
|
+
var response, body;
|
|
51
|
+
return __generator(this, function (_a) {
|
|
52
|
+
switch (_a.label) {
|
|
53
|
+
case 0: return [4 /*yield*/, fetch(user_1.routes.login.path, {
|
|
54
|
+
method: user_1.routes.login.method,
|
|
55
|
+
body: JSON.stringify({ email: email, password: password }),
|
|
56
|
+
redirect: 'follow',
|
|
57
|
+
credentials: 'same-origin',
|
|
58
|
+
headers: { 'Content-Type': 'application/json' },
|
|
59
|
+
})];
|
|
60
|
+
case 1:
|
|
61
|
+
response = _a.sent();
|
|
62
|
+
if (response.status != 200) {
|
|
63
|
+
throw new Error("Failed to log in, error: ".concat(response.statusText));
|
|
64
|
+
}
|
|
65
|
+
return [4 /*yield*/, response.json()];
|
|
66
|
+
case 2:
|
|
67
|
+
body = _a.sent();
|
|
68
|
+
if (body.error) {
|
|
69
|
+
throw new Error(body.error);
|
|
70
|
+
}
|
|
71
|
+
return [2 /*return*/];
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
AuthApi.prototype.initiatePasswordReset = function (email) {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
78
|
+
var response, body;
|
|
79
|
+
return __generator(this, function (_a) {
|
|
80
|
+
switch (_a.label) {
|
|
81
|
+
case 0: return [4 /*yield*/, fetch(user_1.routes.initiatePasswordReset.path, {
|
|
82
|
+
method: user_1.routes.initiatePasswordReset.method,
|
|
83
|
+
body: JSON.stringify({ email: email }),
|
|
84
|
+
redirect: 'follow',
|
|
85
|
+
credentials: 'same-origin',
|
|
86
|
+
headers: { 'Content-Type': 'application/json' },
|
|
87
|
+
})];
|
|
88
|
+
case 1:
|
|
89
|
+
response = _a.sent();
|
|
90
|
+
if (response.status != 200) {
|
|
91
|
+
throw new Error("Failed to send the reset email. Please try again.");
|
|
92
|
+
}
|
|
93
|
+
return [4 /*yield*/, response.json()];
|
|
94
|
+
case 2:
|
|
95
|
+
body = _a.sent();
|
|
96
|
+
if (body.error) {
|
|
97
|
+
throw new Error("Failed to send the reset email. Please try again.");
|
|
98
|
+
}
|
|
99
|
+
return [2 /*return*/];
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
/** Resolves with an error message when the token is invalid; undefined when it's valid. */
|
|
105
|
+
AuthApi.prototype.validateResetToken = function (token) {
|
|
106
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
107
|
+
var response, body;
|
|
108
|
+
return __generator(this, function (_a) {
|
|
109
|
+
switch (_a.label) {
|
|
110
|
+
case 0: return [4 /*yield*/, fetch("".concat(user_1.routes.validateResetToken.path, "?token=").concat(token), {
|
|
111
|
+
method: user_1.routes.validateResetToken.method,
|
|
112
|
+
credentials: 'same-origin',
|
|
113
|
+
})];
|
|
114
|
+
case 1:
|
|
115
|
+
response = _a.sent();
|
|
116
|
+
return [4 /*yield*/, response.json()];
|
|
117
|
+
case 2:
|
|
118
|
+
body = _a.sent();
|
|
119
|
+
if (!body.isValid) {
|
|
120
|
+
return [2 /*return*/, body.message || 'Invalid or expired token'];
|
|
121
|
+
}
|
|
122
|
+
return [2 /*return*/];
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
AuthApi.prototype.executePasswordReset = function (token, newPassword) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
129
|
+
var response;
|
|
130
|
+
return __generator(this, function (_a) {
|
|
131
|
+
switch (_a.label) {
|
|
132
|
+
case 0: return [4 /*yield*/, fetch(user_1.routes.executePasswordReset.path, {
|
|
133
|
+
method: user_1.routes.executePasswordReset.method,
|
|
134
|
+
body: JSON.stringify({ token: token, newPassword: newPassword }),
|
|
135
|
+
credentials: 'same-origin',
|
|
136
|
+
headers: { 'Content-Type': 'application/json' },
|
|
137
|
+
})];
|
|
138
|
+
case 1:
|
|
139
|
+
response = _a.sent();
|
|
140
|
+
if (response.status !== 200) {
|
|
141
|
+
throw new Error('Failed to reset password');
|
|
142
|
+
}
|
|
143
|
+
return [2 /*return*/];
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
return AuthApi;
|
|
149
|
+
}());
|
|
150
|
+
exports.AuthApi = AuthApi;
|
|
151
|
+
//# sourceMappingURL=AuthApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthApi.js","sourceRoot":"","sources":["../../../src/auth/AuthApi.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface AuthButtonProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/** Renders a spinner and disables the button. */
|
|
5
|
+
busy?: boolean;
|
|
6
|
+
/** Defaults to 'submit' so the enclosing form submits on Enter. */
|
|
7
|
+
type?: 'submit' | 'button';
|
|
8
|
+
href?: string;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
}
|
|
11
|
+
/** The auth surfaces' primary action: a full-width 48px pill in the host theme's primary color. */
|
|
12
|
+
export declare function AuthButton(props: AuthButtonProps): React.JSX.Element;
|
|
13
|
+
//# sourceMappingURL=AuthButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthButton.d.ts","sourceRoot":"","sources":["../../../src/auth/AuthButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,iDAAiD;IACjD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,mEAAmE;IACnE,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,mGAAmG;AACnG,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,qBAuBhD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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.AuthButton = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var material_1 = require("@mui/material");
|
|
9
|
+
/** The auth surfaces' primary action: a full-width 48px pill in the host theme's primary color. */
|
|
10
|
+
function AuthButton(props) {
|
|
11
|
+
var children = props.children, busy = props.busy, type = props.type, href = props.href, onClick = props.onClick;
|
|
12
|
+
return (react_1.default.createElement(material_1.Button, { fullWidth: true, variant: 'contained', color: 'primary', disableElevation: true, type: type || 'submit', disabled: busy, href: href, onClick: onClick, sx: {
|
|
13
|
+
height: 48,
|
|
14
|
+
borderRadius: '999px',
|
|
15
|
+
fontSize: '1rem',
|
|
16
|
+
fontWeight: 500,
|
|
17
|
+
textTransform: 'none',
|
|
18
|
+
} }, busy ? react_1.default.createElement(material_1.CircularProgress, { size: 20, sx: { color: 'inherit' } }) : children));
|
|
19
|
+
}
|
|
20
|
+
exports.AuthButton = AuthButton;
|
|
21
|
+
//# sourceMappingURL=AuthButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthButton.js","sourceRoot":"","sources":["../../../src/auth/AuthButton.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAC1B,0CAAyD;AAYzD,mGAAmG;AACnG,SAAgB,UAAU,CAAC,KAAsB;IACvC,IAAA,QAAQ,GAAgC,KAAK,SAArC,EAAE,IAAI,GAA0B,KAAK,KAA/B,EAAE,IAAI,GAAoB,KAAK,KAAzB,EAAE,IAAI,GAAc,KAAK,KAAnB,EAAE,OAAO,GAAK,KAAK,QAAV,CAAW;IACtD,OAAO,CACL,8BAAC,iBAAM,IACL,SAAS,QACT,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,SAAS,EACf,gBAAgB,QAChB,IAAI,EAAE,IAAI,IAAI,QAAQ,EACtB,QAAQ,EAAE,IAAI,EACd,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE;YACF,MAAM,EAAE,EAAE;YACV,YAAY,EAAE,OAAO;YACrB,QAAQ,EAAE,MAAM;YAChB,UAAU,EAAE,GAAG;YACf,aAAa,EAAE,MAAM;SACtB,IAEA,IAAI,CAAC,CAAC,CAAC,8BAAC,2BAAgB,IAAC,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,GAAI,CAAC,CAAC,CAAC,QAAQ,CACpE,CACV,CAAC;AACJ,CAAC;AAvBD,gCAuBC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/** Inline form-level error line, rendered between the fields and the primary action. */
|
|
3
|
+
export declare function AuthFormError({ message }: {
|
|
4
|
+
message: string | undefined;
|
|
5
|
+
}): React.JSX.Element | null;
|
|
6
|
+
//# sourceMappingURL=AuthFormError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthFormError.d.ts","sourceRoot":"","sources":["../../../src/auth/AuthFormError.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,wFAAwF;AACxF,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,4BAUzE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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.AuthFormError = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var material_1 = require("@mui/material");
|
|
9
|
+
/** Inline form-level error line, rendered between the fields and the primary action. */
|
|
10
|
+
function AuthFormError(_a) {
|
|
11
|
+
var message = _a.message;
|
|
12
|
+
if (!message) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return (react_1.default.createElement(material_1.Typography, { role: 'alert', sx: { color: 'error.main', fontSize: '0.875rem', lineHeight: 1.45, mb: 2 } }, message));
|
|
16
|
+
}
|
|
17
|
+
exports.AuthFormError = AuthFormError;
|
|
18
|
+
//# sourceMappingURL=AuthFormError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthFormError.js","sourceRoot":"","sources":["../../../src/auth/AuthFormError.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAC1B,0CAA2C;AAE3C,wFAAwF;AACxF,SAAgB,aAAa,CAAC,EAA4C;QAA1C,OAAO,aAAA;IACrC,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,8BAAC,qBAAU,IAAC,IAAI,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,IAChG,OAAO,CACG,CACd,CAAC;AACJ,CAAC;AAVD,sCAUC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
export interface AuthLayoutProps {
|
|
3
|
+
title: string;
|
|
4
|
+
/** Optional supporting line rendered under the title. */
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Shared shell for the logged-out auth surfaces (login, signup, forgot/reset password).
|
|
10
|
+
*
|
|
11
|
+
* A single centered column that owns its own scrolling: on phones the on-screen keyboard
|
|
12
|
+
* shrinks the app's dvh-sized page host, and the column scrolls instead of clipping the
|
|
13
|
+
* fields. All colors come from the host app's MUI theme — this package stays generic and
|
|
14
|
+
* the app's theme provider supplies the look.
|
|
15
|
+
*/
|
|
16
|
+
export declare function AuthLayout(props: AuthLayoutProps): React.JSX.Element;
|
|
17
|
+
//# sourceMappingURL=AuthLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthLayout.d.ts","sourceRoot":"","sources":["../../../src/auth/AuthLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,qBAkDhD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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.AuthLayout = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var material_1 = require("@mui/material");
|
|
9
|
+
/**
|
|
10
|
+
* Shared shell for the logged-out auth surfaces (login, signup, forgot/reset password).
|
|
11
|
+
*
|
|
12
|
+
* A single centered column that owns its own scrolling: on phones the on-screen keyboard
|
|
13
|
+
* shrinks the app's dvh-sized page host, and the column scrolls instead of clipping the
|
|
14
|
+
* fields. All colors come from the host app's MUI theme — this package stays generic and
|
|
15
|
+
* the app's theme provider supplies the look.
|
|
16
|
+
*/
|
|
17
|
+
function AuthLayout(props) {
|
|
18
|
+
var title = props.title, subtitle = props.subtitle, children = props.children;
|
|
19
|
+
return (react_1.default.createElement(material_1.Box, { sx: {
|
|
20
|
+
flex: 1,
|
|
21
|
+
minHeight: 0,
|
|
22
|
+
width: '100%',
|
|
23
|
+
overflowY: 'auto',
|
|
24
|
+
WebkitOverflowScrolling: 'touch',
|
|
25
|
+
display: 'flex',
|
|
26
|
+
flexDirection: 'column',
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
backgroundColor: 'background.default',
|
|
29
|
+
} },
|
|
30
|
+
react_1.default.createElement(material_1.Box, { sx: {
|
|
31
|
+
width: '100%',
|
|
32
|
+
maxWidth: 400,
|
|
33
|
+
px: 3,
|
|
34
|
+
// Fixed share of the (dvh-sized) viewport: sits in the upper third at rest and
|
|
35
|
+
// collapses gracefully when the phone keyboard shrinks the viewport.
|
|
36
|
+
pt: 'clamp(48px, 16vh, 160px)',
|
|
37
|
+
pb: 6,
|
|
38
|
+
display: 'flex',
|
|
39
|
+
flexDirection: 'column',
|
|
40
|
+
} },
|
|
41
|
+
react_1.default.createElement(material_1.Typography, { component: 'h1', sx: {
|
|
42
|
+
fontSize: '1.5rem',
|
|
43
|
+
fontWeight: 600,
|
|
44
|
+
letterSpacing: '-0.01em',
|
|
45
|
+
color: 'text.primary',
|
|
46
|
+
mb: subtitle ? 1 : 4,
|
|
47
|
+
} }, title),
|
|
48
|
+
subtitle && (react_1.default.createElement(material_1.Typography, { sx: { fontSize: '0.875rem', lineHeight: 1.45, color: 'text.secondary', mb: 4 } }, subtitle)),
|
|
49
|
+
children)));
|
|
50
|
+
}
|
|
51
|
+
exports.AuthLayout = AuthLayout;
|
|
52
|
+
//# sourceMappingURL=AuthLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthLayout.js","sourceRoot":"","sources":["../../../src/auth/AuthLayout.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAAyC;AACzC,0CAAgD;AAShD;;;;;;;GAOG;AACH,SAAgB,UAAU,CAAC,KAAsB;IACvC,IAAA,KAAK,GAAyB,KAAK,MAA9B,EAAE,QAAQ,GAAe,KAAK,SAApB,EAAE,QAAQ,GAAK,KAAK,SAAV,CAAW;IAC5C,OAAO,CACL,8BAAC,cAAG,IACF,EAAE,EAAE;YACF,IAAI,EAAE,CAAC;YACP,SAAS,EAAE,CAAC;YACZ,KAAK,EAAE,MAAM;YACb,SAAS,EAAE,MAAM;YACjB,uBAAuB,EAAE,OAAO;YAChC,OAAO,EAAE,MAAM;YACf,aAAa,EAAE,QAAQ;YACvB,UAAU,EAAE,QAAQ;YACpB,eAAe,EAAE,oBAAoB;SACtC;QAED,8BAAC,cAAG,IACF,EAAE,EAAE;gBACF,KAAK,EAAE,MAAM;gBACb,QAAQ,EAAE,GAAG;gBACb,EAAE,EAAE,CAAC;gBACL,+EAA+E;gBAC/E,qEAAqE;gBACrE,EAAE,EAAE,0BAA0B;gBAC9B,EAAE,EAAE,CAAC;gBACL,OAAO,EAAE,MAAM;gBACf,aAAa,EAAE,QAAQ;aACxB;YAED,8BAAC,qBAAU,IACT,SAAS,EAAC,IAAI,EACd,EAAE,EAAE;oBACF,QAAQ,EAAE,QAAQ;oBAClB,UAAU,EAAE,GAAG;oBACf,aAAa,EAAE,SAAS;oBACxB,KAAK,EAAE,cAAc;oBACrB,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;iBACrB,IAEA,KAAK,CACK;YACZ,QAAQ,IAAI,CACX,8BAAC,qBAAU,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAAE,CAAC,EAAE,IACvF,QAAQ,CACE,CACd;YACA,QAAQ,CACL,CACF,CACP,CAAC;AACJ,CAAC;AAlDD,gCAkDC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface AuthMessagePanelProps {
|
|
3
|
+
title: string;
|
|
4
|
+
body: string;
|
|
5
|
+
actionName: string;
|
|
6
|
+
actionHref: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Status states of the auth flows (link expired, reset complete, signup unavailable):
|
|
10
|
+
* a title, one line of body copy, and a single primary action.
|
|
11
|
+
*/
|
|
12
|
+
export declare function AuthMessagePanel(props: AuthMessagePanelProps): React.JSX.Element;
|
|
13
|
+
//# sourceMappingURL=AuthMessagePanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthMessagePanel.d.ts","sourceRoot":"","sources":["../../../src/auth/AuthMessagePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qBAW5D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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.AuthMessagePanel = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var material_1 = require("@mui/material");
|
|
9
|
+
var AuthLayout_1 = require("./AuthLayout");
|
|
10
|
+
var AuthButton_1 = require("./AuthButton");
|
|
11
|
+
/**
|
|
12
|
+
* Status states of the auth flows (link expired, reset complete, signup unavailable):
|
|
13
|
+
* a title, one line of body copy, and a single primary action.
|
|
14
|
+
*/
|
|
15
|
+
function AuthMessagePanel(props) {
|
|
16
|
+
var title = props.title, body = props.body, actionName = props.actionName, actionHref = props.actionHref;
|
|
17
|
+
return (react_1.default.createElement(AuthLayout_1.AuthLayout, { title: title, subtitle: body },
|
|
18
|
+
react_1.default.createElement(material_1.Box, { sx: { mt: 1 } },
|
|
19
|
+
react_1.default.createElement(AuthButton_1.AuthButton, { type: 'button', href: actionHref }, actionName))));
|
|
20
|
+
}
|
|
21
|
+
exports.AuthMessagePanel = AuthMessagePanel;
|
|
22
|
+
//# sourceMappingURL=AuthMessagePanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthMessagePanel.js","sourceRoot":"","sources":["../../../src/auth/AuthMessagePanel.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAC1B,0CAAoC;AACpC,2CAA0C;AAC1C,2CAA0C;AAS1C;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,KAA4B;IACnD,IAAA,KAAK,GAAmC,KAAK,MAAxC,EAAE,IAAI,GAA6B,KAAK,KAAlC,EAAE,UAAU,GAAiB,KAAK,WAAtB,EAAE,UAAU,GAAK,KAAK,WAAV,CAAW;IACtD,OAAO,CACL,8BAAC,uBAAU,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI;QACtC,8BAAC,cAAG,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE;YAChB,8BAAC,uBAAU,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,UAAU,IACvC,UAAU,CACA,CACT,CACK,CACd,CAAC;AACJ,CAAC;AAXD,4CAWC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface AuthTextFieldProps {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
/** Renders a reveal toggle and masks input until toggled. */
|
|
7
|
+
password?: boolean;
|
|
8
|
+
/** HTML autocomplete token (e.g. 'email', 'current-password', 'new-password'). */
|
|
9
|
+
autoComplete?: string;
|
|
10
|
+
/** HTML input type when not a password field (e.g. 'email'). */
|
|
11
|
+
type?: string;
|
|
12
|
+
autoFocus?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Auth-surface text input: a small label above a rounded field (the label-above pattern —
|
|
17
|
+
* no floating-label notch fighting the corner radius). 48px tall for a comfortable touch
|
|
18
|
+
* target; 1rem input text so mobile browsers don't auto-zoom the field on focus.
|
|
19
|
+
*/
|
|
20
|
+
export declare function AuthTextField(props: AuthTextFieldProps): React.JSX.Element;
|
|
21
|
+
//# sourceMappingURL=AuthTextField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthTextField.d.ts","sourceRoot":"","sources":["../../../src/auth/AuthTextField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,qBAkDtD"}
|
|
@@ -0,0 +1,60 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.AuthTextField = void 0;
|
|
30
|
+
var react_1 = __importStar(require("react"));
|
|
31
|
+
var material_1 = require("@mui/material");
|
|
32
|
+
var Visibility_1 = __importDefault(require("@mui/icons-material/Visibility"));
|
|
33
|
+
var VisibilityOff_1 = __importDefault(require("@mui/icons-material/VisibilityOff"));
|
|
34
|
+
/**
|
|
35
|
+
* Auth-surface text input: a small label above a rounded field (the label-above pattern —
|
|
36
|
+
* no floating-label notch fighting the corner radius). 48px tall for a comfortable touch
|
|
37
|
+
* target; 1rem input text so mobile browsers don't auto-zoom the field on focus.
|
|
38
|
+
*/
|
|
39
|
+
function AuthTextField(props) {
|
|
40
|
+
var label = props.label, value = props.value, onChange = props.onChange, password = props.password, autoComplete = props.autoComplete, type = props.type, autoFocus = props.autoFocus, disabled = props.disabled;
|
|
41
|
+
var _a = (0, react_1.useState)(false), revealed = _a[0], setRevealed = _a[1];
|
|
42
|
+
return (react_1.default.createElement(material_1.Box, { sx: { mb: 2.5 } },
|
|
43
|
+
react_1.default.createElement(material_1.Typography, { component: 'label', htmlFor: "auth-field-".concat(label), sx: { display: 'block', fontSize: '0.875rem', fontWeight: 500, color: 'text.primary', mb: 0.75 } }, label),
|
|
44
|
+
react_1.default.createElement(material_1.TextField, { id: "auth-field-".concat(label), fullWidth: true, value: value, onChange: function (event) { return onChange(event.target.value); }, type: password && !revealed ? 'password' : password ? 'text' : type || 'text', autoComplete: autoComplete, autoFocus: autoFocus, disabled: disabled, InputProps: {
|
|
45
|
+
endAdornment: password ? (react_1.default.createElement(material_1.InputAdornment, { position: 'end' },
|
|
46
|
+
react_1.default.createElement(material_1.IconButton, { "aria-label": revealed ? 'Hide password' : 'Show password', onClick: function () { return setRevealed(!revealed); }, edge: 'end', sx: { color: 'text.secondary', p: '12px' } }, revealed ? react_1.default.createElement(VisibilityOff_1.default, { sx: { fontSize: 20 } }) : react_1.default.createElement(Visibility_1.default, { sx: { fontSize: 20 } })))) : undefined,
|
|
47
|
+
}, sx: {
|
|
48
|
+
'& .MuiOutlinedInput-root': {
|
|
49
|
+
borderRadius: '12px',
|
|
50
|
+
backgroundColor: 'background.paper',
|
|
51
|
+
fontSize: '1rem',
|
|
52
|
+
'& input': { py: '12.5px', px: '14px' },
|
|
53
|
+
'& fieldset': { borderColor: 'divider' },
|
|
54
|
+
'&:hover fieldset': { borderColor: 'text.disabled' },
|
|
55
|
+
'&.Mui-focused fieldset': { borderColor: 'primary.main', borderWidth: '1.5px' },
|
|
56
|
+
},
|
|
57
|
+
} })));
|
|
58
|
+
}
|
|
59
|
+
exports.AuthTextField = AuthTextField;
|
|
60
|
+
//# sourceMappingURL=AuthTextField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthTextField.js","sourceRoot":"","sources":["../../../src/auth/AuthTextField.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAwC;AACxC,0CAAuF;AACvF,8EAAwD;AACxD,oFAA8D;AAgB9D;;;;GAIG;AACH,SAAgB,aAAa,CAAC,KAAyB;IAC7C,IAAA,KAAK,GAAyE,KAAK,MAA9E,EAAE,KAAK,GAAkE,KAAK,MAAvE,EAAE,QAAQ,GAAwD,KAAK,SAA7D,EAAE,QAAQ,GAA8C,KAAK,SAAnD,EAAE,YAAY,GAAgC,KAAK,aAArC,EAAE,IAAI,GAA0B,KAAK,KAA/B,EAAE,SAAS,GAAe,KAAK,UAApB,EAAE,QAAQ,GAAK,KAAK,SAAV,CAAW;IACtF,IAAA,KAA0B,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAAxC,QAAQ,QAAA,EAAE,WAAW,QAAmB,CAAC;IAEhD,OAAO,CACL,8BAAC,cAAG,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE;QAClB,8BAAC,qBAAU,IACT,SAAS,EAAC,OAAO,EACjB,OAAO,EAAE,qBAAc,KAAK,CAAE,EAC9B,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,IAAI,EAAE,IAE/F,KAAK,CACK;QACb,8BAAC,oBAAS,IACR,EAAE,EAAE,qBAAc,KAAK,CAAE,EACzB,SAAS,QACT,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,UAAC,KAAK,IAAK,OAAA,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAA5B,CAA4B,EACjD,IAAI,EAAE,QAAQ,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,MAAM,EAC7E,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE;gBACV,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CACvB,8BAAC,yBAAc,IAAC,QAAQ,EAAC,KAAK;oBAC5B,8BAAC,qBAAU,kBACG,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,EACxD,OAAO,EAAE,cAAM,OAAA,WAAW,CAAC,CAAC,QAAQ,CAAC,EAAtB,CAAsB,EACrC,IAAI,EAAC,KAAK,EACV,EAAE,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC,EAAE,MAAM,EAAE,IAEzC,QAAQ,CAAC,CAAC,CAAC,8BAAC,uBAAa,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAI,CAAC,CAAC,CAAC,8BAAC,oBAAU,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAI,CAC/E,CACE,CAClB,CAAC,CAAC,CAAC,SAAS;aACd,EACD,EAAE,EAAE;gBACF,0BAA0B,EAAE;oBAC1B,YAAY,EAAE,MAAM;oBACpB,eAAe,EAAE,kBAAkB;oBACnC,QAAQ,EAAE,MAAM;oBAChB,SAAS,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE;oBACvC,YAAY,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE;oBACxC,kBAAkB,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE;oBACpD,wBAAwB,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE;iBAChF;aACF,GACD,CACE,CACP,CAAC;AACJ,CAAC;AAlDD,sCAkDC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client-side validation for the auth flows. Each method returns a user-readable
|
|
3
|
+
* error message, or undefined when the input is valid.
|
|
4
|
+
*/
|
|
5
|
+
export declare class AuthValidation {
|
|
6
|
+
/** @param invited invited users don't enter an email (the invite token carries it) */
|
|
7
|
+
static signup(fields: {
|
|
8
|
+
name: string;
|
|
9
|
+
email: string;
|
|
10
|
+
password: string;
|
|
11
|
+
confirmPassword: string;
|
|
12
|
+
}, invited: boolean): string | undefined;
|
|
13
|
+
static passwordReset(fields: {
|
|
14
|
+
newPassword: string;
|
|
15
|
+
confirmPassword: string;
|
|
16
|
+
}): string | undefined;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=AuthValidation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthValidation.d.ts","sourceRoot":"","sources":["../../../src/auth/AuthValidation.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,qBAAa,cAAc;IACzB,sFAAsF;IACtF,MAAM,CAAC,MAAM,CACX,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAA;KAAE,EAClF,OAAO,EAAE,OAAO,GACf,MAAM,GAAG,SAAS;IAkBrB,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,GAAG,SAAS;CASnG"}
|