"use client"; import { XCircle } from "@phosphor-icons/react/dist/ssr/XCircle"; import clsx from "clsx"; import type { ComponentProps, ReactNode } from "react"; import { Heading } from "react-aria-components"; import styles from "./index.module.scss"; import { Button } from "../Button/index.js"; import { ModalDialog } from "../ModalDialog/index.js"; export { ModalDialogTrigger as DrawerTrigger } from "../ModalDialog/index.js"; const CLOSE_DURATION_IN_S = 0.15; export const CLOSE_DURATION_IN_MS = CLOSE_DURATION_IN_S * 1000; type OwnProps = { fill?: boolean | undefined; title: ReactNode; closeHref?: string | undefined; footer?: ReactNode | undefined; headingExtra?: ReactNode | undefined; headingClassName?: string | undefined; bodyClassName?: string | undefined; footerClassName?: string | undefined; }; type Props = Omit< ComponentProps, keyof OwnProps | "overlayVariants" | "overlayClassName" | "variants" > & OwnProps; export const Drawer = ({ className, title, closeHref, children, fill, footer, headingClassName, bodyClassName, footerClassName, headingExtra, ...props }: Props) => ( {(...args) => ( <>
{title}
{headingExtra}
{typeof children === "function" ? children(...args) : children}
{footer && (
{footer}
)} )}
);