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