draft-components 1.0.0-beta.12 → 1.0.0-beta.13

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.
@@ -23,7 +23,7 @@ class Toaster {
23
23
  this._id += 1;
24
24
  return this._id;
25
25
  }
26
- showToast(toast, params) {
26
+ showToast(toast) {
27
27
  const id = this._getNextId();
28
28
  const event = new CustomEvent(TOAST_SHOW_EVENT, {
29
29
  detail: {
@@ -31,7 +31,7 @@ class Toaster {
31
31
  toast: { ...toast, id },
32
32
  },
33
33
  });
34
- const timeoutMs = toast.timeoutMs || params?.timeoutMs || this.timeoutMs;
34
+ const timeoutMs = toast.timeoutMs || this.timeoutMs;
35
35
  this.onShow?.(event.detail.toast);
36
36
  window.dispatchEvent(event);
37
37
  window.setTimeout(() => this.hideToast(id), timeoutMs);
@@ -21,7 +21,7 @@ class Toaster {
21
21
  this._id += 1;
22
22
  return this._id;
23
23
  }
24
- showToast(toast, params) {
24
+ showToast(toast) {
25
25
  const id = this._getNextId();
26
26
  const event = new CustomEvent(TOAST_SHOW_EVENT, {
27
27
  detail: {
@@ -29,7 +29,7 @@ class Toaster {
29
29
  toast: { ...toast, id },
30
30
  },
31
31
  });
32
- const timeoutMs = toast.timeoutMs || params?.timeoutMs || this.timeoutMs;
32
+ const timeoutMs = toast.timeoutMs || this.timeoutMs;
33
33
  this.onShow?.(event.detail.toast);
34
34
  window.dispatchEvent(event);
35
35
  window.setTimeout(() => this.hideToast(id), timeoutMs);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "draft-components",
3
- "version": "1.0.0-beta.12",
3
+ "version": "1.0.0-beta.13",
4
4
  "description": "The React based UI components library.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -31,9 +31,7 @@ export declare class Toaster {
31
31
  onHideToast?: ToastHideCallback;
32
32
  });
33
33
  private _getNextId;
34
- showToast(toast: ToastParams, params?: {
35
- timeoutMs?: number;
36
- }): ToastID;
34
+ showToast(toast: ToastParams): ToastID;
37
35
  hideToast(id: ToastID): void;
38
36
  render(options?: {
39
37
  toastGap?: number;