/**
 * Drawer type definitions
 * @countermeasure/web-components/navigation/drawer
 */

export type DrawerSide = 'left' | 'right' | 'top' | 'bottom'

export type DrawerSize = 'sm' | 'md' | 'lg' | 'full'

export interface DrawerConfig {
  /** Container element (or selector) the drawer is mounted into. Defaults to `document.body`. */
  container?: HTMLElement | string
  /**
   * Edge of the viewport the drawer slides in from.
   * @default 'right'
   */
  side?: DrawerSide
  /**
   * Drawer size along the perpendicular axis.
   * @default 'md'
   */
  size?: DrawerSize
  /** Optional title rendered in the drawer header. */
  title?: string
  /**
   * Render the dimmed backdrop behind the drawer.
   * @default true
   */
  showOverlay?: boolean
  /**
   * Close the drawer when the Escape key is pressed.
   * @default true
   */
  closeOnEscape?: boolean
  /**
   * Close the drawer when the overlay is clicked.
   * @default true
   */
  closeOnOverlay?: boolean
  /** Additional CSS class names. */
  className?: string
  /** Called after the drawer finishes opening. */
  onOpen?: () => void
  /** Called after the drawer finishes closing. */
  onClose?: () => void
}
