import { Component, Element, Event, h, Host, Prop } from "@stencil/core";
export class CorejamModal {
  constructor() {
    this.type = "success";
    this.colorMap = {
      error: "red-600",
      warning: "orange-500",
      success: "green-600",
    };
  }
  closeModal() {
    this.modalInstance.remove();
    this.corejamModalClose.emit();
  }
  render() {
    return (h(Host, null,
      h("corejam-box", { position: "fixed", z: 1000, top: 0, right: 0, bottom: 0, left: 0, style: { background: "rgba(255,255,255, 0.6", backdropFilter: "blur(2px)" } },
        h("corejam-grid", { h: "100%", style: { placeItems: "center" } },
          h("corejam-box", { bWidth: 1, bColor: "gray-400", rounded: "md", shadow: "lg", flex: true, items: "center", position: "relative", justify: "center", direction: "col", p: 4, h: "200px", w: "3", bg: "white" },
            h("corejam-box", { onClick: () => this.closeModal(), top: 10, position: "absolute", right: 10 }, "X"),
            h("corejam-type", { weight: "bold", as: "h3", color: this.colorMap[this.type] }, this.type.toUpperCase()),
            h("corejam-type", null, this.message))))));
  }
  static get is() { return "corejam-modal"; }
  static get properties() { return {
    "message": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "message",
      "reflect": false
    },
    "type": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "\"error\" | \"warning\" | \"success\"",
        "resolved": "\"error\" | \"success\" | \"warning\"",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "type",
      "reflect": false,
      "defaultValue": "\"success\""
    }
  }; }
  static get events() { return [{
      "method": "corejamModalClose",
      "name": "corejam:modal:close",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      }
    }]; }
  static get elementRef() { return "modalInstance"; }
}
