import { defineComponent as b, useCssModule as $, inject as C, openBlock as p, createElementBlock as h, normalizeClass as o, unref as t, createElementVNode as n, renderSlot as k, createTextVNode as M, toDisplayString as y, withDirectives as w, vShow as g, computed as c, createBlock as D, resolveDynamicComponent as N, withCtx as R } from "vue";
import { R as W } from "./RadioGroup.keys-CqfiKkNz.js";
import { _ as V } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const T = ["id", "name", "value", "checked", "disabled"], E = ["for"], F = /* @__PURE__ */ b({
  __name: "VariantButton",
  props: {
    disabled: { type: Boolean },
    fullWidth: { type: Boolean },
    id: {},
    label: {},
    modelValue: {},
    name: {},
    value: {}
  },
  emits: ["input"],
  setup(s, { emit: u }) {
    const e = s, l = $(), a = C(W.key), r = u;
    return (d, i) => {
      var _, v;
      return p(), h("div", {
        "data-variant-button": "",
        class: o([
          t(l).root,
          {
            "w-full": e.fullWidth,
            [t(l)["radio-group-vertical-orientation"]]: ((v = (_ = t(a)) == null ? void 0 : _.orientation) == null ? void 0 : v.value) === "vertical"
          }
        ])
      }, [
        n("input", {
          id: `${e.name}-${e.id}`,
          class: o(["sr-only", t(l).input]),
          type: "radio",
          name: e.name,
          value: e.value,
          checked: e.modelValue === e.value,
          disabled: e.disabled || e.disabled,
          onInput: i[0] || (i[0] = (B) => r("input", B))
        }, null, 42, T),
        n("label", {
          class: o(t(l).label),
          for: `${e.name}-${e.id}`
        }, [
          k(d.$slots, "default", {}, () => [
            M(y(e.label), 1)
          ])
        ], 10, E)
      ], 2);
    };
  }
}), O = "_label_DRkCk", P = "_root_GWg9s", S = "_input_uXvFM", U = {
  label: O,
  root: P,
  "radio-group-vertical-orientation": "_radio-group-vertical-orientation_wL8gH",
  input: S
}, z = {
  $style: U
}, A = /* @__PURE__ */ V(F, [["__cssModules", z]]), H = ["id", "name", "value", "checked", "disabled"], Q = ["for"], X = /* @__PURE__ */ b({
  __name: "VariantChip",
  props: {
    disabled: { type: Boolean },
    fullWidth: { type: Boolean },
    id: {},
    label: {},
    modelValue: {},
    name: {},
    value: {}
  },
  emits: ["input"],
  setup(s, { emit: u }) {
    const e = s, l = $(), a = u;
    return (r, d) => (p(), h("div", {
      class: o([t(l).root, { "w-full": e.fullWidth }])
    }, [
      n("input", {
        id: `${e.name}-${e.id}`,
        class: o(["sr-only", t(l).input]),
        type: "radio",
        name: e.name,
        value: e.value,
        checked: e.modelValue === e.value,
        disabled: e.disabled || e.disabled,
        onInput: d[0] || (d[0] = (i) => a("input", i))
      }, null, 42, H),
      n("label", {
        class: o(t(l).label),
        for: `${e.name}-${e.id}`
      }, y(e.label), 11, Q)
    ], 2));
  }
}), J = "_label_Ft1ne", L = "_input_95Uf3", q = {
  label: J,
  input: L
}, K = {
  $style: q
}, Y = /* @__PURE__ */ V(X, [["__cssModules", K]]), Z = ["id", "name", "value", "checked", "disabled"], I = ["for"], j = /* @__PURE__ */ b({
  __name: "VariantRadio",
  props: {
    disabled: { type: Boolean },
    fullWidth: { type: Boolean },
    id: {},
    label: {},
    modelValue: {},
    name: {},
    value: {}
  },
  emits: ["input"],
  setup(s, { emit: u }) {
    const e = s, l = $(), a = u;
    return (r, d) => (p(), h("div", {
      class: o(["flex", [t(l).root, { "w-full": e.fullWidth }]])
    }, [
      n("input", {
        id: `${e.name}-${e.id}`,
        class: o(t(l).input),
        type: "radio",
        name: e.name,
        value: e.value,
        checked: e.modelValue === e.value,
        disabled: e.disabled,
        onInput: d[0] || (d[0] = (i) => a("input", i))
      }, null, 42, Z),
      w(n("label", {
        class: o([t(l).label, { "text-ice-500": e.disabled }]),
        for: `${e.name}-${e.id}`
      }, y(e.label), 11, I), [
        [g, e.label]
      ])
    ], 2));
  }
}), G = "_label_6mXeQ", ee = "_input_yPU5h", le = {
  label: G,
  input: ee
}, ae = {
  $style: le
}, te = /* @__PURE__ */ V(j, [["__cssModules", ae]]), se = ["for"], oe = ["id", "aria-labelledby", "name", "value", "checked", "disabled"], de = ["id"], ie = /* @__PURE__ */ b({
  __name: "VariantTile",
  props: {
    disabled: { type: Boolean },
    fullWidth: { type: Boolean },
    id: {},
    label: {},
    modelValue: {},
    name: {},
    value: {}
  },
  emits: ["input"],
  setup(s, { emit: u }) {
    const e = s, l = $(), a = u;
    return (r, d) => (p(), h("label", {
      class: o([t(l).root, { "w-full": e.fullWidth, [t(l)["root--disabled"]]: e.disabled }]),
      for: `${e.name}-${e.id}`
    }, [
      n("div", {
        class: o(["flex border", [
          t(l)["tile-header"],
          {
            "border-blue-500 bg-blue-100": e.modelValue === e.value && !e.disabled,
            "border-ice-500 bg-ice-100": e.modelValue !== e.value || e.disabled
          }
        ]])
      }, [
        n("input", {
          id: `${e.name}-${e.id}`,
          "aria-labelledby": `tile-label-${e.name}-${e.id}`,
          class: o(t(l).input),
          type: "radio",
          name: e.name,
          value: e.value,
          checked: e.modelValue === e.value,
          disabled: e.disabled,
          onInput: d[0] || (d[0] = (i) => a("input", i))
        }, null, 42, oe),
        n("div", {
          id: `tile-label-${e.name}-${e.id}`,
          class: o([t(l).label, { "text-ice-500": e.disabled }])
        }, y(e.label), 11, de)
      ], 2),
      n("div", {
        class: o([
          t(l)["tile-body"],
          {
            "border-ice-500": e.modelValue !== e.value || e.disabled,
            "border-blue-500": e.modelValue === e.value && !e.disabled
          }
        ])
      }, [
        k(r.$slots, "default")
      ], 2)
    ], 10, se));
  }
}), ne = "_root_zO_vp", ue = "_label_HSC5h", re = "_input_nxlD1", ce = {
  root: ne,
  "root--disabled": "_root--disabled_9FxpA",
  "tile-header": "_tile-header_Fujbs",
  "tile-body": "_tile-body_PrPuQ",
  label: ue,
  input: re
}, me = {
  $style: ce
}, be = /* @__PURE__ */ V(ie, [["__cssModules", me]]);
var m = /* @__PURE__ */ ((s) => (s.Radio = "radio", s.Button = "button", s.Chip = "chip", s.Tile = "tile", s))(m || {});
const $e = /* @__PURE__ */ b({
  __name: "RadioNew",
  props: {
    name: { default: void 0 },
    disabled: { type: Boolean, default: !1 },
    fullWidth: { type: Boolean, default: !1 },
    id: {},
    modelValue: { default: void 0 },
    hasError: { type: Boolean, default: !1 },
    label: { default: "" },
    variant: { default: void 0 },
    value: {}
  },
  emits: ["update:modelValue"],
  setup(s, { emit: u }) {
    const e = {
      [m.Button]: A,
      [m.Chip]: Y,
      [m.Radio]: te,
      [m.Tile]: be
    }, l = C(W.key, null), a = s, r = c(() => a.modelValue || (l == null ? void 0 : l.modelValue.value)), d = c(() => a.name || (l == null ? void 0 : l.name.value)), i = c(() => a.fullWidth || (l == null ? void 0 : l.fullWidth.value)), _ = c(() => a.disabled || (l == null ? void 0 : l.disabled.value)), v = c(() => a.variant || (l == null ? void 0 : l.variant.value) || "radio"), B = u;
    function x(f) {
      if (l != null && l.update) {
        l.update(f);
        return;
      }
      B("update:modelValue", f.target.value);
    }
    return (f, pe) => (p(), D(N(e[v.value]), {
      id: a.id,
      disabled: _.value,
      "has-error": a.hasError,
      "full-width": i.value,
      label: a.label,
      "model-value": r.value,
      name: d.value,
      value: a.value,
      onInput: x
    }, {
      default: R(() => [
        k(f.$slots, "default")
      ]),
      _: 3
    }, 40, ["id", "disabled", "has-error", "full-width", "label", "model-value", "name", "value"]));
  }
});
export {
  m as RadioVariant,
  $e as default
};
//# sourceMappingURL=RadioNew.js.map
