@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,289 +1,10 @@
1
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
- //#region src/components/settings/account/theme-preview.tsx
3
- function n(n) {
4
- return /* @__PURE__ */ t("svg", {
5
- fill: "none",
6
- viewBox: "0 0 240 117",
7
- xmlns: "http://www.w3.org/2000/svg",
8
- role: "img",
9
- "aria-label": "System theme preview",
10
- ...n,
11
- children: [
12
- /* @__PURE__ */ t("defs", { children: [/* @__PURE__ */ e("clipPath", {
13
- id: "systemDiagonalLight",
14
- children: /* @__PURE__ */ e("polygon", { points: "0,0 240,0 0,117" })
15
- }), /* @__PURE__ */ e("clipPath", {
16
- id: "systemDiagonalDark",
17
- children: /* @__PURE__ */ e("polygon", { points: "240,0 240,117 0,117" })
18
- })] }),
19
- /* @__PURE__ */ t("g", {
20
- clipPath: "url(#systemDiagonalLight)",
21
- children: [
22
- /* @__PURE__ */ e("path", {
23
- d: "M12 0.5H228C234.351 0.5 239.5 5.64873 239.5 12V105C239.5 111.351 234.351 116.5 228 116.5H12C5.64873 116.5 0.5 111.351 0.5 105V12C0.5 5.64873 5.64873 0.5 12 0.5Z",
24
- fill: "white"
25
- }),
26
- /* @__PURE__ */ e("path", {
27
- d: "M12 0.5H228C234.351 0.5 239.5 5.64873 239.5 12V105C239.5 111.351 234.351 116.5 228 116.5H12C5.64873 116.5 0.5 111.351 0.5 105V12C0.5 5.64873 5.64873 0.5 12 0.5Z",
28
- stroke: "#E4E4E7"
29
- }),
30
- /* @__PURE__ */ e("path", {
31
- d: "M32 48.5C32 45.4624 34.4624 43 37.5 43H67.5C70.5376 43 73 45.4624 73 48.5C73 51.5376 70.5376 54 67.5 54H37.5C34.4624 54 32 51.5376 32 48.5Z",
32
- fill: "#F4F4F5"
33
- }),
34
- /* @__PURE__ */ e("path", {
35
- d: "M17 105C17 101.686 19.6863 99 23 99H67C70.3137 99 73 101.686 73 105C73 108.314 70.3137 111 67 111H23C19.6863 111 17 108.314 17 105Z",
36
- fill: "#F4F4F5"
37
- }),
38
- /* @__PURE__ */ e("path", {
39
- d: "M88 25.5C88 22.4624 90.4624 20 93.5 20H207.5C210.538 20 213 22.4624 213 25.5C213 28.5376 210.538 31 207.5 31H93.5C90.4624 31 88 28.5376 88 25.5Z",
40
- fill: "#E4E4E7"
41
- }),
42
- /* @__PURE__ */ e("path", {
43
- d: "M88 105C88 101.686 90.6863 99 94 99H189C192.314 99 195 101.686 195 105C195 108.314 192.314 111 189 111H94C90.6863 111 88 108.314 88 105Z",
44
- fill: "#F4F4F5"
45
- }),
46
- /* @__PURE__ */ e("path", {
47
- d: "M88 51C88 46.5817 91.5817 43 96 43H221C225.418 43 229 46.5817 229 51V85C229 89.4183 225.418 93 221 93H96C91.5817 93 88 89.4183 88 85V51Z",
48
- fill: "#F4F4F5"
49
- }),
50
- /* @__PURE__ */ e("path", {
51
- d: "M17 48.5C17 45.4624 19.4624 43 22.5 43C25.5376 43 28 45.4624 28 48.5C28 51.5376 25.5376 54 22.5 54C19.4624 54 17 51.5376 17 48.5Z",
52
- fill: "#F4F4F5"
53
- }),
54
- /* @__PURE__ */ e("path", {
55
- d: "M17 66.5C17 63.4624 19.4624 61 22.5 61C25.5376 61 28 63.4624 28 66.5C28 69.5376 25.5376 72 22.5 72C19.4624 72 17 69.5376 17 66.5Z",
56
- fill: "#F4F4F5"
57
- }),
58
- /* @__PURE__ */ e("path", {
59
- d: "M17 86.5C17 83.4624 19.4624 81 22.5 81C25.5376 81 28 83.4624 28 86.5V87.5C28 90.5376 25.5376 93 22.5 93C19.4624 93 17 90.5376 17 87.5V86.5Z",
60
- fill: "#F4F4F5"
61
- }),
62
- /* @__PURE__ */ e("path", {
63
- d: "M32 25.5C32 22.4624 34.4624 20 37.5 20H67.5C70.5376 20 73 22.4624 73 25.5C73 28.5376 70.5376 31 67.5 31H37.5C34.4624 31 32 28.5376 32 25.5Z",
64
- fill: "#E4E4E7"
65
- }),
66
- /* @__PURE__ */ e("path", {
67
- d: "M32 66.5C32 63.4624 34.4624 61 37.5 61H67.5C70.5376 61 73 63.4624 73 66.5C73 69.5376 70.5376 72 67.5 72H37.5C34.4624 72 32 69.5376 32 66.5Z",
68
- fill: "#F4F4F5"
69
- }),
70
- /* @__PURE__ */ e("path", {
71
- d: "M32 87C32 83.6863 34.6863 81 38 81H67C70.3137 81 73 83.6863 73 87C73 90.3137 70.3137 93 67 93H38C34.6863 93 32 90.3137 32 87Z",
72
- fill: "#F4F4F5"
73
- }),
74
- /* @__PURE__ */ e("circle", {
75
- cx: "22.5",
76
- cy: "25.5",
77
- fill: "#E4E4E7",
78
- r: "5.5"
79
- })
80
- ]
81
- }),
82
- /* @__PURE__ */ t("g", {
83
- clipPath: "url(#systemDiagonalDark)",
84
- children: [
85
- /* @__PURE__ */ e("path", {
86
- d: "M12 0.5H228C234.351 0.5 239.5 5.64873 239.5 12V105C239.5 111.351 234.351 116.5 228 116.5H12C5.64873 116.5 0.5 111.351 0.5 105V12C0.5 5.64873 5.64873 0.5 12 0.5Z",
87
- fill: "black"
88
- }),
89
- /* @__PURE__ */ e("path", {
90
- d: "M12 0.5H228C234.351 0.5 239.5 5.64873 239.5 12V105C239.5 111.351 234.351 116.5 228 116.5H12C5.64873 116.5 0.5 111.351 0.5 105V12C0.5 5.64873 5.64873 0.5 12 0.5Z",
91
- stroke: "#3F3F46"
92
- }),
93
- /* @__PURE__ */ e("path", {
94
- d: "M32 48.5C32 45.4624 34.4624 43 37.5 43H67.5C70.5376 43 73 45.4624 73 48.5C73 51.5376 70.5376 54 67.5 54H37.5C34.4624 54 32 51.5376 32 48.5Z",
95
- fill: "#27272A"
96
- }),
97
- /* @__PURE__ */ e("path", {
98
- d: "M17 105C17 101.686 19.6863 99 23 99H67C70.3137 99 73 101.686 73 105C73 108.314 70.3137 111 67 111H23C19.6863 111 17 108.314 17 105Z",
99
- fill: "#27272A"
100
- }),
101
- /* @__PURE__ */ e("path", {
102
- d: "M88 25.5C88 22.4624 90.4624 20 93.5 20H207.5C210.538 20 213 22.4624 213 25.5C213 28.5376 210.538 31 207.5 31H93.5C90.4624 31 88 28.5376 88 25.5Z",
103
- fill: "#3F3F46"
104
- }),
105
- /* @__PURE__ */ e("path", {
106
- d: "M88 105C88 101.686 90.6863 99 94 99H189C192.314 99 195 101.686 195 105C195 108.314 192.314 111 189 111H94C90.6863 111 88 108.314 88 105Z",
107
- fill: "#27272A"
108
- }),
109
- /* @__PURE__ */ e("path", {
110
- d: "M88 51C88 46.5817 91.5817 43 96 43H221C225.418 43 229 46.5817 229 51V85C229 89.4183 225.418 93 221 93H96C91.5817 93 88 89.4183 88 85V51Z",
111
- fill: "#27272A"
112
- }),
113
- /* @__PURE__ */ e("path", {
114
- d: "M17 48.5C17 45.4624 19.4624 43 22.5 43C25.5376 43 28 45.4624 28 48.5C28 51.5376 25.5376 54 22.5 54C19.4624 54 17 51.5376 17 48.5Z",
115
- fill: "#27272A"
116
- }),
117
- /* @__PURE__ */ e("path", {
118
- d: "M17 66.5C17 63.4624 19.4624 61 22.5 61C25.5376 61 28 63.4624 28 66.5C28 69.5376 25.5376 72 22.5 72C19.4624 72 17 69.5376 17 66.5Z",
119
- fill: "#27272A"
120
- }),
121
- /* @__PURE__ */ e("path", {
122
- d: "M17 86.5C17 83.4624 19.4624 81 22.5 81C25.5376 81 28 83.4624 28 86.5V87.5C28 90.5376 25.5376 93 22.5 93C19.4624 93 17 90.5376 17 87.5V86.5Z",
123
- fill: "#27272A"
124
- }),
125
- /* @__PURE__ */ e("path", {
126
- d: "M32 25.5C32 22.4624 34.4624 20 37.5 20H67.5C70.5376 20 73 22.4624 73 25.5C73 28.5376 70.5376 31 67.5 31H37.5C34.4624 31 32 28.5376 32 25.5Z",
127
- fill: "#3F3F46"
128
- }),
129
- /* @__PURE__ */ e("path", {
130
- d: "M32 66.5C32 63.4624 34.4624 61 37.5 61H67.5C70.5376 61 73 63.4624 73 66.5C73 69.5376 70.5376 72 67.5 72H37.5C34.4624 72 32 69.5376 32 66.5Z",
131
- fill: "#27272A"
132
- }),
133
- /* @__PURE__ */ e("path", {
134
- d: "M32 87C32 83.6863 34.6863 81 38 81H67C70.3137 81 73 83.6863 73 87C73 90.3137 70.3137 93 67 93H38C34.6863 93 32 90.3137 32 87Z",
135
- fill: "#27272A"
136
- }),
137
- /* @__PURE__ */ e("circle", {
138
- cx: "22.5",
139
- cy: "25.5",
140
- fill: "#3F3F46",
141
- r: "5.5"
142
- })
143
- ]
144
- })
145
- ]
146
- });
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function ThemePreviewSystem(props) {
3
+ return (_jsxs("svg", { fill: "none", viewBox: "0 0 240 117", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-label": "System theme preview", ...props, children: [_jsxs("defs", { children: [_jsx("clipPath", { id: "systemDiagonalLight", children: _jsx("polygon", { points: "0,0 240,0 0,117" }) }), _jsx("clipPath", { id: "systemDiagonalDark", children: _jsx("polygon", { points: "240,0 240,117 0,117" }) })] }), _jsxs("g", { clipPath: "url(#systemDiagonalLight)", children: [_jsx("path", { d: "M12 0.5H228C234.351 0.5 239.5 5.64873 239.5 12V105C239.5 111.351 234.351 116.5 228 116.5H12C5.64873 116.5 0.5 111.351 0.5 105V12C0.5 5.64873 5.64873 0.5 12 0.5Z", fill: "white" }), _jsx("path", { d: "M12 0.5H228C234.351 0.5 239.5 5.64873 239.5 12V105C239.5 111.351 234.351 116.5 228 116.5H12C5.64873 116.5 0.5 111.351 0.5 105V12C0.5 5.64873 5.64873 0.5 12 0.5Z", stroke: "#E4E4E7" }), _jsx("path", { d: "M32 48.5C32 45.4624 34.4624 43 37.5 43H67.5C70.5376 43 73 45.4624 73 48.5C73 51.5376 70.5376 54 67.5 54H37.5C34.4624 54 32 51.5376 32 48.5Z", fill: "#F4F4F5" }), _jsx("path", { d: "M17 105C17 101.686 19.6863 99 23 99H67C70.3137 99 73 101.686 73 105C73 108.314 70.3137 111 67 111H23C19.6863 111 17 108.314 17 105Z", fill: "#F4F4F5" }), _jsx("path", { d: "M88 25.5C88 22.4624 90.4624 20 93.5 20H207.5C210.538 20 213 22.4624 213 25.5C213 28.5376 210.538 31 207.5 31H93.5C90.4624 31 88 28.5376 88 25.5Z", fill: "#E4E4E7" }), _jsx("path", { d: "M88 105C88 101.686 90.6863 99 94 99H189C192.314 99 195 101.686 195 105C195 108.314 192.314 111 189 111H94C90.6863 111 88 108.314 88 105Z", fill: "#F4F4F5" }), _jsx("path", { d: "M88 51C88 46.5817 91.5817 43 96 43H221C225.418 43 229 46.5817 229 51V85C229 89.4183 225.418 93 221 93H96C91.5817 93 88 89.4183 88 85V51Z", fill: "#F4F4F5" }), _jsx("path", { d: "M17 48.5C17 45.4624 19.4624 43 22.5 43C25.5376 43 28 45.4624 28 48.5C28 51.5376 25.5376 54 22.5 54C19.4624 54 17 51.5376 17 48.5Z", fill: "#F4F4F5" }), _jsx("path", { d: "M17 66.5C17 63.4624 19.4624 61 22.5 61C25.5376 61 28 63.4624 28 66.5C28 69.5376 25.5376 72 22.5 72C19.4624 72 17 69.5376 17 66.5Z", fill: "#F4F4F5" }), _jsx("path", { d: "M17 86.5C17 83.4624 19.4624 81 22.5 81C25.5376 81 28 83.4624 28 86.5V87.5C28 90.5376 25.5376 93 22.5 93C19.4624 93 17 90.5376 17 87.5V86.5Z", fill: "#F4F4F5" }), _jsx("path", { d: "M32 25.5C32 22.4624 34.4624 20 37.5 20H67.5C70.5376 20 73 22.4624 73 25.5C73 28.5376 70.5376 31 67.5 31H37.5C34.4624 31 32 28.5376 32 25.5Z", fill: "#E4E4E7" }), _jsx("path", { d: "M32 66.5C32 63.4624 34.4624 61 37.5 61H67.5C70.5376 61 73 63.4624 73 66.5C73 69.5376 70.5376 72 67.5 72H37.5C34.4624 72 32 69.5376 32 66.5Z", fill: "#F4F4F5" }), _jsx("path", { d: "M32 87C32 83.6863 34.6863 81 38 81H67C70.3137 81 73 83.6863 73 87C73 90.3137 70.3137 93 67 93H38C34.6863 93 32 90.3137 32 87Z", fill: "#F4F4F5" }), _jsx("circle", { cx: "22.5", cy: "25.5", fill: "#E4E4E7", r: "5.5" })] }), _jsxs("g", { clipPath: "url(#systemDiagonalDark)", children: [_jsx("path", { d: "M12 0.5H228C234.351 0.5 239.5 5.64873 239.5 12V105C239.5 111.351 234.351 116.5 228 116.5H12C5.64873 116.5 0.5 111.351 0.5 105V12C0.5 5.64873 5.64873 0.5 12 0.5Z", fill: "black" }), _jsx("path", { d: "M12 0.5H228C234.351 0.5 239.5 5.64873 239.5 12V105C239.5 111.351 234.351 116.5 228 116.5H12C5.64873 116.5 0.5 111.351 0.5 105V12C0.5 5.64873 5.64873 0.5 12 0.5Z", stroke: "#3F3F46" }), _jsx("path", { d: "M32 48.5C32 45.4624 34.4624 43 37.5 43H67.5C70.5376 43 73 45.4624 73 48.5C73 51.5376 70.5376 54 67.5 54H37.5C34.4624 54 32 51.5376 32 48.5Z", fill: "#27272A" }), _jsx("path", { d: "M17 105C17 101.686 19.6863 99 23 99H67C70.3137 99 73 101.686 73 105C73 108.314 70.3137 111 67 111H23C19.6863 111 17 108.314 17 105Z", fill: "#27272A" }), _jsx("path", { d: "M88 25.5C88 22.4624 90.4624 20 93.5 20H207.5C210.538 20 213 22.4624 213 25.5C213 28.5376 210.538 31 207.5 31H93.5C90.4624 31 88 28.5376 88 25.5Z", fill: "#3F3F46" }), _jsx("path", { d: "M88 105C88 101.686 90.6863 99 94 99H189C192.314 99 195 101.686 195 105C195 108.314 192.314 111 189 111H94C90.6863 111 88 108.314 88 105Z", fill: "#27272A" }), _jsx("path", { d: "M88 51C88 46.5817 91.5817 43 96 43H221C225.418 43 229 46.5817 229 51V85C229 89.4183 225.418 93 221 93H96C91.5817 93 88 89.4183 88 85V51Z", fill: "#27272A" }), _jsx("path", { d: "M17 48.5C17 45.4624 19.4624 43 22.5 43C25.5376 43 28 45.4624 28 48.5C28 51.5376 25.5376 54 22.5 54C19.4624 54 17 51.5376 17 48.5Z", fill: "#27272A" }), _jsx("path", { d: "M17 66.5C17 63.4624 19.4624 61 22.5 61C25.5376 61 28 63.4624 28 66.5C28 69.5376 25.5376 72 22.5 72C19.4624 72 17 69.5376 17 66.5Z", fill: "#27272A" }), _jsx("path", { d: "M17 86.5C17 83.4624 19.4624 81 22.5 81C25.5376 81 28 83.4624 28 86.5V87.5C28 90.5376 25.5376 93 22.5 93C19.4624 93 17 90.5376 17 87.5V86.5Z", fill: "#27272A" }), _jsx("path", { d: "M32 25.5C32 22.4624 34.4624 20 37.5 20H67.5C70.5376 20 73 22.4624 73 25.5C73 28.5376 70.5376 31 67.5 31H37.5C34.4624 31 32 28.5376 32 25.5Z", fill: "#3F3F46" }), _jsx("path", { d: "M32 66.5C32 63.4624 34.4624 61 37.5 61H67.5C70.5376 61 73 63.4624 73 66.5C73 69.5376 70.5376 72 67.5 72H37.5C34.4624 72 32 69.5376 32 66.5Z", fill: "#27272A" }), _jsx("path", { d: "M32 87C32 83.6863 34.6863 81 38 81H67C70.3137 81 73 83.6863 73 87C73 90.3137 70.3137 93 67 93H38C34.6863 93 32 90.3137 32 87Z", fill: "#27272A" }), _jsx("circle", { cx: "22.5", cy: "25.5", fill: "#3F3F46", r: "5.5" })] })] }));
147
4
  }
148
- function r(n) {
149
- return /* @__PURE__ */ t("svg", {
150
- fill: "none",
151
- viewBox: "0 0 240 117",
152
- xmlns: "http://www.w3.org/2000/svg",
153
- role: "img",
154
- "aria-label": "Light",
155
- ...n,
156
- children: [
157
- /* @__PURE__ */ e("path", {
158
- d: "M12 0.5H228C234.351 0.5 239.5 5.64873 239.5 12V105C239.5 111.351 234.351 116.5 228 116.5H12C5.64873 116.5 0.5 111.351 0.5 105V12C0.5 5.64873 5.64873 0.5 12 0.5Z",
159
- fill: "white"
160
- }),
161
- /* @__PURE__ */ e("path", {
162
- d: "M12 0.5H228C234.351 0.5 239.5 5.64873 239.5 12V105C239.5 111.351 234.351 116.5 228 116.5H12C5.64873 116.5 0.5 111.351 0.5 105V12C0.5 5.64873 5.64873 0.5 12 0.5Z",
163
- stroke: "#E4E4E7"
164
- }),
165
- /* @__PURE__ */ e("path", {
166
- d: "M32 48.5C32 45.4624 34.4624 43 37.5 43H67.5C70.5376 43 73 45.4624 73 48.5C73 51.5376 70.5376 54 67.5 54H37.5C34.4624 54 32 51.5376 32 48.5Z",
167
- fill: "#F4F4F5"
168
- }),
169
- /* @__PURE__ */ e("path", {
170
- d: "M17 105C17 101.686 19.6863 99 23 99H67C70.3137 99 73 101.686 73 105C73 108.314 70.3137 111 67 111H23C19.6863 111 17 108.314 17 105Z",
171
- fill: "#F4F4F5"
172
- }),
173
- /* @__PURE__ */ e("path", {
174
- d: "M88 25.5C88 22.4624 90.4624 20 93.5 20H207.5C210.538 20 213 22.4624 213 25.5C213 28.5376 210.538 31 207.5 31H93.5C90.4624 31 88 28.5376 88 25.5Z",
175
- fill: "#E4E4E7"
176
- }),
177
- /* @__PURE__ */ e("path", {
178
- d: "M88 105C88 101.686 90.6863 99 94 99H189C192.314 99 195 101.686 195 105C195 108.314 192.314 111 189 111H94C90.6863 111 88 108.314 88 105Z",
179
- fill: "#F4F4F5"
180
- }),
181
- /* @__PURE__ */ e("path", {
182
- d: "M88 51C88 46.5817 91.5817 43 96 43H221C225.418 43 229 46.5817 229 51V85C229 89.4183 225.418 93 221 93H96C91.5817 93 88 89.4183 88 85V51Z",
183
- fill: "#F4F4F5"
184
- }),
185
- /* @__PURE__ */ e("path", {
186
- d: "M17 48.5C17 45.4624 19.4624 43 22.5 43C25.5376 43 28 45.4624 28 48.5C28 51.5376 25.5376 54 22.5 54C19.4624 54 17 51.5376 17 48.5Z",
187
- fill: "#F4F4F5"
188
- }),
189
- /* @__PURE__ */ e("path", {
190
- d: "M17 66.5C17 63.4624 19.4624 61 22.5 61C25.5376 61 28 63.4624 28 66.5C28 69.5376 25.5376 72 22.5 72C19.4624 72 17 69.5376 17 66.5Z",
191
- fill: "#F4F4F5"
192
- }),
193
- /* @__PURE__ */ e("path", {
194
- d: "M17 86.5C17 83.4624 19.4624 81 22.5 81C25.5376 81 28 83.4624 28 86.5V87.5C28 90.5376 25.5376 93 22.5 93C19.4624 93 17 90.5376 17 87.5V86.5Z",
195
- fill: "#F4F4F5"
196
- }),
197
- /* @__PURE__ */ e("path", {
198
- d: "M32 25.5C32 22.4624 34.4624 20 37.5 20H67.5C70.5376 20 73 22.4624 73 25.5C73 28.5376 70.5376 31 67.5 31H37.5C34.4624 31 32 28.5376 32 25.5Z",
199
- fill: "#E4E4E7"
200
- }),
201
- /* @__PURE__ */ e("path", {
202
- d: "M32 66.5C32 63.4624 34.4624 61 37.5 61H67.5C70.5376 61 73 63.4624 73 66.5C73 69.5376 70.5376 72 67.5 72H37.5C34.4624 72 32 69.5376 32 66.5Z",
203
- fill: "#F4F4F5"
204
- }),
205
- /* @__PURE__ */ e("path", {
206
- d: "M32 87C32 83.6863 34.6863 81 38 81H67C70.3137 81 73 83.6863 73 87C73 90.3137 70.3137 93 67 93H38C34.6863 93 32 90.3137 32 87Z",
207
- fill: "#F4F4F5"
208
- }),
209
- /* @__PURE__ */ e("circle", {
210
- cx: "22.5",
211
- cy: "25.5",
212
- fill: "#E4E4E7",
213
- r: "5.5"
214
- })
215
- ]
216
- });
5
+ export function ThemePreviewLight(props) {
6
+ return (_jsxs("svg", { fill: "none", viewBox: "0 0 240 117", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-label": "Light", ...props, children: [_jsx("path", { d: "M12 0.5H228C234.351 0.5 239.5 5.64873 239.5 12V105C239.5 111.351 234.351 116.5 228 116.5H12C5.64873 116.5 0.5 111.351 0.5 105V12C0.5 5.64873 5.64873 0.5 12 0.5Z", fill: "white" }), _jsx("path", { d: "M12 0.5H228C234.351 0.5 239.5 5.64873 239.5 12V105C239.5 111.351 234.351 116.5 228 116.5H12C5.64873 116.5 0.5 111.351 0.5 105V12C0.5 5.64873 5.64873 0.5 12 0.5Z", stroke: "#E4E4E7" }), _jsx("path", { d: "M32 48.5C32 45.4624 34.4624 43 37.5 43H67.5C70.5376 43 73 45.4624 73 48.5C73 51.5376 70.5376 54 67.5 54H37.5C34.4624 54 32 51.5376 32 48.5Z", fill: "#F4F4F5" }), _jsx("path", { d: "M17 105C17 101.686 19.6863 99 23 99H67C70.3137 99 73 101.686 73 105C73 108.314 70.3137 111 67 111H23C19.6863 111 17 108.314 17 105Z", fill: "#F4F4F5" }), _jsx("path", { d: "M88 25.5C88 22.4624 90.4624 20 93.5 20H207.5C210.538 20 213 22.4624 213 25.5C213 28.5376 210.538 31 207.5 31H93.5C90.4624 31 88 28.5376 88 25.5Z", fill: "#E4E4E7" }), _jsx("path", { d: "M88 105C88 101.686 90.6863 99 94 99H189C192.314 99 195 101.686 195 105C195 108.314 192.314 111 189 111H94C90.6863 111 88 108.314 88 105Z", fill: "#F4F4F5" }), _jsx("path", { d: "M88 51C88 46.5817 91.5817 43 96 43H221C225.418 43 229 46.5817 229 51V85C229 89.4183 225.418 93 221 93H96C91.5817 93 88 89.4183 88 85V51Z", fill: "#F4F4F5" }), _jsx("path", { d: "M17 48.5C17 45.4624 19.4624 43 22.5 43C25.5376 43 28 45.4624 28 48.5C28 51.5376 25.5376 54 22.5 54C19.4624 54 17 51.5376 17 48.5Z", fill: "#F4F4F5" }), _jsx("path", { d: "M17 66.5C17 63.4624 19.4624 61 22.5 61C25.5376 61 28 63.4624 28 66.5C28 69.5376 25.5376 72 22.5 72C19.4624 72 17 69.5376 17 66.5Z", fill: "#F4F4F5" }), _jsx("path", { d: "M17 86.5C17 83.4624 19.4624 81 22.5 81C25.5376 81 28 83.4624 28 86.5V87.5C28 90.5376 25.5376 93 22.5 93C19.4624 93 17 90.5376 17 87.5V86.5Z", fill: "#F4F4F5" }), _jsx("path", { d: "M32 25.5C32 22.4624 34.4624 20 37.5 20H67.5C70.5376 20 73 22.4624 73 25.5C73 28.5376 70.5376 31 67.5 31H37.5C34.4624 31 32 28.5376 32 25.5Z", fill: "#E4E4E7" }), _jsx("path", { d: "M32 66.5C32 63.4624 34.4624 61 37.5 61H67.5C70.5376 61 73 63.4624 73 66.5C73 69.5376 70.5376 72 67.5 72H37.5C34.4624 72 32 69.5376 32 66.5Z", fill: "#F4F4F5" }), _jsx("path", { d: "M32 87C32 83.6863 34.6863 81 38 81H67C70.3137 81 73 83.6863 73 87C73 90.3137 70.3137 93 67 93H38C34.6863 93 32 90.3137 32 87Z", fill: "#F4F4F5" }), _jsx("circle", { cx: "22.5", cy: "25.5", fill: "#E4E4E7", r: "5.5" })] }));
217
7
  }
218
- function i(n) {
219
- return /* @__PURE__ */ t("svg", {
220
- fill: "none",
221
- viewBox: "0 0 240 117",
222
- xmlns: "http://www.w3.org/2000/svg",
223
- role: "img",
224
- "aria-label": "Dark",
225
- ...n,
226
- children: [
227
- /* @__PURE__ */ e("path", {
228
- d: "M12 0.5H228C234.351 0.5 239.5 5.64873 239.5 12V105C239.5 111.351 234.351 116.5 228 116.5H12C5.64873 116.5 0.5 111.351 0.5 105V12C0.5 5.64873 5.64873 0.5 12 0.5Z",
229
- fill: "black"
230
- }),
231
- /* @__PURE__ */ e("path", {
232
- d: "M12 0.5H228C234.351 0.5 239.5 5.64873 239.5 12V105C239.5 111.351 234.351 116.5 228 116.5H12C5.64873 116.5 0.5 111.351 0.5 105V12C0.5 5.64873 5.64873 0.5 12 0.5Z",
233
- stroke: "#3F3F46"
234
- }),
235
- /* @__PURE__ */ e("path", {
236
- d: "M32 48.5C32 45.4624 34.4624 43 37.5 43H67.5C70.5376 43 73 45.4624 73 48.5C73 51.5376 70.5376 54 67.5 54H37.5C34.4624 54 32 51.5376 32 48.5Z",
237
- fill: "#27272A"
238
- }),
239
- /* @__PURE__ */ e("path", {
240
- d: "M17 105C17 101.686 19.6863 99 23 99H67C70.3137 99 73 101.686 73 105C73 108.314 70.3137 111 67 111H23C19.6863 111 17 108.314 17 105Z",
241
- fill: "#27272A"
242
- }),
243
- /* @__PURE__ */ e("path", {
244
- d: "M88 25.5C88 22.4624 90.4624 20 93.5 20H207.5C210.538 20 213 22.4624 213 25.5C213 28.5376 210.538 31 207.5 31H93.5C90.4624 31 88 28.5376 88 25.5Z",
245
- fill: "#3F3F46"
246
- }),
247
- /* @__PURE__ */ e("path", {
248
- d: "M88 105C88 101.686 90.6863 99 94 99H189C192.314 99 195 101.686 195 105C195 108.314 192.314 111 189 111H94C90.6863 111 88 108.314 88 105Z",
249
- fill: "#27272A"
250
- }),
251
- /* @__PURE__ */ e("path", {
252
- d: "M88 51C88 46.5817 91.5817 43 96 43H221C225.418 43 229 46.5817 229 51V85C229 89.4183 225.418 93 221 93H96C91.5817 93 88 89.4183 88 85V51Z",
253
- fill: "#27272A"
254
- }),
255
- /* @__PURE__ */ e("path", {
256
- d: "M17 48.5C17 45.4624 19.4624 43 22.5 43C25.5376 43 28 45.4624 28 48.5C28 51.5376 25.5376 54 22.5 54C19.4624 54 17 51.5376 17 48.5Z",
257
- fill: "#27272A"
258
- }),
259
- /* @__PURE__ */ e("path", {
260
- d: "M17 66.5C17 63.4624 19.4624 61 22.5 61C25.5376 61 28 63.4624 28 66.5C28 69.5376 25.5376 72 22.5 72C19.4624 72 17 69.5376 17 66.5Z",
261
- fill: "#27272A"
262
- }),
263
- /* @__PURE__ */ e("path", {
264
- d: "M17 86.5C17 83.4624 19.4624 81 22.5 81C25.5376 81 28 83.4624 28 86.5V87.5C28 90.5376 25.5376 93 22.5 93C19.4624 93 17 90.5376 17 87.5V86.5Z",
265
- fill: "#27272A"
266
- }),
267
- /* @__PURE__ */ e("path", {
268
- d: "M32 25.5C32 22.4624 34.4624 20 37.5 20H67.5C70.5376 20 73 22.4624 73 25.5C73 28.5376 70.5376 31 67.5 31H37.5C34.4624 31 32 28.5376 32 25.5Z",
269
- fill: "#3F3F46"
270
- }),
271
- /* @__PURE__ */ e("path", {
272
- d: "M32 66.5C32 63.4624 34.4624 61 37.5 61H67.5C70.5376 61 73 63.4624 73 66.5C73 69.5376 70.5376 72 67.5 72H37.5C34.4624 72 32 69.5376 32 66.5Z",
273
- fill: "#27272A"
274
- }),
275
- /* @__PURE__ */ e("path", {
276
- d: "M32 87C32 83.6863 34.6863 81 38 81H67C70.3137 81 73 83.6863 73 87C73 90.3137 70.3137 93 67 93H38C34.6863 93 32 90.3137 32 87Z",
277
- fill: "#27272A"
278
- }),
279
- /* @__PURE__ */ e("circle", {
280
- cx: "22.5",
281
- cy: "25.5",
282
- fill: "#3F3F46",
283
- r: "5.5"
284
- })
285
- ]
286
- });
8
+ export function ThemePreviewDark(props) {
9
+ return (_jsxs("svg", { fill: "none", viewBox: "0 0 240 117", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-label": "Dark", ...props, children: [_jsx("path", { d: "M12 0.5H228C234.351 0.5 239.5 5.64873 239.5 12V105C239.5 111.351 234.351 116.5 228 116.5H12C5.64873 116.5 0.5 111.351 0.5 105V12C0.5 5.64873 5.64873 0.5 12 0.5Z", fill: "black" }), _jsx("path", { d: "M12 0.5H228C234.351 0.5 239.5 5.64873 239.5 12V105C239.5 111.351 234.351 116.5 228 116.5H12C5.64873 116.5 0.5 111.351 0.5 105V12C0.5 5.64873 5.64873 0.5 12 0.5Z", stroke: "#3F3F46" }), _jsx("path", { d: "M32 48.5C32 45.4624 34.4624 43 37.5 43H67.5C70.5376 43 73 45.4624 73 48.5C73 51.5376 70.5376 54 67.5 54H37.5C34.4624 54 32 51.5376 32 48.5Z", fill: "#27272A" }), _jsx("path", { d: "M17 105C17 101.686 19.6863 99 23 99H67C70.3137 99 73 101.686 73 105C73 108.314 70.3137 111 67 111H23C19.6863 111 17 108.314 17 105Z", fill: "#27272A" }), _jsx("path", { d: "M88 25.5C88 22.4624 90.4624 20 93.5 20H207.5C210.538 20 213 22.4624 213 25.5C213 28.5376 210.538 31 207.5 31H93.5C90.4624 31 88 28.5376 88 25.5Z", fill: "#3F3F46" }), _jsx("path", { d: "M88 105C88 101.686 90.6863 99 94 99H189C192.314 99 195 101.686 195 105C195 108.314 192.314 111 189 111H94C90.6863 111 88 108.314 88 105Z", fill: "#27272A" }), _jsx("path", { d: "M88 51C88 46.5817 91.5817 43 96 43H221C225.418 43 229 46.5817 229 51V85C229 89.4183 225.418 93 221 93H96C91.5817 93 88 89.4183 88 85V51Z", fill: "#27272A" }), _jsx("path", { d: "M17 48.5C17 45.4624 19.4624 43 22.5 43C25.5376 43 28 45.4624 28 48.5C28 51.5376 25.5376 54 22.5 54C19.4624 54 17 51.5376 17 48.5Z", fill: "#27272A" }), _jsx("path", { d: "M17 66.5C17 63.4624 19.4624 61 22.5 61C25.5376 61 28 63.4624 28 66.5C28 69.5376 25.5376 72 22.5 72C19.4624 72 17 69.5376 17 66.5Z", fill: "#27272A" }), _jsx("path", { d: "M17 86.5C17 83.4624 19.4624 81 22.5 81C25.5376 81 28 83.4624 28 86.5V87.5C28 90.5376 25.5376 93 22.5 93C19.4624 93 17 90.5376 17 87.5V86.5Z", fill: "#27272A" }), _jsx("path", { d: "M32 25.5C32 22.4624 34.4624 20 37.5 20H67.5C70.5376 20 73 22.4624 73 25.5C73 28.5376 70.5376 31 67.5 31H37.5C34.4624 31 32 28.5376 32 25.5Z", fill: "#3F3F46" }), _jsx("path", { d: "M32 66.5C32 63.4624 34.4624 61 37.5 61H67.5C70.5376 61 73 63.4624 73 66.5C73 69.5376 70.5376 72 67.5 72H37.5C34.4624 72 32 69.5376 32 66.5Z", fill: "#27272A" }), _jsx("path", { d: "M32 87C32 83.6863 34.6863 81 38 81H67C70.3137 81 73 83.6863 73 87C73 90.3137 70.3137 93 67 93H38C34.6863 93 32 90.3137 32 87Z", fill: "#27272A" }), _jsx("circle", { cx: "22.5", cy: "25.5", fill: "#3F3F46", r: "5.5" })] }));
287
10
  }
288
- //#endregion
289
- export { i as ThemePreviewDark, r as ThemePreviewLight, n as ThemePreviewSystem };
package/dist/email.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './components/auth/email';
1
+ export * from "./components/auth/email";
package/dist/email.js CHANGED
@@ -1,11 +1 @@
1
- import e, { defaultColors as t } from "./components/auth/email/email-styles.js";
2
- import n from "./components/auth/email/email-changed.js";
3
- import r from "./components/auth/email/email-verification.js";
4
- import i from "./components/auth/email/magic-link.js";
5
- import a from "./components/auth/email/new-device.js";
6
- import o from "./components/auth/email/otp-email.js";
7
- import s from "./components/auth/email/password-changed.js";
8
- import c from "./components/auth/email/reset-password.js";
9
- import { emailLocalization as l } from "./components/auth/email/email-localization.js";
10
- import "./components/auth/email/index.js";
11
- export { n as EmailChangedEmail, e as EmailStyles, r as EmailVerificationEmail, i as MagicLinkEmail, a as NewDeviceEmail, o as OtpEmail, s as PasswordChangedEmail, c as ResetPasswordEmail, t as defaultColors, l as emailLocalization };
1
+ export * from "./components/auth/email";
@@ -1,5 +1,5 @@
1
- import { AuthClient } from '../../lib/auth-client';
2
- import { UseSessionOptions } from '../../queries/auth/session-query';
1
+ import type { AuthClient } from "../../lib/auth-client";
2
+ import { type UseSessionOptions } from "../../queries/auth/session-query";
3
3
  /**
4
4
  * Calls `useSession` and redirects unauthenticated users to the sign-in page,
5
5
  * preserving the current URL as a `redirectTo` query param.
@@ -7,4 +7,4 @@ import { UseSessionOptions } from '../../queries/auth/session-query';
7
7
  * @param authClient - The Better Auth client.
8
8
  * @param options - `getSession` params & `useQuery` options.
9
9
  */
10
- export declare function useAuthenticate<TAuthClient extends AuthClient>(authClient: TAuthClient, options?: UseSessionOptions<TAuthClient>): import('@tanstack/react-query').UseQueryResult<import('@tanstack/react-query').NoInfer<import('../..').InferData<TAuthClient["getSession"]>>, import('better-auth/client').BetterFetchError>;
10
+ export declare function useAuthenticate<TAuthClient extends AuthClient>(authClient: TAuthClient, options?: UseSessionOptions<TAuthClient>): import("@tanstack/react-query").UseQueryResult<NoInfer<import("../..").InferData<TAuthClient["getSession"]>>, import("better-auth/client").BetterFetchError>;
@@ -1,23 +1,29 @@
1
- import { useAuth as e } from "../../components/auth/auth-provider.js";
2
- import { useSession as t } from "../../queries/auth/session-query.js";
3
- import { useEffect as n } from "react";
4
- //#region src/hooks/auth/use-authenticate.ts
5
- function r(r, i) {
6
- let { basePaths: a, viewPaths: o, navigate: s } = e(), c = t(r, i);
7
- return n(() => {
8
- if (c.data || c.isPending) return;
9
- let e = window.location.pathname + window.location.search, t = encodeURIComponent(e);
10
- s({
11
- to: `${a.auth}/${o.auth.signIn}?redirectTo=${t}`,
12
- replace: !0
13
- });
14
- }, [
15
- a.auth,
16
- c.data,
17
- c.isPending,
18
- o.auth.signIn,
19
- s
20
- ]), c;
1
+ import { useEffect } from "react";
2
+ import { useAuth } from "../../components/auth/auth-provider";
3
+ import { useSession } from "../../queries/auth/session-query";
4
+ /**
5
+ * Calls `useSession` and redirects unauthenticated users to the sign-in page,
6
+ * preserving the current URL as a `redirectTo` query param.
7
+ *
8
+ * @param authClient - The Better Auth client.
9
+ * @param options - `getSession` params & `useQuery` options.
10
+ */
11
+ export function useAuthenticate(authClient, options) {
12
+ const { basePaths, viewPaths, navigate } = useAuth();
13
+ const session = useSession(authClient, options);
14
+ useEffect(() => {
15
+ if (session.data || session.isPending)
16
+ return;
17
+ const currentURL = window.location.pathname + window.location.search;
18
+ const redirectTo = encodeURIComponent(currentURL);
19
+ const signInPath = `${basePaths.auth}/${viewPaths.auth.signIn}?redirectTo=${redirectTo}`;
20
+ navigate({ to: signInPath, replace: true });
21
+ }, [
22
+ basePaths.auth,
23
+ session.data,
24
+ session.isPending,
25
+ viewPaths.auth.signIn,
26
+ navigate
27
+ ]);
28
+ return session;
21
29
  }
22
- //#endregion
23
- export { r as useAuthenticate };
@@ -1,5 +1,5 @@
1
- import { AuthClient } from '../../lib/auth-client';
2
- import { UseSessionOptions } from '../../queries/auth/session-query';
1
+ import type { AuthClient } from "../../lib/auth-client";
2
+ import { type UseSessionOptions } from "../../queries/auth/session-query";
3
3
  /**
4
4
  * Retrieve the current authenticated user. Thin wrapper over `useSession`
5
5
  * that returns `session.user` as `data`.
@@ -8,7 +8,7 @@ import { UseSessionOptions } from '../../queries/auth/session-query';
8
8
  * @param options - `getSession` params & `useQuery` options.
9
9
  */
10
10
  export declare function useUser<TAuthClient extends AuthClient>(authClient: TAuthClient, options?: UseSessionOptions<TAuthClient>): {
11
- error: import('better-auth/client').BetterFetchError;
11
+ error: import("better-auth/client").BetterFetchError;
12
12
  isError: true;
13
13
  isPending: false;
14
14
  isLoading: false;
@@ -20,7 +20,7 @@ export declare function useUser<TAuthClient extends AuthClient>(authClient: TAut
20
20
  dataUpdatedAt: number;
21
21
  errorUpdatedAt: number;
22
22
  failureCount: number;
23
- failureReason: import('better-auth/client').BetterFetchError | null;
23
+ failureReason: import("better-auth/client").BetterFetchError | null;
24
24
  errorUpdateCount: number;
25
25
  isFetched: boolean;
26
26
  isFetchedAfterMount: boolean;
@@ -30,10 +30,10 @@ export declare function useUser<TAuthClient extends AuthClient>(authClient: TAut
30
30
  isRefetching: boolean;
31
31
  isStale: boolean;
32
32
  isEnabled: boolean;
33
- refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<import('@tanstack/react-query').NoInfer<import('../..').InferData<TAuthClient["getSession"]>>, import('better-auth/client').BetterFetchError>>;
34
- fetchStatus: import('@tanstack/react-query').FetchStatus;
35
- promise: Promise<import('@tanstack/react-query').NoInfer<import('../..').InferData<TAuthClient["getSession"]>>>;
36
- data: import('better-auth').StripEmptyObjects<{
33
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<NoInfer<import("../..").InferData<TAuthClient["getSession"]>>, import("better-auth/client").BetterFetchError>>;
34
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
35
+ promise: Promise<NoInfer<import("../..").InferData<TAuthClient["getSession"]>>>;
36
+ data: import("better-auth").StripEmptyObjects<{
37
37
  id: string;
38
38
  createdAt: Date;
39
39
  updatedAt: Date;
@@ -55,7 +55,7 @@ export declare function useUser<TAuthClient extends AuthClient>(authClient: TAut
55
55
  dataUpdatedAt: number;
56
56
  errorUpdatedAt: number;
57
57
  failureCount: number;
58
- failureReason: import('better-auth/client').BetterFetchError | null;
58
+ failureReason: import("better-auth/client").BetterFetchError | null;
59
59
  errorUpdateCount: number;
60
60
  isFetched: boolean;
61
61
  isFetchedAfterMount: boolean;
@@ -65,10 +65,10 @@ export declare function useUser<TAuthClient extends AuthClient>(authClient: TAut
65
65
  isRefetching: boolean;
66
66
  isStale: boolean;
67
67
  isEnabled: boolean;
68
- refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<import('@tanstack/react-query').NoInfer<import('../..').InferData<TAuthClient["getSession"]>>, import('better-auth/client').BetterFetchError>>;
69
- fetchStatus: import('@tanstack/react-query').FetchStatus;
70
- promise: Promise<import('@tanstack/react-query').NoInfer<import('../..').InferData<TAuthClient["getSession"]>>>;
71
- data: import('better-auth').StripEmptyObjects<{
68
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<NoInfer<import("../..").InferData<TAuthClient["getSession"]>>, import("better-auth/client").BetterFetchError>>;
69
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
70
+ promise: Promise<NoInfer<import("../..").InferData<TAuthClient["getSession"]>>>;
71
+ data: import("better-auth").StripEmptyObjects<{
72
72
  id: string;
73
73
  createdAt: Date;
74
74
  updatedAt: Date;
@@ -78,7 +78,7 @@ export declare function useUser<TAuthClient extends AuthClient>(authClient: TAut
78
78
  image?: string | null | undefined;
79
79
  }> | undefined;
80
80
  } | {
81
- error: import('better-auth/client').BetterFetchError;
81
+ error: import("better-auth/client").BetterFetchError;
82
82
  isError: true;
83
83
  isPending: false;
84
84
  isLoading: false;
@@ -90,7 +90,7 @@ export declare function useUser<TAuthClient extends AuthClient>(authClient: TAut
90
90
  dataUpdatedAt: number;
91
91
  errorUpdatedAt: number;
92
92
  failureCount: number;
93
- failureReason: import('better-auth/client').BetterFetchError | null;
93
+ failureReason: import("better-auth/client").BetterFetchError | null;
94
94
  errorUpdateCount: number;
95
95
  isFetched: boolean;
96
96
  isFetchedAfterMount: boolean;
@@ -100,10 +100,10 @@ export declare function useUser<TAuthClient extends AuthClient>(authClient: TAut
100
100
  isRefetching: boolean;
101
101
  isStale: boolean;
102
102
  isEnabled: boolean;
103
- refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<import('@tanstack/react-query').NoInfer<import('../..').InferData<TAuthClient["getSession"]>>, import('better-auth/client').BetterFetchError>>;
104
- fetchStatus: import('@tanstack/react-query').FetchStatus;
105
- promise: Promise<import('@tanstack/react-query').NoInfer<import('../..').InferData<TAuthClient["getSession"]>>>;
106
- data: import('better-auth').StripEmptyObjects<{
103
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<NoInfer<import("../..").InferData<TAuthClient["getSession"]>>, import("better-auth/client").BetterFetchError>>;
104
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
105
+ promise: Promise<NoInfer<import("../..").InferData<TAuthClient["getSession"]>>>;
106
+ data: import("better-auth").StripEmptyObjects<{
107
107
  id: string;
108
108
  createdAt: Date;
109
109
  updatedAt: Date;
@@ -125,7 +125,7 @@ export declare function useUser<TAuthClient extends AuthClient>(authClient: TAut
125
125
  dataUpdatedAt: number;
126
126
  errorUpdatedAt: number;
127
127
  failureCount: number;
128
- failureReason: import('better-auth/client').BetterFetchError | null;
128
+ failureReason: import("better-auth/client").BetterFetchError | null;
129
129
  errorUpdateCount: number;
130
130
  isFetched: boolean;
131
131
  isFetchedAfterMount: boolean;
@@ -135,10 +135,10 @@ export declare function useUser<TAuthClient extends AuthClient>(authClient: TAut
135
135
  isRefetching: boolean;
136
136
  isStale: boolean;
137
137
  isEnabled: boolean;
138
- refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<import('@tanstack/react-query').NoInfer<import('../..').InferData<TAuthClient["getSession"]>>, import('better-auth/client').BetterFetchError>>;
139
- fetchStatus: import('@tanstack/react-query').FetchStatus;
140
- promise: Promise<import('@tanstack/react-query').NoInfer<import('../..').InferData<TAuthClient["getSession"]>>>;
141
- data: import('better-auth').StripEmptyObjects<{
138
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<NoInfer<import("../..").InferData<TAuthClient["getSession"]>>, import("better-auth/client").BetterFetchError>>;
139
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
140
+ promise: Promise<NoInfer<import("../..").InferData<TAuthClient["getSession"]>>>;
141
+ data: import("better-auth").StripEmptyObjects<{
142
142
  id: string;
143
143
  createdAt: Date;
144
144
  updatedAt: Date;
@@ -159,7 +159,7 @@ export declare function useUser<TAuthClient extends AuthClient>(authClient: TAut
159
159
  dataUpdatedAt: number;
160
160
  errorUpdatedAt: number;
161
161
  failureCount: number;
162
- failureReason: import('better-auth/client').BetterFetchError | null;
162
+ failureReason: import("better-auth/client").BetterFetchError | null;
163
163
  errorUpdateCount: number;
164
164
  isFetched: boolean;
165
165
  isFetchedAfterMount: boolean;
@@ -170,10 +170,10 @@ export declare function useUser<TAuthClient extends AuthClient>(authClient: TAut
170
170
  isRefetching: boolean;
171
171
  isStale: boolean;
172
172
  isEnabled: boolean;
173
- refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<import('@tanstack/react-query').NoInfer<import('../..').InferData<TAuthClient["getSession"]>>, import('better-auth/client').BetterFetchError>>;
174
- fetchStatus: import('@tanstack/react-query').FetchStatus;
175
- promise: Promise<import('@tanstack/react-query').NoInfer<import('../..').InferData<TAuthClient["getSession"]>>>;
176
- data: import('better-auth').StripEmptyObjects<{
173
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<NoInfer<import("../..").InferData<TAuthClient["getSession"]>>, import("better-auth/client").BetterFetchError>>;
174
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
175
+ promise: Promise<NoInfer<import("../..").InferData<TAuthClient["getSession"]>>>;
176
+ data: import("better-auth").StripEmptyObjects<{
177
177
  id: string;
178
178
  createdAt: Date;
179
179
  updatedAt: Date;
@@ -195,7 +195,7 @@ export declare function useUser<TAuthClient extends AuthClient>(authClient: TAut
195
195
  dataUpdatedAt: number;
196
196
  errorUpdatedAt: number;
197
197
  failureCount: number;
198
- failureReason: import('better-auth/client').BetterFetchError | null;
198
+ failureReason: import("better-auth/client").BetterFetchError | null;
199
199
  errorUpdateCount: number;
200
200
  isFetched: boolean;
201
201
  isFetchedAfterMount: boolean;
@@ -205,10 +205,10 @@ export declare function useUser<TAuthClient extends AuthClient>(authClient: TAut
205
205
  isRefetching: boolean;
206
206
  isStale: boolean;
207
207
  isEnabled: boolean;
208
- refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<import('@tanstack/react-query').NoInfer<import('../..').InferData<TAuthClient["getSession"]>>, import('better-auth/client').BetterFetchError>>;
209
- fetchStatus: import('@tanstack/react-query').FetchStatus;
210
- promise: Promise<import('@tanstack/react-query').NoInfer<import('../..').InferData<TAuthClient["getSession"]>>>;
211
- data: import('better-auth').StripEmptyObjects<{
208
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<NoInfer<import("../..").InferData<TAuthClient["getSession"]>>, import("better-auth/client").BetterFetchError>>;
209
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
210
+ promise: Promise<NoInfer<import("../..").InferData<TAuthClient["getSession"]>>>;
211
+ data: import("better-auth").StripEmptyObjects<{
212
212
  id: string;
213
213
  createdAt: Date;
214
214
  updatedAt: Date;
@@ -1,11 +1,15 @@
1
- import { useSession as e } from "../../queries/auth/session-query.js";
2
- //#region src/hooks/auth/use-user.ts
3
- function t(t, n) {
4
- let { data: r, ...i } = e(t, n);
5
- return {
6
- data: r?.user,
7
- ...i
8
- };
1
+ import { useSession } from "../../queries/auth/session-query";
2
+ /**
3
+ * Retrieve the current authenticated user. Thin wrapper over `useSession`
4
+ * that returns `session.user` as `data`.
5
+ *
6
+ * @param authClient - The Better Auth client.
7
+ * @param options - `getSession` params & `useQuery` options.
8
+ */
9
+ export function useUser(authClient, options) {
10
+ const { data, ...rest } = useSession(authClient, options);
11
+ return {
12
+ data: data?.user,
13
+ ...rest
14
+ };
9
15
  }
10
- //#endregion
11
- export { t as useUser };
@@ -1,6 +1,6 @@
1
- import { MutationKey, UseMutationOptions } from '@tanstack/react-query';
2
- import { BetterFetchError } from 'better-auth/client';
3
- import { AuthMutationFn, AuthMutationFnData, AuthMutationFnVariables } from '../mutations/auth-mutation-options';
1
+ import { type MutationKey, type UseMutationOptions } from "@tanstack/react-query";
2
+ import type { BetterFetchError } from "better-auth/client";
3
+ import { type AuthMutationFn, type AuthMutationFnData, type AuthMutationFnVariables } from "../mutations/auth-mutation-options";
4
4
  type UseAuthMutationOptions<TFn extends AuthMutationFn> = Omit<UseMutationOptions<AuthMutationFnData<TFn>, BetterFetchError, AuthMutationFnVariables<TFn>>, "mutationKey" | "mutationFn">;
5
5
  /**
6
6
  * Escape-hatch hook for Better Auth write endpoints that don't have a
@@ -13,5 +13,5 @@ type UseAuthMutationOptions<TFn extends AuthMutationFn> = Omit<UseMutationOption
13
13
  * `MutationCache` observers line up.
14
14
  * @param options - React Query options forwarded to `useMutation`.
15
15
  */
16
- export declare function useAuthMutation<TFn extends AuthMutationFn, const TMutationKey extends MutationKey>(authFn: TFn, mutationKey: TMutationKey, options?: UseAuthMutationOptions<TFn>): import('@tanstack/react-query').UseMutationResult<Awaited<ReturnType<TFn>>, BetterFetchError, AuthMutationFnVariables<TFn>, unknown>;
16
+ export declare function useAuthMutation<TFn extends AuthMutationFn, const TMutationKey extends MutationKey>(authFn: TFn, mutationKey: TMutationKey, options?: UseAuthMutationOptions<TFn>): import("@tanstack/react-query").UseMutationResult<Awaited<ReturnType<TFn>>, BetterFetchError, AuthMutationFnVariables<TFn>, unknown>;
17
17
  export {};