@loke/ui
Version:
To install dependencies:
82 lines (81 loc) • 5.64 kB
text/typescript
import { Close as DialogClose, Content as DialogContent, Description as DialogDescription, Overlay as DialogOverlay, Portal as DialogPortal, Title as DialogTitle, Trigger as DialogTrigger } from "@loke/ui/dialog";
import { Primitive } from "@loke/ui/primitive";
import { type ComponentPropsWithoutRef, type FC, type ReactNode } from "react";
type DrawerDirection = "top" | "right" | "bottom" | "left";
declare const createDrawerScope: import("@loke/ui/context").CreateScope;
interface DrawerProps {
activeSnapPoint?: number | string | null;
children?: ReactNode;
defaultOpen?: boolean;
/** @default "bottom" */
direction?: DrawerDirection;
/** Whether Escape, clicking outside or dragging can dismiss the drawer. Without snap points, a non-dismissible drawer can't be dragged. @default true */
dismissible?: boolean;
/** Index of the snap point from which the overlay starts fading. */
fadeFromIndex?: number;
/** Only allow dragging via the DrawerHandle, not the full content area. @default false */
handleOnly?: boolean;
/** @default true */
modal?: boolean;
/** Mark this drawer as nested inside another drawer. @default false */
nested?: boolean;
/** Prevent body style changes on open. @default false */
noBodyStyles?: boolean;
onOpenChange?: (open: boolean) => void;
open?: boolean;
setActiveSnapPoint?: (snapPoint: number | string | null) => void;
/** Apply CSS scale transform to a [data-loke-drawer-wrapper] element when open. @default false */
shouldScaleBackground?: boolean;
/** Snap point values: fractions (0-1), pixel strings ("200px"), or percentages ("50%"). */
snapPoints?: (number | string)[];
}
declare const Drawer: FC<DrawerProps>;
type DialogTriggerProps = ComponentPropsWithoutRef<typeof DialogTrigger>;
interface DrawerTriggerProps extends DialogTriggerProps {
}
declare const DrawerTrigger: import("react").ForwardRefExoticComponent<DrawerTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
type DialogPortalProps = ComponentPropsWithoutRef<typeof DialogPortal>;
interface DrawerPortalProps extends DialogPortalProps {
}
declare const DrawerPortal: FC<DrawerPortalProps>;
type DialogOverlayProps = ComponentPropsWithoutRef<typeof DialogOverlay>;
interface DrawerOverlayProps extends DialogOverlayProps {
}
declare const DrawerOverlay: import("react").ForwardRefExoticComponent<DrawerOverlayProps & import("react").RefAttributes<HTMLDivElement>>;
type DialogContentProps = ComponentPropsWithoutRef<typeof DialogContent>;
interface DrawerContentProps extends DialogContentProps {
/** Override the root-level dismissible setting for this content. */
dismissible?: boolean;
}
declare const DrawerContent: import("react").ForwardRefExoticComponent<DrawerContentProps & import("react").RefAttributes<HTMLDivElement>>;
type PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;
interface DrawerHandleProps extends PrimitiveDivProps {
}
declare const DrawerHandle: import("react").ForwardRefExoticComponent<DrawerHandleProps & import("react").RefAttributes<HTMLDivElement>>;
type DialogTitleProps = ComponentPropsWithoutRef<typeof DialogTitle>;
interface DrawerTitleProps extends DialogTitleProps {
}
declare const DrawerTitle: import("react").ForwardRefExoticComponent<DrawerTitleProps & import("react").RefAttributes<HTMLHeadingElement>>;
type DialogDescriptionProps = ComponentPropsWithoutRef<typeof DialogDescription>;
interface DrawerDescriptionProps extends DialogDescriptionProps {
}
declare const DrawerDescription: import("react").ForwardRefExoticComponent<DrawerDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>>;
type DialogCloseProps = ComponentPropsWithoutRef<typeof DialogClose>;
interface DrawerCloseProps extends DialogCloseProps {
}
declare const DrawerClose: import("react").ForwardRefExoticComponent<DrawerCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
interface DrawerNestedRootProps extends DrawerProps {
}
declare const DrawerNestedRoot: FC<DrawerNestedRootProps>;
declare const Root: FC<DrawerProps>;
declare const Trigger: import("react").ForwardRefExoticComponent<DrawerTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
declare const Portal: FC<DrawerPortalProps>;
declare const Overlay: import("react").ForwardRefExoticComponent<DrawerOverlayProps & import("react").RefAttributes<HTMLDivElement>>;
declare const Content: import("react").ForwardRefExoticComponent<DrawerContentProps & import("react").RefAttributes<HTMLDivElement>>;
declare const Handle: import("react").ForwardRefExoticComponent<DrawerHandleProps & import("react").RefAttributes<HTMLDivElement>>;
declare const Title: import("react").ForwardRefExoticComponent<DrawerTitleProps & import("react").RefAttributes<HTMLHeadingElement>>;
declare const Description: import("react").ForwardRefExoticComponent<DrawerDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>>;
declare const Close: import("react").ForwardRefExoticComponent<DrawerCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
declare const NestedRoot: FC<DrawerNestedRootProps>;
export type { DrawerCloseProps, DrawerContentProps, DrawerDescriptionProps, DrawerHandleProps, DrawerNestedRootProps, DrawerOverlayProps, DrawerPortalProps, DrawerProps, DrawerTitleProps, DrawerTriggerProps, };
export { Close, Content, createDrawerScope, Description, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerHandle, DrawerNestedRoot, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, Handle, NestedRoot, Overlay, Portal, Root, Title, Trigger, };