import { r as registerInstance, c as createEvent, h, H as Host } from './index-b1696fed.js';
import { m as messageId, P as PdsLabel, a as assignDescription } from './pds-label-62469596.js';
import { b as danger } from './index-56752d25.js';

const baseCss = ".sc-pds-radio:where(*:not(slot),*.sc-pds-radio:not(slot)::before,*.sc-pds-radio:not(slot)::after){-webkit-box-sizing:border-box;box-sizing:border-box}.sc-pds-radio:where(*:not(slot)){margin:0}.sc-pds-radio:where(img,picture.sc-pds-radio,video.sc-pds-radio,canvas.sc-pds-radio,svg).sc-pds-radio{display:block;max-width:100%}.sc-pds-radio:where(input,button.sc-pds-radio,textarea.sc-pds-radio,select).sc-pds-radio{font:inherit}.sc-pds-radio:where(p,h1.sc-pds-radio,h2.sc-pds-radio,h3.sc-pds-radio,h4.sc-pds-radio,h5.sc-pds-radio,h6).sc-pds-radio{overflow-wrap:break-word}.sc-pds-radio:where(a:not([href]):not([class])){color:currentColor;text-decoration:none}.sc-pds-radio:where(a:not([href]):not([class]):hover){color:currentColor;text-decoration:none}.sc-pds-radio:where(ul[role=list],ol[role=list]).sc-pds-radio{list-style:none}.sc-pds-radio:where(table){border-collapse:collapse;border-spacing:0}.sc-pds-radio:where(*:not(slot)){font:var(--pine-typography-body-md-default);letter-spacing:var(--pine-letter-spacing-body-md)}.sc-pds-radio:where(h1,h2.sc-pds-radio,h3.sc-pds-radio,h4.sc-pds-radio,h5.sc-pds-radio,h6).sc-pds-radio{font-family:var(--pine-font-family-heading);color:var(--pine-color-grey-950)}.sc-pds-radio:where(h1){font:var(--pine-typography-heading-h1);letter-spacing:var(--pine-letter-spacing-heading-h1)}.sc-pds-radio:where(h2){font:var(--pine-typography-heading-h2);letter-spacing:var(--pine-letter-spacing-heading-h2)}.sc-pds-radio:where(h3){font:var(--pine-typography-heading-h3);letter-spacing:var(--pine-letter-spacing-heading-h3)}.sc-pds-radio:where(h4){font:var(--pine-typography-heading-h4);letter-spacing:var(--pine-letter-spacing-heading-h4)}.sc-pds-radio:where(h5){font:var(--pine-typography-heading-h5);letter-spacing:var(--pine-letter-spacing-heading-h5)}.sc-pds-radio:where(h6){font:var(--pine-typography-heading-h6);letter-spacing:var(--pine-letter-spacing-heading-h6)}.sc-pds-radio:where(div,label.sc-pds-radio,p.sc-pds-radio,span).sc-pds-radio{color:var(--pine-color-text-default)}.sc-pds-radio:where(code,kbd.sc-pds-radio,pre.sc-pds-radio,samp).sc-pds-radio{font-family:monospace}.sc-pds-radio:where([role=button]){cursor:pointer}.sc-pds-radio:where(:focus){outline:0}.sc-pds-radio:where(:focus-visible){outline:var(--pine-border-width-thick) solid var(--pine-color-purple-500)}.sc-pds-radio:where([hidden]){display:none !important}";
const PdsRadioStyle0 = baseCss;

const pdsRadioCss = ".sc-pds-radio-h{--border-interactive-default:var(--pine-border-interactive-default);--border-interactive-hover:var(--pine-border-interactive-hover);--border-radius:var(--pine-border-radius-circle);--box-shadow-focus:0 0 0 1px #ffffff, 0 0 0 3px var(--pine-color-purple-300);--box-shadow-focus-error:0 0 0 1px #ffffff, 0 0 0 3px var(--pine-color-red-200);--color-background-checked:var(--pine-color-purple-500);--color-background-checked-hover:var(--pine-color-purple-600);--color-background-default:var(--pine-color-white);--color-background-disabled:var(--pine-color-grey-100);--color-background-hover:var(--pine-color-grey-50);--color-background-checked-invalid:var(--pine-color-red-500);--color-background-checked-invalid-hover:var(--pine-color-red-600);--color-border-checked-hover:var(--pine-color-purple-600);--color-border-disabled:var(--pine-color-grey-300);--color-border-invalid:var(--pine-color-red-500);--color-border-checked-invalid-hover:var(--pine-color-red-600);--color-text-invalid:var(--pine-color-red-500);--color-text-disabled:var(---pine-color-grey-600);--color-text-message-default:var(--pine-color-grey-800);--color-text-message-disabled:var(--pine-color-grey-500);--sizing-check-size:6px;--sizing-input-size:16px;--sizing-margin-block-start:6px;-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap}.is-invalid.sc-pds-radio-h input.sc-pds-radio{border-color:var(--color-border-invalid)}.is-invalid.sc-pds-radio-h input.sc-pds-radio:checked{background:var(--color-background-checked-invalid)}.is-invalid.sc-pds-radio-h input.sc-pds-radio:checked:hover{background:var(--color-background-checked-invalid-hover);border-color:var(--color-border-checked-invalid-hover)}.is-invalid.sc-pds-radio-h input.sc-pds-radio:focus-visible{-webkit-box-shadow:var(--box-shadow-focus-error);box-shadow:var(--box-shadow-focus-error);outline:none}.is-invalid.sc-pds-radio-h label.sc-pds-radio,.is-invalid.sc-pds-radio-h .pds-radio__message--error.sc-pds-radio{color:var(--color-text-invalid)}input.sc-pds-radio{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:var(--border-interactive-default);border-radius:var(--border-radius);height:var(--sizing-input-size);margin:0;position:relative;width:var(--sizing-input-size)}input.sc-pds-radio:hover{background:var(--color-background-hover);border:var(--border-interactive-hover)}input.sc-pds-radio:checked{background:var(--color-background-checked);border-color:var(--color-background-checked)}input.sc-pds-radio:checked:hover{background:var(--color-background-checked-hover);border-color:var(--color-border-checked-hover)}input.sc-pds-radio:checked::after{background:var(--color-background-default);border-radius:50%;content:\"\";display:block;height:var(--sizing-check-size);left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);width:var(--sizing-check-size)}input.sc-pds-radio:disabled{background:var(--color-background-disabled);border-color:var(--color-border-disabled);cursor:not-allowed}input.sc-pds-radio:disabled:checked{border-color:var(--color-border-disabled)}input.sc-pds-radio:disabled:checked::after{border-color:var(--color-border-disabled)}input.sc-pds-radio:disabled+label.sc-pds-radio{color:var(--color-border-hover);cursor:not-allowed}input.sc-pds-radio:disabled~.pds-radio__message.sc-pds-radio{color:var(--color-text-message-disabled)}input.sc-pds-radio:focus-visible{-webkit-box-shadow:var(--box-shadow-focus);box-shadow:var(--box-shadow-focus);outline:none}label.sc-pds-radio{font-weight:var(--pine-font-weight-body-medium);-webkit-margin-start:10px;margin-inline-start:10px}.pds-radio__message.sc-pds-radio{color:var(--pine-color-grey-700);-webkit-margin-before:var(--sizing-margin-block-start);margin-block-start:var(--sizing-margin-block-start);-webkit-margin-start:26px;margin-inline-start:26px;width:100%}.pds-radio__message--error.sc-pds-radio{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;font-size:var(--pine-font-size-085);gap:var(--pine-spacing-050)}";
const PdsRadioStyle1 = pdsRadioCss;

const PdsRadio = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.pdsRadioChange = createEvent(this, "pdsRadioChange", 7);
        this.handleRadioChange = (e) => {
            if (this.disabled) {
                return;
            }
            const target = e.target;
            const isChecked = target.checked;
            this.pdsRadioChange.emit(isChecked);
        };
        this.checked = false;
        this.componentId = undefined;
        this.disabled = false;
        this.errorMessage = undefined;
        this.helperMessage = undefined;
        this.invalid = false;
        this.label = undefined;
        this.name = undefined;
        this.required = false;
        this.value = undefined;
    }
    classNames() {
        const classNames = [];
        if (this.invalid) {
            classNames.push('is-invalid');
        }
        if (this.disabled) {
            classNames.push('is-disabled');
        }
        return classNames.join('  ');
    }
    render() {
        return (h(Host, { key: '1e65b437028814fdd4d03f5061140725e9004757', class: this.classNames() }, h("input", { key: '5f4789365bdc2cfdc0a46623dc71dea8f0f1020d', "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage), "aria-invalid": this.invalid ? "true" : undefined, type: "radio", id: this.componentId, name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onChange: this.handleRadioChange }), h(PdsLabel, { key: 'd9dc6f65cb3c10bd2b89fd741d224e027bd6506d', htmlFor: this.componentId, text: this.label }), this.helperMessage &&
            h("div", { key: 'e3e26f4899dc7b9540f6542970da67c51d45c92d', class: 'pds-radio__message', id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
            h("div", { key: 'eccaa4397a33b4bee144233c8e18c0be0b2ec20c', class: `pds-radio__message pds-radio__message--error`, id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, h("pds-icon", { key: '9d22c23b9587a026827acac24d20ca1e7afcb5d3', icon: danger, size: "small" }), this.errorMessage)));
    }
};
PdsRadio.style = PdsRadioStyle0 + PdsRadioStyle1;

export { PdsRadio as pds_radio };

//# sourceMappingURL=pds-radio.entry.js.map