import { useCssModule as d, openBlock as i, createElementBlock as c, normalizeClass as a, withDirectives as u, createElementVNode as s, mergeProps as _, vModelRadio as m, toDisplayString as h } from "vue";
import { _ as f } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const p = "_root_QaWcY", b = "_label_N79We", k = "_error_W_XaQ", v = "_input_OFL4v", y = {
  root: p,
  label: b,
  error: k,
  input: v
}, g = {
  name: "ll-radio",
  props: {
    /**
     * The checked/selected state of the radio button
     */
    checked: {
      type: [String, Number],
      default: void 0
    },
    /**
     * @deprecated Use :checked or v-model:checked instead of :model-value and v-model.
     */
    modelValue: {
      type: [String, Number, null],
      default: null,
      validator(e) {
        if (e !== null)
          throw new Error("ll-radio: use :checked or v-model:checked instead of :model-value and v-model.");
        return !0;
      }
    },
    /**
     * Adds error styling
     */
    hasError: Boolean,
    /**
     * A unique string to distinguish one Radio instance from another
     * and to link the label to the input; required for accessibility
     */
    id: {
      type: String,
      required: !0
    },
    /**
     * The description which appears to the right of the radio button
     */
    label: {
      type: String,
      default: ""
    }
  },
  emits: ["update:checked"],
  setup() {
    return {
      classes: d()
    };
  },
  computed: {
    internalValue: {
      get() {
        return this.checked;
      },
      set(e) {
        this.$emit("update:checked", e);
      }
    }
  },
  created() {
    if (this.$attrs.onChange)
      throw new Error("ll-radio: use the @update:checked event instead of @input");
  }
}, E = ["id"], V = ["for"];
function w(e, l, t, r, M, o) {
  return i(), c("div", {
    class: a(["stash-radio", [r.classes.root, { error: t.hasError }]]),
    "data-test": "ll-radio"
  }, [
    u(s("input", _({
      id: t.id,
      "onUpdate:modelValue": l[0] || (l[0] = (n) => o.internalValue = n),
      class: ["sr-only", r.classes.input],
      type: "radio"
    }, e.$attrs), null, 16, E), [
      [m, o.internalValue]
    ]),
    s("label", {
      for: t.id,
      class: a(r.classes.label)
    }, h(t.label), 11, V)
  ], 2);
}
const S = {
  $style: y
}, C = /* @__PURE__ */ f(g, [["render", w], ["__cssModules", S]]);
export {
  C as default
};
//# sourceMappingURL=Radio.js.map
