@better-auth-ui/heroui 1.6.3 → 1.6.5

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 (204) hide show
  1. package/dist/components/auth/additional-field.d.ts +4 -0
  2. package/dist/components/auth/additional-field.js +270 -0
  3. package/dist/components/auth/auth-provider.d.ts +4 -6
  4. package/dist/components/auth/auth.d.ts +1 -1
  5. package/dist/components/auth/auth.js +54 -28
  6. package/dist/components/{settings/security → auth/delete-user}/danger-zone.d.ts +1 -1
  7. package/dist/components/{settings/security → auth/delete-user}/danger-zone.js +1 -1
  8. package/dist/components/auth/delete-user/delete-user.js +95 -0
  9. package/dist/components/{email → auth/email}/email-changed-email.d.ts +2 -2
  10. package/dist/components/{email → auth/email}/email-changed-email.js +7 -7
  11. package/dist/components/{email → auth/email}/email-verification-email.d.ts +2 -2
  12. package/dist/components/{email → auth/email}/email-verification-email.js +7 -7
  13. package/dist/components/auth/email/magic-link-email.d.ts +3 -0
  14. package/dist/components/{email → auth/email}/magic-link-email.js +7 -7
  15. package/dist/components/auth/email/new-device-email.d.ts +3 -0
  16. package/dist/components/{email → auth/email}/new-device-email.js +7 -7
  17. package/dist/components/auth/email/otp-email.d.ts +3 -0
  18. package/dist/components/{email → auth/email}/otp-email.js +6 -6
  19. package/dist/components/{email → auth/email}/password-changed-email.d.ts +2 -2
  20. package/dist/components/{email → auth/email}/password-changed-email.js +7 -7
  21. package/dist/components/{email → auth/email}/reset-password-email.d.ts +2 -2
  22. package/dist/components/{email → auth/email}/reset-password-email.js +7 -7
  23. package/dist/components/auth/forgot-password.d.ts +1 -1
  24. package/dist/components/auth/forgot-password.js +70 -48
  25. package/dist/components/auth/magic-link/magic-link-button.d.ts +11 -0
  26. package/dist/components/auth/magic-link/magic-link-button.js +20 -0
  27. package/dist/components/auth/magic-link/magic-link.d.ts +16 -0
  28. package/dist/components/auth/magic-link/magic-link.js +87 -0
  29. package/dist/components/{settings/account → auth/multi-session}/manage-account.d.ts +2 -6
  30. package/dist/components/auth/multi-session/manage-account.js +49 -0
  31. package/dist/components/auth/multi-session/manage-accounts.js +34 -0
  32. package/dist/components/{user/switch-account-menu.d.ts → auth/multi-session/switch-account-submenu-content.d.ts} +3 -3
  33. package/dist/components/auth/multi-session/switch-account-submenu-content.js +29 -0
  34. package/dist/components/{user/switch-account-item.d.ts → auth/multi-session/switch-account-submenu-item.d.ts} +2 -2
  35. package/dist/components/auth/multi-session/switch-account-submenu-item.js +20 -0
  36. package/dist/components/auth/multi-session/switch-account-submenu.d.ts +13 -0
  37. package/dist/components/auth/multi-session/switch-account-submenu.js +24 -0
  38. package/dist/components/auth/passkey/passkey-button.d.ts +6 -0
  39. package/dist/components/auth/passkey/passkey-button.js +24 -0
  40. package/dist/components/auth/passkey/passkey.js +45 -0
  41. package/dist/components/auth/passkey/passkeys.js +106 -0
  42. package/dist/components/auth/provider-button.d.ts +6 -8
  43. package/dist/components/auth/provider-button.js +16 -20
  44. package/dist/components/auth/provider-buttons.d.ts +3 -4
  45. package/dist/components/auth/provider-buttons.js +9 -10
  46. package/dist/components/auth/reset-password.js +110 -107
  47. package/dist/components/{settings → auth/settings}/account/account-settings.d.ts +5 -2
  48. package/dist/components/auth/settings/account/account-settings.js +20 -0
  49. package/dist/components/auth/settings/account/change-avatar.js +89 -0
  50. package/dist/components/{settings → auth/settings}/account/change-email.js +17 -17
  51. package/dist/components/{settings → auth/settings}/account/user-profile.d.ts +2 -3
  52. package/dist/components/auth/settings/account/user-profile.js +86 -0
  53. package/dist/components/auth/settings/security/active-session.js +59 -0
  54. package/dist/components/{settings → auth/settings}/security/active-sessions.js +4 -4
  55. package/dist/components/auth/settings/security/change-password.js +189 -0
  56. package/dist/components/auth/settings/security/linked-account.js +56 -0
  57. package/dist/components/{settings → auth/settings}/security/linked-accounts.js +5 -5
  58. package/dist/components/{settings → auth/settings}/security/security-settings.d.ts +1 -1
  59. package/dist/components/auth/settings/security/security-settings.js +22 -0
  60. package/dist/components/auth/settings/settings.js +45 -0
  61. package/dist/components/auth/sign-in.js +66 -85
  62. package/dist/components/auth/sign-out.js +11 -11
  63. package/dist/components/auth/sign-up.js +128 -148
  64. package/dist/components/{settings/account → auth/theme}/appearance.d.ts +3 -6
  65. package/dist/components/auth/theme/appearance.js +72 -0
  66. package/dist/components/auth/theme/theme-toggle-item.d.ts +5 -0
  67. package/dist/components/auth/theme/theme-toggle-item.js +58 -0
  68. package/dist/components/auth/user/user-avatar.js +29 -0
  69. package/dist/components/{user → auth/user}/user-button.d.ts +2 -6
  70. package/dist/components/auth/user/user-button.js +55 -0
  71. package/dist/components/auth/user/user-view.js +37 -0
  72. package/dist/components/auth/username/sign-in-username.d.ts +14 -0
  73. package/dist/components/auth/username/sign-in-username.js +148 -0
  74. package/dist/components/auth/username/username-field.d.ts +8 -0
  75. package/dist/components/auth/username/username-field.js +53 -0
  76. package/dist/email.d.ts +7 -0
  77. package/dist/email.js +9 -0
  78. package/dist/index.d.ts +12 -27
  79. package/dist/index.js +20 -35
  80. package/dist/lib/auth/auth-plugin.d.ts +44 -0
  81. package/dist/lib/auth/delete-user-plugin.d.ts +17 -0
  82. package/dist/lib/auth/delete-user-plugin.js +10 -0
  83. package/dist/lib/auth/magic-link-plugin.d.ts +31 -0
  84. package/dist/lib/auth/magic-link-plugin.js +13 -0
  85. package/dist/lib/auth/multi-session-plugin.d.ts +18 -0
  86. package/dist/lib/auth/multi-session-plugin.js +12 -0
  87. package/dist/lib/auth/passkey-plugin.d.ts +20 -0
  88. package/dist/lib/auth/passkey-plugin.js +12 -0
  89. package/dist/lib/auth/theme-plugin.d.ts +68 -0
  90. package/dist/lib/auth/theme-plugin.js +23 -0
  91. package/dist/lib/auth/username-plugin.d.ts +63 -0
  92. package/dist/lib/auth/username-plugin.js +18 -0
  93. package/dist/plugins.d.ts +20 -0
  94. package/dist/plugins.js +21 -0
  95. package/package.json +19 -21
  96. package/src/components/auth/additional-field.tsx +554 -0
  97. package/src/components/auth/auth-provider.tsx +5 -6
  98. package/src/components/auth/auth.tsx +99 -35
  99. package/src/components/{settings/security → auth/delete-user}/danger-zone.tsx +1 -1
  100. package/src/components/{settings/security → auth/delete-user}/delete-user.tsx +30 -20
  101. package/src/components/{email → auth/email}/email-changed-email.tsx +2 -2
  102. package/src/components/{email → auth/email}/email-verification-email.tsx +2 -2
  103. package/src/components/{email → auth/email}/magic-link-email.tsx +2 -2
  104. package/src/components/{email → auth/email}/new-device-email.tsx +2 -2
  105. package/src/components/{email → auth/email}/otp-email.tsx +2 -2
  106. package/src/components/{email → auth/email}/password-changed-email.tsx +2 -2
  107. package/src/components/{email → auth/email}/reset-password-email.tsx +2 -2
  108. package/src/components/auth/forgot-password.tsx +42 -17
  109. package/src/components/auth/magic-link/magic-link-button.tsx +61 -0
  110. package/src/components/auth/{magic-link.tsx → magic-link/magic-link.tsx} +55 -40
  111. package/src/components/{settings/account → auth/multi-session}/manage-account.tsx +16 -13
  112. package/src/components/{settings/account → auth/multi-session}/manage-accounts.tsx +14 -5
  113. package/src/components/{user/switch-account-menu.tsx → auth/multi-session/switch-account-submenu-content.tsx} +18 -11
  114. package/src/components/{user/switch-account-item.tsx → auth/multi-session/switch-account-submenu-item.tsx} +17 -5
  115. package/src/components/auth/multi-session/switch-account-submenu.tsx +50 -0
  116. package/src/components/auth/passkey/passkey-button.tsx +56 -0
  117. package/src/components/{settings/security → auth/passkey}/passkey.tsx +20 -6
  118. package/src/components/auth/passkey/passkeys.tsx +196 -0
  119. package/src/components/auth/provider-button.tsx +27 -29
  120. package/src/components/auth/provider-buttons.tsx +6 -11
  121. package/src/components/auth/reset-password.tsx +13 -7
  122. package/src/components/{settings → auth/settings}/account/account-settings.tsx +15 -13
  123. package/src/components/{settings → auth/settings}/account/change-avatar.tsx +4 -3
  124. package/src/components/{settings → auth/settings}/account/change-email.tsx +3 -3
  125. package/src/components/auth/settings/account/user-profile.tsx +171 -0
  126. package/src/components/{settings → auth/settings}/security/active-session.tsx +8 -5
  127. package/src/components/{settings → auth/settings}/security/active-sessions.tsx +3 -3
  128. package/src/components/{settings → auth/settings}/security/change-password.tsx +14 -9
  129. package/src/components/{settings → auth/settings}/security/linked-account.tsx +12 -8
  130. package/src/components/{settings → auth/settings}/security/linked-accounts.tsx +2 -2
  131. package/src/components/{settings → auth/settings}/security/security-settings.tsx +7 -6
  132. package/src/components/{settings → auth/settings}/settings.tsx +2 -2
  133. package/src/components/auth/sign-in.tsx +50 -61
  134. package/src/components/auth/sign-out.tsx +2 -2
  135. package/src/components/auth/sign-up.tsx +119 -131
  136. package/src/components/{settings/account → auth/theme}/appearance.tsx +17 -24
  137. package/src/components/auth/theme/theme-toggle-item.tsx +110 -0
  138. package/src/components/{user → auth/user}/user-avatar.tsx +12 -4
  139. package/src/components/{user → auth/user}/user-button.tsx +15 -88
  140. package/src/components/{user → auth/user}/user-view.tsx +12 -4
  141. package/src/components/auth/username/sign-in-username.tsx +299 -0
  142. package/src/components/auth/username/username-field.tsx +124 -0
  143. package/src/email.ts +9 -0
  144. package/src/index.tsx +12 -27
  145. package/src/lib/auth/auth-plugin.ts +67 -0
  146. package/src/lib/auth/delete-user-plugin.ts +15 -0
  147. package/src/lib/auth/magic-link-plugin.ts +26 -0
  148. package/src/lib/auth/multi-session-plugin.ts +17 -0
  149. package/src/lib/auth/passkey-plugin.ts +17 -0
  150. package/src/lib/auth/theme-plugin.ts +86 -0
  151. package/src/lib/auth/username-plugin.tsx +30 -0
  152. package/src/plugins.ts +23 -0
  153. package/dist/components/auth/magic-link-button.d.ts +0 -13
  154. package/dist/components/auth/magic-link-button.js +0 -16
  155. package/dist/components/auth/magic-link.d.ts +0 -17
  156. package/dist/components/auth/magic-link.js +0 -99
  157. package/dist/components/auth/passkey-button.d.ts +0 -4
  158. package/dist/components/auth/passkey-button.js +0 -21
  159. package/dist/components/email/magic-link-email.d.ts +0 -3
  160. package/dist/components/email/new-device-email.d.ts +0 -3
  161. package/dist/components/email/otp-email.d.ts +0 -3
  162. package/dist/components/settings/account/account-settings.js +0 -23
  163. package/dist/components/settings/account/appearance.js +0 -71
  164. package/dist/components/settings/account/change-avatar.js +0 -89
  165. package/dist/components/settings/account/manage-account.js +0 -48
  166. package/dist/components/settings/account/manage-accounts.js +0 -33
  167. package/dist/components/settings/account/user-profile.js +0 -103
  168. package/dist/components/settings/security/active-session.js +0 -59
  169. package/dist/components/settings/security/change-password.js +0 -189
  170. package/dist/components/settings/security/delete-user.js +0 -92
  171. package/dist/components/settings/security/linked-account.js +0 -56
  172. package/dist/components/settings/security/passkey.js +0 -43
  173. package/dist/components/settings/security/passkeys.js +0 -53
  174. package/dist/components/settings/security/security-settings.js +0 -25
  175. package/dist/components/settings/settings.js +0 -45
  176. package/dist/components/user/switch-account-item.js +0 -20
  177. package/dist/components/user/switch-account-menu.js +0 -28
  178. package/dist/components/user/user-avatar.js +0 -29
  179. package/dist/components/user/user-button.js +0 -91
  180. package/dist/components/user/user-view.js +0 -37
  181. package/dist/core.d.ts +0 -1
  182. package/dist/core.js +0 -1
  183. package/dist/react-exports.d.ts +0 -1
  184. package/dist/react-exports.js +0 -1
  185. package/src/components/auth/magic-link-button.tsx +0 -43
  186. package/src/components/auth/passkey-button.tsx +0 -35
  187. package/src/components/settings/account/user-profile.tsx +0 -217
  188. package/src/components/settings/security/passkeys.tsx +0 -96
  189. package/src/core.ts +0 -1
  190. package/src/react-exports.ts +0 -1
  191. /package/dist/components/{settings/security → auth/delete-user}/delete-user.d.ts +0 -0
  192. /package/dist/components/{settings/account → auth/multi-session}/manage-accounts.d.ts +0 -0
  193. /package/dist/components/{settings/security → auth/passkey}/passkey.d.ts +0 -0
  194. /package/dist/components/{settings/security → auth/passkey}/passkeys.d.ts +0 -0
  195. /package/dist/components/{settings → auth/settings}/account/change-avatar.d.ts +0 -0
  196. /package/dist/components/{settings → auth/settings}/account/change-email.d.ts +0 -0
  197. /package/dist/components/{settings → auth/settings}/security/active-session.d.ts +0 -0
  198. /package/dist/components/{settings → auth/settings}/security/active-sessions.d.ts +0 -0
  199. /package/dist/components/{settings → auth/settings}/security/change-password.d.ts +0 -0
  200. /package/dist/components/{settings → auth/settings}/security/linked-account.d.ts +0 -0
  201. /package/dist/components/{settings → auth/settings}/security/linked-accounts.d.ts +0 -0
  202. /package/dist/components/{settings → auth/settings}/settings.d.ts +0 -0
  203. /package/dist/components/{user → auth/user}/user-avatar.d.ts +0 -0
  204. /package/dist/components/{user → auth/user}/user-view.d.ts +0 -0
@@ -0,0 +1,45 @@
1
+ import { AccountSettings as e } from "./account/account-settings.js";
2
+ import { SecuritySettings as t } from "./security/security-settings.js";
3
+ import { useAuth as n, useAuthenticate as r } from "@better-auth-ui/react";
4
+ import { Tabs as i, cn as a } from "@heroui/react";
5
+ import { useMemo as o } from "react";
6
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
+ //#region src/components/auth/settings/settings.tsx
8
+ function l({ className: l, hideNav: u, path: d, variant: f, view: p, ...m }) {
9
+ let { authClient: h, basePaths: g, localization: _, viewPaths: v } = n();
10
+ if (r(h), !p && !d) throw Error("[Better Auth UI] Either `view` or `path` must be provided");
11
+ let y = o(() => Object.fromEntries(Object.entries(v.settings).map(([e, t]) => [t, e])), [v.settings]), b = p || (d ? y[d] : void 0);
12
+ return /* @__PURE__ */ c(i, {
13
+ className: a(l),
14
+ orientation: "horizontal",
15
+ selectedKey: b,
16
+ ...m,
17
+ children: [
18
+ /* @__PURE__ */ s(i.ListContainer, { children: /* @__PURE__ */ c(i.List, {
19
+ "aria-label": _.settings.settings,
20
+ className: "overflow-auto w-fit",
21
+ children: [/* @__PURE__ */ c(i.Tab, {
22
+ id: "account",
23
+ href: `${g.settings}/${v.settings.account}`,
24
+ children: [_.settings.account, /* @__PURE__ */ s(i.Indicator, {})]
25
+ }), /* @__PURE__ */ c(i.Tab, {
26
+ id: "security",
27
+ href: `${g.settings}/${v.settings.security}`,
28
+ children: [_.settings.security, /* @__PURE__ */ s(i.Indicator, {})]
29
+ })]
30
+ }) }),
31
+ /* @__PURE__ */ s(i.Panel, {
32
+ id: "account",
33
+ className: "px-0",
34
+ children: /* @__PURE__ */ s(e, { variant: f })
35
+ }),
36
+ /* @__PURE__ */ s(i.Panel, {
37
+ id: "security",
38
+ className: "px-0",
39
+ children: /* @__PURE__ */ s(t, { variant: f })
40
+ })
41
+ ]
42
+ });
43
+ }
44
+ //#endregion
45
+ export { l as Settings };
@@ -1,144 +1,125 @@
1
1
  import { FieldSeparator as e } from "./field-separator.js";
2
- import { MagicLinkButton as t } from "./magic-link-button.js";
3
- import { PasskeyButton as n } from "./passkey-button.js";
4
- import { ProviderButtons as r } from "./provider-buttons.js";
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";
2
+ import { ProviderButtons as t } from "./provider-buttons.js";
3
+ import { authMutationKeys as n } from "@better-auth-ui/core";
4
+ import { useAuth as r, useFetchOptions as i, useSendVerificationEmail as a, useSignInEmail as o } from "@better-auth-ui/react";
5
+ import { Button as s, Card as c, Checkbox as l, Description as u, 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";
6
+ import { useState as b } from "react";
7
7
  import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
8
- import { useState as w } from "react";
8
+ import { useIsMutating as w } from "@tanstack/react-query";
9
9
  //#region src/components/auth/sign-in.tsx
10
- function T(e) {
11
- return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
12
- }
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({
10
+ function T({ className: T, socialLayout: E, socialPosition: D = "bottom", variant: O, ...k }) {
11
+ let { authClient: A, basePaths: j, baseURL: M, emailAndPassword: N, localization: P, plugins: F, redirectTo: I, socialProviders: L, viewPaths: R, navigate: z } = r(), { fetchOptions: B, resetFetchOptions: V } = i(), [H, U] = b(""), { mutate: W } = a(A, { onSuccess: () => y.success(P.auth.verificationEmailSent) }), { mutate: G, isPending: K } = o(A, {
15
12
  onError: (e, { email: t }) => {
16
- U(""), e.error?.code === "EMAIL_NOT_VERIFIED" ? b.danger(e.error?.message || e.message, { actionProps: {
13
+ U(""), e.error?.code === "EMAIL_NOT_VERIFIED" ? y.danger(e.error?.message || e.message, { actionProps: {
17
14
  children: P.auth.resend,
18
15
  onClick: () => W({
19
16
  email: t,
20
- callbackURL: `${M}${L}`
17
+ callbackURL: `${M}${I}`
21
18
  })
22
- } }) : b.danger(e.error?.message || e.message);
23
- },
24
- onSuccess: () => V({ to: L })
25
- }), { mutate: q, isPending: J } = s({
26
- onError: (e) => {
27
- U(""), b.danger(e.error?.message || e.message);
19
+ } }) : y.danger(e.error?.message || e.message), V();
28
20
  },
29
- onSuccess: () => V({ to: L })
30
- }), Y = (e) => {
21
+ onSuccess: () => z({ to: I })
22
+ }), q = (e) => {
31
23
  e.preventDefault();
32
24
  let t = new FormData(e.currentTarget), n = t.get("email"), r = t.get("rememberMe") === "on";
33
- z?.enabled && !T(n) ? q({
34
- username: n,
35
- password: H
36
- }) : G({
25
+ G({
37
26
  email: n,
38
27
  password: H,
39
- ...N?.rememberMe ? { rememberMe: r } : {}
28
+ ...N?.rememberMe ? { rememberMe: r } : {},
29
+ fetchOptions: B
40
30
  });
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,
31
+ }, J = w({ mutationKey: n.signIn.all }) + w({ mutationKey: n.signUp.all }) > 0, Y = F.find((e) => e.captchaComponent)?.captchaComponent, X = N?.enabled && !!L?.length;
32
+ return /* @__PURE__ */ C(c, {
33
+ className: v("w-full max-w-sm gap-4 md:p-6", T),
34
+ variant: O,
35
+ ...k,
46
36
  children: [
47
- /* @__PURE__ */ S(l.Header, { children: /* @__PURE__ */ S(l.Title, {
37
+ /* @__PURE__ */ S(c.Header, { children: /* @__PURE__ */ S(c.Title, {
48
38
  className: "text-xl font-semibold mb-1",
49
39
  children: P.auth.signIn
50
40
  }) }),
51
- /* @__PURE__ */ C(l.Content, {
41
+ /* @__PURE__ */ C(c.Content, {
52
42
  className: "gap-4",
53
43
  children: [
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,
44
+ D === "top" && /* @__PURE__ */ C(x, { children: [!!L?.length && /* @__PURE__ */ S(t, { socialLayout: E }), X && /* @__PURE__ */ S(e, { children: P.auth.or })] }),
45
+ N?.enabled && /* @__PURE__ */ C(f, {
46
+ onSubmit: q,
60
47
  className: "flex flex-col gap-4",
61
48
  children: [
62
- /* @__PURE__ */ C(v, {
49
+ /* @__PURE__ */ C(_, {
63
50
  name: "email",
64
- type: z?.enabled ? "text" : "email",
65
- autoComplete: z?.enabled ? "username" : "email",
66
- isDisabled: X,
51
+ type: "email",
52
+ autoComplete: "email",
53
+ isDisabled: J,
67
54
  children: [
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",
55
+ /* @__PURE__ */ S(m, { children: P.auth.email }),
56
+ /* @__PURE__ */ S(p, {
57
+ placeholder: P.auth.emailPlaceholder,
58
+ variant: O === "transparent" ? "primary" : "secondary",
72
59
  required: !0
73
60
  }),
74
- /* @__PURE__ */ S(f, {})
61
+ /* @__PURE__ */ S(d, {})
75
62
  ]
76
63
  }),
77
- /* @__PURE__ */ C(v, {
64
+ /* @__PURE__ */ C(_, {
78
65
  minLength: N?.minPasswordLength,
79
66
  maxLength: N?.maxPasswordLength,
80
67
  name: "password",
81
68
  type: "password",
82
69
  autoComplete: "current-password",
83
- isDisabled: X,
70
+ isDisabled: J,
84
71
  value: H,
85
72
  onChange: U,
86
73
  children: [
87
- /* @__PURE__ */ S(h, { children: P.auth.password }),
88
- /* @__PURE__ */ S(m, {
74
+ /* @__PURE__ */ S(m, { children: P.auth.password }),
75
+ /* @__PURE__ */ S(p, {
89
76
  placeholder: P.auth.passwordPlaceholder,
90
- variant: k === "transparent" ? "primary" : "secondary",
77
+ variant: O === "transparent" ? "primary" : "secondary",
91
78
  required: !0
92
79
  }),
93
- /* @__PURE__ */ S(f, {})
80
+ /* @__PURE__ */ S(d, {})
94
81
  ]
95
82
  }),
96
- N?.rememberMe && /* @__PURE__ */ C(u, {
83
+ N?.rememberMe && /* @__PURE__ */ C(l, {
97
84
  name: "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 }) })]
85
+ isDisabled: J,
86
+ variant: O === "transparent" ? "primary" : "secondary",
87
+ children: [/* @__PURE__ */ S(l.Control, { children: /* @__PURE__ */ S(l.Indicator, {}) }), /* @__PURE__ */ S(l.Content, { children: /* @__PURE__ */ S(m, { children: P.auth.rememberMe }) })]
88
+ }),
89
+ Y && /* @__PURE__ */ S("div", {
90
+ className: "flex justify-center",
91
+ children: Y
101
92
  }),
102
93
  /* @__PURE__ */ C("div", {
103
94
  className: "flex flex-col gap-3",
104
- children: [
105
- /* @__PURE__ */ C(c, {
106
- type: "submit",
107
- className: "w-full",
108
- isPending: X,
109
- children: [X && /* @__PURE__ */ S(_, {
110
- color: "current",
111
- size: "sm"
112
- }), P.auth.signIn]
113
- }),
114
- F && /* @__PURE__ */ S(t, {
115
- view: "signIn",
116
- isPending: X
117
- }),
118
- I && /* @__PURE__ */ S(n, { isPending: X })
119
- ]
95
+ children: [/* @__PURE__ */ C(s, {
96
+ type: "submit",
97
+ className: "w-full",
98
+ isPending: J,
99
+ children: [K && /* @__PURE__ */ S(g, {
100
+ color: "current",
101
+ size: "sm"
102
+ }), P.auth.signIn]
103
+ }), F.flatMap((e) => e.authButtons?.map((t, n) => /* @__PURE__ */ S(t, { view: "signIn" }, `${e.id}-${n.toString()}`)))]
120
104
  })
121
105
  ]
122
106
  }),
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
126
- })] })
107
+ D === "bottom" && /* @__PURE__ */ C(x, { children: [X && /* @__PURE__ */ S(e, { children: P.auth.or }), !!L?.length && /* @__PURE__ */ S(t, { socialLayout: E })] })
127
108
  ]
128
109
  }),
129
- /* @__PURE__ */ C(l.Footer, {
110
+ /* @__PURE__ */ C(c.Footer, {
130
111
  className: "flex-col gap-3",
131
- children: [N?.forgotPassword && /* @__PURE__ */ S(g, {
132
- href: `${j.auth}/${B.auth.forgotPassword}`,
112
+ children: [N?.forgotPassword && /* @__PURE__ */ S(h, {
113
+ href: `${j.auth}/${R.auth.forgotPassword}`,
133
114
  className: "no-underline hover:underline",
134
115
  children: P.auth.forgotPasswordLink
135
- }), N?.enabled && /* @__PURE__ */ C(d, {
116
+ }), N?.enabled && /* @__PURE__ */ C(u, {
136
117
  className: "text-sm",
137
118
  children: [
138
119
  P.auth.needToCreateAnAccount,
139
120
  " ",
140
- /* @__PURE__ */ S(g, {
141
- href: `${j.auth}/${B.auth.signUp}`,
121
+ /* @__PURE__ */ S(h, {
122
+ href: `${j.auth}/${R.auth.signUp}`,
142
123
  className: "text-accent no-underline hover:underline decoration-accent-hover",
143
124
  children: P.auth.signUp
144
125
  })
@@ -149,4 +130,4 @@ function E({ className: E, socialLayout: D, socialPosition: O = "bottom", varian
149
130
  });
150
131
  }
151
132
  //#endregion
152
- export { E as SignIn };
133
+ export { T as SignIn };
@@ -1,24 +1,24 @@
1
1
  import { useAuth as e, useSignOut as t } from "@better-auth-ui/react";
2
2
  import { Spinner as n, cn as r, toast as i } from "@heroui/react";
3
- import { jsx as a } from "react/jsx-runtime";
4
- import { useEffect as o, useRef as s } from "react";
3
+ import { useEffect as a, useRef as o } from "react";
4
+ import { jsx as s } from "react/jsx-runtime";
5
5
  //#region src/components/auth/sign-out.tsx
6
6
  function c({ className: c }) {
7
- let { basePaths: l, navigate: u, viewPaths: d } = e(), { mutate: f } = t({
7
+ let { authClient: l, basePaths: u, navigate: d, viewPaths: f } = e(), { mutate: p } = t(l, {
8
8
  onError: (e) => {
9
- i.danger(e.error?.message || e.message), u({
10
- to: `${l.auth}/${d.auth.signIn}`,
9
+ i.danger(e.error?.message || e.message), d({
10
+ to: `${u.auth}/${f.auth.signIn}`,
11
11
  replace: !0
12
12
  });
13
13
  },
14
- onSuccess: () => u({
15
- to: `${l.auth}/${d.auth.signIn}`,
14
+ onSuccess: () => d({
15
+ to: `${u.auth}/${f.auth.signIn}`,
16
16
  replace: !0
17
17
  })
18
- }), p = s(!1);
19
- return o(() => {
20
- p.current || (p.current = !0, f());
21
- }, [f]), /* @__PURE__ */ a(n, {
18
+ }), m = o(!1);
19
+ return a(() => {
20
+ m.current || (m.current = !0, p());
21
+ }, [p]), /* @__PURE__ */ s(n, {
22
22
  className: r("mx-auto my-auto", c),
23
23
  color: "current"
24
24
  });