/** * FamilyDrawer — a multi-view bottom sheet with height-morphing, crossfading * views, and drag-to-dismiss. Inspired by the Family app drawer. * * Zero runtime dependencies (React only). No vaul, no framer-motion. * Drop this file into your project and import { FamilyDrawer, useFamilyDrawer }. * * The implementation is split across focused modules in this folder: * - familyDrawerStyles — the injected stylesheet * - familyDrawerConstants — timing + gesture thresholds * - useFamilyDrawerViewMorph — view crossfade + height morph * - useFamilyDrawerDrag — drag-to-dismiss gesture * - useFamilyDrawerFocusTrap — scroll lock, Escape, Tab trap * This file owns the open/visibility lifecycle and wires the pieces together. */ import React, { type ReactElement, type ReactNode } from "react"; export type FamilyDrawerViewComponent = React.ComponentType; export type ViewsRegistry = Record; interface FamilyDrawerContextValue { /** Current active view name. */ view: string; /** Navigate to another view (triggers the height morph + crossfade). */ setView: (view: string) => void; /** Whether the drawer is open. */ isOpen: boolean; /** Close the drawer. */ close: () => void; /** Crossfade duration in seconds, derived from the height delta. */ opacityDuration: number; } export declare function useFamilyDrawer(): FamilyDrawerContextValue; /** Like useFamilyDrawer, but returns undefined outside a . Lets * hosted content detect the drawer and defer height animation to its morph * instead of running a competing one. */ export declare function useOptionalFamilyDrawer(): FamilyDrawerContextValue | undefined; export interface FamilyDrawerProps { /** Map of view name -> component. Must include a `default` view. */ views: ViewsRegistry; /** A single element that opens the drawer when clicked. */ trigger: ReactElement; defaultView?: string; onViewChange?: (view: string) => void; open?: boolean; defaultOpen?: boolean; onOpenChange?: (open: boolean) => void; /** When true, the panel renders without its own background, padding, or drag * handle — the hosted view is expected to supply its own surface. Drag-to- * dismiss, height morphing, rounding, and the drop shadow are preserved. */ bare?: boolean; /** When false, the drawer can only be dismissed by Escape or an explicit * close button — clicking the overlay outside the panel and drag-to-dismiss * are both disabled. Defaults to true. */ closeOnOutsideClick?: boolean; } export declare function FamilyDrawer({ views, trigger, defaultView, onViewChange, open: controlledOpen, defaultOpen, onOpenChange, bare, closeOnOutsideClick, }: FamilyDrawerProps): import("react/jsx-runtime").JSX.Element; export declare function FamilyDrawerClose(): import("react/jsx-runtime").JSX.Element; export declare function FamilyDrawerBack({ to }: { to?: string; }): import("react/jsx-runtime").JSX.Element; export declare function FamilyDrawerHeader({ icon, title, description, }: { icon?: ReactNode; title: string; description?: string; }): import("react/jsx-runtime").JSX.Element; export declare function FamilyDrawerRow({ icon, children, onClick, }: { icon?: ReactNode; children: ReactNode; onClick?: () => void; }): import("react/jsx-runtime").JSX.Element; export declare function FamilyDrawerPrimaryButton({ children, onClick, }: { children: ReactNode; onClick?: () => void; }): import("react/jsx-runtime").JSX.Element; export declare function FamilyDrawerSecondaryButton({ children, onClick, }: { children: ReactNode; onClick?: () => void; }): import("react/jsx-runtime").JSX.Element; export {}; //# sourceMappingURL=FamilyDrawer.d.ts.map