@mappedin/viewer 0.35.1-488ebfa.0 → 0.35.1-a4cba26.0

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.
@@ -0,0 +1,3 @@
1
+ import { TToast } from './utils';
2
+ declare const DefaultToast: React.FC<TToast>;
3
+ export default DefaultToast;
@@ -3,5 +3,5 @@ export declare const ToastContainer: React.FC;
3
3
  /**
4
4
  * Render a toast on the page.
5
5
  */
6
- declare const toast: (message: string, options?: Partial<Omit<TToast, "id" | "message">>) => void;
6
+ declare const toast: (content: TToast["content"], options?: Partial<Omit<TToast, "id" | "content">>) => void;
7
7
  export default toast;
@@ -1,9 +1,6 @@
1
- type TToastItemProps = {
2
- id: string;
3
- message: string;
4
- timeout?: number;
5
- icon?: string;
6
- onClose?: (id: string) => void;
1
+ import { TToast } from './utils';
2
+ type TToastItemProps = TToast & {
3
+ closeToast?: (id: string) => void;
7
4
  };
8
5
  declare const ToastItem: React.FC<TToastItemProps>;
9
6
  export default ToastItem;
@@ -1,9 +1,13 @@
1
1
  import { PubSub } from '../../lib/pub-sub';
2
- export type TToast = {
2
+ export type TBaseToast = {
3
3
  id: string;
4
- message: string;
5
- icon?: string;
4
+ icon?: string | React.ReactElement;
6
5
  timeout?: number;
6
+ onClose?: () => void;
7
+ };
8
+ export type TCustomToastFn = (toast: TBaseToast) => React.ReactNode;
9
+ export type TToast = TBaseToast & {
10
+ content: string | TCustomToastFn;
7
11
  };
8
12
  export declare enum E_TOAST_EVENT {
9
13
  SHOW = "SHOW"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mappedin/viewer",
3
- "version": "0.35.1-488ebfa.0",
3
+ "version": "0.35.1-a4cba26.0",
4
4
  "type": "module",
5
5
  "browser": "./dist/index.js",
6
6
  "license": "UNLICENSED",