import { Transition } from "motion/react"; import * as React from "react"; //#region src/use-motion-root.d.ts /** * Bridges MotionRoot and MotionContent so the primitive stays "open" while * the content's exit animation is still playing. Root passes * `open={isOpen || showContent}` to the primitive. */ interface IMotionRootContextValue { isOpen: boolean; /** Content still visually mounted (including during exit). */ showContent: boolean; /** Called by `AnimatePresence.onExitComplete` to finally unmount. */ setShowContent: (v: boolean) => void; } declare const MotionRootContext: React.Context; /** * Two-state pattern for motion exit animations. Returns `rootProps` to spread * on the primitive Root and a `contextValue` to provide via * `MotionRootContext.Provider`. The primitive stays open during exit because * Root receives `open={isOpen || showContent}`; `AnimatePresence.onExitComplete` * flips `showContent` false to finally close. */ declare function useMotionRoot(props: { open?: boolean; defaultOpen?: boolean; onOpenChange?: (open: boolean) => void; }): { rootProps: { open: boolean; onOpenChange: (next: boolean) => void; }; contextValue: IMotionRootContextValue; }; /** Read MotionRoot context from a content component. */ declare function useMotionContent(): IMotionRootContextValue; /** Exit duration (ms) from a `Transition`. Reads `duration` or spring `visualDuration`. */ declare function getTransitionDurationMs(t?: Transition): number; /** * Manual mount/unmount driver for `` where AnimatePresence * can't track exits through the non-motion wrapper. `shouldRender` stays true for * `exitDurationMs` after close so exit animation plays in place, then unmounts. * Body `pointer-events` restored via refcount so overlapping modals don't fight. */ declare function useMotionMount(isOpen: boolean, exitDurationMs?: number): boolean; //#endregion export { IMotionRootContextValue, MotionRootContext, getTransitionDurationMs, useMotionContent, useMotionMount, useMotionRoot };