import { Component, Host, h, Prop, State } from '@stencil/core';
export class SupportingText {
  constructor() {
    //@State() message: AbdsFormSupportingText = { text: null, type: null };
    this.messageType = null;
  }
  componentWillRender() {
    if (this.errorText)
      this.messageType = 'error';
    else if (this.helperText)
      this.messageType = 'information';
    else
      this.messageType = null;
  }
  render() {
    /** there are two separate span elements to accommodate the ease-in transition */
    return (h(Host, null,
      h("span", { class: { 'error-text': true, ['active']: this.messageType === 'error' } }, this.errorText),
      h("span", { class: { 'default-text': true, ['active']: this.messageType !== 'error' } }, this.helperText)));
  }
  static get is() { return "abds-supporting-text"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["supporting-text.css"]
  }; }
  static get styleUrls() { return {
    "$": ["supporting-text.css"]
  }; }
  static get properties() { return {
    "errorText": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "text of the error message"
      },
      "attribute": "error-text",
      "reflect": true
    },
    "helperText": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "text of the information message"
      },
      "attribute": "helper-text",
      "reflect": true
    }
  }; }
  static get states() { return {
    "messageType": {}
  }; }
}
//# sourceMappingURL=supporting-text.js.map