@better-auth-ui/solid 1.6.19

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 (270) hide show
  1. package/dist/components/auth/email/email-changed.d.ts +59 -0
  2. package/dist/components/auth/email/email-changed.js +264 -0
  3. package/dist/components/auth/email/email-styles.d.ts +48 -0
  4. package/dist/components/auth/email/email-styles.js +107 -0
  5. package/dist/components/auth/email/email-verification.d.ts +51 -0
  6. package/dist/components/auth/email/email-verification.js +212 -0
  7. package/dist/components/auth/email/index.d.ts +9 -0
  8. package/dist/components/auth/email/magic-link.d.ts +53 -0
  9. package/dist/components/auth/email/magic-link.js +213 -0
  10. package/dist/components/auth/email/new-device.d.ts +77 -0
  11. package/dist/components/auth/email/new-device.js +326 -0
  12. package/dist/components/auth/email/organization-invitation.d.ts +70 -0
  13. package/dist/components/auth/email/organization-invitation.js +260 -0
  14. package/dist/components/auth/email/otp-email.d.ts +49 -0
  15. package/dist/components/auth/email/otp-email.js +191 -0
  16. package/dist/components/auth/email/password-changed.d.ts +56 -0
  17. package/dist/components/auth/email/password-changed.js +236 -0
  18. package/dist/components/auth/email/reset-password.d.ts +51 -0
  19. package/dist/components/auth/email/reset-password.js +212 -0
  20. package/dist/email.d.ts +18 -0
  21. package/dist/email.js +10 -0
  22. package/dist/hooks/auth/use-authenticate.d.ts +3 -0
  23. package/dist/hooks/auth/use-authenticate.js +18 -0
  24. package/dist/hooks/auth/use-sign-out.d.ts +2 -0
  25. package/dist/hooks/auth/use-sign-out.js +17 -0
  26. package/dist/hooks/auth/use-user.d.ts +213 -0
  27. package/dist/hooks/auth/use-user.js +13 -0
  28. package/dist/hooks/use-auth-mutation.d.ts +6 -0
  29. package/dist/hooks/use-auth-mutation.js +11 -0
  30. package/dist/hooks/use-auth-query.d.ts +5 -0
  31. package/dist/hooks/use-auth-query.js +17 -0
  32. package/dist/index.d.ts +48 -0
  33. package/dist/index.js +68 -0
  34. package/dist/lib/auth-client.d.ts +26 -0
  35. package/dist/lib/auth-config.d.ts +12 -0
  36. package/dist/lib/auth-config.js +21 -0
  37. package/dist/lib/auth-plugin.d.ts +16 -0
  38. package/dist/lib/auth-provider.d.ts +12 -0
  39. package/dist/lib/auth-provider.js +36 -0
  40. package/dist/lib/auth-server.d.ts +16 -0
  41. package/dist/lib/auth-utils.d.ts +3 -0
  42. package/dist/lib/auth-utils.js +12 -0
  43. package/dist/lib/fetch-options-provider.d.ts +23 -0
  44. package/dist/lib/fetch-options-provider.js +29 -0
  45. package/dist/lib/mutation-invalidator.d.ts +11 -0
  46. package/dist/lib/mutation-invalidator.js +20 -0
  47. package/dist/lib/provider-icons.d.ts +8 -0
  48. package/dist/lib/provider-icons.js +5 -0
  49. package/dist/mutations/api-key/create-api-key-mutation.d.ts +71 -0
  50. package/dist/mutations/api-key/create-api-key-mutation.js +12 -0
  51. package/dist/mutations/api-key/delete-api-key-mutation.d.ts +23 -0
  52. package/dist/mutations/api-key/delete-api-key-mutation.js +12 -0
  53. package/dist/mutations/auth/request-password-reset-mutation.d.ts +11 -0
  54. package/dist/mutations/auth/request-password-reset-mutation.js +8 -0
  55. package/dist/mutations/auth/reset-password-mutation.d.ts +13 -0
  56. package/dist/mutations/auth/reset-password-mutation.js +8 -0
  57. package/dist/mutations/auth/send-verification-email-mutation.d.ts +11 -0
  58. package/dist/mutations/auth/send-verification-email-mutation.js +8 -0
  59. package/dist/mutations/auth/sign-in-email-mutation.d.ts +15 -0
  60. package/dist/mutations/auth/sign-in-email-mutation.js +8 -0
  61. package/dist/mutations/auth/sign-in-social-mutation.d.ts +53 -0
  62. package/dist/mutations/auth/sign-in-social-mutation.js +8 -0
  63. package/dist/mutations/auth/sign-out-mutation.d.ts +6 -0
  64. package/dist/mutations/auth/sign-out-mutation.js +8 -0
  65. package/dist/mutations/auth/sign-up-email-mutation.d.ts +17 -0
  66. package/dist/mutations/auth/sign-up-email-mutation.js +8 -0
  67. package/dist/mutations/auth-mutation-options.d.ts +10 -0
  68. package/dist/mutations/auth-mutation-options.js +19 -0
  69. package/dist/mutations/create-auth-mutation.d.ts +10 -0
  70. package/dist/mutations/create-auth-mutation.js +20 -0
  71. package/dist/mutations/magic-link/sign-in-magic-link-mutation.d.ts +19 -0
  72. package/dist/mutations/magic-link/sign-in-magic-link-mutation.js +8 -0
  73. package/dist/mutations/multi-session/revoke-multi-session-mutation.d.ts +19 -0
  74. package/dist/mutations/multi-session/revoke-multi-session-mutation.js +12 -0
  75. package/dist/mutations/multi-session/set-active-session-mutation.d.ts +19 -0
  76. package/dist/mutations/multi-session/set-active-session-mutation.js +13 -0
  77. package/dist/mutations/organization/accept-invitation-mutation.d.ts +18 -0
  78. package/dist/mutations/organization/accept-invitation-mutation.js +12 -0
  79. package/dist/mutations/organization/cancel-invitation-mutation.d.ts +18 -0
  80. package/dist/mutations/organization/cancel-invitation-mutation.js +12 -0
  81. package/dist/mutations/organization/check-slug-mutation.d.ts +18 -0
  82. package/dist/mutations/organization/check-slug-mutation.js +15 -0
  83. package/dist/mutations/organization/create-organization-mutation.d.ts +38 -0
  84. package/dist/mutations/organization/create-organization-mutation.js +12 -0
  85. package/dist/mutations/organization/delete-organization-mutation.d.ts +18 -0
  86. package/dist/mutations/organization/delete-organization-mutation.js +12 -0
  87. package/dist/mutations/organization/index.d.ts +13 -0
  88. package/dist/mutations/organization/index.js +13 -0
  89. package/dist/mutations/organization/invite-member-mutation.d.ts +30 -0
  90. package/dist/mutations/organization/invite-member-mutation.js +12 -0
  91. package/dist/mutations/organization/leave-organization-mutation.d.ts +18 -0
  92. package/dist/mutations/organization/leave-organization-mutation.js +12 -0
  93. package/dist/mutations/organization/metadata.d.ts +13 -0
  94. package/dist/mutations/organization/metadata.js +27 -0
  95. package/dist/mutations/organization/reject-invitation-mutation.d.ts +18 -0
  96. package/dist/mutations/organization/reject-invitation-mutation.js +12 -0
  97. package/dist/mutations/organization/remove-member-mutation.d.ts +22 -0
  98. package/dist/mutations/organization/remove-member-mutation.js +12 -0
  99. package/dist/mutations/organization/set-active-organization-mutation.d.ts +24 -0
  100. package/dist/mutations/organization/set-active-organization-mutation.js +35 -0
  101. package/dist/mutations/organization/update-member-role-mutation.d.ts +26 -0
  102. package/dist/mutations/organization/update-member-role-mutation.js +12 -0
  103. package/dist/mutations/organization/update-organization-mutation.d.ts +42 -0
  104. package/dist/mutations/organization/update-organization-mutation.js +12 -0
  105. package/dist/mutations/organization/utils.d.ts +8 -0
  106. package/dist/mutations/organization/utils.js +17 -0
  107. package/dist/mutations/passkey/add-passkey-mutation.d.ts +73 -0
  108. package/dist/mutations/passkey/add-passkey-mutation.js +12 -0
  109. package/dist/mutations/passkey/delete-passkey-mutation.d.ts +19 -0
  110. package/dist/mutations/passkey/delete-passkey-mutation.js +12 -0
  111. package/dist/mutations/passkey/sign-in-passkey-mutation.d.ts +50 -0
  112. package/dist/mutations/passkey/sign-in-passkey-mutation.js +9 -0
  113. package/dist/mutations/settings/change-email-mutation.d.ts +11 -0
  114. package/dist/mutations/settings/change-email-mutation.js +8 -0
  115. package/dist/mutations/settings/change-password-mutation.d.ts +13 -0
  116. package/dist/mutations/settings/change-password-mutation.js +8 -0
  117. package/dist/mutations/settings/delete-user-mutation.d.ts +13 -0
  118. package/dist/mutations/settings/delete-user-mutation.js +8 -0
  119. package/dist/mutations/settings/link-social-mutation.d.ts +35 -0
  120. package/dist/mutations/settings/link-social-mutation.js +8 -0
  121. package/dist/mutations/settings/revoke-session-mutation.d.ts +19 -0
  122. package/dist/mutations/settings/revoke-session-mutation.js +12 -0
  123. package/dist/mutations/settings/unlink-account-mutation.d.ts +23 -0
  124. package/dist/mutations/settings/unlink-account-mutation.js +12 -0
  125. package/dist/mutations/settings/update-user-mutation.d.ts +6 -0
  126. package/dist/mutations/settings/update-user-mutation.js +8 -0
  127. package/dist/mutations/use-session-scoped-mutation.d.ts +17 -0
  128. package/dist/mutations/use-session-scoped-mutation.js +17 -0
  129. package/dist/mutations/username/is-username-available-mutation.d.ts +9 -0
  130. package/dist/mutations/username/is-username-available-mutation.js +8 -0
  131. package/dist/mutations/username/sign-in-username-mutation.d.ts +15 -0
  132. package/dist/mutations/username/sign-in-username-mutation.js +9 -0
  133. package/dist/plugins/captcha-plugin.d.ts +29 -0
  134. package/dist/plugins/captcha-plugin.js +26 -0
  135. package/dist/plugins.d.ts +2 -0
  136. package/dist/plugins.js +2 -0
  137. package/dist/queries/api-key/list-api-keys-query.d.ts +44 -0
  138. package/dist/queries/api-key/list-api-keys-query.js +17 -0
  139. package/dist/queries/auth/session-query.d.ts +22 -0
  140. package/dist/queries/auth/session-query.js +32 -0
  141. package/dist/queries/auth-query-options.d.ts +14 -0
  142. package/dist/queries/auth-query-options.js +17 -0
  143. package/dist/queries/create-user-scoped-query.d.ts +25 -0
  144. package/dist/queries/create-user-scoped-query.js +29 -0
  145. package/dist/queries/multi-session/list-device-sessions-query.d.ts +23 -0
  146. package/dist/queries/multi-session/list-device-sessions-query.js +17 -0
  147. package/dist/queries/organization/active-organization-query.d.ts +37 -0
  148. package/dist/queries/organization/active-organization-query.js +26 -0
  149. package/dist/queries/organization/full-organization-query.d.ts +35 -0
  150. package/dist/queries/organization/full-organization-query.js +25 -0
  151. package/dist/queries/organization/has-permission-query.d.ts +23 -0
  152. package/dist/queries/organization/has-permission-query.js +31 -0
  153. package/dist/queries/organization/index.d.ts +7 -0
  154. package/dist/queries/organization/index.js +7 -0
  155. package/dist/queries/organization/list-invitations-query.d.ts +29 -0
  156. package/dist/queries/organization/list-invitations-query.js +29 -0
  157. package/dist/queries/organization/list-members-query.d.ts +53 -0
  158. package/dist/queries/organization/list-members-query.js +29 -0
  159. package/dist/queries/organization/list-organizations-query.d.ts +23 -0
  160. package/dist/queries/organization/list-organizations-query.js +25 -0
  161. package/dist/queries/organization/list-user-invitations-query.d.ts +29 -0
  162. package/dist/queries/organization/list-user-invitations-query.js +25 -0
  163. package/dist/queries/organization/plugin.d.ts +1 -0
  164. package/dist/queries/organization/plugin.js +8 -0
  165. package/dist/queries/organization/utils.d.ts +16 -0
  166. package/dist/queries/organization/utils.js +18 -0
  167. package/dist/queries/passkey/list-passkeys-query.d.ts +23 -0
  168. package/dist/queries/passkey/list-passkeys-query.js +17 -0
  169. package/dist/queries/settings/account-info-query.d.ts +35 -0
  170. package/dist/queries/settings/account-info-query.js +17 -0
  171. package/dist/queries/settings/list-accounts-query.d.ts +23 -0
  172. package/dist/queries/settings/list-accounts-query.js +17 -0
  173. package/dist/queries/settings/list-sessions-query.d.ts +24 -0
  174. package/dist/queries/settings/list-sessions-query.js +17 -0
  175. package/dist/server/queries/auth/session-query.d.ts +19 -0
  176. package/dist/server/queries/auth/session-query.js +13 -0
  177. package/dist/server.d.ts +7 -0
  178. package/dist/server.js +7 -0
  179. package/package.json +63 -0
  180. package/src/components/auth/email/email-changed.tsx +305 -0
  181. package/src/components/auth/email/email-styles.tsx +139 -0
  182. package/src/components/auth/email/email-verification.tsx +249 -0
  183. package/src/components/auth/email/index.ts +9 -0
  184. package/src/components/auth/email/magic-link.tsx +254 -0
  185. package/src/components/auth/email/new-device.tsx +347 -0
  186. package/src/components/auth/email/organization-invitation.tsx +322 -0
  187. package/src/components/auth/email/otp-email.tsx +239 -0
  188. package/src/components/auth/email/password-changed.tsx +279 -0
  189. package/src/components/auth/email/reset-password.tsx +250 -0
  190. package/src/email.ts +49 -0
  191. package/src/hooks/auth/use-authenticate.ts +30 -0
  192. package/src/hooks/auth/use-sign-out.ts +23 -0
  193. package/src/hooks/auth/use-user.ts +19 -0
  194. package/src/hooks/use-auth-mutation.ts +35 -0
  195. package/src/hooks/use-auth-query.ts +33 -0
  196. package/src/index.ts +48 -0
  197. package/src/lib/auth-client.ts +43 -0
  198. package/src/lib/auth-config.ts +46 -0
  199. package/src/lib/auth-plugin.ts +20 -0
  200. package/src/lib/auth-provider.tsx +60 -0
  201. package/src/lib/auth-server.ts +25 -0
  202. package/src/lib/auth-utils.ts +25 -0
  203. package/src/lib/fetch-options-provider.tsx +77 -0
  204. package/src/lib/mutation-invalidator.tsx +82 -0
  205. package/src/lib/provider-icons.ts +10 -0
  206. package/src/mutations/api-key/create-api-key-mutation.ts +40 -0
  207. package/src/mutations/api-key/delete-api-key-mutation.ts +40 -0
  208. package/src/mutations/auth/request-password-reset-mutation.ts +15 -0
  209. package/src/mutations/auth/reset-password-mutation.ts +16 -0
  210. package/src/mutations/auth/send-verification-email-mutation.ts +15 -0
  211. package/src/mutations/auth/sign-in-email-mutation.ts +17 -0
  212. package/src/mutations/auth/sign-in-social-mutation.ts +16 -0
  213. package/src/mutations/auth/sign-out-mutation.ts +13 -0
  214. package/src/mutations/auth/sign-up-email-mutation.ts +17 -0
  215. package/src/mutations/auth-mutation-options.ts +62 -0
  216. package/src/mutations/create-auth-mutation.ts +44 -0
  217. package/src/mutations/magic-link/sign-in-magic-link-mutation.ts +15 -0
  218. package/src/mutations/multi-session/revoke-multi-session-mutation.ts +40 -0
  219. package/src/mutations/multi-session/set-active-session-mutation.ts +43 -0
  220. package/src/mutations/organization/accept-invitation-mutation.ts +38 -0
  221. package/src/mutations/organization/cancel-invitation-mutation.ts +38 -0
  222. package/src/mutations/organization/check-slug-mutation.ts +36 -0
  223. package/src/mutations/organization/create-organization-mutation.ts +37 -0
  224. package/src/mutations/organization/delete-organization-mutation.ts +37 -0
  225. package/src/mutations/organization/index.ts +13 -0
  226. package/src/mutations/organization/invite-member-mutation.ts +38 -0
  227. package/src/mutations/organization/leave-organization-mutation.ts +37 -0
  228. package/src/mutations/organization/metadata.ts +103 -0
  229. package/src/mutations/organization/reject-invitation-mutation.ts +38 -0
  230. package/src/mutations/organization/remove-member-mutation.ts +38 -0
  231. package/src/mutations/organization/set-active-organization-mutation.ts +110 -0
  232. package/src/mutations/organization/update-member-role-mutation.ts +38 -0
  233. package/src/mutations/organization/update-organization-mutation.ts +37 -0
  234. package/src/mutations/organization/utils.ts +51 -0
  235. package/src/mutations/passkey/add-passkey-mutation.ts +40 -0
  236. package/src/mutations/passkey/delete-passkey-mutation.ts +40 -0
  237. package/src/mutations/passkey/sign-in-passkey-mutation.ts +17 -0
  238. package/src/mutations/settings/change-email-mutation.ts +17 -0
  239. package/src/mutations/settings/change-password-mutation.ts +16 -0
  240. package/src/mutations/settings/delete-user-mutation.ts +16 -0
  241. package/src/mutations/settings/link-social-mutation.ts +16 -0
  242. package/src/mutations/settings/revoke-session-mutation.ts +38 -0
  243. package/src/mutations/settings/unlink-account-mutation.ts +38 -0
  244. package/src/mutations/settings/update-user-mutation.ts +17 -0
  245. package/src/mutations/use-session-scoped-mutation.ts +64 -0
  246. package/src/mutations/username/is-username-available-mutation.ts +15 -0
  247. package/src/mutations/username/sign-in-username-mutation.ts +17 -0
  248. package/src/plugins/captcha-plugin.tsx +64 -0
  249. package/src/plugins.ts +2 -0
  250. package/src/queries/api-key/list-api-keys-query.ts +93 -0
  251. package/src/queries/auth/session-query.ts +81 -0
  252. package/src/queries/auth-query-options.ts +57 -0
  253. package/src/queries/create-user-scoped-query.ts +107 -0
  254. package/src/queries/multi-session/list-device-sessions-query.ts +107 -0
  255. package/src/queries/organization/active-organization-query.ts +127 -0
  256. package/src/queries/organization/full-organization-query.ts +111 -0
  257. package/src/queries/organization/has-permission-query.ts +121 -0
  258. package/src/queries/organization/index.ts +7 -0
  259. package/src/queries/organization/list-invitations-query.ts +124 -0
  260. package/src/queries/organization/list-members-query.ts +124 -0
  261. package/src/queries/organization/list-organizations-query.ts +113 -0
  262. package/src/queries/organization/list-user-invitations-query.ts +114 -0
  263. package/src/queries/organization/plugin.ts +11 -0
  264. package/src/queries/organization/utils.ts +88 -0
  265. package/src/queries/passkey/list-passkeys-query.ts +93 -0
  266. package/src/queries/settings/account-info-query.ts +94 -0
  267. package/src/queries/settings/list-accounts-query.ts +94 -0
  268. package/src/queries/settings/list-sessions-query.ts +96 -0
  269. package/src/server/queries/auth/session-query.ts +56 -0
  270. package/src/server.ts +7 -0
@@ -0,0 +1,326 @@
1
+ import e from "./email-styles.js";
2
+ import { createComponent as t, ssr as n } from "solid-js/web";
3
+ import { Body as r, Button as i, Container as a, Head as o, Heading as s, Hr as c, Html as l, Img as u, Preview as d, Section as f, Tailwind as p, Text as m } from "@solidjs-email/main";
4
+ import { Show as h } from "solid-js";
5
+ //#region src/components/auth/email/new-device.tsx
6
+ var g = "<meta content=\"light dark\" name=\"color-scheme\">", _ = "<meta content=\"light dark\" name=\"supported-color-schemes\">";
7
+ function v(...e) {
8
+ return e.filter(Boolean).join(" ");
9
+ }
10
+ var y = {
11
+ NEW_SIGN_IN_DETECTED: "New sign-in detected",
12
+ LOGO: "Logo",
13
+ NEW_SIGN_IN_TO_YOUR_ACCOUNT: "We detected a new sign-in to your {appName} account {userEmail} from a device we don't recognize.",
14
+ DEVICE_DETAILS: "Device details",
15
+ BROWSER: "Browser",
16
+ OPERATING_SYSTEM: "Operating System",
17
+ LOCATION: "Location",
18
+ IP_ADDRESS: "IP Address",
19
+ TIME: "Time",
20
+ IF_THIS_WAS_YOU: "If this was you, you can safely ignore this email. If you don't recognize this activity, please secure your account immediately.",
21
+ SECURE_MY_ACCOUNT: "Secure my account",
22
+ EMAIL_SENT_BY: "Email sent by {appName}.",
23
+ IF_YOU_DIDNT_SIGN_IN: "If you didn't sign in, please contact support immediately {supportEmail} to secure your account.",
24
+ POWERED_BY_BETTER_AUTH: "Powered by {betterAuth}"
25
+ };
26
+ function b(e) {
27
+ return e.replace(/\s{2,}/g, " ").replace(" .", ".");
28
+ }
29
+ function x(y) {
30
+ let S = () => y.darkMode ?? !0, C = () => ({
31
+ ...x.localization,
32
+ ...y.localization
33
+ }), w = () => b(C().NEW_SIGN_IN_TO_YOUR_ACCOUNT.replace("{appName}", y.appName || "").replace("{userEmail}", y.userEmail || "")), T = () => b(C().IF_YOU_DIDNT_SIGN_IN.replace("{supportEmail}", y.supportEmail || ""));
34
+ return t(l, { get children() {
35
+ return [
36
+ t(o, { get children() {
37
+ return [
38
+ n(g),
39
+ n(_),
40
+ t(e, {
41
+ get colors() {
42
+ return y.colors;
43
+ },
44
+ get darkMode() {
45
+ return S();
46
+ }
47
+ }),
48
+ y.head
49
+ ];
50
+ } }),
51
+ t(d, { get children() {
52
+ return C().NEW_SIGN_IN_DETECTED;
53
+ } }),
54
+ t(p, { get children() {
55
+ return t(r, {
56
+ get class() {
57
+ return v("bg-background", y.classNames?.body);
58
+ },
59
+ style: { "font-family": "Arial, Helvetica, sans-serif" },
60
+ get children() {
61
+ return t(a, {
62
+ get class() {
63
+ return v("mx-auto my-auto max-w-xl px-2 py-10", y.classNames?.container);
64
+ },
65
+ get children() {
66
+ return t(f, {
67
+ get class() {
68
+ return v("rounded-none border border-border bg-card p-8 text-card-foreground", y.classNames?.card);
69
+ },
70
+ get children() {
71
+ return [
72
+ y.logoURL && (typeof y.logoURL == "string" ? t(u, {
73
+ get alt() {
74
+ return y.appName || C().LOGO;
75
+ },
76
+ get class() {
77
+ return v("mx-auto mb-8", y.classNames?.logo);
78
+ },
79
+ height: 48,
80
+ get src() {
81
+ return y.logoURL;
82
+ },
83
+ width: 48
84
+ }) : [t(u, {
85
+ get alt() {
86
+ return y.appName || C().LOGO;
87
+ },
88
+ get class() {
89
+ return v("logo-light mx-auto mb-8", y.classNames?.logo);
90
+ },
91
+ height: 48,
92
+ get src() {
93
+ return y.logoURL.light;
94
+ },
95
+ width: 48
96
+ }), t(u, {
97
+ get alt() {
98
+ return y.appName || C().LOGO;
99
+ },
100
+ get class() {
101
+ return v("logo-dark hidden mx-auto mb-8", y.classNames?.logo);
102
+ },
103
+ height: 48,
104
+ get src() {
105
+ return y.logoURL.dark;
106
+ },
107
+ width: 48
108
+ })]),
109
+ t(s, {
110
+ get class() {
111
+ return v("m-0 mb-5 font-semibold text-2xl", y.classNames?.title);
112
+ },
113
+ get children() {
114
+ return C().NEW_SIGN_IN_DETECTED;
115
+ }
116
+ }),
117
+ t(m, {
118
+ get class() {
119
+ return v("font-normal text-sm", y.classNames?.content);
120
+ },
121
+ get children() {
122
+ return w();
123
+ }
124
+ }),
125
+ t(h, {
126
+ get when() {
127
+ return y.deviceInfo;
128
+ },
129
+ children: (e) => t(f, {
130
+ get class() {
131
+ return v("my-6 border border-border bg-muted p-4", y.classNames?.codeBlock);
132
+ },
133
+ get children() {
134
+ return [
135
+ t(m, {
136
+ get class() {
137
+ return v("m-0 mb-3 text-muted-foreground text-xs", y.classNames?.description);
138
+ },
139
+ get children() {
140
+ return [C().DEVICE_DETAILS, ":"];
141
+ }
142
+ }),
143
+ t(h, {
144
+ get when() {
145
+ return e().browser;
146
+ },
147
+ children: (e) => t(m, {
148
+ get class() {
149
+ return v("m-0 mb-2 text-sm", y.classNames?.content);
150
+ },
151
+ get children() {
152
+ return [
153
+ C().BROWSER,
154
+ ": ",
155
+ e()
156
+ ];
157
+ }
158
+ })
159
+ }),
160
+ t(h, {
161
+ get when() {
162
+ return e().os;
163
+ },
164
+ children: (e) => t(m, {
165
+ get class() {
166
+ return v("m-0 mb-2 text-sm", y.classNames?.content);
167
+ },
168
+ get children() {
169
+ return [
170
+ C().OPERATING_SYSTEM,
171
+ ": ",
172
+ e()
173
+ ];
174
+ }
175
+ })
176
+ }),
177
+ t(h, {
178
+ get when() {
179
+ return e().location;
180
+ },
181
+ children: (e) => t(m, {
182
+ get class() {
183
+ return v("m-0 mb-2 text-sm", y.classNames?.content);
184
+ },
185
+ get children() {
186
+ return [
187
+ C().LOCATION,
188
+ ": ",
189
+ e()
190
+ ];
191
+ }
192
+ })
193
+ }),
194
+ t(h, {
195
+ get when() {
196
+ return e().ipAddress;
197
+ },
198
+ children: (e) => t(m, {
199
+ get class() {
200
+ return v("m-0 mb-2 text-sm", y.classNames?.content);
201
+ },
202
+ get children() {
203
+ return [
204
+ C().IP_ADDRESS,
205
+ ": ",
206
+ e()
207
+ ];
208
+ }
209
+ })
210
+ }),
211
+ t(h, {
212
+ get when() {
213
+ return e().timestamp;
214
+ },
215
+ children: (e) => t(m, {
216
+ get class() {
217
+ return v("m-0 text-sm", y.classNames?.content);
218
+ },
219
+ get children() {
220
+ return [
221
+ C().TIME,
222
+ ": ",
223
+ e()
224
+ ];
225
+ }
226
+ })
227
+ })
228
+ ];
229
+ }
230
+ })
231
+ }),
232
+ t(m, {
233
+ get class() {
234
+ return v("font-normal text-sm", y.classNames?.content);
235
+ },
236
+ get children() {
237
+ return C().IF_THIS_WAS_YOU;
238
+ }
239
+ }),
240
+ t(h, {
241
+ get when() {
242
+ return y.secureAccountLink;
243
+ },
244
+ children: (e) => t(f, {
245
+ class: "mt-6",
246
+ get children() {
247
+ return t(i, {
248
+ get class() {
249
+ return v("inline-block whitespace-nowrap rounded-none bg-primary px-6 py-2.5 font-medium text-primary-foreground text-sm no-underline", y.classNames?.button);
250
+ },
251
+ get href() {
252
+ return e();
253
+ },
254
+ get children() {
255
+ return C().SECURE_MY_ACCOUNT;
256
+ }
257
+ });
258
+ }
259
+ })
260
+ }),
261
+ t(c, { get class() {
262
+ return v("my-6 w-full border border-border border-solid", y.classNames?.separator);
263
+ } }),
264
+ t(h, {
265
+ get when() {
266
+ return y.appName;
267
+ },
268
+ children: (e) => t(m, {
269
+ get class() {
270
+ return v("mb-3 text-muted-foreground text-xs", y.classNames?.description);
271
+ },
272
+ get children() {
273
+ return C().EMAIL_SENT_BY.replace("{appName}", e());
274
+ }
275
+ })
276
+ }),
277
+ t(m, {
278
+ get class() {
279
+ return v("mt-3 text-muted-foreground text-xs", y.classNames?.description);
280
+ },
281
+ get children() {
282
+ return T();
283
+ }
284
+ }),
285
+ t(h, {
286
+ get when() {
287
+ return y.poweredBy;
288
+ },
289
+ get children() {
290
+ return t(m, {
291
+ get class() {
292
+ return v("mt-4 mb-0 text-center text-[11px] text-muted-foreground", y.classNames?.poweredBy);
293
+ },
294
+ get children() {
295
+ return C().POWERED_BY_BETTER_AUTH.replace("{betterAuth}", "better-auth");
296
+ }
297
+ });
298
+ }
299
+ })
300
+ ];
301
+ }
302
+ });
303
+ }
304
+ });
305
+ }
306
+ });
307
+ } })
308
+ ];
309
+ } });
310
+ }
311
+ x.localization = y, x.PreviewProps = {
312
+ userEmail: "m@example.com",
313
+ deviceInfo: {
314
+ browser: "Chrome on macOS",
315
+ os: "macOS 26.2",
316
+ location: "San Francisco, CA, United States",
317
+ ipAddress: "127.0.0.1",
318
+ timestamp: "February 10, 2025 at 4:20 PM UTC"
319
+ },
320
+ secureAccountLink: "https://better-auth-ui.com/auth/secure-account",
321
+ appName: "Better Auth",
322
+ supportEmail: "support@example.com",
323
+ darkMode: !0
324
+ };
325
+ //#endregion
326
+ export { x as default };
@@ -0,0 +1,70 @@
1
+ import { JSX } from 'solid-js';
2
+ import { EmailClassNames, EmailColors } from './email-styles';
3
+ declare const organizationInvitationEmailLocalization: {
4
+ YOU_RE_INVITED_TO_ORGANIZATION: string;
5
+ YOU_RE_INVITED: string;
6
+ LOGO: string;
7
+ ORGANIZATION_LOGO: string;
8
+ INVITED_TO_JOIN_ORGANIZATION: string;
9
+ ACCEPT_INVITATION: string;
10
+ VIEW_INVITATION: string;
11
+ OR_COPY_AND_PASTE_URL: string;
12
+ THIS_INVITATION_EXPIRES_IN_HOURS: string;
13
+ EMAIL_SENT_BY: string;
14
+ IF_YOU_DIDNT_EXPECT_THIS_INVITATION: string;
15
+ POWERED_BY_BETTER_AUTH: string;
16
+ };
17
+ export type OrganizationInvitationEmailLocalization = typeof organizationInvitationEmailLocalization;
18
+ export interface OrganizationInvitationEmailProps {
19
+ url: string;
20
+ email?: string;
21
+ inviterName?: string;
22
+ inviterEmail?: string;
23
+ organizationName?: string;
24
+ organizationLogoURL?: string | {
25
+ light: string;
26
+ dark: string;
27
+ };
28
+ role?: string;
29
+ appName?: string;
30
+ expirationHours?: number;
31
+ logoURL?: string | {
32
+ light: string;
33
+ dark: string;
34
+ };
35
+ classNames?: EmailClassNames;
36
+ colors?: EmailColors;
37
+ poweredBy?: boolean;
38
+ darkMode?: boolean;
39
+ head?: JSX.Element;
40
+ localization?: Partial<OrganizationInvitationEmailLocalization>;
41
+ }
42
+ export declare function OrganizationInvitationEmail(props: OrganizationInvitationEmailProps): JSX.Element;
43
+ export declare namespace OrganizationInvitationEmail {
44
+ var localization: {
45
+ YOU_RE_INVITED_TO_ORGANIZATION: string;
46
+ YOU_RE_INVITED: string;
47
+ LOGO: string;
48
+ ORGANIZATION_LOGO: string;
49
+ INVITED_TO_JOIN_ORGANIZATION: string;
50
+ ACCEPT_INVITATION: string;
51
+ VIEW_INVITATION: string;
52
+ OR_COPY_AND_PASTE_URL: string;
53
+ THIS_INVITATION_EXPIRES_IN_HOURS: string;
54
+ EMAIL_SENT_BY: string;
55
+ IF_YOU_DIDNT_EXPECT_THIS_INVITATION: string;
56
+ POWERED_BY_BETTER_AUTH: string;
57
+ };
58
+ var PreviewProps: {
59
+ url: string;
60
+ email: string;
61
+ inviterName: string;
62
+ inviterEmail: string;
63
+ organizationName: string;
64
+ role: string;
65
+ appName: string;
66
+ expirationHours: number;
67
+ darkMode: true;
68
+ };
69
+ }
70
+ export default OrganizationInvitationEmail;
@@ -0,0 +1,260 @@
1
+ import e from "./email-styles.js";
2
+ import { createComponent as t, ssr as n } from "solid-js/web";
3
+ import { Body as r, Button as i, Container as a, Head as o, Heading as s, Hr as c, Html as l, Img as u, Link as d, Preview as f, Section as p, Tailwind as m, Text as h } from "@solidjs-email/main";
4
+ import { Show as g } from "solid-js";
5
+ //#region src/components/auth/email/organization-invitation.tsx
6
+ var _ = "<meta content=\"light dark\" name=\"color-scheme\">", v = "<meta content=\"light dark\" name=\"supported-color-schemes\">";
7
+ function y(...e) {
8
+ return e.filter(Boolean).join(" ");
9
+ }
10
+ var b = {
11
+ YOU_RE_INVITED_TO_ORGANIZATION: "You're invited to {organizationName}",
12
+ YOU_RE_INVITED: "You're invited",
13
+ LOGO: "Logo",
14
+ ORGANIZATION_LOGO: "Organization logo",
15
+ INVITED_TO_JOIN_ORGANIZATION: "{inviterName} ({inviterEmail}) has invited you to join {organizationName} on {appName} as a {role}.",
16
+ ACCEPT_INVITATION: "Accept invitation",
17
+ VIEW_INVITATION: "View invitation",
18
+ OR_COPY_AND_PASTE_URL: "Or copy and paste this URL into your browser:",
19
+ THIS_INVITATION_EXPIRES_IN_HOURS: "This invitation expires in {expirationHours} hours.",
20
+ EMAIL_SENT_BY: "Email sent by {appName}.",
21
+ IF_YOU_DIDNT_EXPECT_THIS_INVITATION: "If you didn't expect this invitation, you can safely ignore this email.",
22
+ POWERED_BY_BETTER_AUTH: "Powered by {betterAuth}"
23
+ };
24
+ function x(e) {
25
+ return e.replace(/\s{2,}/g, " ").replace(" .", ".");
26
+ }
27
+ function S(b) {
28
+ let C = () => b.expirationHours ?? 48, w = () => b.darkMode ?? !0, T = () => ({
29
+ ...S.localization,
30
+ ...b.localization
31
+ }), E = () => b.organizationName ? T().YOU_RE_INVITED_TO_ORGANIZATION.replace("{organizationName}", b.organizationName) : T().YOU_RE_INVITED, D = () => {
32
+ let e = b.inviterName || "Someone", t = b.inviterEmail || "";
33
+ return x(T().INVITED_TO_JOIN_ORGANIZATION.replace("{inviterName}", e).replace("{inviterEmail}", t).replace("{organizationName}", b.organizationName || "").replace("{appName}", b.appName || "").replace("{role}", b.role || "").replace("()", ""));
34
+ };
35
+ return t(l, { get children() {
36
+ return [
37
+ t(o, { get children() {
38
+ return [
39
+ n(_),
40
+ n(v),
41
+ t(e, {
42
+ get colors() {
43
+ return b.colors;
44
+ },
45
+ get darkMode() {
46
+ return w();
47
+ }
48
+ }),
49
+ b.head
50
+ ];
51
+ } }),
52
+ t(f, { get children() {
53
+ return E();
54
+ } }),
55
+ t(m, { get children() {
56
+ return t(r, {
57
+ get class() {
58
+ return y("bg-background", b.classNames?.body);
59
+ },
60
+ style: { "font-family": "Arial, Helvetica, sans-serif" },
61
+ get children() {
62
+ return t(a, {
63
+ get class() {
64
+ return y("mx-auto my-auto max-w-xl px-2 py-10", b.classNames?.container);
65
+ },
66
+ get children() {
67
+ return t(p, {
68
+ get class() {
69
+ return y("rounded-none border border-border bg-card p-8 text-card-foreground", b.classNames?.card);
70
+ },
71
+ get children() {
72
+ return [
73
+ b.logoURL && (typeof b.logoURL == "string" ? t(u, {
74
+ get alt() {
75
+ return b.appName || T().LOGO;
76
+ },
77
+ get class() {
78
+ return y("mx-auto mb-8", b.classNames?.logo);
79
+ },
80
+ height: 48,
81
+ get src() {
82
+ return b.logoURL;
83
+ },
84
+ width: 48
85
+ }) : [t(u, {
86
+ get alt() {
87
+ return b.appName || T().LOGO;
88
+ },
89
+ get class() {
90
+ return y("logo-light mx-auto mb-8", b.classNames?.logo);
91
+ },
92
+ height: 48,
93
+ get src() {
94
+ return b.logoURL.light;
95
+ },
96
+ width: 48
97
+ }), t(u, {
98
+ get alt() {
99
+ return b.appName || T().LOGO;
100
+ },
101
+ get class() {
102
+ return y("logo-dark hidden mx-auto mb-8", b.classNames?.logo);
103
+ },
104
+ height: 48,
105
+ get src() {
106
+ return b.logoURL.dark;
107
+ },
108
+ width: 48
109
+ })]),
110
+ t(s, {
111
+ get class() {
112
+ return y("m-0 mb-5 font-semibold text-2xl", b.classNames?.title);
113
+ },
114
+ get children() {
115
+ return E();
116
+ }
117
+ }),
118
+ b.organizationLogoURL && (typeof b.organizationLogoURL == "string" ? t(u, {
119
+ get alt() {
120
+ return b.organizationName || T().ORGANIZATION_LOGO;
121
+ },
122
+ get class() {
123
+ return y("mb-5 rounded-md", b.classNames?.logo);
124
+ },
125
+ height: 56,
126
+ get src() {
127
+ return b.organizationLogoURL;
128
+ },
129
+ width: 56
130
+ }) : [t(u, {
131
+ get alt() {
132
+ return b.organizationName || T().ORGANIZATION_LOGO;
133
+ },
134
+ get class() {
135
+ return y("logo-light mb-5 rounded-md", b.classNames?.logo);
136
+ },
137
+ height: 56,
138
+ get src() {
139
+ return b.organizationLogoURL.light;
140
+ },
141
+ width: 56
142
+ }), t(u, {
143
+ get alt() {
144
+ return b.organizationName || T().ORGANIZATION_LOGO;
145
+ },
146
+ get class() {
147
+ return y("logo-dark hidden mb-5 rounded-md", b.classNames?.logo);
148
+ },
149
+ height: 56,
150
+ get src() {
151
+ return b.organizationLogoURL.dark;
152
+ },
153
+ width: 56
154
+ })]),
155
+ t(h, {
156
+ get class() {
157
+ return y("m-0 font-normal text-sm", b.classNames?.content);
158
+ },
159
+ get children() {
160
+ return D();
161
+ }
162
+ }),
163
+ t(p, {
164
+ class: "my-6",
165
+ get children() {
166
+ return t(i, {
167
+ get class() {
168
+ return y("inline-block whitespace-nowrap rounded-none bg-primary px-6 py-2.5 font-medium text-primary-foreground text-sm no-underline", b.classNames?.button);
169
+ },
170
+ get href() {
171
+ return b.url;
172
+ },
173
+ get children() {
174
+ return T().ACCEPT_INVITATION;
175
+ }
176
+ });
177
+ }
178
+ }),
179
+ t(h, {
180
+ get class() {
181
+ return y("m-0 mb-3 text-muted-foreground text-xs", b.classNames?.description);
182
+ },
183
+ get children() {
184
+ return T().OR_COPY_AND_PASTE_URL;
185
+ }
186
+ }),
187
+ t(d, {
188
+ get class() {
189
+ return y("break-all text-primary text-xs", b.classNames?.link);
190
+ },
191
+ get href() {
192
+ return b.url;
193
+ },
194
+ get children() {
195
+ return b.url;
196
+ }
197
+ }),
198
+ t(c, { get class() {
199
+ return y("my-6 w-full border border-border border-solid", b.classNames?.separator);
200
+ } }),
201
+ t(h, {
202
+ get class() {
203
+ return y("m-0 mb-3 text-muted-foreground text-xs", b.classNames?.description);
204
+ },
205
+ get children() {
206
+ return [T().THIS_INVITATION_EXPIRES_IN_HOURS.replace("{expirationHours}", C().toString()), t(g, {
207
+ get when() {
208
+ return b.appName;
209
+ },
210
+ children: (e) => ` ${T().EMAIL_SENT_BY.replace("{appName}", e())}`
211
+ })];
212
+ }
213
+ }),
214
+ t(h, {
215
+ get class() {
216
+ return y("m-0 text-muted-foreground text-xs", b.classNames?.description);
217
+ },
218
+ get children() {
219
+ return T().IF_YOU_DIDNT_EXPECT_THIS_INVITATION;
220
+ }
221
+ }),
222
+ t(g, {
223
+ get when() {
224
+ return b.poweredBy;
225
+ },
226
+ get children() {
227
+ return t(h, {
228
+ get class() {
229
+ return y("m-0 mt-4 text-center text-[11px] text-muted-foreground", b.classNames?.poweredBy);
230
+ },
231
+ get children() {
232
+ return T().POWERED_BY_BETTER_AUTH.replace("{betterAuth}", "better-auth");
233
+ }
234
+ });
235
+ }
236
+ })
237
+ ];
238
+ }
239
+ });
240
+ }
241
+ });
242
+ }
243
+ });
244
+ } })
245
+ ];
246
+ } });
247
+ }
248
+ S.localization = b, S.PreviewProps = {
249
+ url: "https://better-auth-ui.com/settings/organizations",
250
+ email: "m@example.com",
251
+ inviterName: "Jane Doe",
252
+ inviterEmail: "jane@example.com",
253
+ organizationName: "Acme Inc.",
254
+ role: "member",
255
+ appName: "Better Auth",
256
+ expirationHours: 48,
257
+ darkMode: !0
258
+ };
259
+ //#endregion
260
+ export { S as default };
@@ -0,0 +1,49 @@
1
+ import { JSX } from 'solid-js';
2
+ import { EmailClassNames, EmailColors } from './email-styles';
3
+ declare const otpEmailLocalization: {
4
+ YOUR_VERIFICATION_CODE_IS_CODE: string;
5
+ LOGO: string;
6
+ VERIFY_YOUR_EMAIL: string;
7
+ WE_NEED_TO_VERIFY_YOUR_EMAIL_ADDRESS: string;
8
+ THIS_CODE_EXPIRES_IN_MINUTES: string;
9
+ EMAIL_SENT_BY: string;
10
+ IF_YOU_DIDNT_REQUEST_THIS_EMAIL: string;
11
+ POWERED_BY_BETTER_AUTH: string;
12
+ };
13
+ export type OtpEmailEmailLocalization = typeof otpEmailLocalization;
14
+ export interface OtpEmailProps {
15
+ verificationCode: string;
16
+ email?: string;
17
+ appName?: string;
18
+ expirationMinutes?: number;
19
+ logoURL?: string | {
20
+ light: string;
21
+ dark: string;
22
+ };
23
+ classNames?: EmailClassNames;
24
+ colors?: EmailColors;
25
+ poweredBy?: boolean;
26
+ darkMode?: boolean;
27
+ head?: JSX.Element;
28
+ localization?: Partial<OtpEmailEmailLocalization>;
29
+ }
30
+ export declare function OtpEmail(props: OtpEmailProps): JSX.Element;
31
+ export declare namespace OtpEmail {
32
+ var localization: {
33
+ YOUR_VERIFICATION_CODE_IS_CODE: string;
34
+ LOGO: string;
35
+ VERIFY_YOUR_EMAIL: string;
36
+ WE_NEED_TO_VERIFY_YOUR_EMAIL_ADDRESS: string;
37
+ THIS_CODE_EXPIRES_IN_MINUTES: string;
38
+ EMAIL_SENT_BY: string;
39
+ IF_YOU_DIDNT_REQUEST_THIS_EMAIL: string;
40
+ POWERED_BY_BETTER_AUTH: string;
41
+ };
42
+ var PreviewProps: {
43
+ verificationCode: string;
44
+ email: string;
45
+ appName: string;
46
+ darkMode: true;
47
+ };
48
+ }
49
+ export default OtpEmail;