kitzo 2.0.0 → 2.0.2

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
@@ -25,7 +25,7 @@ npm i kitzo
25
25
  or
26
26
 
27
27
  ```javascript
28
- <script src="https://cdn.jsdelivr.net/npm/kitzo@2.0.0/dist/kitzo.umd.min.js"></script>
28
+ <script src="https://cdn.jsdelivr.net/npm/kitzo@2.0.1/dist/kitzo.umd.min.js"></script>
29
29
  ```
30
30
 
31
31
  > Attach this script tag in the html head tag and you are good to go.
package/dist/react.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { useRef, useLayoutEffect, useState, useEffect } from 'react';
1
+ import React, { useRef, useLayoutEffect, useState, useEffect } from 'react';
2
2
 
3
3
  const listeners = new Set();
4
4
  let isStyleAdded = false;
@@ -319,7 +319,6 @@ function LoadingSvg() {
319
319
  })));
320
320
  }
321
321
 
322
- const GAP = 10;
323
322
  function Toast({
324
323
  toast,
325
324
  setToasts,
@@ -331,7 +330,7 @@ function Toast({
331
330
  const h = ref.current.getBoundingClientRect().height;
332
331
  setToasts(prev => prev.map(t => t.options.id === toast.id ? t : {
333
332
  ...t,
334
- offset: t.offset + h + GAP
333
+ offset: t.offset + h + 10
335
334
  }));
336
335
  }, [setToasts, toast.id]);
337
336
  if (position.includes('bottom')) {
@@ -378,7 +377,6 @@ function getToastPosition(position) {
378
377
  return styles;
379
378
  }
380
379
 
381
- const EXIT_ANIM_MS = 300;
382
380
  function ToastContainer(props) {
383
381
  props = Object.assign({
384
382
  position: 'top-center'
@@ -412,7 +410,7 @@ function ToastContainer(props) {
412
410
  ...t,
413
411
  leaving: true
414
412
  } : t));
415
- }, Math.max(0, duration - EXIT_ANIM_MS));
413
+ }, Math.max(0, duration - 300));
416
414
  setTimeout(() => {
417
415
  setToasts(prev => prev.filter(t => t.options.id !== id));
418
416
  }, duration);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitzo",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "A lightweight JavaScript UI micro-library.",
5
5
  "type": "module",
6
6
  "main": "./dist/kitzo.umd.js",