import { b as TailwindStyledElement, x } from '../../chunks/index-5X9ujrWL.js';
import { n } from '../../chunks/property-DfumgIL6.js';
import { c as ce } from '../../chunks/index-B9iart53.js';
import { s as safeCustomElement } from '../../chunks/safe-custom-element-qdGIR_v6.js';
import { c as customStyleMap } from '../../chunks/index-CZGvLdJ0.js';

const style = ":host {\n    display: inline-flex\n}";

var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __decorateClass = (decorators, target, key, kind) => {
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
    if (decorator = decorators[i])
      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  if (kind && result) __defProp(target, key, result);
  return result;
};
let LuksoTag = class extends TailwindStyledElement(style) {
  constructor() {
    super(...arguments);
    this.size = "small";
    this.isRounded = false;
    this.backgroundColor = "";
    this.borderColor = "";
    this.textColor = "";
    this.tagStyles = ce({
      base: "inline-flex items-center justify-center border border-neutral-20 text-neutral-20 px-2 whitespace-nowrap",
      variants: {
        size: {
          "x-small": "font-inter text-8 font-500 leading-20 h-[20px] px-1 rounded-4",
          small: "paragraph-inter-12-medium h-7 px-2 rounded-8",
          large: "paragraph-inter-14-medium h-[34px] px-4 rounded-8"
        },
        isRounded: {
          true: "rounded-[56px]"
        }
      },
      compoundVariants: [
        {
          size: "small",
          isRounded: true,
          class: "px-3"
        },
        {
          size: "x-small",
          isRounded: true,
          class: "px-2"
        }
      ]
    });
  }
  resolveBorderColor() {
    if (this.borderColor) {
      return this.borderColor;
    }
    if (this.backgroundColor) {
      return this.backgroundColor;
    }
  }
  render() {
    const tagStyles = this.tagStyles({
      size: this.size,
      isRounded: this.isRounded
    });
    return x`
      <div
        data-testid="tag"
        class=${tagStyles}
        style=${customStyleMap({
      [`background-color: var(--${this.backgroundColor})`]: !!this.backgroundColor,
      [`border-color: var(--${this.resolveBorderColor()})`]: !!this.resolveBorderColor(),
      [`color: var(--${this.textColor})`]: !!this.textColor
    })}
      >
        <slot></slot>
      </div>
    `;
  }
};
__decorateClass([
  n({ type: String })
], LuksoTag.prototype, "size", 2);
__decorateClass([
  n({ type: Boolean, attribute: "is-rounded" })
], LuksoTag.prototype, "isRounded", 2);
__decorateClass([
  n({ type: String, attribute: "background-color" })
], LuksoTag.prototype, "backgroundColor", 2);
__decorateClass([
  n({ type: String, attribute: "border-color" })
], LuksoTag.prototype, "borderColor", 2);
__decorateClass([
  n({ type: String, attribute: "text-color" })
], LuksoTag.prototype, "textColor", 2);
LuksoTag = __decorateClass([
  safeCustomElement("lukso-tag")
], LuksoTag);

export { LuksoTag };
