customizable-toast-notification 3.0.4 → 3.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 +71 -30
- package/dist/index.umd.js +18 -0
- package/dist/index.umd.js.map +1 -0
- package/package.json +59 -21
package/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Please feel free to connect or reach out for **feedback**, **suggestions**, or any kind of **requirements** or **fixes**—just anything—at:
|
|
4
4
|
|
|
5
|
-
📧 **priyanshu.alt191@gmail.com**
|
|
5
|
+
📧 **priyanshu.alt191@gmail.com**
|
|
6
6
|
|
|
7
|
-
<u>Your support is highly appreciated! 🙌 If you'd like to show some love, please leave a message of appreciation and don't forget to add your message when supporting me through the **QR Code** below
|
|
7
|
+
<u>Your support is highly appreciated! 🙌 If you'd like to show some love, please leave a message of appreciation and don't forget to add your message when supporting me through the **QR Code** below
|
|
8
8
|
or
|
|
9
9
|
**GlobalUPI_ID(eureka91@upi)**
|
|
10
10
|
or
|
|
@@ -22,6 +22,7 @@ or
|
|
|
22
22
|
A simple and highly customizable toast notification library for modern JavaScript applications. This library allows you to easily display toast notifications with various configurations to enhance user experience.
|
|
23
23
|
|
|
24
24
|
## Table of Contents
|
|
25
|
+
|
|
25
26
|
- [Features](#features)
|
|
26
27
|
- [Installation](#installation)
|
|
27
28
|
- [Usage](#usage)
|
|
@@ -31,6 +32,7 @@ A simple and highly customizable toast notification library for modern JavaScrip
|
|
|
31
32
|
- [License](#license)
|
|
32
33
|
|
|
33
34
|
## Features
|
|
35
|
+
|
|
34
36
|
- Display notifications of different types: info, success, error, and warning.
|
|
35
37
|
- Customizable background and text colors.
|
|
36
38
|
- Support for custom messages and default messages.
|
|
@@ -39,35 +41,62 @@ A simple and highly customizable toast notification library for modern JavaScrip
|
|
|
39
41
|
- Animation effects for a smooth appearance and disappearance.
|
|
40
42
|
|
|
41
43
|
## Installation
|
|
44
|
+
|
|
42
45
|
You can install the library via npm:
|
|
46
|
+
|
|
43
47
|
```bash
|
|
44
48
|
npm install customizable-toast-notification
|
|
45
49
|
```
|
|
46
50
|
|
|
47
51
|
## Usage
|
|
48
|
-
|
|
52
|
+
|
|
53
|
+
🔌 CDN Usage (UMD:Universal Module Definition Build)
|
|
54
|
+
You can use this toast notification library directly in your HTML file via a <script> tag:
|
|
55
|
+
|
|
56
|
+
<script src="https://cdn.jsdelivr.net/npm/customizable-toast-notification/dist/index.umd.js"></script>
|
|
57
|
+
<script>
|
|
58
|
+
customizableToast.createToast({
|
|
59
|
+
message: "Hello from the browser!",
|
|
60
|
+
type: "success",
|
|
61
|
+
position: "top-center",
|
|
62
|
+
duration: 4000
|
|
63
|
+
});
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
✅ No build tools or framework needed
|
|
67
|
+
✅ Works in all modern browsers
|
|
68
|
+
|
|
69
|
+
or To use the toast notification library, you need to import it in your JavaScript or TypeScript file:
|
|
70
|
+
|
|
49
71
|
```javascript
|
|
50
|
-
import {
|
|
72
|
+
import {
|
|
73
|
+
createToast,
|
|
74
|
+
setDefaultColors,
|
|
75
|
+
setDefaultMessages,
|
|
76
|
+
} from "customizable-toast-notification";
|
|
51
77
|
|
|
52
78
|
// Create a toast notification
|
|
53
79
|
createToast({
|
|
54
|
-
message:
|
|
80
|
+
message: "This is a custom message!",
|
|
55
81
|
duration: 5000, // Duration in milliseconds
|
|
56
|
-
position:
|
|
57
|
-
type:
|
|
58
|
-
backgroundColor:
|
|
59
|
-
textColor:
|
|
82
|
+
position: "top-right", // Position of the toast
|
|
83
|
+
type: "success", // Type of notification
|
|
84
|
+
backgroundColor: "green", // Custom background color
|
|
85
|
+
textColor: "white", // Custom text color
|
|
60
86
|
showCloseButton: true, // Show close button
|
|
61
|
-
animationDuration:
|
|
62
|
-
animationEasing:
|
|
87
|
+
animationDuration: "0.5s", // Duration of the animations
|
|
88
|
+
animationEasing: "ease", // Easing function for the animations
|
|
63
89
|
});
|
|
64
90
|
```
|
|
65
91
|
|
|
66
92
|
## API Reference
|
|
93
|
+
|
|
67
94
|
### createToast
|
|
95
|
+
|
|
68
96
|
Creates a toast notification with the provided options.
|
|
69
97
|
|
|
70
98
|
#### Parameters
|
|
99
|
+
|
|
71
100
|
- `options` (Object): Options for the toast notification.
|
|
72
101
|
- `message` (string, optional): The message to display in the toast. Defaults based on type if not provided.
|
|
73
102
|
- `duration` (number, optional): The duration the toast should be displayed, in milliseconds (default is 3000).
|
|
@@ -80,75 +109,87 @@ Creates a toast notification with the provided options.
|
|
|
80
109
|
- `animationEasing` (string, optional): Easing function for the animations (default is 'ease').
|
|
81
110
|
|
|
82
111
|
#### Example
|
|
112
|
+
|
|
83
113
|
```javascript
|
|
84
114
|
createToast({
|
|
85
|
-
message:
|
|
86
|
-
type:
|
|
115
|
+
message: "Operation completed successfully!",
|
|
116
|
+
type: "success",
|
|
87
117
|
});
|
|
88
118
|
```
|
|
89
119
|
|
|
90
120
|
### setDefaultColors
|
|
121
|
+
|
|
91
122
|
Sets default colors for different toast types.
|
|
92
123
|
|
|
93
124
|
#### Parameters
|
|
125
|
+
|
|
94
126
|
- `newColors` (Object): New colors to set for toast types, where keys are the toast types (info, success, error, warning).
|
|
95
127
|
|
|
96
128
|
#### Example
|
|
129
|
+
|
|
97
130
|
```javascript
|
|
98
131
|
setDefaultColors({
|
|
99
|
-
info:
|
|
100
|
-
success:
|
|
101
|
-
error:
|
|
102
|
-
warning:
|
|
132
|
+
info: "blue",
|
|
133
|
+
success: "green",
|
|
134
|
+
error: "red",
|
|
135
|
+
warning: "orange",
|
|
103
136
|
});
|
|
104
137
|
```
|
|
105
138
|
|
|
106
139
|
### setDefaultMessages
|
|
140
|
+
|
|
107
141
|
Sets default messages for different toast types.
|
|
108
142
|
|
|
109
143
|
#### Parameters
|
|
144
|
+
|
|
110
145
|
- `newMessages` (Object): New messages to set for toast types, where keys are the toast types (info, success, error, warning).
|
|
111
146
|
|
|
112
147
|
#### Example
|
|
148
|
+
|
|
113
149
|
```javascript
|
|
114
150
|
setDefaultMessages({
|
|
115
|
-
info:
|
|
116
|
-
success:
|
|
117
|
-
error:
|
|
118
|
-
warning:
|
|
151
|
+
info: "This is an informational message!",
|
|
152
|
+
success: "Your action was successful!",
|
|
153
|
+
error: "An error has occurred!",
|
|
154
|
+
warning: "This is a warning message!",
|
|
119
155
|
});
|
|
120
156
|
```
|
|
121
157
|
|
|
122
158
|
## Examples
|
|
159
|
+
|
|
123
160
|
### Basic Usage
|
|
161
|
+
|
|
124
162
|
```javascript
|
|
125
163
|
createToast({
|
|
126
|
-
message:
|
|
164
|
+
message: "Welcome to our website!",
|
|
127
165
|
duration: 4000,
|
|
128
|
-
type:
|
|
166
|
+
type: "info",
|
|
129
167
|
});
|
|
130
168
|
```
|
|
131
169
|
|
|
132
170
|
### Custom Colors and Messages
|
|
171
|
+
|
|
133
172
|
```javascript
|
|
134
173
|
setDefaultColors({
|
|
135
|
-
success:
|
|
136
|
-
error:
|
|
174
|
+
success: "#28a745",
|
|
175
|
+
error: "#dc3545",
|
|
137
176
|
});
|
|
138
177
|
|
|
139
178
|
setDefaultMessages({
|
|
140
|
-
success:
|
|
141
|
-
error:
|
|
179
|
+
success: "Data saved successfully!",
|
|
180
|
+
error: "Failed to save data.",
|
|
142
181
|
});
|
|
143
182
|
|
|
144
183
|
createToast({
|
|
145
|
-
type:
|
|
146
|
-
message:
|
|
184
|
+
type: "success",
|
|
185
|
+
message: "Data saved successfully!",
|
|
147
186
|
});
|
|
148
187
|
```
|
|
149
188
|
|
|
150
189
|
## Contributing
|
|
190
|
+
|
|
151
191
|
Contributions are welcome! Please read the [CONTRIBUTING.md]() for details on our code of conduct, and the process for submitting pull requests.
|
|
152
192
|
|
|
153
193
|
## License
|
|
154
|
-
|
|
194
|
+
|
|
195
|
+
This project is licensed under the Apache-2.0 License - see the [LICENSE.md](LICENSE) file for details.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).customizableToast={})}(this,(function(e){"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview A simple toast notification library for any JavaScript framework.
|
|
4
|
+
* @name Toast Notifications
|
|
5
|
+
* @author Priyanshu Patel
|
|
6
|
+
* @version 1.0.0
|
|
7
|
+
* @license MIT
|
|
8
|
+
* @depends None
|
|
9
|
+
* @description This library provides a simple way to create toast notifications.
|
|
10
|
+
* Author: Priyanshu Patel
|
|
11
|
+
* Email: priyanshu.alt191@gmail.com
|
|
12
|
+
* Created: July 31, 2024
|
|
13
|
+
* Description: A simple toast notification library for any JavaScript framework.
|
|
14
|
+
* Version: 1.0.0
|
|
15
|
+
* License: MIT
|
|
16
|
+
* Dependencies: None
|
|
17
|
+
*/let t={info:"blue",success:"green",error:"red",warning:"darkorange"},o={info:"This is an info message.",success:"Action completed successfully!",error:"An error occurred!",warning:"This is a warning message!"},n=!1;function s(e,t,o,s,i,a){const r=document.createElement("div");return r.textContent=e,r.style.background=t,r.style.color=o,r.style.padding="10px 20px",r.style.marginTop="10px",r.style.borderRadius="5px",r.style.boxShadow="0 0 10px rgba(0, 0, 0, 0.1)",r.style.opacity="0",r.style.transition=`opacity ${s} ${i}`,a&&function(e,t){const o=document.createElement("button");o.textContent="×",o.style.marginLeft="10px",o.style.background="transparent",o.style.border="none",o.style.color=t,o.style.cursor="pointer",o.onclick=()=>{e.style.opacity="0",e.addEventListener("transitionend",(()=>{e.remove(),n=!1}))},e.appendChild(o)}(r,o),r}function i({message:e,duration:i,position:a,type:r,backgroundColor:l,textColor:c,showCloseButton:d,animationDuration:u,animationEasing:p}){if(n)return;n=!0;const y=e||o[r]||"This is a default message.",f=l||t[r]||"gray",m=c||("white"===f?"black":"white"),g=function(e){let t=document.getElementById(`toast-container-${e}`);return t||(t=document.createElement("div"),t.id=`toast-container-${e}`,t.style.position="fixed",t.style.zIndex="9999",function(e,t){t.includes("bottom")?e.style.bottom="10px":t.includes("top")&&(e.style.top="10px"),t.includes("right")?e.style.right="10px":t.includes("left")?e.style.left="10px":t.includes("center")&&(e.style.top="50%",e.style.left="50%",e.style.transform="translate(-50%, -50%)")}(t,e),document.body.appendChild(t)),t}(a),b=s(y,f,m,u||"0.5s",p||"ease",d);g.appendChild(b),requestAnimationFrame((()=>{b.style.opacity="1"})),setTimeout((()=>{b.parentNode&&(b.style.opacity="0",b.addEventListener("transitionend",(()=>{b.remove(),n=!1})))}),i||3e3)}e.createToast=function(e){if("object"!=typeof e)return;const{message:t,duration:o,position:n="bottom-right",type:s="info",backgroundColor:a,textColor:r,showCloseButton:l=!1,animationDuration:c,animationEasing:d}=e;i({message:t,duration:o||3e3,position:n,type:s,backgroundColor:a,textColor:r,showCloseButton:l,animationDuration:c,animationEasing:d})},e.setDefaultColors=function(e){"object"==typeof e&&Object.assign(t,e)},e.setDefaultMessages=function(e){"object"==typeof e&&Object.assign(o,e)},Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
18
|
+
//# sourceMappingURL=index.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../src/index.js"],"sourcesContent":["\"use strict\";\r\n\r\n/**\r\n * @fileoverview A simple toast notification library for any JavaScript framework.\r\n * @name Toast Notifications\r\n * @author Priyanshu Patel\r\n * @version 1.0.0\r\n * @license MIT\r\n * @depends None\r\n * @description This library provides a simple way to create toast notifications.\r\n * Author: Priyanshu Patel\r\n * Email: priyanshu.alt191@gmail.com\r\n * Created: July 31, 2024\r\n * Description: A simple toast notification library for any JavaScript framework.\r\n * Version: 1.0.0\r\n * License: MIT\r\n * Dependencies: None\r\n */\r\n\r\n/**\r\n * Creates a toast notification.\r\n *\r\n * @param {Object} options - Options for the toast notification.\r\n * @param {string} [options.message] - The message to display in the toast. Defaults based on type if not provided.\r\n * @param {number} [options.duration=3000] - The duration the toast should be displayed, in milliseconds.\r\n * @param {string} [options.position='bottom-right'] - The position of the toast on the screen.\r\n * @param {string} [options.type='info'] - The type of the toast ('info', 'success', 'error', 'warning').\r\n * @param {string} [options.backgroundColor] - Custom background color for the toast notification.\r\n * @param {string} [options.textColor='white'] - Custom text color for the toast notification.\r\n * @param {string} [options.animationDuration='0.5s'] - Duration of the fade-in and fade-out animations.\r\n * @param {string} [options.animationEasing='ease'] - Easing function for the animations.\r\n * @param {boolean} [options.showCloseButton=false] - Whether to show a close button.\r\n * @return {void}\r\n */\r\n\r\n/** ########################################### Defaults ############################################ */\r\n\r\nconsole.log(\"Before toast creation\");\r\n\r\nlet defaultColors = {\r\n info: \"blue\",\r\n success: \"green\",\r\n error: \"red\",\r\n warning: \"darkorange\",\r\n};\r\n\r\nlet defaultMessages = {\r\n info: \"This is an info message.\",\r\n success: \"Action completed successfully!\",\r\n error: \"An error occurred!\",\r\n warning: \"This is a warning message!\",\r\n};\r\n\r\n// Flag to manage if a toast is currently being shown\r\nlet isToastShowing = false;\r\n\r\nfunction createToastContainer(position) {\r\n let toastContainer = document.getElementById(`toast-container-${position}`);\r\n if (!toastContainer) {\r\n toastContainer = document.createElement(\"div\");\r\n toastContainer.id = `toast-container-${position}`;\r\n toastContainer.style.position = \"fixed\";\r\n toastContainer.style.zIndex = \"9999\";\r\n setPosition(toastContainer, position);\r\n document.body.appendChild(toastContainer);\r\n }\r\n return toastContainer;\r\n}\r\n\r\nfunction setPosition(container, position) {\r\n if (position.includes(\"bottom\")) {\r\n container.style.bottom = \"10px\";\r\n } else if (position.includes(\"top\")) {\r\n container.style.top = \"10px\";\r\n }\r\n\r\n if (position.includes(\"right\")) {\r\n container.style.right = \"10px\";\r\n } else if (position.includes(\"left\")) {\r\n container.style.left = \"10px\";\r\n } else if (position.includes(\"center\")) {\r\n container.style.top = \"50%\";\r\n container.style.left = \"50%\";\r\n container.style.transform = \"translate(-50%, -50%)\";\r\n }\r\n}\r\n\r\nfunction createToastElement(finalMessage, backgroundColor, textColor, animationDuration, animationEasing, showCloseButton) {\r\n const toast = document.createElement(\"div\");\r\n toast.textContent = finalMessage;\r\n toast.style.background = backgroundColor;\r\n toast.style.color = textColor;\r\n toast.style.padding = \"10px 20px\";\r\n toast.style.marginTop = \"10px\";\r\n toast.style.borderRadius = \"5px\";\r\n toast.style.boxShadow = \"0 0 10px rgba(0, 0, 0, 0.1)\";\r\n toast.style.opacity = \"0\";\r\n toast.style.transition = `opacity ${animationDuration} ${animationEasing}`;\r\n\r\n if (showCloseButton) {\r\n addCloseButton(toast, textColor);\r\n }\r\n\r\n return toast;\r\n}\r\n\r\nfunction addCloseButton(toast, textColor) {\r\n const closeButton = document.createElement(\"button\");\r\n closeButton.textContent = \"×\";\r\n closeButton.style.marginLeft = \"10px\";\r\n closeButton.style.background = \"transparent\";\r\n closeButton.style.border = \"none\";\r\n closeButton.style.color = textColor;\r\n closeButton.style.cursor = \"pointer\";\r\n\r\n closeButton.onclick = () => {\r\n toast.style.opacity = \"0\"; // Start fade out\r\n toast.addEventListener(\"transitionend\", () => {\r\n toast.remove();\r\n isToastShowing = false; // Reset the flag when the toast is removed\r\n });\r\n };\r\n\r\n toast.appendChild(closeButton);\r\n}\r\n\r\nfunction showToast({ message, duration, position, type, backgroundColor, textColor, showCloseButton, animationDuration, animationEasing }) {\r\n if (isToastShowing) return;\r\n\r\n isToastShowing = true;\r\n\r\n const finalMessage = message || defaultMessages[type] || \"This is a default message.\";\r\n const toastBackgroundColor = backgroundColor || defaultColors[type] || \"gray\";\r\n const toastTextColor = textColor || (toastBackgroundColor === \"white\" ? \"black\" : \"white\");\r\n\r\n const toastContainer = createToastContainer(position);\r\n const toast = createToastElement(finalMessage, toastBackgroundColor, toastTextColor, animationDuration || '0.5s', animationEasing || 'ease', showCloseButton);\r\n\r\n toastContainer.appendChild(toast);\r\n requestAnimationFrame(() => {\r\n toast.style.opacity = \"1\"; // Fade in effect\r\n });\r\n\r\n setTimeout(() => {\r\n if (toast.parentNode) {\r\n toast.style.opacity = \"0\"; // Fade out effect\r\n toast.addEventListener(\"transitionend\", () => {\r\n toast.remove();\r\n isToastShowing = false; // Reset the flag when the toast is removed\r\n });\r\n }\r\n }, duration || 3000);\r\n}\r\n\r\n/**\r\n * Create a toast notification with the provided options.\r\n * \r\n * @param {Object} options - Options for the toast notification.\r\n * @param {string} [options.message] - The message to display in the toast.\r\n * @param {number} [options.duration=3000] - The duration of the toast in milliseconds.\r\n * @param {string} [options.position='bottom-right'] - The position of the toast.\r\n * @param {string} [options.type='info'] - The type of the toast.\r\n * @param {string} [options.backgroundColor] - The custom background color.\r\n * @param {string} [options.textColor='white'] - The custom text color.\r\n * @param {boolean} [options.showCloseButton=false] - Whether to show a close button.\r\n * @param {string} [options.animationDuration='0.5s'] - Duration of animations.\r\n * @param {string} [options.animationEasing='ease'] - Easing function for animations.\r\n * @return {void}\r\n */\r\nfunction createToast(options) {\r\n // Validate options\r\n if (typeof options !== 'object') {\r\n console.error(\"Options should be an object.\");\r\n return;\r\n }\r\n\r\n const {\r\n message,\r\n duration,\r\n position = \"bottom-right\",\r\n type = \"info\",\r\n backgroundColor,\r\n textColor,\r\n showCloseButton = false,\r\n animationDuration,\r\n animationEasing,\r\n } = options;\r\n\r\n // Validate duration\r\n if (duration && typeof duration !== 'number') {\r\n console.warn(\"Duration should be a number. Falling back to default value.\");\r\n }\r\n\r\n showToast({ message, duration: duration || 3000, position, type, backgroundColor, textColor, showCloseButton, animationDuration, animationEasing });\r\n}\r\n\r\n/**\r\n * Set default colors for toast types.\r\n * \r\n * @param {Object} newColors - New colors to set for toast types.\r\n * @return {void}\r\n */\r\nfunction setDefaultColors(newColors) {\r\n // Validate newColors\r\n if (typeof newColors !== 'object') {\r\n console.error(\"New colors should be an object.\");\r\n return;\r\n }\r\n \r\n Object.assign(defaultColors, newColors);\r\n}\r\n\r\n/**\r\n * Set default messages for toast types.\r\n * \r\n * @param {Object} newMessages - New messages to set for toast types.\r\n * @return {void}\r\n */\r\nfunction setDefaultMessages(newMessages) {\r\n // Validate newMessages\r\n if (typeof newMessages !== 'object') {\r\n console.error(\"New messages should be an object.\");\r\n return;\r\n }\r\n\r\n Object.assign(defaultMessages, newMessages);\r\n}\r\n\r\nexport { createToast, setDefaultColors, setDefaultMessages };\r\n\r\nconsole.log(\"After toast creation\");"],"names":["defaultColors","info","success","error","warning","defaultMessages","isToastShowing","createToastElement","finalMessage","backgroundColor","textColor","animationDuration","animationEasing","showCloseButton","toast","document","createElement","textContent","style","background","color","padding","marginTop","borderRadius","boxShadow","opacity","transition","closeButton","marginLeft","border","cursor","onclick","addEventListener","remove","appendChild","addCloseButton","showToast","message","duration","position","type","toastBackgroundColor","toastTextColor","toastContainer","getElementById","id","zIndex","container","includes","bottom","top","right","left","transform","setPosition","body","createToastContainer","requestAnimationFrame","setTimeout","parentNode","options","newColors","Object","assign","newMessages"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,39 +1,72 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "customizable-toast-notification",
|
|
3
|
-
"version": "3.0
|
|
4
|
-
"description": "A highly customizable toast notification library for modern web applications.",
|
|
3
|
+
"version": "3.1.0",
|
|
4
|
+
"description": "A lightweight and highly customizable toast notification library or component for modern web applications.",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.mjs",
|
|
7
|
+
"unpkg": "dist/index.umd.js",
|
|
8
|
+
"jsdelivr": "dist/index.umd.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
"import": "./dist/index.esm.mjs",
|
|
11
|
+
"require": "./dist/index.cjs.js",
|
|
12
|
+
"default": "./dist/index.umd.js"
|
|
13
|
+
},
|
|
7
14
|
"scripts": {
|
|
8
15
|
"build": "rollup -c",
|
|
9
16
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
10
17
|
},
|
|
11
18
|
"keywords": [
|
|
12
|
-
"javascript-library",
|
|
13
|
-
"toast-notification-library",
|
|
14
|
-
"toast-notification",
|
|
15
19
|
"toast",
|
|
20
|
+
"toast library",
|
|
21
|
+
"toast notification",
|
|
22
|
+
"toast ui",
|
|
23
|
+
"toast alert",
|
|
24
|
+
"toast message",
|
|
16
25
|
"notification",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
26
|
+
"ui notification",
|
|
27
|
+
"custom notification",
|
|
28
|
+
"javascript",
|
|
29
|
+
"javascript library",
|
|
30
|
+
"popup",
|
|
31
|
+
"popup notification",
|
|
32
|
+
"alert",
|
|
33
|
+
"frontend",
|
|
34
|
+
"ui notification",
|
|
19
35
|
"library",
|
|
20
|
-
"
|
|
21
|
-
"npm
|
|
22
|
-
"toast-library",
|
|
23
|
-
"toast",
|
|
24
|
-
"notification",
|
|
36
|
+
"message popup",
|
|
37
|
+
"npm library",
|
|
25
38
|
"npm",
|
|
26
|
-
"npm
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
39
|
+
"npm toast package",
|
|
40
|
+
"customizable",
|
|
41
|
+
"customizable toast notification",
|
|
42
|
+
"component",
|
|
43
|
+
"toast component",
|
|
44
|
+
"notification component",
|
|
45
|
+
"customisable",
|
|
46
|
+
"customisable toast notification",
|
|
47
|
+
"react component",
|
|
48
|
+
"react toast",
|
|
49
|
+
"frontend",
|
|
50
|
+
"frontend library",
|
|
30
51
|
"ESM",
|
|
31
|
-
"CJS"
|
|
52
|
+
"CJS",
|
|
53
|
+
"cdn",
|
|
54
|
+
"umd",
|
|
55
|
+
"notification",
|
|
56
|
+
"custom-toast",
|
|
57
|
+
"vanilla-js",
|
|
58
|
+
"lightweight"
|
|
32
59
|
],
|
|
33
|
-
"author":
|
|
34
|
-
|
|
60
|
+
"author": {
|
|
61
|
+
"name": "Priyanshu Patel",
|
|
62
|
+
"email": "priyanshu.alt191@gmail.com",
|
|
63
|
+
"url": "https://github.com/sammy-cool"
|
|
64
|
+
},
|
|
65
|
+
"license": "Apache-2.0",
|
|
35
66
|
"files": [
|
|
36
|
-
"dist"
|
|
67
|
+
"dist",
|
|
68
|
+
"README.md",
|
|
69
|
+
"LICENSE"
|
|
37
70
|
],
|
|
38
71
|
"devDependencies": {
|
|
39
72
|
"@rollup/plugin-commonjs": "^26.0.1",
|
|
@@ -41,11 +74,16 @@
|
|
|
41
74
|
"@rollup/plugin-replace": "^6.0.1",
|
|
42
75
|
"@rollup/plugin-terser": "^0.4.4",
|
|
43
76
|
"rollup": "^2.78.0",
|
|
77
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
44
78
|
"rollup-plugin-size-snapshot": "^0.12.0",
|
|
45
79
|
"rollup-plugin-visualizer": "^5.12.0"
|
|
46
80
|
},
|
|
47
81
|
"repository": {
|
|
48
82
|
"type": "git",
|
|
49
83
|
"url": "git+https://github.com/sammy-cool/customizable-toast-notification.git"
|
|
50
|
-
}
|
|
84
|
+
},
|
|
85
|
+
"bugs": {
|
|
86
|
+
"url": "https://github.com/sammy-cool/customizable-toast-notification/issues"
|
|
87
|
+
},
|
|
88
|
+
"homepage": "https://github.com/sammy-cool/customizable-toast-notification#readme"
|
|
51
89
|
}
|