import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
import { d as defineCustomElement$2 } from './klevu-typography2.js';

const klevuBadgeCss = ":host{--background:var(--klevu-badge-background, var(--klevu-color-accent-1));--border-radius:var(--klevu-badge-border-radius, var(--klevu-border-radius-xxl));display:inline-block}div{display:inline-block;padding:var(--klevu-spacing-02) var(--klevu-spacing-05);background:var(--background);border-radius:var(--border-radius);align-items:center}klevu-icon{position:relative;top:1px;left:-4px;font-size:0.7em;margin-right:var(--klevu-spacing-01)}klevu-typography{line-height:1}";

const KlevuBadge$1 = /*@__PURE__*/ proxyCustomElement(class KlevuBadge extends HTMLElement {
  constructor() {
    super();
    this.__registerHost();
    this.__attachShadow();
    this.accent = undefined;
    this.neutral = undefined;
  }
  render() {
    let style = {};
    if (this.accent || this.neutral) {
      style = {
        "--background": this.accent
          ? `var(--klevu-color-accent-${this.accent})`
          : `var(--klevu-color-neutral-${this.neutral})`,
        "--klevu-typography-color": this.neutral && this.neutral > 6 ? "var(--klevu-color-neutral-1)" : "var(--klevu-typography-color)",
      };
    }
    return (h("div", { style: style, part: "badge-base" }, h("klevu-typography", { variant: "body-xs" }, h("span", { part: "badge-content" }, h("slot", null)))));
  }
  static get style() { return klevuBadgeCss; }
}, [1, "klevu-badge", {
    "accent": [2],
    "neutral": [2]
  }]);
function defineCustomElement$1() {
  if (typeof customElements === "undefined") {
    return;
  }
  const components = ["klevu-badge", "klevu-typography"];
  components.forEach(tagName => { switch (tagName) {
    case "klevu-badge":
      if (!customElements.get(tagName)) {
        customElements.define(tagName, KlevuBadge$1);
      }
      break;
    case "klevu-typography":
      if (!customElements.get(tagName)) {
        defineCustomElement$2();
      }
      break;
  } });
}
defineCustomElement$1();

const KlevuBadge = KlevuBadge$1;
const defineCustomElement = defineCustomElement$1;

export { KlevuBadge, defineCustomElement };

//# sourceMappingURL=klevu-badge.js.map