kitzo 2.3.13 → 2.3.15

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
@@ -4,7 +4,7 @@
4
4
 
5
5
  ---
6
6
 
7
- ### 📦 Installation
7
+ ### Installation
8
8
 
9
9
  ```bash
10
10
  npm install kitzo
@@ -12,28 +12,28 @@ npm install kitzo
12
12
 
13
13
  ---
14
14
 
15
- ### 🚀 Core Features
15
+ ### Core Features
16
16
 
17
17
  #### Components
18
18
 
19
- - 🍞 **Toast** — Accessible, animated notifications.
20
- - 💡 **Tooltip** — Smart-positioned contextual labels.
19
+ - **Toast** — Accessible, animated notifications.
20
+ - **Tooltip** — Smart-positioned contextual labels.
21
21
 
22
22
  #### Hooks
23
23
 
24
- - ⏱️ **useDebounce** — Optimize performance by delaying execution.
25
- - 📏 **useWindowSize** — Real-time viewport dimensions.
26
- - 📋 **useCopy** — Simple "copy to clipboard" functionality.
24
+ - **useDebounce** — Optimize performance by delaying execution.
25
+ - **useWindowSize** — Real-time viewport dimensions.
26
+ - **useCopy** — Simple "copy to clipboard" functionality.
27
27
 
28
28
  ---
29
29
 
30
- ### 📖 Documentation
30
+ ### Documentation
31
31
 
32
32
  For usage guides and live demos, visit documentation:
33
33
  [https://kitzo.vercel.app](https://kitzo.vercel.app)
34
34
 
35
35
  ---
36
36
 
37
- ### 📄 License
37
+ ### License
38
38
 
39
39
  MIT
@@ -1,20 +1,19 @@
1
- import { LEAVE_DELAY as l, clearAllTimers as d, clearTimer as f } from "./timers.js";
2
- function m({ toast: t, setToasts: n }) {
3
- if (!t.id) {
4
- let i = 0;
5
- if (n((e) => (i = e.length, e.length === 0 ? e : e.map((r) => ({ ...r, status: "leaving" })))), i === 0) return;
6
- setTimeout(() => {
7
- n([]);
8
- }, l), d();
1
+ import { LEAVE_DELAY as a, clearAllTimers as m, clearTimer as u } from "./timers.js";
2
+ function n({ toast: l, setToasts: r }) {
3
+ if (!l.id) {
4
+ r((e) => e.map((i) => ({ ...i, status: "leaving" }))), setTimeout(() => {
5
+ r((e) => e.filter((i) => i.status !== "leaving"));
6
+ }, a), m();
9
7
  return;
10
8
  }
11
- let u = !0;
12
- n((i) => i.find((r) => r.id === t.id) ? i.map(
13
- (r) => r.id === t.id ? { ...r, status: "leaving" } : r
14
- ) : (u = !1, i)), u && (f(t.id), setTimeout(() => {
15
- n((i) => i.filter((e) => e.id !== t.id));
16
- }, l));
9
+ u(l.id), r(
10
+ (e) => e.map((i) => i.id === l.id ? { ...i, status: "leaving" } : i)
11
+ ), setTimeout(() => {
12
+ r(
13
+ (e) => e.filter((i) => !(i.id === l.id && i.status === "leaving"))
14
+ );
15
+ }, a);
17
16
  }
18
17
  export {
19
- m as default
18
+ n as default
20
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitzo",
3
- "version": "2.3.13",
3
+ "version": "2.3.15",
4
4
  "description": "A lightweight React micro-utility.",
5
5
  "type": "module",
6
6
  "files": [