customizable-toast-notification 3.3.0 → 3.3.1

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
@@ -39,6 +39,7 @@ A simple and highly customizable toast notification library for modern JavaScrip
39
39
  - Adjustable display duration and positioning on the screen.
40
40
  - Close button functionality for user control.
41
41
  - Animation effects for a smooth appearance and disappearance.
42
+ - **NEW**: Optional animated progress bar synced to duration
42
43
 
43
44
  ## Installation
44
45
 
@@ -97,23 +98,35 @@ Creates a toast notification with the provided options.
97
98
 
98
99
  #### Parameters
99
100
 
100
- - `options` (Object): Options for the toast notification.
101
- - `message` (string, optional): The message to display in the toast. Defaults based on type if not provided.
102
- - `duration` (number, optional): The duration the toast should be displayed, in milliseconds (default is 3000).
103
- - `position` (string, optional): The position of the toast on the screen (default is 'bottom-right').
104
- - `type` (string, optional): The type of the toast (info, success, error, warning, default is 'info').
105
- - `backgroundColor` (string, optional): Custom background color for the toast notification.
106
- - `textColor` (string, optional): Custom text color for the toast notification (default is 'white').
107
- - `showCloseButton` (boolean, optional): Whether to show a close button (default is false).
108
- - `animationDuration` (string, optional): Duration of the fade-in and fade-out animations (default is '0.5s').
109
- - `animationEasing` (string, optional): Easing function for the animations (default is 'ease').
101
+ ### ⚙️ Options
102
+
103
+ | Option | Type | Default | Description |
104
+ | ------------------- | --------- | --------------- | ----------------------------------------------------- |
105
+ | `message` | `string` | Based on `type` | The toast content/message. |
106
+ | `duration` | `number` | `3000` | Time in milliseconds to auto-dismiss. |
107
+ | `position` | `string` | `bottom-right` | Position on screen (`top-left`, `bottom-right`, etc.) |
108
+ | `type` | `string` | `info` | One of: `info`, `success`, `error`, `warning` |
109
+ | `backgroundColor` | `string` | Based on `type` | Override background color. |
110
+ | `textColor` | `string` | `white` | Override text color. |
111
+ | `showCloseButton` | `boolean` | `false` | Show a close (×) button. |
112
+ | `animationDuration` | `string` | `0.5s` | CSS duration for fade in/out. |
113
+ | `animationEasing` | `string` | `ease` | CSS easing function for transitions. |
114
+ | `showProgressBar` | `boolean` | `false` | Show a countdown progress bar. |
115
+ | `progressColor` | `string` | `textColor` | Color of the progress bar. |
116
+ | `progressHeight` | `string` | `4px` | Height of the progress bar. |
117
+ | `progressPosition` | `string` | `bottom` | Position of the progress bar: `top` or `bottom`. |
110
118
 
111
119
  #### Example
112
120
 
113
121
  ```javascript
114
122
  createToast({
115
- message: "Operation completed successfully!",
116
- type: "success",
123
+ message: "Uploading file...",
124
+ type: "info",
125
+ duration: 5000,
126
+ showProgressBar: true,
127
+ progressColor: "#ffffff",
128
+ progressHeight: "4px",
129
+ progressPosition: "top",
117
130
  });
118
131
  ```
119
132
 
@@ -2,7 +2,7 @@
2
2
  * @fileoverview A simple toast notification library for any JavaScript framework.
3
3
  * @name Customizable Toast Notifications
4
4
  * @author Priyanshu Patel
5
- * @version "3.2.0"
5
+ * @version "3.3.1"
6
6
  * @build Production
7
7
  * @license Apache-2.0
8
8
  * @depends None
package/dist/index.umd.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * @fileoverview A simple toast notification library for any JavaScript framework.
4
4
  * @name Customizable Toast Notifications
5
5
  * @author Priyanshu Patel
6
- * @version "3.2.0"
6
+ * @version "3.3.1"
7
7
  * @build Production
8
8
  * @license Apache-2.0
9
9
  * @depends None
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "customizable-toast-notification",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "A lightweight and highly customizable toast notification library or component for modern web applications.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",