'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-a1121663.js');

const dvnRadioCss = "dvn-radio label{cursor:pointer;user-select:none;position:relative;vertical-align:top;display:block}dvn-radio label:hover:not(:disabled) .input:checked~.check-mark{box-shadow:0px 0px 0px var(--border-width) var(--base-color) inset, 0px 0px 8px var(--base-color)}dvn-radio label:hover:not(:disabled) .input:not(:checked)~.check-mark{box-shadow:0px 0px 0px 1px var(--base-color-light) inset}dvn-radio label:disabled{cursor:no-drop;color:var(--color-disabled)}dvn-radio label.inline{display:inline-block;margin-right:calc(4 * var(--spacing-unit))}dvn-radio label.leaned{margin:0}dvn-radio label.leaned .check-mark{left:0 !important}dvn-radio label.leaned.small{padding:4px 0 4px 18px}dvn-radio label.leaned.medium{padding:6px 0 6px 22px}dvn-radio label.leaned.large{padding:8px 0 8px 26px}dvn-radio label.small{padding:4px 4px 4px 22px}dvn-radio label.medium{padding:6px 6px 6px 28px}dvn-radio label.large{padding:8px 8px 8px 34px}dvn-radio label.neutral{--base-color:var(--color-neutral);--base-color-light:var(--color-neutral-light)}dvn-radio label.primary{--base-color:var(--color-primary);--base-color-light:var(--color-primary-light)}dvn-radio label.secondary{--base-color:var(--color-secondary);--base-color-light:var(--color-secondary-light)}dvn-radio label.warning{--base-color:var(--color-warning);--base-color-light:var(--color-warning-light)}dvn-radio label.danger{--base-color:var(--color-danger);--base-color-light:var(--color-danger-light)}dvn-radio label.small .check-mark{height:calc(3 * var(--spacing-unit));width:calc(3 * var(--spacing-unit));left:var(--spacing-unit);--border-width:var(--spacing-unit)}dvn-radio label.medium .check-mark{height:calc(4 * var(--spacing-unit));width:calc(4 * var(--spacing-unit));left:var(--spacing-unit);--border-width:calc(3 / 2 * var(--spacing-unit))}dvn-radio label.large .check-mark{height:calc(5 * var(--spacing-unit));width:calc(5 * var(--spacing-unit));left:var(--spacing-unit);--border-width:calc(5 / 3 * var(--spacing-unit))}dvn-radio input{opacity:0;position:absolute;cursor:pointer}dvn-radio input:disabled{cursor:no-drop}dvn-radio input:checked:not(:disabled)~.check-mark{box-shadow:0px 0px 0px var(--border-width) var(--base-color) inset}dvn-radio input:checked:disabled~.check-mark{box-shadow:0px 0px 0px var(--border-width) var(--color-disabled) inset}dvn-radio input:checked~.check-mark:after{display:block}dvn-radio input:focus:not(:disabled)~.check-mark{box-shadow:0px 0px 0px var(--border-width) var(--base-color) inset, 0px 0px 5px var(--base-color)}dvn-radio .check-mark{top:0;bottom:0;margin:auto;position:absolute;border-radius:50%;transition:all .3s;box-sizing:border-box;background-color:var(--color-input-background);box-shadow:0px 0px 0px 1px var(--color-border) inset}dvn-radio .check-mark:after{content:\"\";position:absolute;display:none}";

const DvnRadio = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.scale = 'medium';
    this.tint = 'primary';
    this.disabled = false;
    this.checked = false;
    this.inline = false;
    this.leaned = false;
  }
  render() {
    return (index.h(index.Host, null, index.h("label", { class: {
        [this.scale]: true,
        [this.tint]: true,
        inline: this.inline,
        leaned: this.leaned,
      } }, this.label, index.h("input", { class: "input", type: "radio", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled }), index.h("span", { class: "check-mark" }))));
  }
};
DvnRadio.style = dvnRadioCss;

const DvnRadioGroup = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.change = index.createEvent(this, "change", 7);
    this.scale = 'medium';
    this.disabled = false;
    this.leaned = false;
    this.inline = false;
    this.options = [];
  }
  render() {
    const checkName = name || Math.random().toString(36).substr(2, 5);
    return (index.h(index.Host, null, this.options.map(option => (index.h("dvn-radio", { checked: this.value === option.value, disabled: this.disabled || option.disabled, inline: this.inline, label: option.label, leaned: !this.inline, name: checkName, onChange: (e) => {
        e.stopPropagation();
        this.change.emit(option.value);
      }, scale: this.scale, value: option.value })))));
  }
};

exports.dvn_radio = DvnRadio;
exports.dvn_radio_group = DvnRadioGroup;
