@better-auth-ui/react 1.6.1 → 1.6.3
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.
- package/dist/components/auth/auth-provider.d.ts +4 -3
- package/dist/components/auth/auth-provider.js +24 -40
- package/dist/components/email/email-changed.d.ts +2 -2
- package/dist/components/email/email-changed.js +154 -68
- package/dist/components/email/email-localization.js +18 -23
- package/dist/components/email/email-styles.js +52 -77
- package/dist/components/email/email-verification.d.ts +2 -2
- package/dist/components/email/email-verification.js +138 -73
- package/dist/components/email/index.d.ts +9 -9
- package/dist/components/email/index.js +9 -9
- package/dist/components/email/magic-link.d.ts +2 -2
- package/dist/components/email/magic-link.js +139 -70
- package/dist/components/email/new-device.d.ts +2 -2
- package/dist/components/email/new-device.js +221 -88
- package/dist/components/email/otp-email.d.ts +2 -2
- package/dist/components/email/otp-email.js +127 -63
- package/dist/components/email/password-changed.d.ts +2 -2
- package/dist/components/email/password-changed.js +157 -74
- package/dist/components/email/reset-password.d.ts +2 -2
- package/dist/components/email/reset-password.js +138 -66
- package/dist/components/icons/apple.d.ts +1 -1
- package/dist/components/icons/apple.js +16 -9
- package/dist/components/icons/atlassian.d.ts +1 -1
- package/dist/components/icons/atlassian.js +38 -13
- package/dist/components/icons/cognito.d.ts +1 -1
- package/dist/components/icons/cognito.js +19 -9
- package/dist/components/icons/discord.d.ts +1 -1
- package/dist/components/icons/discord.js +16 -9
- package/dist/components/icons/dropbox.d.ts +1 -1
- package/dist/components/icons/dropbox.js +16 -9
- package/dist/components/icons/facebook.d.ts +1 -1
- package/dist/components/icons/facebook.js +19 -11
- package/dist/components/icons/figma.d.ts +1 -1
- package/dist/components/icons/figma.js +34 -12
- package/dist/components/icons/github.d.ts +1 -1
- package/dist/components/icons/github.js +16 -11
- package/dist/components/icons/gitlab.d.ts +1 -1
- package/dist/components/icons/gitlab.js +30 -9
- package/dist/components/icons/google.d.ts +1 -1
- package/dist/components/icons/google.js +39 -9
- package/dist/components/icons/huggingface.d.ts +1 -1
- package/dist/components/icons/huggingface.js +38 -9
- package/dist/components/icons/index.d.ts +35 -35
- package/dist/components/icons/index.js +35 -35
- package/dist/components/icons/kakao.d.ts +1 -1
- package/dist/components/icons/kakao.js +16 -11
- package/dist/components/icons/kick.d.ts +1 -1
- package/dist/components/icons/kick.js +20 -11
- package/dist/components/icons/line.d.ts +1 -1
- package/dist/components/icons/line.js +16 -9
- package/dist/components/icons/linear.d.ts +1 -1
- package/dist/components/icons/linear.js +16 -9
- package/dist/components/icons/linkedin.d.ts +1 -1
- package/dist/components/icons/linkedin.js +33 -9
- package/dist/components/icons/microsoft.d.ts +1 -1
- package/dist/components/icons/microsoft.js +30 -9
- package/dist/components/icons/naver.d.ts +1 -1
- package/dist/components/icons/naver.js +16 -9
- package/dist/components/icons/notion.d.ts +1 -1
- package/dist/components/icons/notion.js +16 -9
- package/dist/components/icons/paybin.d.ts +1 -1
- package/dist/components/icons/paybin.js +32 -8
- package/dist/components/icons/paypal.d.ts +1 -1
- package/dist/components/icons/paypal.js +30 -9
- package/dist/components/icons/polar.d.ts +1 -1
- package/dist/components/icons/polar.js +24 -9
- package/dist/components/icons/railway.d.ts +1 -1
- package/dist/components/icons/railway.js +16 -9
- package/dist/components/icons/reddit.d.ts +1 -1
- package/dist/components/icons/reddit.js +21 -9
- package/dist/components/icons/roblox.d.ts +1 -1
- package/dist/components/icons/roblox.js +17 -12
- package/dist/components/icons/salesforce.d.ts +1 -1
- package/dist/components/icons/salesforce.js +16 -9
- package/dist/components/icons/slack.d.ts +1 -1
- package/dist/components/icons/slack.js +30 -9
- package/dist/components/icons/spotify.d.ts +1 -1
- package/dist/components/icons/spotify.js +16 -9
- package/dist/components/icons/tiktok.d.ts +1 -1
- package/dist/components/icons/tiktok.js +23 -10
- package/dist/components/icons/twitch.d.ts +1 -1
- package/dist/components/icons/twitch.js +43 -12
- package/dist/components/icons/vercel.d.ts +1 -1
- package/dist/components/icons/vercel.js +16 -9
- package/dist/components/icons/vk.d.ts +1 -1
- package/dist/components/icons/vk.js +16 -9
- package/dist/components/icons/wechat.d.ts +1 -1
- package/dist/components/icons/wechat.js +16 -9
- package/dist/components/icons/x.d.ts +1 -1
- package/dist/components/icons/x.js +16 -9
- package/dist/components/icons/zoom.d.ts +1 -1
- package/dist/components/icons/zoom.js +69 -11
- package/dist/components/settings/account/theme-preview.js +286 -7
- package/dist/core.d.ts +1 -1
- package/dist/hooks/auth/use-authenticate.d.ts +30 -6
- package/dist/hooks/auth/use-authenticate.js +22 -27
- package/dist/hooks/auth/use-is-username-available.d.ts +20 -0
- package/dist/hooks/auth/use-is-username-available.js +13 -0
- package/dist/hooks/auth/use-request-password-reset.d.ts +12 -17
- package/dist/hooks/auth/use-request-password-reset.js +12 -13
- package/dist/hooks/auth/use-reset-password.d.ts +14 -31
- package/dist/hooks/auth/use-reset-password.js +12 -12
- package/dist/hooks/auth/use-send-verification-email.d.ts +11 -16
- package/dist/hooks/auth/use-send-verification-email.js +12 -12
- package/dist/hooks/auth/use-session.d.ts +31 -5
- package/dist/hooks/auth/use-session.js +15 -17
- package/dist/hooks/auth/use-sign-in-email.d.ts +12 -39
- package/dist/hooks/auth/use-sign-in-email.js +16 -24
- package/dist/hooks/auth/use-sign-in-magic-link.d.ts +15 -20
- package/dist/hooks/auth/use-sign-in-magic-link.js +12 -12
- package/dist/hooks/auth/use-sign-in-passkey.d.ts +13 -50
- package/dist/hooks/auth/use-sign-in-passkey.js +16 -24
- package/dist/hooks/auth/use-sign-in-social.d.ts +32 -62
- package/dist/hooks/auth/use-sign-in-social.js +12 -12
- package/dist/hooks/auth/use-sign-in-username.d.ts +25 -0
- package/dist/hooks/auth/use-sign-in-username.js +17 -0
- package/dist/hooks/auth/use-sign-out.d.ts +11 -12
- package/dist/hooks/auth/use-sign-out.js +15 -23
- package/dist/hooks/auth/use-sign-up-email.d.ts +178 -262
- package/dist/hooks/auth/use-sign-up-email.js +16 -24
- package/dist/hooks/auth/use-user.d.ts +63 -61
- package/dist/hooks/auth/use-user.js +10 -13
- package/dist/hooks/settings/use-account-info.d.ts +12 -12
- package/dist/hooks/settings/use-account-info.js +17 -24
- package/dist/hooks/settings/use-add-passkey.d.ts +11 -33
- package/dist/hooks/settings/use-add-passkey.js +16 -23
- package/dist/hooks/settings/use-change-email.d.ts +12 -15
- package/dist/hooks/settings/use-change-email.js +16 -22
- package/dist/hooks/settings/use-change-password.d.ts +12 -45
- package/dist/hooks/settings/use-change-password.js +12 -10
- package/dist/hooks/settings/use-delete-passkey.d.ts +11 -13
- package/dist/hooks/settings/use-delete-passkey.js +16 -23
- package/dist/hooks/settings/use-delete-user.d.ts +14 -32
- package/dist/hooks/settings/use-delete-user.js +12 -10
- package/dist/hooks/settings/use-link-social.d.ts +23 -26
- package/dist/hooks/settings/use-link-social.js +12 -9
- package/dist/hooks/settings/use-list-accounts.d.ts +10 -8
- package/dist/hooks/settings/use-list-accounts.js +14 -22
- package/dist/hooks/settings/use-list-device-sessions.d.ts +30 -7
- package/dist/hooks/settings/use-list-device-sessions.js +14 -21
- package/dist/hooks/settings/use-list-sessions.d.ts +10 -7
- package/dist/hooks/settings/use-list-sessions.js +14 -21
- package/dist/hooks/settings/use-list-user-passkeys.d.ts +9 -6
- package/dist/hooks/settings/use-list-user-passkeys.js +14 -21
- package/dist/hooks/settings/use-revoke-multi-session.d.ts +12 -12
- package/dist/hooks/settings/use-revoke-multi-session.js +16 -19
- package/dist/hooks/settings/use-revoke-session.d.ts +12 -12
- package/dist/hooks/settings/use-revoke-session.js +16 -20
- package/dist/hooks/settings/use-set-active-session.d.ts +13 -30
- package/dist/hooks/settings/use-set-active-session.js +19 -27
- package/dist/hooks/settings/use-unlink-account.d.ts +13 -13
- package/dist/hooks/settings/use-unlink-account.js +16 -20
- package/dist/hooks/settings/use-update-user.d.ts +1179 -5
- package/dist/hooks/settings/use-update-user.js +23 -28
- package/dist/hooks/use-auth-mutation.d.ts +12 -0
- package/dist/hooks/use-auth-mutation.js +11 -0
- package/dist/hooks/use-auth-query.d.ts +14 -0
- package/dist/hooks/use-auth-query.js +15 -0
- package/dist/index.d.ts +40 -36
- package/dist/index.js +84 -36
- package/dist/lib/auth-client.d.ts +1254 -1254
- package/dist/lib/auth-client.js +11 -11
- package/dist/lib/auth-config.d.ts +3 -3
- package/dist/lib/auth-context.d.ts +2 -2
- package/dist/lib/auth-context.js +5 -2
- package/dist/lib/provider-icons.d.ts +2 -2
- package/dist/lib/provider-icons.js +75 -47
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.js +7 -4
- package/dist/mutations/auth/is-username-available-options.d.ts +19 -0
- package/dist/mutations/auth/is-username-available-options.js +7 -0
- package/dist/mutations/auth/request-password-reset-options.d.ts +15 -0
- package/dist/mutations/auth/request-password-reset-options.js +7 -0
- package/dist/mutations/auth/reset-password-options.d.ts +17 -0
- package/dist/mutations/auth/reset-password-options.js +7 -0
- package/dist/mutations/auth/send-verification-email-options.d.ts +15 -0
- package/dist/mutations/auth/send-verification-email-options.js +7 -0
- package/dist/mutations/auth/sign-in-email-options.d.ts +23 -0
- package/dist/mutations/auth/sign-in-email-options.js +11 -0
- package/dist/mutations/auth/sign-in-magic-link-options.d.ts +23 -0
- package/dist/mutations/auth/sign-in-magic-link-options.js +11 -0
- package/dist/mutations/auth/sign-in-passkey-options.d.ts +15 -0
- package/dist/mutations/auth/sign-in-passkey-options.js +11 -0
- package/dist/mutations/auth/sign-in-social-options.d.ts +61 -0
- package/dist/mutations/auth/sign-in-social-options.js +11 -0
- package/dist/mutations/auth/sign-in-username-options.d.ts +19 -0
- package/dist/mutations/auth/sign-in-username-options.js +11 -0
- package/dist/mutations/auth/sign-out-options.d.ts +12 -0
- package/dist/mutations/auth/sign-out-options.js +7 -0
- package/dist/mutations/auth/sign-up-email-options.d.ts +1180 -0
- package/dist/mutations/auth/sign-up-email-options.js +11 -0
- package/dist/mutations/auth-mutation-options.d.ts +25 -0
- package/dist/mutations/auth-mutation-options.js +19 -0
- package/dist/mutations/settings/add-passkey-options.d.ts +15 -0
- package/dist/mutations/settings/add-passkey-options.js +11 -0
- package/dist/mutations/settings/change-email-options.d.ts +15 -0
- package/dist/mutations/settings/change-email-options.js +7 -0
- package/dist/mutations/settings/change-password-options.d.ts +17 -0
- package/dist/mutations/settings/change-password-options.js +7 -0
- package/dist/mutations/settings/delete-passkey-options.d.ts +13 -0
- package/dist/mutations/settings/delete-passkey-options.js +11 -0
- package/dist/mutations/settings/delete-user-options.d.ts +20 -0
- package/dist/mutations/settings/delete-user-options.js +7 -0
- package/dist/mutations/settings/link-social-options.d.ts +39 -0
- package/dist/mutations/settings/link-social-options.js +7 -0
- package/dist/mutations/settings/revoke-multi-session-options.d.ts +13 -0
- package/dist/mutations/settings/revoke-multi-session-options.js +11 -0
- package/dist/mutations/settings/revoke-session-options.d.ts +13 -0
- package/dist/mutations/settings/revoke-session-options.js +7 -0
- package/dist/mutations/settings/set-active-session-options.d.ts +13 -0
- package/dist/mutations/settings/set-active-session-options.js +11 -0
- package/dist/mutations/settings/unlink-account-options.d.ts +15 -0
- package/dist/mutations/settings/unlink-account-options.js +7 -0
- package/dist/mutations/settings/update-user-options.d.ts +1182 -0
- package/dist/mutations/settings/update-user-options.js +7 -0
- package/dist/queries/auth/session-options.d.ts +110 -0
- package/dist/queries/auth/session-options.js +7 -0
- package/dist/queries/auth-query-options.d.ts +29 -0
- package/dist/queries/auth-query-options.js +17 -0
- package/dist/queries/settings/account-info-options.d.ts +32 -0
- package/dist/queries/settings/account-info-options.js +12 -0
- package/dist/queries/settings/list-accounts-options.d.ts +53 -0
- package/dist/queries/settings/list-accounts-options.js +12 -0
- package/dist/queries/settings/list-device-sessions-options.d.ts +99 -0
- package/dist/queries/settings/list-device-sessions-options.js +12 -0
- package/dist/queries/settings/list-sessions-options.d.ts +54 -0
- package/dist/queries/settings/list-sessions-options.js +12 -0
- package/dist/queries/settings/list-user-passkeys-options.d.ts +18 -0
- package/dist/queries/settings/list-user-passkeys-options.js +12 -0
- package/package.json +11 -11
- package/src/components/auth/auth-provider.tsx +4 -6
- package/src/hooks/auth/use-authenticate.ts +8 -9
- package/src/hooks/auth/use-is-username-available.ts +31 -0
- package/src/hooks/auth/use-request-password-reset.ts +20 -11
- package/src/hooks/auth/use-reset-password.ts +20 -12
- package/src/hooks/auth/use-send-verification-email.ts +19 -11
- package/src/hooks/auth/use-session.ts +22 -17
- package/src/hooks/auth/use-sign-in-email.ts +24 -19
- package/src/hooks/auth/use-sign-in-magic-link.ts +19 -13
- package/src/hooks/auth/use-sign-in-passkey.ts +24 -18
- package/src/hooks/auth/use-sign-in-social.ts +19 -11
- package/src/hooks/auth/use-sign-in-username.ts +40 -0
- package/src/hooks/auth/use-sign-out.ts +20 -20
- package/src/hooks/auth/use-sign-up-email.ts +25 -21
- package/src/hooks/auth/use-user.ts +7 -9
- package/src/hooks/settings/use-account-info.ts +31 -21
- package/src/hooks/settings/use-add-passkey.ts +22 -17
- package/src/hooks/settings/use-change-email.ts +24 -20
- package/src/hooks/settings/use-change-password.ts +19 -11
- package/src/hooks/settings/use-delete-passkey.ts +21 -16
- package/src/hooks/settings/use-delete-user.ts +19 -11
- package/src/hooks/settings/use-link-social.ts +20 -10
- package/src/hooks/settings/use-list-accounts.ts +28 -16
- package/src/hooks/settings/use-list-device-sessions.ts +29 -22
- package/src/hooks/settings/use-list-sessions.ts +28 -15
- package/src/hooks/settings/use-list-user-passkeys.ts +28 -17
- package/src/hooks/settings/use-revoke-multi-session.ts +28 -19
- package/src/hooks/settings/use-revoke-session.ts +26 -18
- package/src/hooks/settings/use-set-active-session.ts +40 -28
- package/src/hooks/settings/use-unlink-account.ts +23 -17
- package/src/hooks/settings/use-update-user.ts +33 -27
- package/src/hooks/use-auth-mutation.ts +29 -0
- package/src/hooks/use-auth-query.ts +36 -0
- package/src/index.ts +4 -0
- package/src/lib/auth-config.ts +1 -1
- package/src/mutations/auth/is-username-available-options.ts +18 -0
- package/src/mutations/auth/request-password-reset-options.ts +14 -0
- package/src/mutations/auth/reset-password-options.ts +14 -0
- package/src/mutations/auth/send-verification-email-options.ts +14 -0
- package/src/mutations/auth/sign-in-email-options.ts +19 -0
- package/src/mutations/auth/sign-in-magic-link-options.ts +15 -0
- package/src/mutations/auth/sign-in-passkey-options.ts +15 -0
- package/src/mutations/auth/sign-in-social-options.ts +19 -0
- package/src/mutations/auth/sign-in-username-options.ts +15 -0
- package/src/mutations/auth/sign-out-options.ts +11 -0
- package/src/mutations/auth/sign-up-email-options.ts +15 -0
- package/src/mutations/auth-mutation-options.ts +49 -0
- package/src/mutations/settings/add-passkey-options.ts +15 -0
- package/src/mutations/settings/change-email-options.ts +11 -0
- package/src/mutations/settings/change-password-options.ts +14 -0
- package/src/mutations/settings/delete-passkey-options.ts +15 -0
- package/src/mutations/settings/delete-user-options.ts +11 -0
- package/src/mutations/settings/link-social-options.ts +11 -0
- package/src/mutations/settings/revoke-multi-session-options.ts +15 -0
- package/src/mutations/settings/revoke-session-options.ts +14 -0
- package/src/mutations/settings/set-active-session-options.ts +15 -0
- package/src/mutations/settings/unlink-account-options.ts +14 -0
- package/src/mutations/settings/update-user-options.ts +15 -0
- package/src/queries/auth/session-options.ts +18 -0
- package/src/queries/auth-query-options.ts +34 -0
- package/src/queries/settings/account-info-options.ts +25 -0
- package/src/queries/settings/list-accounts-options.ts +26 -0
- package/src/queries/settings/list-device-sessions-options.ts +24 -0
- package/src/queries/settings/list-sessions-options.ts +23 -0
- package/src/queries/settings/list-user-passkeys-options.ts +23 -0
- package/dist/hooks/auth/use-auth-mutation.d.ts +0 -18
- package/dist/hooks/auth/use-auth-mutation.js +0 -10
- package/dist/hooks/auth/use-auth-query.d.ts +0 -24
- package/dist/hooks/auth/use-auth-query.js +0 -10
- package/dist/lib/auth-config.js +0 -1
- package/src/hooks/auth/use-auth-mutation.ts +0 -56
- package/src/hooks/auth/use-auth-query.ts +0 -50
|
@@ -1,75 +1,140 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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/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
|
+
] });
|
|
15
132
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
})() }))] }) }) }) })] }));
|
|
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
|
|
60
138
|
};
|
|
61
|
-
|
|
62
|
-
|
|
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;
|
|
139
|
+
//#endregion
|
|
140
|
+
export { b as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
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,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { EmailClassNames, 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,72 +1,141 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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/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
|
+
] });
|
|
16
133
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
})() }))] }) }) }) })] }));
|
|
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
|
|
64
139
|
};
|
|
65
|
-
|
|
66
|
-
|
|
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;
|
|
140
|
+
//#endregion
|
|
141
|
+
export { b as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { EmailClassNames, EmailColors } from './email-styles';
|
|
3
3
|
/**
|
|
4
4
|
* Device information displayed in the new device email notification.
|
|
5
5
|
*/
|