@salesmind-ai/design-system 1.8.0 → 1.9.0

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.
Files changed (52) hide show
  1. package/dist/ChangeEmail-BuUhjW0o.d.cts +226 -0
  2. package/dist/ChangeEmail-BuUhjW0o.d.ts +226 -0
  3. package/dist/chunk-AI2YEYT4.js +1368 -0
  4. package/dist/chunk-AI2YEYT4.js.map +1 -0
  5. package/dist/{chunk-4QQKREVH.cjs → chunk-LM3UJILC.cjs} +3 -3
  6. package/dist/{chunk-4QQKREVH.cjs.map → chunk-LM3UJILC.cjs.map} +1 -1
  7. package/dist/{chunk-K7NQ7TQG.cjs → chunk-M4MLGT4B.cjs} +84 -27
  8. package/dist/chunk-M4MLGT4B.cjs.map +1 -0
  9. package/dist/{chunk-25TUCNN6.js → chunk-QVGDMAZY.js} +84 -27
  10. package/dist/chunk-QVGDMAZY.js.map +1 -0
  11. package/dist/{chunk-2TC5EVSJ.js → chunk-TPZ3PKSF.js} +3 -3
  12. package/dist/{chunk-2TC5EVSJ.js.map → chunk-TPZ3PKSF.js.map} +1 -1
  13. package/dist/chunk-YWJKSY5C.cjs +1381 -0
  14. package/dist/chunk-YWJKSY5C.cjs.map +1 -0
  15. package/dist/index.cjs +47 -30
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.css +2372 -0
  18. package/dist/index.css.map +1 -1
  19. package/dist/index.d.cts +1 -0
  20. package/dist/index.d.ts +1 -0
  21. package/dist/index.js +2 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/marketing/index.cjs +27 -27
  24. package/dist/marketing/index.js +1 -1
  25. package/dist/onboarding/index.cjs +5870 -0
  26. package/dist/onboarding/index.cjs.map +1 -0
  27. package/dist/onboarding/index.css +557 -0
  28. package/dist/onboarding/index.css.map +1 -0
  29. package/dist/onboarding/index.d.cts +1589 -0
  30. package/dist/onboarding/index.d.ts +1589 -0
  31. package/dist/onboarding/index.js +5736 -0
  32. package/dist/onboarding/index.js.map +1 -0
  33. package/dist/styles/styles.css +2539 -0
  34. package/dist/v2-auth/index.cjs +59 -0
  35. package/dist/v2-auth/index.cjs.map +1 -0
  36. package/dist/v2-auth/index.css +3360 -0
  37. package/dist/v2-auth/index.css.map +1 -0
  38. package/dist/v2-auth/index.d.cts +76 -0
  39. package/dist/v2-auth/index.d.ts +76 -0
  40. package/dist/v2-auth/index.js +24 -0
  41. package/dist/v2-auth/index.js.map +1 -0
  42. package/dist/web/index.cjs +7 -7
  43. package/dist/web/index.d.cts +1 -1
  44. package/dist/web/index.d.ts +1 -1
  45. package/dist/web/index.js +1 -1
  46. package/dist/web/server/index.cjs +7 -7
  47. package/dist/web/server/index.d.cts +91 -27
  48. package/dist/web/server/index.d.ts +91 -27
  49. package/dist/web/server/index.js +1 -1
  50. package/package.json +14 -2
  51. package/dist/chunk-25TUCNN6.js.map +0 -1
  52. package/dist/chunk-K7NQ7TQG.cjs.map +0 -1
@@ -0,0 +1,1381 @@
1
+ 'use strict';
2
+
3
+ var React2 = require('react');
4
+ var reactSlot = require('@radix-ui/react-slot');
5
+ var clsx5 = require('clsx');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+ var input = require('@base-ui/react/input');
8
+ var checkbox = require('@base-ui/react/checkbox');
9
+
10
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
+
12
+ var React2__default = /*#__PURE__*/_interopDefault(React2);
13
+ var clsx5__default = /*#__PURE__*/_interopDefault(clsx5);
14
+
15
+ // src/v2-auth/Button/Button.tsx
16
+ var Button = React2__default.default.forwardRef(
17
+ ({ className, variant = "primary", size = "md", asChild = false, isLoading = false, children, disabled, ...props }, ref) => {
18
+ const buttonClass = clsx5__default.default(
19
+ "ds-button",
20
+ `ds-button--${variant}`,
21
+ size === "icon" ? "ds-button--icon ds-button--md" : `ds-button--${size}`,
22
+ isLoading && "ds-button--loading",
23
+ className
24
+ );
25
+ if (asChild) {
26
+ return /* @__PURE__ */ jsxRuntime.jsx(
27
+ reactSlot.Slot,
28
+ {
29
+ ref,
30
+ "aria-disabled": isLoading || disabled || void 0,
31
+ className: buttonClass,
32
+ ...props,
33
+ children
34
+ }
35
+ );
36
+ }
37
+ return /* @__PURE__ */ jsxRuntime.jsxs(
38
+ "button",
39
+ {
40
+ ref,
41
+ disabled: isLoading || disabled,
42
+ className: buttonClass,
43
+ ...props,
44
+ children: [
45
+ isLoading && /* @__PURE__ */ jsxRuntime.jsx(
46
+ "svg",
47
+ {
48
+ className: "ds-button__spinner",
49
+ xmlns: "http://www.w3.org/2000/svg",
50
+ width: "1em",
51
+ height: "1em",
52
+ viewBox: "0 0 24 24",
53
+ fill: "none",
54
+ stroke: "currentColor",
55
+ strokeWidth: "2",
56
+ strokeLinecap: "round",
57
+ strokeLinejoin: "round",
58
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
59
+ }
60
+ ),
61
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: clsx5__default.default("ds-button__content", isLoading && "ds-button__content--hidden"), children })
62
+ ]
63
+ }
64
+ );
65
+ }
66
+ );
67
+ Button.displayName = "Button";
68
+ var TextField = React2__default.default.forwardRef(
69
+ ({ className, label, error, helperText, endAdornment, id, ...props }, ref) => {
70
+ const generatedId = React2__default.default.useId();
71
+ const inputId = id || generatedId;
72
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx5__default.default("ds-textfield", className), children: [
73
+ label && /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: inputId, className: "ds-textfield__label", children: label }),
74
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-textfield__input-wrapper", children: [
75
+ /* @__PURE__ */ jsxRuntime.jsx(
76
+ input.Input,
77
+ {
78
+ id: inputId,
79
+ ref,
80
+ className: clsx5__default.default(
81
+ "ds-textfield__input",
82
+ error && "ds-textfield__input--error",
83
+ endAdornment && "ds-textfield__input--adorned"
84
+ ),
85
+ ...props
86
+ }
87
+ ),
88
+ endAdornment && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-textfield__adornment", children: endAdornment })
89
+ ] }),
90
+ helperText && /* @__PURE__ */ jsxRuntime.jsx("span", { className: clsx5__default.default("ds-textfield__helper", error && "ds-textfield__helper--error"), children: helperText })
91
+ ] });
92
+ }
93
+ );
94
+ TextField.displayName = "TextField";
95
+ var Checkbox = React2__default.default.forwardRef(
96
+ ({ className, label, id, ...props }, ref) => {
97
+ const generatedId = React2__default.default.useId();
98
+ const checkboxId = id || generatedId;
99
+ const labelId = `${checkboxId}-label`;
100
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx5__default.default("ds-checkbox-wrapper", className), children: [
101
+ /* @__PURE__ */ jsxRuntime.jsx(
102
+ checkbox.Checkbox.Root,
103
+ {
104
+ id: checkboxId,
105
+ ref,
106
+ className: "ds-checkbox",
107
+ "aria-labelledby": label ? labelId : void 0,
108
+ "aria-label": label ? void 0 : "Checkbox",
109
+ ...props,
110
+ children: /* @__PURE__ */ jsxRuntime.jsx(checkbox.Checkbox.Indicator, { className: "ds-checkbox__indicator", children: /* @__PURE__ */ jsxRuntime.jsx(
111
+ "svg",
112
+ {
113
+ viewBox: "0 0 14 14",
114
+ fill: "none",
115
+ xmlns: "http://www.w3.org/2000/svg",
116
+ className: "ds-checkbox__icon",
117
+ children: /* @__PURE__ */ jsxRuntime.jsx(
118
+ "path",
119
+ {
120
+ d: "M11.6666 3.5L5.24992 9.91667L2.33325 7",
121
+ stroke: "currentColor",
122
+ strokeWidth: "2",
123
+ strokeLinecap: "round",
124
+ strokeLinejoin: "round"
125
+ }
126
+ )
127
+ }
128
+ ) })
129
+ }
130
+ ),
131
+ label && /* @__PURE__ */ jsxRuntime.jsx("label", { id: labelId, htmlFor: checkboxId, className: "ds-checkbox__label", children: label })
132
+ ] });
133
+ }
134
+ );
135
+ Checkbox.displayName = "Checkbox";
136
+ var defaultLoginLabels = {
137
+ continueWithGoogleLabel: "Continue with Google",
138
+ orContinueWithEmailLabel: "or continue with email",
139
+ emailPlaceholder: "you@company.com",
140
+ passwordPlaceholder: "Enter your password",
141
+ signInLabel: "Sign in",
142
+ doNotHaveAnAccountLabel: "Don't have an account?",
143
+ emailLabel: "Email",
144
+ passwordLabel: "Password",
145
+ rememberMeLabel: "Remember me",
146
+ forgotPasswordLabel: "Forgot password?",
147
+ signUpLabel: "Sign up",
148
+ trustedByLabel: "Trusted by 500+ sales teams worldwide"
149
+ };
150
+ var Login = ({
151
+ brandName,
152
+ tagline = "AI Sales Agents that automate your pipeline",
153
+ labels: customLabels,
154
+ showSocialLogin = true,
155
+ showRememberMe = true,
156
+ showForgotPassword = true,
157
+ showSignUp = true,
158
+ logo,
159
+ onSubmit,
160
+ onGoogleLogin,
161
+ onForgotPassword,
162
+ onSignUp,
163
+ isLoading = false,
164
+ error,
165
+ className,
166
+ style
167
+ }) => {
168
+ const l = { ...defaultLoginLabels, ...customLabels };
169
+ const [email, setEmail] = React2.useState("");
170
+ const [password, setPassword] = React2.useState("");
171
+ const [showPassword, setShowPassword] = React2.useState(false);
172
+ const [rememberMe, setRememberMe] = React2.useState(false);
173
+ const handleSubmit = (e) => {
174
+ e.preventDefault();
175
+ onSubmit?.({ email, password, rememberMe });
176
+ };
177
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx5__default.default("ds-login", className), style, children: [
178
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-login__background", children: [
179
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-login__accent ds-login__accent--1", "aria-hidden": "true" }),
180
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-login__accent ds-login__accent--2", "aria-hidden": "true" })
181
+ ] }),
182
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-login__card", children: [
183
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-login__header", children: [
184
+ logo ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-login__logo", children: logo }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-login__logo ds-login__logo--default", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-login__logo-icon", children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
185
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "32", height: "32", rx: "8", fill: "url(#logo-gradient)" }),
186
+ /* @__PURE__ */ jsxRuntime.jsx(
187
+ "path",
188
+ {
189
+ d: "M10 16L14 20L22 12",
190
+ stroke: "white",
191
+ strokeWidth: "2.5",
192
+ strokeLinecap: "round",
193
+ strokeLinejoin: "round"
194
+ }
195
+ ),
196
+ /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: "logo-gradient", x1: "0", y1: "0", x2: "32", y2: "32", children: [
197
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "rgb(var(--accent-rgb))" }),
198
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "1", stopColor: "rgb(var(--accent2-rgb))" })
199
+ ] }) })
200
+ ] }) }) }),
201
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "ds-login__title", children: brandName }),
202
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "ds-login__tagline", children: tagline })
203
+ ] }),
204
+ error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-login__error", children: [
205
+ /* @__PURE__ */ jsxRuntime.jsxs(
206
+ "svg",
207
+ {
208
+ width: "16",
209
+ height: "16",
210
+ viewBox: "0 0 16 16",
211
+ fill: "none",
212
+ xmlns: "http://www.w3.org/2000/svg",
213
+ children: [
214
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "1.5" }),
215
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 4.5V8.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
216
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "11", r: "0.75", fill: "currentColor" })
217
+ ]
218
+ }
219
+ ),
220
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: error })
221
+ ] }),
222
+ showSocialLogin && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-login__social", children: [
223
+ /* @__PURE__ */ jsxRuntime.jsxs(
224
+ "button",
225
+ {
226
+ type: "button",
227
+ className: "ds-login__social-btn",
228
+ onClick: onGoogleLogin,
229
+ disabled: isLoading,
230
+ children: [
231
+ /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 24 24", width: "20", height: "20", children: [
232
+ /* @__PURE__ */ jsxRuntime.jsx(
233
+ "path",
234
+ {
235
+ fill: "#4285F4",
236
+ d: "M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
237
+ }
238
+ ),
239
+ /* @__PURE__ */ jsxRuntime.jsx(
240
+ "path",
241
+ {
242
+ fill: "#34A853",
243
+ d: "M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
244
+ }
245
+ ),
246
+ /* @__PURE__ */ jsxRuntime.jsx(
247
+ "path",
248
+ {
249
+ fill: "#FBBC05",
250
+ d: "M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"
251
+ }
252
+ ),
253
+ /* @__PURE__ */ jsxRuntime.jsx(
254
+ "path",
255
+ {
256
+ fill: "#EA4335",
257
+ d: "M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
258
+ }
259
+ )
260
+ ] }),
261
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: l.continueWithGoogleLabel })
262
+ ]
263
+ }
264
+ ),
265
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-login__divider", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: l.orContinueWithEmailLabel }) })
266
+ ] }),
267
+ /* @__PURE__ */ jsxRuntime.jsxs("form", { className: "ds-login__form", onSubmit: handleSubmit, children: [
268
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-login__field", children: /* @__PURE__ */ jsxRuntime.jsx(
269
+ TextField,
270
+ {
271
+ label: l.emailLabel,
272
+ type: "email",
273
+ placeholder: l.emailPlaceholder,
274
+ value: email,
275
+ onChange: (e) => setEmail(e.target.value),
276
+ disabled: isLoading,
277
+ autoComplete: "email"
278
+ }
279
+ ) }),
280
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-login__field", children: /* @__PURE__ */ jsxRuntime.jsx(
281
+ TextField,
282
+ {
283
+ label: l.passwordLabel,
284
+ type: showPassword ? "text" : "password",
285
+ placeholder: l.passwordPlaceholder,
286
+ value: password,
287
+ onChange: (e) => setPassword(e.target.value),
288
+ disabled: isLoading,
289
+ autoComplete: "current-password",
290
+ endAdornment: /* @__PURE__ */ jsxRuntime.jsx(
291
+ "button",
292
+ {
293
+ type: "button",
294
+ className: "ds-login__password-toggle",
295
+ onClick: () => setShowPassword(!showPassword),
296
+ "aria-label": showPassword ? "Hide password" : "Show password",
297
+ children: showPassword ? /* @__PURE__ */ jsxRuntime.jsxs(
298
+ "svg",
299
+ {
300
+ width: "20",
301
+ height: "20",
302
+ viewBox: "0 0 24 24",
303
+ fill: "none",
304
+ stroke: "currentColor",
305
+ strokeWidth: "2",
306
+ strokeLinecap: "round",
307
+ strokeLinejoin: "round",
308
+ children: [
309
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
310
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
311
+ ]
312
+ }
313
+ ) : /* @__PURE__ */ jsxRuntime.jsxs(
314
+ "svg",
315
+ {
316
+ width: "20",
317
+ height: "20",
318
+ viewBox: "0 0 24 24",
319
+ fill: "none",
320
+ stroke: "currentColor",
321
+ strokeWidth: "2",
322
+ strokeLinecap: "round",
323
+ strokeLinejoin: "round",
324
+ children: [
325
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
326
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "3" })
327
+ ]
328
+ }
329
+ )
330
+ }
331
+ )
332
+ }
333
+ ) }),
334
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-login__options", children: [
335
+ showRememberMe && /* @__PURE__ */ jsxRuntime.jsx(
336
+ Checkbox,
337
+ {
338
+ label: l.rememberMeLabel,
339
+ checked: rememberMe,
340
+ onCheckedChange: (checked) => setRememberMe(checked === true),
341
+ disabled: isLoading
342
+ }
343
+ ),
344
+ showForgotPassword && /* @__PURE__ */ jsxRuntime.jsx(
345
+ "button",
346
+ {
347
+ type: "button",
348
+ className: "ds-login__link",
349
+ onClick: onForgotPassword,
350
+ disabled: isLoading,
351
+ children: l.forgotPasswordLabel
352
+ }
353
+ )
354
+ ] }),
355
+ /* @__PURE__ */ jsxRuntime.jsx(
356
+ Button,
357
+ {
358
+ type: "submit",
359
+ variant: "primary",
360
+ size: "lg",
361
+ disabled: isLoading || !email || !password,
362
+ className: "ds-login__submit",
363
+ children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-login__spinner" }) : l.signInLabel
364
+ }
365
+ )
366
+ ] }),
367
+ showSignUp && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-login__footer", children: [
368
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: l.doNotHaveAnAccountLabel }),
369
+ /* @__PURE__ */ jsxRuntime.jsx(
370
+ "button",
371
+ {
372
+ type: "button",
373
+ className: "ds-login__link ds-login__link--accent",
374
+ onClick: onSignUp,
375
+ disabled: isLoading,
376
+ children: l.signUpLabel
377
+ }
378
+ )
379
+ ] })
380
+ ] })
381
+ ] });
382
+ };
383
+ Login.displayName = "Login";
384
+ var defaultSignupLabels = {
385
+ formTitle: "Create your account",
386
+ googleButtonLabel: "Sign up with Google",
387
+ dividerText: "or sign up with email",
388
+ nameLabel: "Full name",
389
+ namePlaceholder: "John Doe",
390
+ emailLabel: "Work email",
391
+ emailPlaceholder: "you@company.com",
392
+ passwordLabel: "Password",
393
+ passwordPlaceholder: "Create a strong password",
394
+ phoneLabel: "Phone",
395
+ phonePlaceholder: "Phone number",
396
+ hidePasswordLabel: "Hide password",
397
+ showPasswordLabel: "Show password",
398
+ passwordStrengthLabels: ["Very Weak", "Weak", "Fair", "Strong", "Very Strong"],
399
+ termsAgreementPrefix: "I agree to the ",
400
+ termsLabel: "Terms of Service ",
401
+ termsConjunction: "and ",
402
+ privacyLabel: "Privacy Policy",
403
+ submitLabel: "Create account",
404
+ loginPrompt: "Already have an account?",
405
+ loginLabel: "Sign in",
406
+ successTitle: "Welcome!",
407
+ continueToLoginLabel: "Go to Application"
408
+ };
409
+ function calculatePasswordStrength(password, strengthLabels) {
410
+ let score = 0;
411
+ if (password.length >= 8) score++;
412
+ if (password.length >= 12) score++;
413
+ if (/[a-z]/.test(password) && /[A-Z]/.test(password)) score++;
414
+ if (/\d/.test(password)) score++;
415
+ if (/[!@#$%^&*(),.?":{}|<>]/.test(password)) score++;
416
+ score = Math.min(4, score);
417
+ const labels = strengthLabels ?? defaultSignupLabels.passwordStrengthLabels;
418
+ const colors = [
419
+ "var(--status-error)",
420
+ "var(--status-warning)",
421
+ "#ffd000",
422
+ "var(--status-success)",
423
+ "var(--status-success)"
424
+ ];
425
+ return {
426
+ score,
427
+ label: labels[score],
428
+ color: colors[score]
429
+ };
430
+ }
431
+ var Signup = ({
432
+ brandName,
433
+ showSocialSignup = true,
434
+ logo,
435
+ onSubmit,
436
+ onGoogleSignup,
437
+ onLogin,
438
+ onTermsClick,
439
+ onPrivacyClick,
440
+ isLoading = false,
441
+ error,
442
+ isSuccess = false,
443
+ successMessage = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
444
+ "You're all set!",
445
+ /* @__PURE__ */ jsxRuntime.jsx("br", {}),
446
+ "Check your email to verify your account."
447
+ ] }),
448
+ className,
449
+ style,
450
+ labels: customLabels,
451
+ defaultCountry = "TH",
452
+ countries = [],
453
+ renderPhoneInput
454
+ }) => {
455
+ const l = { ...defaultSignupLabels, ...customLabels };
456
+ const [name, setName] = React2.useState("");
457
+ const [email, setEmail] = React2.useState("");
458
+ const defaultCountryData = countries.find((c) => c.code === defaultCountry) || countries[0] || { dial: "+66"};
459
+ const [countryDial, setCountryDial] = React2.useState(defaultCountryData.dial);
460
+ const [phone, setPhone] = React2.useState("");
461
+ const [password, setPassword] = React2.useState("");
462
+ const [showPassword, setShowPassword] = React2.useState(false);
463
+ const [acceptedTerms, setAcceptedTerms] = React2.useState(false);
464
+ const passwordStrength = React2.useMemo(
465
+ () => calculatePasswordStrength(password, l.passwordStrengthLabels),
466
+ [password, l.passwordStrengthLabels]
467
+ );
468
+ const handleSubmit = (e) => {
469
+ e.preventDefault();
470
+ const fullPhone = phone ? phone.trim().startsWith("+") ? phone.trim() : `${countryDial} ${phone}`.trim() : "";
471
+ onSubmit?.({ name, email, phone: fullPhone, password, acceptedTerms });
472
+ };
473
+ const isFormValid = name && email && password.length >= 8 && acceptedTerms;
474
+ if (isSuccess) {
475
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx5__default.default("ds-signup", className), style, children: [
476
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-signup__background", children: [
477
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-signup__accent ds-signup__accent--1", "aria-hidden": "true" }),
478
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-signup__accent ds-signup__accent--2", "aria-hidden": "true" })
479
+ ] }),
480
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-signup__card ds-signup__card--success", children: [
481
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-signup__success-icon", children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 64 64", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
482
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "32", cy: "32", r: "30", stroke: "var(--status-success)", strokeWidth: "2" }),
483
+ /* @__PURE__ */ jsxRuntime.jsx(
484
+ "path",
485
+ {
486
+ d: "M20 32L28 40L44 24",
487
+ stroke: "var(--status-success)",
488
+ strokeWidth: "3",
489
+ strokeLinecap: "round",
490
+ strokeLinejoin: "round"
491
+ }
492
+ )
493
+ ] }) }),
494
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "ds-signup__success-title", children: l.successTitle === "Welcome!" ? brandName ? `Welcome to ${brandName}!` : "Welcome!" : l.successTitle }),
495
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "ds-signup__success-message", children: successMessage }),
496
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "primary", size: "lg", onClick: onLogin, className: "ds-signup__success-btn", children: l.continueToLoginLabel })
497
+ ] })
498
+ ] });
499
+ }
500
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx5__default.default("ds-signup", className), style, children: [
501
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-signup__background", children: [
502
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-signup__accent ds-signup__accent--1", "aria-hidden": "true" }),
503
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-signup__accent ds-signup__accent--2", "aria-hidden": "true" })
504
+ ] }),
505
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-signup__card", children: [
506
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-signup__header", children: [
507
+ logo ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-signup__logo", children: logo }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-signup__logo ds-signup__logo--default", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-signup__logo-icon", children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
508
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "32", height: "32", rx: "8", fill: "url(#signup-logo-gradient)" }),
509
+ /* @__PURE__ */ jsxRuntime.jsx(
510
+ "path",
511
+ {
512
+ d: "M16 8V24M8 16H24",
513
+ stroke: "white",
514
+ strokeWidth: "2.5",
515
+ strokeLinecap: "round"
516
+ }
517
+ ),
518
+ /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: "signup-logo-gradient", x1: "0", y1: "0", x2: "32", y2: "32", children: [
519
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "rgb(var(--accent-rgb))" }),
520
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "1", stopColor: "rgb(var(--accent2-rgb))" })
521
+ ] }) })
522
+ ] }) }) }),
523
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "ds-signup__title", children: l.formTitle })
524
+ ] }),
525
+ error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-signup__error", children: [
526
+ /* @__PURE__ */ jsxRuntime.jsxs(
527
+ "svg",
528
+ {
529
+ width: "16",
530
+ height: "16",
531
+ viewBox: "0 0 16 16",
532
+ fill: "none",
533
+ xmlns: "http://www.w3.org/2000/svg",
534
+ children: [
535
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "1.5" }),
536
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 4.5V8.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
537
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "11", r: "0.75", fill: "currentColor" })
538
+ ]
539
+ }
540
+ ),
541
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: error })
542
+ ] }),
543
+ showSocialSignup && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-signup__social", children: [
544
+ /* @__PURE__ */ jsxRuntime.jsxs(
545
+ "button",
546
+ {
547
+ type: "button",
548
+ className: "ds-signup__social-btn",
549
+ onClick: onGoogleSignup,
550
+ disabled: isLoading,
551
+ children: [
552
+ /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 24 24", width: "20", height: "20", children: [
553
+ /* @__PURE__ */ jsxRuntime.jsx(
554
+ "path",
555
+ {
556
+ fill: "#4285F4",
557
+ d: "M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
558
+ }
559
+ ),
560
+ /* @__PURE__ */ jsxRuntime.jsx(
561
+ "path",
562
+ {
563
+ fill: "#34A853",
564
+ d: "M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
565
+ }
566
+ ),
567
+ /* @__PURE__ */ jsxRuntime.jsx(
568
+ "path",
569
+ {
570
+ fill: "#FBBC05",
571
+ d: "M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"
572
+ }
573
+ ),
574
+ /* @__PURE__ */ jsxRuntime.jsx(
575
+ "path",
576
+ {
577
+ fill: "#EA4335",
578
+ d: "M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
579
+ }
580
+ )
581
+ ] }),
582
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: l.googleButtonLabel })
583
+ ]
584
+ }
585
+ ),
586
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-signup__divider", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: l.dividerText }) })
587
+ ] }),
588
+ /* @__PURE__ */ jsxRuntime.jsxs("form", { className: "ds-signup__form", onSubmit: handleSubmit, children: [
589
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-signup__field", children: /* @__PURE__ */ jsxRuntime.jsx(
590
+ TextField,
591
+ {
592
+ label: l.nameLabel,
593
+ type: "text",
594
+ placeholder: l.namePlaceholder,
595
+ value: name,
596
+ onChange: (e) => setName(e.target.value),
597
+ disabled: isLoading,
598
+ autoComplete: "name"
599
+ }
600
+ ) }),
601
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-signup__field", children: /* @__PURE__ */ jsxRuntime.jsx(
602
+ TextField,
603
+ {
604
+ label: l.emailLabel,
605
+ type: "email",
606
+ placeholder: l.emailPlaceholder,
607
+ value: email,
608
+ onChange: (e) => setEmail(e.target.value),
609
+ disabled: isLoading,
610
+ autoComplete: "email"
611
+ }
612
+ ) }),
613
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-signup__field ds-signup__phone-field", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-textfield", children: [
614
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "ds-textfield__label", htmlFor: "phone-input", children: l.phoneLabel }),
615
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-textfield__input-wrapper", children: renderPhoneInput ? renderPhoneInput({
616
+ value: phone,
617
+ onChange: setPhone,
618
+ placeholder: l.phonePlaceholder,
619
+ disabled: isLoading,
620
+ className: "ds-signup__phone-container ds-textfield__input",
621
+ id: "phone-input"
622
+ }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx5__default.default("ds-signup__phone-container", "ds-textfield__input"), children: [
623
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-signup__flag-select-wrapper", children: [
624
+ /* @__PURE__ */ jsxRuntime.jsx(
625
+ "select",
626
+ {
627
+ className: "ds-signup__flag-select-native",
628
+ value: countryDial,
629
+ onChange: (e) => {
630
+ const newDial = e.target.value;
631
+ setCountryDial(newDial);
632
+ setPhone(newDial + " ");
633
+ },
634
+ disabled: isLoading,
635
+ "aria-label": "Select country code",
636
+ children: countries.map((c) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: c.dial, children: c.name }, c.code))
637
+ }
638
+ ),
639
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-signup__flag-display", "aria-hidden": "true", children: [
640
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-signup__flag-icon", children: countries.find((c) => c.dial === countryDial)?.flag || "\u{1F310}" }),
641
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "10", height: "6", viewBox: "0 0 10 6", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 1L5 5L9 1", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
642
+ ] })
643
+ ] }),
644
+ /* @__PURE__ */ jsxRuntime.jsx(
645
+ "input",
646
+ {
647
+ id: "phone-input",
648
+ type: "tel",
649
+ placeholder: l.phonePlaceholder,
650
+ value: phone,
651
+ onChange: (e) => setPhone(e.target.value),
652
+ disabled: isLoading,
653
+ className: "ds-signup__phone-input ds-signup__phone-input-native",
654
+ autoComplete: "tel"
655
+ }
656
+ )
657
+ ] }) })
658
+ ] }) }),
659
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-signup__field", children: [
660
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-signup__password-wrapper", children: [
661
+ /* @__PURE__ */ jsxRuntime.jsx(
662
+ TextField,
663
+ {
664
+ label: l.passwordLabel,
665
+ type: showPassword ? "text" : "password",
666
+ placeholder: l.passwordPlaceholder,
667
+ value: password,
668
+ onChange: (e) => setPassword(e.target.value),
669
+ disabled: isLoading,
670
+ autoComplete: "new-password"
671
+ }
672
+ ),
673
+ /* @__PURE__ */ jsxRuntime.jsx(
674
+ "button",
675
+ {
676
+ type: "button",
677
+ className: "ds-signup__password-toggle",
678
+ onClick: () => setShowPassword(!showPassword),
679
+ "aria-label": showPassword ? l.hidePasswordLabel : l.showPasswordLabel,
680
+ children: showPassword ? /* @__PURE__ */ jsxRuntime.jsxs(
681
+ "svg",
682
+ {
683
+ width: "20",
684
+ height: "20",
685
+ viewBox: "0 0 24 24",
686
+ fill: "none",
687
+ stroke: "currentColor",
688
+ strokeWidth: "2",
689
+ strokeLinecap: "round",
690
+ strokeLinejoin: "round",
691
+ children: [
692
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
693
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
694
+ ]
695
+ }
696
+ ) : /* @__PURE__ */ jsxRuntime.jsxs(
697
+ "svg",
698
+ {
699
+ width: "20",
700
+ height: "20",
701
+ viewBox: "0 0 24 24",
702
+ fill: "none",
703
+ stroke: "currentColor",
704
+ strokeWidth: "2",
705
+ strokeLinecap: "round",
706
+ strokeLinejoin: "round",
707
+ children: [
708
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
709
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "3" })
710
+ ]
711
+ }
712
+ )
713
+ }
714
+ )
715
+ ] }),
716
+ password && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-signup__strength", children: [
717
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-signup__strength-bar", children: [0, 1, 2, 3].map((i) => /* @__PURE__ */ jsxRuntime.jsx(
718
+ "div",
719
+ {
720
+ className: clsx5__default.default(
721
+ "ds-signup__strength-segment",
722
+ i < passwordStrength.score && "ds-signup__strength-segment--active"
723
+ ),
724
+ style: i < passwordStrength.score ? { backgroundColor: passwordStrength.color } : {}
725
+ },
726
+ i
727
+ )) }),
728
+ /* @__PURE__ */ jsxRuntime.jsx(
729
+ "span",
730
+ {
731
+ className: "ds-signup__strength-label",
732
+ style: { color: passwordStrength.color },
733
+ children: passwordStrength.label
734
+ }
735
+ )
736
+ ] })
737
+ ] }),
738
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-signup__terms", children: [
739
+ /* @__PURE__ */ jsxRuntime.jsx(
740
+ Checkbox,
741
+ {
742
+ label: "",
743
+ checked: acceptedTerms,
744
+ onCheckedChange: (checked) => setAcceptedTerms(checked === true),
745
+ disabled: isLoading
746
+ }
747
+ ),
748
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ds-signup__terms-text", children: [
749
+ (l.termsAgreementPrefix || "").endsWith(" ") ? l.termsAgreementPrefix || "" : `${l.termsAgreementPrefix || ""} `,
750
+ /* @__PURE__ */ jsxRuntime.jsx(
751
+ "button",
752
+ {
753
+ type: "button",
754
+ className: "ds-signup__link",
755
+ onClick: onTermsClick,
756
+ disabled: isLoading,
757
+ children: l.termsLabel
758
+ }
759
+ ),
760
+ (l.termsConjunction || " ").startsWith(" ") && (l.termsConjunction || " ").endsWith(" ") ? l.termsConjunction || " " : ` ${(l.termsConjunction || "").trim()} `,
761
+ /* @__PURE__ */ jsxRuntime.jsx(
762
+ "button",
763
+ {
764
+ type: "button",
765
+ className: "ds-signup__link",
766
+ onClick: onPrivacyClick,
767
+ disabled: isLoading,
768
+ children: l.privacyLabel
769
+ }
770
+ )
771
+ ] })
772
+ ] }),
773
+ /* @__PURE__ */ jsxRuntime.jsx(
774
+ Button,
775
+ {
776
+ type: "submit",
777
+ variant: "primary",
778
+ size: "lg",
779
+ disabled: isLoading || !isFormValid,
780
+ className: "ds-signup__submit",
781
+ children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-signup__spinner" }) : l.submitLabel
782
+ }
783
+ )
784
+ ] }),
785
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-signup__footer", children: [
786
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: l.loginPrompt }),
787
+ /* @__PURE__ */ jsxRuntime.jsx(
788
+ "button",
789
+ {
790
+ type: "button",
791
+ className: "ds-signup__link ds-signup__link--accent",
792
+ onClick: onLogin,
793
+ disabled: isLoading,
794
+ children: l.loginLabel
795
+ }
796
+ )
797
+ ] })
798
+ ] })
799
+ ] });
800
+ };
801
+ Signup.displayName = "Signup";
802
+ var defaultForgotPasswordLabels = {
803
+ forgotPasswordTitle: "Forgot password?",
804
+ resetInstructionsTagline: "No worries, we'll send you reset instructions.",
805
+ emailLabel: "Email",
806
+ emailPlaceholder: "Enter your email",
807
+ resetPasswordButton: "Reset password",
808
+ backToLoginButton: "Back to login",
809
+ checkYourEmailTitle: "Check your email",
810
+ passwordResetLinkTagline: "We sent a password reset link to",
811
+ didNotReceiveEmailHint: "Didn't receive the email? ",
812
+ clickToResendButton: "Click to resend",
813
+ setNewPasswordTitle: "Set new password",
814
+ mustBeCharactersTagline: "Must be at least 8 characters.",
815
+ passwordLabel: "Password",
816
+ enterNewPasswordPlaceholder: "Enter new password",
817
+ confirmPasswordLabel: "Confirm password",
818
+ confirmNewPasswordPlaceholder: "Confirm new password",
819
+ passwordsDontMatchError: "Passwords don't match",
820
+ passwordResetTitle: "Password reset",
821
+ passwordSuccessfullyResetTagline: "Your password has been successfully reset.",
822
+ clickBelowLogInHint: "Click below to log in.",
823
+ continueToLoginButton: "Continue to login",
824
+ showPasswordLabel: "Show password",
825
+ hidePasswordLabel: "Hide password"
826
+ };
827
+ var ForgotPassword = ({
828
+ logo,
829
+ labels: customLabels,
830
+ onSubmit,
831
+ onResetPassword,
832
+ onBackToLogin,
833
+ isLoading = false,
834
+ error,
835
+ step = "email",
836
+ email: initialEmail = "",
837
+ className
838
+ }) => {
839
+ const l = { ...defaultForgotPasswordLabels, ...customLabels };
840
+ const [email, setEmail] = React2.useState(initialEmail);
841
+ const [password, setPassword] = React2.useState("");
842
+ const [confirmPassword, setConfirmPassword] = React2.useState("");
843
+ const [showPassword, setShowPassword] = React2.useState(false);
844
+ const [resendTimer, setResendTimer] = React2.useState(0);
845
+ const hasStartedTimer = React2__default.default.useRef(false);
846
+ React2.useEffect(() => {
847
+ if (step === "sent" && !hasStartedTimer.current) {
848
+ hasStartedTimer.current = true;
849
+ setResendTimer(60);
850
+ } else if (step !== "sent") {
851
+ hasStartedTimer.current = false;
852
+ }
853
+ }, [step]);
854
+ React2.useEffect(() => {
855
+ let timerId;
856
+ if (resendTimer > 0) {
857
+ timerId = setInterval(() => {
858
+ setResendTimer((prev) => prev - 1);
859
+ }, 1e3);
860
+ }
861
+ return () => {
862
+ if (timerId) clearInterval(timerId);
863
+ };
864
+ }, [resendTimer]);
865
+ const handleResendClick = () => {
866
+ if (resendTimer === 0) {
867
+ onSubmit?.(email || initialEmail);
868
+ setResendTimer(60);
869
+ }
870
+ };
871
+ const handleEmailSubmit = (e) => {
872
+ e.preventDefault();
873
+ onSubmit?.(email);
874
+ };
875
+ const handleResetSubmit = (e) => {
876
+ e.preventDefault();
877
+ onResetPassword?.({ password, confirmPassword });
878
+ };
879
+ const renderLogo = () => logo ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-forgot__logo", children: logo }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-forgot__logo ds-forgot__logo--default", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-forgot__logo-icon", children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
880
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "32", height: "32", rx: "8", fill: "url(#forgot-logo-gradient)" }),
881
+ /* @__PURE__ */ jsxRuntime.jsx(
882
+ "path",
883
+ {
884
+ d: "M16 10V14M16 22V22.01M16 26C21.5228 26 26 21.5228 26 16C26 10.4772 21.5228 6 16 6C10.4772 6 6 10.4772 6 16C6 21.5228 10.4772 26 16 26Z",
885
+ stroke: "white",
886
+ strokeWidth: "2",
887
+ strokeLinecap: "round"
888
+ }
889
+ ),
890
+ /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: "forgot-logo-gradient", x1: "0", y1: "0", x2: "32", y2: "32", children: [
891
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "rgb(var(--accent-rgb))" }),
892
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "1", stopColor: "rgb(var(--accent2-rgb))" })
893
+ ] }) })
894
+ ] }) }) });
895
+ if (step === "email") {
896
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx5__default.default("ds-forgot", className), children: [
897
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-forgot__accent ds-forgot__accent--1", "aria-hidden": "true" }),
898
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-forgot__accent ds-forgot__accent--2", "aria-hidden": "true" }),
899
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-forgot__card", children: [
900
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-forgot__header", children: [
901
+ renderLogo(),
902
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "ds-forgot__title", children: l.forgotPasswordTitle }),
903
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "ds-forgot__tagline", children: l.resetInstructionsTagline })
904
+ ] }),
905
+ error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-forgot__error", children: [
906
+ /* @__PURE__ */ jsxRuntime.jsxs(
907
+ "svg",
908
+ {
909
+ width: "16",
910
+ height: "16",
911
+ viewBox: "0 0 16 16",
912
+ fill: "none",
913
+ xmlns: "http://www.w3.org/2000/svg",
914
+ children: [
915
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "1.5" }),
916
+ /* @__PURE__ */ jsxRuntime.jsx(
917
+ "path",
918
+ {
919
+ d: "M8 4.5V8.5",
920
+ stroke: "currentColor",
921
+ strokeWidth: "1.5",
922
+ strokeLinecap: "round"
923
+ }
924
+ ),
925
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "11", r: "0.75", fill: "currentColor" })
926
+ ]
927
+ }
928
+ ),
929
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: error })
930
+ ] }),
931
+ /* @__PURE__ */ jsxRuntime.jsxs("form", { className: "ds-forgot__form", onSubmit: handleEmailSubmit, children: [
932
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-forgot__field", children: /* @__PURE__ */ jsxRuntime.jsx(
933
+ TextField,
934
+ {
935
+ label: l.emailLabel,
936
+ type: "email",
937
+ placeholder: l.emailPlaceholder,
938
+ value: email,
939
+ onChange: (e) => setEmail(e.target.value),
940
+ disabled: isLoading,
941
+ autoComplete: "email"
942
+ }
943
+ ) }),
944
+ /* @__PURE__ */ jsxRuntime.jsx(
945
+ Button,
946
+ {
947
+ type: "submit",
948
+ variant: "primary",
949
+ size: "lg",
950
+ disabled: isLoading || !email,
951
+ className: "ds-forgot__submit",
952
+ children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-forgot__spinner" }) : l.resetPasswordButton
953
+ }
954
+ )
955
+ ] }),
956
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-forgot__footer", children: /* @__PURE__ */ jsxRuntime.jsxs(
957
+ "button",
958
+ {
959
+ type: "button",
960
+ className: "ds-forgot__back",
961
+ onClick: onBackToLogin,
962
+ disabled: isLoading,
963
+ children: [
964
+ /* @__PURE__ */ jsxRuntime.jsx(
965
+ "svg",
966
+ {
967
+ width: "16",
968
+ height: "16",
969
+ viewBox: "0 0 16 16",
970
+ fill: "none",
971
+ stroke: "currentColor",
972
+ strokeWidth: "1.5",
973
+ strokeLinecap: "round",
974
+ strokeLinejoin: "round",
975
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 12L6 8L10 4" })
976
+ }
977
+ ),
978
+ l.backToLoginButton
979
+ ]
980
+ }
981
+ ) })
982
+ ] })
983
+ ] });
984
+ }
985
+ if (step === "sent") {
986
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx5__default.default("ds-forgot", className), children: [
987
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-forgot__accent ds-forgot__accent--1", "aria-hidden": "true" }),
988
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-forgot__accent ds-forgot__accent--2", "aria-hidden": "true" }),
989
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-forgot__card ds-forgot__card--centered", children: [
990
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-forgot__success-icon", children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 64 64", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
991
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "32", cy: "32", r: "30", stroke: "rgb(var(--accent-rgb))", strokeWidth: "2" }),
992
+ /* @__PURE__ */ jsxRuntime.jsx(
993
+ "path",
994
+ {
995
+ d: "M20 32L44 32M44 32L36 24M44 32L36 40",
996
+ stroke: "rgb(var(--accent-rgb))",
997
+ strokeWidth: "3",
998
+ strokeLinecap: "round",
999
+ strokeLinejoin: "round"
1000
+ }
1001
+ )
1002
+ ] }) }),
1003
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "ds-forgot__title", children: l.checkYourEmailTitle }),
1004
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "ds-forgot__tagline", children: [
1005
+ l.passwordResetLinkTagline,
1006
+ /* @__PURE__ */ jsxRuntime.jsx("br", {}),
1007
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: email || initialEmail })
1008
+ ] }),
1009
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-forgot__hint", children: [
1010
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: l.didNotReceiveEmailHint }),
1011
+ /* @__PURE__ */ jsxRuntime.jsx(
1012
+ "button",
1013
+ {
1014
+ type: "button",
1015
+ className: "ds-forgot__link",
1016
+ onClick: handleResendClick,
1017
+ disabled: isLoading || resendTimer > 0,
1018
+ children: resendTimer > 0 ? `${l.clickToResendButton} ${resendTimer}s` : l.clickToResendButton
1019
+ }
1020
+ )
1021
+ ] }),
1022
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-forgot__footer", children: /* @__PURE__ */ jsxRuntime.jsxs(
1023
+ "button",
1024
+ {
1025
+ type: "button",
1026
+ className: "ds-forgot__back",
1027
+ onClick: onBackToLogin,
1028
+ disabled: isLoading,
1029
+ children: [
1030
+ /* @__PURE__ */ jsxRuntime.jsx(
1031
+ "svg",
1032
+ {
1033
+ width: "16",
1034
+ height: "16",
1035
+ viewBox: "0 0 16 16",
1036
+ fill: "none",
1037
+ stroke: "currentColor",
1038
+ strokeWidth: "1.5",
1039
+ strokeLinecap: "round",
1040
+ strokeLinejoin: "round",
1041
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 12L6 8L10 4" })
1042
+ }
1043
+ ),
1044
+ l.backToLoginButton
1045
+ ]
1046
+ }
1047
+ ) })
1048
+ ] })
1049
+ ] });
1050
+ }
1051
+ if (step === "reset") {
1052
+ const passwordsMatch = password === confirmPassword;
1053
+ const isValid = password.length >= 8 && passwordsMatch;
1054
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx5__default.default("ds-forgot", className), children: [
1055
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-forgot__accent ds-forgot__accent--1", "aria-hidden": "true" }),
1056
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-forgot__accent ds-forgot__accent--2", "aria-hidden": "true" }),
1057
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-forgot__card", children: [
1058
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-forgot__header", children: [
1059
+ renderLogo(),
1060
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "ds-forgot__title", children: l.setNewPasswordTitle }),
1061
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "ds-forgot__tagline", children: l.mustBeCharactersTagline })
1062
+ ] }),
1063
+ error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-forgot__error", children: [
1064
+ /* @__PURE__ */ jsxRuntime.jsxs(
1065
+ "svg",
1066
+ {
1067
+ width: "16",
1068
+ height: "16",
1069
+ viewBox: "0 0 16 16",
1070
+ fill: "none",
1071
+ xmlns: "http://www.w3.org/2000/svg",
1072
+ children: [
1073
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "1.5" }),
1074
+ /* @__PURE__ */ jsxRuntime.jsx(
1075
+ "path",
1076
+ {
1077
+ d: "M8 4.5V8.5",
1078
+ stroke: "currentColor",
1079
+ strokeWidth: "1.5",
1080
+ strokeLinecap: "round"
1081
+ }
1082
+ ),
1083
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "11", r: "0.75", fill: "currentColor" })
1084
+ ]
1085
+ }
1086
+ ),
1087
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: error })
1088
+ ] }),
1089
+ /* @__PURE__ */ jsxRuntime.jsxs("form", { className: "ds-forgot__form", onSubmit: handleResetSubmit, children: [
1090
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-forgot__field", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-forgot__password-wrapper", children: [
1091
+ /* @__PURE__ */ jsxRuntime.jsx(
1092
+ TextField,
1093
+ {
1094
+ label: l.passwordLabel,
1095
+ type: showPassword ? "text" : "password",
1096
+ placeholder: l.enterNewPasswordPlaceholder,
1097
+ value: password,
1098
+ onChange: (e) => setPassword(e.target.value),
1099
+ disabled: isLoading,
1100
+ autoComplete: "new-password"
1101
+ }
1102
+ ),
1103
+ /* @__PURE__ */ jsxRuntime.jsx(
1104
+ "button",
1105
+ {
1106
+ type: "button",
1107
+ className: "ds-forgot__password-toggle",
1108
+ onClick: () => setShowPassword(!showPassword),
1109
+ "aria-label": showPassword ? l.hidePasswordLabel : l.showPasswordLabel,
1110
+ children: showPassword ? /* @__PURE__ */ jsxRuntime.jsxs(
1111
+ "svg",
1112
+ {
1113
+ width: "20",
1114
+ height: "20",
1115
+ viewBox: "0 0 24 24",
1116
+ fill: "none",
1117
+ stroke: "currentColor",
1118
+ strokeWidth: "2",
1119
+ strokeLinecap: "round",
1120
+ strokeLinejoin: "round",
1121
+ children: [
1122
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
1123
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
1124
+ ]
1125
+ }
1126
+ ) : /* @__PURE__ */ jsxRuntime.jsxs(
1127
+ "svg",
1128
+ {
1129
+ width: "20",
1130
+ height: "20",
1131
+ viewBox: "0 0 24 24",
1132
+ fill: "none",
1133
+ stroke: "currentColor",
1134
+ strokeWidth: "2",
1135
+ strokeLinecap: "round",
1136
+ strokeLinejoin: "round",
1137
+ children: [
1138
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
1139
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "3" })
1140
+ ]
1141
+ }
1142
+ )
1143
+ }
1144
+ )
1145
+ ] }) }),
1146
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-forgot__field", children: /* @__PURE__ */ jsxRuntime.jsx(
1147
+ TextField,
1148
+ {
1149
+ label: l.confirmPasswordLabel,
1150
+ type: showPassword ? "text" : "password",
1151
+ placeholder: l.confirmNewPasswordPlaceholder,
1152
+ value: confirmPassword,
1153
+ onChange: (e) => setConfirmPassword(e.target.value),
1154
+ disabled: isLoading,
1155
+ autoComplete: "new-password",
1156
+ error: confirmPassword.length > 0 && !passwordsMatch,
1157
+ helperText: confirmPassword.length > 0 && !passwordsMatch ? l.passwordsDontMatchError : void 0
1158
+ }
1159
+ ) }),
1160
+ /* @__PURE__ */ jsxRuntime.jsx(
1161
+ Button,
1162
+ {
1163
+ type: "submit",
1164
+ variant: "primary",
1165
+ size: "lg",
1166
+ disabled: isLoading || !isValid,
1167
+ className: "ds-forgot__submit",
1168
+ children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-forgot__spinner" }) : l.resetPasswordButton
1169
+ }
1170
+ )
1171
+ ] }),
1172
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-forgot__footer", children: /* @__PURE__ */ jsxRuntime.jsxs(
1173
+ "button",
1174
+ {
1175
+ type: "button",
1176
+ className: "ds-forgot__back",
1177
+ onClick: onBackToLogin,
1178
+ disabled: isLoading,
1179
+ children: [
1180
+ /* @__PURE__ */ jsxRuntime.jsx(
1181
+ "svg",
1182
+ {
1183
+ width: "16",
1184
+ height: "16",
1185
+ viewBox: "0 0 16 16",
1186
+ fill: "none",
1187
+ stroke: "currentColor",
1188
+ strokeWidth: "1.5",
1189
+ strokeLinecap: "round",
1190
+ strokeLinejoin: "round",
1191
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 12L6 8L10 4" })
1192
+ }
1193
+ ),
1194
+ l.backToLoginButton
1195
+ ]
1196
+ }
1197
+ ) })
1198
+ ] })
1199
+ ] });
1200
+ }
1201
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx5__default.default("ds-forgot", className), children: [
1202
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-forgot__accent ds-forgot__accent--1", "aria-hidden": "true" }),
1203
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-forgot__accent ds-forgot__accent--2", "aria-hidden": "true" }),
1204
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-forgot__card ds-forgot__card--centered", children: [
1205
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-forgot__success-icon ds-forgot__success-icon--check", children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 64 64", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1206
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "32", cy: "32", r: "30", stroke: "var(--status-success)", strokeWidth: "2" }),
1207
+ /* @__PURE__ */ jsxRuntime.jsx(
1208
+ "path",
1209
+ {
1210
+ d: "M20 32L28 40L44 24",
1211
+ stroke: "var(--status-success)",
1212
+ strokeWidth: "3",
1213
+ strokeLinecap: "round",
1214
+ strokeLinejoin: "round"
1215
+ }
1216
+ )
1217
+ ] }) }),
1218
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "ds-forgot__title", children: l.passwordResetTitle }),
1219
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "ds-forgot__tagline", children: [
1220
+ l.passwordSuccessfullyResetTagline,
1221
+ /* @__PURE__ */ jsxRuntime.jsx("br", {}),
1222
+ l.clickBelowLogInHint
1223
+ ] }),
1224
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "primary", size: "lg", onClick: onBackToLogin, className: "ds-forgot__submit", children: l.continueToLoginButton })
1225
+ ] })
1226
+ ] });
1227
+ };
1228
+ ForgotPassword.displayName = "ForgotPassword";
1229
+ var defaultLabels = {
1230
+ changeEmailTitle: "Change Email",
1231
+ changeEmailTagline: "Enter you new email and the current password.",
1232
+ newEmailLabel: "New Email",
1233
+ newEmailPlaceholder: "",
1234
+ currentPasswordLabel: "Current Password",
1235
+ currentPasswordPlaceholder: "",
1236
+ forgotPasswordButton: "Forgot password?",
1237
+ continueButton: "Continue",
1238
+ backToLoginButton: "Back to login",
1239
+ showPasswordLabel: "Show password",
1240
+ hidePasswordLabel: "Hide password",
1241
+ successTitle: "Email updated",
1242
+ successTagline: "Your email address has been successfully changed.",
1243
+ continueToLoginButton: "Continue to login"
1244
+ };
1245
+ var EyeOpen = () => /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1246
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
1247
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "3" })
1248
+ ] });
1249
+ var EyeOff = () => /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1250
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
1251
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
1252
+ ] });
1253
+ var ChangeEmail = ({
1254
+ logo,
1255
+ labels: customLabels,
1256
+ onSubmit,
1257
+ onForgotPassword,
1258
+ onBackToLogin,
1259
+ isLoading = false,
1260
+ error,
1261
+ step = "form",
1262
+ className
1263
+ }) => {
1264
+ const l = { ...defaultLabels, ...customLabels };
1265
+ const [email, setEmail] = React2.useState("");
1266
+ const [password, setPassword] = React2.useState("");
1267
+ const [showPassword, setShowPassword] = React2.useState(false);
1268
+ const renderLogo = () => logo ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-change-email__logo", children: logo }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-change-email__logo" });
1269
+ const handleSubmit = (e) => {
1270
+ e.preventDefault();
1271
+ onSubmit?.({ email, password });
1272
+ };
1273
+ if (step === "success") {
1274
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx5__default.default("ds-change-email", className), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-change-email__container", children: [
1275
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-change-email__accent ds-change-email__accent--1", "aria-hidden": "true" }),
1276
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-change-email__accent ds-change-email__accent--2", "aria-hidden": "true" }),
1277
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-change-email__card", children: [
1278
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-change-email__header", children: [
1279
+ renderLogo(),
1280
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "ds-change-email__title", children: l.successTitle }),
1281
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "ds-change-email__tagline", children: l.successTagline })
1282
+ ] }),
1283
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "primary", size: "lg", onClick: onBackToLogin, className: "ds-change-email__submit", children: l.continueToLoginButton })
1284
+ ] })
1285
+ ] }) });
1286
+ }
1287
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx5__default.default("ds-change-email", className), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-change-email__container", children: [
1288
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-change-email__accent ds-change-email__accent--1", "aria-hidden": "true" }),
1289
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-change-email__accent ds-change-email__accent--2", "aria-hidden": "true" }),
1290
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-change-email__card", children: [
1291
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-change-email__header", children: [
1292
+ renderLogo(),
1293
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "ds-change-email__title", children: l.changeEmailTitle }),
1294
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "ds-change-email__tagline", children: l.changeEmailTagline })
1295
+ ] }),
1296
+ error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-change-email__error", children: [
1297
+ /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1298
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "1.5" }),
1299
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 4.5V8.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
1300
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "11", r: "0.75", fill: "currentColor" })
1301
+ ] }),
1302
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: error })
1303
+ ] }),
1304
+ /* @__PURE__ */ jsxRuntime.jsxs("form", { className: "ds-change-email__form", onSubmit: handleSubmit, children: [
1305
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-change-email__field", children: /* @__PURE__ */ jsxRuntime.jsx(
1306
+ TextField,
1307
+ {
1308
+ label: l.newEmailLabel,
1309
+ type: "email",
1310
+ placeholder: l.newEmailPlaceholder,
1311
+ value: email,
1312
+ onChange: (e) => setEmail(e.target.value),
1313
+ disabled: isLoading,
1314
+ autoComplete: "email"
1315
+ }
1316
+ ) }),
1317
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-change-email__field", children: /* @__PURE__ */ jsxRuntime.jsx(
1318
+ TextField,
1319
+ {
1320
+ label: l.currentPasswordLabel,
1321
+ type: showPassword ? "text" : "password",
1322
+ placeholder: l.currentPasswordPlaceholder,
1323
+ value: password,
1324
+ onChange: (e) => setPassword(e.target.value),
1325
+ disabled: isLoading,
1326
+ autoComplete: "current-password",
1327
+ endAdornment: /* @__PURE__ */ jsxRuntime.jsx(
1328
+ "button",
1329
+ {
1330
+ type: "button",
1331
+ className: "ds-change-email__password-toggle",
1332
+ onClick: () => setShowPassword(!showPassword),
1333
+ "aria-label": showPassword ? l.hidePasswordLabel : l.showPasswordLabel,
1334
+ children: showPassword ? /* @__PURE__ */ jsxRuntime.jsx(EyeOff, {}) : /* @__PURE__ */ jsxRuntime.jsx(EyeOpen, {})
1335
+ }
1336
+ )
1337
+ }
1338
+ ) }),
1339
+ /* @__PURE__ */ jsxRuntime.jsx(
1340
+ "div",
1341
+ {
1342
+ className: "ds-change-email__options",
1343
+ style: { display: "flex", justifyContent: "flex-end", marginTop: -8 },
1344
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1345
+ "button",
1346
+ {
1347
+ type: "button",
1348
+ className: "ds-change-email__link",
1349
+ onClick: onForgotPassword,
1350
+ disabled: isLoading,
1351
+ children: l.forgotPasswordButton
1352
+ }
1353
+ )
1354
+ }
1355
+ ),
1356
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginTop: 24 }, children: /* @__PURE__ */ jsxRuntime.jsx(
1357
+ Button,
1358
+ {
1359
+ type: "submit",
1360
+ variant: "primary",
1361
+ size: "lg",
1362
+ disabled: isLoading || !email || !password,
1363
+ className: "ds-change-email__submit",
1364
+ children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-change-email__spinner" }) : l.continueButton
1365
+ }
1366
+ ) })
1367
+ ] })
1368
+ ] })
1369
+ ] }) });
1370
+ };
1371
+ ChangeEmail.displayName = "ChangeEmail";
1372
+
1373
+ exports.Button = Button;
1374
+ exports.ChangeEmail = ChangeEmail;
1375
+ exports.Checkbox = Checkbox;
1376
+ exports.ForgotPassword = ForgotPassword;
1377
+ exports.Login = Login;
1378
+ exports.Signup = Signup;
1379
+ exports.TextField = TextField;
1380
+ //# sourceMappingURL=out.js.map
1381
+ //# sourceMappingURL=chunk-YWJKSY5C.cjs.map