d9-toast 1.4.28 → 1.4.29

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.
Files changed (2) hide show
  1. package/README.md +6 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -94,11 +94,12 @@ function MyComponent() {
94
94
  ### `useToast()`
95
95
 
96
96
  ```ts
97
- const { showToast, removeToast, removeToastAll } = useToast();
97
+ const { sounds, showToast, removeToast, removeToastAll } = useToast();
98
98
  ```
99
99
 
100
100
  | Method | Description |
101
101
  | -------------------- | --------------------------------- |
102
+ | `sounds` | Available toast sounds `"success" \| "error" \| "info" \| "warning"` |
102
103
  | `showToast(options)` | Show a toast and returns its `id` |
103
104
  | `removeToast(id)` | Remove toast by ID |
104
105
  | `removeToastAll()` | Clear all toasts |
@@ -139,6 +140,7 @@ actions?: {
139
140
  **Example**
140
141
 
141
142
  ```jsx
143
+
142
144
  showToast({
143
145
  message: "File uploaded",
144
146
  actions: [
@@ -168,6 +170,8 @@ audio?: {
168
170
  ### Example
169
171
 
170
172
  ```jsx
173
+ const { sounds, showToast } = useToast();
174
+
171
175
  showToast({
172
176
  message: "Message sent",
173
177
  type: "success",
@@ -175,6 +179,7 @@ showToast({
175
179
  enabled: true,
176
180
  volume: 0.8,
177
181
  cooldown: 500,
182
+ audioFile: sounds.success,
178
183
  },
179
184
  });
180
185
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "d9-toast",
3
- "version": "1.4.28",
3
+ "version": "1.4.29",
4
4
  "description": "Customizable toast notifications for React",
5
5
  "homepage": "https://codesandbox.io/embed/cqkyzm?view=preview",
6
6
  "repository": {