@better-auth-ui/heroui 1.6.2 → 1.6.4

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 (213) 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-provider.js +12 -11
  5. package/dist/components/auth/auth.d.ts +1 -1
  6. package/dist/components/auth/auth.js +54 -28
  7. package/dist/components/{settings/security → auth/delete-user}/danger-zone.d.ts +3 -4
  8. package/dist/components/{settings/security → auth/delete-user}/danger-zone.js +1 -1
  9. package/dist/components/{settings/security → auth/delete-user}/delete-user.d.ts +1 -1
  10. package/dist/components/auth/delete-user/delete-user.js +95 -0
  11. package/dist/components/{email → auth/email}/email-changed-email.d.ts +2 -2
  12. package/dist/components/{email → auth/email}/email-changed-email.js +7 -7
  13. package/dist/components/{email → auth/email}/email-verification-email.d.ts +2 -2
  14. package/dist/components/{email → auth/email}/email-verification-email.js +7 -7
  15. package/dist/components/auth/email/magic-link-email.d.ts +3 -0
  16. package/dist/components/{email → auth/email}/magic-link-email.js +7 -7
  17. package/dist/components/auth/email/new-device-email.d.ts +3 -0
  18. package/dist/components/{email → auth/email}/new-device-email.js +7 -7
  19. package/dist/components/auth/email/otp-email.d.ts +3 -0
  20. package/dist/components/{email → auth/email}/otp-email.js +6 -6
  21. package/dist/components/{email → auth/email}/password-changed-email.d.ts +2 -2
  22. package/dist/components/{email → auth/email}/password-changed-email.js +7 -7
  23. package/dist/components/{email → auth/email}/reset-password-email.d.ts +2 -2
  24. package/dist/components/{email → auth/email}/reset-password-email.js +7 -7
  25. package/dist/components/auth/error-toaster.d.ts +1 -0
  26. package/dist/components/auth/error-toaster.js +17 -0
  27. package/dist/components/auth/forgot-password.d.ts +2 -2
  28. package/dist/components/auth/forgot-password.js +42 -42
  29. package/dist/components/auth/magic-link/magic-link-button.d.ts +11 -0
  30. package/dist/components/auth/magic-link/magic-link-button.js +20 -0
  31. package/dist/components/auth/magic-link/magic-link.d.ts +16 -0
  32. package/dist/components/auth/magic-link/magic-link.js +87 -0
  33. package/dist/components/{settings/account → auth/multi-session}/manage-account.d.ts +2 -6
  34. package/dist/components/auth/multi-session/manage-account.js +49 -0
  35. package/dist/components/{settings/account → auth/multi-session}/manage-accounts.d.ts +1 -1
  36. package/dist/components/auth/multi-session/manage-accounts.js +34 -0
  37. package/dist/components/{user/switch-account-menu.d.ts → auth/multi-session/switch-account-submenu-content.d.ts} +3 -3
  38. package/dist/components/auth/multi-session/switch-account-submenu-content.js +29 -0
  39. package/dist/components/{user/switch-account-item.d.ts → auth/multi-session/switch-account-submenu-item.d.ts} +2 -2
  40. package/dist/components/auth/multi-session/switch-account-submenu-item.js +20 -0
  41. package/dist/components/auth/multi-session/switch-account-submenu.d.ts +13 -0
  42. package/dist/components/auth/multi-session/switch-account-submenu.js +24 -0
  43. package/dist/components/auth/passkey/passkey-button.d.ts +6 -0
  44. package/dist/components/auth/passkey/passkey-button.js +24 -0
  45. package/dist/components/auth/passkey/passkey.js +45 -0
  46. package/dist/components/{settings/security → auth/passkey}/passkeys.d.ts +1 -1
  47. package/dist/components/auth/passkey/passkeys.js +106 -0
  48. package/dist/components/auth/provider-button.d.ts +13 -0
  49. package/dist/components/auth/provider-button.js +25 -0
  50. package/dist/components/auth/provider-buttons.d.ts +3 -10
  51. package/dist/components/auth/provider-buttons.js +14 -22
  52. package/dist/components/auth/reset-password.d.ts +1 -1
  53. package/dist/components/auth/reset-password.js +110 -110
  54. package/dist/components/{settings → auth/settings}/account/account-settings.d.ts +5 -2
  55. package/dist/components/auth/settings/account/account-settings.js +20 -0
  56. package/dist/components/auth/settings/account/change-avatar.js +89 -0
  57. package/dist/components/{settings → auth/settings}/account/change-email.d.ts +1 -1
  58. package/dist/components/{settings → auth/settings}/account/change-email.js +17 -20
  59. package/dist/components/{settings → auth/settings}/account/user-profile.d.ts +3 -4
  60. package/dist/components/auth/settings/account/user-profile.js +86 -0
  61. package/dist/components/auth/settings/security/active-session.js +59 -0
  62. package/dist/components/{settings → auth/settings}/security/active-sessions.d.ts +1 -1
  63. package/dist/components/auth/settings/security/active-sessions.js +34 -0
  64. package/dist/components/{settings → auth/settings}/security/change-password.d.ts +1 -1
  65. package/dist/components/auth/settings/security/change-password.js +189 -0
  66. package/dist/components/auth/settings/security/linked-account.js +56 -0
  67. package/dist/components/{settings → auth/settings}/security/linked-accounts.d.ts +1 -1
  68. package/dist/components/auth/settings/security/linked-accounts.js +45 -0
  69. package/dist/components/{settings → auth/settings}/security/security-settings.d.ts +1 -1
  70. package/dist/components/auth/settings/security/security-settings.js +22 -0
  71. package/dist/components/auth/settings/settings.js +45 -0
  72. package/dist/components/auth/sign-in.d.ts +1 -1
  73. package/dist/components/auth/sign-in.js +64 -100
  74. package/dist/components/auth/sign-out.js +11 -11
  75. package/dist/components/auth/sign-up.d.ts +1 -1
  76. package/dist/components/auth/sign-up.js +123 -157
  77. package/dist/components/{settings/account → auth/theme}/appearance.d.ts +3 -6
  78. package/dist/components/auth/theme/appearance.js +72 -0
  79. package/dist/components/auth/theme/theme-toggle-item.d.ts +5 -0
  80. package/dist/components/auth/theme/theme-toggle-item.js +58 -0
  81. package/dist/components/auth/user/user-avatar.js +29 -0
  82. package/dist/components/{user → auth/user}/user-button.d.ts +2 -6
  83. package/dist/components/auth/user/user-button.js +55 -0
  84. package/dist/components/auth/user/user-view.js +37 -0
  85. package/dist/components/auth/username/sign-in-username.d.ts +14 -0
  86. package/dist/components/auth/username/sign-in-username.js +142 -0
  87. package/dist/components/auth/username/username-field.d.ts +8 -0
  88. package/dist/components/auth/username/username-field.js +51 -0
  89. package/dist/email.d.ts +7 -0
  90. package/dist/email.js +9 -0
  91. package/dist/index.d.ts +13 -27
  92. package/dist/index.js +22 -36
  93. package/dist/lib/auth/auth-plugin.d.ts +44 -0
  94. package/dist/lib/auth/delete-user-plugin.d.ts +17 -0
  95. package/dist/lib/auth/delete-user-plugin.js +10 -0
  96. package/dist/lib/auth/magic-link-plugin.d.ts +31 -0
  97. package/dist/lib/auth/magic-link-plugin.js +13 -0
  98. package/dist/lib/auth/multi-session-plugin.d.ts +18 -0
  99. package/dist/lib/auth/multi-session-plugin.js +12 -0
  100. package/dist/lib/auth/passkey-plugin.d.ts +20 -0
  101. package/dist/lib/auth/passkey-plugin.js +12 -0
  102. package/dist/lib/auth/theme-plugin.d.ts +68 -0
  103. package/dist/lib/auth/theme-plugin.js +23 -0
  104. package/dist/lib/auth/username-plugin.d.ts +63 -0
  105. package/dist/lib/auth/username-plugin.js +18 -0
  106. package/dist/plugins.d.ts +20 -0
  107. package/dist/plugins.js +21 -0
  108. package/package.json +22 -22
  109. package/src/components/auth/additional-field.tsx +554 -0
  110. package/src/components/auth/auth-provider.tsx +8 -5
  111. package/src/components/auth/auth.tsx +100 -36
  112. package/src/components/{settings/security → auth/delete-user}/danger-zone.tsx +3 -10
  113. package/src/components/{settings/security → auth/delete-user}/delete-user.tsx +31 -24
  114. package/src/components/{email → auth/email}/email-changed-email.tsx +2 -2
  115. package/src/components/{email → auth/email}/email-verification-email.tsx +2 -2
  116. package/src/components/{email → auth/email}/magic-link-email.tsx +2 -2
  117. package/src/components/{email → auth/email}/new-device-email.tsx +2 -2
  118. package/src/components/{email → auth/email}/otp-email.tsx +2 -2
  119. package/src/components/{email → auth/email}/password-changed-email.tsx +2 -2
  120. package/src/components/{email → auth/email}/reset-password-email.tsx +2 -2
  121. package/src/components/auth/error-toaster.tsx +25 -0
  122. package/src/components/auth/forgot-password.tsx +15 -13
  123. package/src/components/auth/magic-link/magic-link-button.tsx +61 -0
  124. package/src/components/auth/{magic-link.tsx → magic-link/magic-link.tsx} +52 -57
  125. package/src/components/{settings/account → auth/multi-session}/manage-account.tsx +15 -15
  126. package/src/components/{settings/account → auth/multi-session}/manage-accounts.tsx +16 -12
  127. package/src/components/{user/switch-account-menu.tsx → auth/multi-session/switch-account-submenu-content.tsx} +19 -17
  128. package/src/components/{user/switch-account-item.tsx → auth/multi-session/switch-account-submenu-item.tsx} +18 -8
  129. package/src/components/auth/multi-session/switch-account-submenu.tsx +50 -0
  130. package/src/components/auth/passkey/passkey-button.tsx +56 -0
  131. package/src/components/{settings/security → auth/passkey}/passkey.tsx +21 -9
  132. package/src/components/auth/passkey/passkeys.tsx +196 -0
  133. package/src/components/auth/provider-button.tsx +65 -0
  134. package/src/components/auth/provider-buttons.tsx +23 -45
  135. package/src/components/auth/reset-password.tsx +14 -9
  136. package/src/components/{settings → auth/settings}/account/account-settings.tsx +15 -13
  137. package/src/components/{settings → auth/settings}/account/change-avatar.tsx +4 -5
  138. package/src/components/{settings → auth/settings}/account/change-email.tsx +5 -6
  139. package/src/components/auth/settings/account/user-profile.tsx +171 -0
  140. package/src/components/{settings → auth/settings}/security/active-session.tsx +8 -6
  141. package/src/components/{settings → auth/settings}/security/active-sessions.tsx +5 -10
  142. package/src/components/{settings → auth/settings}/security/change-password.tsx +22 -14
  143. package/src/components/{settings → auth/settings}/security/linked-account.tsx +10 -16
  144. package/src/components/{settings → auth/settings}/security/linked-accounts.tsx +4 -9
  145. package/src/components/{settings → auth/settings}/security/security-settings.tsx +7 -6
  146. package/src/components/{settings → auth/settings}/settings.tsx +2 -2
  147. package/src/components/auth/sign-in.tsx +39 -80
  148. package/src/components/auth/sign-out.tsx +2 -2
  149. package/src/components/auth/sign-up.tsx +110 -147
  150. package/src/components/{settings/account → auth/theme}/appearance.tsx +18 -25
  151. package/src/components/auth/theme/theme-toggle-item.tsx +110 -0
  152. package/src/components/{user → auth/user}/user-avatar.tsx +12 -4
  153. package/src/components/{user → auth/user}/user-button.tsx +15 -88
  154. package/src/components/{user → auth/user}/user-view.tsx +12 -4
  155. package/src/components/auth/username/sign-in-username.tsx +283 -0
  156. package/src/components/auth/username/username-field.tsx +122 -0
  157. package/src/email.ts +9 -0
  158. package/src/index.tsx +13 -27
  159. package/src/lib/auth/auth-plugin.ts +67 -0
  160. package/src/lib/auth/delete-user-plugin.ts +15 -0
  161. package/src/lib/auth/magic-link-plugin.ts +26 -0
  162. package/src/lib/auth/multi-session-plugin.ts +17 -0
  163. package/src/lib/auth/passkey-plugin.ts +17 -0
  164. package/src/lib/auth/theme-plugin.ts +86 -0
  165. package/src/lib/auth/username-plugin.tsx +30 -0
  166. package/src/plugins.ts +23 -0
  167. package/dist/components/auth/magic-link-button.d.ts +0 -13
  168. package/dist/components/auth/magic-link-button.js +0 -16
  169. package/dist/components/auth/magic-link.d.ts +0 -17
  170. package/dist/components/auth/magic-link.js +0 -111
  171. package/dist/components/auth/passkey-button.d.ts +0 -4
  172. package/dist/components/auth/passkey-button.js +0 -24
  173. package/dist/components/email/magic-link-email.d.ts +0 -3
  174. package/dist/components/email/new-device-email.d.ts +0 -3
  175. package/dist/components/email/otp-email.d.ts +0 -3
  176. package/dist/components/settings/account/account-settings.js +0 -23
  177. package/dist/components/settings/account/appearance.js +0 -71
  178. package/dist/components/settings/account/change-avatar.js +0 -89
  179. package/dist/components/settings/account/manage-account.js +0 -51
  180. package/dist/components/settings/account/manage-accounts.js +0 -33
  181. package/dist/components/settings/account/user-profile.js +0 -106
  182. package/dist/components/settings/security/active-session.js +0 -62
  183. package/dist/components/settings/security/active-sessions.js +0 -34
  184. package/dist/components/settings/security/change-password.js +0 -192
  185. package/dist/components/settings/security/delete-user.js +0 -97
  186. package/dist/components/settings/security/linked-account.js +0 -62
  187. package/dist/components/settings/security/linked-accounts.js +0 -45
  188. package/dist/components/settings/security/passkey.js +0 -43
  189. package/dist/components/settings/security/passkeys.js +0 -53
  190. package/dist/components/settings/security/security-settings.js +0 -25
  191. package/dist/components/settings/settings.js +0 -45
  192. package/dist/components/user/switch-account-item.js +0 -20
  193. package/dist/components/user/switch-account-menu.js +0 -28
  194. package/dist/components/user/user-avatar.js +0 -29
  195. package/dist/components/user/user-button.js +0 -91
  196. package/dist/components/user/user-view.js +0 -37
  197. package/dist/core.d.ts +0 -1
  198. package/dist/core.js +0 -1
  199. package/dist/react-exports.d.ts +0 -1
  200. package/dist/react-exports.js +0 -1
  201. package/src/components/auth/magic-link-button.tsx +0 -43
  202. package/src/components/auth/passkey-button.tsx +0 -36
  203. package/src/components/settings/account/user-profile.tsx +0 -218
  204. package/src/components/settings/security/passkeys.tsx +0 -104
  205. package/src/core.ts +0 -1
  206. package/src/react-exports.ts +0 -1
  207. /package/dist/components/{settings/security → auth/passkey}/passkey.d.ts +0 -0
  208. /package/dist/components/{settings → auth/settings}/account/change-avatar.d.ts +0 -0
  209. /package/dist/components/{settings → auth/settings}/security/active-session.d.ts +0 -0
  210. /package/dist/components/{settings → auth/settings}/security/linked-account.d.ts +0 -0
  211. /package/dist/components/{settings → auth/settings}/settings.d.ts +0 -0
  212. /package/dist/components/{user → auth/user}/user-avatar.d.ts +0 -0
  213. /package/dist/components/{user → auth/user}/user-view.d.ts +0 -0
@@ -1,235 +1,201 @@
1
- import { FieldSeparator as e } from "./field-separator.js";
2
- import { MagicLinkButton as t } from "./magic-link-button.js";
1
+ import { AdditionalField as e } from "./additional-field.js";
2
+ import { FieldSeparator as t } from "./field-separator.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";
9
- import { useDebouncer as C } from "@tanstack/react-pacer";
4
+ import { authMutationKeys as r, parseAdditionalFieldValue as i } from "@better-auth-ui/core";
5
+ import { useAuth as a, useSignUpEmail as o } from "@better-auth-ui/react";
6
+ import { Eye as s, EyeSlash as c } from "@gravity-ui/icons";
7
+ import { Button as l, Card as u, Description as d, FieldError as f, Form as p, Input as m, InputGroup as h, Label as g, Link as _, Spinner as v, TextField as y, cn as b, toast as x } from "@heroui/react";
8
+ import { useState as S } from "react";
9
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
10
+ import { useIsMutating as E } from "@tanstack/react-query";
10
11
  //#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) => {
13
- if (!e.trim()) {
14
- K();
15
- return;
16
- }
17
- U({ username: e.trim() });
18
- }, { wait: 500 });
19
- function oe(e) {
20
- H(e), K(), P?.isUsernameAvailable && q.maybeExecute(e);
21
- }
22
- let { mutate: se, isPending: ce } = te({
12
+ function D({ className: D, socialLayout: O, socialPosition: k = "bottom", variant: A, ...j }) {
13
+ let { additionalFields: M, authClient: ee, basePaths: N, emailAndPassword: P, localization: F, plugins: I, redirectTo: L, socialProviders: R, viewPaths: z, navigate: B } = a(), [V, H] = S(""), [U, W] = S(""), { mutate: G, isPending: K } = o(ee, {
23
14
  onError: (e) => {
24
- R(""), B(""), h.danger(e.error?.message || e.message);
15
+ H(""), W(""), x.danger(e.error?.message || e.message);
25
16
  },
26
17
  onSuccess: () => {
27
- k?.requireEmailVerification ? (h.success(A.auth.verifyYourEmail), I({ to: `${O.auth}/${F.auth.signIn}` })) : I({ to: M });
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);
18
+ P?.requireEmailVerification ? (x.success(F.auth.verifyYourEmail), B({ to: `${N.auth}/${z.auth.signIn}` })) : B({ to: L });
35
19
  }
36
- }), [X, de] = y(!1), [Z, fe] = y(!1), Q = ce || ue || le, pe = (e) => {
20
+ }), [q, J] = S(!1), [Y, X] = S(!1), Z = E({ mutationKey: r.signIn.all }) + E({ mutationKey: r.signUp.all }) > 0, Q = async (e) => {
37
21
  e.preventDefault();
38
- 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("");
22
+ let t = new FormData(e.currentTarget), n = t.get("name") ?? "", r = t.get("email");
23
+ if (P?.confirmPassword && V !== U) {
24
+ x.danger(F.auth.passwordsDoNotMatch), H(""), W("");
41
25
  return;
42
26
  }
43
- se({
27
+ let a = {};
28
+ for (let e of M ?? []) {
29
+ if (!e.signUp || e.readOnly) continue;
30
+ let n = i(e, t.get(e.name));
31
+ if (e.validate) try {
32
+ await e.validate(n);
33
+ } catch (e) {
34
+ x.danger(e instanceof Error ? e.message : String(e));
35
+ return;
36
+ }
37
+ n !== void 0 && (a[e.name] = n);
38
+ }
39
+ G({
44
40
  name: n,
45
41
  email: r,
46
- password: L,
47
- ...P?.enabled ? {
48
- username: V.trim(),
49
- ...P.displayUsername ? { displayUsername: V.trim() } : {}
50
- } : {}
42
+ password: V,
43
+ ...a
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),
55
- variant: D,
56
- ...ae,
45
+ }, $ = P?.enabled && !!R?.length;
46
+ return /* @__PURE__ */ T(u, {
47
+ className: b("w-full max-w-sm gap-4 md:p-6", D),
48
+ variant: A,
49
+ ...j,
57
50
  children: [
58
- /* @__PURE__ */ _(o.Header, { children: /* @__PURE__ */ _(o.Title, {
51
+ /* @__PURE__ */ w(u.Header, { children: /* @__PURE__ */ w(u.Title, {
59
52
  className: "text-xl font-semibold mb-1",
60
- children: A.auth.signUp
53
+ children: F.auth.signUp
61
54
  }) }),
62
- /* @__PURE__ */ v(o.Content, {
55
+ /* @__PURE__ */ T(u.Content, {
63
56
  className: "gap-4",
64
57
  children: [
65
- E === "top" && /* @__PURE__ */ v(g, { children: [!!N?.length && /* @__PURE__ */ _(n, {
66
- isPending: Q,
67
- socialLayout: T,
68
- signInSocial: Y
69
- }), $ && /* @__PURE__ */ _(e, { children: A.auth.or })] }),
70
- k?.enabled && /* @__PURE__ */ v(c, {
71
- onSubmit: pe,
58
+ k === "top" && /* @__PURE__ */ T(C, { children: [!!R?.length && /* @__PURE__ */ w(n, { socialLayout: O }), $ && /* @__PURE__ */ w(t, { children: F.auth.or })] }),
59
+ P?.enabled && /* @__PURE__ */ T(p, {
60
+ onSubmit: Q,
72
61
  className: "flex flex-col gap-4",
73
62
  children: [
74
- /* @__PURE__ */ v(p, {
63
+ P.name !== !1 && /* @__PURE__ */ T(y, {
75
64
  name: "name",
76
65
  type: "text",
77
66
  autoComplete: "name",
78
- isDisabled: Q,
67
+ isDisabled: Z,
79
68
  children: [
80
- /* @__PURE__ */ _(d, { children: A.auth.name }),
81
- /* @__PURE__ */ _(l, {
82
- placeholder: A.auth.namePlaceholder,
69
+ /* @__PURE__ */ w(g, { children: F.auth.name }),
70
+ /* @__PURE__ */ w(m, {
71
+ placeholder: F.auth.namePlaceholder,
83
72
  required: !0,
84
- variant: D === "transparent" ? "primary" : "secondary"
85
- }),
86
- /* @__PURE__ */ _(s, {})
87
- ]
88
- }),
89
- P?.enabled && /* @__PURE__ */ v(p, {
90
- name: "username",
91
- type: "text",
92
- autoComplete: "username",
93
- minLength: P.minUsernameLength,
94
- maxLength: P.maxUsernameLength,
95
- isDisabled: Q,
96
- value: V,
97
- onChange: oe,
98
- isInvalid: !!G || W && !W.available,
99
- children: [
100
- /* @__PURE__ */ _(d, { children: A.auth.username }),
101
- /* @__PURE__ */ v(u, {
102
- variant: D === "transparent" ? "primary" : "secondary",
103
- children: [/* @__PURE__ */ _(u.Input, {
104
- placeholder: A.auth.usernamePlaceholder,
105
- required: !0
106
- }), P.isUsernameAvailable && V.trim() && /* @__PURE__ */ _(u.Suffix, {
107
- className: "px-2",
108
- children: W?.available ? /* @__PURE__ */ _(ie, { className: "text-success" }) : G || W?.available === !1 ? /* @__PURE__ */ _(S, { className: "text-danger" }) : /* @__PURE__ */ _(f, {
109
- size: "sm",
110
- color: "current"
111
- })
112
- })]
73
+ variant: A === "transparent" ? "primary" : "secondary"
113
74
  }),
114
- /* @__PURE__ */ _(s, { children: G?.error?.message || G?.message || W?.available === !1 && A.auth.usernameTaken })
75
+ /* @__PURE__ */ w(f, {})
115
76
  ]
116
77
  }),
117
- /* @__PURE__ */ v(p, {
78
+ /* @__PURE__ */ T(y, {
118
79
  name: "email",
119
80
  type: "email",
120
81
  autoComplete: "email",
121
- isDisabled: Q,
82
+ isDisabled: Z,
122
83
  children: [
123
- /* @__PURE__ */ _(d, { children: A.auth.email }),
124
- /* @__PURE__ */ _(l, {
125
- placeholder: A.auth.emailPlaceholder,
84
+ /* @__PURE__ */ w(g, { children: F.auth.email }),
85
+ /* @__PURE__ */ w(m, {
86
+ placeholder: F.auth.emailPlaceholder,
126
87
  required: !0,
127
- variant: D === "transparent" ? "primary" : "secondary"
88
+ variant: A === "transparent" ? "primary" : "secondary"
128
89
  }),
129
- /* @__PURE__ */ _(s, {})
90
+ /* @__PURE__ */ w(f, {})
130
91
  ]
131
92
  }),
132
- /* @__PURE__ */ v(p, {
133
- minLength: k?.minPasswordLength,
134
- maxLength: k?.maxPasswordLength,
93
+ M?.map((t) => t.signUp === "above" && /* @__PURE__ */ w(e, {
94
+ name: t.name,
95
+ field: t,
96
+ isPending: Z,
97
+ variant: A
98
+ }, t.name)),
99
+ /* @__PURE__ */ T(y, {
100
+ minLength: P?.minPasswordLength,
101
+ maxLength: P?.maxPasswordLength,
135
102
  name: "password",
136
103
  autoComplete: "new-password",
137
- isDisabled: Q,
138
- value: L,
139
- onChange: R,
104
+ isDisabled: Z,
105
+ value: V,
106
+ onChange: H,
140
107
  children: [
141
- /* @__PURE__ */ _(d, { children: A.auth.password }),
142
- /* @__PURE__ */ v(u, {
143
- variant: D === "transparent" ? "primary" : "secondary",
144
- children: [/* @__PURE__ */ _(u.Input, {
145
- placeholder: A.auth.passwordPlaceholder,
146
- type: X ? "text" : "password",
108
+ /* @__PURE__ */ w(g, { children: F.auth.password }),
109
+ /* @__PURE__ */ T(h, {
110
+ variant: A === "transparent" ? "primary" : "secondary",
111
+ children: [/* @__PURE__ */ w(h.Input, {
112
+ placeholder: F.auth.passwordPlaceholder,
113
+ type: q ? "text" : "password",
147
114
  name: "password",
148
115
  required: !0
149
- }), /* @__PURE__ */ _(u.Suffix, {
116
+ }), /* @__PURE__ */ w(h.Suffix, {
150
117
  className: "px-0",
151
- children: /* @__PURE__ */ _(a, {
118
+ children: /* @__PURE__ */ w(l, {
152
119
  isIconOnly: !0,
153
- "aria-label": X ? A.auth.hidePassword : A.auth.showPassword,
120
+ "aria-label": q ? F.auth.hidePassword : F.auth.showPassword,
154
121
  size: "sm",
155
122
  variant: "ghost",
156
- onPress: () => de(!X),
157
- isDisabled: Q,
158
- children: _(X ? x : b, {})
123
+ onPress: () => J(!q),
124
+ isDisabled: Z,
125
+ children: w(q ? c : s, {})
159
126
  })
160
127
  })]
161
128
  }),
162
- /* @__PURE__ */ _(s, {})
129
+ /* @__PURE__ */ w(f, {})
163
130
  ]
164
131
  }),
165
- k?.confirmPassword && /* @__PURE__ */ v(p, {
166
- minLength: k?.minPasswordLength,
167
- maxLength: k?.maxPasswordLength,
132
+ P?.confirmPassword && /* @__PURE__ */ T(y, {
133
+ minLength: P?.minPasswordLength,
134
+ maxLength: P?.maxPasswordLength,
168
135
  name: "confirmPassword",
169
136
  autoComplete: "new-password",
170
- isDisabled: Q,
171
- value: z,
172
- onChange: B,
137
+ isDisabled: Z,
138
+ value: U,
139
+ onChange: W,
173
140
  children: [
174
- /* @__PURE__ */ _(d, { children: A.auth.confirmPassword }),
175
- /* @__PURE__ */ v(u, {
176
- variant: D === "transparent" ? "primary" : "secondary",
177
- children: [/* @__PURE__ */ _(u.Input, {
141
+ /* @__PURE__ */ w(g, { children: F.auth.confirmPassword }),
142
+ /* @__PURE__ */ T(h, {
143
+ variant: A === "transparent" ? "primary" : "secondary",
144
+ children: [/* @__PURE__ */ w(h.Input, {
178
145
  name: "confirmPassword",
179
- placeholder: A.auth.confirmPasswordPlaceholder,
180
- type: Z ? "text" : "password",
146
+ placeholder: F.auth.confirmPasswordPlaceholder,
147
+ type: Y ? "text" : "password",
181
148
  required: !0
182
- }), /* @__PURE__ */ _(u.Suffix, {
149
+ }), /* @__PURE__ */ w(h.Suffix, {
183
150
  className: "px-0",
184
- children: /* @__PURE__ */ _(a, {
151
+ children: /* @__PURE__ */ w(l, {
185
152
  isIconOnly: !0,
186
- "aria-label": Z ? A.auth.hidePassword : A.auth.showPassword,
153
+ "aria-label": Y ? F.auth.hidePassword : F.auth.showPassword,
187
154
  size: "sm",
188
155
  variant: "ghost",
189
- onPress: () => fe(!Z),
190
- isDisabled: Q,
191
- children: _(Z ? x : b, {})
156
+ onPress: () => X(!Y),
157
+ isDisabled: Z,
158
+ children: w(Y ? c : s, {})
192
159
  })
193
160
  })]
194
161
  }),
195
- /* @__PURE__ */ _(s, {})
162
+ /* @__PURE__ */ w(f, {})
196
163
  ]
197
164
  }),
198
- /* @__PURE__ */ v("div", {
165
+ M?.map((t) => t.signUp && t.signUp !== "above" && /* @__PURE__ */ w(e, {
166
+ name: t.name,
167
+ field: t,
168
+ isPending: Z,
169
+ variant: A
170
+ }, t.name)),
171
+ /* @__PURE__ */ T("div", {
199
172
  className: "flex flex-col gap-3",
200
- children: [/* @__PURE__ */ v(a, {
173
+ children: [/* @__PURE__ */ T(l, {
201
174
  type: "submit",
202
175
  className: "w-full",
203
- isPending: Q,
204
- children: [Q && /* @__PURE__ */ _(f, {
176
+ isPending: Z,
177
+ children: [K && /* @__PURE__ */ w(v, {
205
178
  color: "current",
206
179
  size: "sm"
207
- }), A.auth.signUp]
208
- }), j && /* @__PURE__ */ _(t, {
209
- view: "signUp",
210
- isPending: Q
211
- })]
180
+ }), F.auth.signUp]
181
+ }), I.flatMap((e) => e.authButtons?.map((t, n) => /* @__PURE__ */ w(t, { view: "signUp" }, `${e.id}-${n.toString()}`)))]
212
182
  })
213
183
  ]
214
184
  }),
215
- E === "bottom" && /* @__PURE__ */ v(g, { children: [$ && /* @__PURE__ */ _(e, { children: A.auth.or }), !!N?.length && /* @__PURE__ */ _(n, {
216
- socialLayout: T,
217
- signInSocial: Y,
218
- isPending: Q
219
- })] })
185
+ k === "bottom" && /* @__PURE__ */ T(C, { children: [$ && /* @__PURE__ */ w(t, { children: F.auth.or }), !!R?.length && /* @__PURE__ */ w(n, { socialLayout: O })] })
220
186
  ]
221
187
  }),
222
- /* @__PURE__ */ _(o.Footer, {
223
- className: "flex-col",
224
- children: /* @__PURE__ */ v(ne, {
188
+ /* @__PURE__ */ w(u.Footer, {
189
+ className: "flex-col gap-3",
190
+ children: /* @__PURE__ */ T(d, {
225
191
  className: "text-sm",
226
192
  children: [
227
- A.auth.alreadyHaveAnAccount,
193
+ F.auth.alreadyHaveAnAccount,
228
194
  " ",
229
- /* @__PURE__ */ _(re, {
230
- href: `${O.auth}/${F.auth.signIn}`,
231
- className: "text-accent decoration-accent no-underline hover:underline",
232
- children: A.auth.signIn
195
+ /* @__PURE__ */ w(_, {
196
+ href: `${N.auth}/${z.auth.signIn}`,
197
+ className: "text-accent no-underline hover:underline decoration-accent-hover",
198
+ children: F.auth.signIn
233
199
  })
234
200
  ]
235
201
  })
@@ -238,4 +204,4 @@ function w({ className: w, socialLayout: T, socialPosition: E = "bottom", varian
238
204
  });
239
205
  }
240
206
  //#endregion
241
- export { w as SignUp };
207
+ export { D as SignUp };
@@ -7,10 +7,7 @@ export type AppearanceProps = {
7
7
  * Renders a theme selector card with visual theme previews.
8
8
  *
9
9
  * Displays a card containing radio buttons for selecting between system, light,
10
- * and dark themes. Each option shows a visual preview of the theme. Only renders
11
- * if theme settings are configured (theme, setTheme, and themes are provided).
12
- *
13
- * @param className - Optional additional CSS class names for the card container.
14
- * @returns A JSX element containing the theme selector card, or null if theme settings are not configured.
10
+ * and dark themes. Each option shows a visual preview of the theme. Theme options
11
+ * are conditionally shown based on the `themes` array provided via the theme plugin.
15
12
  */
16
- export declare function Appearance({ className, variant, ...props }: AppearanceProps & CardProps): import("react/jsx-runtime").JSX.Element | null;
13
+ export declare function Appearance({ className, variant, ...props }: AppearanceProps & Omit<CardProps, "children">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,72 @@
1
+ import { themePlugin as e } from "../../../lib/auth/theme-plugin.js";
2
+ import { ThemePreviewDark as t, ThemePreviewLight as n, ThemePreviewSystem as r, useAuthPlugin as i } from "@better-auth-ui/react";
3
+ import { Display as a, Moon as o, Sun as s } from "@gravity-ui/icons";
4
+ import { Card as c, Label as l, Radio as u, RadioGroup as d, cn as f, useIsHydrated as p } from "@heroui/react";
5
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
6
+ //#region src/components/auth/theme/appearance.tsx
7
+ function g({ className: g, variant: _, ...v }) {
8
+ let { useTheme: y, localization: b } = i(e), { theme: x, setTheme: S, themes: C = [] } = y(), w = p();
9
+ return /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h2", {
10
+ className: f("text-sm font-semibold mb-3"),
11
+ children: b.appearance
12
+ }), /* @__PURE__ */ m(c, {
13
+ className: f("p-4 gap-4", g),
14
+ variant: _,
15
+ ...v,
16
+ children: /* @__PURE__ */ h(c.Content, { children: [/* @__PURE__ */ m(l, { children: b.theme }), /* @__PURE__ */ m(d, {
17
+ variant: _ === "transparent" ? "secondary" : "primary",
18
+ value: w ? x : "",
19
+ onChange: S,
20
+ isDisabled: !w || !x,
21
+ children: /* @__PURE__ */ h("div", {
22
+ className: "grid gap-3 grid-cols-2 sm:grid-cols-3",
23
+ children: [
24
+ C.includes("system") && /* @__PURE__ */ m(u, {
25
+ value: "system",
26
+ className: f("mt-0 px-4 pb-4 pt-3 rounded-xl", "border border-transparent data-[selected=true]:border-accent data-[selected=true]:bg-accent/10", "data-[focus-visible=true]:border-accent data-[focus-visible=true]:bg-accent/10", _ === "transparent" ? "bg-surface" : "bg-surface-secondary"),
27
+ children: /* @__PURE__ */ h(u.Content, {
28
+ className: "gap-2",
29
+ children: [/* @__PURE__ */ h("div", {
30
+ className: "flex gap-2 justify-between",
31
+ children: [/* @__PURE__ */ h(l, {
32
+ className: "flex gap-2 items-center",
33
+ children: [/* @__PURE__ */ m(a, { className: "text-muted" }), b.system]
34
+ }), /* @__PURE__ */ m(u.Control, { children: /* @__PURE__ */ m(u.Indicator, {}) })]
35
+ }), /* @__PURE__ */ m(r, { className: "w-full" })]
36
+ })
37
+ }),
38
+ C.includes("light") && /* @__PURE__ */ m(u, {
39
+ value: "light",
40
+ className: f("mt-0 px-4 pb-4 pt-3 rounded-xl", "border border-transparent data-[selected=true]:border-accent data-[selected=true]:bg-accent/10", "data-[focus-visible=true]:border-accent data-[focus-visible=true]:bg-accent/10", _ === "transparent" ? "bg-surface" : "bg-surface-secondary"),
41
+ children: /* @__PURE__ */ h(u.Content, {
42
+ className: "gap-2",
43
+ children: [/* @__PURE__ */ h("div", {
44
+ className: "flex gap-2 justify-between",
45
+ children: [/* @__PURE__ */ h(l, {
46
+ className: "flex gap-2 items-center",
47
+ children: [/* @__PURE__ */ m(s, { className: "text-muted" }), b.light]
48
+ }), /* @__PURE__ */ m(u.Control, { children: /* @__PURE__ */ m(u.Indicator, {}) })]
49
+ }), /* @__PURE__ */ m(n, { className: "w-full" })]
50
+ })
51
+ }),
52
+ C.includes("dark") && /* @__PURE__ */ m(u, {
53
+ value: "dark",
54
+ className: f("mt-0 px-4 pb-4 pt-3 rounded-xl", "border border-transparent data-[selected=true]:border-accent data-[selected=true]:bg-accent/10", "data-[focus-visible=true]:border-accent data-[focus-visible=true]:bg-accent/10", _ === "transparent" ? "bg-surface" : "bg-surface-secondary"),
55
+ children: /* @__PURE__ */ h(u.Content, {
56
+ className: "gap-2",
57
+ children: [/* @__PURE__ */ h("div", {
58
+ className: "flex gap-2 justify-between",
59
+ children: [/* @__PURE__ */ h(l, {
60
+ className: "flex gap-2 items-center",
61
+ children: [/* @__PURE__ */ m(o, { className: "text-muted" }), b.dark]
62
+ }), /* @__PURE__ */ m(u.Control, { children: /* @__PURE__ */ m(u.Indicator, {}) })]
63
+ }), /* @__PURE__ */ m(t, { className: "w-full" })]
64
+ })
65
+ })
66
+ ]
67
+ })
68
+ })] })
69
+ })] });
70
+ }
71
+ //#endregion
72
+ export { g as Appearance };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Theme toggle dropdown item used inside `UserButton`. Callers are responsible
3
+ * for ensuring theming is configured before rendering this component.
4
+ */
5
+ export declare function ThemeToggleItem(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,58 @@
1
+ import { themePlugin as e } from "../../../lib/auth/theme-plugin.js";
2
+ import { useAuthPlugin as t } from "@better-auth-ui/react";
3
+ import { Display as n, Moon as r, Sun as i } from "@gravity-ui/icons";
4
+ import { Dropdown as a, Label as o, Tabs as s } from "@heroui/react";
5
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
+ //#region src/components/auth/theme/theme-toggle-item.tsx
7
+ var u = "[role=\"tab\"][aria-selected=\"true\"]";
8
+ function d() {
9
+ let { useTheme: d, localization: f } = t(e), { theme: p, setTheme: m, themes: h = [] } = d();
10
+ return /* @__PURE__ */ l(a.Item, {
11
+ className: "py-1 pe-2",
12
+ onFocus: (e) => {
13
+ e.target === e.currentTarget && e.currentTarget.querySelector(u)?.focus({ preventScroll: !0 });
14
+ },
15
+ shouldCloseOnSelect: !1,
16
+ children: [/* @__PURE__ */ c(o, { children: f.theme }), /* @__PURE__ */ c(s, {
17
+ className: "ml-auto",
18
+ selectedKey: p,
19
+ onSelectionChange: (e) => m(e),
20
+ children: /* @__PURE__ */ c(s.ListContainer, {
21
+ onKeyDown: (e) => {
22
+ if (e.key !== "ArrowUp" && e.key !== "ArrowDown") return;
23
+ let t = e.target;
24
+ if (t.getAttribute("role") !== "tab") return;
25
+ let n = t.closest("[role=\"menuitem\"]"), r = n?.closest("[role=\"menu\"]");
26
+ if (!n || !r) return;
27
+ let i = Array.from(r.querySelectorAll("[role=\"menuitem\"]:not([data-disabled])")), a = i.indexOf(n);
28
+ if (a === -1) return;
29
+ let o = i[e.key === "ArrowDown" ? a + 1 : a - 1];
30
+ o && (e.preventDefault(), o.focus());
31
+ },
32
+ children: /* @__PURE__ */ l(s.List, {
33
+ "aria-label": f.theme,
34
+ className: "*:h-5 *:w-5 *:p-0",
35
+ children: [
36
+ h.includes("system") && /* @__PURE__ */ l(s.Tab, {
37
+ id: "system",
38
+ "aria-label": f.system,
39
+ children: [/* @__PURE__ */ c(n, { className: "size-3" }), /* @__PURE__ */ c(s.Indicator, {})]
40
+ }),
41
+ h.includes("light") && /* @__PURE__ */ l(s.Tab, {
42
+ id: "light",
43
+ "aria-label": f.light,
44
+ children: [/* @__PURE__ */ c(i, { className: "size-3" }), /* @__PURE__ */ c(s.Indicator, {})]
45
+ }),
46
+ h.includes("dark") && /* @__PURE__ */ l(s.Tab, {
47
+ id: "dark",
48
+ "aria-label": f.dark,
49
+ children: [/* @__PURE__ */ c(r, { className: "size-3" }), /* @__PURE__ */ c(s.Indicator, {})]
50
+ })
51
+ ]
52
+ })
53
+ })
54
+ })]
55
+ });
56
+ }
57
+ //#endregion
58
+ export { d as ThemeToggleItem };
@@ -0,0 +1,29 @@
1
+ import { useAuth as e, useSession as t } from "@better-auth-ui/react";
2
+ import { Person as n } from "@gravity-ui/icons";
3
+ import { Avatar as r, Skeleton as i, cn as a } from "@heroui/react";
4
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
5
+ //#region src/components/auth/user/user-avatar.tsx
6
+ function c({ className: c, fallback: l, isPending: u, user: d, size: f = "sm", style: p, ...m }) {
7
+ let { authClient: h } = e(), { data: g, isPending: _ } = t(h, { enabled: !d && !u });
8
+ if ((u || _) && !d) return /* @__PURE__ */ o(i, {
9
+ className: a("rounded-full", f === "sm" ? "size-8" : f === "md" ? "size-10" : "size-12", c),
10
+ style: p
11
+ });
12
+ let v = d ?? g?.user, y = (v?.username || v?.name || v?.email)?.slice(0, 2).toUpperCase();
13
+ return /* @__PURE__ */ s(r, {
14
+ size: f,
15
+ className: a("rounded-full", c),
16
+ style: p,
17
+ ...m,
18
+ children: [/* @__PURE__ */ o(r.Image, {
19
+ alt: v?.displayUsername || v?.name || v?.email,
20
+ src: v?.image ?? void 0
21
+ }), /* @__PURE__ */ o(r.Fallback, {
22
+ className: a(f === "lg" ? "text-xl" : f === "md" ? "text-base" : "text-sm"),
23
+ delayMs: v?.image ? 600 : void 0,
24
+ children: l || y || /* @__PURE__ */ o(n, { className: "size-4" })
25
+ })]
26
+ });
27
+ }
28
+ //#endregion
29
+ export { c as UserAvatar };
@@ -7,19 +7,15 @@ export type UserButtonProps = {
7
7
  * @default "bottom"
8
8
  */
9
9
  placement?: DropdownPopoverProps["placement"];
10
- themeToggle?: boolean;
11
10
  variant?: ButtonProps["variant"];
12
11
  };
13
12
  /**
14
- * Render a user account dropdown button that shows account actions, session switching, and theme controls.
15
- *
16
- * Renders either an icon-only trigger or a full button showing the current user state; its dropdown contains account settings, multi-session switching (when enabled), theme selection (when enabled), and sign-in/sign-out flows depending on authentication state.
13
+ * Render a user account dropdown button that shows account actions.
17
14
  *
18
15
  * @param className - Additional CSS classes applied to the trigger element
19
16
  * @param placement - Dropdown popover placement (e.g., "bottom", "top-start", "bottom-end")
20
17
  * @param size - "icon" renders an avatar-only trigger; "default" renders a button with label and chevron
21
18
  * @param variant - Button visual variant passed to the underlying Button component
22
- * @param themeToggle - When true and theming is available, show theme selection controls in the menu
23
19
  * @returns The user button and its dropdown menu as a JSX element
24
20
  */
25
- export declare function UserButton({ className, placement, size, variant, themeToggle }: UserButtonProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare function UserButton({ className, placement, size, variant }: UserButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,55 @@
1
+ import { UserAvatar as e } from "./user-avatar.js";
2
+ import { UserView as t } from "./user-view.js";
3
+ import { useAuth as n, useSession as r } from "@better-auth-ui/react";
4
+ import { ArrowRightFromSquare as i, ArrowRightToSquare as a, ChevronsExpandVertical as o, Gear as s, PersonPlus as c } from "@gravity-ui/icons";
5
+ import { Button as l, Dropdown as u, Label as d, Separator as f, cn as p } from "@heroui/react";
6
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
7
+ //#region src/components/auth/user/user-button.tsx
8
+ function _({ className: _, placement: v = "bottom", size: y = "default", variant: b = "ghost" }) {
9
+ let { authClient: x, basePaths: S, viewPaths: C, localization: w, plugins: T } = n(), { data: E, isPending: D } = r(x), O = T.flatMap((e) => e.userMenuItems?.map((t, n) => /* @__PURE__ */ h(t, {}, `${e.id}-${n.toString()}`)) ?? []);
10
+ return /* @__PURE__ */ g(u, { children: [y === "icon" ? /* @__PURE__ */ h(u.Trigger, {
11
+ className: p("rounded-full", _),
12
+ children: /* @__PURE__ */ h(e, {})
13
+ }) : /* @__PURE__ */ g(l, {
14
+ variant: b,
15
+ className: p("h-auto font-normal justify-start px-3 py-2 text-left", _),
16
+ children: [E || D ? /* @__PURE__ */ h(t, { isPending: D }) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(e, {}), /* @__PURE__ */ h("p", {
17
+ className: "text-sm font-medium",
18
+ children: w.auth.account
19
+ })] }), /* @__PURE__ */ h(o, { className: "ml-auto size-3.5" })]
20
+ }), /* @__PURE__ */ g(u.Popover, {
21
+ placement: v,
22
+ className: "min-w-40 md:min-w-56 max-w-[48svw]",
23
+ children: [E && /* @__PURE__ */ h("div", {
24
+ className: "px-3 pt-3 pb-1",
25
+ children: /* @__PURE__ */ h(t, {})
26
+ }), /* @__PURE__ */ h(u.Menu, { children: E ? /* @__PURE__ */ g(m, { children: [
27
+ /* @__PURE__ */ g(u.Item, {
28
+ textValue: w.settings.settings,
29
+ href: `${S.settings}/${C.settings.account}`,
30
+ children: [/* @__PURE__ */ h(s, { className: "text-muted" }), /* @__PURE__ */ h(d, { children: w.settings.settings })]
31
+ }),
32
+ O,
33
+ /* @__PURE__ */ h(f, {}),
34
+ /* @__PURE__ */ g(u.Item, {
35
+ textValue: w.auth.signOut,
36
+ href: `${S.auth}/${C.auth.signOut}`,
37
+ children: [/* @__PURE__ */ h(i, { className: "text-muted" }), /* @__PURE__ */ h(d, { children: w.auth.signOut })]
38
+ })
39
+ ] }) : /* @__PURE__ */ g(m, { children: [
40
+ /* @__PURE__ */ g(u.Item, {
41
+ textValue: w.auth.signIn,
42
+ href: `${S.auth}/${C.auth.signIn}`,
43
+ children: [/* @__PURE__ */ h(a, { className: "text-muted" }), /* @__PURE__ */ h(d, { children: w.auth.signIn })]
44
+ }),
45
+ /* @__PURE__ */ g(u.Item, {
46
+ textValue: w.auth.signUp,
47
+ href: `${S.auth}/${C.auth.signUp}`,
48
+ children: [/* @__PURE__ */ h(c, { className: "text-muted" }), /* @__PURE__ */ h(d, { children: w.auth.signUp })]
49
+ }),
50
+ O
51
+ ] }) })]
52
+ })] });
53
+ }
54
+ //#endregion
55
+ export { _ as UserButton };