@better-auth-ui/react 1.6.8 → 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.
- package/dist/components/auth/auth-context.d.ts +3 -0
- package/dist/components/auth/auth-context.js +4 -0
- package/dist/components/auth/auth-provider.d.ts +4 -4
- package/dist/components/auth/auth-provider.js +65 -41
- package/dist/components/auth/email/email-changed.d.ts +2 -2
- package/dist/components/auth/email/email-changed.js +68 -154
- package/dist/components/auth/email/email-localization.d.ts +11 -3
- package/dist/components/auth/email/email-localization.js +25 -18
- package/dist/components/auth/email/email-styles.js +77 -52
- package/dist/components/auth/email/email-verification.d.ts +2 -2
- package/dist/components/auth/email/email-verification.js +73 -138
- package/dist/components/auth/email/index.d.ts +10 -9
- package/dist/components/auth/email/index.js +10 -9
- package/dist/components/auth/email/magic-link.d.ts +2 -2
- package/dist/components/auth/email/magic-link.js +70 -139
- package/dist/components/auth/email/new-device.d.ts +2 -2
- package/dist/components/auth/email/new-device.js +88 -221
- package/dist/components/auth/email/organization-invitation.d.ts +121 -0
- package/dist/components/auth/email/organization-invitation.js +110 -0
- package/dist/components/auth/email/otp-email.d.ts +2 -2
- package/dist/components/auth/email/otp-email.js +63 -127
- package/dist/components/auth/email/password-changed.d.ts +2 -2
- package/dist/components/auth/email/password-changed.js +74 -157
- package/dist/components/auth/email/reset-password.d.ts +2 -2
- package/dist/components/auth/email/reset-password.js +66 -138
- package/dist/components/auth/fetch-options-provider.d.ts +1 -1
- package/dist/components/auth/fetch-options-provider.js +28 -27
- package/dist/components/icons/apple.d.ts +1 -1
- package/dist/components/icons/apple.js +9 -16
- package/dist/components/icons/atlassian.d.ts +1 -1
- package/dist/components/icons/atlassian.js +13 -38
- package/dist/components/icons/cognito.d.ts +1 -1
- package/dist/components/icons/cognito.js +9 -19
- package/dist/components/icons/discord.d.ts +1 -1
- package/dist/components/icons/discord.js +9 -16
- package/dist/components/icons/dropbox.d.ts +1 -1
- package/dist/components/icons/dropbox.js +9 -16
- package/dist/components/icons/facebook.d.ts +1 -1
- package/dist/components/icons/facebook.js +11 -19
- package/dist/components/icons/figma.d.ts +1 -1
- package/dist/components/icons/figma.js +12 -34
- package/dist/components/icons/github.d.ts +1 -1
- package/dist/components/icons/github.js +11 -16
- package/dist/components/icons/gitlab.d.ts +1 -1
- package/dist/components/icons/gitlab.js +9 -30
- package/dist/components/icons/google.d.ts +1 -1
- package/dist/components/icons/google.js +9 -39
- package/dist/components/icons/huggingface.d.ts +1 -1
- package/dist/components/icons/huggingface.js +9 -38
- package/dist/components/icons/index.d.ts +35 -35
- package/dist/components/icons/index.js +35 -35
- package/dist/components/icons/kakao.d.ts +1 -1
- package/dist/components/icons/kakao.js +11 -16
- package/dist/components/icons/kick.d.ts +1 -1
- package/dist/components/icons/kick.js +11 -20
- package/dist/components/icons/line.d.ts +1 -1
- package/dist/components/icons/line.js +9 -16
- package/dist/components/icons/linear.d.ts +1 -1
- package/dist/components/icons/linear.js +9 -16
- package/dist/components/icons/linkedin.d.ts +1 -1
- package/dist/components/icons/linkedin.js +9 -33
- package/dist/components/icons/microsoft.d.ts +1 -1
- package/dist/components/icons/microsoft.js +9 -30
- package/dist/components/icons/naver.d.ts +1 -1
- package/dist/components/icons/naver.js +9 -16
- package/dist/components/icons/notion.d.ts +1 -1
- package/dist/components/icons/notion.js +9 -16
- package/dist/components/icons/paybin.d.ts +1 -1
- package/dist/components/icons/paybin.js +8 -32
- package/dist/components/icons/paypal.d.ts +1 -1
- package/dist/components/icons/paypal.js +9 -30
- package/dist/components/icons/polar.d.ts +1 -1
- package/dist/components/icons/polar.js +9 -24
- package/dist/components/icons/railway.d.ts +1 -1
- package/dist/components/icons/railway.js +9 -16
- package/dist/components/icons/reddit.d.ts +1 -1
- package/dist/components/icons/reddit.js +9 -21
- package/dist/components/icons/roblox.d.ts +1 -1
- package/dist/components/icons/roblox.js +12 -17
- package/dist/components/icons/salesforce.d.ts +1 -1
- package/dist/components/icons/salesforce.js +9 -16
- package/dist/components/icons/slack.d.ts +1 -1
- package/dist/components/icons/slack.js +9 -30
- package/dist/components/icons/spotify.d.ts +1 -1
- package/dist/components/icons/spotify.js +9 -16
- package/dist/components/icons/tiktok.d.ts +1 -1
- package/dist/components/icons/tiktok.js +10 -23
- package/dist/components/icons/twitch.d.ts +1 -1
- package/dist/components/icons/twitch.js +12 -43
- package/dist/components/icons/vercel.d.ts +1 -1
- package/dist/components/icons/vercel.js +9 -16
- package/dist/components/icons/vk.d.ts +1 -1
- package/dist/components/icons/vk.js +9 -16
- package/dist/components/icons/wechat.d.ts +1 -1
- package/dist/components/icons/wechat.js +9 -16
- package/dist/components/icons/x.d.ts +1 -1
- package/dist/components/icons/x.js +9 -16
- package/dist/components/icons/zoom.d.ts +1 -1
- package/dist/components/icons/zoom.js +11 -69
- package/dist/components/mutation-invalidator.d.ts +1 -0
- package/dist/components/mutation-invalidator.js +31 -0
- package/dist/components/settings/account/theme-preview.js +7 -286
- package/dist/email.d.ts +1 -1
- package/dist/email.js +1 -11
- package/dist/hooks/auth/use-authenticate.d.ts +3 -3
- package/dist/hooks/auth/use-authenticate.js +28 -22
- package/dist/hooks/auth/use-user.d.ts +34 -34
- package/dist/hooks/auth/use-user.js +14 -10
- package/dist/hooks/use-auth-mutation.d.ts +4 -4
- package/dist/hooks/use-auth-mutation.js +18 -10
- package/dist/hooks/use-auth-plugin.d.ts +1 -1
- package/dist/hooks/use-auth-plugin.js +26 -8
- package/dist/hooks/use-auth-query.d.ts +3 -3
- package/dist/hooks/use-auth-query.js +20 -14
- package/dist/index.d.ts +48 -45
- package/dist/index.js +47 -79
- package/dist/lib/auth-client.d.ts +7 -4
- package/dist/lib/auth-client.js +1 -0
- package/dist/lib/auth-plugin.d.ts +19 -3
- package/dist/lib/auth-plugin.js +1 -0
- package/dist/lib/auth-server.d.ts +10 -3
- package/dist/lib/auth-server.js +1 -0
- package/dist/lib/provider-icons.d.ts +2 -2
- package/dist/lib/provider-icons.js +47 -75
- package/dist/lib/settings-tab.d.ts +19 -0
- package/dist/lib/settings-tab.js +1 -0
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.js +4 -7
- package/dist/mutations/api-key/create-api-key-mutation.d.ts +9 -7
- package/dist/mutations/api-key/create-api-key-mutation.js +37 -27
- package/dist/mutations/api-key/delete-api-key-mutation.d.ts +10 -6
- package/dist/mutations/api-key/delete-api-key-mutation.js +37 -27
- package/dist/mutations/auth/request-password-reset-mutation.d.ts +4 -4
- package/dist/mutations/auth/request-password-reset-mutation.js +31 -22
- package/dist/mutations/auth/reset-password-mutation.d.ts +4 -4
- package/dist/mutations/auth/reset-password-mutation.js +32 -22
- package/dist/mutations/auth/send-verification-email-mutation.d.ts +4 -4
- package/dist/mutations/auth/send-verification-email-mutation.js +31 -22
- package/dist/mutations/auth/sign-in-email-mutation.d.ts +10 -10
- package/dist/mutations/auth/sign-in-email-mutation.js +38 -27
- package/dist/mutations/auth/sign-in-social-mutation.d.ts +6 -6
- package/dist/mutations/auth/sign-in-social-mutation.js +36 -22
- package/dist/mutations/auth/sign-out-mutation.d.ts +9 -7
- package/dist/mutations/auth/sign-out-mutation.js +39 -26
- package/dist/mutations/auth/sign-up-email-mutation.d.ts +12 -12
- package/dist/mutations/auth/sign-up-email-mutation.js +34 -27
- package/dist/mutations/auth-mutation-options.d.ts +2 -2
- package/dist/mutations/auth-mutation-options.js +22 -18
- package/dist/mutations/magic-link/sign-in-magic-link-mutation.d.ts +4 -4
- package/dist/mutations/magic-link/sign-in-magic-link-mutation.js +31 -22
- package/dist/mutations/multi-session/revoke-multi-session-mutation.d.ts +8 -8
- package/dist/mutations/multi-session/revoke-multi-session-mutation.js +37 -27
- package/dist/mutations/multi-session/set-active-session-mutation.d.ts +8 -9
- package/dist/mutations/multi-session/set-active-session-mutation.js +38 -29
- package/dist/mutations/organization/accept-invitation-mutation.d.ts +43 -0
- package/dist/mutations/organization/accept-invitation-mutation.js +32 -0
- package/dist/mutations/organization/cancel-invitation-mutation.d.ts +25 -0
- package/dist/mutations/organization/cancel-invitation-mutation.js +28 -0
- package/dist/mutations/organization/check-slug-mutation.d.ts +21 -0
- package/dist/mutations/organization/check-slug-mutation.js +30 -0
- package/dist/mutations/organization/create-organization-mutation.d.ts +39 -0
- package/dist/mutations/organization/create-organization-mutation.js +29 -0
- package/dist/mutations/organization/delete-organization-mutation.d.ts +21 -0
- package/dist/mutations/organization/delete-organization-mutation.js +29 -0
- package/dist/mutations/organization/index.d.ts +12 -0
- package/dist/mutations/organization/index.js +12 -0
- package/dist/mutations/organization/invite-member-mutation.d.ts +43 -0
- package/dist/mutations/organization/invite-member-mutation.js +35 -0
- package/dist/mutations/organization/leave-organization-mutation.d.ts +65 -0
- package/dist/mutations/organization/leave-organization-mutation.js +32 -0
- package/dist/mutations/organization/reject-invitation-mutation.d.ts +31 -0
- package/dist/mutations/organization/reject-invitation-mutation.js +25 -0
- package/dist/mutations/organization/remove-member-mutation.d.ts +35 -0
- package/dist/mutations/organization/remove-member-mutation.js +29 -0
- package/dist/mutations/organization/set-active-organization-mutation.d.ts +71 -0
- package/dist/mutations/organization/set-active-organization-mutation.js +72 -0
- package/dist/mutations/organization/update-member-role-mutation.d.ts +31 -0
- package/dist/mutations/organization/update-member-role-mutation.js +36 -0
- package/dist/mutations/organization/update-organization-mutation.d.ts +21 -0
- package/dist/mutations/organization/update-organization-mutation.js +36 -0
- package/dist/mutations/passkey/add-passkey-mutation.d.ts +16 -16
- package/dist/mutations/passkey/add-passkey-mutation.js +38 -27
- package/dist/mutations/passkey/delete-passkey-mutation.d.ts +8 -8
- package/dist/mutations/passkey/delete-passkey-mutation.js +37 -27
- package/dist/mutations/passkey/sign-in-passkey-mutation.d.ts +24 -24
- package/dist/mutations/passkey/sign-in-passkey-mutation.js +36 -27
- package/dist/mutations/settings/change-email-mutation.d.ts +9 -8
- package/dist/mutations/settings/change-email-mutation.js +35 -27
- package/dist/mutations/settings/change-password-mutation.d.ts +6 -6
- package/dist/mutations/settings/change-password-mutation.js +31 -22
- package/dist/mutations/settings/delete-user-mutation.d.ts +4 -4
- package/dist/mutations/settings/delete-user-mutation.js +31 -22
- package/dist/mutations/settings/link-social-mutation.d.ts +4 -4
- package/dist/mutations/settings/link-social-mutation.js +31 -22
- package/dist/mutations/settings/revoke-session-mutation.d.ts +8 -8
- package/dist/mutations/settings/revoke-session-mutation.js +37 -27
- package/dist/mutations/settings/unlink-account-mutation.d.ts +8 -8
- package/dist/mutations/settings/unlink-account-mutation.js +37 -27
- package/dist/mutations/settings/update-user-mutation.d.ts +8 -8
- package/dist/mutations/settings/update-user-mutation.js +34 -33
- package/dist/mutations/username/is-username-available-mutation.d.ts +4 -4
- package/dist/mutations/username/is-username-available-mutation.js +34 -22
- package/dist/mutations/username/sign-in-username-mutation.d.ts +10 -10
- package/dist/mutations/username/sign-in-username-mutation.js +35 -27
- package/dist/plugins/captcha-plugin.d.ts +3 -3
- package/dist/plugins/captcha-plugin.js +31 -26
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +1 -2
- package/dist/queries/api-key/list-api-keys-query.d.ts +20 -11
- package/dist/queries/api-key/list-api-keys-query.js +52 -29
- package/dist/queries/auth/session-query.d.ts +6 -6
- package/dist/queries/auth/session-query.js +70 -28
- package/dist/queries/auth-query-options.d.ts +2 -2
- package/dist/queries/auth-query-options.js +20 -16
- package/dist/queries/multi-session/list-device-sessions-query.d.ts +8 -8
- package/dist/queries/multi-session/list-device-sessions-query.js +83 -29
- package/dist/queries/organization/active-organization-query.d.ts +39 -0
- package/dist/queries/organization/active-organization-query.js +37 -0
- package/dist/queries/organization/full-organization-query.d.ts +37 -0
- package/dist/queries/organization/full-organization-query.js +31 -0
- package/dist/queries/organization/has-permission-query.d.ts +21 -0
- package/dist/queries/organization/has-permission-query.js +38 -0
- package/dist/queries/organization/index.d.ts +7 -0
- package/dist/queries/organization/index.js +7 -0
- package/dist/queries/organization/list-invitations-query.d.ts +29 -0
- package/dist/queries/organization/list-invitations-query.js +37 -0
- package/dist/queries/organization/list-members-query.d.ts +61 -0
- package/dist/queries/organization/list-members-query.js +37 -0
- package/dist/queries/organization/list-organizations-query.d.ts +22 -0
- package/dist/queries/organization/list-organizations-query.js +31 -0
- package/dist/queries/organization/list-user-invitations-query.d.ts +29 -0
- package/dist/queries/organization/list-user-invitations-query.js +31 -0
- package/dist/queries/passkey/list-passkeys-query.d.ts +8 -8
- package/dist/queries/passkey/list-passkeys-query.js +81 -29
- package/dist/queries/settings/account-info-query.d.ts +6 -6
- package/dist/queries/settings/account-info-query.js +85 -29
- package/dist/queries/settings/list-accounts-query.d.ts +6 -6
- package/dist/queries/settings/list-accounts-query.js +83 -29
- package/dist/queries/settings/list-sessions-query.d.ts +6 -6
- package/dist/queries/settings/list-sessions-query.js +81 -29
- package/dist/server/queries/api-key/list-api-keys-query.d.ts +83 -0
- package/dist/server/queries/api-key/list-api-keys-query.js +49 -0
- package/dist/server/queries/auth/session-query.d.ts +5 -5
- package/dist/server/queries/auth/session-query.js +50 -12
- package/dist/server/queries/multi-session/list-device-sessions-query.d.ts +7 -7
- package/dist/server/queries/multi-session/list-device-sessions-query.js +53 -11
- package/dist/server/queries/organization/active-organization-query.d.ts +61 -0
- package/dist/server/queries/organization/active-organization-query.js +25 -0
- package/dist/server/queries/organization/full-organization-query.d.ts +42 -0
- package/dist/server/queries/organization/full-organization-query.js +21 -0
- package/dist/server/queries/organization/has-permission-query.d.ts +66 -0
- package/dist/server/queries/organization/has-permission-query.js +23 -0
- package/dist/server/queries/organization/list-invitations-query.d.ts +34 -0
- package/dist/server/queries/organization/list-invitations-query.js +21 -0
- package/dist/server/queries/organization/list-members-query.d.ts +66 -0
- package/dist/server/queries/organization/list-members-query.js +21 -0
- package/dist/server/queries/organization/list-organizations-query.d.ts +27 -0
- package/dist/server/queries/organization/list-organizations-query.js +21 -0
- package/dist/server/queries/organization/list-user-invitations-query.d.ts +34 -0
- package/dist/server/queries/organization/list-user-invitations-query.js +21 -0
- package/dist/server/queries/passkey/list-passkeys-query.d.ts +7 -7
- package/dist/server/queries/passkey/list-passkeys-query.js +53 -11
- package/dist/server/queries/settings/account-info-query.d.ts +5 -5
- package/dist/server/queries/settings/account-info-query.js +53 -11
- package/dist/server/queries/settings/list-accounts-query.d.ts +5 -5
- package/dist/server/queries/settings/list-accounts-query.js +53 -11
- package/dist/server/queries/settings/list-sessions-query.d.ts +5 -5
- package/dist/server/queries/settings/list-sessions-query.js +53 -11
- package/dist/server.d.ts +15 -7
- package/dist/server.js +14 -7
- package/package.json +20 -17
- package/src/components/auth/auth-context.tsx +7 -0
- package/src/components/auth/auth-provider.tsx +19 -31
- package/src/components/auth/email/email-localization.tsx +5 -3
- package/src/components/auth/email/index.ts +1 -0
- package/src/components/auth/email/organization-invitation.tsx +454 -0
- package/src/components/mutation-invalidator.tsx +67 -0
- package/src/index.ts +3 -0
- package/src/lib/auth-client.ts +7 -0
- package/src/lib/auth-plugin.ts +17 -0
- package/src/lib/auth-server.ts +17 -1
- package/src/lib/settings-tab.ts +21 -0
- package/src/mutations/api-key/create-api-key-mutation.ts +34 -19
- package/src/mutations/api-key/delete-api-key-mutation.ts +36 -19
- package/src/mutations/auth/sign-in-email-mutation.ts +18 -22
- package/src/mutations/auth/sign-out-mutation.ts +19 -13
- package/src/mutations/auth/sign-up-email-mutation.ts +18 -22
- package/src/mutations/multi-session/revoke-multi-session-mutation.ts +31 -20
- package/src/mutations/multi-session/set-active-session-mutation.ts +25 -44
- package/src/mutations/organization/accept-invitation-mutation.ts +71 -0
- package/src/mutations/organization/cancel-invitation-mutation.ts +67 -0
- package/src/mutations/organization/check-slug-mutation.ts +55 -0
- package/src/mutations/organization/create-organization-mutation.ts +71 -0
- package/src/mutations/organization/delete-organization-mutation.ts +71 -0
- package/src/mutations/organization/index.ts +12 -0
- package/src/mutations/organization/invite-member-mutation.ts +81 -0
- package/src/mutations/organization/leave-organization-mutation.ts +74 -0
- package/src/mutations/organization/reject-invitation-mutation.ts +64 -0
- package/src/mutations/organization/remove-member-mutation.ts +67 -0
- package/src/mutations/organization/set-active-organization-mutation.ts +142 -0
- package/src/mutations/organization/update-member-role-mutation.ts +81 -0
- package/src/mutations/organization/update-organization-mutation.ts +84 -0
- package/src/mutations/passkey/add-passkey-mutation.ts +28 -17
- package/src/mutations/passkey/delete-passkey-mutation.ts +27 -17
- package/src/mutations/passkey/sign-in-passkey-mutation.ts +18 -21
- package/src/mutations/settings/change-email-mutation.ts +22 -18
- package/src/mutations/settings/delete-user-mutation.ts +2 -2
- package/src/mutations/settings/revoke-session-mutation.ts +24 -19
- package/src/mutations/settings/unlink-account-mutation.ts +24 -17
- package/src/mutations/settings/update-user-mutation.ts +18 -30
- package/src/mutations/username/is-username-available-mutation.ts +2 -2
- package/src/mutations/username/sign-in-username-mutation.ts +20 -23
- package/src/queries/api-key/list-api-keys-query.ts +20 -8
- package/src/queries/multi-session/list-device-sessions-query.ts +2 -2
- package/src/queries/organization/active-organization-query.ts +140 -0
- package/src/queries/organization/full-organization-query.ts +113 -0
- package/src/queries/organization/has-permission-query.ts +124 -0
- package/src/queries/organization/index.ts +7 -0
- package/src/queries/organization/list-invitations-query.ts +133 -0
- package/src/queries/organization/list-members-query.ts +133 -0
- package/src/queries/organization/list-organizations-query.ts +122 -0
- package/src/queries/organization/list-user-invitations-query.ts +122 -0
- package/src/queries/passkey/list-passkeys-query.ts +2 -2
- package/src/server/queries/api-key/list-api-keys-query.ts +94 -0
- package/src/server/queries/multi-session/list-device-sessions-query.ts +2 -2
- package/src/server/queries/organization/active-organization-query.ts +92 -0
- package/src/server/queries/organization/full-organization-query.ts +64 -0
- package/src/server/queries/organization/has-permission-query.ts +66 -0
- package/src/server/queries/organization/list-invitations-query.ts +81 -0
- package/src/server/queries/organization/list-members-query.ts +75 -0
- package/src/server/queries/organization/list-organizations-query.ts +67 -0
- package/src/server/queries/organization/list-user-invitations-query.ts +68 -0
- package/src/server/queries/passkey/list-passkeys-query.ts +2 -2
- package/src/server.ts +8 -0
|
@@ -1,289 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
149
|
-
|
|
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
|
|
219
|
-
|
|
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
|
|
1
|
+
export * from "./components/auth/email";
|
package/dist/email.js
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
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
|
|
2
|
-
import { UseSessionOptions } from
|
|
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(
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
|
2
|
-
import { UseSessionOptions } from
|
|
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(
|
|
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(
|
|
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(
|
|
34
|
-
fetchStatus: import(
|
|
35
|
-
promise: Promise<
|
|
36
|
-
data: import(
|
|
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(
|
|
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(
|
|
69
|
-
fetchStatus: import(
|
|
70
|
-
promise: Promise<
|
|
71
|
-
data: import(
|
|
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(
|
|
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(
|
|
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(
|
|
104
|
-
fetchStatus: import(
|
|
105
|
-
promise: Promise<
|
|
106
|
-
data: import(
|
|
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(
|
|
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(
|
|
139
|
-
fetchStatus: import(
|
|
140
|
-
promise: Promise<
|
|
141
|
-
data: import(
|
|
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(
|
|
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(
|
|
174
|
-
fetchStatus: import(
|
|
175
|
-
promise: Promise<
|
|
176
|
-
data: import(
|
|
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(
|
|
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(
|
|
209
|
-
fetchStatus: import(
|
|
210
|
-
promise: Promise<
|
|
211
|
-
data: import(
|
|
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
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
|
2
|
-
import { BetterFetchError } from
|
|
3
|
-
import { AuthMutationFn, AuthMutationFnData, AuthMutationFnVariables } from
|
|
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(
|
|
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 {};
|