import { defineComponent as f, useCssModule as b, openBlock as r, createElementBlock as d, normalizeClass as n, unref as a, renderSlot as u, withModifiers as c, withKeys as v, createVNode as C, createCommentVNode as _ } from "vue";
import { getColorScheme as y } from "@leaflink/stash-utils/colorScheme";
import z from "./Icon.js";
import { _ as $ } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const k = ["disabled"], x = /* @__PURE__ */ f({
  name: "ll-chip",
  __name: "Chip",
  props: {
    colorScheme: { default: "ice" },
    shade: { default: "light" },
    size: { default: "medium" },
    radius: { default: "standard" },
    bgColor: { default: void 0 },
    textColor: { default: void 0 },
    isRemovable: { type: Boolean, default: !1 },
    shouldOverrideColors: { type: Boolean, default: !1 },
    disabled: { type: Boolean, default: !1 }
  },
  emits: ["click", "remove"],
  setup(m, { emit: p }) {
    const e = m, i = p, s = b();
    function h() {
      const { computedBgColor: t, computedTextColor: o } = y({
        shade: e.shade,
        color: e.colorScheme
      }), l = `text-${e.textColor || o} bg-${e.bgColor || t}`;
      return {
        "rounded-none": e.radius === "none",
        "rounded-xs": e.radius === "standard",
        "rounded-full": e.radius === "pill",
        [l]: !e.shouldOverrideColors && !e.disabled,
        "bg-ice-500 text-white": e.disabled
      };
    }
    return (t, o) => (r(), d("span", {
      class: n(["stash-chip relative inline-flex items-center", [
        `stash-chip--radius-${e.radius}`,
        `stash-chip--size-${e.size}`,
        `stash-chip--shade-${e.shade}`,
        a(s).root,
        a(s).removableChip,
        a(s)[`size-${e.size}`],
        h()
      ]]),
      "data-test": "stash-chip",
      onClick: o[2] || (o[2] = (l) => i("click"))
    }, [
      m.isRemovable ? (r(), d("span", {
        key: 0,
        class: n([{ "mr-6 truncate": e.isRemovable }])
      }, [
        u(t.$slots, "default")
      ], 2)) : u(t.$slots, "default", { key: 1 }),
      e.isRemovable ? (r(), d("button", {
        key: 2,
        tabindex: "-1",
        class: n(["stash-chip__remove-button", ["absolute", a(s)["remove-button"]]]),
        "data-test": "stash-chip|remove-button",
        disabled: e.disabled,
        onKeypress: o[0] || (o[0] = v(c((l) => i("remove"), ["prevent"]), ["enter"])),
        onMousedown: o[1] || (o[1] = c((l) => i("remove"), ["prevent", "stop"]))
      }, [
        C(z, {
          "data-test": "icon|close",
          name: "close",
          size: "small"
        })
      ], 42, k)) : _("", !0)
    ], 2));
  }
}), g = "_root_mkIpj", B = {
  root: g,
  "size-medium": "_size-medium_K--Tj",
  "size-small": "_size-small_oKwqV",
  "remove-button": "_remove-button_Bz9gP"
}, S = {
  $style: B
}, V = /* @__PURE__ */ $(x, [["__cssModules", S]]);
export {
  V as default
};
//# sourceMappingURL=Chip.js.map
