/**
 * @license
 * Copyright (c) 2017 - 2026 Vaadin Ltd.
 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
 */
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
import { type RadioButtonEventMap, RadioButtonMixin } from './vaadin-radio-button-mixin.js';

export * from './vaadin-radio-button-mixin.js';

/**
 * `<vaadin-radio-button>` is a web component representing a choice in a radio group.
 * Only one radio button in the group can be selected at the same time.
 *
 * ```html
 * <vaadin-radio-group label="Travel class">
 *   <vaadin-radio-button value="economy" label="Economy"></vaadin-radio-button>
 *   <vaadin-radio-button value="business" label="Business"></vaadin-radio-button>
 *   <vaadin-radio-button value="firstClass" label="First Class"></vaadin-radio-button>
 * </vaadin-radio-group>
 * ```
 *
 * ### Styling
 *
 * The following shadow DOM parts are available for styling:
 *
 * Part name   | Description
 * ------------|----------------
 * `radio`     | The wrapper element which contains slotted `<input type="radio">`.
 *
 * The following state attributes are available for styling:
 *
 * Attribute    | Description
 * -------------|--------------------------
 * `active`     | Set when the radio button is pressed, either with a pointer or the keyboard.
 * `disabled`   | Set when the radio button is disabled.
 * `focus-ring` | Set when the radio button is focused using the keyboard.
 * `focused`    | Set when the radio button is focused.
 * `checked`    | Set when the radio button is checked.
 * `has-label`  | Set when the radio button has a label.
 *
 * The following custom CSS properties are available for styling:
 *
 * Custom CSS property                          |
 * :--------------------------------------------|
 * | `--vaadin-radio-button-background`         |
 * | `--vaadin-radio-button-border-color`       |
 * | `--vaadin-radio-button-border-width`       |
 * | `--vaadin-radio-button-gap`                |
 * | `--vaadin-radio-button-label-color`        |
 * | `--vaadin-radio-button-label-font-size`    |
 * | `--vaadin-radio-button-label-font-weight`  |
 * | `--vaadin-radio-button-label-line-height`  |
 * | `--vaadin-radio-button-marker-color`       |
 * | `--vaadin-radio-button-marker-size`        |
 * | `--vaadin-radio-button-size`               |
 *
 * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
 *
 * @fires {CustomEvent} checked-changed - Fired when the `checked` property changes.
 */
declare class RadioButton extends RadioButtonMixin(ElementMixin(ThemableMixin(HTMLElement))) {
  addEventListener<K extends keyof RadioButtonEventMap>(
    type: K,
    listener: (this: RadioButton, ev: RadioButtonEventMap[K]) => void,
    options?: AddEventListenerOptions | boolean,
  ): void;

  removeEventListener<K extends keyof RadioButtonEventMap>(
    type: K,
    listener: (this: RadioButton, ev: RadioButtonEventMap[K]) => void,
    options?: EventListenerOptions | boolean,
  ): void;
}

declare global {
  interface HTMLElementTagNameMap {
    'vaadin-radio-button': RadioButton;
  }
}

export { RadioButton };
