import { Component, Host, Prop, State, h } from '@stencil/core';
export class SupportingText {
  constructor() {
    //--------------------------------------------------------------------------
    //
    //  Private State
    //
    //--------------------------------------------------------------------------
    this.messageType = null;
  }
  // --------------------------------------------------------------------------
  //
  //  Lifecycle Methods
  //
  // --------------------------------------------------------------------------
  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: { active: this.messageType === 'error', 'error-text': true } }, this.errorText),
      h("span", { class: { active: this.messageType !== 'error', 'default-text': true } }, 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": "Error message text. **Note:** Error text will always override helper text."
      },
      "attribute": "error-text",
      "reflect": true
    },
    "helperText": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Helper/informational message text."
      },
      "attribute": "helper-text",
      "reflect": true
    }
  }; }
  static get states() { return {
    "messageType": {}
  }; }
}
//# sourceMappingURL=supporting-text.js.map