@better-auth-ui/heroui 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.
- package/dist/components/auth/additional-field.d.ts +2 -2
- package/dist/components/auth/additional-field.js +133 -266
- package/dist/components/auth/api-key/api-key-skeleton.js +4 -20
- package/dist/components/auth/api-key/api-key.d.ts +6 -2
- package/dist/components/auth/api-key/api-key.js +16 -54
- package/dist/components/auth/api-key/api-keys-empty.d.ts +3 -1
- package/dist/components/auth/api-key/api-keys-empty.js +8 -34
- package/dist/components/auth/api-key/api-keys.d.ts +10 -2
- package/dist/components/auth/api-key/api-keys.js +21 -40
- package/dist/components/auth/api-key/create-api-key-dialog.d.ts +3 -1
- package/dist/components/auth/api-key/create-api-key-dialog.js +43 -73
- package/dist/components/auth/api-key/delete-api-key-dialog.d.ts +4 -2
- package/dist/components/auth/api-key/delete-api-key-dialog.js +16 -50
- package/dist/components/auth/api-key/new-api-key-dialog.js +23 -59
- package/dist/components/auth/api-key/organization-api-keys.d.ts +14 -0
- package/dist/components/auth/api-key/organization-api-keys.js +22 -0
- package/dist/components/auth/auth-provider.d.ts +1 -1
- package/dist/components/auth/auth-provider.js +10 -16
- package/dist/components/auth/auth.d.ts +3 -3
- package/dist/components/auth/auth.js +86 -61
- package/dist/components/auth/delete-user/danger-zone.d.ts +3 -3
- package/dist/components/auth/delete-user/danger-zone.js +11 -17
- package/dist/components/auth/delete-user/delete-account.d.ts +9 -0
- package/dist/components/auth/delete-user/delete-account.js +50 -0
- package/dist/components/auth/email/email-changed-email.d.ts +2 -2
- package/dist/components/auth/email/email-changed-email.js +22 -29
- package/dist/components/auth/email/email-verification-email.d.ts +2 -2
- package/dist/components/auth/email/email-verification-email.js +22 -29
- package/dist/components/auth/email/magic-link-email.d.ts +2 -2
- package/dist/components/auth/email/magic-link-email.js +22 -29
- package/dist/components/auth/email/new-device-email.d.ts +2 -2
- package/dist/components/auth/email/new-device-email.js +22 -29
- package/dist/components/auth/email/organization-invitation-email.d.ts +3 -0
- package/dist/components/auth/email/organization-invitation-email.js +23 -0
- package/dist/components/auth/email/otp-email.d.ts +2 -2
- package/dist/components/auth/email/otp-email.js +21 -28
- package/dist/components/auth/email/password-changed-email.d.ts +2 -2
- package/dist/components/auth/email/password-changed-email.js +22 -29
- package/dist/components/auth/email/reset-password-email.d.ts +2 -2
- package/dist/components/auth/email/reset-password-email.js +22 -29
- package/dist/components/auth/error-toaster.js +32 -16
- package/dist/components/auth/field-separator.d.ts +1 -1
- package/dist/components/auth/field-separator.js +4 -17
- package/dist/components/auth/forgot-password.d.ts +1 -1
- package/dist/components/auth/forgot-password.js +36 -88
- package/dist/components/auth/magic-link/magic-link-button.d.ts +1 -1
- package/dist/components/auth/magic-link/magic-link-button.js +33 -19
- package/dist/components/auth/magic-link/magic-link.d.ts +2 -2
- package/dist/components/auth/magic-link/magic-link.js +39 -86
- package/dist/components/auth/multi-session/manage-account.d.ts +1 -1
- package/dist/components/auth/multi-session/manage-account.js +32 -48
- package/dist/components/auth/multi-session/manage-accounts.d.ts +1 -1
- package/dist/components/auth/multi-session/manage-accounts.js +32 -33
- package/dist/components/auth/multi-session/switch-account-submenu-content.d.ts +3 -1
- package/dist/components/auth/multi-session/switch-account-submenu-content.js +24 -27
- package/dist/components/auth/multi-session/switch-account-submenu-item.d.ts +3 -2
- package/dist/components/auth/multi-session/switch-account-submenu-item.js +16 -19
- package/dist/components/auth/multi-session/switch-account-submenu.d.ts +2 -1
- package/dist/components/auth/multi-session/switch-account-submenu.js +23 -23
- package/dist/components/auth/organization/change-organization-logo.d.ts +4 -0
- package/dist/components/auth/organization/change-organization-logo.js +69 -0
- package/dist/components/auth/organization/create-organization-dialog.d.ts +13 -0
- package/dist/components/auth/organization/create-organization-dialog.js +37 -0
- package/dist/components/auth/organization/delete-organization-dialog.d.ts +7 -0
- package/dist/components/auth/organization/delete-organization-dialog.js +25 -0
- package/dist/components/auth/organization/delete-organization-skeleton.d.ts +4 -0
- package/dist/components/auth/organization/delete-organization-skeleton.js +8 -0
- package/dist/components/auth/organization/delete-organization.d.ts +5 -0
- package/dist/components/auth/organization/delete-organization.js +27 -0
- package/dist/components/auth/organization/invite-member-dialog.d.ts +13 -0
- package/dist/components/auth/organization/invite-member-dialog.js +47 -0
- package/dist/components/auth/organization/leave-organization-dialog.d.ts +7 -0
- package/dist/components/auth/organization/leave-organization-dialog.js +21 -0
- package/dist/components/auth/organization/leave-organization.d.ts +4 -0
- package/dist/components/auth/organization/leave-organization.js +16 -0
- package/dist/components/auth/organization/organization-danger-zone.d.ts +16 -0
- package/dist/components/auth/organization/organization-danger-zone.js +23 -0
- package/dist/components/auth/organization/organization-invitation-row-skeleton.d.ts +5 -0
- package/dist/components/auth/organization/organization-invitation-row-skeleton.js +9 -0
- package/dist/components/auth/organization/organization-invitation-row.d.ts +5 -0
- package/dist/components/auth/organization/organization-invitation-row.js +31 -0
- package/dist/components/auth/organization/organization-invitations-empty.d.ts +8 -0
- package/dist/components/auth/organization/organization-invitations-empty.js +13 -0
- package/dist/components/auth/organization/organization-invitations.d.ts +9 -0
- package/dist/components/auth/organization/organization-invitations.js +66 -0
- package/dist/components/auth/organization/organization-logo.d.ts +15 -0
- package/dist/components/auth/organization/organization-logo.js +14 -0
- package/dist/components/auth/organization/organization-member-row-skeleton.d.ts +4 -0
- package/dist/components/auth/organization/organization-member-row-skeleton.js +9 -0
- package/dist/components/auth/organization/organization-member-row.d.ts +9 -0
- package/dist/components/auth/organization/organization-member-row.js +34 -0
- package/dist/components/auth/organization/organization-members.d.ts +9 -0
- package/dist/components/auth/organization/organization-members.js +67 -0
- package/dist/components/auth/organization/organization-people.d.ts +10 -0
- package/dist/components/auth/organization/organization-people.js +11 -0
- package/dist/components/auth/organization/organization-profile.d.ts +9 -0
- package/dist/components/auth/organization/organization-profile.js +34 -0
- package/dist/components/auth/organization/organization-row.d.ts +8 -0
- package/dist/components/auth/organization/organization-row.js +31 -0
- package/dist/components/auth/organization/organization-settings.d.ts +12 -0
- package/dist/components/auth/organization/organization-settings.js +13 -0
- package/dist/components/auth/organization/organization-switcher.d.ts +20 -0
- package/dist/components/auth/organization/organization-switcher.js +48 -0
- package/dist/components/auth/organization/organization-view-skeleton.d.ts +6 -0
- package/dist/components/auth/organization/organization-view-skeleton.js +9 -0
- package/dist/components/auth/organization/organization-view.d.ts +15 -0
- package/dist/components/auth/organization/organization-view.js +31 -0
- package/dist/components/auth/organization/organization.d.ts +17 -0
- package/dist/components/auth/organization/organization.js +60 -0
- package/dist/components/auth/organization/organizations-empty.d.ts +4 -0
- package/dist/components/auth/organization/organizations-empty.js +9 -0
- package/dist/components/auth/organization/organizations-settings.d.ts +17 -0
- package/dist/components/auth/organization/organizations-settings.js +17 -0
- package/dist/components/auth/organization/organizations.d.ts +10 -0
- package/dist/components/auth/organization/organizations.js +21 -0
- package/dist/components/auth/organization/remove-member-dialog.d.ts +9 -0
- package/dist/components/auth/organization/remove-member-dialog.js +20 -0
- package/dist/components/auth/organization/slug-field.d.ts +19 -0
- package/dist/components/auth/organization/slug-field.js +38 -0
- package/dist/components/auth/organization/user-invitation-row-skeleton.d.ts +4 -0
- package/dist/components/auth/organization/user-invitation-row-skeleton.js +8 -0
- package/dist/components/auth/organization/user-invitation-row.d.ts +10 -0
- package/dist/components/auth/organization/user-invitation-row.js +22 -0
- package/dist/components/auth/organization/user-invitations-empty.d.ts +4 -0
- package/dist/components/auth/organization/user-invitations-empty.js +12 -0
- package/dist/components/auth/organization/user-invitations.d.ts +10 -0
- package/dist/components/auth/organization/user-invitations.js +18 -0
- package/dist/components/auth/passkey/add-passkey-dialog.d.ts +5 -0
- package/dist/components/auth/passkey/add-passkey-dialog.js +22 -0
- package/dist/components/auth/passkey/delete-passkey-dialog.d.ts +11 -0
- package/dist/components/auth/passkey/delete-passkey-dialog.js +14 -0
- package/dist/components/auth/passkey/passkey-button.d.ts +1 -1
- package/dist/components/auth/passkey/passkey-button.js +24 -23
- package/dist/components/auth/passkey/passkey-skeleton.d.ts +1 -0
- package/dist/components/auth/passkey/passkey-skeleton.js +5 -0
- package/dist/components/auth/passkey/passkey.d.ts +2 -5
- package/dist/components/auth/passkey/passkey.js +16 -44
- package/dist/components/auth/passkey/passkeys-empty.d.ts +4 -0
- package/dist/components/auth/passkey/passkeys-empty.js +9 -0
- package/dist/components/auth/passkey/passkeys.d.ts +1 -1
- package/dist/components/auth/passkey/passkeys.js +15 -105
- package/dist/components/auth/provider-button.d.ts +2 -2
- package/dist/components/auth/provider-button.js +28 -24
- package/dist/components/auth/provider-buttons.js +28 -18
- package/dist/components/auth/reset-password.d.ts +1 -1
- package/dist/components/auth/reset-password.js +56 -146
- package/dist/components/auth/settings/account/account-settings.d.ts +2 -2
- package/dist/components/auth/settings/account/account-settings.js +21 -19
- package/dist/components/auth/settings/account/change-avatar.js +53 -88
- package/dist/components/auth/settings/account/change-email.d.ts +1 -1
- package/dist/components/auth/settings/account/change-email.js +27 -53
- package/dist/components/auth/settings/account/user-profile.d.ts +1 -1
- package/dist/components/auth/settings/account/user-profile.js +64 -85
- package/dist/components/auth/settings/security/active-session.d.ts +1 -1
- package/dist/components/auth/settings/security/active-session.js +50 -57
- package/dist/components/auth/settings/security/active-sessions.d.ts +1 -1
- package/dist/components/auth/settings/security/active-sessions.js +21 -32
- package/dist/components/auth/settings/security/change-password.d.ts +1 -1
- package/dist/components/auth/settings/security/change-password.js +76 -186
- package/dist/components/auth/settings/security/linked-account.d.ts +1 -1
- package/dist/components/auth/settings/security/linked-account.js +37 -55
- package/dist/components/auth/settings/security/linked-accounts.d.ts +1 -1
- package/dist/components/auth/settings/security/linked-accounts.js +34 -43
- package/dist/components/auth/settings/security/security-settings.d.ts +2 -2
- package/dist/components/auth/settings/security/security-settings.js +19 -21
- package/dist/components/auth/settings/settings.d.ts +4 -4
- package/dist/components/auth/settings/settings.js +52 -44
- package/dist/components/auth/sign-in.d.ts +2 -2
- package/dist/components/auth/sign-in.js +63 -132
- package/dist/components/auth/sign-out.js +32 -26
- package/dist/components/auth/sign-up.d.ts +2 -2
- package/dist/components/auth/sign-up.js +97 -211
- package/dist/components/auth/theme/appearance.d.ts +1 -1
- package/dist/components/auth/theme/appearance.js +23 -71
- package/dist/components/auth/theme/theme-toggle-item.js +56 -61
- package/dist/components/auth/user/user-avatar.d.ts +4 -4
- package/dist/components/auth/user/user-avatar.js +31 -28
- package/dist/components/auth/user/user-button.d.ts +6 -7
- package/dist/components/auth/user/user-button.js +38 -72
- package/dist/components/auth/user/user-view.d.ts +13 -7
- package/dist/components/auth/user/user-view.js +26 -36
- package/dist/components/auth/username/sign-in-username.d.ts +2 -2
- package/dist/components/auth/username/sign-in-username.js +87 -147
- package/dist/components/auth/username/username-field.d.ts +1 -1
- package/dist/components/auth/username/username-field.js +44 -52
- package/dist/email.d.ts +8 -7
- package/dist/email.js +8 -8
- package/dist/index.d.ts +21 -21
- package/dist/index.js +21 -22
- package/dist/lib/auth/api-key-plugin.d.ts +7 -4
- package/dist/lib/auth/api-key-plugin.js +12 -10
- package/dist/lib/auth/auth-plugin.d.ts +10 -6
- package/dist/lib/auth/auth-plugin.js +1 -0
- package/dist/lib/auth/delete-user-plugin.d.ts +6 -6
- package/dist/lib/auth/delete-user-plugin.js +6 -9
- package/dist/lib/auth/magic-link-plugin.d.ts +5 -5
- package/dist/lib/auth/magic-link-plugin.js +17 -12
- package/dist/lib/auth/multi-session-plugin.d.ts +5 -5
- package/dist/lib/auth/multi-session-plugin.js +8 -11
- package/dist/lib/auth/organization-plugin.d.ts +37 -0
- package/dist/lib/auth/organization-plugin.js +19 -0
- package/dist/lib/auth/passkey-plugin.d.ts +9 -6
- package/dist/lib/auth/passkey-plugin.js +8 -11
- package/dist/lib/auth/theme-plugin.d.ts +6 -6
- package/dist/lib/auth/theme-plugin.js +25 -22
- package/dist/lib/auth/username-plugin.d.ts +11 -11
- package/dist/lib/auth/username-plugin.js +18 -17
- package/dist/plugins.d.ts +46 -22
- package/dist/plugins.js +47 -22
- package/package.json +25 -19
- package/src/components/auth/api-key/api-key.tsx +25 -16
- package/src/components/auth/api-key/api-keys-empty.tsx +8 -4
- package/src/components/auth/api-key/api-keys.tsx +52 -14
- package/src/components/auth/api-key/create-api-key-dialog.tsx +17 -4
- package/src/components/auth/api-key/delete-api-key-dialog.tsx +10 -2
- package/src/components/auth/api-key/organization-api-keys.tsx +55 -0
- package/src/components/auth/delete-user/danger-zone.tsx +3 -3
- package/src/components/auth/delete-user/{delete-user.tsx → delete-account.tsx} +9 -9
- package/src/components/auth/email/organization-invitation-email.tsx +38 -0
- package/src/components/auth/error-toaster.tsx +28 -10
- package/src/components/auth/forgot-password.tsx +10 -2
- package/src/components/auth/multi-session/manage-accounts.tsx +1 -1
- package/src/components/auth/multi-session/switch-account-submenu-content.tsx +7 -2
- package/src/components/auth/multi-session/switch-account-submenu-item.tsx +4 -2
- package/src/components/auth/multi-session/switch-account-submenu.tsx +8 -4
- package/src/components/auth/organization/change-organization-logo.tsx +171 -0
- package/src/components/auth/organization/create-organization-dialog.tsx +133 -0
- package/src/components/auth/organization/delete-organization-dialog.tsx +97 -0
- package/src/components/auth/organization/delete-organization-skeleton.tsx +17 -0
- package/src/components/auth/organization/delete-organization.tsx +77 -0
- package/src/components/auth/organization/invite-member-dialog.tsx +177 -0
- package/src/components/auth/organization/leave-organization-dialog.tsx +95 -0
- package/src/components/auth/organization/leave-organization.tsx +59 -0
- package/src/components/auth/organization/organization-danger-zone.tsx +68 -0
- package/src/components/auth/organization/organization-invitation-row-skeleton.tsx +29 -0
- package/src/components/auth/organization/organization-invitation-row.tsx +97 -0
- package/src/components/auth/organization/organization-invitations-empty.tsx +39 -0
- package/src/components/auth/organization/organization-invitations.tsx +351 -0
- package/src/components/auth/organization/organization-logo.tsx +64 -0
- package/src/components/auth/organization/organization-member-row-skeleton.tsx +24 -0
- package/src/components/auth/organization/organization-member-row.tsx +157 -0
- package/src/components/auth/organization/organization-members.tsx +284 -0
- package/src/components/auth/organization/organization-people.tsx +26 -0
- package/src/components/auth/organization/organization-profile.tsx +141 -0
- package/src/components/auth/organization/organization-row.tsx +66 -0
- package/src/components/auth/organization/organization-settings.tsx +38 -0
- package/src/components/auth/organization/organization-switcher.tsx +233 -0
- package/src/components/auth/organization/organization-view-skeleton.tsx +36 -0
- package/src/components/auth/organization/organization-view.tsx +109 -0
- package/src/components/auth/organization/organization.tsx +162 -0
- package/src/components/auth/organization/organizations-empty.tsx +35 -0
- package/src/components/auth/organization/organizations-settings.tsx +36 -0
- package/src/components/auth/organization/organizations.tsx +80 -0
- package/src/components/auth/organization/remove-member-dialog.tsx +95 -0
- package/src/components/auth/organization/slug-field.tsx +111 -0
- package/src/components/auth/organization/user-invitation-row-skeleton.tsx +17 -0
- package/src/components/auth/organization/user-invitation-row.tsx +90 -0
- package/src/components/auth/organization/user-invitations-empty.tsx +30 -0
- package/src/components/auth/organization/user-invitations.tsx +59 -0
- package/src/components/auth/passkey/add-passkey-dialog.tsx +109 -0
- package/src/components/auth/passkey/delete-passkey-dialog.tsx +95 -0
- package/src/components/auth/passkey/passkey-skeleton.tsx +16 -0
- package/src/components/auth/passkey/passkey.tsx +23 -22
- package/src/components/auth/passkey/passkeys-empty.tsx +35 -0
- package/src/components/auth/passkey/passkeys.tsx +33 -154
- package/src/components/auth/settings/account/change-email.tsx +1 -1
- package/src/components/auth/settings/account/user-profile.tsx +5 -5
- package/src/components/auth/settings/security/active-sessions.tsx +6 -4
- package/src/components/auth/settings/security/linked-accounts.tsx +2 -2
- package/src/components/auth/settings/settings.tsx +77 -14
- package/src/components/auth/user/user-avatar.tsx +4 -1
- package/src/components/auth/user/user-button.tsx +14 -11
- package/src/components/auth/user/user-view.tsx +32 -12
- package/src/email.ts +1 -0
- package/src/lib/auth/api-key-plugin.ts +10 -4
- package/src/lib/auth/auth-plugin.ts +6 -1
- package/src/lib/auth/organization-plugin.tsx +32 -0
- package/src/plugins.ts +25 -1
- package/dist/components/auth/delete-user/delete-user.d.ts +0 -9
- package/dist/components/auth/delete-user/delete-user.js +0 -95
|
@@ -1,53 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useAuth
|
|
3
|
-
import { Check
|
|
4
|
-
import { FieldError
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
})
|
|
46
|
-
})]
|
|
47
|
-
}),
|
|
48
|
-
/* @__PURE__ */ f(o, {})
|
|
49
|
-
]
|
|
50
|
-
});
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useAuth, useAuthPlugin, useIsUsernameAvailable } from "@better-auth-ui/react";
|
|
3
|
+
import { Check, Xmark } from "@gravity-ui/icons";
|
|
4
|
+
import { FieldError, InputGroup, Label, Spinner, TextField } from "@heroui/react";
|
|
5
|
+
import { useDebouncer } from "@tanstack/react-pacer";
|
|
6
|
+
import { useState } from "react";
|
|
7
|
+
import { usernamePlugin } from "../../../lib/auth/username-plugin";
|
|
8
|
+
/**
|
|
9
|
+
* Renderer for the `username` additional field. Owns availability checking,
|
|
10
|
+
* length limits, and visual indicators. `FieldError` automatically surfaces
|
|
11
|
+
* native validation messages. Availability feedback is shown via the icon and
|
|
12
|
+
* aria-label without affecting the field's invalid state.
|
|
13
|
+
*/
|
|
14
|
+
export function UsernameField({ name, field, isPending, variant }) {
|
|
15
|
+
const { authClient } = useAuth();
|
|
16
|
+
const { localization, minUsernameLength, maxUsernameLength, isUsernameAvailable: checkAvailability } = useAuthPlugin(usernamePlugin);
|
|
17
|
+
const currentUsername = String(field.defaultValue ?? "");
|
|
18
|
+
const [value, setValue] = useState(currentUsername);
|
|
19
|
+
const { mutate: requestAvailability, data: availability, error: availabilityError, reset: resetAvailability } = useIsUsernameAvailable(authClient, {
|
|
20
|
+
// Bypass global error toast
|
|
21
|
+
onError: () => { }
|
|
22
|
+
});
|
|
23
|
+
const debouncer = useDebouncer((next) => {
|
|
24
|
+
const trimmed = next.trim();
|
|
25
|
+
// Skip blank input and the user's own current username (profile view).
|
|
26
|
+
if (!trimmed || trimmed === currentUsername) {
|
|
27
|
+
resetAvailability();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
requestAvailability({ username: trimmed });
|
|
31
|
+
}, { wait: 500 });
|
|
32
|
+
function handleChange(next) {
|
|
33
|
+
setValue(next);
|
|
34
|
+
resetAvailability();
|
|
35
|
+
if (checkAvailability) {
|
|
36
|
+
debouncer.maybeExecute(next);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const isCheckingAvailability = !!checkAvailability && !!value.trim() && value.trim() !== currentUsername;
|
|
40
|
+
return (_jsxs(TextField, { name: name, type: "text", autoComplete: "username", minLength: minUsernameLength, maxLength: maxUsernameLength, isDisabled: isPending, isReadOnly: field.readOnly, value: value, onChange: handleChange, children: [_jsx(Label, { children: field.label }), _jsxs(InputGroup, { variant: variant === "transparent" ? "primary" : "secondary", children: [_jsx(InputGroup.Input, { placeholder: field.placeholder, required: field.required }), isCheckingAvailability && (_jsx(InputGroup.Suffix, { "aria-label": availability?.available
|
|
41
|
+
? localization.usernameAvailable
|
|
42
|
+
: availability?.available === false
|
|
43
|
+
? localization.usernameTaken
|
|
44
|
+
: undefined, className: "px-2", children: availability?.available ? (_jsx(Check, { className: "text-success" })) : availabilityError || availability?.available === false ? (_jsx(Xmark, { className: "text-danger" })) : (_jsx(Spinner, { size: "sm", color: "current" })) }))] }), _jsx(FieldError, {})] }));
|
|
51
45
|
}
|
|
52
|
-
//#endregion
|
|
53
|
-
export { h as UsernameField };
|
package/dist/email.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
1
|
+
export * from "./components/auth/email/email-changed-email";
|
|
2
|
+
export * from "./components/auth/email/email-verification-email";
|
|
3
|
+
export * from "./components/auth/email/magic-link-email";
|
|
4
|
+
export * from "./components/auth/email/new-device-email";
|
|
5
|
+
export * from "./components/auth/email/organization-invitation-email";
|
|
6
|
+
export * from "./components/auth/email/otp-email";
|
|
7
|
+
export * from "./components/auth/email/password-changed-email";
|
|
8
|
+
export * from "./components/auth/email/reset-password-email";
|
package/dist/email.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
2
|
+
export * from "./components/auth/email/email-changed-email";
|
|
3
|
+
export * from "./components/auth/email/email-verification-email";
|
|
4
|
+
export * from "./components/auth/email/magic-link-email";
|
|
5
|
+
export * from "./components/auth/email/new-device-email";
|
|
6
|
+
export * from "./components/auth/email/organization-invitation-email";
|
|
7
|
+
export * from "./components/auth/email/otp-email";
|
|
8
|
+
export * from "./components/auth/email/password-changed-email";
|
|
9
|
+
export * from "./components/auth/email/reset-password-email";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
1
|
+
export * from "./components/auth/additional-field";
|
|
2
|
+
export * from "./components/auth/auth";
|
|
3
|
+
export * from "./components/auth/auth-provider";
|
|
4
|
+
export * from "./components/auth/forgot-password";
|
|
5
|
+
export * from "./components/auth/provider-button";
|
|
6
|
+
export * from "./components/auth/provider-buttons";
|
|
7
|
+
export * from "./components/auth/reset-password";
|
|
8
|
+
export * from "./components/auth/settings/account/account-settings";
|
|
9
|
+
export * from "./components/auth/settings/account/change-email";
|
|
10
|
+
export * from "./components/auth/settings/account/user-profile";
|
|
11
|
+
export * from "./components/auth/settings/security/active-sessions";
|
|
12
|
+
export * from "./components/auth/settings/security/change-password";
|
|
13
|
+
export * from "./components/auth/settings/security/linked-accounts";
|
|
14
|
+
export * from "./components/auth/settings/security/security-settings";
|
|
15
|
+
export * from "./components/auth/settings/settings";
|
|
16
|
+
export * from "./components/auth/sign-in";
|
|
17
|
+
export * from "./components/auth/sign-out";
|
|
18
|
+
export * from "./components/auth/sign-up";
|
|
19
|
+
export * from "./components/auth/user/user-avatar";
|
|
20
|
+
export * from "./components/auth/user/user-button";
|
|
21
|
+
export * from "./components/auth/user/user-view";
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export { p as AccountSettings, m as ActiveSessions, e as AdditionalField, c as Auth, l as AuthProvider, u as ChangeEmail, h as ChangePassword, t as ForgotPassword, g as LinkedAccounts, r as ProviderButton, i as ProviderButtons, n as ResetPassword, _ as SecuritySettings, v as Settings, a as SignIn, o as SignOut, s as SignUp, d as UserAvatar, b as UserButton, f as UserProfile, y as UserView };
|
|
2
|
+
export * from "./components/auth/additional-field";
|
|
3
|
+
export * from "./components/auth/auth";
|
|
4
|
+
export * from "./components/auth/auth-provider";
|
|
5
|
+
export * from "./components/auth/forgot-password";
|
|
6
|
+
export * from "./components/auth/provider-button";
|
|
7
|
+
export * from "./components/auth/provider-buttons";
|
|
8
|
+
export * from "./components/auth/reset-password";
|
|
9
|
+
export * from "./components/auth/settings/account/account-settings";
|
|
10
|
+
export * from "./components/auth/settings/account/change-email";
|
|
11
|
+
export * from "./components/auth/settings/account/user-profile";
|
|
12
|
+
export * from "./components/auth/settings/security/active-sessions";
|
|
13
|
+
export * from "./components/auth/settings/security/change-password";
|
|
14
|
+
export * from "./components/auth/settings/security/linked-accounts";
|
|
15
|
+
export * from "./components/auth/settings/security/security-settings";
|
|
16
|
+
export * from "./components/auth/settings/settings";
|
|
17
|
+
export * from "./components/auth/sign-in";
|
|
18
|
+
export * from "./components/auth/sign-out";
|
|
19
|
+
export * from "./components/auth/sign-up";
|
|
20
|
+
export * from "./components/auth/user/user-avatar";
|
|
21
|
+
export * from "./components/auth/user/user-button";
|
|
22
|
+
export * from "./components/auth/user/user-view";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { ApiKeyPluginOptions } from
|
|
2
|
-
import { ApiKeys } from
|
|
3
|
-
|
|
1
|
+
import { type ApiKeyPluginOptions } from "@better-auth-ui/core/plugins";
|
|
2
|
+
import { ApiKeys } from "../../components/auth/api-key/api-keys";
|
|
3
|
+
import { OrganizationApiKeys } from "../../components/auth/api-key/organization-api-keys";
|
|
4
|
+
export declare const apiKeyPlugin: ((options?: ApiKeyPluginOptions | undefined) => {
|
|
5
|
+
organizationCards?: (typeof OrganizationApiKeys)[] | undefined;
|
|
4
6
|
securityCards: (typeof ApiKeys)[];
|
|
5
7
|
localization: {
|
|
6
8
|
apiKey: string;
|
|
@@ -15,8 +17,9 @@ export declare const apiKeyPlugin: ((options?: ApiKeyPluginOptions | undefined)
|
|
|
15
17
|
deleteApiKeyWarning: string;
|
|
16
18
|
dismissNewKey: string;
|
|
17
19
|
};
|
|
20
|
+
organization: boolean;
|
|
18
21
|
id: "apiKey";
|
|
19
|
-
}
|
|
22
|
+
} & {
|
|
20
23
|
id: "apiKey";
|
|
21
24
|
}) & {
|
|
22
25
|
id: "apiKey";
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { createAuthPlugin } from "@better-auth-ui/core";
|
|
2
|
+
import { apiKeyPlugin as coreApiKeyPlugin } from "@better-auth-ui/core/plugins";
|
|
3
|
+
import { ApiKeys } from "../../components/auth/api-key/api-keys";
|
|
4
|
+
import { OrganizationApiKeys } from "../../components/auth/api-key/organization-api-keys";
|
|
5
|
+
export const apiKeyPlugin = createAuthPlugin(coreApiKeyPlugin.id, (options = {}) => {
|
|
6
|
+
const core = coreApiKeyPlugin(options);
|
|
7
|
+
return {
|
|
8
|
+
...core,
|
|
9
|
+
securityCards: [ApiKeys],
|
|
10
|
+
...(core.organization ? { organizationCards: [OrganizationApiKeys] } : {})
|
|
11
|
+
};
|
|
12
|
+
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AdditionalField as AdditionalFieldConfig } from
|
|
2
|
-
import { AccountCardProps, AuthPlugin as AuthPluginPrimitive, AuthPluginComponents as BaseAuthPluginComponents, SecurityCardProps, UserMenuItemProps } from
|
|
3
|
-
import { CardProps } from
|
|
4
|
-
import { ComponentType, ReactNode } from
|
|
5
|
-
import { SocialLayout } from
|
|
1
|
+
import type { AdditionalField as AdditionalFieldConfig } from "@better-auth-ui/core";
|
|
2
|
+
import type { AccountCardProps, AuthPlugin as AuthPluginPrimitive, AuthPluginComponents as BaseAuthPluginComponents, OrganizationCardProps, SecurityCardProps, UserMenuItemProps } from "@better-auth-ui/react";
|
|
3
|
+
import type { CardProps } from "@heroui/react";
|
|
4
|
+
import type { ComponentType, ReactNode } from "react";
|
|
5
|
+
import type { SocialLayout } from "../../components/auth/provider-buttons";
|
|
6
6
|
/** Props for the heroui `<AdditionalField>` component and `field.render` callbacks. */
|
|
7
7
|
export type AdditionalFieldProps = {
|
|
8
8
|
name: string;
|
|
@@ -21,7 +21,7 @@ declare module "@better-auth-ui/core" {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
/** Heroui slot component shapes — inherits from the framework-agnostic defaults and narrows slots that receive a heroui variant from the host. */
|
|
24
|
-
export type AuthPluginComponents = Omit<BaseAuthPluginComponents, "securityCards" | "accountCards"> & {
|
|
24
|
+
export type AuthPluginComponents = Omit<BaseAuthPluginComponents, "securityCards" | "accountCards" | "organizationCards"> & {
|
|
25
25
|
/** Rendered as cards inside security settings */
|
|
26
26
|
securityCards?: ComponentType<SecurityCardProps & {
|
|
27
27
|
variant?: CardProps["variant"];
|
|
@@ -30,6 +30,10 @@ export type AuthPluginComponents = Omit<BaseAuthPluginComponents, "securityCards
|
|
|
30
30
|
accountCards?: ComponentType<AccountCardProps & {
|
|
31
31
|
variant?: CardProps["variant"];
|
|
32
32
|
}>[];
|
|
33
|
+
/** Rendered as cards inside the active organization's settings */
|
|
34
|
+
organizationCards?: ComponentType<OrganizationCardProps & {
|
|
35
|
+
variant?: CardProps["variant"];
|
|
36
|
+
}>[];
|
|
33
37
|
/** Rendered as items inside the `UserButton` dropdown (e.g. account switcher). */
|
|
34
38
|
userMenuItems?: ComponentType<UserMenuItemProps>[];
|
|
35
39
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { DeleteUserPluginOptions } from
|
|
2
|
-
import { DangerZone } from
|
|
3
|
-
export declare const deleteUserPlugin: ((options?: DeleteUserPluginOptions | undefined) =>
|
|
1
|
+
import { type DeleteUserPluginOptions } from "@better-auth-ui/core/plugins";
|
|
2
|
+
import { DangerZone } from "../../components/auth/delete-user/danger-zone";
|
|
3
|
+
export declare const deleteUserPlugin: ((options?: DeleteUserPluginOptions | undefined) => {
|
|
4
4
|
securityCards: (typeof DangerZone)[];
|
|
5
5
|
localization: {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
deleteAccount: string;
|
|
7
|
+
deleteAccountDescription: string;
|
|
8
8
|
deleteUserVerificationSent: string;
|
|
9
9
|
deleteUserSuccess: string;
|
|
10
10
|
};
|
|
11
11
|
sendDeleteAccountVerification: boolean;
|
|
12
12
|
id: "deleteUser";
|
|
13
|
-
}
|
|
13
|
+
} & {
|
|
14
14
|
id: "deleteUser";
|
|
15
15
|
}) & {
|
|
16
16
|
id: "deleteUser";
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
securityCards: [e]
|
|
1
|
+
import { createAuthPlugin } from "@better-auth-ui/core";
|
|
2
|
+
import { deleteUserPlugin as coreDeleteUserPlugin } from "@better-auth-ui/core/plugins";
|
|
3
|
+
import { DangerZone } from "../../components/auth/delete-user/danger-zone";
|
|
4
|
+
export const deleteUserPlugin = createAuthPlugin(coreDeleteUserPlugin.id, (options = {}) => ({
|
|
5
|
+
...coreDeleteUserPlugin(options),
|
|
6
|
+
securityCards: [DangerZone]
|
|
8
7
|
}));
|
|
9
|
-
//#endregion
|
|
10
|
-
export { r as deleteUserPlugin };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MagicLinkPluginOptions } from
|
|
2
|
-
import { MagicLink } from
|
|
3
|
-
import { MagicLinkButton } from
|
|
4
|
-
export declare const magicLinkPlugin: ((options?: MagicLinkPluginOptions | undefined) =>
|
|
1
|
+
import { type MagicLinkPluginOptions } from "@better-auth-ui/core/plugins";
|
|
2
|
+
import { MagicLink } from "../../components/auth/magic-link/magic-link";
|
|
3
|
+
import { MagicLinkButton } from "../../components/auth/magic-link/magic-link-button";
|
|
4
|
+
export declare const magicLinkPlugin: ((options?: MagicLinkPluginOptions | undefined) => {
|
|
5
5
|
authButtons: (typeof MagicLinkButton)[];
|
|
6
6
|
views: {
|
|
7
7
|
auth: {
|
|
@@ -24,7 +24,7 @@ export declare const magicLinkPlugin: ((options?: MagicLinkPluginOptions | undef
|
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
id: "magicLink";
|
|
27
|
-
}
|
|
27
|
+
} & {
|
|
28
28
|
id: "magicLink";
|
|
29
29
|
}) & {
|
|
30
30
|
id: "magicLink";
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { createAuthPlugin } from "@better-auth-ui/core";
|
|
2
|
+
import { magicLinkPlugin as coreMagicLinkPlugin } from "@better-auth-ui/core/plugins";
|
|
3
|
+
import { MagicLink } from "../../components/auth/magic-link/magic-link";
|
|
4
|
+
import { MagicLinkButton } from "../../components/auth/magic-link/magic-link-button";
|
|
5
|
+
export const magicLinkPlugin = createAuthPlugin(coreMagicLinkPlugin.id, (options = {}) => ({
|
|
6
|
+
...coreMagicLinkPlugin(options),
|
|
7
|
+
authButtons: [MagicLinkButton],
|
|
8
|
+
views: {
|
|
9
|
+
auth: { magicLink: MagicLink }
|
|
10
|
+
},
|
|
11
|
+
// Conditional, not an override: when `emailAndPassword.enabled === false`
|
|
12
|
+
// the `<Auth>` router renders this at `/auth/sign-in` instead of the
|
|
13
|
+
// disabled password form. With password auth on, the built-in `SignIn`
|
|
14
|
+
// still wins.
|
|
15
|
+
fallbackViews: {
|
|
16
|
+
auth: { signIn: MagicLink }
|
|
17
|
+
}
|
|
11
18
|
}));
|
|
12
|
-
//#endregion
|
|
13
|
-
export { i as magicLinkPlugin };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MultiSessionPluginOptions } from
|
|
2
|
-
import { ManageAccounts } from
|
|
3
|
-
import { SwitchAccountSubmenu } from
|
|
4
|
-
export declare const multiSessionPlugin: ((options?: MultiSessionPluginOptions | undefined) =>
|
|
1
|
+
import { type MultiSessionPluginOptions } from "@better-auth-ui/core/plugins";
|
|
2
|
+
import { ManageAccounts } from "../../components/auth/multi-session/manage-accounts";
|
|
3
|
+
import { SwitchAccountSubmenu } from "../../components/auth/multi-session/switch-account-submenu";
|
|
4
|
+
export declare const multiSessionPlugin: ((options?: MultiSessionPluginOptions | undefined) => {
|
|
5
5
|
accountCards: (typeof ManageAccounts)[];
|
|
6
6
|
userMenuItems: (typeof SwitchAccountSubmenu)[];
|
|
7
7
|
localization: {
|
|
@@ -11,7 +11,7 @@ export declare const multiSessionPlugin: ((options?: MultiSessionPluginOptions |
|
|
|
11
11
|
manageAccountsDescription: string;
|
|
12
12
|
};
|
|
13
13
|
id: "multiSession";
|
|
14
|
-
}
|
|
14
|
+
} & {
|
|
15
15
|
id: "multiSession";
|
|
16
16
|
}) & {
|
|
17
17
|
id: "multiSession";
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
userMenuItems: [t]
|
|
1
|
+
import { createAuthPlugin } from "@better-auth-ui/core";
|
|
2
|
+
import { multiSessionPlugin as coreMultiSessionPlugin } from "@better-auth-ui/core/plugins";
|
|
3
|
+
import { ManageAccounts } from "../../components/auth/multi-session/manage-accounts";
|
|
4
|
+
import { SwitchAccountSubmenu } from "../../components/auth/multi-session/switch-account-submenu";
|
|
5
|
+
export const multiSessionPlugin = createAuthPlugin(coreMultiSessionPlugin.id, (options = {}) => ({
|
|
6
|
+
...coreMultiSessionPlugin(options),
|
|
7
|
+
accountCards: [ManageAccounts],
|
|
8
|
+
userMenuItems: [SwitchAccountSubmenu]
|
|
10
9
|
}));
|
|
11
|
-
//#endregion
|
|
12
|
-
export { i as multiSessionPlugin };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type OrganizationLocalization, type OrganizationPluginOptions } from "@better-auth-ui/core/plugins";
|
|
2
|
+
import { OrganizationsSettings } from "../../components/auth/organization/organizations-settings";
|
|
3
|
+
export declare const organizationPlugin: ((options?: OrganizationPluginOptions | undefined) => {
|
|
4
|
+
localization: OrganizationLocalization;
|
|
5
|
+
settingsTabs: {
|
|
6
|
+
view: "organizations";
|
|
7
|
+
label: import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
component: typeof OrganizationsSettings;
|
|
9
|
+
}[];
|
|
10
|
+
slug: string | null | undefined;
|
|
11
|
+
checkSlug: boolean;
|
|
12
|
+
logo: {
|
|
13
|
+
delete?: (url: string) => Promise<void>;
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
extension: "png" | "jpg" | "webp" | "inherit";
|
|
16
|
+
resize: (file: File, size?: number, extension?: "png" | "jpg" | "webp" | "inherit") => Promise<File>;
|
|
17
|
+
size: number;
|
|
18
|
+
upload?: (file: File) => Promise<string>;
|
|
19
|
+
};
|
|
20
|
+
roles: {
|
|
21
|
+
[x: string]: string;
|
|
22
|
+
};
|
|
23
|
+
viewPaths: {
|
|
24
|
+
settings: {
|
|
25
|
+
organizations: string;
|
|
26
|
+
};
|
|
27
|
+
organization: {
|
|
28
|
+
settings: string;
|
|
29
|
+
people: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
id: "organization";
|
|
33
|
+
} & {
|
|
34
|
+
id: "organization";
|
|
35
|
+
}) & {
|
|
36
|
+
id: "organization";
|
|
37
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createAuthPlugin } from "@better-auth-ui/core";
|
|
3
|
+
import { organizationPlugin as coreOrganizationPlugin } from "@better-auth-ui/core/plugins";
|
|
4
|
+
import { Briefcase } from "@gravity-ui/icons";
|
|
5
|
+
import { OrganizationsSettings } from "../../components/auth/organization/organizations-settings";
|
|
6
|
+
export const organizationPlugin = createAuthPlugin(coreOrganizationPlugin.id, (options = {}) => {
|
|
7
|
+
const coreOptions = coreOrganizationPlugin(options);
|
|
8
|
+
return {
|
|
9
|
+
...coreOptions,
|
|
10
|
+
localization: coreOptions.localization,
|
|
11
|
+
settingsTabs: [
|
|
12
|
+
{
|
|
13
|
+
view: "organizations",
|
|
14
|
+
label: (_jsxs(_Fragment, { children: [_jsx(Briefcase, { className: "text-muted" }), coreOptions.localization.organizations] })),
|
|
15
|
+
component: OrganizationsSettings
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
};
|
|
19
|
+
});
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import { PasskeyPluginOptions } from
|
|
2
|
-
import { PasskeyButton } from
|
|
3
|
-
import { Passkeys } from
|
|
4
|
-
export declare const passkeyPlugin: ((options?: PasskeyPluginOptions | undefined) =>
|
|
1
|
+
import { type PasskeyPluginOptions } from "@better-auth-ui/core/plugins";
|
|
2
|
+
import { PasskeyButton } from "../../components/auth/passkey/passkey-button";
|
|
3
|
+
import { Passkeys } from "../../components/auth/passkey/passkeys";
|
|
4
|
+
export declare const passkeyPlugin: ((options?: PasskeyPluginOptions | undefined) => {
|
|
5
5
|
authButtons: (typeof PasskeyButton)[];
|
|
6
6
|
securityCards: (typeof Passkeys)[];
|
|
7
7
|
localization: {
|
|
8
8
|
passkey: string;
|
|
9
9
|
addPasskey: string;
|
|
10
10
|
deletePasskey: string;
|
|
11
|
+
deletePasskeyTitle: string;
|
|
12
|
+
deletePasskeyWarning: string;
|
|
11
13
|
passkeys: string;
|
|
12
14
|
passkeysDescription: string;
|
|
13
|
-
|
|
15
|
+
noPasskeys: string;
|
|
16
|
+
name: string;
|
|
14
17
|
};
|
|
15
18
|
id: "passkey";
|
|
16
|
-
}
|
|
19
|
+
} & {
|
|
17
20
|
id: "passkey";
|
|
18
21
|
}) & {
|
|
19
22
|
id: "passkey";
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
securityCards: [t]
|
|
1
|
+
import { createAuthPlugin } from "@better-auth-ui/core";
|
|
2
|
+
import { passkeyPlugin as corePasskeyPlugin } from "@better-auth-ui/core/plugins";
|
|
3
|
+
import { PasskeyButton } from "../../components/auth/passkey/passkey-button";
|
|
4
|
+
import { Passkeys } from "../../components/auth/passkey/passkeys";
|
|
5
|
+
export const passkeyPlugin = createAuthPlugin(corePasskeyPlugin.id, (options = {}) => ({
|
|
6
|
+
...corePasskeyPlugin(options),
|
|
7
|
+
authButtons: [PasskeyButton],
|
|
8
|
+
securityCards: [Passkeys]
|
|
10
9
|
}));
|
|
11
|
-
//#endregion
|
|
12
|
-
export { i as passkeyPlugin };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ThemeLocalization } from
|
|
2
|
-
import { Appearance } from
|
|
3
|
-
import { ThemeToggleItem } from
|
|
1
|
+
import { type ThemeLocalization } from "@better-auth-ui/core/plugins";
|
|
2
|
+
import { Appearance } from "../../components/auth/theme/appearance";
|
|
3
|
+
import { ThemeToggleItem } from "../../components/auth/theme/theme-toggle-item";
|
|
4
4
|
/**
|
|
5
5
|
* Hook shape compatible with `next-themes`' `useTheme` and similar APIs. The
|
|
6
6
|
* hook is invoked inside the plugin factory so consumers can register the
|
|
@@ -45,7 +45,7 @@ export type ThemePluginOptions = CommonThemeOptions & ({
|
|
|
45
45
|
setTheme: (theme: string) => void;
|
|
46
46
|
useTheme?: never;
|
|
47
47
|
});
|
|
48
|
-
export declare const themePlugin: ((args_0: ThemePluginOptions) =>
|
|
48
|
+
export declare const themePlugin: ((args_0: ThemePluginOptions) => {
|
|
49
49
|
useTheme: UseThemeHook;
|
|
50
50
|
userMenuItems: (typeof ThemeToggleItem)[];
|
|
51
51
|
accountCards: (typeof Appearance)[];
|
|
@@ -57,10 +57,10 @@ export declare const themePlugin: ((args_0: ThemePluginOptions) => Omit<{
|
|
|
57
57
|
dark: string;
|
|
58
58
|
};
|
|
59
59
|
theme: string;
|
|
60
|
-
themes: string[];
|
|
61
60
|
setTheme: (theme: string) => void;
|
|
61
|
+
themes: string[];
|
|
62
62
|
id: "theme";
|
|
63
|
-
}
|
|
63
|
+
} & {
|
|
64
64
|
id: "theme";
|
|
65
65
|
}) & {
|
|
66
66
|
id: "theme";
|