import { defineComponent as n, computed as r, openBlock as t, createBlock as i, resolveDynamicComponent as d, normalizeClass as c, withCtx as f, renderSlot as p, createElementBlock as a, toDisplayString as u, unref as m, createCommentVNode as y } from "vue";
import { t as b } from "./locale.js";
const h = {
  key: 0,
  class: "font-semibold text-red-500",
  title: "Required",
  "aria-label": "required"
}, _ = {
  key: 1,
  class: "text-ice-700"
}, g = /* @__PURE__ */ n({
  __name: "Label",
  props: {
    for: { default: void 0 },
    hasError: { type: Boolean, default: !1 },
    isRequired: { type: Boolean, default: !1 },
    showOptional: { type: Boolean, default: !1 },
    legend: { type: Boolean, default: !1 },
    disabled: { type: Boolean },
    isSrOnly: { type: Boolean, default: !1 }
  },
  setup(l) {
    const e = l, o = r(() => e.legend ? "legend" : "label");
    return (s, B) => (t(), i(d(o.value), {
      class: c(["stash-label block truncate text-sm font-medium leading-6", {
        "animate-shake": e.hasError,
        "stash-label--disabled text-ice-700": e.disabled,
        "text-ice-900": !e.disabled,
        "sr-only": e.isSrOnly
      }]),
      for: e.for,
      "data-test": "stash-label"
    }, {
      default: f(() => [
        p(s.$slots, "default"),
        e.isRequired ? (t(), a("span", h, " * ")) : e.showOptional ? (t(), a("span", _, " (" + u(m(b)("ll.optional")) + ")", 1)) : y("", !0)
      ]),
      _: 3
    }, 8, ["class", "for"]));
  }
});
export {
  g as _
};
//# sourceMappingURL=Label.vue_vue_type_script_setup_true_lang-WIpehdiu.js.map
