@better-auth-ui/react 1.6.8 → 1.6.10

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 (233) hide show
  1. package/dist/components/auth/auth-context.d.ts +3 -0
  2. package/dist/components/auth/email/email-localization.d.ts +11 -3
  3. package/dist/components/auth/email/index.d.ts +1 -0
  4. package/dist/components/auth/email/organization-invitation.d.ts +121 -0
  5. package/dist/components/mutation-invalidator.d.ts +1 -0
  6. package/dist/email.js +1348 -11
  7. package/dist/hooks/auth/use-authenticate.d.ts +1 -1
  8. package/dist/hooks/auth/use-user.d.ts +12 -12
  9. package/dist/hooks/use-auth-query.d.ts +1 -1
  10. package/dist/index.d.ts +3 -0
  11. package/dist/index.js +2469 -79
  12. package/dist/lib/auth-client.d.ts +4 -1
  13. package/dist/lib/auth-plugin.d.ts +16 -0
  14. package/dist/lib/auth-server.d.ts +8 -1
  15. package/dist/lib/settings-tab.d.ts +19 -0
  16. package/dist/mutations/api-key/create-api-key-mutation.d.ts +6 -4
  17. package/dist/mutations/api-key/delete-api-key-mutation.d.ts +7 -3
  18. package/dist/mutations/auth/sign-in-email-mutation.d.ts +5 -5
  19. package/dist/mutations/auth/sign-out-mutation.d.ts +6 -4
  20. package/dist/mutations/auth/sign-up-email-mutation.d.ts +5 -5
  21. package/dist/mutations/multi-session/revoke-multi-session-mutation.d.ts +5 -5
  22. package/dist/mutations/multi-session/set-active-session-mutation.d.ts +5 -6
  23. package/dist/mutations/organization/accept-invitation-mutation.d.ts +43 -0
  24. package/dist/mutations/organization/cancel-invitation-mutation.d.ts +25 -0
  25. package/dist/mutations/organization/check-slug-mutation.d.ts +21 -0
  26. package/dist/mutations/organization/create-organization-mutation.d.ts +39 -0
  27. package/dist/mutations/organization/delete-organization-mutation.d.ts +21 -0
  28. package/dist/mutations/organization/index.d.ts +12 -0
  29. package/dist/mutations/organization/invite-member-mutation.d.ts +43 -0
  30. package/dist/mutations/organization/leave-organization-mutation.d.ts +65 -0
  31. package/dist/mutations/organization/reject-invitation-mutation.d.ts +31 -0
  32. package/dist/mutations/organization/remove-member-mutation.d.ts +35 -0
  33. package/dist/mutations/organization/set-active-organization-mutation.d.ts +71 -0
  34. package/dist/mutations/organization/update-member-role-mutation.d.ts +31 -0
  35. package/dist/mutations/organization/update-organization-mutation.d.ts +21 -0
  36. package/dist/mutations/passkey/add-passkey-mutation.d.ts +5 -5
  37. package/dist/mutations/passkey/delete-passkey-mutation.d.ts +5 -5
  38. package/dist/mutations/passkey/sign-in-passkey-mutation.d.ts +5 -5
  39. package/dist/mutations/settings/change-email-mutation.d.ts +6 -5
  40. package/dist/mutations/settings/revoke-session-mutation.d.ts +5 -5
  41. package/dist/mutations/settings/unlink-account-mutation.d.ts +5 -5
  42. package/dist/mutations/settings/update-user-mutation.d.ts +5 -5
  43. package/dist/mutations/username/sign-in-username-mutation.d.ts +5 -5
  44. package/dist/plugins/captcha-plugin.d.ts +2 -2
  45. package/dist/plugins.js +27 -2
  46. package/dist/queries/api-key/list-api-keys-query.d.ts +17 -8
  47. package/dist/queries/auth/session-query.d.ts +1 -1
  48. package/dist/queries/multi-session/list-device-sessions-query.d.ts +5 -5
  49. package/dist/queries/organization/active-organization-query.d.ts +39 -0
  50. package/dist/queries/organization/full-organization-query.d.ts +37 -0
  51. package/dist/queries/organization/has-permission-query.d.ts +21 -0
  52. package/dist/queries/organization/index.d.ts +7 -0
  53. package/dist/queries/organization/list-invitations-query.d.ts +29 -0
  54. package/dist/queries/organization/list-members-query.d.ts +61 -0
  55. package/dist/queries/organization/list-organizations-query.d.ts +22 -0
  56. package/dist/queries/organization/list-user-invitations-query.d.ts +29 -0
  57. package/dist/queries/passkey/list-passkeys-query.d.ts +5 -5
  58. package/dist/queries/settings/account-info-query.d.ts +1 -1
  59. package/dist/queries/settings/list-accounts-query.d.ts +1 -1
  60. package/dist/queries/settings/list-sessions-query.d.ts +1 -1
  61. package/dist/server/queries/api-key/list-api-keys-query.d.ts +83 -0
  62. package/dist/server/queries/multi-session/list-device-sessions-query.d.ts +4 -4
  63. package/dist/server/queries/organization/active-organization-query.d.ts +61 -0
  64. package/dist/server/queries/organization/full-organization-query.d.ts +42 -0
  65. package/dist/server/queries/organization/has-permission-query.d.ts +66 -0
  66. package/dist/server/queries/organization/list-invitations-query.d.ts +34 -0
  67. package/dist/server/queries/organization/list-members-query.d.ts +66 -0
  68. package/dist/server/queries/organization/list-organizations-query.d.ts +27 -0
  69. package/dist/server/queries/organization/list-user-invitations-query.d.ts +34 -0
  70. package/dist/server/queries/passkey/list-passkeys-query.d.ts +4 -4
  71. package/dist/server.d.ts +8 -0
  72. package/dist/server.js +131 -7
  73. package/dist/use-auth-plugin-ClcP84Uz.js +80 -0
  74. package/package.json +19 -16
  75. package/src/components/auth/auth-context.tsx +7 -0
  76. package/src/components/auth/auth-provider.tsx +19 -31
  77. package/src/components/auth/email/email-localization.tsx +5 -3
  78. package/src/components/auth/email/index.ts +1 -0
  79. package/src/components/auth/email/organization-invitation.tsx +454 -0
  80. package/src/components/mutation-invalidator.tsx +67 -0
  81. package/src/index.ts +3 -0
  82. package/src/lib/auth-client.ts +7 -0
  83. package/src/lib/auth-plugin.ts +17 -0
  84. package/src/lib/auth-server.ts +17 -1
  85. package/src/lib/settings-tab.ts +21 -0
  86. package/src/mutations/api-key/create-api-key-mutation.ts +34 -19
  87. package/src/mutations/api-key/delete-api-key-mutation.ts +36 -19
  88. package/src/mutations/auth/sign-in-email-mutation.ts +18 -22
  89. package/src/mutations/auth/sign-out-mutation.ts +19 -13
  90. package/src/mutations/auth/sign-up-email-mutation.ts +18 -22
  91. package/src/mutations/multi-session/revoke-multi-session-mutation.ts +31 -20
  92. package/src/mutations/multi-session/set-active-session-mutation.ts +25 -44
  93. package/src/mutations/organization/accept-invitation-mutation.ts +71 -0
  94. package/src/mutations/organization/cancel-invitation-mutation.ts +67 -0
  95. package/src/mutations/organization/check-slug-mutation.ts +55 -0
  96. package/src/mutations/organization/create-organization-mutation.ts +71 -0
  97. package/src/mutations/organization/delete-organization-mutation.ts +71 -0
  98. package/src/mutations/organization/index.ts +12 -0
  99. package/src/mutations/organization/invite-member-mutation.ts +81 -0
  100. package/src/mutations/organization/leave-organization-mutation.ts +74 -0
  101. package/src/mutations/organization/reject-invitation-mutation.ts +64 -0
  102. package/src/mutations/organization/remove-member-mutation.ts +67 -0
  103. package/src/mutations/organization/set-active-organization-mutation.ts +142 -0
  104. package/src/mutations/organization/update-member-role-mutation.ts +81 -0
  105. package/src/mutations/organization/update-organization-mutation.ts +84 -0
  106. package/src/mutations/passkey/add-passkey-mutation.ts +28 -17
  107. package/src/mutations/passkey/delete-passkey-mutation.ts +27 -17
  108. package/src/mutations/passkey/sign-in-passkey-mutation.ts +18 -21
  109. package/src/mutations/settings/change-email-mutation.ts +22 -18
  110. package/src/mutations/settings/delete-user-mutation.ts +2 -2
  111. package/src/mutations/settings/revoke-session-mutation.ts +24 -19
  112. package/src/mutations/settings/unlink-account-mutation.ts +24 -17
  113. package/src/mutations/settings/update-user-mutation.ts +18 -30
  114. package/src/mutations/username/is-username-available-mutation.ts +2 -2
  115. package/src/mutations/username/sign-in-username-mutation.ts +20 -23
  116. package/src/queries/api-key/list-api-keys-query.ts +20 -8
  117. package/src/queries/multi-session/list-device-sessions-query.ts +2 -2
  118. package/src/queries/organization/active-organization-query.ts +140 -0
  119. package/src/queries/organization/full-organization-query.ts +113 -0
  120. package/src/queries/organization/has-permission-query.ts +124 -0
  121. package/src/queries/organization/index.ts +7 -0
  122. package/src/queries/organization/list-invitations-query.ts +133 -0
  123. package/src/queries/organization/list-members-query.ts +133 -0
  124. package/src/queries/organization/list-organizations-query.ts +122 -0
  125. package/src/queries/organization/list-user-invitations-query.ts +122 -0
  126. package/src/queries/passkey/list-passkeys-query.ts +2 -2
  127. package/src/server/queries/api-key/list-api-keys-query.ts +94 -0
  128. package/src/server/queries/multi-session/list-device-sessions-query.ts +2 -2
  129. package/src/server/queries/organization/active-organization-query.ts +92 -0
  130. package/src/server/queries/organization/full-organization-query.ts +64 -0
  131. package/src/server/queries/organization/has-permission-query.ts +66 -0
  132. package/src/server/queries/organization/list-invitations-query.ts +81 -0
  133. package/src/server/queries/organization/list-members-query.ts +75 -0
  134. package/src/server/queries/organization/list-organizations-query.ts +67 -0
  135. package/src/server/queries/organization/list-user-invitations-query.ts +68 -0
  136. package/src/server/queries/passkey/list-passkeys-query.ts +2 -2
  137. package/src/server.ts +8 -0
  138. package/dist/components/auth/auth-provider.js +0 -44
  139. package/dist/components/auth/email/email-changed.js +0 -156
  140. package/dist/components/auth/email/email-localization.js +0 -19
  141. package/dist/components/auth/email/email-styles.js +0 -104
  142. package/dist/components/auth/email/email-verification.js +0 -140
  143. package/dist/components/auth/email/index.js +0 -9
  144. package/dist/components/auth/email/magic-link.js +0 -141
  145. package/dist/components/auth/email/new-device.js +0 -223
  146. package/dist/components/auth/email/otp-email.js +0 -129
  147. package/dist/components/auth/email/password-changed.js +0 -159
  148. package/dist/components/auth/email/reset-password.js +0 -140
  149. package/dist/components/auth/fetch-options-provider.js +0 -30
  150. package/dist/components/icons/apple.js +0 -17
  151. package/dist/components/icons/atlassian.js +0 -39
  152. package/dist/components/icons/cognito.js +0 -20
  153. package/dist/components/icons/discord.js +0 -17
  154. package/dist/components/icons/dropbox.js +0 -17
  155. package/dist/components/icons/facebook.js +0 -20
  156. package/dist/components/icons/figma.js +0 -35
  157. package/dist/components/icons/github.js +0 -17
  158. package/dist/components/icons/gitlab.js +0 -31
  159. package/dist/components/icons/google.js +0 -40
  160. package/dist/components/icons/huggingface.js +0 -39
  161. package/dist/components/icons/index.js +0 -35
  162. package/dist/components/icons/kakao.js +0 -17
  163. package/dist/components/icons/kick.js +0 -21
  164. package/dist/components/icons/line.js +0 -17
  165. package/dist/components/icons/linear.js +0 -17
  166. package/dist/components/icons/linkedin.js +0 -34
  167. package/dist/components/icons/microsoft.js +0 -31
  168. package/dist/components/icons/naver.js +0 -17
  169. package/dist/components/icons/notion.js +0 -17
  170. package/dist/components/icons/paybin.js +0 -33
  171. package/dist/components/icons/paypal.js +0 -31
  172. package/dist/components/icons/polar.js +0 -25
  173. package/dist/components/icons/railway.js +0 -17
  174. package/dist/components/icons/reddit.js +0 -22
  175. package/dist/components/icons/roblox.js +0 -18
  176. package/dist/components/icons/salesforce.js +0 -17
  177. package/dist/components/icons/slack.js +0 -31
  178. package/dist/components/icons/spotify.js +0 -17
  179. package/dist/components/icons/tiktok.js +0 -24
  180. package/dist/components/icons/twitch.js +0 -44
  181. package/dist/components/icons/vercel.js +0 -17
  182. package/dist/components/icons/vk.js +0 -17
  183. package/dist/components/icons/wechat.js +0 -17
  184. package/dist/components/icons/x.js +0 -17
  185. package/dist/components/icons/zoom.js +0 -70
  186. package/dist/components/settings/account/theme-preview.js +0 -289
  187. package/dist/hooks/auth/use-authenticate.js +0 -23
  188. package/dist/hooks/auth/use-user.js +0 -11
  189. package/dist/hooks/use-auth-mutation.js +0 -11
  190. package/dist/hooks/use-auth-plugin.js +0 -10
  191. package/dist/hooks/use-auth-query.js +0 -15
  192. package/dist/lib/provider-icons.js +0 -76
  193. package/dist/lib/utils.js +0 -8
  194. package/dist/mutations/api-key/create-api-key-mutation.js +0 -29
  195. package/dist/mutations/api-key/delete-api-key-mutation.js +0 -29
  196. package/dist/mutations/auth/request-password-reset-mutation.js +0 -24
  197. package/dist/mutations/auth/reset-password-mutation.js +0 -24
  198. package/dist/mutations/auth/send-verification-email-mutation.js +0 -24
  199. package/dist/mutations/auth/sign-in-email-mutation.js +0 -29
  200. package/dist/mutations/auth/sign-in-social-mutation.js +0 -24
  201. package/dist/mutations/auth/sign-out-mutation.js +0 -28
  202. package/dist/mutations/auth/sign-up-email-mutation.js +0 -29
  203. package/dist/mutations/auth-mutation-options.js +0 -19
  204. package/dist/mutations/magic-link/sign-in-magic-link-mutation.js +0 -24
  205. package/dist/mutations/multi-session/revoke-multi-session-mutation.js +0 -29
  206. package/dist/mutations/multi-session/set-active-session-mutation.js +0 -31
  207. package/dist/mutations/passkey/add-passkey-mutation.js +0 -29
  208. package/dist/mutations/passkey/delete-passkey-mutation.js +0 -29
  209. package/dist/mutations/passkey/sign-in-passkey-mutation.js +0 -29
  210. package/dist/mutations/settings/change-email-mutation.js +0 -29
  211. package/dist/mutations/settings/change-password-mutation.js +0 -24
  212. package/dist/mutations/settings/delete-user-mutation.js +0 -24
  213. package/dist/mutations/settings/link-social-mutation.js +0 -24
  214. package/dist/mutations/settings/revoke-session-mutation.js +0 -29
  215. package/dist/mutations/settings/unlink-account-mutation.js +0 -29
  216. package/dist/mutations/settings/update-user-mutation.js +0 -35
  217. package/dist/mutations/username/is-username-available-mutation.js +0 -24
  218. package/dist/mutations/username/sign-in-username-mutation.js +0 -29
  219. package/dist/plugins/captcha-plugin.js +0 -29
  220. package/dist/queries/api-key/list-api-keys-query.js +0 -31
  221. package/dist/queries/auth/session-query.js +0 -30
  222. package/dist/queries/auth-query-options.js +0 -17
  223. package/dist/queries/multi-session/list-device-sessions-query.js +0 -31
  224. package/dist/queries/passkey/list-passkeys-query.js +0 -31
  225. package/dist/queries/settings/account-info-query.js +0 -31
  226. package/dist/queries/settings/list-accounts-query.js +0 -31
  227. package/dist/queries/settings/list-sessions-query.js +0 -31
  228. package/dist/server/queries/auth/session-query.js +0 -13
  229. package/dist/server/queries/multi-session/list-device-sessions-query.js +0 -12
  230. package/dist/server/queries/passkey/list-passkeys-query.js +0 -12
  231. package/dist/server/queries/settings/account-info-query.js +0 -12
  232. package/dist/server/queries/settings/list-accounts-query.js +0 -12
  233. package/dist/server/queries/settings/list-sessions-query.js +0 -12
@@ -1,44 +0,0 @@
1
- "use client";
2
- import { FetchOptionsProvider as e } from "./fetch-options-provider.js";
3
- import { deepmerge as t, defaultAuthConfig as n } from "@better-auth-ui/core";
4
- import { QueryClient as r, QueryClientContext as i, QueryClientProvider as a } from "@tanstack/react-query";
5
- import { createContext as o, useContext as s } from "react";
6
- import { jsx as c } from "react/jsx-runtime";
7
- //#region src/components/auth/auth-provider.tsx
8
- var l = o(void 0), u = new r({ defaultOptions: { queries: { staleTime: 5e3 } } });
9
- function d({ children: r, queryClient: o, ...d }) {
10
- let f = t(n, {
11
- ...d,
12
- viewPaths: {
13
- auth: {
14
- ...n.viewPaths.auth,
15
- ...d.viewPaths?.auth
16
- },
17
- settings: {
18
- ...n.viewPaths.settings,
19
- ...d.viewPaths?.settings
20
- }
21
- }
22
- });
23
- f.redirectTo = typeof window < "u" && new URLSearchParams(window.location.search).get("redirectTo")?.trim() || f.redirectTo;
24
- let p = /* @__PURE__ */ new Map();
25
- for (let e of f.plugins ?? []) for (let t of e.additionalFields ?? []) p.set(t.name, t);
26
- for (let e of f.additionalFields ?? []) p.set(e.name, e);
27
- return f.additionalFields = Array.from(p.values()), s(i) ? /* @__PURE__ */ c(l.Provider, {
28
- value: f,
29
- children: /* @__PURE__ */ c(e, { children: r })
30
- }) : /* @__PURE__ */ c(a, {
31
- client: o || u,
32
- children: /* @__PURE__ */ c(l.Provider, {
33
- value: f,
34
- children: /* @__PURE__ */ c(e, { children: r })
35
- })
36
- });
37
- }
38
- function f() {
39
- let e = s(l);
40
- if (!e) throw Error("[Better Auth UI] AuthProvider is required");
41
- return e;
42
- }
43
- //#endregion
44
- export { d as AuthProvider, f as useAuth };
@@ -1,156 +0,0 @@
1
- import { cn as e } from "../../../lib/utils.js";
2
- import t from "./email-styles.js";
3
- import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
4
- import { Body as a, Button as o, Container as s, Head as c, Heading as l, Hr as u, Html as d, Img as f, Link as p, Preview as m, Section as h, Tailwind as g, Text as _, pixelBasedPreset as v } from "@react-email/components";
5
- //#region src/components/auth/email/email-changed.tsx
6
- var y = {
7
- YOUR_EMAIL_ADDRESS_HAS_BEEN_CHANGED: "Your email address has been changed",
8
- LOGO: "Logo",
9
- EMAIL_ADDRESS_CHANGED: "Email address changed",
10
- EMAIL_ADDRESS_FOR_YOUR_ACCOUNT_CHANGED: "The email address for your {appName} account has been changed.",
11
- PREVIOUS_EMAIL: "Previous email:",
12
- NEW_EMAIL: "New email:",
13
- IF_YOU_MADE_THIS_CHANGE: "If you made this change, you can safely ignore this email.",
14
- I_DIDNT_MAKE_THIS_CHANGE: "I didn't make this change",
15
- EMAIL_SENT_BY: "Email sent by {appName}.",
16
- IF_YOU_DIDNT_AUTHORIZE_THIS_CHANGE: "If you didn't authorize this change, please contact support immediately {supportEmail} to secure your account.",
17
- POWERED_BY_BETTER_AUTH: "Powered by {betterAuth}"
18
- }, b = ({ oldEmail: y, newEmail: x, revertURL: S, appName: C, supportEmail: w, logoURL: T, colors: E, classNames: D, darkMode: O = !0, poweredBy: k, head: A, ...j }) => {
19
- let M = {
20
- ...b.localization,
21
- ...j.localization
22
- }, N = M.YOUR_EMAIL_ADDRESS_HAS_BEEN_CHANGED;
23
- return /* @__PURE__ */ i(d, { children: [
24
- /* @__PURE__ */ i(c, { children: [
25
- /* @__PURE__ */ r("meta", {
26
- content: "light dark",
27
- name: "color-scheme"
28
- }),
29
- /* @__PURE__ */ r("meta", {
30
- content: "light dark",
31
- name: "supported-color-schemes"
32
- }),
33
- /* @__PURE__ */ r(t, {
34
- colors: E,
35
- darkMode: O
36
- }),
37
- A
38
- ] }),
39
- /* @__PURE__ */ r(m, { children: N }),
40
- /* @__PURE__ */ r(g, {
41
- config: { presets: [v] },
42
- children: /* @__PURE__ */ r(a, {
43
- className: e("bg-background font-sans", D?.body),
44
- children: /* @__PURE__ */ r(s, {
45
- className: e("mx-auto my-auto max-w-xl px-2 py-10", D?.container),
46
- children: /* @__PURE__ */ i(h, {
47
- className: e("bg-card text-card-foreground rounded-none border border-border p-8", D?.card),
48
- children: [
49
- T && (typeof T == "string" ? /* @__PURE__ */ r(f, {
50
- src: T,
51
- width: 48,
52
- height: 48,
53
- alt: C || M.LOGO,
54
- className: e("mx-auto mb-8", D?.logo)
55
- }) : /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r(f, {
56
- src: T.light,
57
- width: 48,
58
- height: 48,
59
- alt: C || M.LOGO,
60
- className: e("mx-auto mb-8 logo-light", D?.logo)
61
- }), /* @__PURE__ */ r(f, {
62
- src: T.dark,
63
- width: 48,
64
- height: 48,
65
- alt: C || M.LOGO,
66
- className: e("hidden mx-auto mb-8 logo-dark", D?.logo)
67
- })] })),
68
- /* @__PURE__ */ r(l, {
69
- className: e("m-0 mb-5 text-2xl font-semibold", D?.title),
70
- children: M.EMAIL_ADDRESS_CHANGED
71
- }),
72
- /* @__PURE__ */ r(_, {
73
- className: e("text-sm font-normal", D?.content),
74
- children: M.EMAIL_ADDRESS_FOR_YOUR_ACCOUNT_CHANGED.replace("{appName}", C || "").replace(/\s{2,}/g, " ").replace(" .", ".")
75
- }),
76
- (y || x) && /* @__PURE__ */ i(h, {
77
- className: e("my-6 border border-border bg-muted p-4", D?.codeBlock),
78
- children: [y && /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r(_, {
79
- className: e("m-0 mb-2 text-xs text-muted-foreground", D?.description),
80
- children: M.PREVIOUS_EMAIL
81
- }), /* @__PURE__ */ r(_, {
82
- className: e("m-0 mb-4 text-sm font-semibold", D?.content),
83
- children: y
84
- })] }), x && /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r(_, {
85
- className: e("m-0 mb-2 text-xs text-muted-foreground", D?.description),
86
- children: M.NEW_EMAIL
87
- }), /* @__PURE__ */ r(_, {
88
- className: e("m-0 text-sm font-semibold text-primary", D?.content),
89
- children: x
90
- })] })]
91
- }),
92
- /* @__PURE__ */ r(_, {
93
- className: e("text-sm font-normal", D?.content),
94
- children: M.IF_YOU_MADE_THIS_CHANGE
95
- }),
96
- S && /* @__PURE__ */ r(h, {
97
- className: "my-6",
98
- children: /* @__PURE__ */ r(o, {
99
- href: S,
100
- className: e("inline-block whitespace-nowrap rounded-none text-sm font-medium py-2.5 px-6 bg-primary text-primary-foreground no-underline", D?.button),
101
- children: M.I_DIDNT_MAKE_THIS_CHANGE
102
- })
103
- }),
104
- /* @__PURE__ */ r(u, { className: e("my-6 w-full border border-solid border-border", D?.separator) }),
105
- C && /* @__PURE__ */ r(_, {
106
- className: e("mb-3 text-xs text-muted-foreground", D?.description),
107
- children: M.EMAIL_SENT_BY.replace("{appName}", C)
108
- }),
109
- /* @__PURE__ */ r(_, {
110
- className: e("mt-3 text-xs text-muted-foreground", D?.description),
111
- children: (() => {
112
- let [t, a] = M.IF_YOU_DIDNT_AUTHORIZE_THIS_CHANGE.split("{supportEmail}");
113
- return w ? /* @__PURE__ */ i(n, { children: [
114
- t,
115
- /* @__PURE__ */ r(p, {
116
- href: `mailto:${w}`,
117
- className: e("text-primary underline", D?.link),
118
- children: w
119
- }),
120
- a
121
- ] }) : M.IF_YOU_DIDNT_AUTHORIZE_THIS_CHANGE.replace("{supportEmail}", "").replace(/\s{2,}/g, " ").replace(" .", ".");
122
- })()
123
- }),
124
- k && /* @__PURE__ */ r(_, {
125
- className: e("mt-4 mb-0 text-center text-[11px] text-muted-foreground", D?.poweredBy),
126
- children: (() => {
127
- let [t, a] = M.POWERED_BY_BETTER_AUTH.split("{betterAuth}");
128
- return /* @__PURE__ */ i(n, { children: [
129
- t,
130
- /* @__PURE__ */ r(p, {
131
- href: "https://better-auth.com",
132
- className: e("text-primary underline", D?.link),
133
- children: "better-auth"
134
- }),
135
- a
136
- ] });
137
- })()
138
- })
139
- ]
140
- })
141
- })
142
- })
143
- })
144
- ] });
145
- };
146
- b.localization = y, b.PreviewProps = {
147
- oldEmail: "old@example.com",
148
- newEmail: "new@example.com",
149
- supportEmail: "support@example.com",
150
- revertURL: "https://better-auth-ui.com/auth/revert-email?token=example-token",
151
- appName: "Better Auth",
152
- poweredBy: !0,
153
- darkMode: !0
154
- };
155
- //#endregion
156
- export { b as default };
@@ -1,19 +0,0 @@
1
- import e from "./email-changed.js";
2
- import t from "./email-verification.js";
3
- import n from "./magic-link.js";
4
- import r from "./new-device.js";
5
- import i from "./otp-email.js";
6
- import a from "./password-changed.js";
7
- import o from "./reset-password.js";
8
- //#region src/components/auth/email/email-localization.tsx
9
- var s = {
10
- ...e.localization,
11
- ...t.localization,
12
- ...n.localization,
13
- ...r.localization,
14
- ...i.localization,
15
- ...a.localization,
16
- ...o.localization
17
- };
18
- //#endregion
19
- export { s as emailLocalization };
@@ -1,104 +0,0 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- //#region src/components/auth/email/email-styles.tsx
3
- var t = {
4
- light: {
5
- background: "#F5F5F5",
6
- border: "#E5E5E5",
7
- card: "#FFFFFF",
8
- cardForeground: "#0A0A0A",
9
- foreground: "#262626",
10
- muted: "#F5F5F5",
11
- mutedForeground: "#737373",
12
- primary: "#171717",
13
- primaryForeground: "#FAFAFA"
14
- },
15
- dark: {
16
- background: "#0A0A0A",
17
- border: "#2E2E2E",
18
- card: "#171717",
19
- cardForeground: "#FAFAFA",
20
- foreground: "#D4D4D4",
21
- muted: "#212121",
22
- mutedForeground: "#A1A1A1",
23
- primary: "#E5E5E5",
24
- primaryForeground: "#171717"
25
- }
26
- }, n = ({ colors: n, darkMode: r = !0 }) => /* @__PURE__ */ e("style", {
27
- type: "text/css",
28
- children: `
29
- .bg-background {
30
- background-color: ${n?.light?.background || t.light.background} !important;
31
- }
32
- .bg-card {
33
- background-color: ${n?.light?.card || t.light.card} !important;
34
- }
35
- .bg-primary {
36
- background-color: ${n?.light?.primary || t.light.primary} !important;
37
- }
38
- .bg-muted {
39
- background-color: ${n?.light?.muted || t.light.muted} !important;
40
- }
41
- .border-border {
42
- border-color: ${n?.light?.border || t.light.border} !important;
43
- }
44
- .text-card-foreground {
45
- color: ${n?.light?.cardForeground || t.light.cardForeground} !important;
46
- }
47
- .text-muted-foreground {
48
- color: ${n?.light?.mutedForeground || t.light.mutedForeground} !important;
49
- }
50
- .text-primary {
51
- color: ${n?.light?.primary || t.light.primary} !important;
52
- }
53
- .text-primary-foreground {
54
- color: ${n?.light?.primaryForeground || t.light.primaryForeground} !important;
55
- }
56
- .logo-dark {
57
- display: none !important;
58
- }
59
- .logo-light {
60
- display: block !important;
61
- }
62
-
63
- ${r ? `@media (prefers-color-scheme: dark) {
64
- .bg-background {
65
- background-color: ${n?.dark?.background || t.dark.background} !important;
66
- }
67
- .bg-card {
68
- background-color: ${n?.dark?.card || t.dark.card} !important;
69
- }
70
- .bg-primary {
71
- background-color: ${n?.dark?.primary || t.dark.primary} !important;
72
- }
73
- .bg-muted {
74
- background-color: ${n?.dark?.muted || t.dark.muted} !important;
75
- }
76
- .border-border {
77
- border-color: ${n?.dark?.border || t.dark.border} !important;
78
- }
79
- .text-card-foreground {
80
- color: ${n?.dark?.cardForeground || t.dark.cardForeground} !important;
81
- }
82
- .text-muted-foreground {
83
- color: ${n?.dark?.mutedForeground || t.dark.mutedForeground} !important;
84
- }
85
- .text-primary {
86
- color: ${n?.dark?.primary || t.dark.primary} !important;
87
- }
88
- .text-primary-foreground {
89
- color: ${n?.dark?.primaryForeground || t.dark.primaryForeground} !important;
90
- }
91
- .logo-dark {
92
- display: block !important;
93
- }
94
- .logo-light {
95
- display: none !important;
96
- }
97
- * {
98
- box-shadow: none !important;
99
- }
100
- }` : ""}
101
- `
102
- });
103
- //#endregion
104
- export { n as default, t as defaultColors };
@@ -1,140 +0,0 @@
1
- import { cn as e } from "../../../lib/utils.js";
2
- import t from "./email-styles.js";
3
- import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
4
- import { Body as a, Button as o, Container as s, Head as c, Heading as l, Hr as u, Html as d, Img as f, Link as p, Preview as m, Section as h, Tailwind as g, Text as _, pixelBasedPreset as v } from "@react-email/components";
5
- //#region src/components/auth/email/email-verification.tsx
6
- var y = {
7
- VERIFY_YOUR_EMAIL_ADDRESS: "Verify your email address",
8
- LOGO: "Logo",
9
- CLICK_BUTTON_TO_VERIFY_EMAIL: "Click the button below to verify your email address {emailAddress} for your {appName} account.",
10
- VERIFY_EMAIL_ADDRESS: "Verify email address",
11
- OR_COPY_AND_PASTE_URL: "Or copy and paste this URL into your browser:",
12
- THIS_LINK_EXPIRES_IN_MINUTES: "This link expires in {expirationMinutes} minutes.",
13
- EMAIL_SENT_BY: "Email sent by {appName}.",
14
- IF_YOU_DIDNT_REQUEST_THIS_EMAIL: "If you didn't request this email, you can safely ignore it. Someone else might have typed your email address by mistake.",
15
- POWERED_BY_BETTER_AUTH: "Powered by {betterAuth}"
16
- }, b = ({ url: y, email: x, appName: S, expirationMinutes: C = 60, logoURL: w, colors: T, classNames: E, darkMode: D = !0, poweredBy: O, head: k, ...A }) => {
17
- let j = {
18
- ...b.localization,
19
- ...A.localization
20
- }, M = j.VERIFY_YOUR_EMAIL_ADDRESS;
21
- return /* @__PURE__ */ i(d, { children: [
22
- /* @__PURE__ */ i(c, { children: [
23
- /* @__PURE__ */ r("meta", {
24
- content: "light dark",
25
- name: "color-scheme"
26
- }),
27
- /* @__PURE__ */ r("meta", {
28
- content: "light dark",
29
- name: "supported-color-schemes"
30
- }),
31
- /* @__PURE__ */ r(t, {
32
- colors: T,
33
- darkMode: D
34
- }),
35
- k
36
- ] }),
37
- /* @__PURE__ */ r(m, { children: M }),
38
- /* @__PURE__ */ r(g, {
39
- config: { presets: [v] },
40
- children: /* @__PURE__ */ r(a, {
41
- className: e("bg-background font-sans", E?.body),
42
- children: /* @__PURE__ */ r(s, {
43
- className: e("mx-auto my-auto max-w-xl px-2 py-10", E?.container),
44
- children: /* @__PURE__ */ i(h, {
45
- className: e("bg-card text-card-foreground rounded-none border border-border p-8", E?.card),
46
- children: [
47
- w && (typeof w == "string" ? /* @__PURE__ */ r(f, {
48
- src: w,
49
- width: 48,
50
- height: 48,
51
- alt: S || j.LOGO,
52
- className: e("mx-auto mb-8", E?.logo)
53
- }) : /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r(f, {
54
- src: w.light,
55
- width: 48,
56
- height: 48,
57
- alt: S || j.LOGO,
58
- className: e("mx-auto mb-8 logo-light", E?.logo)
59
- }), /* @__PURE__ */ r(f, {
60
- src: w.dark,
61
- width: 48,
62
- height: 48,
63
- alt: S || j.LOGO,
64
- className: e("hidden mx-auto mb-8 logo-dark", E?.logo)
65
- })] })),
66
- /* @__PURE__ */ r(l, {
67
- className: e("m-0 mb-5 text-2xl font-semibold", E?.title),
68
- children: j.VERIFY_EMAIL_ADDRESS
69
- }),
70
- /* @__PURE__ */ r(_, {
71
- className: e("text-sm font-normal", E?.content),
72
- children: (() => {
73
- let e = j.CLICK_BUTTON_TO_VERIFY_EMAIL.replace("{appName}", S || "").replace(/\s{2,}/g, " ").replace(" .", "."), [t, a] = e.split("{emailAddress}");
74
- return x ? /* @__PURE__ */ i(n, { children: [
75
- t,
76
- /* @__PURE__ */ r(p, {
77
- href: `mailto:${x}`,
78
- className: "text-primary font-medium",
79
- children: x
80
- }),
81
- a
82
- ] }) : e.replace("{emailAddress}", "").replace(/\s{2,}/g, " ").replace(" .", ".");
83
- })()
84
- }),
85
- /* @__PURE__ */ r(h, {
86
- className: "my-6",
87
- children: /* @__PURE__ */ r(o, {
88
- href: y,
89
- className: e("inline-block whitespace-nowrap rounded-none text-sm font-medium py-2.5 px-6 bg-primary text-primary-foreground no-underline", E?.button),
90
- children: j.VERIFY_EMAIL_ADDRESS
91
- })
92
- }),
93
- /* @__PURE__ */ r(_, {
94
- className: e("mb-3 text-xs text-muted-foreground", E?.description),
95
- children: j.OR_COPY_AND_PASTE_URL
96
- }),
97
- /* @__PURE__ */ r(p, {
98
- className: e("break-all text-xs text-primary", E?.link),
99
- href: y,
100
- children: y
101
- }),
102
- /* @__PURE__ */ r(u, { className: e("my-6 w-full border border-solid border-border", E?.separator) }),
103
- C || S ? /* @__PURE__ */ i(_, {
104
- className: e("mb-3 text-xs text-muted-foreground", E?.description),
105
- children: [C ? j.THIS_LINK_EXPIRES_IN_MINUTES.replace("{expirationMinutes}", C.toString()) : null, S && /* @__PURE__ */ i(n, { children: [C ? " " : "", j.EMAIL_SENT_BY.replace("{appName}", S)] })]
106
- }) : null,
107
- /* @__PURE__ */ r(_, {
108
- className: e("mt-3 text-xs text-muted-foreground", E?.description),
109
- children: j.IF_YOU_DIDNT_REQUEST_THIS_EMAIL
110
- }),
111
- O && /* @__PURE__ */ r(_, {
112
- className: e("mt-4 mb-0 text-center text-[11px] text-muted-foreground", E?.poweredBy),
113
- children: (() => {
114
- let [t, a] = j.POWERED_BY_BETTER_AUTH.split("{betterAuth}");
115
- return /* @__PURE__ */ i(n, { children: [
116
- t,
117
- /* @__PURE__ */ r(p, {
118
- href: "https://better-auth.com",
119
- className: e("text-primary underline", E?.link),
120
- children: "better-auth"
121
- }),
122
- a
123
- ] });
124
- })()
125
- })
126
- ]
127
- })
128
- })
129
- })
130
- })
131
- ] });
132
- };
133
- b.localization = y, b.PreviewProps = {
134
- url: "https://better-auth-ui.com/auth/verify-email?token=example-token",
135
- appName: "Better Auth",
136
- email: "m@example.com",
137
- darkMode: !0
138
- };
139
- //#endregion
140
- export { b as default };
@@ -1,9 +0,0 @@
1
- import "./email-styles.js";
2
- import "./email-changed.js";
3
- import "./email-verification.js";
4
- import "./magic-link.js";
5
- import "./new-device.js";
6
- import "./otp-email.js";
7
- import "./password-changed.js";
8
- import "./reset-password.js";
9
- import "./email-localization.js";
@@ -1,141 +0,0 @@
1
- import { cn as e } from "../../../lib/utils.js";
2
- import t from "./email-styles.js";
3
- import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
4
- import { Body as a, Button as o, Container as s, Head as c, Heading as l, Hr as u, Html as d, Img as f, Link as p, Preview as m, Section as h, Tailwind as g, Text as _, pixelBasedPreset as v } from "@react-email/components";
5
- //#region src/components/auth/email/magic-link.tsx
6
- var y = {
7
- SIGN_IN_TO_APP_NAME: "Sign in to {appName}",
8
- SIGN_IN_TO_YOUR_ACCOUNT: "Sign in to your account",
9
- YOUR_ACCOUNT: "your account",
10
- LOGO: "Logo",
11
- CLICK_BUTTON_TO_SIGN_IN: "Click the button below to sign in to your account {emailAddress}.",
12
- OR_COPY_AND_PASTE_URL: "Or copy and paste this URL into your browser:",
13
- THIS_LINK_EXPIRES_IN_MINUTES: "This link expires in {expirationMinutes} minutes.",
14
- EMAIL_SENT_BY: "Email sent by {appName}.",
15
- IF_YOU_DIDNT_REQUEST_THIS_EMAIL: "If you didn't request this email, you can safely ignore it. Someone else might have typed your email address by mistake.",
16
- POWERED_BY_BETTER_AUTH: "Powered by {betterAuth}"
17
- }, b = ({ url: y, email: x, appName: S, expirationMinutes: C = 5, logoURL: w, colors: T, classNames: E, darkMode: D = !0, poweredBy: O, head: k, ...A }) => {
18
- let j = {
19
- ...b.localization,
20
- ...A.localization
21
- }, M = S ? j.SIGN_IN_TO_APP_NAME.replace("{appName}", S) : j.SIGN_IN_TO_YOUR_ACCOUNT;
22
- return /* @__PURE__ */ i(d, { children: [
23
- /* @__PURE__ */ i(c, { children: [
24
- /* @__PURE__ */ r("meta", {
25
- content: "light dark",
26
- name: "color-scheme"
27
- }),
28
- /* @__PURE__ */ r("meta", {
29
- content: "light dark",
30
- name: "supported-color-schemes"
31
- }),
32
- /* @__PURE__ */ r(t, {
33
- colors: T,
34
- darkMode: D
35
- }),
36
- k
37
- ] }),
38
- /* @__PURE__ */ r(m, { children: M }),
39
- /* @__PURE__ */ r(g, {
40
- config: { presets: [v] },
41
- children: /* @__PURE__ */ r(a, {
42
- className: e("bg-background font-sans", E?.body),
43
- children: /* @__PURE__ */ r(s, {
44
- className: e("mx-auto my-auto max-w-xl px-2 py-10", E?.container),
45
- children: /* @__PURE__ */ i(h, {
46
- className: e("bg-card text-card-foreground rounded-none border border-border p-8", E?.card),
47
- children: [
48
- w && (typeof w == "string" ? /* @__PURE__ */ r(f, {
49
- src: w,
50
- width: 48,
51
- height: 48,
52
- alt: S || j.LOGO,
53
- className: e("mx-auto mb-8", E?.logo)
54
- }) : /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r(f, {
55
- src: w.light,
56
- width: 48,
57
- height: 48,
58
- alt: S || j.LOGO,
59
- className: e("mx-auto mb-8 logo-light", E?.logo)
60
- }), /* @__PURE__ */ r(f, {
61
- src: w.dark,
62
- width: 48,
63
- height: 48,
64
- alt: S || j.LOGO,
65
- className: e("hidden mx-auto mb-8 logo-dark", E?.logo)
66
- })] })),
67
- /* @__PURE__ */ r(l, {
68
- className: e("m-0 mb-5 text-2xl font-semibold", E?.title),
69
- children: S ? j.SIGN_IN_TO_APP_NAME.replace("{appName}", S) : j.SIGN_IN_TO_YOUR_ACCOUNT
70
- }),
71
- /* @__PURE__ */ r(_, {
72
- className: e("m-0 text-sm font-normal", E?.content),
73
- children: (() => {
74
- let [e, t] = j.CLICK_BUTTON_TO_SIGN_IN.split("{emailAddress}");
75
- return x ? /* @__PURE__ */ i(n, { children: [
76
- e,
77
- /* @__PURE__ */ r(p, {
78
- href: `mailto:${x}`,
79
- className: "text-primary font-medium",
80
- children: x
81
- }),
82
- t
83
- ] }) : j.CLICK_BUTTON_TO_SIGN_IN.replace("{emailAddress}", "").replace(/\s{2,}/g, " ").replace(" .", ".");
84
- })()
85
- }),
86
- /* @__PURE__ */ r(h, {
87
- className: "my-6",
88
- children: /* @__PURE__ */ r(o, {
89
- href: y,
90
- className: e("inline-block whitespace-nowrap rounded-none text-sm font-medium py-2.5 px-6 bg-primary text-primary-foreground no-underline", E?.button),
91
- children: S ? j.SIGN_IN_TO_APP_NAME.replace("{appName}", S) : j.SIGN_IN_TO_YOUR_ACCOUNT
92
- })
93
- }),
94
- /* @__PURE__ */ r(_, {
95
- className: e("m-0 mb-3 text-xs text-muted-foreground", E?.description),
96
- children: j.OR_COPY_AND_PASTE_URL
97
- }),
98
- /* @__PURE__ */ r(p, {
99
- className: e("break-all text-xs text-primary", E?.link),
100
- href: y,
101
- children: y
102
- }),
103
- /* @__PURE__ */ r(u, { className: e("my-6 w-full border border-solid border-border", E?.separator) }),
104
- C || S ? /* @__PURE__ */ i(_, {
105
- className: e("m-0 mb-3 text-xs text-muted-foreground", E?.description),
106
- children: [C ? j.THIS_LINK_EXPIRES_IN_MINUTES.replace("{expirationMinutes}", C.toString()) : null, S && /* @__PURE__ */ i(n, { children: [C ? " " : "", j.EMAIL_SENT_BY.replace("{appName}", S)] })]
107
- }) : null,
108
- /* @__PURE__ */ r(_, {
109
- className: e("m-0 text-xs text-muted-foreground", E?.description),
110
- children: j.IF_YOU_DIDNT_REQUEST_THIS_EMAIL
111
- }),
112
- O && /* @__PURE__ */ r(_, {
113
- className: e("m-0 mt-4 text-center text-[11px] text-muted-foreground", E?.poweredBy),
114
- children: (() => {
115
- let [t, a] = j.POWERED_BY_BETTER_AUTH.split("{betterAuth}");
116
- return /* @__PURE__ */ i(n, { children: [
117
- t,
118
- /* @__PURE__ */ r(p, {
119
- href: "https://better-auth.com",
120
- className: e("text-primary underline", E?.link),
121
- children: "better-auth"
122
- }),
123
- a
124
- ] });
125
- })()
126
- })
127
- ]
128
- })
129
- })
130
- })
131
- })
132
- ] });
133
- };
134
- b.localization = y, b.PreviewProps = {
135
- url: "https://better-auth-ui.com/auth/verify?token=example-token",
136
- email: "m@example.com",
137
- appName: "Better Auth",
138
- darkMode: !0
139
- };
140
- //#endregion
141
- export { b as default };