drawer-stack
Version:
Drawer stack for React
42 lines (41 loc) • 1.73 kB
TypeScript
import React, { type ReactNode } from "react";
interface CustomVerticalDrawerProps {
open: boolean;
onOpenChange: (open: boolean) => void;
children: ReactNode;
handleOnly?: boolean;
onDrag?: (event: TouchEvent | MouseEvent, percentageDragged: number) => void;
onRelease?: (event: TouchEvent | MouseEvent, open: boolean) => void;
}
interface DrawerRootProps extends CustomVerticalDrawerProps {
}
interface DrawerPortalProps {
children: ReactNode;
}
interface DrawerOverlayProps {
className?: string;
style?: React.CSSProperties;
}
interface DrawerContentProps {
children: ReactNode;
className?: string;
style?: React.CSSProperties;
onPointerDownOutside?: (event: PointerEvent) => void;
onInteractOutside?: (event: PointerEvent) => void;
}
interface DrawerHandleProps {
className?: string;
}
declare function DrawerRoot({ children, ...props }: DrawerRootProps): import("react/jsx-runtime").JSX.Element;
declare function DrawerPortal({ children }: DrawerPortalProps): React.ReactPortal | null;
declare function DrawerOverlay({ className, style }: DrawerOverlayProps): import("react/jsx-runtime").JSX.Element;
declare function DrawerContent({ children, className, style, onPointerDownOutside, onInteractOutside, }: DrawerContentProps): import("react/jsx-runtime").JSX.Element | null;
declare function DrawerHandle({ className }: DrawerHandleProps): import("react/jsx-runtime").JSX.Element;
export declare const Drawer: {
Root: typeof DrawerRoot;
Portal: typeof DrawerPortal;
Overlay: typeof DrawerOverlay;
Content: typeof DrawerContent;
Handle: typeof DrawerHandle;
};
export { DrawerRoot, DrawerPortal, DrawerOverlay, DrawerContent, DrawerHandle };