import { Component, Host, h, Prop, Event } from '@stencil/core';
export class UxplChiplet {
  constructor() {
    /**
    * Show close button
    */
    this.showClose = false;
    /**
    * Type (classic/square)
    */
    this.type = 'square';
  }
  doClose() {
    this.closed.emit();
  }
  render() {
    return (h(Host, null,
      h("div", { class: "chip-container", part: "chip-container" },
        h("div", { class: {
            "chiplet": true,
            "square": this.type.toLowerCase() === 'square',
            "classic": this.type.toLowerCase() === 'classic',
          }, style: {
            "color": this.textColor ? this.textColor : undefined,
            "backgroundColor": this.backgroundColor ? this.backgroundColor : undefined
          }, part: "chiplet" },
          h("slot", null),
          this.showClose ?
            h("uxpl-icon", { class: "close-button", part: "close-button", size: "10px", icon: "pl-icon-close", color: this.closeButtonColor, onClick: () => this.doClose() })
            :
              undefined))));
  }
  static get is() { return "uxpl-chiplet"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["uxpl-chiplet.css"]
  }; }
  static get styleUrls() { return {
    "$": ["uxpl-chiplet.css"]
  }; }
  static get properties() { return {
    "backgroundColor": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Background color of the chiplet."
      },
      "attribute": "background-color",
      "reflect": false
    },
    "textColor": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Text color of the chiplet."
      },
      "attribute": "text-color",
      "reflect": false
    },
    "showClose": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Show close button"
      },
      "attribute": "show-close",
      "reflect": false,
      "defaultValue": "false"
    },
    "closeButtonColor": {
      "type": "any",
      "mutable": false,
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Close button color"
      },
      "attribute": "close-button-color",
      "reflect": false
    },
    "type": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Type (classic/square)"
      },
      "attribute": "type",
      "reflect": false,
      "defaultValue": "'square'"
    }
  }; }
  static get events() { return [{
      "method": "closed",
      "name": "closed",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [],
        "text": "Emitted when the chiplet close button is clicked"
      },
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      }
    }]; }
}
