import type { ReactNode, RefAttributes, SyntheticEvent } from "react";
import type { DialogElementType } from "./Drawer";

export interface DrawerProps extends RefAttributes<DialogElementType> {
  isOpen: boolean;
  /**
   * Direction that drawer will open from
   */
  direction: "top" | "bottom" | "left" | "right";
  className?: string;
  closeLabel?: string;
  /**
   * Announce text for screen readers when drawer opens
   */
  announce?: string;
  onOpen?: () => void;
  onClose?: () => void;
  children?: ReactNode;
}

export type DrawerContextProps = {
  onClose: (event?: SyntheticEvent<HTMLElement, Event>) => void;
  closeLabel: string | undefined;
  headerId?: string;
};
