@better-auth-ui/react 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 (334) hide show
  1. package/dist/components/auth/auth-context.d.ts +3 -0
  2. package/dist/components/auth/auth-context.js +4 -0
  3. package/dist/components/auth/auth-provider.d.ts +4 -4
  4. package/dist/components/auth/auth-provider.js +65 -41
  5. package/dist/components/auth/email/email-changed.d.ts +2 -2
  6. package/dist/components/auth/email/email-changed.js +68 -154
  7. package/dist/components/auth/email/email-localization.d.ts +11 -3
  8. package/dist/components/auth/email/email-localization.js +25 -18
  9. package/dist/components/auth/email/email-styles.js +77 -52
  10. package/dist/components/auth/email/email-verification.d.ts +2 -2
  11. package/dist/components/auth/email/email-verification.js +73 -138
  12. package/dist/components/auth/email/index.d.ts +10 -9
  13. package/dist/components/auth/email/index.js +10 -9
  14. package/dist/components/auth/email/magic-link.d.ts +2 -2
  15. package/dist/components/auth/email/magic-link.js +70 -139
  16. package/dist/components/auth/email/new-device.d.ts +2 -2
  17. package/dist/components/auth/email/new-device.js +88 -221
  18. package/dist/components/auth/email/organization-invitation.d.ts +121 -0
  19. package/dist/components/auth/email/organization-invitation.js +110 -0
  20. package/dist/components/auth/email/otp-email.d.ts +2 -2
  21. package/dist/components/auth/email/otp-email.js +63 -127
  22. package/dist/components/auth/email/password-changed.d.ts +2 -2
  23. package/dist/components/auth/email/password-changed.js +74 -157
  24. package/dist/components/auth/email/reset-password.d.ts +2 -2
  25. package/dist/components/auth/email/reset-password.js +66 -138
  26. package/dist/components/auth/fetch-options-provider.d.ts +1 -1
  27. package/dist/components/auth/fetch-options-provider.js +28 -27
  28. package/dist/components/icons/apple.d.ts +1 -1
  29. package/dist/components/icons/apple.js +9 -16
  30. package/dist/components/icons/atlassian.d.ts +1 -1
  31. package/dist/components/icons/atlassian.js +13 -38
  32. package/dist/components/icons/cognito.d.ts +1 -1
  33. package/dist/components/icons/cognito.js +9 -19
  34. package/dist/components/icons/discord.d.ts +1 -1
  35. package/dist/components/icons/discord.js +9 -16
  36. package/dist/components/icons/dropbox.d.ts +1 -1
  37. package/dist/components/icons/dropbox.js +9 -16
  38. package/dist/components/icons/facebook.d.ts +1 -1
  39. package/dist/components/icons/facebook.js +11 -19
  40. package/dist/components/icons/figma.d.ts +1 -1
  41. package/dist/components/icons/figma.js +12 -34
  42. package/dist/components/icons/github.d.ts +1 -1
  43. package/dist/components/icons/github.js +11 -16
  44. package/dist/components/icons/gitlab.d.ts +1 -1
  45. package/dist/components/icons/gitlab.js +9 -30
  46. package/dist/components/icons/google.d.ts +1 -1
  47. package/dist/components/icons/google.js +9 -39
  48. package/dist/components/icons/huggingface.d.ts +1 -1
  49. package/dist/components/icons/huggingface.js +9 -38
  50. package/dist/components/icons/index.d.ts +35 -35
  51. package/dist/components/icons/index.js +35 -35
  52. package/dist/components/icons/kakao.d.ts +1 -1
  53. package/dist/components/icons/kakao.js +11 -16
  54. package/dist/components/icons/kick.d.ts +1 -1
  55. package/dist/components/icons/kick.js +11 -20
  56. package/dist/components/icons/line.d.ts +1 -1
  57. package/dist/components/icons/line.js +9 -16
  58. package/dist/components/icons/linear.d.ts +1 -1
  59. package/dist/components/icons/linear.js +9 -16
  60. package/dist/components/icons/linkedin.d.ts +1 -1
  61. package/dist/components/icons/linkedin.js +9 -33
  62. package/dist/components/icons/microsoft.d.ts +1 -1
  63. package/dist/components/icons/microsoft.js +9 -30
  64. package/dist/components/icons/naver.d.ts +1 -1
  65. package/dist/components/icons/naver.js +9 -16
  66. package/dist/components/icons/notion.d.ts +1 -1
  67. package/dist/components/icons/notion.js +9 -16
  68. package/dist/components/icons/paybin.d.ts +1 -1
  69. package/dist/components/icons/paybin.js +8 -32
  70. package/dist/components/icons/paypal.d.ts +1 -1
  71. package/dist/components/icons/paypal.js +9 -30
  72. package/dist/components/icons/polar.d.ts +1 -1
  73. package/dist/components/icons/polar.js +9 -24
  74. package/dist/components/icons/railway.d.ts +1 -1
  75. package/dist/components/icons/railway.js +9 -16
  76. package/dist/components/icons/reddit.d.ts +1 -1
  77. package/dist/components/icons/reddit.js +9 -21
  78. package/dist/components/icons/roblox.d.ts +1 -1
  79. package/dist/components/icons/roblox.js +12 -17
  80. package/dist/components/icons/salesforce.d.ts +1 -1
  81. package/dist/components/icons/salesforce.js +9 -16
  82. package/dist/components/icons/slack.d.ts +1 -1
  83. package/dist/components/icons/slack.js +9 -30
  84. package/dist/components/icons/spotify.d.ts +1 -1
  85. package/dist/components/icons/spotify.js +9 -16
  86. package/dist/components/icons/tiktok.d.ts +1 -1
  87. package/dist/components/icons/tiktok.js +10 -23
  88. package/dist/components/icons/twitch.d.ts +1 -1
  89. package/dist/components/icons/twitch.js +12 -43
  90. package/dist/components/icons/vercel.d.ts +1 -1
  91. package/dist/components/icons/vercel.js +9 -16
  92. package/dist/components/icons/vk.d.ts +1 -1
  93. package/dist/components/icons/vk.js +9 -16
  94. package/dist/components/icons/wechat.d.ts +1 -1
  95. package/dist/components/icons/wechat.js +9 -16
  96. package/dist/components/icons/x.d.ts +1 -1
  97. package/dist/components/icons/x.js +9 -16
  98. package/dist/components/icons/zoom.d.ts +1 -1
  99. package/dist/components/icons/zoom.js +11 -69
  100. package/dist/components/mutation-invalidator.d.ts +1 -0
  101. package/dist/components/mutation-invalidator.js +31 -0
  102. package/dist/components/settings/account/theme-preview.js +7 -286
  103. package/dist/email.d.ts +1 -1
  104. package/dist/email.js +1 -11
  105. package/dist/hooks/auth/use-authenticate.d.ts +3 -3
  106. package/dist/hooks/auth/use-authenticate.js +28 -22
  107. package/dist/hooks/auth/use-user.d.ts +34 -34
  108. package/dist/hooks/auth/use-user.js +14 -10
  109. package/dist/hooks/use-auth-mutation.d.ts +4 -4
  110. package/dist/hooks/use-auth-mutation.js +18 -10
  111. package/dist/hooks/use-auth-plugin.d.ts +1 -1
  112. package/dist/hooks/use-auth-plugin.js +26 -8
  113. package/dist/hooks/use-auth-query.d.ts +3 -3
  114. package/dist/hooks/use-auth-query.js +20 -14
  115. package/dist/index.d.ts +48 -45
  116. package/dist/index.js +47 -79
  117. package/dist/lib/auth-client.d.ts +7 -4
  118. package/dist/lib/auth-client.js +1 -0
  119. package/dist/lib/auth-plugin.d.ts +19 -3
  120. package/dist/lib/auth-plugin.js +1 -0
  121. package/dist/lib/auth-server.d.ts +10 -3
  122. package/dist/lib/auth-server.js +1 -0
  123. package/dist/lib/provider-icons.d.ts +2 -2
  124. package/dist/lib/provider-icons.js +47 -75
  125. package/dist/lib/settings-tab.d.ts +19 -0
  126. package/dist/lib/settings-tab.js +1 -0
  127. package/dist/lib/utils.d.ts +1 -1
  128. package/dist/lib/utils.js +4 -7
  129. package/dist/mutations/api-key/create-api-key-mutation.d.ts +9 -7
  130. package/dist/mutations/api-key/create-api-key-mutation.js +37 -27
  131. package/dist/mutations/api-key/delete-api-key-mutation.d.ts +10 -6
  132. package/dist/mutations/api-key/delete-api-key-mutation.js +37 -27
  133. package/dist/mutations/auth/request-password-reset-mutation.d.ts +4 -4
  134. package/dist/mutations/auth/request-password-reset-mutation.js +31 -22
  135. package/dist/mutations/auth/reset-password-mutation.d.ts +4 -4
  136. package/dist/mutations/auth/reset-password-mutation.js +32 -22
  137. package/dist/mutations/auth/send-verification-email-mutation.d.ts +4 -4
  138. package/dist/mutations/auth/send-verification-email-mutation.js +31 -22
  139. package/dist/mutations/auth/sign-in-email-mutation.d.ts +10 -10
  140. package/dist/mutations/auth/sign-in-email-mutation.js +38 -27
  141. package/dist/mutations/auth/sign-in-social-mutation.d.ts +6 -6
  142. package/dist/mutations/auth/sign-in-social-mutation.js +36 -22
  143. package/dist/mutations/auth/sign-out-mutation.d.ts +9 -7
  144. package/dist/mutations/auth/sign-out-mutation.js +39 -26
  145. package/dist/mutations/auth/sign-up-email-mutation.d.ts +12 -12
  146. package/dist/mutations/auth/sign-up-email-mutation.js +34 -27
  147. package/dist/mutations/auth-mutation-options.d.ts +2 -2
  148. package/dist/mutations/auth-mutation-options.js +22 -18
  149. package/dist/mutations/magic-link/sign-in-magic-link-mutation.d.ts +4 -4
  150. package/dist/mutations/magic-link/sign-in-magic-link-mutation.js +31 -22
  151. package/dist/mutations/multi-session/revoke-multi-session-mutation.d.ts +8 -8
  152. package/dist/mutations/multi-session/revoke-multi-session-mutation.js +37 -27
  153. package/dist/mutations/multi-session/set-active-session-mutation.d.ts +8 -9
  154. package/dist/mutations/multi-session/set-active-session-mutation.js +38 -29
  155. package/dist/mutations/organization/accept-invitation-mutation.d.ts +43 -0
  156. package/dist/mutations/organization/accept-invitation-mutation.js +32 -0
  157. package/dist/mutations/organization/cancel-invitation-mutation.d.ts +25 -0
  158. package/dist/mutations/organization/cancel-invitation-mutation.js +28 -0
  159. package/dist/mutations/organization/check-slug-mutation.d.ts +21 -0
  160. package/dist/mutations/organization/check-slug-mutation.js +30 -0
  161. package/dist/mutations/organization/create-organization-mutation.d.ts +39 -0
  162. package/dist/mutations/organization/create-organization-mutation.js +29 -0
  163. package/dist/mutations/organization/delete-organization-mutation.d.ts +21 -0
  164. package/dist/mutations/organization/delete-organization-mutation.js +29 -0
  165. package/dist/mutations/organization/index.d.ts +12 -0
  166. package/dist/mutations/organization/index.js +12 -0
  167. package/dist/mutations/organization/invite-member-mutation.d.ts +43 -0
  168. package/dist/mutations/organization/invite-member-mutation.js +35 -0
  169. package/dist/mutations/organization/leave-organization-mutation.d.ts +65 -0
  170. package/dist/mutations/organization/leave-organization-mutation.js +32 -0
  171. package/dist/mutations/organization/reject-invitation-mutation.d.ts +31 -0
  172. package/dist/mutations/organization/reject-invitation-mutation.js +25 -0
  173. package/dist/mutations/organization/remove-member-mutation.d.ts +35 -0
  174. package/dist/mutations/organization/remove-member-mutation.js +29 -0
  175. package/dist/mutations/organization/set-active-organization-mutation.d.ts +71 -0
  176. package/dist/mutations/organization/set-active-organization-mutation.js +72 -0
  177. package/dist/mutations/organization/update-member-role-mutation.d.ts +31 -0
  178. package/dist/mutations/organization/update-member-role-mutation.js +36 -0
  179. package/dist/mutations/organization/update-organization-mutation.d.ts +21 -0
  180. package/dist/mutations/organization/update-organization-mutation.js +36 -0
  181. package/dist/mutations/passkey/add-passkey-mutation.d.ts +16 -16
  182. package/dist/mutations/passkey/add-passkey-mutation.js +38 -27
  183. package/dist/mutations/passkey/delete-passkey-mutation.d.ts +8 -8
  184. package/dist/mutations/passkey/delete-passkey-mutation.js +37 -27
  185. package/dist/mutations/passkey/sign-in-passkey-mutation.d.ts +24 -24
  186. package/dist/mutations/passkey/sign-in-passkey-mutation.js +36 -27
  187. package/dist/mutations/settings/change-email-mutation.d.ts +9 -8
  188. package/dist/mutations/settings/change-email-mutation.js +35 -27
  189. package/dist/mutations/settings/change-password-mutation.d.ts +6 -6
  190. package/dist/mutations/settings/change-password-mutation.js +31 -22
  191. package/dist/mutations/settings/delete-user-mutation.d.ts +4 -4
  192. package/dist/mutations/settings/delete-user-mutation.js +31 -22
  193. package/dist/mutations/settings/link-social-mutation.d.ts +4 -4
  194. package/dist/mutations/settings/link-social-mutation.js +31 -22
  195. package/dist/mutations/settings/revoke-session-mutation.d.ts +8 -8
  196. package/dist/mutations/settings/revoke-session-mutation.js +37 -27
  197. package/dist/mutations/settings/unlink-account-mutation.d.ts +8 -8
  198. package/dist/mutations/settings/unlink-account-mutation.js +37 -27
  199. package/dist/mutations/settings/update-user-mutation.d.ts +8 -8
  200. package/dist/mutations/settings/update-user-mutation.js +34 -33
  201. package/dist/mutations/username/is-username-available-mutation.d.ts +4 -4
  202. package/dist/mutations/username/is-username-available-mutation.js +34 -22
  203. package/dist/mutations/username/sign-in-username-mutation.d.ts +10 -10
  204. package/dist/mutations/username/sign-in-username-mutation.js +35 -27
  205. package/dist/plugins/captcha-plugin.d.ts +3 -3
  206. package/dist/plugins/captcha-plugin.js +31 -26
  207. package/dist/plugins.d.ts +1 -1
  208. package/dist/plugins.js +1 -2
  209. package/dist/queries/api-key/list-api-keys-query.d.ts +20 -11
  210. package/dist/queries/api-key/list-api-keys-query.js +52 -29
  211. package/dist/queries/auth/session-query.d.ts +6 -6
  212. package/dist/queries/auth/session-query.js +70 -28
  213. package/dist/queries/auth-query-options.d.ts +2 -2
  214. package/dist/queries/auth-query-options.js +20 -16
  215. package/dist/queries/multi-session/list-device-sessions-query.d.ts +8 -8
  216. package/dist/queries/multi-session/list-device-sessions-query.js +83 -29
  217. package/dist/queries/organization/active-organization-query.d.ts +39 -0
  218. package/dist/queries/organization/active-organization-query.js +37 -0
  219. package/dist/queries/organization/full-organization-query.d.ts +37 -0
  220. package/dist/queries/organization/full-organization-query.js +31 -0
  221. package/dist/queries/organization/has-permission-query.d.ts +21 -0
  222. package/dist/queries/organization/has-permission-query.js +38 -0
  223. package/dist/queries/organization/index.d.ts +7 -0
  224. package/dist/queries/organization/index.js +7 -0
  225. package/dist/queries/organization/list-invitations-query.d.ts +29 -0
  226. package/dist/queries/organization/list-invitations-query.js +37 -0
  227. package/dist/queries/organization/list-members-query.d.ts +61 -0
  228. package/dist/queries/organization/list-members-query.js +37 -0
  229. package/dist/queries/organization/list-organizations-query.d.ts +22 -0
  230. package/dist/queries/organization/list-organizations-query.js +31 -0
  231. package/dist/queries/organization/list-user-invitations-query.d.ts +29 -0
  232. package/dist/queries/organization/list-user-invitations-query.js +31 -0
  233. package/dist/queries/passkey/list-passkeys-query.d.ts +8 -8
  234. package/dist/queries/passkey/list-passkeys-query.js +81 -29
  235. package/dist/queries/settings/account-info-query.d.ts +6 -6
  236. package/dist/queries/settings/account-info-query.js +85 -29
  237. package/dist/queries/settings/list-accounts-query.d.ts +6 -6
  238. package/dist/queries/settings/list-accounts-query.js +83 -29
  239. package/dist/queries/settings/list-sessions-query.d.ts +6 -6
  240. package/dist/queries/settings/list-sessions-query.js +81 -29
  241. package/dist/server/queries/api-key/list-api-keys-query.d.ts +83 -0
  242. package/dist/server/queries/api-key/list-api-keys-query.js +49 -0
  243. package/dist/server/queries/auth/session-query.d.ts +5 -5
  244. package/dist/server/queries/auth/session-query.js +50 -12
  245. package/dist/server/queries/multi-session/list-device-sessions-query.d.ts +7 -7
  246. package/dist/server/queries/multi-session/list-device-sessions-query.js +53 -11
  247. package/dist/server/queries/organization/active-organization-query.d.ts +61 -0
  248. package/dist/server/queries/organization/active-organization-query.js +25 -0
  249. package/dist/server/queries/organization/full-organization-query.d.ts +42 -0
  250. package/dist/server/queries/organization/full-organization-query.js +21 -0
  251. package/dist/server/queries/organization/has-permission-query.d.ts +66 -0
  252. package/dist/server/queries/organization/has-permission-query.js +23 -0
  253. package/dist/server/queries/organization/list-invitations-query.d.ts +34 -0
  254. package/dist/server/queries/organization/list-invitations-query.js +21 -0
  255. package/dist/server/queries/organization/list-members-query.d.ts +66 -0
  256. package/dist/server/queries/organization/list-members-query.js +21 -0
  257. package/dist/server/queries/organization/list-organizations-query.d.ts +27 -0
  258. package/dist/server/queries/organization/list-organizations-query.js +21 -0
  259. package/dist/server/queries/organization/list-user-invitations-query.d.ts +34 -0
  260. package/dist/server/queries/organization/list-user-invitations-query.js +21 -0
  261. package/dist/server/queries/passkey/list-passkeys-query.d.ts +7 -7
  262. package/dist/server/queries/passkey/list-passkeys-query.js +53 -11
  263. package/dist/server/queries/settings/account-info-query.d.ts +5 -5
  264. package/dist/server/queries/settings/account-info-query.js +53 -11
  265. package/dist/server/queries/settings/list-accounts-query.d.ts +5 -5
  266. package/dist/server/queries/settings/list-accounts-query.js +53 -11
  267. package/dist/server/queries/settings/list-sessions-query.d.ts +5 -5
  268. package/dist/server/queries/settings/list-sessions-query.js +53 -11
  269. package/dist/server.d.ts +15 -7
  270. package/dist/server.js +14 -7
  271. package/package.json +20 -17
  272. package/src/components/auth/auth-context.tsx +7 -0
  273. package/src/components/auth/auth-provider.tsx +19 -31
  274. package/src/components/auth/email/email-localization.tsx +5 -3
  275. package/src/components/auth/email/index.ts +1 -0
  276. package/src/components/auth/email/organization-invitation.tsx +454 -0
  277. package/src/components/mutation-invalidator.tsx +67 -0
  278. package/src/index.ts +3 -0
  279. package/src/lib/auth-client.ts +7 -0
  280. package/src/lib/auth-plugin.ts +17 -0
  281. package/src/lib/auth-server.ts +17 -1
  282. package/src/lib/settings-tab.ts +21 -0
  283. package/src/mutations/api-key/create-api-key-mutation.ts +34 -19
  284. package/src/mutations/api-key/delete-api-key-mutation.ts +36 -19
  285. package/src/mutations/auth/sign-in-email-mutation.ts +18 -22
  286. package/src/mutations/auth/sign-out-mutation.ts +19 -13
  287. package/src/mutations/auth/sign-up-email-mutation.ts +18 -22
  288. package/src/mutations/multi-session/revoke-multi-session-mutation.ts +31 -20
  289. package/src/mutations/multi-session/set-active-session-mutation.ts +25 -44
  290. package/src/mutations/organization/accept-invitation-mutation.ts +71 -0
  291. package/src/mutations/organization/cancel-invitation-mutation.ts +67 -0
  292. package/src/mutations/organization/check-slug-mutation.ts +55 -0
  293. package/src/mutations/organization/create-organization-mutation.ts +71 -0
  294. package/src/mutations/organization/delete-organization-mutation.ts +71 -0
  295. package/src/mutations/organization/index.ts +12 -0
  296. package/src/mutations/organization/invite-member-mutation.ts +81 -0
  297. package/src/mutations/organization/leave-organization-mutation.ts +74 -0
  298. package/src/mutations/organization/reject-invitation-mutation.ts +64 -0
  299. package/src/mutations/organization/remove-member-mutation.ts +67 -0
  300. package/src/mutations/organization/set-active-organization-mutation.ts +142 -0
  301. package/src/mutations/organization/update-member-role-mutation.ts +81 -0
  302. package/src/mutations/organization/update-organization-mutation.ts +84 -0
  303. package/src/mutations/passkey/add-passkey-mutation.ts +28 -17
  304. package/src/mutations/passkey/delete-passkey-mutation.ts +27 -17
  305. package/src/mutations/passkey/sign-in-passkey-mutation.ts +18 -21
  306. package/src/mutations/settings/change-email-mutation.ts +22 -18
  307. package/src/mutations/settings/delete-user-mutation.ts +2 -2
  308. package/src/mutations/settings/revoke-session-mutation.ts +24 -19
  309. package/src/mutations/settings/unlink-account-mutation.ts +24 -17
  310. package/src/mutations/settings/update-user-mutation.ts +18 -30
  311. package/src/mutations/username/is-username-available-mutation.ts +2 -2
  312. package/src/mutations/username/sign-in-username-mutation.ts +20 -23
  313. package/src/queries/api-key/list-api-keys-query.ts +20 -8
  314. package/src/queries/multi-session/list-device-sessions-query.ts +2 -2
  315. package/src/queries/organization/active-organization-query.ts +140 -0
  316. package/src/queries/organization/full-organization-query.ts +113 -0
  317. package/src/queries/organization/has-permission-query.ts +124 -0
  318. package/src/queries/organization/index.ts +7 -0
  319. package/src/queries/organization/list-invitations-query.ts +133 -0
  320. package/src/queries/organization/list-members-query.ts +133 -0
  321. package/src/queries/organization/list-organizations-query.ts +122 -0
  322. package/src/queries/organization/list-user-invitations-query.ts +122 -0
  323. package/src/queries/passkey/list-passkeys-query.ts +2 -2
  324. package/src/server/queries/api-key/list-api-keys-query.ts +94 -0
  325. package/src/server/queries/multi-session/list-device-sessions-query.ts +2 -2
  326. package/src/server/queries/organization/active-organization-query.ts +92 -0
  327. package/src/server/queries/organization/full-organization-query.ts +64 -0
  328. package/src/server/queries/organization/has-permission-query.ts +66 -0
  329. package/src/server/queries/organization/list-invitations-query.ts +81 -0
  330. package/src/server/queries/organization/list-members-query.ts +75 -0
  331. package/src/server/queries/organization/list-organizations-query.ts +67 -0
  332. package/src/server/queries/organization/list-user-invitations-query.ts +68 -0
  333. package/src/server/queries/passkey/list-passkeys-query.ts +2 -2
  334. package/src/server.ts +8 -0
@@ -1,140 +1,75 @@
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
- ] });
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Body, Button, Container, Head, Heading, Hr, Html, Img, Link, Preview, pixelBasedPreset, Section, Tailwind, Text } from "@react-email/components";
3
+ import { cn } from "../../../lib/utils";
4
+ import { EmailStyles } from "./email-styles";
5
+ const emailVerificationEmailLocalization = {
6
+ VERIFY_YOUR_EMAIL_ADDRESS: "Verify your email address",
7
+ LOGO: "Logo",
8
+ CLICK_BUTTON_TO_VERIFY_EMAIL: "Click the button below to verify your email address {emailAddress} for your {appName} account.",
9
+ VERIFY_EMAIL_ADDRESS: "Verify email address",
10
+ OR_COPY_AND_PASTE_URL: "Or copy and paste this URL into your browser:",
11
+ THIS_LINK_EXPIRES_IN_MINUTES: "This link expires in {expirationMinutes} minutes.",
12
+ EMAIL_SENT_BY: "Email sent by {appName}.",
13
+ 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.",
14
+ POWERED_BY_BETTER_AUTH: "Powered by {betterAuth}"
132
15
  };
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
16
+ /**
17
+ * Email template component that sends email verification links to users.
18
+ *
19
+ * This email includes:
20
+ * - Verification button and fallback URL
21
+ * - Expiration time information
22
+ * - Security notice for unauthorized requests
23
+ * - Customizable branding and styling
24
+ * - Support for light/dark mode themes
25
+ *
26
+ * @example
27
+ * ```tsx
28
+ * <EmailVerificationEmail
29
+ * url="https://example.com/verify?token=abc123"
30
+ * email="user@example.com"
31
+ * appName="My App"
32
+ * expirationMinutes={60}
33
+ * logoURL="https://example.com/logo.png"
34
+ * darkMode={true}
35
+ * />
36
+ * ```
37
+ */
38
+ export const EmailVerificationEmail = ({ url, email, appName, expirationMinutes = 60, logoURL, colors, classNames, darkMode = true, poweredBy, head, ...props }) => {
39
+ const localization = {
40
+ ...EmailVerificationEmail.localization,
41
+ ...props.localization
42
+ };
43
+ const previewText = localization.VERIFY_YOUR_EMAIL_ADDRESS;
44
+ return (_jsxs(Html, { children: [_jsxs(Head, { children: [_jsx("meta", { content: "light dark", name: "color-scheme" }), _jsx("meta", { content: "light dark", name: "supported-color-schemes" }), _jsx(EmailStyles, { colors: colors, darkMode: darkMode }), head] }), _jsx(Preview, { children: previewText }), _jsx(Tailwind, { config: { presets: [pixelBasedPreset] }, children: _jsx(Body, { className: cn("bg-background font-sans", classNames?.body), children: _jsx(Container, { className: cn("mx-auto my-auto max-w-xl px-2 py-10", classNames?.container), children: _jsxs(Section, { className: cn("bg-card text-card-foreground rounded-none border border-border p-8", classNames?.card), children: [logoURL &&
45
+ (typeof logoURL === "string" ? (_jsx(Img, { src: logoURL, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("mx-auto mb-8", classNames?.logo) })) : (_jsxs(_Fragment, { children: [_jsx(Img, { src: logoURL.light, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("mx-auto mb-8 logo-light", classNames?.logo) }), _jsx(Img, { src: logoURL.dark, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("hidden mx-auto mb-8 logo-dark", classNames?.logo) })] }))), _jsx(Heading, { className: cn("m-0 mb-5 text-2xl font-semibold", classNames?.title), children: localization.VERIFY_EMAIL_ADDRESS }), _jsx(Text, { className: cn("text-sm font-normal", classNames?.content), children: (() => {
46
+ const textWithAppName = localization.CLICK_BUTTON_TO_VERIFY_EMAIL.replace("{appName}", appName || "")
47
+ .replace(/\s{2,}/g, " ")
48
+ .replace(" .", ".");
49
+ const [beforeEmailAddress, afterEmailAddress] = textWithAppName.split("{emailAddress}");
50
+ return email ? (_jsxs(_Fragment, { children: [beforeEmailAddress, _jsx(Link, { href: `mailto:${email}`, className: "text-primary font-medium", children: email }), afterEmailAddress] })) : (textWithAppName
51
+ .replace("{emailAddress}", "")
52
+ .replace(/\s{2,}/g, " ")
53
+ .replace(" .", "."));
54
+ })() }), _jsx(Section, { className: "my-6", children: _jsx(Button, { href: url, className: cn("inline-block whitespace-nowrap rounded-none text-sm font-medium py-2.5 px-6 bg-primary text-primary-foreground no-underline", classNames?.button), children: localization.VERIFY_EMAIL_ADDRESS }) }), _jsx(Text, { className: cn("mb-3 text-xs text-muted-foreground", classNames?.description), children: localization.OR_COPY_AND_PASTE_URL }), _jsx(Link, { className: cn("break-all text-xs text-primary", classNames?.link), href: url, children: url }), _jsx(Hr, { className: cn("my-6 w-full border border-solid border-border", classNames?.separator) }), expirationMinutes || appName ? (_jsxs(Text, { className: cn("mb-3 text-xs text-muted-foreground", classNames?.description), children: [expirationMinutes
55
+ ? localization.THIS_LINK_EXPIRES_IN_MINUTES.replace("{expirationMinutes}", expirationMinutes.toString())
56
+ : null, appName && (_jsxs(_Fragment, { children: [expirationMinutes ? " " : "", localization.EMAIL_SENT_BY.replace("{appName}", appName)] }))] })) : null, _jsx(Text, { className: cn("mt-3 text-xs text-muted-foreground", classNames?.description), children: localization.IF_YOU_DIDNT_REQUEST_THIS_EMAIL }), poweredBy && (_jsx(Text, { className: cn("mt-4 mb-0 text-center text-[11px] text-muted-foreground", classNames?.poweredBy), children: (() => {
57
+ const [beforeBetterAuth, afterBetterAuth] = localization.POWERED_BY_BETTER_AUTH.split("{betterAuth}");
58
+ return (_jsxs(_Fragment, { children: [beforeBetterAuth, _jsx(Link, { href: "https://better-auth.com", className: cn("text-primary underline", classNames?.link), children: "better-auth" }), afterBetterAuth] }));
59
+ })() }))] }) }) }) })] }));
138
60
  };
139
- //#endregion
140
- export { b as default };
61
+ /**
62
+ * Default localization strings for the email verification template.
63
+ * Can be overridden via the `localization` prop.
64
+ */
65
+ EmailVerificationEmail.localization = emailVerificationEmailLocalization;
66
+ /**
67
+ * Example props for previewing the email template in development.
68
+ */
69
+ EmailVerificationEmail.PreviewProps = {
70
+ url: "https://better-auth-ui.com/auth/verify-email?token=example-token",
71
+ appName: "Better Auth",
72
+ email: "m@example.com",
73
+ darkMode: true
74
+ };
75
+ export default EmailVerificationEmail;
@@ -1,9 +1,10 @@
1
- export * from './email-changed';
2
- export * from './email-localization';
3
- export * from './email-styles';
4
- export * from './email-verification';
5
- export * from './magic-link';
6
- export * from './new-device';
7
- export * from './otp-email';
8
- export * from './password-changed';
9
- export * from './reset-password';
1
+ export * from "./email-changed";
2
+ export * from "./email-localization";
3
+ export * from "./email-styles";
4
+ export * from "./email-verification";
5
+ export * from "./magic-link";
6
+ export * from "./new-device";
7
+ export * from "./organization-invitation";
8
+ export * from "./otp-email";
9
+ export * from "./password-changed";
10
+ export * from "./reset-password";
@@ -1,9 +1,10 @@
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
+ export * from "./email-changed";
2
+ export * from "./email-localization";
3
+ export * from "./email-styles";
4
+ export * from "./email-verification";
5
+ export * from "./magic-link";
6
+ export * from "./new-device";
7
+ export * from "./organization-invitation";
8
+ export * from "./otp-email";
9
+ export * from "./password-changed";
10
+ export * from "./reset-password";
@@ -1,5 +1,5 @@
1
- import { ReactNode } from 'react';
2
- import { EmailClassNames, EmailColors } from './email-styles';
1
+ import type { ReactNode } from "react";
2
+ import { type EmailClassNames, type EmailColors } from "./email-styles";
3
3
  declare const magicLinkEmailLocalization: {
4
4
  SIGN_IN_TO_APP_NAME: string;
5
5
  SIGN_IN_TO_YOUR_ACCOUNT: string;
@@ -1,141 +1,72 @@
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
- ] });
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Body, Button, Container, Head, Heading, Hr, Html, Img, Link, Preview, pixelBasedPreset, Section, Tailwind, Text } from "@react-email/components";
3
+ import { cn } from "../../../lib/utils";
4
+ import { EmailStyles } from "./email-styles";
5
+ const magicLinkEmailLocalization = {
6
+ SIGN_IN_TO_APP_NAME: "Sign in to {appName}",
7
+ SIGN_IN_TO_YOUR_ACCOUNT: "Sign in to your account",
8
+ YOUR_ACCOUNT: "your account",
9
+ LOGO: "Logo",
10
+ CLICK_BUTTON_TO_SIGN_IN: "Click the button below to sign in to your account {emailAddress}.",
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}"
133
16
  };
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
17
+ /**
18
+ * Email template component that sends magic link authentication emails for passwordless sign-in.
19
+ *
20
+ * This email includes:
21
+ * - Sign-in button with magic link
22
+ * - Fallback URL for manual copy/paste
23
+ * - Expiration time information
24
+ * - Security notice for unauthorized requests
25
+ * - Customizable branding and styling
26
+ * - Support for light/dark mode themes
27
+ *
28
+ * @example
29
+ * ```tsx
30
+ * <MagicLinkEmail
31
+ * url="https://example.com/auth/verify?token=abc123"
32
+ * email="user@example.com"
33
+ * appName="My App"
34
+ * expirationMinutes={5}
35
+ * logoURL="https://example.com/logo.png"
36
+ * darkMode={true}
37
+ * />
38
+ * ```
39
+ */
40
+ export const MagicLinkEmail = ({ url, email, appName, expirationMinutes = 5, logoURL, colors, classNames, darkMode = true, poweredBy, head, ...props }) => {
41
+ const localization = {
42
+ ...MagicLinkEmail.localization,
43
+ ...props.localization
44
+ };
45
+ const previewText = appName
46
+ ? localization.SIGN_IN_TO_APP_NAME.replace("{appName}", appName)
47
+ : localization.SIGN_IN_TO_YOUR_ACCOUNT;
48
+ return (_jsxs(Html, { children: [_jsxs(Head, { children: [_jsx("meta", { content: "light dark", name: "color-scheme" }), _jsx("meta", { content: "light dark", name: "supported-color-schemes" }), _jsx(EmailStyles, { colors: colors, darkMode: darkMode }), head] }), _jsx(Preview, { children: previewText }), _jsx(Tailwind, { config: { presets: [pixelBasedPreset] }, children: _jsx(Body, { className: cn("bg-background font-sans", classNames?.body), children: _jsx(Container, { className: cn("mx-auto my-auto max-w-xl px-2 py-10", classNames?.container), children: _jsxs(Section, { className: cn("bg-card text-card-foreground rounded-none border border-border p-8", classNames?.card), children: [logoURL &&
49
+ (typeof logoURL === "string" ? (_jsx(Img, { src: logoURL, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("mx-auto mb-8", classNames?.logo) })) : (_jsxs(_Fragment, { children: [_jsx(Img, { src: logoURL.light, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("mx-auto mb-8 logo-light", classNames?.logo) }), _jsx(Img, { src: logoURL.dark, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("hidden mx-auto mb-8 logo-dark", classNames?.logo) })] }))), _jsx(Heading, { className: cn("m-0 mb-5 text-2xl font-semibold", classNames?.title), children: appName
50
+ ? localization.SIGN_IN_TO_APP_NAME.replace("{appName}", appName)
51
+ : localization.SIGN_IN_TO_YOUR_ACCOUNT }), _jsx(Text, { className: cn("m-0 text-sm font-normal", classNames?.content), children: (() => {
52
+ const [beforeEmailAddress, afterEmailAddress] = localization.CLICK_BUTTON_TO_SIGN_IN.split("{emailAddress}");
53
+ return email ? (_jsxs(_Fragment, { children: [beforeEmailAddress, _jsx(Link, { href: `mailto:${email}`, className: "text-primary font-medium", children: email }), afterEmailAddress] })) : (localization.CLICK_BUTTON_TO_SIGN_IN.replace("{emailAddress}", "")
54
+ .replace(/\s{2,}/g, " ")
55
+ .replace(" .", "."));
56
+ })() }), _jsx(Section, { className: "my-6", children: _jsx(Button, { href: url, className: cn("inline-block whitespace-nowrap rounded-none text-sm font-medium py-2.5 px-6 bg-primary text-primary-foreground no-underline", classNames?.button), children: appName
57
+ ? localization.SIGN_IN_TO_APP_NAME.replace("{appName}", appName)
58
+ : localization.SIGN_IN_TO_YOUR_ACCOUNT }) }), _jsx(Text, { className: cn("m-0 mb-3 text-xs text-muted-foreground", classNames?.description), children: localization.OR_COPY_AND_PASTE_URL }), _jsx(Link, { className: cn("break-all text-xs text-primary", classNames?.link), href: url, children: url }), _jsx(Hr, { className: cn("my-6 w-full border border-solid border-border", classNames?.separator) }), expirationMinutes || appName ? (_jsxs(Text, { className: cn("m-0 mb-3 text-xs text-muted-foreground", classNames?.description), children: [expirationMinutes
59
+ ? localization.THIS_LINK_EXPIRES_IN_MINUTES.replace("{expirationMinutes}", expirationMinutes.toString())
60
+ : null, appName && (_jsxs(_Fragment, { children: [expirationMinutes ? " " : "", localization.EMAIL_SENT_BY.replace("{appName}", appName)] }))] })) : null, _jsx(Text, { className: cn("m-0 text-xs text-muted-foreground", classNames?.description), children: localization.IF_YOU_DIDNT_REQUEST_THIS_EMAIL }), poweredBy && (_jsx(Text, { className: cn("m-0 mt-4 text-center text-[11px] text-muted-foreground", classNames?.poweredBy), children: (() => {
61
+ const [beforeBetterAuth, afterBetterAuth] = localization.POWERED_BY_BETTER_AUTH.split("{betterAuth}");
62
+ return (_jsxs(_Fragment, { children: [beforeBetterAuth, _jsx(Link, { href: "https://better-auth.com", className: cn("text-primary underline", classNames?.link), children: "better-auth" }), afterBetterAuth] }));
63
+ })() }))] }) }) }) })] }));
139
64
  };
140
- //#endregion
141
- export { b as default };
65
+ MagicLinkEmail.localization = magicLinkEmailLocalization;
66
+ MagicLinkEmail.PreviewProps = {
67
+ url: "https://better-auth-ui.com/auth/verify?token=example-token",
68
+ email: "m@example.com",
69
+ appName: "Better Auth",
70
+ darkMode: true
71
+ };
72
+ export default MagicLinkEmail;
@@ -1,5 +1,5 @@
1
- import { ReactNode } from 'react';
2
- import { EmailClassNames, EmailColors } from './email-styles';
1
+ import type { ReactNode } from "react";
2
+ import { type EmailClassNames, type EmailColors } from "./email-styles";
3
3
  /**
4
4
  * Device information displayed in the new device email notification.
5
5
  */