import React from "react"; import Animated from "react-native-reanimated"; type AnimatedViewProps = React.ComponentProps; /** * Reanimated config for the FIELD-level Sign In ↔ Sign Up toggle. (The * welcome ↔ form stage swap is a fixed, shared-value fade-through — see the * morph effect in the component.) * • `layout` — eases the card height as fields appear/disappear. * • `entering`/`exiting` — fields that mount/unmount (Sign In ↔ Sign Up). */ export interface AuthFormTransition { layout?: AnimatedViewProps["layout"]; entering?: AnimatedViewProps["entering"]; exiting?: AnimatedViewProps["exiting"]; } export interface AuthScreenProps { /** Master-password field label. */ passwordLabel?: string; /** Master-password field placeholder. */ passwordPlaceholder?: string; /** Optional social-auth block, rendered under the primary CTA. */ socialAuth?: React.ReactNode; /** * Render the "Sign in with passkey" button + ceremony flow. Pass the * result of `isPasskeySupported()` (only meaningful in sign-in mode). */ passkeyEnabled?: boolean; passkeyUnlockPlaceholder?: string; passkeyUnlockTitle?: string; passkeyUnlockDescription?: string; /** * Connection / server-settings dialog, folded into this single page (no * route). When provided, a gear button is shown top-right that toggles it. * * Mutually exclusive with `onSettingsPress`, which is the better fit where * the settings surface deserves a whole screen rather than a dialog. */ settings?: (props: { visible: boolean; onClose: () => void; }) => React.ReactNode; /** * Show the gear, but navigate instead of opening a dialog. * * Takes precedence over `settings`. A connection screen that has to explain * offline against cloud, official against self-hosted, and show a live health * check is too much for a dialog on a phone — it wants a real screen with * room and a back button. Web, by contrast, passes NEITHER: a browser reached * the app by loading a particular server's URL, so offering to point it * somewhere else is answering a question the page's own origin already * settled. */ onSettingsPress?: () => void; /** Override the animations. Merged over the defaults. */ transition?: AuthFormTransition; /** * App-specific hero rendered on the welcome view, under the logo (the home * for each app's old welcome-screen animation — vault's PasswordDemoAnimation, * simple-finance's AssetCarousel, …). Omit for none. */ decoration?: React.ReactNode; /** * Full-bleed layer behind everything on the screen — a texture, an ambient * gradient. Rendered absolutely-filled and `pointerEvents="none"`, below the * morph, so a welcome→form stage change does not fade it. * * Pairs with `cardBackdrop`: this is the ground, that is the accent hugging * the form. A backdrop drawn here sits UNDER the card backdrop, so a card * glow still reads over an opaque texture. */ backdrop?: React.ReactNode; /** * Persistent footer under the form — copyright, build, which server the * client is pointed at. Always visible, unlike the legal line, which is * welcome-stage only. */ footer?: React.ReactNode; /** * Companion pane shown BESIDE the form on a wide viewport, and not rendered * at all on a narrow one. * * This is the difference between a mobile layout stretched across a monitor * and something that looks built for a desktop. A single centred card on a * 1440px screen leaves most of the window empty; giving the brand, the * product story and the ambient motion their own half turns that emptiness * into the composition. * * Rendered inside the same `KeyboardAvoidingView` as the form but outside its * scroll view, so it holds still while the form scrolls. */ aside?: React.ReactNode; /** * Viewport width, in px, at which `aside` appears. Defaults to 1024 — below * that a two-pane split squeezes the form narrower than its own 360px card. */ asideBreakpoint?: number; /** * Reserve the height of the TALLER of Sign In / Sign Up so the card holds * still when the two are toggled. Defaults to `true`. * * The cost of the lock is slack: whichever mode is shorter leaves the * difference as empty space above its submit button. Where Sign Up carries * several more fields than Sign In that gap is the more visible flaw of the * two — most people only ever sign in, and they all see it — so a consumer * can set this `false` and let the card resize instead. The body is already * wrapped in a layout animation, so the change eases rather than jumps. */ lockFormHeight?: boolean; /** * Ambient layer immediately behind the auth card — a soft glow, a tint. * Rendered absolutely, `pointerEvents="none"`, and bled a little past the * card's edges so the effect hugs the form rather than washing the screen. * * Deliberately scoped to the card. A full-bleed version of this reads as a * coloured background, which is a much louder decision than an accent behind * the one thing the user is looking at. * * Distinct from `decoration`, which is content INSIDE the welcome view's * flow and moves with it. */ cardBackdrop?: React.ReactNode; /** How far the card backdrop bleeds past the card, in px. Defaults to 48. */ cardBackdropBleed?: number; /** Welcome-view tagline/subtitle. Defaults to AppConfig `tagline`. */ welcomeCtaLabel?: string; /** * Called the first time the user leaves the welcome stage. * * The consumer persists this — an introduction repeated on every launch is an * obstacle, not an introduction. Kept as a callback rather than handled here * because this screen is shared across apps and has no business knowing where * any of them keep their preferences. */ onWelcomeDismissed?: () => void; /** * Show the Sign Up half of the toggle. Defaults to `true`. * * Set `false` where the server has no self-service registration — an * identity provider whose tenant is `closed`, for instance. The toggle is * hidden rather than disabled, because a control that cannot ever succeed is * worse than no control. */ signUpEnabled?: boolean; /** * Offer the "Forgot password?" link. Defaults to `true`. * * Hidden rather than disabled, for the same reason `signUpEnabled` hides its * toggle: a control that cannot ever succeed is worse than no control. A * server that has not finished first-boot setup has one account and no mail * transport to send a reset through, and the link is also a way out of a * flow that has to be completed before anything else works. */ forgotPasswordEnabled?: boolean; /** * Collect an invite code on the Sign Up form and require it. For servers * whose registration is invite-only. */ requireInviteCode?: boolean; /** * Override registration entirely. When provided this runs instead of * `useAuth().register`, and the screen shows `signUpSuccessMessage` rather * than assuming the user is now signed in. * * This exists because registration is not uniform across the estate: the * single-tenant apps sign you straight in, while the multi-tenant IdP creates * an unverified account, emails a link, and leaves you signed out. Reshaping * the shared `AuthService.register` to cover both would have changed the * contract vault and simple-finance already depend on. */ onSignUp?: (input: { email: string; password: string; displayName: string; inviteCode?: string; }) => Promise; /** Shown after a successful `onSignUp`. */ signUpSuccessMessage?: string; /** * Render the welcome stage (logo, decoration, "Get Started") before the form. * Defaults to `true`. * * Set `false` to land straight on the form. An app whose only purpose at this * URL is to authenticate has nothing to introduce, and a button that only * reveals the form it precedes is pure friction. The in-card "← Back" is * hidden too, since there is no stage behind it. */ showWelcome?: boolean; /** * Page heading, rendered ABOVE the card, e.g. * "Log into your Entropy account to continue." * * Undefined renders no heading, which is the right default for an app whose * own login the user reached deliberately -- the surrounding brand already * says where they are. Set it on an identity provider, where the user is * frequently redirected in from a relying application and this is the only * thing on screen that can say whose credentials to type. * * It used to render inside the card header, where it sat over the * Sign In / Sign Up toggle and read as a label for the selected mode. Above * the card it is the page's heading and the card is purely the form. */ title?: string; /** Optional line under `title`. Ignored unless `title` is set. */ subtitle?: string; } /** * Single consolidated unauthenticated screen with three animated stages: * a welcome view (logo + app decoration + Get Started), the Sign In / Sign Up * form (with an animated mode toggle), and inline forgot-password. Terms/Privacy * are themed popups and a connection-settings dialog can be folded in. Preserves * the passkey ceremony + non-PRF unlock and the HIBP/strength checks. */ export declare function AuthScreen({ passwordLabel, passwordPlaceholder, socialAuth, passkeyEnabled, passkeyUnlockPlaceholder, passkeyUnlockTitle, passkeyUnlockDescription, settings, onSettingsPress, transition, decoration, footer, aside, asideBreakpoint, lockFormHeight, backdrop, cardBackdrop, cardBackdropBleed, welcomeCtaLabel, onWelcomeDismissed, signUpEnabled, forgotPasswordEnabled, requireInviteCode, onSignUp, signUpSuccessMessage, showWelcome, title, subtitle, }?: AuthScreenProps): React.JSX.Element; export default AuthScreen; //# sourceMappingURL=AuthScreen.d.ts.map