import type { PrimitivePropsWithRef } from '../utils/primitive.cjs'; /** @internal Shared state distributed from LoadingOverlay to backdrop and content parts via context. */ export interface LoadingOverlayContextValue { /** Effective visibility after `delay`, not the raw prop. */ visible: boolean; fullScreen: boolean; loadingLabel: string; } /** Props for the {@link LoadingOverlayRoot}. */ export interface LoadingOverlayRootProps extends PrimitivePropsWithRef<'div'> { /** * Whether work is in flight, for controlled usage paired with `onVisibleChange`. * @default undefined — uncontrolled, tracks internally. */ visible?: boolean | undefined; /** * Fires when the overlay actually appears or disappears, after `delay`, reporting the effective transition rather than the raw prop. * @default undefined — no-op if omitted. */ onVisibleChange?: ((visible: boolean) => void) | undefined; /** * Covers the viewport instead of the root's box, emitting `data-full-screen` and locking body scroll while visible. * @default false — the overlay covers only the root element's box. */ fullScreen?: boolean | undefined; /** * Accessible name of the busy region, announced when the overlay becomes * visible and used as the derived `Spinner`'s label. * @default 'Loading' — name the work ("Loading invoices") when multiple overlays exist. */ loadingLabel?: string | undefined; /** * Text announced when the overlay hides, closing the loop the appearance announcement opened. * @default undefined — hiding announces nothing. */ loadedLabel?: string | undefined; /** * Milliseconds to wait after `visible` turns true before the overlay renders, preventing spinner flash on fast responses. * @default 0 — shows immediately to avoid hiding slow connections. */ delay?: number | undefined; } /** Props for the {@link LoadingOverlay} recipe, which wraps children in the derived anatomy and has no `asChild`. */ export type LoadingOverlayProps = Omit & { /** * How heavily the skin dims the page, fed to the derived Backdrop. * @default undefined — the skin's own default dimming. */ emphasis?: 'low' | 'medium' | 'high' | (string & {}) | undefined; }; /** Props for {@link LoadingOverlayBackdrop}, the scrim layer that reads visibility from the root's context. */ export interface LoadingOverlayBackdropProps extends PrimitivePropsWithRef<'div'> { /** * How heavily the skin dims the page behind, mirrored to `data-emphasis`. * @default undefined — the skin's own default dimming. */ emphasis?: 'low' | 'medium' | 'high' | (string & {}) | undefined; } /** Props for {@link LoadingOverlayContent}, the centered indicator layer that reads visibility and label from the root's context. */ export interface LoadingOverlayContentProps extends PrimitivePropsWithRef<'div'> { }