react-toast-msg 1.6.0 → 2.1.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.
package/README.md CHANGED
@@ -1,70 +1,130 @@
1
- # 🚀 react-toast-msg
1
+ # React Toast MSG - (SudhuCodes)
2
2
 
3
- ![Version](https://img.shields.io/npm/v/react-toast-msg) ![License](https://img.shields.io/npm/l/react-toast-msg) ![Downloads](https://img.shields.io/npm/dt/react-toast-msg)
3
+ A lightweight and customizable React toast notification library.
4
4
 
5
- A lightweight, zero-config, customizable React toast notification library — just plug and play.
5
+ ![Version](https://img.shields.io/npm/v/react-toast-msg)
6
+ ![License](https://img.shields.io/npm/l/react-toast-msg)
7
+ ![Downloads](https://img.shields.io/npm/dt/react-toast-msg)
8
+
9
+ ---
10
+
11
+ ![React Toast MSG](https://github.com/user-attachments/assets/c91fd623-a733-4634-88b7-2bb0f30366ff 'React Toast MSG')
6
12
 
7
13
  ## Features
8
14
 
9
- - Extremely fast and minimal
10
- - Works with both `import` and `require`
11
- - Easy to style with utility classes
12
- - Works with React 18+
13
- - Supports multiple variants (success, error and more coming soon)
15
+ | Feature | Description |
16
+ | ---------------------- | -------------------------------------------- |
17
+ | Lightweight and fast | Minimal dependency and highly performant |
18
+ | Zero configuration | Works instantly with default settings |
19
+ | Custom auto-close time | Set duration per toast dynamically |
20
+ | Multiple toast types | success, error, warning, default |
21
+ | React 18+ support | Fully compatible with React 18 and above |
22
+ | Easy styling | Customize with simple CSS or utility classes |
23
+
24
+ ---
14
25
 
15
26
  ## Installation
16
27
 
17
28
  ```bash
18
- npm install react-toast-msg
29
+ npm i react-toast-msg
19
30
  ```
20
31
 
32
+ ---
33
+
21
34
  ## Usage
22
35
 
23
- ### 1. Add the `ToastContainer` at the root of your app (once):
36
+ ### 1. Add `ToastContainer` at the root of your application:
24
37
 
25
38
  ```jsx
26
- import { ToastContainer, toast } from 'react-toast-msg';
39
+ import { toast, ToastContainer } from 'react-toast-msg';
27
40
 
28
- function App() {
41
+ export default function Example() {
29
42
  return (
30
43
  <>
31
44
  <ToastContainer />
32
- <button onClick={() => toast.success('This is a success toast!')}>Show Success Toast</button>
33
- <button onClick={() => toast.error('This is an error toast!')}>Show Error Toast</button>
45
+
46
+ <button onClick={() => toast('Default toast')}>Default</button>
47
+ <button onClick={() => toast.success('Success toast')}>Success</button>
48
+ <button onClick={() => toast.error('Error toast')}>Error</button>
49
+ <button onClick={() => toast.warning('Warning toast')}>Warning</button>
50
+
51
+ <button onClick={() => toast.success('Success toast', 5000)}>Success with duration</button>
34
52
  </>
35
53
  );
36
54
  }
37
55
  ```
38
56
 
39
- ## Variants
57
+ ---
40
58
 
41
- ```js
42
- toast.success('Success message!');
43
- toast.error('Something went wrong!');
59
+ ## Custom Auto-Close Duration
60
+
61
+ You can now define a custom timeout per toast.
62
+
63
+ | Usage Example | Description |
64
+ | -------------------------------- | ------------------------------------ |
65
+ | `toast('Message')` | Default timeout |
66
+ | `toast('Message', 1000)` | Closes after 1000ms (1 second) |
67
+ | `toast.success('Saved', 5000)` | Success toast closes after 5 seconds |
68
+ | `toast('Text', 'success', 2000)` | Type + duration together |
69
+
70
+ > Note: Duration is in milliseconds and default value is 3000ms
71
+
72
+ ### Example:
73
+
74
+ ```jsx
75
+ <button onClick={() => toast('This will close in 1 second', 1000)}>
76
+ Show 1s Toast
77
+ </button>
44
78
 
45
- // More coming soon
79
+ <button onClick={() => toast.success('Success - 5s', 5000)}>
80
+ Show 5s Success Toast
81
+ </button>
46
82
  ```
47
83
 
48
- ## Customization (Coming Soon)
84
+ ---
49
85
 
50
- | Property | Description | Default |
51
- | ---------- | ------------------------------------- | ------- |
52
- | `duration` | Duration of the toast in milliseconds | `3000` |
86
+ ## ToastContainer Props
87
+
88
+ | Prop | Type | Default | Description |
89
+ | --------- | ------ | ------- | ------------------------------------------------- |
90
+ | autoClose | number | 3000 | Default close time in milliseconds for all toasts |
91
+
92
+ Usage:
93
+
94
+ ```jsx
95
+ <ToastContainer autoClose={5000} /> // Default 5-second timeout
96
+ ```
97
+
98
+ ---
99
+
100
+ ## Available Toast Variants
101
+
102
+ ```js
103
+ toast('Default message');
104
+ toast.success('Success message');
105
+ toast.error('Error occurred');
106
+ toast.warning('Warning message');
107
+ ```
108
+
109
+ ---
53
110
 
54
111
  ## Contributing
55
112
 
56
- > react-toast-msg is an open-source project — and you can help make it better! Whether you want to:
113
+ Contributions are welcome. You can:
114
+
115
+ - Report issues
116
+ - Suggest features
117
+ - Submit pull requests
118
+ - Improve documentation or code quality
119
+
120
+ Repository: [https://github.com/sudhucodes/react-toast-msg](https://github.com/sudhucodes/react-toast-msg)
57
121
 
58
- - Suggest new features
59
- - Improve performance or accessibility
60
- - Fix bugs
61
- - Refactor code or improve documentation
122
+ ---
62
123
 
63
- We’d love your input!
124
+ ## License
64
125
 
65
- Start by checking out the [GitHub repo](https://github.com/sudhucodes/react-toast-msg) issues, discussions, and PRs are welcome. Let's build something amazing together 🚀
126
+ react-toast-msg is [MIT licensed](./LICENSE).
66
127
 
67
- ## Links
128
+ ---
68
129
 
69
- - [GitHub Repo](https://github.com/sudhucodes/react-toast-msg)
70
- - [npm Package](https://www.npmjs.com/package/react-toast-msg)
130
+ <p align="center"> <sub>© 2025 SudhuCodes — All rights reserved.</sub> </p>
@@ -0,0 +1,16 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ type ToastType = 'success' | 'error' | 'warning' | 'default';
4
+ interface ToastContainerProps {
5
+ autoClose?: number;
6
+ }
7
+
8
+ declare function ToastContainer({ autoClose }: ToastContainerProps): react_jsx_runtime.JSX.Element;
9
+ declare function toast(message: string, type?: ToastType | number, duration?: number): void;
10
+ declare namespace toast {
11
+ var success: (message: string, duration?: number) => void;
12
+ var error: (message: string, duration?: number) => void;
13
+ var warning: (message: string, duration?: number) => void;
14
+ }
15
+
16
+ export { ToastContainer, type ToastType, toast };
@@ -0,0 +1,16 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ type ToastType = 'success' | 'error' | 'warning' | 'default';
4
+ interface ToastContainerProps {
5
+ autoClose?: number;
6
+ }
7
+
8
+ declare function ToastContainer({ autoClose }: ToastContainerProps): react_jsx_runtime.JSX.Element;
9
+ declare function toast(message: string, type?: ToastType | number, duration?: number): void;
10
+ declare namespace toast {
11
+ var success: (message: string, duration?: number) => void;
12
+ var error: (message: string, duration?: number) => void;
13
+ var warning: (message: string, duration?: number) => void;
14
+ }
15
+
16
+ export { ToastContainer, type ToastType, toast };
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ "use strict";var f=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var P=(t,o)=>{for(var e in o)f(t,e,{get:o[e],enumerable:!0})},L=(t,o,e,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of E(o))!C.call(t,a)&&a!==e&&f(t,a,{get:()=>o[a],enumerable:!(n=I(o,a))||n.enumerable});return t};var N=t=>L(f({},"__esModule",{value:!0}),t);var B={};P(B,{ToastContainer:()=>b,toast:()=>s});module.exports=N(B);function z(t){if(!t||typeof document=="undefined"||document.getElementById("react-toast-msg-style"))return;let o=document.head||document.getElementsByTagName("head")[0],e=document.createElement("style");e.type="text/css",e.id="react-toast-msg-style",e.appendChild(document.createTextNode(t)),o.appendChild(e)}z(`:root{--default-bg-color: oklch(27.8% .033 256.848);--default-text-color: #fff;--success-bg-color: oklch(72.3% .219 149.579);--success-text-color: #fff;--error-bg-color: oklch(63.7% .237 25.331);--error-text-color: #fff;--warning-bg-color: oklch(79.5% .184 86.047);--warning-text-color: #fff}*{margin:0;padding:0;box-sizing:border-box}.toast-container{position:fixed;font-family:sans-serif;top:1.5rem;right:1.5rem;display:flex;flex-direction:column;align-items:flex-end;gap:10px;z-index:9999}.toast{display:flex;align-items:center;gap:8px;background:#0f172b;color:#fff;padding:12px;font-size:14px;border-radius:8px;min-width:200px;max-width:300px;will-change:transform,opacity}.toast svg{flex-shrink:0}.toast-enter{animation:toastEnter .45s cubic-bezier(.21,1.02,.73,1) forwards}.toast-exit{animation:toastExit .4s cubic-bezier(.06,.71,.55,1) forwards}.toast-success{background:var(--success-bg-color)}.toast-error{background:var(--error-bg-color)}.toast-warning{background:var(--warning-bg-color)}@keyframes toastEnter{0%{opacity:0;transform:translate(20px)}60%{opacity:1;transform:translate(-2px)}to{opacity:1;transform:translate(0)}}@keyframes toastExit{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(20px)}}
3
+ `);var d=require("react");var x=require("react/jsx-runtime");function g({message:t,type:o="default",icon:e,leaving:n}){return(0,x.jsxs)("div",{className:`toast toast-${o} ${n?"toast-exit":"toast-enter"}`,children:[e,t]})}var r=require("react/jsx-runtime"),h=({size:t=24,strokeWidth:o=2})=>(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("circle",{cx:12,cy:12,r:10}),(0,r.jsx)("path",{d:"m9 12 2 2 4-4"})]}),y=({size:t=24,strokeWidth:o=2})=>(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-circle-x-icon lucide-circle-x",children:[(0,r.jsx)("circle",{cx:12,cy:12,r:10}),(0,r.jsx)("path",{d:"m15 9-6 6"}),(0,r.jsx)("path",{d:"m9 9 6 6"})]}),w=({size:t=24,strokeWidth:o=2})=>(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-triangle-alert-icon lucide-triangle-alert",children:[(0,r.jsx)("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}),(0,r.jsx)("path",{d:"M12 9v4"}),(0,r.jsx)("path",{d:"M12 17h.01"})]});var l=require("react/jsx-runtime");function T(t){switch(t){case"success":return(0,l.jsx)(h,{size:20});case"error":return(0,l.jsx)(y,{size:20});case"warning":return(0,l.jsx)(w,{size:18});default:return null}}var u=require("react/jsx-runtime"),p=null;function b({autoClose:t=3e3}){let[o,e]=(0,d.useState)([]);return(0,d.useEffect)(()=>{p=(n,a="default",v)=>{let m=Date.now(),k=v||t;e(i=>[...i,{id:m,message:n,type:a,leaving:!1}]),setTimeout(()=>{e(i=>i.map(c=>c.id===m?{...c,leaving:!0}:c)),setTimeout(()=>{e(i=>i.filter(c=>c.id!==m))},400)},k)}},[t]),(0,u.jsx)("div",{className:"toast-container",children:o.map(n=>(0,u.jsx)(g,{message:n.message,type:n.type,icon:T(n.type),leaving:n.leaving},n.id))})}function s(t,o,e){p&&(typeof o=="number"?p(t,"default",o):p(t,o,e))}s.success=(t,o)=>s(t,"success",o);s.error=(t,o)=>s(t,"error",o);s.warning=(t,o)=>s(t,"warning",o);0&&(module.exports={ToastContainer,toast});
package/dist/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ function b(t){if(!t||typeof document=="undefined"||document.getElementById("react-toast-msg-style"))return;let o=document.head||document.getElementsByTagName("head")[0],e=document.createElement("style");e.type="text/css",e.id="react-toast-msg-style",e.appendChild(document.createTextNode(t)),o.appendChild(e)}b(`:root{--default-bg-color: oklch(27.8% .033 256.848);--default-text-color: #fff;--success-bg-color: oklch(72.3% .219 149.579);--success-text-color: #fff;--error-bg-color: oklch(63.7% .237 25.331);--error-text-color: #fff;--warning-bg-color: oklch(79.5% .184 86.047);--warning-text-color: #fff}*{margin:0;padding:0;box-sizing:border-box}.toast-container{position:fixed;font-family:sans-serif;top:1.5rem;right:1.5rem;display:flex;flex-direction:column;align-items:flex-end;gap:10px;z-index:9999}.toast{display:flex;align-items:center;gap:8px;background:#0f172b;color:#fff;padding:12px;font-size:14px;border-radius:8px;min-width:200px;max-width:300px;will-change:transform,opacity}.toast svg{flex-shrink:0}.toast-enter{animation:toastEnter .45s cubic-bezier(.21,1.02,.73,1) forwards}.toast-exit{animation:toastExit .4s cubic-bezier(.06,.71,.55,1) forwards}.toast-success{background:var(--success-bg-color)}.toast-error{background:var(--error-bg-color)}.toast-warning{background:var(--warning-bg-color)}@keyframes toastEnter{0%{opacity:0;transform:translate(20px)}60%{opacity:1;transform:translate(-2px)}to{opacity:1;transform:translate(0)}}@keyframes toastExit{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(20px)}}
3
+ `);import{useState as k,useEffect as I}from"react";import{jsxs as v}from"react/jsx-runtime";function m({message:t,type:o="default",icon:e,leaving:r}){return v("div",{className:`toast toast-${o} ${r?"toast-exit":"toast-enter"}`,children:[e,t]})}import{jsx as n,jsxs as p}from"react/jsx-runtime";var f=({size:t=24,strokeWidth:o=2})=>p("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round",children:[n("circle",{cx:12,cy:12,r:10}),n("path",{d:"m9 12 2 2 4-4"})]}),u=({size:t=24,strokeWidth:o=2})=>p("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-circle-x-icon lucide-circle-x",children:[n("circle",{cx:12,cy:12,r:10}),n("path",{d:"m15 9-6 6"}),n("path",{d:"m9 9 6 6"})]}),g=({size:t=24,strokeWidth:o=2})=>p("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-triangle-alert-icon lucide-triangle-alert",children:[n("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}),n("path",{d:"M12 9v4"}),n("path",{d:"M12 17h.01"})]});import{jsx as d}from"react/jsx-runtime";function x(t){switch(t){case"success":return d(f,{size:20});case"error":return d(u,{size:20});case"warning":return d(g,{size:18});default:return null}}import{jsx as h}from"react/jsx-runtime";var c=null;function E({autoClose:t=3e3}){let[o,e]=k([]);return I(()=>{c=(r,y="default",w)=>{let l=Date.now(),T=w||t;e(a=>[...a,{id:l,message:r,type:y,leaving:!1}]),setTimeout(()=>{e(a=>a.map(i=>i.id===l?{...i,leaving:!0}:i)),setTimeout(()=>{e(a=>a.filter(i=>i.id!==l))},400)},T)}},[t]),h("div",{className:"toast-container",children:o.map(r=>h(m,{message:r.message,type:r.type,icon:x(r.type),leaving:r.leaving},r.id))})}function s(t,o,e){c&&(typeof o=="number"?c(t,"default",o):c(t,o,e))}s.success=(t,o)=>s(t,"success",o);s.error=(t,o)=>s(t,"error",o);s.warning=(t,o)=>s(t,"warning",o);export{E as ToastContainer,s as toast};
package/package.json CHANGED
@@ -1,17 +1,26 @@
1
1
  {
2
2
  "name": "react-toast-msg",
3
- "version": "1.6.0",
3
+ "version": "2.1.0",
4
4
  "description": "A lightweight, customizable React toast notification library with zero-config and fast setup.",
5
- "main": "dist/react-toast-msg.umd.js",
6
- "module": "dist/react-toast-msg.es.js",
7
5
  "files": [
8
6
  "dist"
9
7
  ],
10
8
  "scripts": {
11
9
  "dev": "vite",
12
- "build": "vite build",
13
- "prepare": "npm run build"
10
+ "prettier": "prettier --write src",
11
+ "build": "tsup"
14
12
  },
13
+ "prettier": {
14
+ "printWidth": 120,
15
+ "semi": true,
16
+ "tabWidth": 4,
17
+ "singleQuote": true,
18
+ "trailingComma": "none",
19
+ "arrowParens": "avoid"
20
+ },
21
+ "main": "dist/index.js",
22
+ "module": "dist/index.mjs",
23
+ "types": "dist/index.d.ts",
15
24
  "keywords": [
16
25
  "react",
17
26
  "toast",
@@ -28,16 +37,17 @@
28
37
  "type": "git",
29
38
  "url": "https://github.com/sudhucodes/react-toast-msg.git"
30
39
  },
31
- "bugs": {
32
- "url": "https://github.com/sudhucodes/react-toast-msg/issues"
33
- },
34
- "homepage": "https://github.com/sudhucodes/react-toast-msg#readme",
35
40
  "peerDependencies": {
36
41
  "react": "^18 || ^19",
37
42
  "react-dom": "^18 || ^19"
38
43
  },
39
44
  "devDependencies": {
45
+ "@types/react": "^19.2.2",
46
+ "@types/react-dom": "^19.2.2",
40
47
  "@vitejs/plugin-react": "^4.3.4",
48
+ "prettier": "^3.6.2",
49
+ "tsup": "^8.5.0",
50
+ "typescript": "^5.9.3",
41
51
  "vite": "^6.0.3"
42
52
  }
43
53
  }
@@ -1 +0,0 @@
1
- :root{--default-bg-color: oklch(27.8% .033 256.848);--default-text-color: #fff;--success-bg-color: oklch(72.3% .219 149.579);--success-text-color: #fff;--error-bg-color: oklch(63.7% .237 25.331);--error-text-color: #fff;--warning-bg-color: oklch(79.5% .184 86.047);--warning-text-color: #fff}*{margin:0;padding:0;box-sizing:border-box}.toast-container{position:fixed;font-family:sans-serif;top:1rem;right:1rem;display:flex;flex-direction:column;align-items:flex-end;gap:10px;z-index:9999}.toast{display:flex;align-items:center;gap:8px;background:#0f172b;color:#fff;padding:12px;font-size:14px;border-radius:8px;min-width:200px;max-width:300px;will-change:transform,opacity}.toast svg{flex-shrink:0}.toast-enter{animation:toastEnter .45s cubic-bezier(.21,1.02,.73,1) forwards}.toast-exit{animation:toastExit .4s cubic-bezier(.06,.71,.55,1) forwards}.toast-success{background:var(--success-bg-color)}.toast-error{background:var(--error-bg-color)}.toast-warning{background:var(--warning-bg-color)}@keyframes toastEnter{0%{opacity:0;transform:translate(20px)}60%{opacity:1;transform:translate(-2px)}to{opacity:1;transform:translate(0)}}@keyframes toastExit{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(20px)}}
@@ -1,381 +0,0 @@
1
- import te, { useState as ne, useEffect as oe } from "react";
2
- var b = { exports: {} }, E = {};
3
- /**
4
- * @license React
5
- * react-jsx-runtime.production.js
6
- *
7
- * Copyright (c) Meta Platforms, Inc. and affiliates.
8
- *
9
- * This source code is licensed under the MIT license found in the
10
- * LICENSE file in the root directory of this source tree.
11
- */
12
- var F;
13
- function ae() {
14
- if (F) return E;
15
- F = 1;
16
- var t = Symbol.for("react.transitional.element"), l = Symbol.for("react.fragment");
17
- function f(c, u, i) {
18
- var d = null;
19
- if (i !== void 0 && (d = "" + i), u.key !== void 0 && (d = "" + u.key), "key" in u) {
20
- i = {};
21
- for (var m in u)
22
- m !== "key" && (i[m] = u[m]);
23
- } else i = u;
24
- return u = i.ref, {
25
- $$typeof: t,
26
- type: c,
27
- key: d,
28
- ref: u !== void 0 ? u : null,
29
- props: i
30
- };
31
- }
32
- return E.Fragment = l, E.jsx = f, E.jsxs = f, E;
33
- }
34
- var _ = {};
35
- /**
36
- * @license React
37
- * react-jsx-runtime.development.js
38
- *
39
- * Copyright (c) Meta Platforms, Inc. and affiliates.
40
- *
41
- * This source code is licensed under the MIT license found in the
42
- * LICENSE file in the root directory of this source tree.
43
- */
44
- var D;
45
- function se() {
46
- return D || (D = 1, process.env.NODE_ENV !== "production" && (function() {
47
- function t(e) {
48
- if (e == null) return null;
49
- if (typeof e == "function")
50
- return e.$$typeof === K ? null : e.displayName || e.name || null;
51
- if (typeof e == "string") return e;
52
- switch (e) {
53
- case x:
54
- return "Fragment";
55
- case V:
56
- return "Profiler";
57
- case J:
58
- return "StrictMode";
59
- case X:
60
- return "Suspense";
61
- case H:
62
- return "SuspenseList";
63
- case Q:
64
- return "Activity";
65
- }
66
- if (typeof e == "object")
67
- switch (typeof e.tag == "number" && console.error(
68
- "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
69
- ), e.$$typeof) {
70
- case q:
71
- return "Portal";
72
- case G:
73
- return e.displayName || "Context";
74
- case z:
75
- return (e._context.displayName || "Context") + ".Consumer";
76
- case B:
77
- var r = e.render;
78
- return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
79
- case Z:
80
- return r = e.displayName || null, r !== null ? r : t(e.type) || "Memo";
81
- case w:
82
- r = e._payload, e = e._init;
83
- try {
84
- return t(e(r));
85
- } catch {
86
- }
87
- }
88
- return null;
89
- }
90
- function l(e) {
91
- return "" + e;
92
- }
93
- function f(e) {
94
- try {
95
- l(e);
96
- var r = !1;
97
- } catch {
98
- r = !0;
99
- }
100
- if (r) {
101
- r = console;
102
- var n = r.error, o = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
103
- return n.call(
104
- r,
105
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
106
- o
107
- ), l(e);
108
- }
109
- }
110
- function c(e) {
111
- if (e === x) return "<>";
112
- if (typeof e == "object" && e !== null && e.$$typeof === w)
113
- return "<...>";
114
- try {
115
- var r = t(e);
116
- return r ? "<" + r + ">" : "<...>";
117
- } catch {
118
- return "<...>";
119
- }
120
- }
121
- function u() {
122
- var e = h.A;
123
- return e === null ? null : e.getOwner();
124
- }
125
- function i() {
126
- return Error("react-stack-top-frame");
127
- }
128
- function d(e) {
129
- if (N.call(e, "key")) {
130
- var r = Object.getOwnPropertyDescriptor(e, "key").get;
131
- if (r && r.isReactWarning) return !1;
132
- }
133
- return e.key !== void 0;
134
- }
135
- function m(e, r) {
136
- function n() {
137
- C || (C = !0, console.error(
138
- "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
139
- r
140
- ));
141
- }
142
- n.isReactWarning = !0, Object.defineProperty(e, "key", {
143
- get: n,
144
- configurable: !0
145
- });
146
- }
147
- function W() {
148
- var e = t(this.type);
149
- return Y[e] || (Y[e] = !0, console.error(
150
- "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
151
- )), e = this.props.ref, e !== void 0 ? e : null;
152
- }
153
- function U(e, r, n, o, T, k) {
154
- var a = n.ref;
155
- return e = {
156
- $$typeof: P,
157
- type: e,
158
- key: r,
159
- props: n,
160
- _owner: o
161
- }, (a !== void 0 ? a : null) !== null ? Object.defineProperty(e, "ref", {
162
- enumerable: !1,
163
- get: W
164
- }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
165
- configurable: !1,
166
- enumerable: !1,
167
- writable: !0,
168
- value: 0
169
- }), Object.defineProperty(e, "_debugInfo", {
170
- configurable: !1,
171
- enumerable: !1,
172
- writable: !0,
173
- value: null
174
- }), Object.defineProperty(e, "_debugStack", {
175
- configurable: !1,
176
- enumerable: !1,
177
- writable: !0,
178
- value: T
179
- }), Object.defineProperty(e, "_debugTask", {
180
- configurable: !1,
181
- enumerable: !1,
182
- writable: !0,
183
- value: k
184
- }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
185
- }
186
- function y(e, r, n, o, T, k) {
187
- var a = r.children;
188
- if (a !== void 0)
189
- if (o)
190
- if (ee(a)) {
191
- for (o = 0; o < a.length; o++)
192
- A(a[o]);
193
- Object.freeze && Object.freeze(a);
194
- } else
195
- console.error(
196
- "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
197
- );
198
- else A(a);
199
- if (N.call(r, "key")) {
200
- a = t(e);
201
- var v = Object.keys(r).filter(function(re) {
202
- return re !== "key";
203
- });
204
- o = 0 < v.length ? "{key: someKey, " + v.join(": ..., ") + ": ...}" : "{key: someKey}", L[a + o] || (v = 0 < v.length ? "{" + v.join(": ..., ") + ": ...}" : "{}", console.error(
205
- `A props object containing a "key" prop is being spread into JSX:
206
- let props = %s;
207
- <%s {...props} />
208
- React keys must be passed directly to JSX without using spread:
209
- let props = %s;
210
- <%s key={someKey} {...props} />`,
211
- o,
212
- a,
213
- v,
214
- a
215
- ), L[a + o] = !0);
216
- }
217
- if (a = null, n !== void 0 && (f(n), a = "" + n), d(r) && (f(r.key), a = "" + r.key), "key" in r) {
218
- n = {};
219
- for (var j in r)
220
- j !== "key" && (n[j] = r[j]);
221
- } else n = r;
222
- return a && m(
223
- n,
224
- typeof e == "function" ? e.displayName || e.name || "Unknown" : e
225
- ), U(
226
- e,
227
- a,
228
- n,
229
- u(),
230
- T,
231
- k
232
- );
233
- }
234
- function A(e) {
235
- S(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === w && (e._payload.status === "fulfilled" ? S(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
236
- }
237
- function S(e) {
238
- return typeof e == "object" && e !== null && e.$$typeof === P;
239
- }
240
- var R = te, P = Symbol.for("react.transitional.element"), q = Symbol.for("react.portal"), x = Symbol.for("react.fragment"), J = Symbol.for("react.strict_mode"), V = Symbol.for("react.profiler"), z = Symbol.for("react.consumer"), G = Symbol.for("react.context"), B = Symbol.for("react.forward_ref"), X = Symbol.for("react.suspense"), H = Symbol.for("react.suspense_list"), Z = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), Q = Symbol.for("react.activity"), K = Symbol.for("react.client.reference"), h = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, N = Object.prototype.hasOwnProperty, ee = Array.isArray, g = console.createTask ? console.createTask : function() {
241
- return null;
242
- };
243
- R = {
244
- react_stack_bottom_frame: function(e) {
245
- return e();
246
- }
247
- };
248
- var C, Y = {}, I = R.react_stack_bottom_frame.bind(
249
- R,
250
- i
251
- )(), $ = g(c(i)), L = {};
252
- _.Fragment = x, _.jsx = function(e, r, n) {
253
- var o = 1e4 > h.recentlyCreatedOwnerStacks++;
254
- return y(
255
- e,
256
- r,
257
- n,
258
- !1,
259
- o ? Error("react-stack-top-frame") : I,
260
- o ? g(c(e)) : $
261
- );
262
- }, _.jsxs = function(e, r, n) {
263
- var o = 1e4 > h.recentlyCreatedOwnerStacks++;
264
- return y(
265
- e,
266
- r,
267
- n,
268
- !0,
269
- o ? Error("react-stack-top-frame") : I,
270
- o ? g(c(e)) : $
271
- );
272
- };
273
- })()), _;
274
- }
275
- var M;
276
- function le() {
277
- return M || (M = 1, process.env.NODE_ENV === "production" ? b.exports = ae() : b.exports = se()), b.exports;
278
- }
279
- var s = le();
280
- const ce = ({ size: t = 24, strokeWidth: l = 2 }) => /* @__PURE__ */ s.jsxs(
281
- "svg",
282
- {
283
- xmlns: "http://www.w3.org/2000/svg",
284
- width: t,
285
- height: t,
286
- viewBox: "0 0 24 24",
287
- fill: "none",
288
- stroke: "currentColor",
289
- strokeWidth: l,
290
- strokeLinecap: "round",
291
- strokeLinejoin: "round",
292
- children: [
293
- /* @__PURE__ */ s.jsx("circle", { cx: 12, cy: 12, r: 10 }),
294
- /* @__PURE__ */ s.jsx("path", { d: "m9 12 2 2 4-4" })
295
- ]
296
- }
297
- ), ie = ({ size: t = 24, strokeWidth: l = 2 }) => /* @__PURE__ */ s.jsxs(
298
- "svg",
299
- {
300
- xmlns: "http://www.w3.org/2000/svg",
301
- width: t,
302
- height: t,
303
- viewBox: "0 0 24 24",
304
- fill: "none",
305
- stroke: "currentColor",
306
- strokeWidth: l,
307
- strokeLinecap: "round",
308
- strokeLinejoin: "round",
309
- className: "lucide lucide-circle-x-icon lucide-circle-x",
310
- children: [
311
- /* @__PURE__ */ s.jsx("circle", { cx: 12, cy: 12, r: 10 }),
312
- /* @__PURE__ */ s.jsx("path", { d: "m15 9-6 6" }),
313
- /* @__PURE__ */ s.jsx("path", { d: "m9 9 6 6" })
314
- ]
315
- }
316
- ), ue = ({ size: t = 24, strokeWidth: l = 2 }) => /* @__PURE__ */ s.jsxs(
317
- "svg",
318
- {
319
- xmlns: "http://www.w3.org/2000/svg",
320
- width: t,
321
- height: t,
322
- viewBox: "0 0 24 24",
323
- fill: "none",
324
- stroke: "currentColor",
325
- strokeWidth: l,
326
- strokeLinecap: "round",
327
- strokeLinejoin: "round",
328
- className: "lucide lucide-triangle-alert-icon lucide-triangle-alert",
329
- children: [
330
- /* @__PURE__ */ s.jsx("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
331
- /* @__PURE__ */ s.jsx("path", { d: "M12 9v4" }),
332
- /* @__PURE__ */ s.jsx("path", { d: "M12 17h.01" })
333
- ]
334
- }
335
- );
336
- function fe(t) {
337
- switch (t) {
338
- case "success":
339
- return /* @__PURE__ */ s.jsx(ce, { size: 20 });
340
- case "error":
341
- return /* @__PURE__ */ s.jsx(ie, { size: 20 });
342
- case "warning":
343
- return /* @__PURE__ */ s.jsx(ue, { size: 18 });
344
- default:
345
- return null;
346
- }
347
- }
348
- function de({ message: t, type: l = "default", icon: f, leaving: c }) {
349
- return /* @__PURE__ */ s.jsxs("div", { className: `toast toast-${l} ${c ? "toast-exit" : "toast-enter"}`, children: [
350
- f,
351
- t
352
- ] });
353
- }
354
- let O;
355
- function ve({
356
- autoClose: t = 3e3
357
- }) {
358
- const [l, f] = ne([]);
359
- return oe(() => {
360
- O = (c, u = "default") => {
361
- const i = Date.now();
362
- f((d) => [...d, { id: i, message: c, type: u, leaving: !1 }]), setTimeout(() => {
363
- f(
364
- (d) => d.map((m) => m.id === i ? { ...m, leaving: !0 } : m)
365
- ), setTimeout(() => {
366
- f((d) => d.filter((m) => m.id !== i));
367
- }, 400);
368
- }, t);
369
- };
370
- }, []), /* @__PURE__ */ s.jsx("div", { className: "toast-container", children: l.map((c) => /* @__PURE__ */ s.jsx(de, { message: c.message, type: c.type, icon: fe(c.type), leaving: c.leaving }, c.id)) });
371
- }
372
- function p(t, l = "default") {
373
- O && O(t, l);
374
- }
375
- p.success = (t) => p(t, "success");
376
- p.error = (t) => p(t, "error");
377
- p.warning = (t) => p(t, "warning");
378
- export {
379
- ve as ToastContainer,
380
- p as toast
381
- };
@@ -1,22 +0,0 @@
1
- (function(p,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],v):(p=typeof globalThis<"u"?globalThis:p||self,v(p.ReactToastMsg={},p.React))})(this,(function(p,v){"use strict";var b={exports:{}},T={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var A;function J(){if(A)return T;A=1;var t=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function f(i,u,l){var d=null;if(l!==void 0&&(d=""+l),u.key!==void 0&&(d=""+u.key),"key"in u){l={};for(var m in u)m!=="key"&&(l[m]=u[m])}else l=u;return u=l.ref,{$$typeof:t,type:i,key:d,ref:u!==void 0?u:null,props:l}}return T.Fragment=c,T.jsx=f,T.jsxs=f,T}var R={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var P;function V(){return P||(P=1,process.env.NODE_ENV!=="production"&&(function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ue?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case te:return"Profiler";case re:return"StrictMode";case se:return"Suspense";case ce:return"SuspenseList";case le:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case ee:return"Portal";case oe:return e.displayName||"Context";case ne:return(e._context.displayName||"Context")+".Consumer";case ae:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ie:return r=e.displayName||null,r!==null?r:t(e.type)||"Memo";case j:r=e._payload,e=e._init;try{return t(e(r))}catch{}}return null}function c(e){return""+e}function f(e){try{c(e);var r=!1}catch{r=!0}if(r){r=console;var n=r.error,o=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),c(e)}}function i(e){if(e===w)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===j)return"<...>";try{var r=t(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function u(){var e=k.A;return e===null?null:e.getOwner()}function l(){return Error("react-stack-top-frame")}function d(e){if(F.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function m(e,r){function n(){M||(M=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function Q(){var e=t(this.type);return D[e]||(D[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function K(e,r,n,o,h,O){var a=n.ref;return e={$$typeof:L,type:e,key:r,props:n,_owner:o},(a!==void 0?a:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:Q}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:h}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:O}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function C(e,r,n,o,h,O){var a=r.children;if(a!==void 0)if(o)if(fe(a)){for(o=0;o<a.length;o++)Y(a[o]);Object.freeze&&Object.freeze(a)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Y(a);if(F.call(r,"key")){a=t(e);var _=Object.keys(r).filter(function(de){return de!=="key"});o=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",U[a+o]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
- let props = %s;
19
- <%s {...props} />
20
- React keys must be passed directly to JSX without using spread:
21
- let props = %s;
22
- <%s key={someKey} {...props} />`,o,a,_,a),U[a+o]=!0)}if(a=null,n!==void 0&&(f(n),a=""+n),d(r)&&(f(r.key),a=""+r.key),"key"in r){n={};for(var S in r)S!=="key"&&(n[S]=r[S])}else n=r;return a&&m(n,typeof e=="function"?e.displayName||e.name||"Unknown":e),K(e,a,n,u(),h,O)}function Y(e){I(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===j&&(e._payload.status==="fulfilled"?I(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function I(e){return typeof e=="object"&&e!==null&&e.$$typeof===L}var x=v,L=Symbol.for("react.transitional.element"),ee=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),re=Symbol.for("react.strict_mode"),te=Symbol.for("react.profiler"),ne=Symbol.for("react.consumer"),oe=Symbol.for("react.context"),ae=Symbol.for("react.forward_ref"),se=Symbol.for("react.suspense"),ce=Symbol.for("react.suspense_list"),ie=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),ue=Symbol.for("react.client.reference"),k=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,fe=Array.isArray,y=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(e){return e()}};var M,D={},$=x.react_stack_bottom_frame.bind(x,l)(),W=y(i(l)),U={};R.Fragment=w,R.jsx=function(e,r,n){var o=1e4>k.recentlyCreatedOwnerStacks++;return C(e,r,n,!1,o?Error("react-stack-top-frame"):$,o?y(i(e)):W)},R.jsxs=function(e,r,n){var o=1e4>k.recentlyCreatedOwnerStacks++;return C(e,r,n,!0,o?Error("react-stack-top-frame"):$,o?y(i(e)):W)}})()),R}var N;function z(){return N||(N=1,process.env.NODE_ENV==="production"?b.exports=J():b.exports=V()),b.exports}var s=z();const q=({size:t=24,strokeWidth:c=2})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:c,strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("circle",{cx:12,cy:12,r:10}),s.jsx("path",{d:"m9 12 2 2 4-4"})]}),G=({size:t=24,strokeWidth:c=2})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:c,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-circle-x-icon lucide-circle-x",children:[s.jsx("circle",{cx:12,cy:12,r:10}),s.jsx("path",{d:"m15 9-6 6"}),s.jsx("path",{d:"m9 9 6 6"})]}),B=({size:t=24,strokeWidth:c=2})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:c,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-triangle-alert-icon lucide-triangle-alert",children:[s.jsx("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}),s.jsx("path",{d:"M12 9v4"}),s.jsx("path",{d:"M12 17h.01"})]});function X(t){switch(t){case"success":return s.jsx(q,{size:20});case"error":return s.jsx(G,{size:20});case"warning":return s.jsx(B,{size:18});default:return null}}function H({message:t,type:c="default",icon:f,leaving:i}){return s.jsxs("div",{className:`toast toast-${c} ${i?"toast-exit":"toast-enter"}`,children:[f,t]})}let g;function Z({autoClose:t=3e3}){const[c,f]=v.useState([]);return v.useEffect(()=>{g=(i,u="default")=>{const l=Date.now();f(d=>[...d,{id:l,message:i,type:u,leaving:!1}]),setTimeout(()=>{f(d=>d.map(m=>m.id===l?{...m,leaving:!0}:m)),setTimeout(()=>{f(d=>d.filter(m=>m.id!==l))},400)},t)}},[]),s.jsx("div",{className:"toast-container",children:c.map(i=>s.jsx(H,{message:i.message,type:i.type,icon:X(i.type),leaving:i.leaving},i.id))})}function E(t,c="default"){g&&g(t,c)}E.success=t=>E(t,"success"),E.error=t=>E(t,"error"),E.warning=t=>E(t,"warning"),p.ToastContainer=Z,p.toast=E,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}));