kitzo 2.1.3 → 2.1.5
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 +1 -1
- package/dist/react.esm.js +6 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ npm i kitzo
|
|
|
26
26
|
or
|
|
27
27
|
|
|
28
28
|
```javascript
|
|
29
|
-
<script src="https://cdn.jsdelivr.net/npm/kitzo@2.1.
|
|
29
|
+
<script src="https://cdn.jsdelivr.net/npm/kitzo@2.1.5/dist/kitzo.umd.min.js"></script>
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
> Vanilla: Attach this script tag in the html head tag and you are good to go.
|
package/dist/react.esm.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useRef, useLayoutEffect, useState, useEffect } from 'react';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
return `.toast-content,
|
|
3
|
+
const toastStyles = `.toast-content,
|
|
5
4
|
.toast-content-bottom {
|
|
6
5
|
font-size: 0.925rem;
|
|
7
6
|
}
|
|
@@ -183,20 +182,18 @@ function toastStyles() {
|
|
|
183
182
|
}
|
|
184
183
|
}
|
|
185
184
|
`;
|
|
186
|
-
}
|
|
187
185
|
const listeners = new Set();
|
|
188
|
-
let isStyleAdded$1 = false;
|
|
189
186
|
function addToast(toast) {
|
|
190
187
|
listeners.forEach(callback => {
|
|
191
188
|
callback(toast);
|
|
192
189
|
});
|
|
193
190
|
}
|
|
194
191
|
function subscribe(callback) {
|
|
195
|
-
if (!
|
|
192
|
+
if (!document.getElementById('kitzo-react-toast-styles')) {
|
|
196
193
|
const styleTag = document.createElement('style');
|
|
197
|
-
styleTag.
|
|
194
|
+
styleTag.id = 'kitzo-react-toast-styles';
|
|
195
|
+
styleTag.textContent = toastStyles;
|
|
198
196
|
document.head.appendChild(styleTag);
|
|
199
|
-
isStyleAdded$1 = true;
|
|
200
197
|
}
|
|
201
198
|
listeners.add(callback);
|
|
202
199
|
return () => listeners.delete(callback);
|
|
@@ -207,7 +204,7 @@ function toast(text = 'Toast message', options = {}) {
|
|
|
207
204
|
duration: 2000,
|
|
208
205
|
id,
|
|
209
206
|
style: {},
|
|
210
|
-
showIcon:
|
|
207
|
+
showIcon: false
|
|
211
208
|
}, options);
|
|
212
209
|
addToast({
|
|
213
210
|
type: 'success',
|
|
@@ -561,7 +558,7 @@ const tooltipStyles = `
|
|
|
561
558
|
font-size: 0.875rem;
|
|
562
559
|
background-color: hsl(0, 0%, 15%);
|
|
563
560
|
color: hsl(0, 0%, 95%);
|
|
564
|
-
padding-block:
|
|
561
|
+
padding-block: 6px;
|
|
565
562
|
padding-inline: 10px;
|
|
566
563
|
border-radius: 0.325rem;
|
|
567
564
|
|