import { r as registerInstance, h } from './index-0a3acb15.js';

const EclListIllustrationItem = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.theme = 'ec';
    this.itemTitle = undefined;
    this.image = undefined;
    this.icon = undefined;
    this.imageAlt = undefined;
    this.squareImage = false;
    this.styleClass = undefined;
  }
  getClass() {
    const styleClasses = [
      `sc-ecl-list-illustration-${this.theme}`,
      `ecl-list-illustration__item`,
      this.styleClass
    ];
    return styleClasses.join(' ');
  }
  getImgClass() {
    const imgClasses = [
      `sc-ecl-list-illustration-${this.theme}`,
      `ecl-list-illustration__image`,
    ];
    if (this.squareImage) {
      imgClasses.push('ecl-list-illustration__image--square');
    }
    return imgClasses.join(' ');
  }
  getImgAttr() {
    const attrs = {
      role: 'img',
    };
    if (this.imageAlt) {
      attrs['aria-label'] = this.imageAlt;
    }
    return attrs;
  }
  render() {
    return (h("div", { class: this.getClass() }, this.image ?
      h("div", Object.assign({ class: this.getImgClass(), style: { backgroundImage: "url(" + this.image + ")" } }, this.getImgAttr())) : '', h("div", { class: `ecl-list-illustration__detail sc-ecl-list-illustration-${this.theme}` }, h("div", { class: `ecl-list-illustration__title-container sc-ecl-list-illustration-${this.theme}` }, this.icon ?
      h("ecl-icon", { icon: this.icon, size: "xl", "style-class": `ecl-list-illustration__icon sc-ecl-list-illustration-${this.theme}` }) : '', this.itemTitle ?
      h("div", { class: `ecl-list-illustration__title sc-ecl-list-illustration-${this.theme}` }, this.itemTitle) : ''), h("div", { class: `ecl-list-illustration__description sc-ecl-list-illustration-${this.theme}` }, h("slot", null)))));
  }
};

export { EclListIllustrationItem as ecl_list_illustration_item };

//# sourceMappingURL=ecl-list-illustration-item.entry.js.map