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