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