import { AgnosticDrawer, DrawerProps } from '../core/Drawer'; import * as React from 'react'; /** * React-specific props for Drawer. * * Includes onOpenChange for controlled-component support. This is necessary * because the underlying Lit web component manages its own open state internally * (e.g. it sets this.open = false on Escape or backdrop click). @lit/react's * createComponent only bridges DOM events -> React props, so without explicitly * calling onOpenChange(false) on close/cancel, React's state never learns the * drawer closed. The stale open={true} is then re-applied on the next render, * causing previously dismissed drawers to reappear when other drawers are opened. */ export interface ReactDrawerProps extends DrawerProps { children?: React.ReactNode; className?: string; id?: string; /** * Called with the new open state whenever the drawer opens or closes. * Wire this to your React state setter (e.g. onOpenChange={setIsOpen}) so * React stays in sync when the drawer closes itself internally. */ onOpenChange?: (open: boolean) => void; } /** * Helper component for drawer header slot */ export interface DrawerHeaderProps { children?: React.ReactNode; } /** * Helper component for drawer footer slot */ export interface DrawerFooterProps { children?: React.ReactNode; } /** * ReactDrawer wraps _ReactDrawerBase to add onOpenChange support. * * The Lit element fires "drawer-close" when the close button is clicked and * "drawer-cancel" when the user presses Escape or clicks the backdrop. Both * mean the drawer is now closed. We intercept those two events and call * onOpenChange(false) so React state reflects the new closed state immediately, * preventing the stale open={true} from being pushed back into the element on * the next render. */ export declare const ReactDrawer: React.ForwardRefExoticComponent>; export declare const DrawerHeader: React.FC; export declare const DrawerFooter: React.FC; export type { DrawerOpenEvent, DrawerCloseEvent, DrawerCancelEvent } from '../core/Drawer'; //# sourceMappingURL=ReactDrawer.d.ts.map