@better-auth-ui/heroui 1.6.2 → 1.6.3

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 (74) hide show
  1. package/dist/components/auth/auth-provider.js +12 -11
  2. package/dist/components/auth/auth.d.ts +1 -1
  3. package/dist/components/auth/error-toaster.d.ts +1 -0
  4. package/dist/components/auth/error-toaster.js +17 -0
  5. package/dist/components/auth/forgot-password.d.ts +1 -1
  6. package/dist/components/auth/forgot-password.js +3 -6
  7. package/dist/components/auth/magic-link.d.ts +1 -1
  8. package/dist/components/auth/magic-link.js +52 -64
  9. package/dist/components/auth/passkey-button.js +12 -15
  10. package/dist/components/auth/provider-button.d.ts +15 -0
  11. package/dist/components/auth/provider-button.js +29 -0
  12. package/dist/components/auth/provider-buttons.d.ts +4 -10
  13. package/dist/components/auth/provider-buttons.js +16 -23
  14. package/dist/components/auth/reset-password.d.ts +1 -1
  15. package/dist/components/auth/reset-password.js +3 -6
  16. package/dist/components/auth/sign-in.d.ts +1 -1
  17. package/dist/components/auth/sign-in.js +81 -93
  18. package/dist/components/auth/sign-up.d.ts +1 -1
  19. package/dist/components/auth/sign-up.js +99 -108
  20. package/dist/components/settings/account/appearance.d.ts +1 -1
  21. package/dist/components/settings/account/change-avatar.js +1 -1
  22. package/dist/components/settings/account/change-email.d.ts +1 -1
  23. package/dist/components/settings/account/change-email.js +1 -4
  24. package/dist/components/settings/account/manage-account.js +1 -4
  25. package/dist/components/settings/account/manage-accounts.d.ts +1 -1
  26. package/dist/components/settings/account/manage-accounts.js +16 -16
  27. package/dist/components/settings/account/user-profile.d.ts +1 -1
  28. package/dist/components/settings/account/user-profile.js +1 -4
  29. package/dist/components/settings/security/active-session.js +1 -4
  30. package/dist/components/settings/security/active-sessions.d.ts +1 -1
  31. package/dist/components/settings/security/active-sessions.js +17 -17
  32. package/dist/components/settings/security/change-password.d.ts +1 -1
  33. package/dist/components/settings/security/change-password.js +1 -4
  34. package/dist/components/settings/security/delete-user.d.ts +1 -1
  35. package/dist/components/settings/security/delete-user.js +6 -11
  36. package/dist/components/settings/security/linked-account.js +1 -7
  37. package/dist/components/settings/security/linked-accounts.d.ts +1 -1
  38. package/dist/components/settings/security/linked-accounts.js +18 -18
  39. package/dist/components/settings/security/passkey.js +19 -19
  40. package/dist/components/settings/security/passkeys.d.ts +1 -1
  41. package/dist/components/settings/security/passkeys.js +28 -28
  42. package/dist/components/user/switch-account-item.js +9 -9
  43. package/dist/components/user/switch-account-menu.js +16 -16
  44. package/dist/index.d.ts +1 -0
  45. package/dist/index.js +34 -33
  46. package/package.json +6 -4
  47. package/src/components/auth/auth-provider.tsx +4 -0
  48. package/src/components/auth/auth.tsx +1 -1
  49. package/src/components/auth/error-toaster.tsx +25 -0
  50. package/src/components/auth/forgot-password.tsx +1 -2
  51. package/src/components/auth/magic-link.tsx +3 -23
  52. package/src/components/auth/passkey-button.tsx +1 -2
  53. package/src/components/auth/provider-button.tsx +67 -0
  54. package/src/components/auth/provider-buttons.tsx +26 -43
  55. package/src/components/auth/reset-password.tsx +1 -2
  56. package/src/components/auth/sign-in.tsx +2 -20
  57. package/src/components/auth/sign-up.tsx +5 -20
  58. package/src/components/settings/account/appearance.tsx +1 -1
  59. package/src/components/settings/account/change-avatar.tsx +1 -3
  60. package/src/components/settings/account/change-email.tsx +2 -3
  61. package/src/components/settings/account/manage-account.tsx +1 -4
  62. package/src/components/settings/account/manage-accounts.tsx +3 -8
  63. package/src/components/settings/account/user-profile.tsx +1 -2
  64. package/src/components/settings/security/active-session.tsx +0 -1
  65. package/src/components/settings/security/active-sessions.tsx +3 -8
  66. package/src/components/settings/security/change-password.tsx +7 -4
  67. package/src/components/settings/security/delete-user.tsx +1 -4
  68. package/src/components/settings/security/linked-account.tsx +4 -14
  69. package/src/components/settings/security/linked-accounts.tsx +3 -8
  70. package/src/components/settings/security/passkey.tsx +2 -4
  71. package/src/components/settings/security/passkeys.tsx +4 -12
  72. package/src/components/user/switch-account-item.tsx +2 -4
  73. package/src/components/user/switch-account-menu.tsx +2 -7
  74. package/src/index.tsx +1 -0
@@ -2,157 +2,145 @@ import { FieldSeparator as e } from "./field-separator.js";
2
2
  import { MagicLinkButton as t } from "./magic-link-button.js";
3
3
  import { PasskeyButton as n } from "./passkey-button.js";
4
4
  import { ProviderButtons as r } from "./provider-buttons.js";
5
- import { useAuth as i, useSendVerificationEmail as a, useSignInEmail as o, useSignInSocial as s, useSignInUsername as c } from "@better-auth-ui/react";
6
- import { Button as ee, Card as l, Checkbox as u, Description as te, FieldError as d, Form as f, Input as p, Label as m, Link as h, Spinner as g, TextField as _, cn as v, toast as y } from "@heroui/react";
7
- import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
8
- import { useState as C } from "react";
5
+ import { useAuth as i, useSendVerificationEmail as a, useSignInEmail as o, useSignInUsername as s } from "@better-auth-ui/react";
6
+ import { Button as c, Card as l, Checkbox as u, Description as d, FieldError as f, Form as p, Input as m, Label as h, Link as g, Spinner as _, TextField as v, cn as y, toast as b } from "@heroui/react";
7
+ import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
8
+ import { useState as w } from "react";
9
9
  //#region src/components/auth/sign-in.tsx
10
- function w(e) {
10
+ function T(e) {
11
11
  return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
12
12
  }
13
- function T({ className: T, socialLayout: E, socialPosition: D = "bottom", variant: O, ...k }) {
14
- let { basePaths: A, baseURL: j, emailAndPassword: M, localization: N, magicLink: P, passkey: F, redirectTo: I, socialProviders: L, username: R, viewPaths: z, navigate: B } = i(), [V, H] = C(""), { mutate: U } = a({
15
- onError: (e) => y.danger(e.error?.message || e.message),
16
- onSuccess: () => y.success(N.auth.verificationEmailSent)
17
- }), { mutate: W, isPending: G } = o({
13
+ function E({ className: E, socialLayout: D, socialPosition: O = "bottom", variant: k, ...A }) {
14
+ let { basePaths: j, baseURL: M, emailAndPassword: N, localization: P, magicLink: F, passkey: I, redirectTo: L, socialProviders: R, username: z, viewPaths: B, navigate: V } = i(), [H, U] = w(""), { mutate: W } = a({ onSuccess: () => b.success(P.auth.verificationEmailSent) }), { mutate: G, isPending: K } = o({
18
15
  onError: (e, { email: t }) => {
19
- H(""), e.error?.code === "EMAIL_NOT_VERIFIED" ? y.danger(e.error?.message || e.message, { actionProps: {
20
- children: N.auth.resend,
21
- onClick: () => U({
16
+ U(""), e.error?.code === "EMAIL_NOT_VERIFIED" ? b.danger(e.error?.message || e.message, { actionProps: {
17
+ children: P.auth.resend,
18
+ onClick: () => W({
22
19
  email: t,
23
- callbackURL: `${j}${I}`
20
+ callbackURL: `${M}${L}`
24
21
  })
25
- } }) : y.danger(e.error?.message || e.message);
22
+ } }) : b.danger(e.error?.message || e.message);
26
23
  },
27
- onSuccess: () => B({ to: I })
28
- }), { mutate: K, isPending: q } = c({
24
+ onSuccess: () => V({ to: L })
25
+ }), { mutate: q, isPending: J } = s({
29
26
  onError: (e) => {
30
- H(""), y.danger(e.error?.message || e.message);
27
+ U(""), b.danger(e.error?.message || e.message);
31
28
  },
32
- onSuccess: () => B({ to: I })
33
- }), [J, Y] = C(!1), { mutate: X, isPending: Z } = s({
34
- onError: (e) => y.danger(e.error?.message || e.message),
35
- onSuccess: () => {
36
- Y(!0), setTimeout(() => {
37
- Y(!1);
38
- }, 5e3);
39
- }
40
- }), ne = (e) => {
29
+ onSuccess: () => V({ to: L })
30
+ }), Y = (e) => {
41
31
  e.preventDefault();
42
32
  let t = new FormData(e.currentTarget), n = t.get("email"), r = t.get("rememberMe") === "on";
43
- R?.enabled && !w(n) ? K({
33
+ z?.enabled && !T(n) ? q({
44
34
  username: n,
45
- password: V
46
- }) : W({
35
+ password: H
36
+ }) : G({
47
37
  email: n,
48
- password: V,
49
- ...M?.rememberMe ? { rememberMe: r } : {}
38
+ password: H,
39
+ ...N?.rememberMe ? { rememberMe: r } : {}
50
40
  });
51
- }, Q = G || q || Z || J, $ = M?.enabled && !!L?.length;
52
- return /* @__PURE__ */ S(l, {
53
- className: v("w-full max-w-sm gap-4 md:p-6", T),
54
- variant: O,
55
- ...k,
41
+ }, X = K || J, Z = N?.enabled && !!R?.length;
42
+ return /* @__PURE__ */ C(l, {
43
+ className: y("w-full max-w-sm gap-4 md:p-6", E),
44
+ variant: k,
45
+ ...A,
56
46
  children: [
57
- /* @__PURE__ */ x(l.Header, { children: /* @__PURE__ */ x(l.Title, {
47
+ /* @__PURE__ */ S(l.Header, { children: /* @__PURE__ */ S(l.Title, {
58
48
  className: "text-xl font-semibold mb-1",
59
- children: N.auth.signIn
49
+ children: P.auth.signIn
60
50
  }) }),
61
- /* @__PURE__ */ S(l.Content, {
51
+ /* @__PURE__ */ C(l.Content, {
62
52
  className: "gap-4",
63
53
  children: [
64
- D === "top" && /* @__PURE__ */ S(b, { children: [!!L?.length && /* @__PURE__ */ x(r, {
65
- socialLayout: E,
66
- signInSocial: X,
67
- isPending: Q
68
- }), $ && /* @__PURE__ */ x(e, { children: N.auth.or })] }),
69
- M?.enabled && /* @__PURE__ */ S(f, {
70
- onSubmit: ne,
54
+ O === "top" && /* @__PURE__ */ C(x, { children: [!!R?.length && /* @__PURE__ */ S(r, {
55
+ socialLayout: D,
56
+ isPending: X
57
+ }), Z && /* @__PURE__ */ S(e, { children: P.auth.or })] }),
58
+ N?.enabled && /* @__PURE__ */ C(p, {
59
+ onSubmit: Y,
71
60
  className: "flex flex-col gap-4",
72
61
  children: [
73
- /* @__PURE__ */ S(_, {
62
+ /* @__PURE__ */ C(v, {
74
63
  name: "email",
75
- type: R?.enabled ? "text" : "email",
76
- autoComplete: R?.enabled ? "username" : "email",
77
- isDisabled: Q,
64
+ type: z?.enabled ? "text" : "email",
65
+ autoComplete: z?.enabled ? "username" : "email",
66
+ isDisabled: X,
78
67
  children: [
79
- /* @__PURE__ */ x(m, { children: R?.enabled ? N.auth.username : N.auth.email }),
80
- /* @__PURE__ */ x(p, {
81
- placeholder: R?.enabled ? N.auth.usernameOrEmailPlaceholder : N.auth.emailPlaceholder,
82
- variant: O === "transparent" ? "primary" : "secondary",
68
+ /* @__PURE__ */ S(h, { children: z?.enabled ? P.auth.username : P.auth.email }),
69
+ /* @__PURE__ */ S(m, {
70
+ placeholder: z?.enabled ? P.auth.usernameOrEmailPlaceholder : P.auth.emailPlaceholder,
71
+ variant: k === "transparent" ? "primary" : "secondary",
83
72
  required: !0
84
73
  }),
85
- /* @__PURE__ */ x(d, {})
74
+ /* @__PURE__ */ S(f, {})
86
75
  ]
87
76
  }),
88
- /* @__PURE__ */ S(_, {
89
- minLength: M?.minPasswordLength,
90
- maxLength: M?.maxPasswordLength,
77
+ /* @__PURE__ */ C(v, {
78
+ minLength: N?.minPasswordLength,
79
+ maxLength: N?.maxPasswordLength,
91
80
  name: "password",
92
81
  type: "password",
93
82
  autoComplete: "current-password",
94
- isDisabled: Q,
95
- value: V,
96
- onChange: H,
83
+ isDisabled: X,
84
+ value: H,
85
+ onChange: U,
97
86
  children: [
98
- /* @__PURE__ */ x(m, { children: N.auth.password }),
99
- /* @__PURE__ */ x(p, {
100
- placeholder: N.auth.passwordPlaceholder,
101
- variant: O === "transparent" ? "primary" : "secondary",
87
+ /* @__PURE__ */ S(h, { children: P.auth.password }),
88
+ /* @__PURE__ */ S(m, {
89
+ placeholder: P.auth.passwordPlaceholder,
90
+ variant: k === "transparent" ? "primary" : "secondary",
102
91
  required: !0
103
92
  }),
104
- /* @__PURE__ */ x(d, {})
93
+ /* @__PURE__ */ S(f, {})
105
94
  ]
106
95
  }),
107
- M?.rememberMe && /* @__PURE__ */ S(u, {
96
+ N?.rememberMe && /* @__PURE__ */ C(u, {
108
97
  name: "rememberMe",
109
- isDisabled: Q,
110
- variant: O === "transparent" ? "primary" : "secondary",
111
- children: [/* @__PURE__ */ x(u.Control, { children: /* @__PURE__ */ x(u.Indicator, {}) }), /* @__PURE__ */ x(u.Content, { children: /* @__PURE__ */ x(m, { children: N.auth.rememberMe }) })]
98
+ isDisabled: X,
99
+ variant: k === "transparent" ? "primary" : "secondary",
100
+ children: [/* @__PURE__ */ S(u.Control, { children: /* @__PURE__ */ S(u.Indicator, {}) }), /* @__PURE__ */ S(u.Content, { children: /* @__PURE__ */ S(h, { children: P.auth.rememberMe }) })]
112
101
  }),
113
- /* @__PURE__ */ S("div", {
102
+ /* @__PURE__ */ C("div", {
114
103
  className: "flex flex-col gap-3",
115
104
  children: [
116
- /* @__PURE__ */ S(ee, {
105
+ /* @__PURE__ */ C(c, {
117
106
  type: "submit",
118
107
  className: "w-full",
119
- isPending: Q,
120
- children: [Q && /* @__PURE__ */ x(g, {
108
+ isPending: X,
109
+ children: [X && /* @__PURE__ */ S(_, {
121
110
  color: "current",
122
111
  size: "sm"
123
- }), N.auth.signIn]
112
+ }), P.auth.signIn]
124
113
  }),
125
- P && /* @__PURE__ */ x(t, {
114
+ F && /* @__PURE__ */ S(t, {
126
115
  view: "signIn",
127
- isPending: Q
116
+ isPending: X
128
117
  }),
129
- F && /* @__PURE__ */ x(n, { isPending: Q })
118
+ I && /* @__PURE__ */ S(n, { isPending: X })
130
119
  ]
131
120
  })
132
121
  ]
133
122
  }),
134
- D === "bottom" && /* @__PURE__ */ S(b, { children: [$ && /* @__PURE__ */ x(e, { children: N.auth.or }), !!L?.length && /* @__PURE__ */ x(r, {
135
- socialLayout: E,
136
- signInSocial: X,
137
- isPending: Q
123
+ O === "bottom" && /* @__PURE__ */ C(x, { children: [Z && /* @__PURE__ */ S(e, { children: P.auth.or }), !!R?.length && /* @__PURE__ */ S(r, {
124
+ socialLayout: D,
125
+ isPending: X
138
126
  })] })
139
127
  ]
140
128
  }),
141
- /* @__PURE__ */ S(l.Footer, {
129
+ /* @__PURE__ */ C(l.Footer, {
142
130
  className: "flex-col gap-3",
143
- children: [M?.forgotPassword && /* @__PURE__ */ x(h, {
144
- href: `${A.auth}/${z.auth.forgotPassword}`,
131
+ children: [N?.forgotPassword && /* @__PURE__ */ S(g, {
132
+ href: `${j.auth}/${B.auth.forgotPassword}`,
145
133
  className: "no-underline hover:underline",
146
- children: N.auth.forgotPasswordLink
147
- }), M?.enabled && /* @__PURE__ */ S(te, {
134
+ children: P.auth.forgotPasswordLink
135
+ }), N?.enabled && /* @__PURE__ */ C(d, {
148
136
  className: "text-sm",
149
137
  children: [
150
- N.auth.needToCreateAnAccount,
138
+ P.auth.needToCreateAnAccount,
151
139
  " ",
152
- /* @__PURE__ */ x(h, {
153
- href: `${A.auth}/${z.auth.signUp}`,
140
+ /* @__PURE__ */ S(g, {
141
+ href: `${j.auth}/${B.auth.signUp}`,
154
142
  className: "text-accent no-underline hover:underline decoration-accent-hover",
155
- children: N.auth.signUp
143
+ children: P.auth.signUp
156
144
  })
157
145
  ]
158
146
  })]
@@ -161,4 +149,4 @@ function T({ className: T, socialLayout: E, socialPosition: D = "bottom", varian
161
149
  });
162
150
  }
163
151
  //#endregion
164
- export { T as SignIn };
152
+ export { E as SignIn };
@@ -16,4 +16,4 @@ export type SignUpProps = {
16
16
  * @param socialPosition - Position of social provider buttons relative to the form; `"top"` or `"bottom"` (default `"bottom"`)
17
17
  * @returns The sign-up form React element
18
18
  */
19
- export declare function SignUp({ className, socialLayout, socialPosition, variant, ...props }: SignUpProps & CardProps): import("react/jsx-runtime").JSX.Element;
19
+ export declare function SignUp({ className, socialLayout, socialPosition, variant, ...props }: SignUpProps & Omit<CardProps, "children">): import("react/jsx-runtime").JSX.Element;
@@ -1,235 +1,226 @@
1
1
  import { FieldSeparator as e } from "./field-separator.js";
2
2
  import { MagicLinkButton as t } from "./magic-link-button.js";
3
3
  import { ProviderButtons as n } from "./provider-buttons.js";
4
- import { useAuth as r, useIsUsernameAvailable as i, useSignInSocial as ee, useSignUpEmail as te } from "@better-auth-ui/react";
5
- import { Button as a, Card as o, Description as ne, FieldError as s, Form as c, Input as l, InputGroup as u, Label as d, Link as re, Spinner as f, TextField as p, cn as m, toast as h } from "@heroui/react";
6
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
7
- import { useState as y } from "react";
8
- import { Check as ie, Eye as b, EyeSlash as x, Xmark as S } from "@gravity-ui/icons";
4
+ import { useAuth as r, useIsUsernameAvailable as i, useSignUpEmail as ee } from "@better-auth-ui/react";
5
+ import { Button as a, Card as o, Description as te, FieldError as s, Form as ne, Input as c, InputGroup as l, Label as u, Link as re, Spinner as d, TextField as f, cn as p, toast as m } from "@heroui/react";
6
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
7
+ import { useState as v } from "react";
8
+ import { Check as y, Eye as b, EyeSlash as x, Xmark as S } from "@gravity-ui/icons";
9
9
  import { useDebouncer as C } from "@tanstack/react-pacer";
10
10
  //#region src/components/auth/sign-up.tsx
11
- function w({ className: w, socialLayout: T, socialPosition: E = "bottom", variant: D, ...ae }) {
12
- let { basePaths: O, emailAndPassword: k, localization: A, magicLink: j, redirectTo: M, socialProviders: N, username: P, viewPaths: F, navigate: I } = r(), [L, R] = y(""), [z, B] = y(""), [V, H] = y(""), { mutate: U, data: W, error: G, reset: K } = i(), q = C((e) => {
11
+ function w({ className: w, socialLayout: T, socialPosition: E = "bottom", variant: D, ...O }) {
12
+ let { basePaths: k, emailAndPassword: A, localization: j, magicLink: M, redirectTo: N, socialProviders: P, username: F, viewPaths: I, navigate: L } = r(), [R, z] = v(""), [B, V] = v(""), [H, U] = v(""), { mutate: W, data: G, error: K, reset: q } = i(), J = C((e) => {
13
13
  if (!e.trim()) {
14
- K();
14
+ q();
15
15
  return;
16
16
  }
17
- U({ username: e.trim() });
17
+ W({ username: e.trim() });
18
18
  }, { wait: 500 });
19
- function oe(e) {
20
- H(e), K(), P?.isUsernameAvailable && q.maybeExecute(e);
19
+ function Y(e) {
20
+ U(e), q(), F?.isUsernameAvailable && J.maybeExecute(e);
21
21
  }
22
- let { mutate: se, isPending: ce } = te({
22
+ let { mutate: ie, isPending: ae } = ee({
23
23
  onError: (e) => {
24
- R(""), B(""), h.danger(e.error?.message || e.message);
24
+ z(""), V(""), m.danger(e.error?.message || e.message);
25
25
  },
26
26
  onSuccess: () => {
27
- k?.requireEmailVerification ? (h.success(A.auth.verifyYourEmail), I({ to: `${O.auth}/${F.auth.signIn}` })) : I({ to: M });
27
+ A?.requireEmailVerification ? (m.success(j.auth.verifyYourEmail), L({ to: `${k.auth}/${I.auth.signIn}` })) : L({ to: N });
28
28
  }
29
- }), [le, J] = y(!1), { mutate: Y, isPending: ue } = ee({
30
- onError: (e) => h.danger(e.error?.message || e.message),
31
- onSuccess: () => {
32
- J(!0), setTimeout(() => {
33
- J(!1);
34
- }, 5e3);
35
- }
36
- }), [X, de] = y(!1), [Z, fe] = y(!1), Q = ce || ue || le, pe = (e) => {
29
+ }), [X, oe] = v(!1), [Z, se] = v(!1), Q = ae, ce = (e) => {
37
30
  e.preventDefault();
38
31
  let t = new FormData(e.currentTarget), n = t.get("name"), r = t.get("email");
39
- if (k?.confirmPassword && L !== z) {
40
- h.danger(A.auth.passwordsDoNotMatch), R(""), B("");
32
+ if (A?.confirmPassword && R !== B) {
33
+ m.danger(j.auth.passwordsDoNotMatch), z(""), V("");
41
34
  return;
42
35
  }
43
- se({
36
+ ie({
44
37
  name: n,
45
38
  email: r,
46
- password: L,
47
- ...P?.enabled ? {
48
- username: V.trim(),
49
- ...P.displayUsername ? { displayUsername: V.trim() } : {}
39
+ password: R,
40
+ ...F?.enabled ? {
41
+ username: H.trim(),
42
+ ...F.displayUsername ? { displayUsername: H.trim() } : {}
50
43
  } : {}
51
44
  });
52
- }, $ = k?.enabled && !!N?.length;
53
- return /* @__PURE__ */ v(o, {
54
- className: m("w-full max-w-sm p-4 md:p-6", w),
45
+ }, $ = A?.enabled && !!P?.length;
46
+ return /* @__PURE__ */ _(o, {
47
+ className: p("w-full max-w-sm p-4 md:p-6", w),
55
48
  variant: D,
56
- ...ae,
49
+ ...O,
57
50
  children: [
58
- /* @__PURE__ */ _(o.Header, { children: /* @__PURE__ */ _(o.Title, {
51
+ /* @__PURE__ */ g(o.Header, { children: /* @__PURE__ */ g(o.Title, {
59
52
  className: "text-xl font-semibold mb-1",
60
- children: A.auth.signUp
53
+ children: j.auth.signUp
61
54
  }) }),
62
- /* @__PURE__ */ v(o.Content, {
55
+ /* @__PURE__ */ _(o.Content, {
63
56
  className: "gap-4",
64
57
  children: [
65
- E === "top" && /* @__PURE__ */ v(g, { children: [!!N?.length && /* @__PURE__ */ _(n, {
58
+ E === "top" && /* @__PURE__ */ _(h, { children: [!!P?.length && /* @__PURE__ */ g(n, {
66
59
  isPending: Q,
67
- socialLayout: T,
68
- signInSocial: Y
69
- }), $ && /* @__PURE__ */ _(e, { children: A.auth.or })] }),
70
- k?.enabled && /* @__PURE__ */ v(c, {
71
- onSubmit: pe,
60
+ socialLayout: T
61
+ }), $ && /* @__PURE__ */ g(e, { children: j.auth.or })] }),
62
+ A?.enabled && /* @__PURE__ */ _(ne, {
63
+ onSubmit: ce,
72
64
  className: "flex flex-col gap-4",
73
65
  children: [
74
- /* @__PURE__ */ v(p, {
66
+ /* @__PURE__ */ _(f, {
75
67
  name: "name",
76
68
  type: "text",
77
69
  autoComplete: "name",
78
70
  isDisabled: Q,
79
71
  children: [
80
- /* @__PURE__ */ _(d, { children: A.auth.name }),
81
- /* @__PURE__ */ _(l, {
82
- placeholder: A.auth.namePlaceholder,
72
+ /* @__PURE__ */ g(u, { children: j.auth.name }),
73
+ /* @__PURE__ */ g(c, {
74
+ placeholder: j.auth.namePlaceholder,
83
75
  required: !0,
84
76
  variant: D === "transparent" ? "primary" : "secondary"
85
77
  }),
86
- /* @__PURE__ */ _(s, {})
78
+ /* @__PURE__ */ g(s, {})
87
79
  ]
88
80
  }),
89
- P?.enabled && /* @__PURE__ */ v(p, {
81
+ F?.enabled && /* @__PURE__ */ _(f, {
90
82
  name: "username",
91
83
  type: "text",
92
84
  autoComplete: "username",
93
- minLength: P.minUsernameLength,
94
- maxLength: P.maxUsernameLength,
85
+ minLength: F.minUsernameLength,
86
+ maxLength: F.maxUsernameLength,
95
87
  isDisabled: Q,
96
- value: V,
97
- onChange: oe,
98
- isInvalid: !!G || W && !W.available,
88
+ value: H,
89
+ onChange: Y,
90
+ isInvalid: !!K || G && !G.available,
99
91
  children: [
100
- /* @__PURE__ */ _(d, { children: A.auth.username }),
101
- /* @__PURE__ */ v(u, {
92
+ /* @__PURE__ */ g(u, { children: j.auth.username }),
93
+ /* @__PURE__ */ _(l, {
102
94
  variant: D === "transparent" ? "primary" : "secondary",
103
- children: [/* @__PURE__ */ _(u.Input, {
104
- placeholder: A.auth.usernamePlaceholder,
95
+ children: [/* @__PURE__ */ g(l.Input, {
96
+ placeholder: j.auth.usernamePlaceholder,
105
97
  required: !0
106
- }), P.isUsernameAvailable && V.trim() && /* @__PURE__ */ _(u.Suffix, {
98
+ }), F.isUsernameAvailable && H.trim() && /* @__PURE__ */ g(l.Suffix, {
107
99
  className: "px-2",
108
- children: W?.available ? /* @__PURE__ */ _(ie, { className: "text-success" }) : G || W?.available === !1 ? /* @__PURE__ */ _(S, { className: "text-danger" }) : /* @__PURE__ */ _(f, {
100
+ children: G?.available ? /* @__PURE__ */ g(y, { className: "text-success" }) : K || G?.available === !1 ? /* @__PURE__ */ g(S, { className: "text-danger" }) : /* @__PURE__ */ g(d, {
109
101
  size: "sm",
110
102
  color: "current"
111
103
  })
112
104
  })]
113
105
  }),
114
- /* @__PURE__ */ _(s, { children: G?.error?.message || G?.message || W?.available === !1 && A.auth.usernameTaken })
106
+ /* @__PURE__ */ g(s, { children: K?.error?.message || K?.message || (G?.available === !1 ? j.auth.usernameTaken : null) })
115
107
  ]
116
108
  }),
117
- /* @__PURE__ */ v(p, {
109
+ /* @__PURE__ */ _(f, {
118
110
  name: "email",
119
111
  type: "email",
120
112
  autoComplete: "email",
121
113
  isDisabled: Q,
122
114
  children: [
123
- /* @__PURE__ */ _(d, { children: A.auth.email }),
124
- /* @__PURE__ */ _(l, {
125
- placeholder: A.auth.emailPlaceholder,
115
+ /* @__PURE__ */ g(u, { children: j.auth.email }),
116
+ /* @__PURE__ */ g(c, {
117
+ placeholder: j.auth.emailPlaceholder,
126
118
  required: !0,
127
119
  variant: D === "transparent" ? "primary" : "secondary"
128
120
  }),
129
- /* @__PURE__ */ _(s, {})
121
+ /* @__PURE__ */ g(s, {})
130
122
  ]
131
123
  }),
132
- /* @__PURE__ */ v(p, {
133
- minLength: k?.minPasswordLength,
134
- maxLength: k?.maxPasswordLength,
124
+ /* @__PURE__ */ _(f, {
125
+ minLength: A?.minPasswordLength,
126
+ maxLength: A?.maxPasswordLength,
135
127
  name: "password",
136
128
  autoComplete: "new-password",
137
129
  isDisabled: Q,
138
- value: L,
139
- onChange: R,
130
+ value: R,
131
+ onChange: z,
140
132
  children: [
141
- /* @__PURE__ */ _(d, { children: A.auth.password }),
142
- /* @__PURE__ */ v(u, {
133
+ /* @__PURE__ */ g(u, { children: j.auth.password }),
134
+ /* @__PURE__ */ _(l, {
143
135
  variant: D === "transparent" ? "primary" : "secondary",
144
- children: [/* @__PURE__ */ _(u.Input, {
145
- placeholder: A.auth.passwordPlaceholder,
136
+ children: [/* @__PURE__ */ g(l.Input, {
137
+ placeholder: j.auth.passwordPlaceholder,
146
138
  type: X ? "text" : "password",
147
139
  name: "password",
148
140
  required: !0
149
- }), /* @__PURE__ */ _(u.Suffix, {
141
+ }), /* @__PURE__ */ g(l.Suffix, {
150
142
  className: "px-0",
151
- children: /* @__PURE__ */ _(a, {
143
+ children: /* @__PURE__ */ g(a, {
152
144
  isIconOnly: !0,
153
- "aria-label": X ? A.auth.hidePassword : A.auth.showPassword,
145
+ "aria-label": X ? j.auth.hidePassword : j.auth.showPassword,
154
146
  size: "sm",
155
147
  variant: "ghost",
156
- onPress: () => de(!X),
148
+ onPress: () => oe(!X),
157
149
  isDisabled: Q,
158
- children: _(X ? x : b, {})
150
+ children: g(X ? x : b, {})
159
151
  })
160
152
  })]
161
153
  }),
162
- /* @__PURE__ */ _(s, {})
154
+ /* @__PURE__ */ g(s, {})
163
155
  ]
164
156
  }),
165
- k?.confirmPassword && /* @__PURE__ */ v(p, {
166
- minLength: k?.minPasswordLength,
167
- maxLength: k?.maxPasswordLength,
157
+ A?.confirmPassword && /* @__PURE__ */ _(f, {
158
+ minLength: A?.minPasswordLength,
159
+ maxLength: A?.maxPasswordLength,
168
160
  name: "confirmPassword",
169
161
  autoComplete: "new-password",
170
162
  isDisabled: Q,
171
- value: z,
172
- onChange: B,
163
+ value: B,
164
+ onChange: V,
173
165
  children: [
174
- /* @__PURE__ */ _(d, { children: A.auth.confirmPassword }),
175
- /* @__PURE__ */ v(u, {
166
+ /* @__PURE__ */ g(u, { children: j.auth.confirmPassword }),
167
+ /* @__PURE__ */ _(l, {
176
168
  variant: D === "transparent" ? "primary" : "secondary",
177
- children: [/* @__PURE__ */ _(u.Input, {
169
+ children: [/* @__PURE__ */ g(l.Input, {
178
170
  name: "confirmPassword",
179
- placeholder: A.auth.confirmPasswordPlaceholder,
171
+ placeholder: j.auth.confirmPasswordPlaceholder,
180
172
  type: Z ? "text" : "password",
181
173
  required: !0
182
- }), /* @__PURE__ */ _(u.Suffix, {
174
+ }), /* @__PURE__ */ g(l.Suffix, {
183
175
  className: "px-0",
184
- children: /* @__PURE__ */ _(a, {
176
+ children: /* @__PURE__ */ g(a, {
185
177
  isIconOnly: !0,
186
- "aria-label": Z ? A.auth.hidePassword : A.auth.showPassword,
178
+ "aria-label": Z ? j.auth.hidePassword : j.auth.showPassword,
187
179
  size: "sm",
188
180
  variant: "ghost",
189
- onPress: () => fe(!Z),
181
+ onPress: () => se(!Z),
190
182
  isDisabled: Q,
191
- children: _(Z ? x : b, {})
183
+ children: g(Z ? x : b, {})
192
184
  })
193
185
  })]
194
186
  }),
195
- /* @__PURE__ */ _(s, {})
187
+ /* @__PURE__ */ g(s, {})
196
188
  ]
197
189
  }),
198
- /* @__PURE__ */ v("div", {
190
+ /* @__PURE__ */ _("div", {
199
191
  className: "flex flex-col gap-3",
200
- children: [/* @__PURE__ */ v(a, {
192
+ children: [/* @__PURE__ */ _(a, {
201
193
  type: "submit",
202
194
  className: "w-full",
203
195
  isPending: Q,
204
- children: [Q && /* @__PURE__ */ _(f, {
196
+ children: [Q && /* @__PURE__ */ g(d, {
205
197
  color: "current",
206
198
  size: "sm"
207
- }), A.auth.signUp]
208
- }), j && /* @__PURE__ */ _(t, {
199
+ }), j.auth.signUp]
200
+ }), M && /* @__PURE__ */ g(t, {
209
201
  view: "signUp",
210
202
  isPending: Q
211
203
  })]
212
204
  })
213
205
  ]
214
206
  }),
215
- E === "bottom" && /* @__PURE__ */ v(g, { children: [$ && /* @__PURE__ */ _(e, { children: A.auth.or }), !!N?.length && /* @__PURE__ */ _(n, {
207
+ E === "bottom" && /* @__PURE__ */ _(h, { children: [$ && /* @__PURE__ */ g(e, { children: j.auth.or }), !!P?.length && /* @__PURE__ */ g(n, {
216
208
  socialLayout: T,
217
- signInSocial: Y,
218
209
  isPending: Q
219
210
  })] })
220
211
  ]
221
212
  }),
222
- /* @__PURE__ */ _(o.Footer, {
213
+ /* @__PURE__ */ g(o.Footer, {
223
214
  className: "flex-col",
224
- children: /* @__PURE__ */ v(ne, {
215
+ children: /* @__PURE__ */ _(te, {
225
216
  className: "text-sm",
226
217
  children: [
227
- A.auth.alreadyHaveAnAccount,
218
+ j.auth.alreadyHaveAnAccount,
228
219
  " ",
229
- /* @__PURE__ */ _(re, {
230
- href: `${O.auth}/${F.auth.signIn}`,
220
+ /* @__PURE__ */ g(re, {
221
+ href: `${k.auth}/${I.auth.signIn}`,
231
222
  className: "text-accent decoration-accent no-underline hover:underline",
232
- children: A.auth.signIn
223
+ children: j.auth.signIn
233
224
  })
234
225
  ]
235
226
  })
@@ -13,4 +13,4 @@ export type AppearanceProps = {
13
13
  * @param className - Optional additional CSS class names for the card container.
14
14
  * @returns A JSX element containing the theme selector card, or null if theme settings are not configured.
15
15
  */
16
- export declare function Appearance({ className, variant, ...props }: AppearanceProps & CardProps): import("react/jsx-runtime").JSX.Element | null;
16
+ export declare function Appearance({ className, variant, ...props }: AppearanceProps & Omit<CardProps, "children">): import("react/jsx-runtime").JSX.Element | null;
@@ -7,7 +7,7 @@ import { CloudArrowUpIn as m, TrashBin as h } from "@gravity-ui/icons";
7
7
  import { fileToBase64 as g } from "@better-auth-ui/core";
8
8
  //#region src/components/settings/account/change-avatar.tsx
9
9
  function _({ className: _ }) {
10
- let { localization: v, avatar: y } = t(), { data: b } = n(), { mutate: x, isPending: S } = r({ onError: (e) => l.danger(e.error?.message || e.message) }), C = f(null), [w, T] = p(!1), [E, D] = p(!1), O = S || w || E;
10
+ let { localization: v, avatar: y } = t(), { data: b } = n(), { mutate: x, isPending: S } = r(), C = f(null), [w, T] = p(!1), [E, D] = p(!1), O = S || w || E;
11
11
  async function k(e) {
12
12
  let t = e.target.files?.[0];
13
13
  if (t) {
@@ -12,4 +12,4 @@ export type ChangeEmailProps = {
12
12
  *
13
13
  * @returns A JSX element rendering the change-email card and form
14
14
  */
15
- export declare function ChangeEmail({ className, variant, ...props }: ChangeEmailProps & CardProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function ChangeEmail({ className, variant, ...props }: ChangeEmailProps & Omit<CardProps, "children">): import("react/jsx-runtime").JSX.Element;
@@ -3,10 +3,7 @@ import { Button as r, Card as i, FieldError as a, Fieldset as o, Form as s, Inpu
3
3
  import { jsx as h, jsxs as g } from "react/jsx-runtime";
4
4
  //#region src/components/settings/account/change-email.tsx
5
5
  function _({ className: _, variant: v, ...y }) {
6
- let { localization: b, baseURL: x, viewPaths: S } = e(), { data: C } = n(), { mutate: w, isPending: T } = t({
7
- onSuccess: () => m.success(b.settings.changeEmailSuccess),
8
- onError: (e) => m.danger(e.error?.message || e.message)
9
- });
6
+ let { localization: b, baseURL: x, viewPaths: S } = e(), { data: C } = n(), { mutate: w, isPending: T } = t({ onSuccess: () => m.success(b.settings.changeEmailSuccess) });
10
7
  function E(e) {
11
8
  e.preventDefault(), w({
12
9
  newEmail: new FormData(e.currentTarget).get("email"),