@burdenoff/microfe-auth 2026.917.1 → 2026.925.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/dist/auth/pages/UserProfilePage.js +188 -171
- package/dist/auth/pages/UserProfilePage.js.map +1 -1
- package/dist/auth/pages/UsersPage.js +199 -182
- package/dist/auth/pages/UsersPage.js.map +1 -1
- package/dist/auth/utils/legalUrls.d.ts +1 -1
- package/dist/auth/utils/legalUrls.js.map +1 -1
- package/dist/auth/utils/ssoOrigins.js +1 -1
- package/dist/auth/utils/ssoOrigins.js.map +1 -1
- package/dist/auth/utils/validation.d.ts +19 -0
- package/dist/auth/utils/validation.js +20 -1
- package/dist/auth/utils/validation.js.map +1 -1
- package/dist/microfe-auth.css +1 -1
- package/dist/translations/en.d.ts +2 -0
- package/dist/translations/en.js +2 -0
- package/dist/translations/en.js.map +1 -1
- package/package.json +3 -2
|
@@ -3,32 +3,32 @@ import { useTr as t } from "../../shared/hooks/useTr.js";
|
|
|
3
3
|
import { AuthLayout as n } from "../components/AuthLayout.js";
|
|
4
4
|
import { AlertIcon as r, CheckIcon as i, EmailIcon as a, SpinnerIcon as o, UserIcon as s } from "../components/AuthIcons.js";
|
|
5
5
|
import { useUserOperations as c } from "../hooks/useUserOperations.js";
|
|
6
|
-
import { useCompleteAvatarUploadMutation as
|
|
7
|
-
import { validateUserFields as d } from "../utils/validation.js";
|
|
6
|
+
import { useCompleteAvatarUploadMutation as ee, useInitiateAvatarUploadMutation as l } from "../../generated/wspace-operations.js";
|
|
7
|
+
import { validatePhoneNumber as u, validateUserFields as d } from "../utils/validation.js";
|
|
8
8
|
import { useEffect as f, useId as p, useRef as m, useState as h } from "react";
|
|
9
9
|
import { useNavigate as g } from "react-router";
|
|
10
10
|
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
11
11
|
import { Button as b } from "@burdenoff/fe-libs/button";
|
|
12
12
|
import { NextSteps as x, PagePurpose as S } from "@burdenoff/fe-libs/ui";
|
|
13
|
-
import { useGatewayClient as
|
|
14
|
-
import { useAuth as
|
|
13
|
+
import { useGatewayClient as te } from "@burdenoff/fe-libs/shared/graphql";
|
|
14
|
+
import { useAuth as ne } from "@burdenoff/fe-libs/shared/providers/shell/AuthProvider";
|
|
15
15
|
//#region src/auth/pages/UserProfilePage.tsx
|
|
16
|
-
function
|
|
17
|
-
let
|
|
16
|
+
function C() {
|
|
17
|
+
let C = t(), w = g(), T = ne(), E = e((e) => e.isAuthenticated), D = e((e) => e.user), O = e((e) => e.setUser), { updateCurrentUserProfile: k, isLoading: A } = c(), j = p(), M = p(), N = p(), P = p(), F = p(), I = e((e) => e.currentWorkspaceId), L = te("workspace"), [R] = l({ client: L }), [z] = ee({ client: L }), B = m(null), [V, H] = h(!1), U = async (e) => {
|
|
18
18
|
let t = e.target.files?.[0];
|
|
19
19
|
if (!t) return;
|
|
20
20
|
if (!t.type.startsWith("image/")) {
|
|
21
|
-
|
|
21
|
+
Y(C("auth.profile.invalidImageType", "Please select an image file"));
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
if (!
|
|
25
|
-
|
|
24
|
+
if (!I) {
|
|
25
|
+
Y(C("auth.profile.noWorkspace", "Please select a workspace before uploading a profile picture"));
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
let n = { "x-workspace-id":
|
|
28
|
+
H(!0), Y(null);
|
|
29
|
+
let n = { "x-workspace-id": I };
|
|
30
30
|
try {
|
|
31
|
-
let e = t.name.split(".").pop()?.toLowerCase() ?? "", r = await
|
|
31
|
+
let e = t.name.split(".").pop()?.toLowerCase() ?? "", r = await R({
|
|
32
32
|
variables: { input: {
|
|
33
33
|
fileName: t.name,
|
|
34
34
|
fileSize: t.size.toString(),
|
|
@@ -43,38 +43,38 @@ function T() {
|
|
|
43
43
|
headers: { "Content-Type": t.type },
|
|
44
44
|
body: t
|
|
45
45
|
})).ok) throw Error("Failed to upload file");
|
|
46
|
-
let o = (await
|
|
46
|
+
let o = (await z({
|
|
47
47
|
variables: { input: { sessionId: i.id } },
|
|
48
48
|
context: { headers: n }
|
|
49
49
|
})).data?.completeUpload.file?.downloadUrl;
|
|
50
50
|
if (!o) throw Error("Upload succeeded but no URL returned");
|
|
51
|
-
await
|
|
52
|
-
...
|
|
51
|
+
await k({ avatar: o }), D && O({
|
|
52
|
+
...D,
|
|
53
53
|
avatar: o
|
|
54
|
-
}),
|
|
54
|
+
}), T.updateUser({ avatar: o }), $(C("auth.profile.avatarUpdated", "Profile picture updated!"));
|
|
55
55
|
} catch (e) {
|
|
56
|
-
|
|
56
|
+
Y(e instanceof Error ? e.message : C("auth.profile.avatarFailed", "Failed to upload picture"));
|
|
57
57
|
} finally {
|
|
58
|
-
|
|
58
|
+
H(!1), B.current && (B.current.value = "");
|
|
59
59
|
}
|
|
60
|
-
}, [
|
|
60
|
+
}, [W, G] = h(!1), [K, q] = h({
|
|
61
61
|
username: "",
|
|
62
62
|
firstName: "",
|
|
63
63
|
lastName: "",
|
|
64
64
|
name: "",
|
|
65
65
|
phoneNumber: ""
|
|
66
|
-
}), [X, Z] = h(null), [Q, $] = h(null);
|
|
66
|
+
}), [J, Y] = h(null), [X, Z] = h(null), [Q, $] = h(null);
|
|
67
67
|
return f(() => {
|
|
68
|
-
|
|
69
|
-
username:
|
|
70
|
-
firstName:
|
|
71
|
-
lastName:
|
|
72
|
-
name:
|
|
73
|
-
phoneNumber:
|
|
68
|
+
D && q({
|
|
69
|
+
username: D.username || "",
|
|
70
|
+
firstName: D.firstName || "",
|
|
71
|
+
lastName: D.lastName || "",
|
|
72
|
+
name: D.name || "",
|
|
73
|
+
phoneNumber: D.phoneNumber || ""
|
|
74
74
|
});
|
|
75
|
-
}, [
|
|
76
|
-
title:
|
|
77
|
-
subtitle:
|
|
75
|
+
}, [D]), !E || !D ? /* @__PURE__ */ v(n, {
|
|
76
|
+
title: C("auth.profile.title", "Profile"),
|
|
77
|
+
subtitle: C("auth.profile.subtitle", "View and manage your profile"),
|
|
78
78
|
children: /* @__PURE__ */ y("div", {
|
|
79
79
|
className: "text-center py-12",
|
|
80
80
|
children: [
|
|
@@ -84,19 +84,19 @@ function T() {
|
|
|
84
84
|
}),
|
|
85
85
|
/* @__PURE__ */ v("h2", {
|
|
86
86
|
className: "text-xl font-semibold text-[var(--color-text-primary)] mb-2",
|
|
87
|
-
children:
|
|
87
|
+
children: C("auth.profile.authRequired", "Authentication Required")
|
|
88
88
|
}),
|
|
89
89
|
/* @__PURE__ */ v("p", {
|
|
90
90
|
className: "text-[var(--color-text-secondary)] mb-6",
|
|
91
|
-
children:
|
|
91
|
+
children: C("auth.profile.signInToView", "Please sign in to view your profile")
|
|
92
92
|
}),
|
|
93
93
|
/* @__PURE__ */ v(b, {
|
|
94
94
|
type: "button",
|
|
95
|
-
onClick: () =>
|
|
95
|
+
onClick: () => w("/auth/login"),
|
|
96
96
|
variant: "default",
|
|
97
97
|
size: "lg",
|
|
98
98
|
className: "font-semibold",
|
|
99
|
-
children:
|
|
99
|
+
children: C("auth.profile.signIn", "Sign In")
|
|
100
100
|
})
|
|
101
101
|
]
|
|
102
102
|
})
|
|
@@ -108,15 +108,15 @@ function T() {
|
|
|
108
108
|
children: [
|
|
109
109
|
/* @__PURE__ */ v("h1", {
|
|
110
110
|
className: "text-3xl font-semibold text-[var(--color-text-primary)]",
|
|
111
|
-
children:
|
|
111
|
+
children: C("auth.profile.myProfile", "My Profile")
|
|
112
112
|
}),
|
|
113
113
|
/* @__PURE__ */ v("p", {
|
|
114
114
|
className: "text-[var(--color-text-secondary)] mt-2",
|
|
115
|
-
children:
|
|
115
|
+
children: C("auth.profile.viewAndManage", "View and manage your account information")
|
|
116
116
|
}),
|
|
117
117
|
/* @__PURE__ */ v(S, {
|
|
118
118
|
className: "mt-3",
|
|
119
|
-
children:
|
|
119
|
+
children: C("auth.profile.purpose", "This is how you appear across the platform. Update your name, photo, and contact details here — teammates see this information, and we use your email for sign-in and important notices.")
|
|
120
120
|
})
|
|
121
121
|
]
|
|
122
122
|
}),
|
|
@@ -132,11 +132,11 @@ function T() {
|
|
|
132
132
|
type: "button",
|
|
133
133
|
onClick: () => $(null),
|
|
134
134
|
className: "ml-auto text-sm text-[var(--color-status-success-text)] hover:underline transition-colors duration-200",
|
|
135
|
-
children:
|
|
135
|
+
children: C("auth.profile.dismiss", "Dismiss")
|
|
136
136
|
})
|
|
137
137
|
]
|
|
138
138
|
}),
|
|
139
|
-
|
|
139
|
+
J && /* @__PURE__ */ y("div", {
|
|
140
140
|
className: "mb-6 flex items-start gap-3 p-4 rounded-xl bg-[var(--color-status-error-bg-subtle)] border border-[var(--color-status-error-border)]",
|
|
141
141
|
children: [
|
|
142
142
|
/* @__PURE__ */ v(r, { className: "size-5 text-[var(--color-status-error-text)] flex-shrink-0 mt-0.5" }),
|
|
@@ -144,14 +144,14 @@ function T() {
|
|
|
144
144
|
className: "flex-1",
|
|
145
145
|
children: /* @__PURE__ */ v("p", {
|
|
146
146
|
className: "text-sm text-[var(--color-status-error-text)]",
|
|
147
|
-
children:
|
|
147
|
+
children: J
|
|
148
148
|
})
|
|
149
149
|
}),
|
|
150
150
|
/* @__PURE__ */ v("button", {
|
|
151
151
|
type: "button",
|
|
152
|
-
onClick: () =>
|
|
152
|
+
onClick: () => Y(null),
|
|
153
153
|
className: "text-sm text-[var(--color-status-error-text)] hover:underline transition-colors duration-200",
|
|
154
|
-
children:
|
|
154
|
+
children: C("auth.profile.dismiss", "Dismiss")
|
|
155
155
|
})
|
|
156
156
|
]
|
|
157
157
|
}),
|
|
@@ -164,21 +164,21 @@ function T() {
|
|
|
164
164
|
children: [/* @__PURE__ */ y("div", {
|
|
165
165
|
className: "relative group",
|
|
166
166
|
children: [
|
|
167
|
-
|
|
168
|
-
src:
|
|
169
|
-
alt:
|
|
167
|
+
D.avatar ? /* @__PURE__ */ v("img", {
|
|
168
|
+
src: D.avatar,
|
|
169
|
+
alt: C("auth.profile.avatarAlt", "Profile picture"),
|
|
170
170
|
className: "size-20 rounded-full object-cover shadow-lg"
|
|
171
171
|
}) : /* @__PURE__ */ v("div", {
|
|
172
172
|
className: "size-20 rounded-full bg-accent-soft backdrop-blur-sm flex items-center justify-center text-[var(--color-action-primary-bg)] text-3xl font-semibold shadow-lg",
|
|
173
|
-
children: (
|
|
173
|
+
children: (D.name || D.username || D.email).charAt(0).toUpperCase()
|
|
174
174
|
}),
|
|
175
175
|
/* @__PURE__ */ v("button", {
|
|
176
176
|
type: "button",
|
|
177
|
-
onClick: () =>
|
|
178
|
-
disabled:
|
|
179
|
-
"aria-label":
|
|
177
|
+
onClick: () => B.current?.click(),
|
|
178
|
+
disabled: V,
|
|
179
|
+
"aria-label": C("auth.profile.changeAvatar", "Change profile picture"),
|
|
180
180
|
className: "absolute inset-0 rounded-full flex items-center justify-center bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity duration-200 cursor-pointer",
|
|
181
|
-
children:
|
|
181
|
+
children: V ? /* @__PURE__ */ v(o, { className: "size-6 text-white animate-spin" }) : /* @__PURE__ */ y("svg", {
|
|
182
182
|
className: "size-6 text-white",
|
|
183
183
|
fill: "none",
|
|
184
184
|
viewBox: "0 0 24 24",
|
|
@@ -197,13 +197,13 @@ function T() {
|
|
|
197
197
|
})
|
|
198
198
|
}),
|
|
199
199
|
/* @__PURE__ */ v("input", {
|
|
200
|
-
ref:
|
|
200
|
+
ref: B,
|
|
201
201
|
type: "file",
|
|
202
202
|
accept: "image/*",
|
|
203
203
|
className: "hidden",
|
|
204
|
-
onChange: (e) => void
|
|
204
|
+
onChange: (e) => void U(e),
|
|
205
205
|
tabIndex: -1,
|
|
206
|
-
"aria-label":
|
|
206
|
+
"aria-label": C("auth.profile.avatarUpload", "Upload avatar image")
|
|
207
207
|
})
|
|
208
208
|
]
|
|
209
209
|
}), /* @__PURE__ */ y("div", {
|
|
@@ -211,20 +211,20 @@ function T() {
|
|
|
211
211
|
children: [
|
|
212
212
|
/* @__PURE__ */ v("h2", {
|
|
213
213
|
className: "text-2xl font-semibold",
|
|
214
|
-
children:
|
|
214
|
+
children: D.name || `${D.firstName || ""} ${D.lastName || ""}`.trim() || D.username
|
|
215
215
|
}),
|
|
216
216
|
/* @__PURE__ */ y("p", {
|
|
217
217
|
className: "text-text-secondary flex items-center gap-2",
|
|
218
|
-
children: [/* @__PURE__ */ v(a, { className: "size-4" }),
|
|
218
|
+
children: [/* @__PURE__ */ v(a, { className: "size-4" }), D.email]
|
|
219
219
|
}),
|
|
220
220
|
/* @__PURE__ */ y("div", {
|
|
221
221
|
className: "flex items-center gap-2 mt-2",
|
|
222
222
|
children: [/* @__PURE__ */ v("span", {
|
|
223
223
|
className: "px-2.5 py-1 rounded-full text-xs font-medium bg-bg-surface/60 text-text-secondary backdrop-blur-sm",
|
|
224
|
-
children:
|
|
225
|
-
}),
|
|
224
|
+
children: D.role?.replace("_", " ") || C("auth.profile.member", "Member")
|
|
225
|
+
}), D.emailVerified && /* @__PURE__ */ y("span", {
|
|
226
226
|
className: "px-2.5 py-1 rounded-full text-xs font-medium bg-status-success-bg-subtle text-status-success-text flex items-center gap-1",
|
|
227
|
-
children: [/* @__PURE__ */ v(i, { className: "size-3" }),
|
|
227
|
+
children: [/* @__PURE__ */ v(i, { className: "size-3" }), C("auth.profile.verified", "Verified")]
|
|
228
228
|
})]
|
|
229
229
|
})
|
|
230
230
|
]
|
|
@@ -232,24 +232,28 @@ function T() {
|
|
|
232
232
|
})
|
|
233
233
|
}), /* @__PURE__ */ v("div", {
|
|
234
234
|
className: "p-6",
|
|
235
|
-
children:
|
|
235
|
+
children: W ? /* @__PURE__ */ y("form", {
|
|
236
236
|
onSubmit: async (e) => {
|
|
237
|
-
e.preventDefault(), Z(null), $(null)
|
|
238
|
-
|
|
237
|
+
if (e.preventDefault(), Y(null), Z(null), $(null), !u(K.phoneNumber).valid) {
|
|
238
|
+
let e = C("auth.profile.phoneNumber_invalid", "Invalid phone number");
|
|
239
|
+
Z(e), Y(e);
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
let t = d(K, { requireAll: !1 });
|
|
239
243
|
if (!t.valid) {
|
|
240
|
-
|
|
244
|
+
Y(t.errors.map((e) => C(`auth.profile.${e.field}_${e.code}`, e.message)).join(" · "));
|
|
241
245
|
return;
|
|
242
246
|
}
|
|
243
247
|
try {
|
|
244
|
-
await
|
|
248
|
+
await k({
|
|
245
249
|
username: t.values.username || void 0,
|
|
246
250
|
firstName: t.values.firstName || void 0,
|
|
247
251
|
lastName: t.values.lastName || void 0,
|
|
248
|
-
name:
|
|
249
|
-
phoneNumber:
|
|
250
|
-
}), $(
|
|
252
|
+
name: K.name || void 0,
|
|
253
|
+
phoneNumber: K.phoneNumber || void 0
|
|
254
|
+
}), $(C("auth.profile.updateSuccess", "Profile updated successfully!")), G(!1);
|
|
251
255
|
} catch (e) {
|
|
252
|
-
|
|
256
|
+
Y(e instanceof Error ? e.message : C("auth.profile.updateFailed", "Failed to update profile"));
|
|
253
257
|
}
|
|
254
258
|
},
|
|
255
259
|
className: "space-y-6",
|
|
@@ -257,9 +261,9 @@ function T() {
|
|
|
257
261
|
className: "grid grid-cols-1 md:grid-cols-2 gap-6",
|
|
258
262
|
children: [
|
|
259
263
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
260
|
-
htmlFor:
|
|
264
|
+
htmlFor: j,
|
|
261
265
|
className: "block text-sm font-medium text-[var(--color-text-primary)] mb-2",
|
|
262
|
-
children:
|
|
266
|
+
children: C("auth.profile.username", "Username")
|
|
263
267
|
}), /* @__PURE__ */ y("div", {
|
|
264
268
|
className: "relative",
|
|
265
269
|
children: [/* @__PURE__ */ v("div", {
|
|
@@ -269,108 +273,121 @@ function T() {
|
|
|
269
273
|
"aria-hidden": "true"
|
|
270
274
|
})
|
|
271
275
|
}), /* @__PURE__ */ v("input", {
|
|
272
|
-
id:
|
|
276
|
+
id: j,
|
|
273
277
|
type: "text",
|
|
274
|
-
"aria-label":
|
|
275
|
-
value:
|
|
276
|
-
onChange: (e) =>
|
|
277
|
-
...
|
|
278
|
+
"aria-label": C("auth.profile.username", "Username"),
|
|
279
|
+
value: K.username,
|
|
280
|
+
onChange: (e) => q({
|
|
281
|
+
...K,
|
|
278
282
|
username: e.target.value
|
|
279
283
|
}),
|
|
280
284
|
className: "block w-full pl-[3.5rem] pr-4 py-3 border border-[var(--color-border-default)] rounded-xl bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all duration-300",
|
|
281
|
-
placeholder:
|
|
285
|
+
placeholder: C("auth.profile.usernamePlaceholder", "Enter username")
|
|
282
286
|
})]
|
|
283
287
|
})] }),
|
|
284
288
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
285
|
-
htmlFor:
|
|
289
|
+
htmlFor: M,
|
|
286
290
|
className: "block text-sm font-medium text-[var(--color-text-primary)] mb-2",
|
|
287
|
-
children:
|
|
291
|
+
children: C("auth.profile.displayName", "Display Name")
|
|
288
292
|
}), /* @__PURE__ */ v("input", {
|
|
289
|
-
id:
|
|
293
|
+
id: M,
|
|
290
294
|
type: "text",
|
|
291
|
-
"aria-label":
|
|
292
|
-
value:
|
|
293
|
-
onChange: (e) =>
|
|
294
|
-
...
|
|
295
|
+
"aria-label": C("auth.profile.displayName", "Display Name"),
|
|
296
|
+
value: K.name,
|
|
297
|
+
onChange: (e) => q({
|
|
298
|
+
...K,
|
|
295
299
|
name: e.target.value
|
|
296
300
|
}),
|
|
297
301
|
className: "block w-full px-4 py-3 border border-[var(--color-border-default)] rounded-xl bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all duration-300",
|
|
298
|
-
placeholder:
|
|
302
|
+
placeholder: C("auth.profile.displayNamePlaceholder", "Enter display name")
|
|
299
303
|
})] }),
|
|
300
304
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
301
|
-
htmlFor:
|
|
305
|
+
htmlFor: N,
|
|
302
306
|
className: "block text-sm font-medium text-[var(--color-text-primary)] mb-2",
|
|
303
|
-
children:
|
|
307
|
+
children: C("auth.profile.firstName", "First Name")
|
|
304
308
|
}), /* @__PURE__ */ v("input", {
|
|
305
|
-
id:
|
|
309
|
+
id: N,
|
|
306
310
|
type: "text",
|
|
307
|
-
"aria-label":
|
|
308
|
-
value:
|
|
309
|
-
onChange: (e) =>
|
|
310
|
-
...
|
|
311
|
+
"aria-label": C("auth.profile.firstName", "First Name"),
|
|
312
|
+
value: K.firstName,
|
|
313
|
+
onChange: (e) => q({
|
|
314
|
+
...K,
|
|
311
315
|
firstName: e.target.value
|
|
312
316
|
}),
|
|
313
317
|
className: "block w-full px-4 py-3 border border-[var(--color-border-default)] rounded-xl bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all duration-300",
|
|
314
|
-
placeholder:
|
|
318
|
+
placeholder: C("auth.profile.firstNamePlaceholder", "Enter first name")
|
|
315
319
|
})] }),
|
|
316
320
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
317
|
-
htmlFor:
|
|
321
|
+
htmlFor: P,
|
|
318
322
|
className: "block text-sm font-medium text-[var(--color-text-primary)] mb-2",
|
|
319
|
-
children:
|
|
323
|
+
children: C("auth.profile.lastName", "Last Name")
|
|
320
324
|
}), /* @__PURE__ */ v("input", {
|
|
321
|
-
id:
|
|
325
|
+
id: P,
|
|
322
326
|
type: "text",
|
|
323
|
-
"aria-label":
|
|
324
|
-
value:
|
|
325
|
-
onChange: (e) =>
|
|
326
|
-
...
|
|
327
|
+
"aria-label": C("auth.profile.lastName", "Last Name"),
|
|
328
|
+
value: K.lastName,
|
|
329
|
+
onChange: (e) => q({
|
|
330
|
+
...K,
|
|
327
331
|
lastName: e.target.value
|
|
328
332
|
}),
|
|
329
333
|
className: "block w-full px-4 py-3 border border-[var(--color-border-default)] rounded-xl bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all duration-300",
|
|
330
|
-
placeholder:
|
|
334
|
+
placeholder: C("auth.profile.lastNamePlaceholder", "Enter last name")
|
|
331
335
|
})] }),
|
|
332
336
|
/* @__PURE__ */ y("div", {
|
|
333
337
|
className: "md:col-span-2",
|
|
334
|
-
children: [
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
id: L,
|
|
340
|
-
type: "tel",
|
|
341
|
-
"aria-label": T("auth.profile.phoneNumber", "Phone Number"),
|
|
342
|
-
value: J.phoneNumber,
|
|
343
|
-
onChange: (e) => Y({
|
|
344
|
-
...J,
|
|
345
|
-
phoneNumber: e.target.value
|
|
338
|
+
children: [
|
|
339
|
+
/* @__PURE__ */ v("label", {
|
|
340
|
+
htmlFor: F,
|
|
341
|
+
className: "block text-sm font-medium text-[var(--color-text-primary)] mb-2",
|
|
342
|
+
children: C("auth.profile.phoneNumber", "Phone Number")
|
|
346
343
|
}),
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
344
|
+
/* @__PURE__ */ v("input", {
|
|
345
|
+
id: F,
|
|
346
|
+
type: "tel",
|
|
347
|
+
"aria-label": C("auth.profile.phoneNumber", "Phone Number"),
|
|
348
|
+
"aria-invalid": X ? !0 : void 0,
|
|
349
|
+
"aria-describedby": X ? `${F}-error` : void 0,
|
|
350
|
+
value: K.phoneNumber,
|
|
351
|
+
onChange: (e) => {
|
|
352
|
+
q({
|
|
353
|
+
...K,
|
|
354
|
+
phoneNumber: e.target.value
|
|
355
|
+
}), X && (Z(null), Y(null));
|
|
356
|
+
},
|
|
357
|
+
className: "block w-full px-4 py-3 border border-[var(--color-border-default)] rounded-xl bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all duration-300",
|
|
358
|
+
placeholder: C("auth.profile.phonePlaceholder", "Enter phone number")
|
|
359
|
+
}),
|
|
360
|
+
X && /* @__PURE__ */ v("p", {
|
|
361
|
+
id: `${F}-error`,
|
|
362
|
+
role: "alert",
|
|
363
|
+
className: "mt-2 text-sm text-[var(--color-status-error-text)]",
|
|
364
|
+
children: X
|
|
365
|
+
})
|
|
366
|
+
]
|
|
350
367
|
})
|
|
351
368
|
]
|
|
352
369
|
}), /* @__PURE__ */ y("div", {
|
|
353
|
-
className: "flex gap-3 pt-
|
|
370
|
+
className: "flex gap-3 pt-6 mt-6 border-t border-[var(--color-border-default)]",
|
|
354
371
|
children: [/* @__PURE__ */ v(b, {
|
|
355
372
|
type: "submit",
|
|
356
|
-
disabled:
|
|
373
|
+
disabled: A,
|
|
357
374
|
variant: "default",
|
|
358
375
|
size: "lg",
|
|
359
376
|
className: "font-semibold",
|
|
360
|
-
children:
|
|
377
|
+
children: A ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(o, { className: "size-4 animate-spin" }), C("auth.profile.saving", "Saving...")] }) : C("auth.profile.saveChanges", "Save Changes")
|
|
361
378
|
}), /* @__PURE__ */ v("button", {
|
|
362
379
|
type: "button",
|
|
363
380
|
onClick: () => {
|
|
364
|
-
|
|
365
|
-
username:
|
|
366
|
-
firstName:
|
|
367
|
-
lastName:
|
|
368
|
-
name:
|
|
369
|
-
phoneNumber:
|
|
370
|
-
}),
|
|
381
|
+
D && q({
|
|
382
|
+
username: D.username || "",
|
|
383
|
+
firstName: D.firstName || "",
|
|
384
|
+
lastName: D.lastName || "",
|
|
385
|
+
name: D.name || "",
|
|
386
|
+
phoneNumber: D.phoneNumber || ""
|
|
387
|
+
}), G(!1), Y(null), Z(null);
|
|
371
388
|
},
|
|
372
|
-
className: "
|
|
373
|
-
children:
|
|
389
|
+
className: "inline-flex items-center h-10 px-8 rounded-xl border border-[var(--color-border-default)] text-[var(--color-text-secondary)] font-medium hover:bg-[var(--color-bg-muted)] transition-colors duration-200",
|
|
390
|
+
children: C("auth.profile.cancel", "Cancel")
|
|
374
391
|
})]
|
|
375
392
|
})]
|
|
376
393
|
}) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ y("div", {
|
|
@@ -380,52 +397,52 @@ function T() {
|
|
|
380
397
|
className: "p-4 rounded-xl bg-[var(--color-bg-muted)]",
|
|
381
398
|
children: [/* @__PURE__ */ v("label", {
|
|
382
399
|
className: "block text-sm font-medium text-[var(--color-text-tertiary)] mb-1",
|
|
383
|
-
children:
|
|
400
|
+
children: C("auth.profile.username", "Username")
|
|
384
401
|
}), /* @__PURE__ */ v("p", {
|
|
385
402
|
className: "text-[var(--color-text-primary)] font-medium",
|
|
386
|
-
children:
|
|
403
|
+
children: D.username || "-"
|
|
387
404
|
})]
|
|
388
405
|
}),
|
|
389
406
|
/* @__PURE__ */ y("div", {
|
|
390
407
|
className: "p-4 rounded-xl bg-[var(--color-bg-muted)]",
|
|
391
408
|
children: [/* @__PURE__ */ v("label", {
|
|
392
409
|
className: "block text-sm font-medium text-[var(--color-text-tertiary)] mb-1",
|
|
393
|
-
children:
|
|
410
|
+
children: C("auth.profile.displayName", "Display Name")
|
|
394
411
|
}), /* @__PURE__ */ v("p", {
|
|
395
412
|
className: "text-[var(--color-text-primary)] font-medium",
|
|
396
|
-
children:
|
|
413
|
+
children: D.name || "-"
|
|
397
414
|
})]
|
|
398
415
|
}),
|
|
399
416
|
/* @__PURE__ */ y("div", {
|
|
400
417
|
className: "p-4 rounded-xl bg-[var(--color-bg-muted)]",
|
|
401
418
|
children: [/* @__PURE__ */ v("label", {
|
|
402
419
|
className: "block text-sm font-medium text-[var(--color-text-tertiary)] mb-1",
|
|
403
|
-
children:
|
|
420
|
+
children: C("auth.profile.firstName", "First Name")
|
|
404
421
|
}), /* @__PURE__ */ v("p", {
|
|
405
422
|
className: "text-[var(--color-text-primary)] font-medium",
|
|
406
|
-
children:
|
|
423
|
+
children: D.firstName || "-"
|
|
407
424
|
})]
|
|
408
425
|
}),
|
|
409
426
|
/* @__PURE__ */ y("div", {
|
|
410
427
|
className: "p-4 rounded-xl bg-[var(--color-bg-muted)]",
|
|
411
428
|
children: [/* @__PURE__ */ v("label", {
|
|
412
429
|
className: "block text-sm font-medium text-[var(--color-text-tertiary)] mb-1",
|
|
413
|
-
children:
|
|
430
|
+
children: C("auth.profile.lastName", "Last Name")
|
|
414
431
|
}), /* @__PURE__ */ v("p", {
|
|
415
432
|
className: "text-[var(--color-text-primary)] font-medium",
|
|
416
|
-
children:
|
|
433
|
+
children: D.lastName || "-"
|
|
417
434
|
})]
|
|
418
435
|
}),
|
|
419
436
|
/* @__PURE__ */ y("div", {
|
|
420
437
|
className: "p-4 rounded-xl bg-[var(--color-bg-muted)]",
|
|
421
438
|
children: [/* @__PURE__ */ v("label", {
|
|
422
439
|
className: "block text-sm font-medium text-[var(--color-text-tertiary)] mb-1",
|
|
423
|
-
children:
|
|
440
|
+
children: C("auth.profile.email", "Email")
|
|
424
441
|
}), /* @__PURE__ */ y("p", {
|
|
425
442
|
className: "text-[var(--color-text-primary)] font-medium flex items-center gap-2",
|
|
426
|
-
children: [
|
|
443
|
+
children: [D.email, D.emailVerified && /* @__PURE__ */ y("span", {
|
|
427
444
|
className: "inline-flex items-center gap-1 text-[var(--color-status-success-text)] text-xs",
|
|
428
|
-
children: [/* @__PURE__ */ v(i, { className: "size-3" }),
|
|
445
|
+
children: [/* @__PURE__ */ v(i, { className: "size-3" }), C("auth.profile.verified", "Verified")]
|
|
429
446
|
})]
|
|
430
447
|
})]
|
|
431
448
|
}),
|
|
@@ -433,35 +450,35 @@ function T() {
|
|
|
433
450
|
className: "p-4 rounded-xl bg-[var(--color-bg-muted)]",
|
|
434
451
|
children: [/* @__PURE__ */ v("label", {
|
|
435
452
|
className: "block text-sm font-medium text-[var(--color-text-tertiary)] mb-1",
|
|
436
|
-
children:
|
|
453
|
+
children: C("auth.profile.phoneNumber", "Phone Number")
|
|
437
454
|
}), /* @__PURE__ */ v("p", {
|
|
438
455
|
className: "text-[var(--color-text-primary)] font-medium",
|
|
439
|
-
children:
|
|
456
|
+
children: D.phoneNumber || "-"
|
|
440
457
|
})]
|
|
441
458
|
}),
|
|
442
459
|
/* @__PURE__ */ y("div", {
|
|
443
460
|
className: "p-4 rounded-xl bg-[var(--color-bg-muted)]",
|
|
444
461
|
children: [/* @__PURE__ */ v("label", {
|
|
445
462
|
className: "block text-sm font-medium text-[var(--color-text-tertiary)] mb-1",
|
|
446
|
-
children:
|
|
463
|
+
children: C("auth.profile.role", "Role")
|
|
447
464
|
}), /* @__PURE__ */ v("p", {
|
|
448
465
|
className: "text-[var(--color-text-primary)] font-medium",
|
|
449
|
-
children:
|
|
466
|
+
children: D.role?.replace("_", " ") || C("auth.profile.member", "Member")
|
|
450
467
|
})]
|
|
451
468
|
}),
|
|
452
469
|
/* @__PURE__ */ y("div", {
|
|
453
470
|
className: "p-4 rounded-xl bg-[var(--color-bg-muted)]",
|
|
454
471
|
children: [/* @__PURE__ */ v("label", {
|
|
455
472
|
className: "block text-sm font-medium text-[var(--color-text-tertiary)] mb-1",
|
|
456
|
-
children:
|
|
473
|
+
children: C("auth.profile.mfaStatus", "MFA Status")
|
|
457
474
|
}), /* @__PURE__ */ v("p", {
|
|
458
475
|
className: "text-[var(--color-text-primary)] font-medium",
|
|
459
|
-
children:
|
|
476
|
+
children: D.mfaEnabled ? /* @__PURE__ */ y("span", {
|
|
460
477
|
className: "text-[var(--color-status-success-text)] flex items-center gap-1",
|
|
461
|
-
children: [/* @__PURE__ */ v(i, { className: "size-4" }),
|
|
478
|
+
children: [/* @__PURE__ */ v(i, { className: "size-4" }), C("auth.profile.enabled", "Enabled")]
|
|
462
479
|
}) : /* @__PURE__ */ v("span", {
|
|
463
480
|
className: "text-[var(--color-status-warning-text)]",
|
|
464
|
-
children:
|
|
481
|
+
children: C("auth.profile.notEnabled", "Not Enabled")
|
|
465
482
|
})
|
|
466
483
|
})]
|
|
467
484
|
}),
|
|
@@ -469,20 +486,20 @@ function T() {
|
|
|
469
486
|
className: "p-4 rounded-xl bg-[var(--color-bg-muted)]",
|
|
470
487
|
children: [/* @__PURE__ */ v("label", {
|
|
471
488
|
className: "block text-sm font-medium text-[var(--color-text-tertiary)] mb-1",
|
|
472
|
-
children:
|
|
489
|
+
children: C("auth.profile.lastLogin", "Last Login")
|
|
473
490
|
}), /* @__PURE__ */ v("p", {
|
|
474
491
|
className: "text-[var(--color-text-primary)] font-medium",
|
|
475
|
-
children:
|
|
492
|
+
children: D.lastLoginAt ? new Date(D.lastLoginAt).toLocaleString() : C("auth.profile.never", "Never")
|
|
476
493
|
})]
|
|
477
494
|
}),
|
|
478
495
|
/* @__PURE__ */ y("div", {
|
|
479
496
|
className: "p-4 rounded-xl bg-[var(--color-bg-muted)]",
|
|
480
497
|
children: [/* @__PURE__ */ v("label", {
|
|
481
498
|
className: "block text-sm font-medium text-[var(--color-text-tertiary)] mb-1",
|
|
482
|
-
children:
|
|
499
|
+
children: C("auth.profile.accountCreated", "Account Created")
|
|
483
500
|
}), /* @__PURE__ */ v("p", {
|
|
484
501
|
className: "text-[var(--color-text-primary)] font-medium",
|
|
485
|
-
children:
|
|
502
|
+
children: D.createdAt ? new Date(D.createdAt).toLocaleString() : "-"
|
|
486
503
|
})]
|
|
487
504
|
})
|
|
488
505
|
]
|
|
@@ -490,16 +507,16 @@ function T() {
|
|
|
490
507
|
className: "flex gap-3 pt-6 mt-6 border-t border-[var(--color-border-default)]",
|
|
491
508
|
children: [/* @__PURE__ */ v(b, {
|
|
492
509
|
type: "button",
|
|
493
|
-
onClick: () =>
|
|
510
|
+
onClick: () => G(!0),
|
|
494
511
|
variant: "default",
|
|
495
512
|
size: "lg",
|
|
496
513
|
className: "font-semibold",
|
|
497
|
-
children:
|
|
514
|
+
children: C("auth.profile.editProfile", "Edit Profile")
|
|
498
515
|
}), /* @__PURE__ */ v("button", {
|
|
499
516
|
type: "button",
|
|
500
|
-
onClick: () =>
|
|
501
|
-
className: "
|
|
502
|
-
children:
|
|
517
|
+
onClick: () => w("/auth/security"),
|
|
518
|
+
className: "inline-flex items-center h-10 px-8 rounded-xl border border-[var(--color-border-default)] text-[var(--color-text-secondary)] font-medium hover:bg-[var(--color-bg-muted)] transition-colors duration-200",
|
|
519
|
+
children: C("auth.profile.securitySettings", "Security Settings")
|
|
503
520
|
})]
|
|
504
521
|
})] })
|
|
505
522
|
})]
|
|
@@ -510,23 +527,23 @@ function T() {
|
|
|
510
527
|
steps: [
|
|
511
528
|
{
|
|
512
529
|
id: "edit-profile",
|
|
513
|
-
label:
|
|
514
|
-
description:
|
|
515
|
-
onClick: () =>
|
|
516
|
-
done: !!(
|
|
530
|
+
label: C("auth.profile.nextEdit", "Complete your profile"),
|
|
531
|
+
description: C("auth.profile.nextEditDesc", "Add your display name and photo so teammates recognise you."),
|
|
532
|
+
onClick: () => G(!0),
|
|
533
|
+
done: !!(D.name && D.avatar)
|
|
517
534
|
},
|
|
518
535
|
{
|
|
519
536
|
id: "enable-mfa",
|
|
520
|
-
label:
|
|
521
|
-
description:
|
|
522
|
-
onClick: () =>
|
|
523
|
-
done: !!
|
|
537
|
+
label: C("auth.profile.nextMfa", "Secure your account with 2FA"),
|
|
538
|
+
description: C("auth.profile.nextMfaDesc", "Turn on two-factor authentication for stronger protection."),
|
|
539
|
+
onClick: () => w("/auth/mfa"),
|
|
540
|
+
done: !!D.mfaEnabled
|
|
524
541
|
},
|
|
525
542
|
{
|
|
526
543
|
id: "security-center",
|
|
527
|
-
label:
|
|
528
|
-
description:
|
|
529
|
-
onClick: () =>
|
|
544
|
+
label: C("auth.profile.nextSecurity", "Visit the Security Center"),
|
|
545
|
+
description: C("auth.profile.nextSecurityDesc", "Review sessions, password, and account options."),
|
|
546
|
+
onClick: () => w("/auth/security")
|
|
530
547
|
}
|
|
531
548
|
]
|
|
532
549
|
}),
|
|
@@ -534,7 +551,7 @@ function T() {
|
|
|
534
551
|
className: "mt-8 grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
535
552
|
children: [/* @__PURE__ */ y("button", {
|
|
536
553
|
type: "button",
|
|
537
|
-
onClick: () =>
|
|
554
|
+
onClick: () => w("/auth/mfa"),
|
|
538
555
|
className: "p-4 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] hover:border-[var(--color-action-primary-border)] transition-colors duration-200 text-left group",
|
|
539
556
|
children: [
|
|
540
557
|
/* @__PURE__ */ v("div", {
|
|
@@ -554,16 +571,16 @@ function T() {
|
|
|
554
571
|
}),
|
|
555
572
|
/* @__PURE__ */ v("h3", {
|
|
556
573
|
className: "font-medium text-[var(--color-text-primary)]",
|
|
557
|
-
children:
|
|
574
|
+
children: C("auth.profile.twoFactorAuth", "Two-Factor Auth")
|
|
558
575
|
}),
|
|
559
576
|
/* @__PURE__ */ v("p", {
|
|
560
577
|
className: "text-sm text-[var(--color-text-tertiary)] mt-1",
|
|
561
|
-
children:
|
|
578
|
+
children: D.mfaEnabled ? C("auth.profile.manageMfa", "Manage MFA settings") : C("auth.profile.enableMfa", "Enable MFA for extra security")
|
|
562
579
|
})
|
|
563
580
|
]
|
|
564
581
|
}), /* @__PURE__ */ y("button", {
|
|
565
582
|
type: "button",
|
|
566
|
-
onClick: () =>
|
|
583
|
+
onClick: () => w("/devportal/api-keys"),
|
|
567
584
|
className: "p-4 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] hover:border-[var(--color-action-secondary-border)] transition-colors duration-200 text-left group",
|
|
568
585
|
children: [
|
|
569
586
|
/* @__PURE__ */ v("div", {
|
|
@@ -583,11 +600,11 @@ function T() {
|
|
|
583
600
|
}),
|
|
584
601
|
/* @__PURE__ */ v("h3", {
|
|
585
602
|
className: "font-medium text-[var(--color-text-primary)]",
|
|
586
|
-
children:
|
|
603
|
+
children: C("auth.profile.apiKeys", "API Keys")
|
|
587
604
|
}),
|
|
588
605
|
/* @__PURE__ */ v("p", {
|
|
589
606
|
className: "text-sm text-[var(--color-text-tertiary)] mt-1",
|
|
590
|
-
children:
|
|
607
|
+
children: C("auth.profile.manageApiKeys", "Manage your API access credentials")
|
|
591
608
|
})
|
|
592
609
|
]
|
|
593
610
|
})]
|
|
@@ -596,6 +613,6 @@ function T() {
|
|
|
596
613
|
});
|
|
597
614
|
}
|
|
598
615
|
//#endregion
|
|
599
|
-
export {
|
|
616
|
+
export { C as UserProfilePage };
|
|
600
617
|
|
|
601
618
|
//# sourceMappingURL=UserProfilePage.js.map
|