@better-auth-ui/heroui 1.6.7 → 1.6.9

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 (280) hide show
  1. package/dist/components/auth/additional-field.d.ts +2 -2
  2. package/dist/components/auth/additional-field.js +133 -266
  3. package/dist/components/auth/api-key/api-key-skeleton.js +4 -20
  4. package/dist/components/auth/api-key/api-key.d.ts +6 -2
  5. package/dist/components/auth/api-key/api-key.js +16 -54
  6. package/dist/components/auth/api-key/api-keys-empty.d.ts +3 -1
  7. package/dist/components/auth/api-key/api-keys-empty.js +8 -34
  8. package/dist/components/auth/api-key/api-keys.d.ts +10 -2
  9. package/dist/components/auth/api-key/api-keys.js +21 -40
  10. package/dist/components/auth/api-key/create-api-key-dialog.d.ts +3 -1
  11. package/dist/components/auth/api-key/create-api-key-dialog.js +43 -73
  12. package/dist/components/auth/api-key/delete-api-key-dialog.d.ts +4 -2
  13. package/dist/components/auth/api-key/delete-api-key-dialog.js +16 -50
  14. package/dist/components/auth/api-key/new-api-key-dialog.js +23 -59
  15. package/dist/components/auth/api-key/organization-api-keys.d.ts +14 -0
  16. package/dist/components/auth/api-key/organization-api-keys.js +22 -0
  17. package/dist/components/auth/auth-provider.d.ts +1 -1
  18. package/dist/components/auth/auth-provider.js +10 -16
  19. package/dist/components/auth/auth.d.ts +3 -3
  20. package/dist/components/auth/auth.js +86 -61
  21. package/dist/components/auth/delete-user/danger-zone.d.ts +3 -3
  22. package/dist/components/auth/delete-user/danger-zone.js +11 -17
  23. package/dist/components/auth/delete-user/delete-account.d.ts +9 -0
  24. package/dist/components/auth/delete-user/delete-account.js +50 -0
  25. package/dist/components/auth/email/email-changed-email.d.ts +2 -2
  26. package/dist/components/auth/email/email-changed-email.js +22 -29
  27. package/dist/components/auth/email/email-verification-email.d.ts +2 -2
  28. package/dist/components/auth/email/email-verification-email.js +22 -29
  29. package/dist/components/auth/email/magic-link-email.d.ts +2 -2
  30. package/dist/components/auth/email/magic-link-email.js +22 -29
  31. package/dist/components/auth/email/new-device-email.d.ts +2 -2
  32. package/dist/components/auth/email/new-device-email.js +22 -29
  33. package/dist/components/auth/email/organization-invitation-email.d.ts +3 -0
  34. package/dist/components/auth/email/organization-invitation-email.js +23 -0
  35. package/dist/components/auth/email/otp-email.d.ts +2 -2
  36. package/dist/components/auth/email/otp-email.js +21 -28
  37. package/dist/components/auth/email/password-changed-email.d.ts +2 -2
  38. package/dist/components/auth/email/password-changed-email.js +22 -29
  39. package/dist/components/auth/email/reset-password-email.d.ts +2 -2
  40. package/dist/components/auth/email/reset-password-email.js +22 -29
  41. package/dist/components/auth/error-toaster.js +32 -16
  42. package/dist/components/auth/field-separator.d.ts +1 -1
  43. package/dist/components/auth/field-separator.js +4 -17
  44. package/dist/components/auth/forgot-password.d.ts +1 -1
  45. package/dist/components/auth/forgot-password.js +36 -88
  46. package/dist/components/auth/magic-link/magic-link-button.d.ts +1 -1
  47. package/dist/components/auth/magic-link/magic-link-button.js +33 -19
  48. package/dist/components/auth/magic-link/magic-link.d.ts +2 -2
  49. package/dist/components/auth/magic-link/magic-link.js +39 -86
  50. package/dist/components/auth/multi-session/manage-account.d.ts +1 -1
  51. package/dist/components/auth/multi-session/manage-account.js +32 -48
  52. package/dist/components/auth/multi-session/manage-accounts.d.ts +1 -1
  53. package/dist/components/auth/multi-session/manage-accounts.js +32 -33
  54. package/dist/components/auth/multi-session/switch-account-submenu-content.d.ts +3 -1
  55. package/dist/components/auth/multi-session/switch-account-submenu-content.js +24 -27
  56. package/dist/components/auth/multi-session/switch-account-submenu-item.d.ts +3 -2
  57. package/dist/components/auth/multi-session/switch-account-submenu-item.js +16 -19
  58. package/dist/components/auth/multi-session/switch-account-submenu.d.ts +2 -1
  59. package/dist/components/auth/multi-session/switch-account-submenu.js +23 -23
  60. package/dist/components/auth/organization/change-organization-logo.d.ts +4 -0
  61. package/dist/components/auth/organization/change-organization-logo.js +69 -0
  62. package/dist/components/auth/organization/create-organization-dialog.d.ts +13 -0
  63. package/dist/components/auth/organization/create-organization-dialog.js +37 -0
  64. package/dist/components/auth/organization/delete-organization-dialog.d.ts +7 -0
  65. package/dist/components/auth/organization/delete-organization-dialog.js +25 -0
  66. package/dist/components/auth/organization/delete-organization-skeleton.d.ts +4 -0
  67. package/dist/components/auth/organization/delete-organization-skeleton.js +8 -0
  68. package/dist/components/auth/organization/delete-organization.d.ts +5 -0
  69. package/dist/components/auth/organization/delete-organization.js +27 -0
  70. package/dist/components/auth/organization/invite-member-dialog.d.ts +13 -0
  71. package/dist/components/auth/organization/invite-member-dialog.js +47 -0
  72. package/dist/components/auth/organization/leave-organization-dialog.d.ts +7 -0
  73. package/dist/components/auth/organization/leave-organization-dialog.js +21 -0
  74. package/dist/components/auth/organization/leave-organization.d.ts +4 -0
  75. package/dist/components/auth/organization/leave-organization.js +16 -0
  76. package/dist/components/auth/organization/organization-danger-zone.d.ts +16 -0
  77. package/dist/components/auth/organization/organization-danger-zone.js +23 -0
  78. package/dist/components/auth/organization/organization-invitation-row-skeleton.d.ts +5 -0
  79. package/dist/components/auth/organization/organization-invitation-row-skeleton.js +9 -0
  80. package/dist/components/auth/organization/organization-invitation-row.d.ts +5 -0
  81. package/dist/components/auth/organization/organization-invitation-row.js +31 -0
  82. package/dist/components/auth/organization/organization-invitations-empty.d.ts +8 -0
  83. package/dist/components/auth/organization/organization-invitations-empty.js +13 -0
  84. package/dist/components/auth/organization/organization-invitations.d.ts +9 -0
  85. package/dist/components/auth/organization/organization-invitations.js +66 -0
  86. package/dist/components/auth/organization/organization-logo.d.ts +15 -0
  87. package/dist/components/auth/organization/organization-logo.js +14 -0
  88. package/dist/components/auth/organization/organization-member-row-skeleton.d.ts +4 -0
  89. package/dist/components/auth/organization/organization-member-row-skeleton.js +9 -0
  90. package/dist/components/auth/organization/organization-member-row.d.ts +9 -0
  91. package/dist/components/auth/organization/organization-member-row.js +34 -0
  92. package/dist/components/auth/organization/organization-members.d.ts +9 -0
  93. package/dist/components/auth/organization/organization-members.js +67 -0
  94. package/dist/components/auth/organization/organization-people.d.ts +10 -0
  95. package/dist/components/auth/organization/organization-people.js +11 -0
  96. package/dist/components/auth/organization/organization-profile.d.ts +9 -0
  97. package/dist/components/auth/organization/organization-profile.js +34 -0
  98. package/dist/components/auth/organization/organization-row.d.ts +8 -0
  99. package/dist/components/auth/organization/organization-row.js +31 -0
  100. package/dist/components/auth/organization/organization-settings.d.ts +12 -0
  101. package/dist/components/auth/organization/organization-settings.js +13 -0
  102. package/dist/components/auth/organization/organization-switcher.d.ts +20 -0
  103. package/dist/components/auth/organization/organization-switcher.js +48 -0
  104. package/dist/components/auth/organization/organization-view-skeleton.d.ts +6 -0
  105. package/dist/components/auth/organization/organization-view-skeleton.js +9 -0
  106. package/dist/components/auth/organization/organization-view.d.ts +15 -0
  107. package/dist/components/auth/organization/organization-view.js +31 -0
  108. package/dist/components/auth/organization/organization.d.ts +17 -0
  109. package/dist/components/auth/organization/organization.js +60 -0
  110. package/dist/components/auth/organization/organizations-empty.d.ts +4 -0
  111. package/dist/components/auth/organization/organizations-empty.js +9 -0
  112. package/dist/components/auth/organization/organizations-settings.d.ts +17 -0
  113. package/dist/components/auth/organization/organizations-settings.js +17 -0
  114. package/dist/components/auth/organization/organizations.d.ts +10 -0
  115. package/dist/components/auth/organization/organizations.js +21 -0
  116. package/dist/components/auth/organization/remove-member-dialog.d.ts +9 -0
  117. package/dist/components/auth/organization/remove-member-dialog.js +20 -0
  118. package/dist/components/auth/organization/slug-field.d.ts +19 -0
  119. package/dist/components/auth/organization/slug-field.js +38 -0
  120. package/dist/components/auth/organization/user-invitation-row-skeleton.d.ts +4 -0
  121. package/dist/components/auth/organization/user-invitation-row-skeleton.js +8 -0
  122. package/dist/components/auth/organization/user-invitation-row.d.ts +10 -0
  123. package/dist/components/auth/organization/user-invitation-row.js +22 -0
  124. package/dist/components/auth/organization/user-invitations-empty.d.ts +4 -0
  125. package/dist/components/auth/organization/user-invitations-empty.js +12 -0
  126. package/dist/components/auth/organization/user-invitations.d.ts +10 -0
  127. package/dist/components/auth/organization/user-invitations.js +18 -0
  128. package/dist/components/auth/passkey/add-passkey-dialog.d.ts +5 -0
  129. package/dist/components/auth/passkey/add-passkey-dialog.js +22 -0
  130. package/dist/components/auth/passkey/delete-passkey-dialog.d.ts +11 -0
  131. package/dist/components/auth/passkey/delete-passkey-dialog.js +14 -0
  132. package/dist/components/auth/passkey/passkey-button.d.ts +1 -1
  133. package/dist/components/auth/passkey/passkey-button.js +24 -23
  134. package/dist/components/auth/passkey/passkey-skeleton.d.ts +1 -0
  135. package/dist/components/auth/passkey/passkey-skeleton.js +5 -0
  136. package/dist/components/auth/passkey/passkey.d.ts +2 -5
  137. package/dist/components/auth/passkey/passkey.js +16 -44
  138. package/dist/components/auth/passkey/passkeys-empty.d.ts +4 -0
  139. package/dist/components/auth/passkey/passkeys-empty.js +9 -0
  140. package/dist/components/auth/passkey/passkeys.d.ts +1 -1
  141. package/dist/components/auth/passkey/passkeys.js +15 -105
  142. package/dist/components/auth/provider-button.d.ts +2 -2
  143. package/dist/components/auth/provider-button.js +28 -24
  144. package/dist/components/auth/provider-buttons.js +28 -18
  145. package/dist/components/auth/reset-password.d.ts +1 -1
  146. package/dist/components/auth/reset-password.js +56 -146
  147. package/dist/components/auth/settings/account/account-settings.d.ts +2 -2
  148. package/dist/components/auth/settings/account/account-settings.js +21 -19
  149. package/dist/components/auth/settings/account/change-avatar.js +53 -88
  150. package/dist/components/auth/settings/account/change-email.d.ts +1 -1
  151. package/dist/components/auth/settings/account/change-email.js +27 -53
  152. package/dist/components/auth/settings/account/user-profile.d.ts +1 -1
  153. package/dist/components/auth/settings/account/user-profile.js +64 -85
  154. package/dist/components/auth/settings/security/active-session.d.ts +1 -1
  155. package/dist/components/auth/settings/security/active-session.js +50 -57
  156. package/dist/components/auth/settings/security/active-sessions.d.ts +1 -1
  157. package/dist/components/auth/settings/security/active-sessions.js +21 -32
  158. package/dist/components/auth/settings/security/change-password.d.ts +1 -1
  159. package/dist/components/auth/settings/security/change-password.js +76 -186
  160. package/dist/components/auth/settings/security/linked-account.d.ts +1 -1
  161. package/dist/components/auth/settings/security/linked-account.js +37 -55
  162. package/dist/components/auth/settings/security/linked-accounts.d.ts +1 -1
  163. package/dist/components/auth/settings/security/linked-accounts.js +34 -43
  164. package/dist/components/auth/settings/security/security-settings.d.ts +2 -2
  165. package/dist/components/auth/settings/security/security-settings.js +19 -21
  166. package/dist/components/auth/settings/settings.d.ts +4 -4
  167. package/dist/components/auth/settings/settings.js +52 -44
  168. package/dist/components/auth/sign-in.d.ts +2 -2
  169. package/dist/components/auth/sign-in.js +63 -132
  170. package/dist/components/auth/sign-out.js +32 -26
  171. package/dist/components/auth/sign-up.d.ts +2 -2
  172. package/dist/components/auth/sign-up.js +97 -211
  173. package/dist/components/auth/theme/appearance.d.ts +1 -1
  174. package/dist/components/auth/theme/appearance.js +23 -71
  175. package/dist/components/auth/theme/theme-toggle-item.js +56 -61
  176. package/dist/components/auth/user/user-avatar.d.ts +4 -4
  177. package/dist/components/auth/user/user-avatar.js +31 -28
  178. package/dist/components/auth/user/user-button.d.ts +6 -7
  179. package/dist/components/auth/user/user-button.js +38 -72
  180. package/dist/components/auth/user/user-view.d.ts +13 -7
  181. package/dist/components/auth/user/user-view.js +26 -36
  182. package/dist/components/auth/username/sign-in-username.d.ts +2 -2
  183. package/dist/components/auth/username/sign-in-username.js +87 -147
  184. package/dist/components/auth/username/username-field.d.ts +1 -1
  185. package/dist/components/auth/username/username-field.js +44 -52
  186. package/dist/email.d.ts +8 -7
  187. package/dist/email.js +8 -8
  188. package/dist/index.d.ts +21 -21
  189. package/dist/index.js +21 -22
  190. package/dist/lib/auth/api-key-plugin.d.ts +7 -4
  191. package/dist/lib/auth/api-key-plugin.js +12 -10
  192. package/dist/lib/auth/auth-plugin.d.ts +10 -6
  193. package/dist/lib/auth/auth-plugin.js +1 -0
  194. package/dist/lib/auth/delete-user-plugin.d.ts +6 -6
  195. package/dist/lib/auth/delete-user-plugin.js +6 -9
  196. package/dist/lib/auth/magic-link-plugin.d.ts +5 -5
  197. package/dist/lib/auth/magic-link-plugin.js +17 -12
  198. package/dist/lib/auth/multi-session-plugin.d.ts +5 -5
  199. package/dist/lib/auth/multi-session-plugin.js +8 -11
  200. package/dist/lib/auth/organization-plugin.d.ts +37 -0
  201. package/dist/lib/auth/organization-plugin.js +19 -0
  202. package/dist/lib/auth/passkey-plugin.d.ts +9 -6
  203. package/dist/lib/auth/passkey-plugin.js +8 -11
  204. package/dist/lib/auth/theme-plugin.d.ts +6 -6
  205. package/dist/lib/auth/theme-plugin.js +25 -22
  206. package/dist/lib/auth/username-plugin.d.ts +11 -11
  207. package/dist/lib/auth/username-plugin.js +18 -17
  208. package/dist/plugins.d.ts +46 -22
  209. package/dist/plugins.js +47 -22
  210. package/package.json +25 -19
  211. package/src/components/auth/api-key/api-key.tsx +25 -16
  212. package/src/components/auth/api-key/api-keys-empty.tsx +8 -4
  213. package/src/components/auth/api-key/api-keys.tsx +52 -14
  214. package/src/components/auth/api-key/create-api-key-dialog.tsx +17 -4
  215. package/src/components/auth/api-key/delete-api-key-dialog.tsx +10 -2
  216. package/src/components/auth/api-key/organization-api-keys.tsx +55 -0
  217. package/src/components/auth/delete-user/danger-zone.tsx +3 -3
  218. package/src/components/auth/delete-user/{delete-user.tsx → delete-account.tsx} +9 -9
  219. package/src/components/auth/email/organization-invitation-email.tsx +38 -0
  220. package/src/components/auth/error-toaster.tsx +28 -10
  221. package/src/components/auth/forgot-password.tsx +10 -2
  222. package/src/components/auth/multi-session/manage-accounts.tsx +1 -1
  223. package/src/components/auth/multi-session/switch-account-submenu-content.tsx +7 -2
  224. package/src/components/auth/multi-session/switch-account-submenu-item.tsx +4 -2
  225. package/src/components/auth/multi-session/switch-account-submenu.tsx +8 -4
  226. package/src/components/auth/organization/change-organization-logo.tsx +171 -0
  227. package/src/components/auth/organization/create-organization-dialog.tsx +133 -0
  228. package/src/components/auth/organization/delete-organization-dialog.tsx +97 -0
  229. package/src/components/auth/organization/delete-organization-skeleton.tsx +17 -0
  230. package/src/components/auth/organization/delete-organization.tsx +77 -0
  231. package/src/components/auth/organization/invite-member-dialog.tsx +177 -0
  232. package/src/components/auth/organization/leave-organization-dialog.tsx +95 -0
  233. package/src/components/auth/organization/leave-organization.tsx +59 -0
  234. package/src/components/auth/organization/organization-danger-zone.tsx +68 -0
  235. package/src/components/auth/organization/organization-invitation-row-skeleton.tsx +29 -0
  236. package/src/components/auth/organization/organization-invitation-row.tsx +97 -0
  237. package/src/components/auth/organization/organization-invitations-empty.tsx +39 -0
  238. package/src/components/auth/organization/organization-invitations.tsx +351 -0
  239. package/src/components/auth/organization/organization-logo.tsx +64 -0
  240. package/src/components/auth/organization/organization-member-row-skeleton.tsx +24 -0
  241. package/src/components/auth/organization/organization-member-row.tsx +157 -0
  242. package/src/components/auth/organization/organization-members.tsx +284 -0
  243. package/src/components/auth/organization/organization-people.tsx +26 -0
  244. package/src/components/auth/organization/organization-profile.tsx +141 -0
  245. package/src/components/auth/organization/organization-row.tsx +66 -0
  246. package/src/components/auth/organization/organization-settings.tsx +38 -0
  247. package/src/components/auth/organization/organization-switcher.tsx +233 -0
  248. package/src/components/auth/organization/organization-view-skeleton.tsx +36 -0
  249. package/src/components/auth/organization/organization-view.tsx +109 -0
  250. package/src/components/auth/organization/organization.tsx +162 -0
  251. package/src/components/auth/organization/organizations-empty.tsx +35 -0
  252. package/src/components/auth/organization/organizations-settings.tsx +36 -0
  253. package/src/components/auth/organization/organizations.tsx +80 -0
  254. package/src/components/auth/organization/remove-member-dialog.tsx +95 -0
  255. package/src/components/auth/organization/slug-field.tsx +111 -0
  256. package/src/components/auth/organization/user-invitation-row-skeleton.tsx +17 -0
  257. package/src/components/auth/organization/user-invitation-row.tsx +90 -0
  258. package/src/components/auth/organization/user-invitations-empty.tsx +30 -0
  259. package/src/components/auth/organization/user-invitations.tsx +59 -0
  260. package/src/components/auth/passkey/add-passkey-dialog.tsx +109 -0
  261. package/src/components/auth/passkey/delete-passkey-dialog.tsx +95 -0
  262. package/src/components/auth/passkey/passkey-skeleton.tsx +16 -0
  263. package/src/components/auth/passkey/passkey.tsx +23 -22
  264. package/src/components/auth/passkey/passkeys-empty.tsx +35 -0
  265. package/src/components/auth/passkey/passkeys.tsx +33 -154
  266. package/src/components/auth/settings/account/change-email.tsx +1 -1
  267. package/src/components/auth/settings/account/user-profile.tsx +5 -5
  268. package/src/components/auth/settings/security/active-sessions.tsx +6 -4
  269. package/src/components/auth/settings/security/linked-accounts.tsx +2 -2
  270. package/src/components/auth/settings/settings.tsx +77 -14
  271. package/src/components/auth/user/user-avatar.tsx +4 -1
  272. package/src/components/auth/user/user-button.tsx +14 -11
  273. package/src/components/auth/user/user-view.tsx +32 -12
  274. package/src/email.ts +1 -0
  275. package/src/lib/auth/api-key-plugin.ts +10 -4
  276. package/src/lib/auth/auth-plugin.ts +6 -1
  277. package/src/lib/auth/organization-plugin.tsx +32 -0
  278. package/src/plugins.ts +25 -1
  279. package/dist/components/auth/delete-user/delete-user.d.ts +0 -9
  280. package/dist/components/auth/delete-user/delete-user.js +0 -95
@@ -1,106 +1,16 @@
1
- import { passkeyPlugin as e } from "../../../lib/auth/passkey-plugin.js";
2
- import { Passkey as t } from "./passkey.js";
3
- import { useAddPasskey as n, useAuth as r, useAuthPlugin as i, useListPasskeys as a } from "@better-auth-ui/react";
4
- import { Fingerprint as o } from "@gravity-ui/icons";
5
- import { AlertDialog as s, Button as c, Card as l, FieldError as u, Form as d, Input as f, Label as p, Skeleton as m, Spinner as h, TextField as g, cn as _ } from "@heroui/react";
6
- import { useState as v } from "react";
7
- import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
8
- //#region src/components/auth/passkey/passkeys.tsx
9
- function S({ className: m, variant: S, ...w }) {
10
- let { authClient: T, localization: E } = r(), { localization: D } = i(e), { data: O, isPending: k } = a(T), { mutate: A, isPending: j } = n(T), [M, N] = v(!1), [P, F] = v(""), I = (e) => {
11
- N(e), F("");
12
- }, L = async (e) => {
13
- e.preventDefault(), A({ name: P.trim() || void 0 }, { onSuccess: () => {
14
- N(!1), F("");
15
- } });
16
- };
17
- return /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("h2", {
18
- className: _("text-sm font-semibold mb-3"),
19
- children: D.passkeys
20
- }), /* @__PURE__ */ b(l, {
21
- className: _(m),
22
- variant: S,
23
- ...w,
24
- children: /* @__PURE__ */ x(l.Content, {
25
- className: "gap-0",
26
- children: [/* @__PURE__ */ x("div", {
27
- className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
28
- children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
29
- className: "text-sm font-medium leading-tight",
30
- children: D.passkeysDescription
31
- }), /* @__PURE__ */ b("p", {
32
- className: "text-muted text-xs mt-0.5",
33
- children: D.passkeysInstructions
34
- })] }), /* @__PURE__ */ x(s, { children: [/* @__PURE__ */ b(c, {
35
- className: "shrink-0",
36
- size: "sm",
37
- isDisabled: k,
38
- onPress: () => N(!0),
39
- children: D.addPasskey
40
- }), /* @__PURE__ */ b(s.Backdrop, {
41
- isOpen: M,
42
- onOpenChange: I,
43
- children: /* @__PURE__ */ b(s.Container, { children: /* @__PURE__ */ b(s.Dialog, { children: /* @__PURE__ */ x(d, {
44
- onSubmit: L,
45
- children: [
46
- /* @__PURE__ */ b(s.CloseTrigger, {}),
47
- /* @__PURE__ */ x(s.Header, { children: [/* @__PURE__ */ b(s.Icon, {
48
- status: "default",
49
- children: /* @__PURE__ */ b(o, {})
50
- }), /* @__PURE__ */ b(s.Heading, { children: D.addPasskey })] }),
51
- /* @__PURE__ */ x(s.Body, {
52
- className: "overflow-visible",
53
- children: [/* @__PURE__ */ b("p", {
54
- className: "text-muted text-sm",
55
- children: D.passkeysInstructions
56
- }), /* @__PURE__ */ x(g, {
57
- className: "mt-4",
58
- name: "passkey-name",
59
- isDisabled: j,
60
- value: P,
61
- onChange: F,
62
- children: [
63
- /* @__PURE__ */ b(p, { children: D.passkey }),
64
- /* @__PURE__ */ b(f, {
65
- autoFocus: !0,
66
- placeholder: E.settings.optional,
67
- variant: "secondary"
68
- }),
69
- /* @__PURE__ */ b(u, {})
70
- ]
71
- })]
72
- }),
73
- /* @__PURE__ */ x(s.Footer, { children: [/* @__PURE__ */ b(c, {
74
- slot: "close",
75
- variant: "tertiary",
76
- isDisabled: j,
77
- children: E.settings.cancel
78
- }), /* @__PURE__ */ x(c, {
79
- type: "submit",
80
- isPending: j,
81
- children: [j && /* @__PURE__ */ b(h, {
82
- color: "current",
83
- size: "sm"
84
- }), D.addPasskey]
85
- })] })
86
- ]
87
- }) }) })
88
- })] })]
89
- }), k ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("div", { className: "border-b border-dashed -mx-4 md:-mx-6 my-4" }), /* @__PURE__ */ b(C, {})] }) : O?.map((e) => /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("div", { className: "border-b border-dashed -mx-4 md:-mx-6 my-4" }), /* @__PURE__ */ b(t, { passkey: e })] }, e.id))]
90
- })
91
- })] });
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useAuth, useAuthPlugin, useListPasskeys } from "@better-auth-ui/react";
3
+ import { Button, Card, cn } from "@heroui/react";
4
+ import { useState } from "react";
5
+ import { passkeyPlugin } from "../../../lib/auth/passkey-plugin";
6
+ import { AddPasskeyDialog } from "./add-passkey-dialog";
7
+ import { Passkey } from "./passkey";
8
+ import { PasskeySkeleton } from "./passkey-skeleton";
9
+ import { PasskeysEmpty } from "./passkeys-empty";
10
+ export function Passkeys({ className, variant, ...props }) {
11
+ const { authClient } = useAuth();
12
+ const { localization: passkeyLocalization } = useAuthPlugin(passkeyPlugin);
13
+ const { data: passkeys, isPending } = useListPasskeys(authClient);
14
+ const [addOpen, setAddOpen] = useState(false);
15
+ return (_jsxs("div", { className: cn("flex flex-col gap-3", className), children: [_jsxs("div", { className: "flex items-end justify-between gap-3", children: [_jsx("h2", { className: "text-sm font-semibold truncate", children: passkeyLocalization.passkeys }), _jsx(Button, { className: "shrink-0", size: "sm", isDisabled: isPending, onPress: () => setAddOpen(true), children: passkeyLocalization.addPasskey })] }), _jsx(Card, { variant: variant, ...props, children: _jsx(Card.Content, { children: isPending ? (_jsx(PasskeySkeleton, {})) : !passkeys?.length ? (_jsx(PasskeysEmpty, { onAddPress: () => setAddOpen(true) })) : (passkeys.map((passkey, index) => (_jsxs("div", { children: [index > 0 && (_jsx("div", { className: "border-b border-dashed -mx-4 my-4" })), _jsx(Passkey, { passkey: passkey })] }, passkey.id)))) }) }), _jsx(AddPasskeyDialog, { isOpen: addOpen, onOpenChange: setAddOpen })] }));
92
16
  }
93
- function C() {
94
- return /* @__PURE__ */ b("div", {
95
- className: "flex items-center justify-between",
96
- children: /* @__PURE__ */ x("div", {
97
- className: "flex items-center gap-3",
98
- children: [/* @__PURE__ */ b(m, { className: "size-10 rounded-xl" }), /* @__PURE__ */ x("div", {
99
- className: "flex flex-col gap-1",
100
- children: [/* @__PURE__ */ b(m, { className: "h-4 w-24 rounded-lg" }), /* @__PURE__ */ b(m, { className: "h-3 w-20 rounded-lg" })]
101
- })]
102
- })
103
- });
104
- }
105
- //#endregion
106
- export { S as Passkeys };
@@ -1,5 +1,5 @@
1
- import { ButtonProps } from '@heroui/react';
2
- import { SocialProvider } from 'better-auth/social-providers';
1
+ import { type ButtonProps } from "@heroui/react";
2
+ import type { SocialProvider } from "better-auth/social-providers";
3
3
  export type ProviderButtonProps = {
4
4
  provider: SocialProvider;
5
5
  display?: "full" | "name" | "icon";
@@ -1,25 +1,29 @@
1
- import { authMutationKeys as e, getProviderName as t } from "@better-auth-ui/core";
2
- import { providerIcons as n, useAuth as r, useSignInSocial as i } from "@better-auth-ui/react";
3
- import { Button as a, Spinner as o } from "@heroui/react";
4
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
5
- import { useIsMutating as l } from "@tanstack/react-query";
6
- //#region src/components/auth/provider-button.tsx
7
- function u({ provider: u, display: d = "full", variant: f = "tertiary", ...p }) {
8
- let { authClient: m, baseURL: h, localization: g, redirectTo: _ } = r(), v = `${h}${_}`, { mutate: y, isPending: b } = i(m), x = n[u];
9
- return /* @__PURE__ */ c(a, {
10
- variant: f,
11
- isPending: l({ mutationKey: e.signIn.all }) + l({ mutationKey: e.signUp.all }) > 0,
12
- onPress: () => y({
13
- provider: u,
14
- callbackURL: v
15
- }),
16
- ...p,
17
- "aria-label": t(u),
18
- children: [b ? /* @__PURE__ */ s(o, {
19
- color: "current",
20
- size: "sm"
21
- }) : /* @__PURE__ */ s(x, {}), d === "full" ? g.auth.continueWith.replace("{{provider}}", t(u)) : d === "name" ? t(u) : null]
22
- });
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { authMutationKeys, getProviderName } from "@better-auth-ui/core";
3
+ import { providerIcons, useAuth, useSignInSocial } from "@better-auth-ui/react";
4
+ import { Button, Spinner } from "@heroui/react";
5
+ import { useIsMutating } from "@tanstack/react-query";
6
+ /**
7
+ * Social provider sign-in button.
8
+ *
9
+ * @param provider - Provider to sign in with.
10
+ * @param display - `"full"` (e.g. "Continue with Google"), `"name"` (just the provider name), or `"icon"` (icon only).
11
+ */
12
+ export function ProviderButton({ provider, display = "full", variant = "tertiary", ...props }) {
13
+ const { authClient, baseURL, localization, redirectTo } = useAuth();
14
+ const callbackURL = `${baseURL}${redirectTo}`;
15
+ const { mutate: signInSocial, isPending: signInSocialPending } = useSignInSocial(authClient);
16
+ const ProviderIcon = providerIcons[provider];
17
+ const signInMutating = useIsMutating({
18
+ mutationKey: authMutationKeys.signIn.all
19
+ });
20
+ const signUpMutating = useIsMutating({
21
+ mutationKey: authMutationKeys.signUp.all
22
+ });
23
+ const isPending = signInMutating + signUpMutating > 0;
24
+ return (_jsxs(Button, { variant: variant, isPending: isPending, onPress: () => signInSocial({ provider, callbackURL }), ...props, "aria-label": getProviderName(provider), children: [signInSocialPending ? (_jsx(Spinner, { color: "current", size: "sm" })) : (_jsx(ProviderIcon, {})), display === "full"
25
+ ? localization.auth.continueWith.replace("{{provider}}", getProviderName(provider))
26
+ : display === "name"
27
+ ? getProviderName(provider)
28
+ : null] }));
23
29
  }
24
- //#endregion
25
- export { u as ProviderButton };
@@ -1,19 +1,29 @@
1
- import { ProviderButton as e } from "./provider-button.js";
2
- import { useAuth as t } from "@better-auth-ui/react";
3
- import { cn as n } from "@heroui/react";
4
- import { useMemo as r } from "react";
5
- import { jsx as i } from "react/jsx-runtime";
6
- //#region src/components/auth/provider-buttons.tsx
7
- function a({ socialLayout: a = "auto" }) {
8
- let { socialProviders: o } = t(), s = r(() => a === "auto" ? o?.length && o.length >= 4 ? "horizontal" : "vertical" : a, [a, o?.length]);
9
- return /* @__PURE__ */ i("div", {
10
- className: n("gap-3", s === "grid" && "grid grid-cols-2", s === "vertical" && "flex flex-col", s === "horizontal" && "flex flex-wrap"),
11
- children: o?.map((t) => /* @__PURE__ */ i(e, {
12
- provider: t,
13
- display: s === "vertical" ? "full" : s === "grid" ? "name" : "icon",
14
- className: n("w-full", s === "horizontal" && "flex-1")
15
- }, t))
16
- });
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useAuth } from "@better-auth-ui/react";
3
+ import { cn } from "@heroui/react";
4
+ import { useMemo } from "react";
5
+ import { ProviderButton } from "./provider-button";
6
+ /**
7
+ * Render social provider sign-in buttons. Each button owns its own sign-in
8
+ * mutation and reads shared auth pending state from React Query.
9
+ *
10
+ * @param socialLayout - Preferred layout for the buttons; `"auto"` picks `"horizontal"` when there are four or more providers, otherwise `"vertical"`.
11
+ * @returns The JSX element that renders the configured social provider buttons.
12
+ */
13
+ export function ProviderButtons({ socialLayout = "auto" }) {
14
+ const { socialProviders } = useAuth();
15
+ const resolvedSocialLayout = useMemo(() => {
16
+ if (socialLayout === "auto") {
17
+ if (socialProviders?.length && socialProviders.length >= 4) {
18
+ return "horizontal";
19
+ }
20
+ return "vertical";
21
+ }
22
+ return socialLayout;
23
+ }, [socialLayout, socialProviders?.length]);
24
+ return (_jsx("div", { className: cn("gap-3", resolvedSocialLayout === "grid" && "grid grid-cols-2", resolvedSocialLayout === "vertical" && "flex flex-col", resolvedSocialLayout === "horizontal" && "flex flex-wrap"), children: socialProviders?.map((provider) => (_jsx(ProviderButton, { provider: provider, display: resolvedSocialLayout === "vertical"
25
+ ? "full"
26
+ : resolvedSocialLayout === "grid"
27
+ ? "name"
28
+ : "icon", className: cn("w-full", resolvedSocialLayout === "horizontal" && "flex-1") }, provider))) }));
17
29
  }
18
- //#endregion
19
- export { a as ProviderButtons };
@@ -1,4 +1,4 @@
1
- import { CardProps } from '@heroui/react';
1
+ import { type CardProps } from "@heroui/react";
2
2
  export type ResetPasswordProps = {
3
3
  className?: string;
4
4
  variant?: CardProps["variant"];
@@ -1,147 +1,57 @@
1
- import { useAuth as e, useResetPassword as t } from "@better-auth-ui/react";
2
- import { Eye as n, EyeSlash as r } from "@gravity-ui/icons";
3
- import { Button as i, Card as a, Description as o, FieldError as s, Form as c, InputGroup as l, Label as u, Link as d, Spinner as f, TextField as p, cn as m, toast as h } from "@heroui/react";
4
- import { useEffect as g, useState as _ } from "react";
5
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
6
- //#region src/components/auth/reset-password.tsx
7
- function b({ className: b, variant: x, ...S }) {
8
- let { authClient: C, basePaths: w, emailAndPassword: T, localization: E, viewPaths: D, navigate: O } = e(), { mutate: k, isPending: A } = t(C, { onSuccess: () => {
9
- h.success(E.auth.passwordResetSuccess), O({ to: `${w.auth}/${D.auth.signIn}` });
10
- } }), [j, M] = _(!1), [N, P] = _(!1);
11
- g(() => {
12
- new URLSearchParams(window.location.search).get("token") || (h.danger(E.auth.invalidResetPasswordToken), O({ to: `${w.auth}/${D.auth.signIn}` }));
13
- }, [
14
- w.auth,
15
- E.auth.invalidResetPasswordToken,
16
- D.auth.signIn,
17
- O
18
- ]);
19
- function F(e) {
20
- e.preventDefault();
21
- let t = new URLSearchParams(window.location.search).get("token");
22
- if (!t) {
23
- h.danger(E.auth.invalidResetPasswordToken), O({ to: `${w.auth}/${D.auth.signIn}` });
24
- return;
25
- }
26
- let n = new FormData(e.currentTarget), r = n.get("password"), i = n.get("confirmPassword");
27
- if (T?.confirmPassword && r !== i) {
28
- h.danger(E.auth.passwordsDoNotMatch);
29
- return;
30
- }
31
- k({
32
- token: t,
33
- newPassword: r
34
- });
35
- }
36
- return /* @__PURE__ */ y(a, {
37
- className: m("w-full max-w-sm gap-4 md:p-6", b),
38
- variant: x,
39
- ...S,
40
- children: [
41
- /* @__PURE__ */ v(a.Header, { children: /* @__PURE__ */ v(a.Title, {
42
- className: "text-xl font-semibold mb-1",
43
- children: E.auth.resetPassword
44
- }) }),
45
- /* @__PURE__ */ v(a.Content, {
46
- className: "gap-4",
47
- children: /* @__PURE__ */ y(c, {
48
- onSubmit: F,
49
- className: "flex flex-col gap-4",
50
- children: [
51
- /* @__PURE__ */ y(p, {
52
- minLength: T?.minPasswordLength,
53
- maxLength: T?.maxPasswordLength,
54
- name: "password",
55
- autoComplete: "new-password",
56
- isDisabled: A,
57
- children: [
58
- /* @__PURE__ */ v(u, { children: E.auth.password }),
59
- /* @__PURE__ */ y(l, {
60
- variant: x === "transparent" ? "primary" : "secondary",
61
- children: [/* @__PURE__ */ v(l.Input, {
62
- name: "password",
63
- placeholder: E.auth.newPasswordPlaceholder,
64
- type: j ? "text" : "password",
65
- required: !0
66
- }), /* @__PURE__ */ v(l.Suffix, {
67
- className: "px-0",
68
- children: /* @__PURE__ */ v(i, {
69
- isIconOnly: !0,
70
- "aria-label": j ? E.auth.hidePassword : E.auth.showPassword,
71
- size: "sm",
72
- variant: "ghost",
73
- onPress: () => M(!j),
74
- isDisabled: A,
75
- children: v(j ? r : n, {})
76
- })
77
- })]
78
- }),
79
- /* @__PURE__ */ v(s, {})
80
- ]
81
- }),
82
- T?.confirmPassword && /* @__PURE__ */ y(p, {
83
- minLength: T?.minPasswordLength,
84
- maxLength: T?.maxPasswordLength,
85
- name: "confirmPassword",
86
- autoComplete: "new-password",
87
- isDisabled: A,
88
- children: [
89
- /* @__PURE__ */ v(u, { children: E.auth.confirmPassword }),
90
- /* @__PURE__ */ y(l, {
91
- variant: x === "transparent" ? "primary" : "secondary",
92
- children: [/* @__PURE__ */ v(l.Input, {
93
- placeholder: E.auth.confirmPasswordPlaceholder,
94
- type: N ? "text" : "password",
95
- required: !0,
96
- name: "confirmPassword"
97
- }), /* @__PURE__ */ v(l.Suffix, {
98
- className: "px-0",
99
- children: /* @__PURE__ */ v(i, {
100
- isIconOnly: !0,
101
- "aria-label": N ? E.auth.hidePassword : E.auth.showPassword,
102
- size: "sm",
103
- variant: "ghost",
104
- onPress: () => P(!N),
105
- isDisabled: A,
106
- children: v(N ? r : n, {})
107
- })
108
- })]
109
- }),
110
- /* @__PURE__ */ v(s, {})
111
- ]
112
- }),
113
- /* @__PURE__ */ v("div", {
114
- className: "flex flex-col gap-3",
115
- children: /* @__PURE__ */ y(i, {
116
- type: "submit",
117
- className: "w-full",
118
- isPending: A,
119
- children: [A && /* @__PURE__ */ v(f, {
120
- color: "current",
121
- size: "sm"
122
- }), E.auth.resetPassword]
123
- })
124
- })
125
- ]
126
- })
127
- }),
128
- /* @__PURE__ */ v(a.Footer, {
129
- className: "flex-col gap-3",
130
- children: /* @__PURE__ */ y(o, {
131
- className: "text-sm",
132
- children: [
133
- E.auth.rememberYourPassword,
134
- " ",
135
- /* @__PURE__ */ v(d, {
136
- href: `${w.auth}/${D.auth.signIn}`,
137
- className: "text-accent no-underline hover:underline decoration-accent-hover",
138
- children: E.auth.signIn
139
- })
140
- ]
141
- })
142
- })
143
- ]
144
- });
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useAuth, useResetPassword } from "@better-auth-ui/react";
3
+ import { Eye, EyeSlash } from "@gravity-ui/icons";
4
+ import { Button, Card, cn, Description, FieldError, Form, InputGroup, Label, Link, Spinner, TextField, toast } from "@heroui/react";
5
+ import { useEffect, useState } from "react";
6
+ /**
7
+ * Renders a reset password form that verifies a "token" URL parameter on mount and redirects to sign-in if absent.
8
+ *
9
+ * Renders password (and optional confirm-password) inputs with visibility toggles, applies min/max length constraints from the auth configuration, shows field errors, and submits the new password to the auth client.
10
+ */
11
+ export function ResetPassword({ className, variant, ...props }) {
12
+ const { authClient, basePaths, emailAndPassword, localization, viewPaths, navigate } = useAuth();
13
+ const { mutate: resetPassword, isPending } = useResetPassword(authClient, {
14
+ onSuccess: () => {
15
+ toast.success(localization.auth.passwordResetSuccess);
16
+ navigate({ to: `${basePaths.auth}/${viewPaths.auth.signIn}` });
17
+ }
18
+ });
19
+ const [isPasswordVisible, setIsPasswordVisible] = useState(false);
20
+ const [isConfirmPasswordVisible, setIsConfirmPasswordVisible] = useState(false);
21
+ useEffect(() => {
22
+ const searchParams = new URLSearchParams(window.location.search);
23
+ const token = searchParams.get("token");
24
+ if (!token) {
25
+ toast.danger(localization.auth.invalidResetPasswordToken);
26
+ navigate({ to: `${basePaths.auth}/${viewPaths.auth.signIn}` });
27
+ }
28
+ }, [
29
+ basePaths.auth,
30
+ localization.auth.invalidResetPasswordToken,
31
+ viewPaths.auth.signIn,
32
+ navigate
33
+ ]);
34
+ function handleSubmit(e) {
35
+ e.preventDefault();
36
+ const searchParams = new URLSearchParams(window.location.search);
37
+ const token = searchParams.get("token");
38
+ if (!token) {
39
+ toast.danger(localization.auth.invalidResetPasswordToken);
40
+ navigate({ to: `${basePaths.auth}/${viewPaths.auth.signIn}` });
41
+ return;
42
+ }
43
+ const formData = new FormData(e.currentTarget);
44
+ const password = formData.get("password");
45
+ const confirmPassword = formData.get("confirmPassword");
46
+ if (emailAndPassword?.confirmPassword && password !== confirmPassword) {
47
+ toast.danger(localization.auth.passwordsDoNotMatch);
48
+ return;
49
+ }
50
+ resetPassword({ token, newPassword: password });
51
+ }
52
+ return (_jsxs(Card, { className: cn("w-full max-w-sm gap-4 md:p-6", className), variant: variant, ...props, children: [_jsx(Card.Header, { children: _jsx(Card.Title, { className: "text-xl font-semibold mb-1", children: localization.auth.resetPassword }) }), _jsx(Card.Content, { className: "gap-4", children: _jsxs(Form, { onSubmit: handleSubmit, className: "flex flex-col gap-4", children: [_jsxs(TextField, { minLength: emailAndPassword?.minPasswordLength, maxLength: emailAndPassword?.maxPasswordLength, name: "password", autoComplete: "new-password", isDisabled: isPending, children: [_jsx(Label, { children: localization.auth.password }), _jsxs(InputGroup, { variant: variant === "transparent" ? "primary" : "secondary", children: [_jsx(InputGroup.Input, { name: "password", placeholder: localization.auth.newPasswordPlaceholder, type: isPasswordVisible ? "text" : "password", required: true }), _jsx(InputGroup.Suffix, { className: "px-0", children: _jsx(Button, { isIconOnly: true, "aria-label": isPasswordVisible
53
+ ? localization.auth.hidePassword
54
+ : localization.auth.showPassword, size: "sm", variant: "ghost", onPress: () => setIsPasswordVisible(!isPasswordVisible), isDisabled: isPending, children: isPasswordVisible ? _jsx(EyeSlash, {}) : _jsx(Eye, {}) }) })] }), _jsx(FieldError, {})] }), emailAndPassword?.confirmPassword && (_jsxs(TextField, { minLength: emailAndPassword?.minPasswordLength, maxLength: emailAndPassword?.maxPasswordLength, name: "confirmPassword", autoComplete: "new-password", isDisabled: isPending, children: [_jsx(Label, { children: localization.auth.confirmPassword }), _jsxs(InputGroup, { variant: variant === "transparent" ? "primary" : "secondary", children: [_jsx(InputGroup.Input, { placeholder: localization.auth.confirmPasswordPlaceholder, type: isConfirmPasswordVisible ? "text" : "password", required: true, name: "confirmPassword" }), _jsx(InputGroup.Suffix, { className: "px-0", children: _jsx(Button, { isIconOnly: true, "aria-label": isConfirmPasswordVisible
55
+ ? localization.auth.hidePassword
56
+ : localization.auth.showPassword, size: "sm", variant: "ghost", onPress: () => setIsConfirmPasswordVisible(!isConfirmPasswordVisible), isDisabled: isPending, children: isConfirmPasswordVisible ? _jsx(EyeSlash, {}) : _jsx(Eye, {}) }) })] }), _jsx(FieldError, {})] })), _jsx("div", { className: "flex flex-col gap-3", children: _jsxs(Button, { type: "submit", className: "w-full", isPending: isPending, children: [isPending && _jsx(Spinner, { color: "current", size: "sm" }), localization.auth.resetPassword] }) })] }) }), _jsx(Card.Footer, { className: "flex-col gap-3", children: _jsxs(Description, { className: "text-sm", children: [localization.auth.rememberYourPassword, " ", _jsx(Link, { href: `${basePaths.auth}/${viewPaths.auth.signIn}`, className: "text-accent no-underline hover:underline decoration-accent-hover", children: localization.auth.signIn })] }) })] }));
145
57
  }
146
- //#endregion
147
- export { b as ResetPassword };
@@ -1,5 +1,5 @@
1
- import { CardProps } from '@heroui/react';
2
- import { ComponentProps } from 'react';
1
+ import { type CardProps } from "@heroui/react";
2
+ import type { ComponentProps } from "react";
3
3
  export type AccountSettingsProps = {
4
4
  className?: string;
5
5
  variant?: CardProps["variant"];
@@ -1,20 +1,22 @@
1
- import { ChangeEmail as e } from "./change-email.js";
2
- import { UserProfile as t } from "./user-profile.js";
3
- import { useAuth as n } from "@better-auth-ui/react";
4
- import { cn as r } from "@heroui/react";
5
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
- //#region src/components/auth/settings/account/account-settings.tsx
7
- function o({ className: o, variant: s, ...c }) {
8
- let { emailAndPassword: l, plugins: u } = n(), d = u.some((e) => e.id === "magicLink");
9
- return /* @__PURE__ */ a("div", {
10
- className: r("flex w-full flex-col gap-4 md:gap-6", o),
11
- ...c,
12
- children: [
13
- /* @__PURE__ */ i(t, { variant: s }),
14
- (l?.enabled || d) && /* @__PURE__ */ i(e, { variant: s }),
15
- u.flatMap((e) => e.accountCards?.map((t, n) => /* @__PURE__ */ i(t, { variant: s }, `${e.id}-${n.toString()}`)))
16
- ]
17
- });
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useAuth } from "@better-auth-ui/react";
3
+ import { cn } from "@heroui/react";
4
+ import { ChangeEmail } from "./change-email";
5
+ import { UserProfile } from "./user-profile";
6
+ /**
7
+ * Renders the account settings layout.
8
+ *
9
+ * `UserProfile` always renders. `ChangeEmail` renders when password auth is
10
+ * enabled or the `magicLink` plugin is registered. Plugin-contributed account
11
+ * cards (e.g. `Appearance` from the theme plugin, multi-session accounts) are
12
+ * rendered via the plugins array.
13
+ *
14
+ * @param className - Optional additional CSS class names for the outer container.
15
+ * @param variant - Card variant forwarded to each account settings card.
16
+ * @returns The account settings container as a JSX element.
17
+ */
18
+ export function AccountSettings({ className, variant, ...props }) {
19
+ const { emailAndPassword, plugins } = useAuth();
20
+ const hasMagicLink = plugins.some((plugin) => plugin.id === "magicLink");
21
+ return (_jsxs("div", { className: cn("flex w-full flex-col gap-4 md:gap-6", className), ...props, children: [_jsx(UserProfile, { variant: variant }), (emailAndPassword?.enabled || hasMagicLink) && (_jsx(ChangeEmail, { variant: variant })), plugins.flatMap((plugin) => plugin.accountCards?.map((Card, index) => (_jsx(Card, { variant: variant }, `${plugin.id}-${index.toString()}`))))] }));
18
22
  }
19
- //#endregion
20
- export { o as AccountSettings };