import { Component, h, Host, Listen, State } from "@stencil/core";
export class CorejamFlash {
  constructor() {
    this.colors = {
      success: "red",
      info: "blue",
      warning: "orange",
      error: "red",
    };
  }
  flashEvent(evt) {
    this.flash = evt.detail;
  }
  render() {
    return (h(Host, null, this.flash && (h("corejam-box", { p: 3, bWidth: 1, rounded: "md", bColor: `${this.colors[this.flash.type]}-700`, bg: `${this.colors[this.flash.type]}-300`, m: 3, w: "12", h: "100%", onClick: () => (this.flash = null) }, this.flash.msg))));
  }
  static get is() { return "corejam-flash"; }
  static get states() { return {
    "flash": {}
  }; }
  static get listeners() { return [{
      "name": "corejam:flash",
      "method": "flashEvent",
      "target": "document",
      "capture": false,
      "passive": false
    }]; }
}
