@team-frieeren/components 1.0.14 → 1.0.15

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/Toast.js CHANGED
@@ -311,13 +311,7 @@ var defaultToastValue = {
311
311
  duration: 3000,
312
312
  position: "top-right"
313
313
  };
314
- var ToastContext = /*#__PURE__*/createContext({
315
- toasts: [],
316
- add: function add() {
317
- return "";
318
- },
319
- remove: function remove() {}
320
- });
314
+ var ToastContext = /*#__PURE__*/createContext(null);
321
315
  var ToastPortal = function ToastPortal(_a) {
322
316
  var children = _a.children;
323
317
  var isMounted = useIsMounted();
@@ -387,11 +381,10 @@ var ToastProvider = function ToastProvider(_a) {
387
381
  }, []);
388
382
  var value = useMemo(function () {
389
383
  return {
390
- toasts: toasts,
391
384
  add: add,
392
385
  remove: remove
393
386
  };
394
- }, [toasts, add, remove]);
387
+ }, [add, remove]);
395
388
  return jsxs(ToastContext.Provider, {
396
389
  value: value,
397
390
  children: [children, jsx(ToastPortal, {
@@ -24,7 +24,6 @@ export interface ToastProviderProps {
24
24
  options?: Partial<ToastOptions>;
25
25
  }
26
26
  export interface ToastContextValue {
27
- toasts: ToastType[];
28
27
  add: (toast: Partial<ToastOptions>) => string;
29
28
  remove: (id: string) => void;
30
29
  }
@@ -1,3 +1,3 @@
1
1
  import { ToastContextValue, ToastProviderProps } from "./Toast.type";
2
- export declare const ToastContext: import("react").Context<ToastContextValue>;
2
+ export declare const ToastContext: import("react").Context<ToastContextValue | null>;
3
3
  export declare const ToastProvider: ({ options, children }: ToastProviderProps) => import("react/jsx-runtime").JSX.Element;
package/dist/index.js CHANGED
@@ -497,13 +497,7 @@ var defaultToastValue = {
497
497
  duration: 3000,
498
498
  position: "top-right"
499
499
  };
500
- var ToastContext = /*#__PURE__*/createContext({
501
- toasts: [],
502
- add: function add() {
503
- return "";
504
- },
505
- remove: function remove() {}
506
- });
500
+ var ToastContext = /*#__PURE__*/createContext(null);
507
501
  var ToastPortal = function ToastPortal(_a) {
508
502
  var children = _a.children;
509
503
  var isMounted = useIsMounted();
@@ -573,11 +567,10 @@ var ToastProvider = function ToastProvider(_a) {
573
567
  }, []);
574
568
  var value = useMemo(function () {
575
569
  return {
576
- toasts: toasts,
577
570
  add: add,
578
571
  remove: remove
579
572
  };
580
- }, [toasts, add, remove]);
573
+ }, [add, remove]);
581
574
  return jsxs(ToastContext.Provider, {
582
575
  value: value,
583
576
  children: [children, jsx(ToastPortal, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-frieeren/components",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",