aau-auth-kit-ui
Version:
Plug & play shadcn/ui components for aau-auth-kit with Next.js integration
1,368 lines (1,315 loc) • 291 kB
TypeScript
import * as react_jsx_runtime from 'react/jsx-runtime';
import * as React$1 from 'react';
import { ReactNode, ComponentProps, ComponentType } from 'react';
import * as zod from 'zod';
import { z } from 'zod';
import * as AvatarPrimitive from '@radix-ui/react-avatar';
import * as aau_auth_kit from 'aau-auth-kit';
import { Session as Session$1, User as User$1, SocialProvider } from 'aau-auth-kit';
import * as nanostores from 'nanostores';
import * as _better_fetch_fetch from '@better-fetch/fetch';
import { G } from './init-D_J0VONd.js';
type AdminPageClassNames = {
base?: string;
card?: string;
header?: string;
title?: string;
searchContainer?: string;
searchInput?: string;
table?: string;
tableHeader?: string;
tableRow?: string;
tableCell?: string;
statusBadge?: string;
actionButton?: string;
pagination?: string;
dialog?: {
content?: string;
header?: string;
footer?: string;
};
};
interface AdminPageProps {
className?: string;
classNames?: AdminPageClassNames;
title?: string;
pageSize?: number;
}
declare function AdminPage({ className, classNames, pageSize, }: AdminPageProps): react_jsx_runtime.JSX.Element;
declare const authLocalization: {
/** @default "Account" */
account: string;
/** @default "Accounts" */
accounts: string;
/** @default "Manage your currently signed in accounts." */
accountsDescription: string;
/** @default "Sign in to an additional account." */
accountsInstructions: string;
/** @default "Add Account" */
addAccount: string;
/** @default "Add Passkey" */
addPasskey: string;
/** @default "Already have an account?" */
alreadyHaveAnAccount: string;
/** @default "Avatar" */
avatar: string;
/** @default "Click on the avatar to upload a custom one from your files." */
avatarDescription: string;
/** @default "An avatar is optional but strongly recommended." */
avatarInstructions: string;
/** @default "Backup code is required" */
backupCodeRequired: string;
/** @default "Backup Codes" */
backupCodes: string;
/** @default "Save these backup codes in a secure place. You can use them to access your account if you lose your two-factor authentication method." */
backupCodesDescription: string;
/** @default "Enter one of your backup codes. Once used, each code can only be used once and will be invalidated after use." */
backupCodePlaceholder: string;
/** @default "Backup Code" */
backupCode: string;
/** @default "Recover account" */
backupCodeAction: string;
/** @default "Cancel" */
cancel: string;
/** @default "Change Password" */
changePassword: string;
/** @default "Enter your current password and a new password." */
changePasswordDescription: string;
/** @default "Please use 8 characters at minimum." */
changePasswordInstructions: string;
/** @default "Your password has been changed." */
changePasswordSuccess: string;
/** @default "Confirm Password" */
confirmPassword: string;
/** @default "Confirm Password" */
confirmPasswordPlaceholder: string;
/** @default "Confirm password is required" */
confirmPasswordRequired: string;
/** @default "Continue with Authenticator" */
continueWithAuthenticator: string;
/** @default "Copied to clipboard" */
copiedToClipboard: string;
/** @default "Copy all codes" */
copyAllCodes: string;
/** @default "Continue" */
continue: string;
/** @default "Current Password" */
currentPassword: string;
/** @default "Current Password" */
currentPasswordPlaceholder: string;
/** @default "Current Session" */
currentSession: string;
/** @default "Delete" */
delete: string;
/** @default "Delete Account" */
deleteAccount: string;
/** @default "Permanently remove your account and all of its contents. This action is not reversible, so please continue with caution." */
deleteAccountDescription: string;
/** @default "Please confirm the deletion of your account. This action is not reversible, so please continue with caution." */
deleteAccountInstructions: string;
/** @default "Please check your email to verify the deletion of your account." */
deleteAccountVerify: string;
/** @default "Your account has been deleted." */
deleteAccountSuccess: string;
/** @default "You must be recently logged in to delete your account." */
deleteAccountNotFresh: string;
/** @default "Disable" */
disable: string;
/** @default "Choose a provider to login to your account" */
disabledCredentialsDescription: string;
/** @default "Don't have an account?" */
dontHaveAnAccount: string;
/** @default "Email" */
email: string;
/** @default "Enter the email address you want to use to log in." */
emailDescription: string;
/** @default "Please enter a valid email address." */
emailInstructions: string;
/** @default "Email address is invalid" */
emailInvalid: string;
/** @default "Phone" */
phone: string;
/** @default "Phone Number" */
phoneNumber: string;
/** @default "Enter your phone number" */
phonePlaceholder: string;
/** @default "Please enter a valid phone number" */
phoneInvalid: string;
/** @default "We'll send you a verification code" */
phoneDescription: string;
/** @default "Verification code sent successfully" */
otpSent: string;
/** @default "Phone number verified successfully" */
phoneVerified: string;
/** @default "Verify" */
verifyPhoneNumber: string;
/** @default "Enter the verification code sent to" */
enterVerificationCode: string;
/** @default "Verification Code" */
verificationCode: string;
/** @default "Resend Code" */
resendCode: string;
/** @default "One Time Password" */
oneTimePassword: string;
/** @default "Email is the same" */
emailIsTheSame: string;
/** @default "m@example.com" */
emailPlaceholder: string;
/** @default "Email address is required" */
emailRequired: string;
/** @default "Please check your email to verify the change." */
emailVerifyChange: string;
/** @default "Please check your email for the verification link." */
emailVerification: string;
/** @default "Enable" */
enable: string;
/** @default "Error" */
error: string;
/** @default "is invalid" */
isInvalid: string;
/** @default "is required" */
isRequired: string;
/** @default "is the same" */
isTheSame: string;
/** @default "Forgot authenticator?" */
forgotAuthenticator: string;
/** @default "Forgot Password" */
forgotPassword: string;
/** @default "Send reset link" */
forgotPasswordAction: string;
/** @default "Enter your email to reset your password" */
forgotPasswordDescription: string;
/** @default "Check your email for the password reset link." */
forgotPasswordEmail: string;
/** @default "Forgot your password?" */
forgotPasswordLink: string;
/** @default "Invalid two factor cookie" */
invalidTwoFactorCookie: string;
/** @default "Link" */
link: string;
/** @default "Magic Link" */
magicLink: string;
/** @default "Send magic link" */
magicLinkAction: string;
/** @default "Enter your email to receive a magic link" */
magicLinkDescription: string;
/** @default "Check your email for the magic link" */
magicLinkEmail: string;
/** @default "Email Code" */
emailOTP: string;
/** @default "Send code" */
emailOTPSendAction: string;
/** @default "Verify code" */
emailOTPVerifyAction: string;
/** @default "Enter your email to receive a code" */
emailOTPDescription: string;
/** @default "Please check your email for the verification code." */
emailOTPVerificationSent: string;
/** @default "Name" */
name: string;
/** @default "Please enter your full name, or a display name." */
nameDescription: string;
/** @default "Please use 32 characters at maximum." */
nameInstructions: string;
/** @default "Name" */
namePlaceholder: string;
/** @default "New Password" */
newPassword: string;
/** @default "New Password" */
newPasswordPlaceholder: string;
/** @default "New password is required" */
newPasswordRequired: string;
/** @default "Or continue with" */
orContinueWith: string;
/** @default "Passkey" */
passkey: string;
/** @default "Passkeys" */
passkeys: string;
/** @default "Manage your passkeys for secure access." */
passkeysDescription: string;
/** @default "Securely access your account without a password." */
passkeysInstructions: string;
/** @default "Password" */
password: string;
/** @default "Password" */
passwordPlaceholder: string;
/** @default "Password is required" */
passwordRequired: string;
/** @default "Passwords do not match" */
passwordsDoNotMatch: string;
/** @default "Providers" */
providers: string;
/** @default "Connect your account with a third-party service." */
providersDescription: string;
/** @default "Recover Account" */
recoverAccount: string;
/** @default "Recover account" */
recoverAccountAction: string;
/** @default "Please enter a backup code to access your account" */
recoverAccountDescription: string;
/** @default "Remember me" */
rememberMe: string;
/** @default "Resend verification email" */
resendVerificationEmail: string;
/** @default "Reset Password" */
resetPassword: string;
/** @default "Save new password" */
resetPasswordAction: string;
/** @default "Enter your new password below" */
resetPasswordDescription: string;
/** @default "Invalid reset password link" */
resetPasswordInvalidToken: string;
/** @default "Password reset successfully" */
resetPasswordSuccess: string;
/** @default "Request failed" */
requestFailed: string;
/** @default "Revoke" */
revoke: string;
/** @default "Sign In" */
signIn: string;
/** @default "Sign In" */
signInPhone: string;
/** @default "Login" */
signInAction: string;
/** @default "Enter your email below to login to your account" */
signInDescription: string;
/** @default "Enter your username or email below to login to your account" */
signInUsernameDescription: string;
/** @default "Sign in with" */
signInWith: string;
/** @default "Sign Out" */
signOut: string;
/** @default "Sign Up" */
signUp: string;
/** @default "Create an account" */
signUpAction: string;
/** @default "Enter your information to create an account" */
signUpDescription: string;
/** @default "Check your email for the verification link." */
signUpEmail: string;
/** @default "Sessions" */
sessions: string;
/** @default "Manage your active sessions and revoke access." */
sessionsDescription: string;
/** @default "Set Password" */
setPassword: string;
/** @default "Click the button below to receive an email to set up a password for your account." */
setPasswordDescription: string;
/** @default "Settings" */
settings: string;
/** @default "Save" */
save: string;
/** @default "Security" */
security: string;
/** @default "Switch Account" */
switchAccount: string;
/** @default "Trust this device" */
trustDevice: string;
/** @default "Two-Factor" */
twoFactor: string;
/** @default "Verify code" */
twoFactorAction: string;
/** @default "Please enter your one-time password to continue" */
twoFactorDescription: string;
/** @default "Add an extra layer of security to your account." */
twoFactorCardDescription: string;
/** @default "Please enter your password to disable 2FA." */
twoFactorDisableInstructions: string;
/** @default "Please enter your password to enable 2FA" */
twoFactorEnableInstructions: string;
/** @default "Two-factor authentication has been enabled" */
twoFactorEnabled: string;
/** @default "Two-Factor Authentication has been disabled" */
twoFactorDisabled: string;
/** @default "Two-Factor Authentication" */
twoFactorPrompt: string;
/** @default "Scan the QR Code with your Authenticator" */
twoFactorTotpLabel: string;
/** @default "Send verification code" */
sendVerificationCode: string;
/** @default "Unlink" */
unlink: string;
/** @default "Updated successfully" */
updatedSuccessfully: string;
/** @default "Username" */
username: string;
/** @default "Enter the username you want to use to log in." */
usernameDescription: string;
/** @default "Please use 32 characters at maximum." */
usernameInstructions: string;
/** @default "Username" */
usernamePlaceholder: string;
/** @default "Username or email" */
signInUsernamePlaceholder: string;
/** @default "Verify Your Email" */
verifyYourEmail: string;
/** @default "Please verify your email address. Check your inbox for the verification email. If you haven't received the email, click the button below to resend." */
verifyYourEmailDescription: string;
/** @default "Go back" */
goBack: string;
/** @default "Invalid password" */
invalidPassword: string;
/** @default "Password too short" */
passwordTooShort: string;
/** @default "Admin" */
admin: string;
/** @default "Users" */
users: string;
/** @default "Create User" */
createUser: string;
/** @default "Creating..." */
creatingUser: string;
/** @default "User created successfully" */
userCreatedSuccess: string;
/** @default "Failed to create user" */
userCreatedError: string;
/** @default "Name is required for admin user" */
adminNameRequired: string;
/** @default "Email is required for admin user" */
adminEmailRequired: string;
/** @default "Invalid email address for admin user" */
adminEmailInvalid: string;
/** @default "Password must be at least 8 characters" */
passwordMinLength: string;
/** @default "Role is required" */
adminRoleRequired: string;
/** @default "User banned successfully" */
userBannedSuccess: string;
/** @default "Failed to ban user" */
userBannedError: string;
/** @default "User unbanned successfully" */
userUnbannedSuccess: string;
/** @default "Failed to unban user" */
userUnbannedError: string;
/** @default "User removed successfully" */
userRemovedSuccess: string;
/** @default "Failed to remove user" */
userRemovedError: string;
/** @default "Failed to fetch users" */
fetchUsersError: string;
};
type AuthLocalization = Partial<typeof authLocalization>;
declare const authViewPaths: {
readonly callback: "callback";
readonly forgotPassword: "forgot-password";
readonly resetPassword: "reset-password";
readonly settings: "settings";
readonly signIn: "sign-in";
readonly signOut: "sign-out";
readonly signUp: "sign-up";
readonly twoFactor: "two-factor";
readonly signInPhone: "sign-in-phone";
readonly sendOtp: "send-otp";
};
type AuthViewPaths = typeof authViewPaths;
type AuthView = keyof AuthViewPaths;
type AuthFormClassNames = {
base?: string;
button?: string;
checkbox?: string;
description?: string;
error?: string;
forgotPasswordLink?: string;
icon?: string;
input?: string;
label?: string;
outlineButton?: string;
primaryButton?: string;
providerButton?: string;
qrCode?: string;
secondaryButton?: string;
otpInput?: string;
otpInputContainer?: string;
};
interface AuthFormProps {
className?: string;
classNames?: AuthFormClassNames;
isSubmitting?: boolean;
localization?: Partial<AuthLocalization>;
pathname?: string;
redirectTo?: string;
view?: AuthView;
otpSeparators?: 0 | 1 | 2;
setIsSubmitting?: (isSubmitting: boolean) => void;
}
declare function AuthForm({ className, classNames, isSubmitting, localization, pathname, redirectTo, view, otpSeparators, setIsSubmitting, }: AuthFormProps): false | react_jsx_runtime.JSX.Element | undefined;
interface CreateUserDialogProps {
open: boolean;
onOpenChange: (open: boolean) => void;
onUserCreated: () => void;
classNames?: AuthFormClassNames;
}
declare function CreateUserDialog({ open, onOpenChange, onUserCreated, classNames }: CreateUserDialogProps): react_jsx_runtime.JSX.Element;
type UserAction = "ban" | "unban" | "remove" | "setRole" | "revokeSessions";
interface UserActionMenuProps {
userId: string;
status: "active" | "banned";
role: string | string[];
disabled: boolean;
onUserAction: (action: UserAction, userId: string, data?: unknown) => Promise<{
success: boolean;
}>;
}
declare function UserActionMenu({ userId, status, role, disabled, onUserAction, }: UserActionMenuProps): react_jsx_runtime.JSX.Element;
declare function SignedInAdmin({ children }: {
children: ReactNode;
}): ReactNode;
declare function RedirectNotAdminToSignIn(): ReactNode;
type OrganizationSwitcherClassNames = {
base?: string;
trigger?: string;
popover?: string;
command?: string;
commandInput?: string;
commandEmpty?: string;
commandList?: string;
commandItem?: string;
commandSeparator?: string;
createButton?: string;
avatar?: string;
avatarFallback?: string;
organizationName?: string;
organizationRole?: string;
};
interface OrganizationSwitcherProps {
className?: string;
classNames?: OrganizationSwitcherClassNames;
activeFirstOrg?: boolean;
editOrganizationUrl?: string;
logoSize?: number;
logoExtension?: string;
}
declare function OrganizationSwitcher({ className, classNames, activeFirstOrg, editOrganizationUrl, logoSize, logoExtension, }: OrganizationSwitcherProps): react_jsx_runtime.JSX.Element;
declare function RedirectNoOrgToCreate(): ReactNode;
type OrganizationProfileCardClassNames = {
base?: string;
header?: string;
title?: string;
description?: string;
separator?: string;
section?: string;
sectionLabel?: string;
sectionContent?: string;
profileSection?: string;
profileContent?: string;
avatar?: string;
avatarFallback?: string;
organizationName?: string;
editButton?: string;
leaveSection?: string;
leaveButton?: string;
skeleton?: string;
};
interface OrganizationProfileCardProps {
className?: string;
classNames?: OrganizationProfileCardClassNames;
showUpdateOrg?: (() => boolean) | boolean;
logoSize?: number;
logoExtension?: string;
}
declare function OrganizationProfileCard({ className, classNames, logoSize, logoExtension, showUpdateOrg, }: OrganizationProfileCardProps): react_jsx_runtime.JSX.Element;
type Organization$1 = {
id: string;
createdAt: Date;
name: string;
slug: string;
logo?: string | null | undefined;
};
declare const organizationSchema$1: zod.ZodObject<{
name: zod.ZodString;
slug: zod.ZodString;
logo: zod.ZodOptional<zod.ZodAny>;
}, "strip", zod.ZodTypeAny, {
name: string;
slug: string;
logo?: any;
}, {
name: string;
slug: string;
logo?: any;
}>;
type OrganizationData = zod.infer<typeof organizationSchema$1>;
type OrganizationCreatorClassNames = {
base?: string;
form?: string;
formGroup?: string;
label?: string;
input?: string;
fileInput?: string;
fileInputButton?: string;
fileInputText?: string;
footer?: string;
submitButton?: string;
avatar?: string;
avatarFallback?: string;
logoContainer?: string;
logoInstructions?: string;
errorMessage?: string;
};
interface OrganizationCreatorProps {
className?: string;
classNames?: OrganizationCreatorClassNames;
logoSize?: number;
logoExtension?: string;
onSuccess?: () => void;
organization?: Organization$1;
mode?: "create" | "update";
}
declare function OrganizationCreator({ className, classNames, logoSize, logoExtension, onSuccess, organization, mode, }: OrganizationCreatorProps): react_jsx_runtime.JSX.Element;
type OrganizationPageClassNames = {
base?: string;
card?: string;
header?: string;
title?: string;
searchContainer?: string;
searchInput?: string;
table?: string;
tableHeader?: string;
tableRow?: string;
tableCell?: string;
statusBadge?: string;
actionButton?: string;
pagination?: string;
dialog?: {
content?: string;
header?: string;
footer?: string;
};
};
interface OrganizationPageProps {
className?: string;
classNames?: OrganizationPageClassNames;
title?: string;
pageSize?: number;
}
declare function OrganizationMember({ className, classNames, pageSize, }: OrganizationPageProps): react_jsx_runtime.JSX.Element;
type InvitationCardClassNames = {
base?: string;
card?: string;
header?: string;
title?: string;
searchContainer?: string;
searchInput?: string;
table?: string;
tableHeader?: string;
tableRow?: string;
tableCell?: string;
statusBadge?: string;
actionButton?: string;
pagination?: string;
dialog?: {
content?: string;
header?: string;
footer?: string;
};
};
interface InvitationPageProps {
className?: string;
classNames?: InvitationCardClassNames;
title?: string;
pageSize?: number;
}
declare function OrganizationInvitation({ className, classNames, pageSize, }: InvitationPageProps): react_jsx_runtime.JSX.Element;
declare function AuthCallback({ redirectTo }: {
redirectTo?: string;
}): react_jsx_runtime.JSX.Element;
type Profile = {
id?: string | number;
email?: string | null;
name?: string | null;
firstName?: string | null;
fullName?: string | null;
isAnonymous?: boolean | null;
emailVerified?: boolean | null;
image?: string | null;
avatar?: string | null;
avatarUrl?: string | null;
};
declare function Avatar({ className, ...props }: React$1.ComponentProps<typeof AvatarPrimitive.Root>): react_jsx_runtime.JSX.Element;
interface UserAvatarClassNames$1 {
base?: string;
image?: string;
fallback?: string;
fallbackIcon?: string;
skeleton?: string;
}
interface UserAvatarProps {
user?: Profile;
classNames?: UserAvatarClassNames$1;
isPending?: boolean;
}
/**
* Displays a user avatar with image and fallback support
*
* Renders a user's avatar image when available, with appropriate fallbacks:
* - Shows a skeleton when isPending is true
* - Displays first two characters of user's name when no image is available
* - Falls back to a generic user icon when neither image nor name is available
*/
declare function UserAvatar({ user, classNames, className, isPending, ...props }: UserAvatarProps & ComponentProps<typeof Avatar>): react_jsx_runtime.JSX.Element;
type SettingsCardClassNames = {
base?: string;
avatar?: UserAvatarClassNames$1;
button?: string;
cell?: string;
checkbox?: string;
destructiveButton?: string;
content?: string;
description?: string;
dialog?: {
content?: string;
footer?: string;
header?: string;
};
error?: string;
footer?: string;
header?: string;
icon?: string;
input?: string;
instructions?: string;
label?: string;
primaryButton?: string;
secondaryButton?: string;
outlineButton?: string;
skeleton?: string;
title?: string;
};
interface SettingsCardProps {
children?: ReactNode;
className?: string;
classNames?: SettingsCardClassNames;
title: ReactNode;
description?: ReactNode;
instructions?: ReactNode;
actionLabel?: ReactNode;
isSubmitting?: boolean;
disabled?: boolean;
isPending?: boolean;
optimistic?: boolean;
variant?: "default" | "destructive";
action?: () => Promise<unknown> | unknown;
}
declare function SettingsCard({ children, className, classNames, title, description, instructions, actionLabel, disabled, isPending, isSubmitting, optimistic, variant, action }: SettingsCardProps): react_jsx_runtime.JSX.Element;
type SettingsCardsClassNames = {
base?: string;
card?: SettingsCardClassNames;
tabs?: {
base?: string;
list?: string;
trigger?: string;
content?: string;
};
};
interface SettingsCardsProps {
className?: string;
classNames?: SettingsCardsClassNames;
}
declare function SettingsCards({ className, classNames }: SettingsCardsProps): react_jsx_runtime.JSX.Element;
interface AuthCardClassNames {
base?: string;
content?: string;
description?: string;
footer?: string;
footerLink?: string;
form?: AuthFormClassNames;
header?: string;
separator?: string;
settings?: SettingsCardsClassNames;
title?: string;
}
interface AuthCardProps {
className?: string;
classNames?: AuthCardClassNames;
callbackURL?: string;
pathname?: string;
redirectTo?: string;
socialLayout?: "auto" | "horizontal" | "grid" | "vertical";
view?: AuthView;
otpSeparators?: 0 | 1 | 2;
}
declare function AuthCard({ className, classNames, callbackURL, pathname, redirectTo, socialLayout, view, otpSeparators, }: AuthCardProps): react_jsx_runtime.JSX.Element;
interface ForgotPasswordFormProps {
className?: string;
classNames?: AuthFormClassNames;
isSubmitting?: boolean;
localization: Partial<AuthLocalization>;
setIsSubmitting?: (value: boolean) => void;
}
declare function ForgotPasswordForm({ className, classNames, isSubmitting, localization, setIsSubmitting, }: ForgotPasswordFormProps): react_jsx_runtime.JSX.Element;
interface ResetPasswordFormProps {
className?: string;
classNames?: AuthFormClassNames;
localization: Partial<AuthLocalization>;
}
declare function ResetPasswordForm({ className, classNames, localization, }: ResetPasswordFormProps): react_jsx_runtime.JSX.Element;
interface SignInFormProps {
className?: string;
classNames?: AuthFormClassNames;
isSubmitting?: boolean;
localization: Partial<AuthLocalization>;
redirectTo?: string;
setIsSubmitting?: (isSubmitting: boolean) => void;
}
declare function SignInForm({ className, classNames, isSubmitting, redirectTo, setIsSubmitting, }: SignInFormProps): react_jsx_runtime.JSX.Element;
interface SignUpFormProps {
className?: string;
classNames?: AuthFormClassNames;
callbackURL?: string;
isSubmitting?: boolean;
redirectTo?: string;
setIsSubmitting?: (value: boolean) => void;
}
declare function SignUpForm({ className, classNames, callbackURL, isSubmitting, redirectTo, setIsSubmitting, }: SignUpFormProps): react_jsx_runtime.JSX.Element;
declare function SignOut(): react_jsx_runtime.JSX.Element;
/**
* Conditionally renders content during authentication loading state
*
* Renders its children only when the authentication state is being determined
* (during the loading/pending phase). Once the authentication state is resolved,
* nothing is rendered. Useful for displaying loading indicators or temporary
* content while waiting for the authentication check to complete.
*/
declare function AuthLoading({ children }: {
children: ReactNode;
}): ReactNode;
declare function Input({ className, type, ...props }: React$1.ComponentProps<"input">): react_jsx_runtime.JSX.Element;
declare function PasswordInput({ className, enableToggle, onChange, ...props }: ComponentProps<typeof Input> & {
enableToggle?: boolean;
}): react_jsx_runtime.JSX.Element;
interface ProviderIconProps {
className?: string;
variant?: "default" | "color";
}
type ProviderIcon = ComponentType<ProviderIconProps>;
declare const FacebookIcon: ProviderIcon;
declare const GitHubIcon: ProviderIcon;
declare const GoogleIcon: ProviderIcon;
declare function RedirectToSignIn(): ReactNode;
declare function RedirectToSignUp(): ReactNode;
interface ChangePasswordCardProps {
className?: string;
classNames?: SettingsCardClassNames;
accounts?: {
provider: string;
}[] | null;
isPending?: boolean;
skipHook?: boolean;
}
declare function ChangePasswordCard({ className, classNames, accounts, isPending, skipHook }: ChangePasswordCardProps): react_jsx_runtime.JSX.Element;
interface DeleteAccountCardProps {
className?: string;
classNames?: SettingsCardClassNames;
accounts?: {
provider: string;
}[] | null;
isPending?: boolean;
skipHook?: boolean;
}
declare function DeleteAccountCard({ className, classNames, accounts, isPending, skipHook }: DeleteAccountCardProps): react_jsx_runtime.JSX.Element;
interface ProvidersCardProps {
className?: string;
classNames?: SettingsCardClassNames;
accounts?: {
accountId: string;
provider: string;
}[] | null;
isPending?: boolean;
skipHook?: boolean;
}
declare function ProvidersCard({ className, classNames, isPending, skipHook, accounts }: ProvidersCardProps): react_jsx_runtime.JSX.Element;
interface SessionsCardProps {
className?: string;
classNames?: SettingsCardClassNames;
isPending?: boolean;
sessions?: Session$1[] | null;
skipHook?: boolean;
refetch?: () => Promise<void>;
}
declare function SessionsCard({ className, classNames, isPending, sessions, skipHook, refetch, }: SessionsCardProps): react_jsx_runtime.JSX.Element;
interface UpdateAvatarCardProps {
className?: string;
classNames?: SettingsCardClassNames;
isPending?: boolean;
}
declare function UpdateAvatarCard({ className, classNames, isPending: externalIsPending, }: UpdateAvatarCardProps): react_jsx_runtime.JSX.Element;
interface ChangeEmailCardProps {
className?: string;
classNames?: SettingsCardClassNames;
isPending?: boolean;
}
declare function ChangeEmailCard({ className, classNames, isPending, }: ChangeEmailCardProps): react_jsx_runtime.JSX.Element;
type FieldType = "string" | "number" | "boolean";
interface AdditionalField {
description?: ReactNode;
instructions?: ReactNode;
label: ReactNode;
placeholder?: string;
required?: boolean;
type: FieldType;
validate?: (value: string) => Promise<boolean>;
}
interface AdditionalFields {
[key: string]: AdditionalField;
}
interface UpdateFieldCardProps {
className?: string;
classNames?: SettingsCardClassNames;
description?: ReactNode;
instructions?: ReactNode;
isPending?: boolean;
name: string;
placeholder?: string;
required?: boolean;
label?: ReactNode;
type?: FieldType;
value?: unknown;
validate?: (value: string) => boolean | Promise<boolean>;
}
declare function UpdateFieldCard({ className, classNames, description, instructions, isPending, name, placeholder, required, label, type, value, validate }: UpdateFieldCardProps): react_jsx_runtime.JSX.Element;
interface UpdateNameCardProps {
className?: string;
classNames?: SettingsCardClassNames;
isPending?: boolean;
}
declare function UpdateNameCard({ className, classNames, isPending, }: UpdateNameCardProps): react_jsx_runtime.JSX.Element;
declare function SignedIn({ children }: {
children: ReactNode;
}): ReactNode;
declare function SignedOut({ children }: {
children: ReactNode;
}): ReactNode;
interface UserAvatarClassNames {
base?: string;
image?: string;
fallback?: string;
fallbackIcon?: string;
skeleton?: string;
}
interface UserViewClassNames {
base?: string;
avatar?: UserAvatarClassNames;
p?: string;
small?: string;
}
interface UserViewProps {
className?: string;
classNames?: UserViewClassNames;
isPending?: boolean;
user?: Profile;
}
/**
* Displays user information with avatar and details in a compact view
*
* Renders a user's profile information with appropriate fallbacks:
* - Shows avatar alongside user name and email when available
* - Shows loading skeletons when isPending is true
* - Falls back to generic "User" text when neither name nor email is available
* - Supports customization through classNames prop
*/
declare function UserView({ user, className, classNames, isPending }: UserViewProps): react_jsx_runtime.JSX.Element;
interface UserButtonClassNames {
base?: string;
skeleton?: string;
trigger?: {
base?: string;
avatar?: UserAvatarClassNames;
user?: UserViewClassNames;
skeleton?: string;
};
content?: {
base?: string;
user?: UserViewClassNames;
avatar?: UserAvatarClassNames;
menuItem?: string;
separator?: string;
};
}
interface UserButtonProps {
className?: string;
classNames?: UserButtonClassNames;
additionalLinks?: {
href: string;
icon?: ReactNode;
label: ReactNode;
signedIn?: boolean;
}[];
disableDefaultLinks?: boolean;
}
/**
* Displays an interactive user button with dropdown menu functionality
*
* Renders a user interface element that can be displayed as either an icon or full button:
* - Shows a user avatar or placeholder when in icon mode
* - Displays user name and email with dropdown indicator in full mode
* - Provides dropdown menu with authentication options (sign in/out, settings, etc.)
* - Supports multi-session functionality for switching between accounts
* - Can be customized with additional links and styling options
*/
declare function UserButton({ className, classNames, additionalLinks, disableDefaultLinks, }: UserButtonProps): react_jsx_runtime.JSX.Element;
interface AuthenticateOptions {
authView?: AuthView;
enabled?: boolean;
}
declare function useAuthenticate(options?: AuthenticateOptions): void;
interface UserWithPhoneNumber extends G {
phoneNumber: string;
phoneNumberVerified: boolean;
}
interface UserWithTwoFactor extends G {
/**
* If the user has enabled two factor authentication.
*/
twoFactorEnabled: boolean;
}
interface UserWithRole extends G {
role?: string | null;
banned?: boolean | null;
banReason?: string | null;
}
declare const organizationSchema: z.ZodObject<{
id: z.ZodDefault<z.ZodString>;
name: z.ZodString;
slug: z.ZodString;
logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
createdAt: z.ZodDate;
}, "strip", z.ZodTypeAny, {
id: string;
createdAt: Date;
name: string;
slug: string;
logo?: string | null | undefined;
}, {
createdAt: Date;
name: string;
slug: string;
id?: string | undefined;
logo?: string | null | undefined;
}>;
declare const memberSchema: z.ZodObject<{
id: z.ZodDefault<z.ZodString>;
organizationId: z.ZodString;
userId: z.ZodString;
role: z.ZodString;
createdAt: z.ZodDate;
}, "strip", z.ZodTypeAny, {
id: string;
userId: string;
createdAt: Date;
role: string;
organizationId: string;
}, {
userId: string;
createdAt: Date;
role: string;
organizationId: string;
id?: string | undefined;
}>;
declare const invitationSchema: z.ZodObject<{
id: z.ZodDefault<z.ZodString>;
organizationId: z.ZodString;
email: z.ZodString;
role: z.ZodString;
status: z.ZodDefault<z.ZodEnum<["pending", "accepted", "rejected", "canceled"]>>;
/**
* The id of the user who invited the user.
*/
inviterId: z.ZodString;
expiresAt: z.ZodDate;
}, "strip", z.ZodTypeAny, {
id: string;
status: "pending" | "accepted" | "rejected" | "canceled";
email: string;
expiresAt: Date;
role: string;
organizationId: string;
inviterId: string;
}, {
email: string;
expiresAt: Date;
role: string;
organizationId: string;
inviterId: string;
id?: string | undefined;
status?: "pending" | "accepted" | "rejected" | "canceled" | undefined;
}>;
type Organization = z.infer<typeof organizationSchema>;
type Member = z.infer<typeof memberSchema>;
type Invitation = z.infer<typeof invitationSchema>;
type Session = AuthClient["$Infer"]["Session"]["session"];
declare const authClientForType: {
useActiveOrganization: () => {
data: aau_auth_kit.Prettify<{
id: string;
name: string;
createdAt: Date;
slug: string;
logo?: string | null | undefined;
} & {
members: (Member & {
user: {
id: string;
name: string;
email: string;
image: string | undefined;
};
})[];
invitations: Invitation[];
}> | null;
error: null | _better_fetch_fetch.BetterFetchError;
isPending: boolean;
isRefetching: boolean;
};
useListOrganizations: () => {
data: {
id: string;
name: string;
createdAt: Date;
slug: string;
logo?: string | null | undefined;
}[] | null;
error: null | _better_fetch_fetch.BetterFetchError;
isPending: boolean;
isRefetching: boolean;
};
useActiveMember: () => {
data: {
id: string;
createdAt: Date;
userId: string;
organizationId: string;
role: string;
} | null;
error: null | _better_fetch_fetch.BetterFetchError;
isPending: boolean;
isRefetching: boolean;
};
} & {
admin: {
setRole: <FetchOptions extends {
method?: string | undefined;
cache?: RequestCache | undefined;
credentials?: RequestCredentials | undefined;
headers?: (HeadersInit & (HeadersInit | {
accept: "application/json" | "text/plain" | "application/octet-stream";
"content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
authorization: "Bearer" | "Basic";
})) | undefined;
integrity?: string | undefined;
keepalive?: boolean | undefined;
mode?: RequestMode | undefined;
priority?: RequestPriority | undefined;
redirect?: RequestRedirect | undefined;
referrer?: string | undefined;
referrerPolicy?: ReferrerPolicy | undefined;
signal?: (AbortSignal | null) | undefined;
window?: null | undefined;
onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
hookOptions?: {
cloneResponse?: boolean;
} | undefined;
timeout?: number | undefined;
customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
baseURL?: string | undefined;
throw?: boolean | undefined;
auth?: ({
type: "Bearer";
token: string | (() => string | undefined) | undefined;
} | {
type: "Basic";
username: string | (() => string | undefined) | undefined;
password: string | (() => string | undefined) | undefined;
} | {
type: "Custom";
prefix: string | (() => string | undefined) | undefined;
value: string | (() => string | undefined) | undefined;
}) | undefined;
body?: (Partial<{
userId: string;
role: string;
}> & Record<string, any>) | undefined;
query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
params?: Record<string, any> | undefined;
duplex?: "full" | "half" | undefined;
jsonParser?: (<T>(text: string) => Promise<T | undefined>) | undefined;
retry?: _better_fetch_fetch.RetryOptions | undefined;
retryAttempt?: number | undefined;
output?: (zod.ZodType | typeof Blob | typeof File) | undefined;
errorSchema?: zod.ZodType | undefined;
disableValidation?: boolean | undefined;
}>(data_0: aau_auth_kit.Prettify<{
userId: string;
role: string;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
user: UserWithRole;
}, {
code?: string;
message?: string;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
admin: {
createUser: <FetchOptions extends {
method?: string | undefined;
cache?: RequestCache | undefined;
credentials?: RequestCredentials | undefined;
headers?: (HeadersInit & (HeadersInit | {
accept: "application/json" | "text/plain" | "application/octet-stream";
"content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
authorization: "Bearer" | "Basic";
})) | undefined;
integrity?: string | undefined;
keepalive?: boolean | undefined;
mode?: RequestMode | undefined;
priority?: RequestPriority | undefined;
redirect?: RequestRedirect | undefined;
referrer?: string | undefined;
referrerPolicy?: ReferrerPolicy | undefined;
signal?: (AbortSignal | null) | undefined;
window?: null | undefined;
onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
hookOptions?: {
cloneResponse?: boolean;
} | undefined;
timeout?: number | undefined;
customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
baseURL?: string | undefined;
throw?: boolean | undefined;
auth?: ({
type: "Bearer";
token: string | (() => string | undefined) | undefined;
} | {
type: "Basic";
username: string | (() => string | undefined) | undefined;
password: string | (() => string | undefined) | undefined;
} | {
type: "Custom";
prefix: string | (() => string | undefined) | undefined;
value: string | (() => string | undefined) | undefined;
}) | undefined;
body?: (Partial<{
password: string;
email: string;
name: string;
data?: Record<string, any> | undefined;
role?: string | undefined;
}> & Record<string, any>) | undefined;
query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
params?: Record<string, any> | undefined;
duplex?: "full" | "half" | undefined;
jsonParser?: (<T>(text: string) => Promise<T | undefined>) | undefined;
retry?: _better_fetch_fetch.RetryOptions | undefined;
retryAttempt?: number | undefined;
output?: (zod.ZodType | typeof Blob | typeof File) | undefined;
errorSchema?: zod.ZodType | undefined;
disableValidation?: boolean | undefined;
}>(data_0: aau_auth_kit.Prettify<{
password: string;
email: string;
name: string;
data?: Record<string, any> | undefined;
role?: string | undefined;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
user: UserWithRole;
}, {
code?: string;
message?: string;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
admin: {
listUsers: <FetchOptions extends {
method?: string | undefined;
cache?: RequestCache | undefined;
credentials?: RequestCredentials | undefined;
headers?: (HeadersInit & (HeadersInit | {
accept: "application/json" | "text/plain" | "application/octet-stream";
"content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
authorization: "Bearer" | "Basic";
})) | undefined;
integrity?: string | undefined;
keepalive?: boolean | undefined;
mode?: RequestMode | undefined;
priority?: RequestPriority | undefined;
redirect?: RequestRedirect | undefined;
referrer?: string | undefined;
referrerPolicy?: ReferrerPolicy | undefined;
signal?: (AbortSignal | null) | undefined;
window?: null | undefined;
onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
hookOptions?: {
cloneResponse?: boolean;
} | undefined;
timeout?: number | undefined;
customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
baseURL?: string | undefined;
throw?: boolean | undefined;
auth?: ({
type: "Bearer";
token: string | (() => string | undefined) | undefined;
} | {
type: "Basic";
username: string | (() => string | undefined) | undefined;
password: string | (() => string | undefined) | undefined;
} | {
type: "Custom";
prefix: string | (() => string | undefined) | undefined;
value: string | (() => string | undefined) | undefined;
}) | undefined;
body?: undefined;
query?: (Partial<{
search?: string | undefined;
limit?: number | undefined;
offset?: number | undefined;
sortBy?: string | undefined;
sortDirection?: "asc" | "desc" | undefined;
}> & Record<string, any>) | undefined;
params?: Record<string, any> | undefined;
duplex?: "full" | "half" | undefined;
jsonParser?: (<T>(text: string) => Promise<T | undefined>) | undefined;
retry?: _better_fetch_fetch.RetryOptions | undefined;
retryAttempt?: number | undefined;
output?: (zod.ZodType | typeof Blob | typeof File) | undefined;
errorSchema?: zod.ZodType | undefined;
disableValidation?: boolean | undefined;
}>(data_0: aau_auth_kit.Prettify<{
query: {
search?: string | undefined;
limit?: number | undefined;
offset?: number | undefined;
sortBy?: string | undefined;
sortDirection?: "asc" | "desc" | undefined;
};
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
users: UserWithRole[];
}, {
code?: string;
message?: string;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
admin: {
listUserSessions: <FetchOptions extends {
method?: string | undefined;
cache?: RequestCache | undefined;
credentials?: RequestCredentials | undefined;
headers?: (HeadersInit & (H