@cal.macconnachie/web-components 2.1.4 → 2.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -433,7 +433,7 @@ export declare class BaseToast extends BaseElement {
433
433
  private pauseTimer;
434
434
  private resumeTimer;
435
435
  show(): void;
436
- remove(): void;
436
+ hide(): void;
437
437
  static styles: CSSResult;
438
438
  render(): TemplateResult<1>;
439
439
  }
package/dist/index.js CHANGED
@@ -7259,7 +7259,7 @@ class Te extends I {
7259
7259
  o === "s" ? s = t * 1e3 : o === "ms" && (s = t);
7260
7260
  const i = s - e;
7261
7261
  this.timerStarted = Date.now(), this.toastTimout = setTimeout(() => {
7262
- this.remove();
7262
+ this.hide();
7263
7263
  }, i), this.style.animationPlayState = "running";
7264
7264
  const a = this.shadowRoot?.querySelector(".toast-container");
7265
7265
  a && (a.style.animationPlayState = "running");
@@ -7271,7 +7271,7 @@ class Te extends I {
7271
7271
  const e = parseInt(this.dismiss), t = this.dismiss.replace(e.toString(), "");
7272
7272
  let o = 0;
7273
7273
  this.addEventListener("mouseenter", this.pauseTimer.bind(this)), this.addEventListener("mouseleave", this.resumeTimer.bind(this)), t === "s" ? o = e * 1e3 : t === "ms" && (o = e), this.style.setProperty("--toast-duration", `${o}ms`), this.toastTimout = setTimeout(() => {
7274
- this.remove();
7274
+ this.hide();
7275
7275
  }, o);
7276
7276
  }
7277
7277
  this.dispatchEvent(
@@ -7282,7 +7282,7 @@ class Te extends I {
7282
7282
  })
7283
7283
  );
7284
7284
  }
7285
- remove() {
7285
+ hide() {
7286
7286
  this.classList.remove("show"), this.classList.add("hide"), this.toastTimout && clearTimeout(this.toastTimout), this.removeEventListener("mouseenter", this.pauseTimer.bind(this)), this.removeEventListener("mouseleave", this.resumeTimer.bind(this)), this.dispatchEvent(
7287
7287
  new CustomEvent("toast-hidden", {
7288
7288
  detail: { toast: this },
@@ -7654,7 +7654,7 @@ class Te extends I {
7654
7654
  <button
7655
7655
  class="toast-dismiss-btn ${this.variant}"
7656
7656
  aria-label="Dismiss toast"
7657
- @click=${() => this.remove()}
7657
+ @click=${() => this.hide()}
7658
7658
  >
7659
7659
  &times;
7660
7660
  </button>
@@ -7686,7 +7686,9 @@ function wa({
7686
7686
  }) {
7687
7687
  const s = document.createElement("base-toast");
7688
7688
  s.id = `toast-${Date.now()}`, s.setAttribute("variant", e), s.setAttribute("position", t), s.setAttribute("dismiss", o), s.textContent = r, document.body.appendChild(s), s.show(), s.addEventListener("toast-hidden", () => {
7689
- s.remove();
7689
+ s.hide(), setTimeout(() => {
7690
+ s.parentElement && s.remove();
7691
+ }, 500);
7690
7692
  });
7691
7693
  }
7692
7694
  var Lo = Object.defineProperty, Ze = (r, e, t, o) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cal.macconnachie/web-components",
3
- "version": "2.1.4",
3
+ "version": "2.1.6",
4
4
  "description": "Web components hosted on a CDN",
5
5
  "keywords": [
6
6
  "web-components",