import * as react_jsx_runtime from 'react/jsx-runtime';
import { ReactNode } from 'react';
import { UseAuthResult } from '../../hooks/useAuth.mjs';
import { AuthMode } from '../../types/auth.mjs';
interface AuthDialogProps {
/** Result from useAuth(). The dialog reads + drives this. */
auth: UseAuthResult;
/** Controlled open state. */
open: boolean;
/** Called when the dialog wants to close (overlay click, ESC, Close button). */
onOpenChange: (open: boolean) => void;
/** Children (typically `` and `...`). */
children: ReactNode;
/**
* Disable closing via ESC key. Defaults to false (ESC closes).
*/
disableEscapeClose?: boolean;
/**
* Where to portal the dialog. Defaults to `document.body`. Pass `null` to
* disable portaling and render in-place.
*/
container?: HTMLElement | null;
}
declare function AuthDialogRoot({ auth, open, onOpenChange, children, disableEscapeClose, container, }: AuthDialogProps): react_jsx_runtime.JSX.Element | null;
interface AuthDialogOverlayProps {
className?: string;
/**
* If true (default), clicking the overlay closes the dialog.
*/
closeOnClick?: boolean;
}
declare function Overlay({ className, closeOnClick }: AuthDialogOverlayProps): react_jsx_runtime.JSX.Element;
interface AuthDialogPanelProps {
className?: string;
children: ReactNode;
}
declare function Panel({ className, children }: AuthDialogPanelProps): react_jsx_runtime.JSX.Element;
interface AuthDialogHeaderProps {
className?: string;
children: ReactNode;
}
declare function Header({ className, children }: AuthDialogHeaderProps): react_jsx_runtime.JSX.Element;
interface AuthDialogTitleProps {
className?: string;
children?: ReactNode;
/**
* If provided, this string is shown when none of the more-specific
* mode children are passed. Defaults to a per-mode label.
*/
fallback?: string;
}
declare function Title({ className, children, fallback }: AuthDialogTitleProps): react_jsx_runtime.JSX.Element;
interface AuthDialogCloseProps {
className?: string;
children?: ReactNode;
ariaLabel?: string;
}
declare function Close({ className, children, ariaLabel }: AuthDialogCloseProps): react_jsx_runtime.JSX.Element;
interface AuthDialogErrorProps {
className?: string;
/** If true, hide when there's no error (default true). */
hideEmpty?: boolean;
children?: (message: string) => ReactNode;
}
declare function ErrorDisplay({ className, hideEmpty, children }: AuthDialogErrorProps): react_jsx_runtime.JSX.Element | null;
interface FormPropsBase {
className?: string;
inputClassName?: string;
submitClassName?: string;
submitLabel?: ReactNode;
/** Optional renderProp slot: render after default fields, before submit. */
children?: ReactNode;
}
interface AuthDialogSignInFormProps extends FormPropsBase {
/** Default email value. */
defaultEmail?: string;
}
declare function SignInForm(props: AuthDialogSignInFormProps): react_jsx_runtime.JSX.Element | null;
interface AuthDialogSignUpFormProps extends FormPropsBase {
defaultEmail?: string;
/** Minimum password length hint shown to the user. Defaults to 8. */
minPasswordLength?: number;
}
declare function SignUpForm(props: AuthDialogSignUpFormProps): react_jsx_runtime.JSX.Element | null;
interface AuthDialogForgotPasswordFormProps extends FormPropsBase {
defaultEmail?: string;
/** Message shown after the request is submitted. */
sentMessage?: ReactNode;
sentClassName?: string;
}
declare function ForgotPasswordForm(props: AuthDialogForgotPasswordFormProps): react_jsx_runtime.JSX.Element | null;
interface AuthDialogResetPasswordFormProps extends FormPropsBase {
minPasswordLength?: number;
}
declare function ResetPasswordForm(props: AuthDialogResetPasswordFormProps): react_jsx_runtime.JSX.Element | null;
interface AuthDialogVerifyEmailNoticeProps {
className?: string;
resendClassName?: string;
resendLabel?: ReactNode;
/** Custom message renderer; receives the captured email or null. */
children?: (email: string | null) => ReactNode;
}
declare function VerifyEmailNotice(props: AuthDialogVerifyEmailNoticeProps): react_jsx_runtime.JSX.Element | null;
interface AuthDialogModeSwitchProps {
to: AuthMode;
className?: string;
children: ReactNode;
/** Show only when the current mode is in this set. Defaults to always. */
visibleWhen?: AuthMode[];
}
declare function ModeSwitch({ to, className, children, visibleWhen }: AuthDialogModeSwitchProps): react_jsx_runtime.JSX.Element | null;
interface AuthDialogPoweredByProps {
className?: string;
/**
* The URL of the central account hub. Defaults to
* `https://admin.sites.bffless.app/account`. Override for self-hosted CE
* deployments or staging environments.
*/
href?: string;
/**
* Override the rendered link text. Defaults to
* `"Powered by BFFless Auth · Manage account"`.
*/
children?: ReactNode;
}
/**
* Subtle footer link communicating the identity-provider model: "this site's
* sign-in is BFFless Auth; you can manage credentials and see all your sites
* at one central place." Pair it with ``.
*
* Rendered as a normal anchor so it works with any styling system. Opens in
* a new tab so the consumer site doesn't lose context.
*/
declare function PoweredBy({ className, href, children }: AuthDialogPoweredByProps): react_jsx_runtime.JSX.Element;
interface AuthDialogAccountExistsHintProps {
className?: string;
/**
* Render slot. Receives the helper to switch to sign-in mode (which also
* clears the current error). Use this to wire your own copy / button:
*
* ```tsx
*
* {(switchToSignIn) => (
*
* That email is already registered. instead.
*
* )}
*
* ```
*/
children?: (switchToSignIn: () => void) => ReactNode;
/** Class for the inline "Sign in instead" button in the default copy. */
switchClassName?: string;
}
/**
* Inline helper that detects the `email_exists` error coming back from
* `` and offers to switch to the Sign-in tab. Renders
* nothing in any other state — safe to drop into the panel unconditionally.
*
* Place it near `` (or replace the generic error display
* for the email-exists path):
*
* ```tsx
*
*
*
* ```
*
* The component decides when to show; the consumer keeps full control over
* styling and copy via the optional render prop.
*/
declare function AccountExistsHint({ className, children, switchClassName, }: AuthDialogAccountExistsHintProps): react_jsx_runtime.JSX.Element | null;
interface AuthDialogForgotPasswordLinkProps {
className?: string;
children?: ReactNode;
}
declare function ForgotPasswordLink({ className, children }: AuthDialogForgotPasswordLinkProps): react_jsx_runtime.JSX.Element | null;
declare const AuthDialog: typeof AuthDialogRoot & {
Overlay: typeof Overlay;
Panel: typeof Panel;
Header: typeof Header;
Title: typeof Title;
Close: typeof Close;
Error: typeof ErrorDisplay;
SignInForm: typeof SignInForm;
SignUpForm: typeof SignUpForm;
ForgotPasswordForm: typeof ForgotPasswordForm;
ResetPasswordForm: typeof ResetPasswordForm;
VerifyEmailNotice: typeof VerifyEmailNotice;
ModeSwitch: typeof ModeSwitch;
ForgotPasswordLink: typeof ForgotPasswordLink;
PoweredBy: typeof PoweredBy;
AccountExistsHint: typeof AccountExistsHint;
};
export { AuthDialog, type AuthDialogAccountExistsHintProps, type AuthDialogCloseProps, type AuthDialogErrorProps, type AuthDialogForgotPasswordFormProps, type AuthDialogForgotPasswordLinkProps, type AuthDialogHeaderProps, type AuthDialogModeSwitchProps, type AuthDialogOverlayProps, type AuthDialogPanelProps, type AuthDialogPoweredByProps, type AuthDialogProps, type AuthDialogResetPasswordFormProps, type AuthDialogSignInFormProps, type AuthDialogSignUpFormProps, type AuthDialogTitleProps, type AuthDialogVerifyEmailNoticeProps };