var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { MelodicComponent } from '@melodicdev/core';
import { radioTemplate } from './radio.template.js';
import { radioStyles } from './radio.styles.js';
/**
 * ml-radio - Radio input component
 *
 * @example
 * ```html
 * <ml-radio name="choice" value="a" label="Option A"></ml-radio>
 * <ml-radio name="choice" value="b" label="Option B" checked></ml-radio>
 * ```
 *
 * @fires ml:change - Emitted when selected
 */
let RadioComponent = class RadioComponent {
    constructor() {
        /** Radio group name */
        this.name = '';
        /** Radio value */
        this.value = '';
        /** Radio label */
        this.label = '';
        /** Hint text */
        this.hint = '';
        /** Radio size */
        this.size = 'md';
        /** Checked state */
        this.checked = false;
        /** Disabled state */
        this.disabled = false;
        this.handleChange = () => {
            this.checked = true;
            this.elementRef.dispatchEvent(new CustomEvent('ml:change', {
                bubbles: true,
                composed: true,
                detail: { value: this.value, checked: true }
            }));
        };
    }
};
RadioComponent = __decorate([
    MelodicComponent({
        selector: 'ml-radio',
        template: radioTemplate,
        styles: radioStyles,
        attributes: ['name', 'value', 'label', 'hint', 'size', 'checked', 'disabled']
    })
], RadioComponent);
export { RadioComponent };
