/**
 * Button type definitions
 * @countermeasure/web-components/primitives/button
 */

import { type ButtonVariant, type ButtonSize } from './variants'

export type { ButtonVariant, ButtonSize } from './variants'

export interface ButtonConfig {
  /** Container element (or selector) the button is mounted into. */
  container?: HTMLElement | string
  /** Button text content */
  label?: string
  /**
   * Visual style variant
   * @default 'primary'
   */
  variant?: ButtonVariant
  /**
   * Button size
   * @default 'md'
   */
  size?: ButtonSize
  /**
   * Disable interaction
   * @default false
   */
  disabled?: boolean
  /**
   * Show loading spinner
   * @default false
   */
  loading?: boolean
  /** Icon HTML to display */
  icon?: string
  /**
   * Icon position relative to label
   * @default 'left'
   */
  iconPosition?: 'left' | 'right'
  /** Accessible label for screen readers */
  ariaLabel?: string
  /**
   * HTML button type attribute
   * @default 'button'
   */
  type?: 'button' | 'submit' | 'reset'
  /** Additional CSS class names */
  className?: string
  /** Click handler invoked when the button is activated. */
  onClick?: () => void
}

export interface ButtonGroupConfig {
  /** Container element (or selector) the group is mounted into. */
  container?: HTMLElement | string
  /**
   * Layout orientation for grouped buttons
   * @default 'horizontal'
   */
  orientation?: 'horizontal' | 'vertical'
  /** Additional CSS class names */
  className?: string
}
