/**
 * Menubar type definitions
 * @countermeasure/web-components/navigation/menubar
 */

export interface MenuItem {
  /** Item kind — controls rendering and selection behaviour. */
  type: 'item' | 'separator' | 'checkbox' | 'radio'
  /** Visible label. Omit for separators. */
  label?: string
  /** Optional icon HTML rendered before the label. */
  icon?: string
  /** Keyboard shortcut hint displayed at the trailing edge. */
  shortcut?: string
  /**
   * Disable interaction.
   * @default false
   */
  disabled?: boolean
  /**
   * Initial checked state for checkbox/radio items.
   * @default false
   */
  checked?: boolean
  /** Nested submenu entries. */
  children?: MenuItem[]
  /** Called when the item is selected. */
  onSelect?: () => void
}

export interface MenubarItem {
  /** Top-level menu label (e.g. `'File'`, `'Edit'`). */
  label: string
  /** Items rendered inside this top-level menu. */
  children: MenuItem[]
}

export interface MenubarConfig {
  /** Container element (or selector) the menubar is mounted into. */
  container: HTMLElement | string
  /** Top-level menus rendered left-to-right. */
  items: MenubarItem[]
  /** Additional CSS class names. */
  className?: string
}
