import { h } from '@stencil/core';
export class EclListIllustrationItem {
  constructor() {
    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)))));
  }
  static get is() { return "ecl-list-illustration-item"; }
  static get properties() {
    return {
      "theme": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "theme",
        "reflect": false,
        "defaultValue": "'ec'"
      },
      "itemTitle": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "item-title",
        "reflect": false
      },
      "image": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "image",
        "reflect": false
      },
      "icon": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "icon",
        "reflect": false
      },
      "imageAlt": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "image-alt",
        "reflect": false
      },
      "squareImage": {
        "type": "boolean",
        "mutable": false,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "square-image",
        "reflect": false,
        "defaultValue": "false"
      },
      "styleClass": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "style-class",
        "reflect": false
      }
    };
  }
}
//# sourceMappingURL=ecl-list-illustration-item.js.map
