import type { StateValue } from "../../../../lib/propNormalization";

export interface SwitchProps extends Omit<
  React.ButtonHTMLAttributes<HTMLButtonElement>,
  "onChange"
> {
  /**
   * Whether the switch is checked (Figma prop).
   * @default false
   */
  propSwitch?: boolean;
  onChange?: (
    _e:
      | React.MouseEvent<HTMLButtonElement>
      | React.KeyboardEvent<HTMLButtonElement>,
  ) => void;
  onFocus?: (_e: React.FocusEvent<HTMLButtonElement>) => void;
  onBlur?: (_e: React.FocusEvent<HTMLButtonElement>) => void;
  /**
   * Visual state.
   */
  state?: StateValue;
  /**
   * Label text (Figma prop).
   */
  text?: string;
  className?: string;
}

export interface SwitchViewProps {
  switchId: string;
  propSwitch: boolean;
  state: "default" | "hover" | "focus" | "selected";
  text?: string;
  className: string;
  switchClasses: string;
  trackClasses: string;
  thumbClasses: string;
  labelClasses: string;
  switchAriaLabel: string;
  onClick: (_e: React.MouseEvent<HTMLButtonElement>) => void;
  onKeyDown: (_e: React.KeyboardEvent<HTMLButtonElement>) => void;
  onFocus: (_e: React.FocusEvent<HTMLButtonElement>) => void;
  onBlur: (_e: React.FocusEvent<HTMLButtonElement>) => void;
}
