@burdenoff/microfe-auth 2026.916.1 → 2026.917.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.
- package/dist/auth/pages/RegisterPage.js +210 -204
- package/dist/auth/pages/RegisterPage.js.map +1 -1
- package/dist/auth/pages/UserProfilePage.js +301 -278
- package/dist/auth/pages/UserProfilePage.js.map +1 -1
- package/dist/auth/pages/UsersPage.js +203 -181
- package/dist/auth/pages/UsersPage.js.map +1 -1
- package/dist/auth/utils/validation.d.ts +117 -0
- package/dist/auth/utils/validation.js +107 -1
- package/dist/auth/utils/validation.js.map +1 -1
- package/dist/microfe-auth.css +1 -1
- package/dist/translations/en.d.ts +41 -2
- package/dist/translations/en.js +41 -2
- package/dist/translations/en.js.map +1 -1
- package/package.json +3 -2
|
@@ -1,138 +1,144 @@
|
|
|
1
1
|
import { useAuth as e } from "../providers/AuthProvider.js";
|
|
2
2
|
import { useTr as t } from "../../shared/hooks/useTr.js";
|
|
3
3
|
import { useAuthOperations as n } from "../hooks/useAuthOperations.js";
|
|
4
|
-
import { useOAuthOperations as
|
|
5
|
-
import { AuthLayout as
|
|
6
|
-
import { AlertIcon as
|
|
7
|
-
import { validateEmail as
|
|
8
|
-
import { resolveLegalUrl as
|
|
4
|
+
import { useOAuthOperations as r } from "../hooks/useOAuthOperations.js";
|
|
5
|
+
import { AuthLayout as i } from "../components/AuthLayout.js";
|
|
6
|
+
import { AlertIcon as a, CheckIcon as ee, EmailIcon as o, EyeIcon as s, EyeOffIcon as c, GitHubIcon as te, GoogleIcon as ne, LockIcon as l, MicrosoftIcon as u, SpinnerIcon as d, UserIcon as f, XIcon as p } from "../components/AuthIcons.js";
|
|
7
|
+
import { validateEmail as m, validatePassword as re, validateUserFields as ie } from "../utils/validation.js";
|
|
8
|
+
import { resolveLegalUrl as h } from "../utils/legalUrls.js";
|
|
9
9
|
import { CaptchaV2 as ae } from "../components/CaptchaV2.js";
|
|
10
10
|
import { useSignupCaptcha as oe } from "../hooks/useSignupCaptcha.js";
|
|
11
|
-
import { useState as
|
|
12
|
-
import { useNavigate as
|
|
13
|
-
import { Fragment as se, jsx as
|
|
14
|
-
import { Button as
|
|
11
|
+
import { useState as g } from "react";
|
|
12
|
+
import { useNavigate as _ } from "react-router";
|
|
13
|
+
import { Fragment as se, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
14
|
+
import { Button as b } from "@burdenoff/fe-libs/button";
|
|
15
15
|
import { PagePurpose as ce } from "@burdenoff/fe-libs/ui";
|
|
16
16
|
//#region src/auth/pages/RegisterPage.tsx
|
|
17
|
-
function
|
|
18
|
-
let
|
|
17
|
+
function x() {
|
|
18
|
+
let x = t(), { productName: S } = e(), C = _(), { signUp: w, resendVerification: le, isLoading: T, errorCode: E } = n(), { initiateGoogleOAuth: ue, initiateMicrosoftOAuth: de, isProviderConfigured: D } = r(), [O, fe] = g(!1), [k, A] = g({
|
|
19
19
|
email: "",
|
|
20
20
|
username: "",
|
|
21
21
|
password: "",
|
|
22
22
|
firstName: "",
|
|
23
23
|
lastName: ""
|
|
24
|
-
}), [
|
|
25
|
-
let e =
|
|
24
|
+
}), [j, M] = g([]), [N, P] = g(!1), [F, I] = g(null), [L, R] = g(null), [z, B] = g(null), [V, pe] = g(0), { enabled: H, siteKey: me } = oe(), [U, W] = g(!1), [G, K] = g(null), q = !!F && E === "ACCOUNT_DEACTIVATED", J = !!F && E === "ACCOUNT_REMOVED", Y = !!F && E === "ACCOUNT_SUSPENDED", X = (() => {
|
|
25
|
+
let e = k.password;
|
|
26
26
|
return [
|
|
27
27
|
{
|
|
28
|
-
label:
|
|
28
|
+
label: x("auth.register.pwMin8", "At least 12 characters"),
|
|
29
29
|
met: e.length >= 12
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
label:
|
|
32
|
+
label: x("auth.register.pwUppercase", "One uppercase letter"),
|
|
33
33
|
met: /[A-Z]/.test(e)
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
|
-
label:
|
|
36
|
+
label: x("auth.register.pwLowercase", "One lowercase letter"),
|
|
37
37
|
met: /[a-z]/.test(e)
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
|
-
label:
|
|
40
|
+
label: x("auth.register.pwNumber", "One number"),
|
|
41
41
|
met: /\d/.test(e)
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
|
-
label:
|
|
44
|
+
label: x("auth.register.pwSpecial", "One special character"),
|
|
45
45
|
met: /[!@#$%^&*(),.?":{}|<>]/.test(e)
|
|
46
46
|
}
|
|
47
47
|
];
|
|
48
48
|
})(), Z = (() => {
|
|
49
49
|
let e = X.filter((e) => e.met).length;
|
|
50
50
|
return e <= 2 ? {
|
|
51
|
-
level:
|
|
51
|
+
level: x("auth.register.passwordStrengthWeak", "weak"),
|
|
52
52
|
color: "bg-status-error-bg-subtle0",
|
|
53
53
|
width: "w-1/4"
|
|
54
54
|
} : e <= 3 ? {
|
|
55
|
-
level:
|
|
55
|
+
level: x("auth.register.passwordStrengthFair", "fair"),
|
|
56
56
|
color: "bg-status-warning-text",
|
|
57
57
|
width: "w-2/4"
|
|
58
58
|
} : e <= 4 ? {
|
|
59
|
-
level:
|
|
59
|
+
level: x("auth.register.passwordStrengthGood", "good"),
|
|
60
60
|
color: "bg-status-warning-bg-subtle0",
|
|
61
61
|
width: "w-3/4"
|
|
62
62
|
} : {
|
|
63
|
-
level:
|
|
63
|
+
level: x("auth.register.passwordStrengthStrong", "strong"),
|
|
64
64
|
color: "bg-status-success-text",
|
|
65
65
|
width: "w-full"
|
|
66
66
|
};
|
|
67
|
-
})(),
|
|
67
|
+
})(), he = async (e) => {
|
|
68
68
|
e.preventDefault();
|
|
69
69
|
let t = [];
|
|
70
|
-
|
|
71
|
-
let n = ie(
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
m(k.email) || t.push(x("auth.register.invalidEmail", "Please enter a valid email address"));
|
|
71
|
+
let n = ie(k);
|
|
72
|
+
n.valid || t.push(...n.errors.map((e) => x(`auth.register.${e.field}_${e.code}`, e.message)));
|
|
73
|
+
let r = re(k.password);
|
|
74
|
+
if (r.valid || t.push(...r.errors), H && !z && t.push(x("auth.register.completeCaptcha", "Please complete the reCAPTCHA verification")), t.length > 0) {
|
|
75
|
+
M(t);
|
|
74
76
|
return;
|
|
75
77
|
}
|
|
76
|
-
|
|
78
|
+
M([]), I(null);
|
|
77
79
|
try {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
...
|
|
81
|
-
|
|
80
|
+
let e = n.values;
|
|
81
|
+
await w({
|
|
82
|
+
...k,
|
|
83
|
+
firstName: e.firstName,
|
|
84
|
+
lastName: e.lastName,
|
|
85
|
+
username: e.username,
|
|
86
|
+
...z ? { recaptchaToken: z } : {}
|
|
87
|
+
}), P(!0);
|
|
82
88
|
} catch (e) {
|
|
83
|
-
|
|
89
|
+
I(e instanceof Error ? e.message : x("auth.register.signUpFailed", "Sign up failed")), console.error("Sign up failed:", e), H && (B(null), pe((e) => e + 1));
|
|
84
90
|
}
|
|
85
|
-
},
|
|
86
|
-
|
|
91
|
+
}, ge = () => {
|
|
92
|
+
R(null);
|
|
87
93
|
try {
|
|
88
94
|
ue();
|
|
89
95
|
} catch (e) {
|
|
90
|
-
|
|
96
|
+
R(e instanceof Error ? e.message : x("auth.register.googleSignUpFailed", "Failed to initiate Google sign up"));
|
|
91
97
|
}
|
|
92
|
-
},
|
|
93
|
-
|
|
98
|
+
}, _e = () => {
|
|
99
|
+
R(null);
|
|
94
100
|
try {
|
|
95
101
|
de();
|
|
96
102
|
} catch (e) {
|
|
97
|
-
|
|
103
|
+
R(e instanceof Error ? e.message : x("auth.register.microsoftSignUpFailed", "Failed to initiate Microsoft sign up"));
|
|
98
104
|
}
|
|
99
|
-
}, Q =
|
|
105
|
+
}, Q = D("google"), $ = D("microsoft"), ve = [
|
|
100
106
|
{
|
|
101
107
|
name: "Google",
|
|
102
|
-
icon:
|
|
103
|
-
onClick:
|
|
108
|
+
icon: ne,
|
|
109
|
+
onClick: ge,
|
|
104
110
|
disabled: !Q,
|
|
105
|
-
tooltip: Q ? void 0 :
|
|
111
|
+
tooltip: Q ? void 0 : x("auth.register.googleNotConfigured", "Google sign up is not configured")
|
|
106
112
|
},
|
|
107
113
|
{
|
|
108
114
|
name: "GitHub",
|
|
109
|
-
icon:
|
|
115
|
+
icon: te,
|
|
110
116
|
onClick: () => {},
|
|
111
117
|
disabled: !0,
|
|
112
|
-
tooltip:
|
|
118
|
+
tooltip: x("auth.register.githubNotConfigured", "GitHub sign up is not configured")
|
|
113
119
|
},
|
|
114
120
|
{
|
|
115
121
|
name: "Microsoft",
|
|
116
|
-
icon:
|
|
117
|
-
onClick:
|
|
122
|
+
icon: u,
|
|
123
|
+
onClick: _e,
|
|
118
124
|
disabled: !$,
|
|
119
|
-
tooltip: $ ? void 0 :
|
|
125
|
+
tooltip: $ ? void 0 : x("auth.register.microsoftNotConfigured", "Microsoft sign up is not configured")
|
|
120
126
|
}
|
|
121
|
-
], [
|
|
122
|
-
return
|
|
123
|
-
title:
|
|
124
|
-
subtitle:
|
|
125
|
-
children: /* @__PURE__ */
|
|
127
|
+
], [ye, be = ""] = x("auth.register.verificationEmailSentTo", "We've sent a verification email to {{email}}. Please check your inbox and click the verification link to activate your account.").split("{{email}}");
|
|
128
|
+
return N ? /* @__PURE__ */ v(i, {
|
|
129
|
+
title: x("auth.register.checkEmail", "Check your email"),
|
|
130
|
+
subtitle: x("auth.register.verificationLinkSent", "We've sent you a verification link"),
|
|
131
|
+
children: /* @__PURE__ */ y("div", {
|
|
126
132
|
className: "flex flex-col items-center justify-center py-6",
|
|
127
133
|
children: [
|
|
128
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ v("div", {
|
|
129
135
|
className: "size-20 rounded-full bg-status-success-bg-subtle flex items-center justify-center mb-6",
|
|
130
|
-
children: /* @__PURE__ */
|
|
136
|
+
children: /* @__PURE__ */ v("svg", {
|
|
131
137
|
className: "size-10 text-status-success-text",
|
|
132
138
|
fill: "none",
|
|
133
139
|
viewBox: "0 0 24 24",
|
|
134
140
|
stroke: "currentColor",
|
|
135
|
-
children: /* @__PURE__ */
|
|
141
|
+
children: /* @__PURE__ */ v("path", {
|
|
136
142
|
strokeLinecap: "round",
|
|
137
143
|
strokeLinejoin: "round",
|
|
138
144
|
strokeWidth: 2,
|
|
@@ -140,56 +146,56 @@ function b() {
|
|
|
140
146
|
})
|
|
141
147
|
})
|
|
142
148
|
}),
|
|
143
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ v("h3", {
|
|
144
150
|
className: "text-lg font-semibold text-[var(--color-text-primary)] mb-2",
|
|
145
|
-
children:
|
|
151
|
+
children: x("auth.register.accountCreated", "Account created successfully!")
|
|
146
152
|
}),
|
|
147
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ y("p", {
|
|
148
154
|
className: "text-center text-[var(--color-text-secondary)] mb-8 max-w-sm",
|
|
149
155
|
children: [
|
|
150
|
-
|
|
151
|
-
/* @__PURE__ */
|
|
156
|
+
ye,
|
|
157
|
+
/* @__PURE__ */ v("span", {
|
|
152
158
|
className: "font-medium text-[var(--color-text-primary)]",
|
|
153
|
-
children:
|
|
159
|
+
children: k.email
|
|
154
160
|
}),
|
|
155
|
-
|
|
161
|
+
be
|
|
156
162
|
]
|
|
157
163
|
}),
|
|
158
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ y("div", {
|
|
159
165
|
className: "space-y-3 w-full",
|
|
160
166
|
children: [
|
|
161
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ v(b, {
|
|
162
168
|
type: "button",
|
|
163
|
-
onClick: () =>
|
|
169
|
+
onClick: () => C("/auth/login"),
|
|
164
170
|
variant: "default",
|
|
165
171
|
size: "lg",
|
|
166
172
|
className: "w-full font-semibold",
|
|
167
|
-
children:
|
|
173
|
+
children: x("auth.register.continueToSignIn", "Continue to sign in")
|
|
168
174
|
}),
|
|
169
|
-
G && /* @__PURE__ */
|
|
175
|
+
G && /* @__PURE__ */ v("p", {
|
|
170
176
|
className: "text-center text-sm text-status-error-text",
|
|
171
177
|
children: G
|
|
172
178
|
}),
|
|
173
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ y("p", {
|
|
174
180
|
className: "text-center text-sm text-[var(--color-text-tertiary)]",
|
|
175
181
|
children: [
|
|
176
|
-
|
|
182
|
+
x("auth.register.didntReceiveEmail", "Didn't receive the email? Check your spam folder or"),
|
|
177
183
|
" ",
|
|
178
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ v("button", {
|
|
179
185
|
type: "button",
|
|
180
186
|
disabled: U,
|
|
181
187
|
onClick: async () => {
|
|
182
188
|
K(null), W(!0);
|
|
183
189
|
try {
|
|
184
|
-
await le(
|
|
190
|
+
await le(k.email);
|
|
185
191
|
} catch (e) {
|
|
186
|
-
K(e instanceof Error ? e.message :
|
|
192
|
+
K(e instanceof Error ? e.message : x("auth.register.resendFailed", "Failed to resend verification email"));
|
|
187
193
|
} finally {
|
|
188
194
|
W(!1);
|
|
189
195
|
}
|
|
190
196
|
},
|
|
191
197
|
className: "text-text-link hover:text-text-linkHover font-medium disabled:opacity-50 disabled:cursor-not-allowed",
|
|
192
|
-
children: U ?
|
|
198
|
+
children: U ? x("auth.register.resending", "resending...") : x("auth.register.tryAgain", "try again")
|
|
193
199
|
})
|
|
194
200
|
]
|
|
195
201
|
})
|
|
@@ -197,223 +203,223 @@ function b() {
|
|
|
197
203
|
})
|
|
198
204
|
]
|
|
199
205
|
})
|
|
200
|
-
}) : /* @__PURE__ */
|
|
201
|
-
title:
|
|
202
|
-
subtitle:
|
|
203
|
-
productName:
|
|
206
|
+
}) : /* @__PURE__ */ y(i, {
|
|
207
|
+
title: x("auth.register.createAccount", "Create your account"),
|
|
208
|
+
subtitle: x("auth.register.startJourney", "Start your journey with {{productName}}").replace("{{productName}}", S || "Burdenoff Workspaces"),
|
|
209
|
+
productName: S,
|
|
204
210
|
children: [
|
|
205
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ v(ce, {
|
|
206
212
|
className: "mb-5",
|
|
207
|
-
children:
|
|
213
|
+
children: x("auth.register.purpose", "Create your account to get a personal workspace and start collaborating. You'll verify your email, then you can sign in and invite your team.")
|
|
208
214
|
}),
|
|
209
|
-
/* @__PURE__ */
|
|
210
|
-
onSubmit:
|
|
215
|
+
/* @__PURE__ */ y("form", {
|
|
216
|
+
onSubmit: he,
|
|
211
217
|
className: "space-y-5",
|
|
212
218
|
children: [
|
|
213
|
-
q && /* @__PURE__ */
|
|
219
|
+
q && /* @__PURE__ */ y("div", {
|
|
214
220
|
className: "flex items-start gap-3 p-4 rounded-xl bg-status-warning-bg-subtle border border-status-warning-border",
|
|
215
|
-
children: [/* @__PURE__ */
|
|
221
|
+
children: [/* @__PURE__ */ v(a, { className: "size-5 text-status-warning-text flex-shrink-0 mt-0.5" }), /* @__PURE__ */ y("div", {
|
|
216
222
|
className: "space-y-2",
|
|
217
223
|
children: [
|
|
218
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ v("p", {
|
|
219
225
|
className: "text-sm font-medium text-status-warning-text",
|
|
220
|
-
children:
|
|
226
|
+
children: x("auth.register.accountDeactivated", "This email belongs to a deactivated account.")
|
|
221
227
|
}),
|
|
222
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ v("p", {
|
|
223
229
|
className: "text-xs text-status-warning-text/80",
|
|
224
|
-
children:
|
|
230
|
+
children: x("auth.register.accountDeactivatedHelp", "If this is your account, you can reactivate it instead of creating a new one.")
|
|
225
231
|
}),
|
|
226
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ v("button", {
|
|
227
233
|
type: "button",
|
|
228
|
-
onClick: () =>
|
|
234
|
+
onClick: () => C("/auth/reactivate", { state: { email: k.email } }),
|
|
229
235
|
className: "text-sm font-semibold text-status-warning-text underline underline-offset-2",
|
|
230
|
-
children:
|
|
236
|
+
children: x("auth.register.reactivateCta", "Reactivate my account")
|
|
231
237
|
})
|
|
232
238
|
]
|
|
233
239
|
})]
|
|
234
240
|
}),
|
|
235
|
-
(J || Y) && /* @__PURE__ */
|
|
241
|
+
(J || Y) && /* @__PURE__ */ y("div", {
|
|
236
242
|
className: "flex items-start gap-3 p-4 rounded-xl bg-status-warning-bg-subtle border border-status-warning-border",
|
|
237
|
-
children: [/* @__PURE__ */
|
|
243
|
+
children: [/* @__PURE__ */ v(a, { className: "size-5 text-status-warning-text flex-shrink-0 mt-0.5" }), /* @__PURE__ */ v("p", {
|
|
238
244
|
className: "text-sm text-status-warning-text",
|
|
239
|
-
children:
|
|
245
|
+
children: F
|
|
240
246
|
})]
|
|
241
247
|
}),
|
|
242
|
-
(
|
|
248
|
+
(F && !q && !J && !Y || j.length > 0) && /* @__PURE__ */ y("div", {
|
|
243
249
|
className: "flex items-start gap-3 p-4 rounded-xl bg-status-error-bg-subtle border border-status-error-border",
|
|
244
|
-
children: [/* @__PURE__ */
|
|
250
|
+
children: [/* @__PURE__ */ v(a, { className: "size-5 text-status-error-text flex-shrink-0 mt-0.5" }), /* @__PURE__ */ y("div", {
|
|
245
251
|
className: "space-y-1",
|
|
246
|
-
children: [
|
|
252
|
+
children: [F && !q && !J && !Y && /* @__PURE__ */ v("p", {
|
|
247
253
|
className: "text-sm text-status-error-text",
|
|
248
|
-
children:
|
|
249
|
-
}),
|
|
254
|
+
children: F
|
|
255
|
+
}), j.map((e) => /* @__PURE__ */ v("p", {
|
|
250
256
|
className: "text-sm text-status-error-text",
|
|
251
257
|
children: e
|
|
252
258
|
}, e))]
|
|
253
259
|
})]
|
|
254
260
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ y("div", {
|
|
256
262
|
className: "grid grid-cols-2 gap-4",
|
|
257
|
-
children: [/* @__PURE__ */
|
|
263
|
+
children: [/* @__PURE__ */ y("div", {
|
|
258
264
|
className: "space-y-2",
|
|
259
|
-
children: [/* @__PURE__ */
|
|
265
|
+
children: [/* @__PURE__ */ v("label", {
|
|
260
266
|
htmlFor: "firstName",
|
|
261
267
|
className: "block text-sm font-medium text-[var(--color-text-primary)]",
|
|
262
|
-
children:
|
|
263
|
-
}), /* @__PURE__ */
|
|
268
|
+
children: x("auth.register.firstName", "First Name")
|
|
269
|
+
}), /* @__PURE__ */ v("input", {
|
|
264
270
|
id: "firstName",
|
|
265
271
|
type: "text",
|
|
266
272
|
required: !0,
|
|
267
273
|
"aria-required": "true",
|
|
268
|
-
"aria-label":
|
|
269
|
-
value:
|
|
270
|
-
onChange: (e) =>
|
|
271
|
-
...
|
|
274
|
+
"aria-label": x("auth.register.firstName", "First Name"),
|
|
275
|
+
value: k.firstName,
|
|
276
|
+
onChange: (e) => A({
|
|
277
|
+
...k,
|
|
272
278
|
firstName: e.target.value
|
|
273
279
|
}),
|
|
274
280
|
className: "block w-full px-4 py-3 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
|
|
275
|
-
placeholder:
|
|
281
|
+
placeholder: x("auth.register.firstNamePlaceholder", "Enter first name")
|
|
276
282
|
})]
|
|
277
|
-
}), /* @__PURE__ */
|
|
283
|
+
}), /* @__PURE__ */ y("div", {
|
|
278
284
|
className: "space-y-2",
|
|
279
|
-
children: [/* @__PURE__ */
|
|
285
|
+
children: [/* @__PURE__ */ v("label", {
|
|
280
286
|
htmlFor: "lastName",
|
|
281
287
|
className: "block text-sm font-medium text-[var(--color-text-primary)]",
|
|
282
|
-
children:
|
|
283
|
-
}), /* @__PURE__ */
|
|
288
|
+
children: x("auth.register.lastName", "Last Name")
|
|
289
|
+
}), /* @__PURE__ */ v("input", {
|
|
284
290
|
id: "lastName",
|
|
285
291
|
type: "text",
|
|
286
292
|
required: !0,
|
|
287
293
|
"aria-required": "true",
|
|
288
|
-
"aria-label":
|
|
289
|
-
value:
|
|
290
|
-
onChange: (e) =>
|
|
291
|
-
...
|
|
294
|
+
"aria-label": x("auth.register.lastName", "Last Name"),
|
|
295
|
+
value: k.lastName,
|
|
296
|
+
onChange: (e) => A({
|
|
297
|
+
...k,
|
|
292
298
|
lastName: e.target.value
|
|
293
299
|
}),
|
|
294
300
|
className: "block w-full px-4 py-3 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
|
|
295
|
-
placeholder:
|
|
301
|
+
placeholder: x("auth.register.lastNamePlaceholder", "Enter last name")
|
|
296
302
|
})]
|
|
297
303
|
})]
|
|
298
304
|
}),
|
|
299
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ y("div", {
|
|
300
306
|
className: "space-y-2",
|
|
301
|
-
children: [/* @__PURE__ */
|
|
307
|
+
children: [/* @__PURE__ */ v("label", {
|
|
302
308
|
htmlFor: "username",
|
|
303
309
|
className: "block text-sm font-medium text-[var(--color-text-primary)]",
|
|
304
|
-
children:
|
|
305
|
-
}), /* @__PURE__ */
|
|
310
|
+
children: x("auth.register.username", "Username")
|
|
311
|
+
}), /* @__PURE__ */ y("div", {
|
|
306
312
|
className: "relative",
|
|
307
|
-
children: [/* @__PURE__ */
|
|
313
|
+
children: [/* @__PURE__ */ v("div", {
|
|
308
314
|
className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
|
|
309
|
-
children: /* @__PURE__ */
|
|
310
|
-
}), /* @__PURE__ */
|
|
315
|
+
children: /* @__PURE__ */ v(f, { className: "size-5 text-[var(--color-text-tertiary)]" })
|
|
316
|
+
}), /* @__PURE__ */ v("input", {
|
|
311
317
|
id: "username",
|
|
312
318
|
type: "text",
|
|
313
319
|
required: !0,
|
|
314
320
|
"aria-required": "true",
|
|
315
|
-
"aria-label":
|
|
321
|
+
"aria-label": x("auth.register.username", "Username"),
|
|
316
322
|
autoComplete: "username",
|
|
317
|
-
value:
|
|
318
|
-
onChange: (e) =>
|
|
319
|
-
...
|
|
323
|
+
value: k.username,
|
|
324
|
+
onChange: (e) => A({
|
|
325
|
+
...k,
|
|
320
326
|
username: e.target.value
|
|
321
327
|
}),
|
|
322
328
|
className: "block w-full pl-[3.5rem] pr-4 py-3 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
|
|
323
|
-
placeholder:
|
|
329
|
+
placeholder: x("auth.register.usernamePlaceholder", "Choose a username")
|
|
324
330
|
})]
|
|
325
331
|
})]
|
|
326
332
|
}),
|
|
327
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ y("div", {
|
|
328
334
|
className: "space-y-2",
|
|
329
|
-
children: [/* @__PURE__ */
|
|
335
|
+
children: [/* @__PURE__ */ v("label", {
|
|
330
336
|
htmlFor: "email",
|
|
331
337
|
className: "block text-sm font-medium text-[var(--color-text-primary)]",
|
|
332
|
-
children:
|
|
333
|
-
}), /* @__PURE__ */
|
|
338
|
+
children: x("auth.register.email", "Email")
|
|
339
|
+
}), /* @__PURE__ */ y("div", {
|
|
334
340
|
className: "relative",
|
|
335
|
-
children: [/* @__PURE__ */
|
|
341
|
+
children: [/* @__PURE__ */ v("div", {
|
|
336
342
|
className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
|
|
337
|
-
children: /* @__PURE__ */
|
|
338
|
-
}), /* @__PURE__ */
|
|
343
|
+
children: /* @__PURE__ */ v(o, { className: "size-5 text-[var(--color-text-tertiary)]" })
|
|
344
|
+
}), /* @__PURE__ */ v("input", {
|
|
339
345
|
id: "email",
|
|
340
346
|
type: "email",
|
|
341
347
|
required: !0,
|
|
342
348
|
"aria-required": "true",
|
|
343
|
-
"aria-label":
|
|
349
|
+
"aria-label": x("auth.register.email", "Email"),
|
|
344
350
|
autoComplete: "email",
|
|
345
|
-
value:
|
|
346
|
-
onChange: (e) =>
|
|
347
|
-
...
|
|
351
|
+
value: k.email,
|
|
352
|
+
onChange: (e) => A({
|
|
353
|
+
...k,
|
|
348
354
|
email: e.target.value
|
|
349
355
|
}),
|
|
350
356
|
className: "block w-full pl-[3.5rem] pr-4 py-3 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
|
|
351
|
-
placeholder:
|
|
357
|
+
placeholder: x("auth.register.emailPlaceholder", "you@example.com")
|
|
352
358
|
})]
|
|
353
359
|
})]
|
|
354
360
|
}),
|
|
355
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ y("div", {
|
|
356
362
|
className: "space-y-2",
|
|
357
363
|
children: [
|
|
358
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ v("label", {
|
|
359
365
|
htmlFor: "password",
|
|
360
366
|
className: "block text-sm font-medium text-[var(--color-text-primary)]",
|
|
361
|
-
children:
|
|
367
|
+
children: x("auth.register.password", "Password")
|
|
362
368
|
}),
|
|
363
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ y("div", {
|
|
364
370
|
className: "relative",
|
|
365
371
|
children: [
|
|
366
|
-
/* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ v("div", {
|
|
367
373
|
className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
|
|
368
|
-
children: /* @__PURE__ */
|
|
374
|
+
children: /* @__PURE__ */ v(l, { className: "size-5 text-[var(--color-text-tertiary)]" })
|
|
369
375
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ v("input", {
|
|
371
377
|
id: "password",
|
|
372
|
-
type:
|
|
378
|
+
type: O ? "text" : "password",
|
|
373
379
|
required: !0,
|
|
374
380
|
"aria-required": "true",
|
|
375
|
-
"aria-label":
|
|
381
|
+
"aria-label": x("auth.register.password", "Password"),
|
|
376
382
|
autoComplete: "new-password",
|
|
377
|
-
value:
|
|
378
|
-
onChange: (e) =>
|
|
379
|
-
...
|
|
383
|
+
value: k.password,
|
|
384
|
+
onChange: (e) => A({
|
|
385
|
+
...k,
|
|
380
386
|
password: e.target.value
|
|
381
387
|
}),
|
|
382
388
|
className: "block w-full pl-[3.5rem] pr-12 py-3 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
|
|
383
|
-
placeholder:
|
|
389
|
+
placeholder: x("auth.register.passwordPlaceholder", "Create a strong password")
|
|
384
390
|
}),
|
|
385
|
-
/* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ v("button", {
|
|
386
392
|
type: "button",
|
|
387
|
-
onClick: () => fe(!
|
|
388
|
-
"aria-label":
|
|
393
|
+
onClick: () => fe(!O),
|
|
394
|
+
"aria-label": O ? x("auth.register.hidePassword", "Hide password") : x("auth.register.showPassword", "Show password"),
|
|
389
395
|
className: "absolute inset-y-0 right-0 pr-3.5 flex items-center text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] transition-colors",
|
|
390
|
-
children:
|
|
396
|
+
children: v(O ? c : s, { className: "size-5" })
|
|
391
397
|
})
|
|
392
398
|
]
|
|
393
399
|
}),
|
|
394
|
-
|
|
400
|
+
k.password && /* @__PURE__ */ y("div", {
|
|
395
401
|
className: "space-y-3 pt-2",
|
|
396
|
-
children: [/* @__PURE__ */
|
|
402
|
+
children: [/* @__PURE__ */ y("div", {
|
|
397
403
|
className: "space-y-1",
|
|
398
|
-
children: [/* @__PURE__ */
|
|
404
|
+
children: [/* @__PURE__ */ v("div", {
|
|
399
405
|
className: "h-1.5 bg-[var(--color-bg-sunken)] rounded-full overflow-hidden",
|
|
400
|
-
children: /* @__PURE__ */
|
|
401
|
-
}), /* @__PURE__ */
|
|
406
|
+
children: /* @__PURE__ */ v("div", { className: `h-full ${Z.color} ${Z.width} transition-all duration-300` })
|
|
407
|
+
}), /* @__PURE__ */ y("p", {
|
|
402
408
|
className: "text-xs text-[var(--color-text-tertiary)] capitalize",
|
|
403
409
|
children: [
|
|
404
|
-
|
|
410
|
+
x("auth.register.passwordStrength", "Password strength:"),
|
|
405
411
|
" ",
|
|
406
|
-
/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */ v("span", {
|
|
407
413
|
className: "font-medium",
|
|
408
414
|
children: Z.level
|
|
409
415
|
})
|
|
410
416
|
]
|
|
411
417
|
})]
|
|
412
|
-
}), /* @__PURE__ */
|
|
418
|
+
}), /* @__PURE__ */ v("div", {
|
|
413
419
|
className: "grid grid-cols-2 gap-2",
|
|
414
|
-
children: X.map((e) => /* @__PURE__ */
|
|
420
|
+
children: X.map((e) => /* @__PURE__ */ y("div", {
|
|
415
421
|
className: "flex items-center gap-2",
|
|
416
|
-
children: [e.met ? /* @__PURE__ */
|
|
422
|
+
children: [e.met ? /* @__PURE__ */ v(ee, { className: "size-4 text-status-success-text" }) : /* @__PURE__ */ v(p, { className: "size-4 text-[var(--color-text-tertiary)]" }), /* @__PURE__ */ v("span", {
|
|
417
423
|
className: `text-xs ${e.met ? "text-status-success-text" : "text-[var(--color-text-tertiary)]"}`,
|
|
418
424
|
children: e.label
|
|
419
425
|
})]
|
|
@@ -422,91 +428,91 @@ function b() {
|
|
|
422
428
|
})
|
|
423
429
|
]
|
|
424
430
|
}),
|
|
425
|
-
/* @__PURE__ */
|
|
431
|
+
/* @__PURE__ */ y("p", {
|
|
426
432
|
className: "text-xs text-[var(--color-text-tertiary)] leading-relaxed",
|
|
427
433
|
children: [
|
|
428
|
-
|
|
434
|
+
x("auth.register.agreeToTerms", "By creating an account, you agree to our"),
|
|
429
435
|
" ",
|
|
430
|
-
/* @__PURE__ */
|
|
431
|
-
href:
|
|
436
|
+
/* @__PURE__ */ v("a", {
|
|
437
|
+
href: h("/terms"),
|
|
432
438
|
target: "_blank",
|
|
433
439
|
rel: "noopener noreferrer",
|
|
434
440
|
className: "text-text-link underline underline-offset-2",
|
|
435
|
-
children:
|
|
441
|
+
children: x("auth.register.termsOfService", "Terms of Service")
|
|
436
442
|
}),
|
|
437
443
|
" ",
|
|
438
|
-
|
|
444
|
+
x("auth.register.and", "and"),
|
|
439
445
|
" ",
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
href:
|
|
446
|
+
/* @__PURE__ */ v("a", {
|
|
447
|
+
href: h("/privacy"),
|
|
442
448
|
target: "_blank",
|
|
443
449
|
rel: "noopener noreferrer",
|
|
444
450
|
className: "text-text-link underline underline-offset-2",
|
|
445
|
-
children:
|
|
451
|
+
children: x("auth.register.privacyPolicy", "Privacy Policy")
|
|
446
452
|
}),
|
|
447
453
|
"."
|
|
448
454
|
]
|
|
449
455
|
}),
|
|
450
|
-
/* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ v(ae, {
|
|
451
457
|
enabled: H,
|
|
452
|
-
siteKey:
|
|
453
|
-
onVerify:
|
|
454
|
-
onExpired: () =>
|
|
455
|
-
},
|
|
456
|
-
/* @__PURE__ */
|
|
458
|
+
siteKey: me,
|
|
459
|
+
onVerify: B,
|
|
460
|
+
onExpired: () => B(null)
|
|
461
|
+
}, V),
|
|
462
|
+
/* @__PURE__ */ v(b, {
|
|
457
463
|
type: "submit",
|
|
458
|
-
disabled:
|
|
464
|
+
disabled: T,
|
|
459
465
|
variant: "default",
|
|
460
466
|
size: "lg",
|
|
461
467
|
className: "w-full font-semibold",
|
|
462
|
-
children:
|
|
468
|
+
children: T ? /* @__PURE__ */ y(se, { children: [/* @__PURE__ */ v(d, { className: "size-5 animate-spin" }), /* @__PURE__ */ v("span", { children: x("auth.register.creatingAccount", "Creating account...") })] }) : x("auth.register.createAccountBtn", "Create account")
|
|
463
469
|
})
|
|
464
470
|
]
|
|
465
471
|
}),
|
|
466
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ y("div", {
|
|
467
473
|
className: "relative my-8",
|
|
468
|
-
children: [/* @__PURE__ */
|
|
474
|
+
children: [/* @__PURE__ */ v("div", {
|
|
469
475
|
className: "absolute inset-0 flex items-center",
|
|
470
|
-
children: /* @__PURE__ */
|
|
471
|
-
}), /* @__PURE__ */
|
|
476
|
+
children: /* @__PURE__ */ v("div", { className: "w-full border-t border-[var(--color-border-default)]" })
|
|
477
|
+
}), /* @__PURE__ */ v("div", {
|
|
472
478
|
className: "relative flex justify-center",
|
|
473
|
-
children: /* @__PURE__ */
|
|
479
|
+
children: /* @__PURE__ */ v("span", {
|
|
474
480
|
className: "px-4 bg-[var(--color-bg-canvas)] text-sm text-[var(--color-text-tertiary)]",
|
|
475
|
-
children:
|
|
481
|
+
children: x("auth.register.orSignUpWith", "or sign up with")
|
|
476
482
|
})
|
|
477
483
|
})]
|
|
478
484
|
}),
|
|
479
|
-
|
|
485
|
+
L && /* @__PURE__ */ y("div", {
|
|
480
486
|
className: "flex items-start gap-3 p-4 rounded-xl border bg-status-error-bg-subtle border-status-error-border",
|
|
481
|
-
children: [/* @__PURE__ */
|
|
487
|
+
children: [/* @__PURE__ */ v(a, { className: "size-5 flex-shrink-0 mt-0.5 text-status-error-text" }), /* @__PURE__ */ v("p", {
|
|
482
488
|
className: "text-sm text-status-error-text",
|
|
483
|
-
children:
|
|
489
|
+
children: L
|
|
484
490
|
})]
|
|
485
491
|
}),
|
|
486
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ v("div", {
|
|
487
493
|
className: "grid grid-cols-3 gap-3",
|
|
488
|
-
children:
|
|
494
|
+
children: ve.map((e) => /* @__PURE__ */ y("button", {
|
|
489
495
|
type: "button",
|
|
490
496
|
onClick: e.onClick,
|
|
491
497
|
disabled: e.disabled,
|
|
492
498
|
title: e.tooltip,
|
|
493
499
|
className: `flex items-center justify-center gap-2 px-4 py-3 rounded-xl border transition-all duration-200 group ${e.disabled ? "border-[var(--color-border-subtle)] bg-[var(--color-bg-disabled)] cursor-not-allowed opacity-50" : "border-[var(--color-border-default)] bg-[var(--color-bg-surface)] hover:bg-[var(--color-bg-sunken)] hover:border-[var(--color-border-strong)]"}`,
|
|
494
|
-
children: [/* @__PURE__ */
|
|
500
|
+
children: [/* @__PURE__ */ v(e.icon, { className: `size-5 ${e.disabled ? "opacity-50" : ""}` }), /* @__PURE__ */ v("span", {
|
|
495
501
|
className: `sr-only sm:not-sr-only text-sm font-medium transition-colors ${e.disabled ? "text-[var(--color-text-disabled)]" : "text-[var(--color-text-secondary)] group-hover:text-[var(--color-text-primary)]"}`,
|
|
496
502
|
children: e.name
|
|
497
503
|
})]
|
|
498
504
|
}, e.name))
|
|
499
505
|
}),
|
|
500
|
-
/* @__PURE__ */
|
|
506
|
+
/* @__PURE__ */ y("p", {
|
|
501
507
|
className: "mt-8 text-center text-sm text-[var(--color-text-secondary)]",
|
|
502
508
|
children: [
|
|
503
|
-
|
|
509
|
+
x("auth.register.alreadyHaveAccount", "Already have an account?"),
|
|
504
510
|
" ",
|
|
505
|
-
/* @__PURE__ */
|
|
511
|
+
/* @__PURE__ */ v("button", {
|
|
506
512
|
type: "button",
|
|
507
|
-
onClick: () =>
|
|
513
|
+
onClick: () => C("/auth/login"),
|
|
508
514
|
className: "font-semibold text-text-link hover:text-text-linkHover transition-colors",
|
|
509
|
-
children:
|
|
515
|
+
children: x("auth.register.signIn", "Sign in")
|
|
510
516
|
})
|
|
511
517
|
]
|
|
512
518
|
})
|
|
@@ -514,6 +520,6 @@ function b() {
|
|
|
514
520
|
});
|
|
515
521
|
}
|
|
516
522
|
//#endregion
|
|
517
|
-
export {
|
|
523
|
+
export { x as RegisterPage };
|
|
518
524
|
|
|
519
525
|
//# sourceMappingURL=RegisterPage.js.map
|