@nexub/react 3.3.0 → 3.5.0

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.
@@ -28,6 +28,11 @@ function Toaster({ expand = false, visibleToasts = 3 }) {
28
28
  const heights = React.useRef(/* @__PURE__ */ new Map());
29
29
  const state = React.useRef({ order, expanded, visibleToasts });
30
30
  state.current = { order, expanded, visibleToasts };
31
+ const timers = React.useRef(/* @__PURE__ */ new Set());
32
+ React.useEffect(() => {
33
+ const pending = timers.current;
34
+ return () => pending.forEach(clearTimeout);
35
+ }, []);
31
36
  const layout = React.useCallback(() => {
32
37
  const ol = viewportRef.current;
33
38
  if (!ol) return;
@@ -101,7 +106,8 @@ function Toaster({ expand = false, visibleToasts = 3 }) {
101
106
  if (open) return;
102
107
  fireToastClose(t);
103
108
  setClosed((s) => new Set(s).add(t.id));
104
- setTimeout(() => {
109
+ const timer = setTimeout(() => {
110
+ timers.current.delete(timer);
105
111
  toast.dismiss(t.id);
106
112
  setClosed((s) => {
107
113
  const next = new Set(s);
@@ -109,6 +115,7 @@ function Toaster({ expand = false, visibleToasts = 3 }) {
109
115
  return next;
110
116
  });
111
117
  }, 1e3);
118
+ timers.current.add(timer);
112
119
  },
113
120
  className: cn(
114
121
  "group pointer-events-auto absolute inset-x-4 top-4 flex items-center justify-between gap-3 overflow-hidden rounded-shape-container bg-[var(--color-inverse-surface)] py-3 ps-4 pe-2 text-[var(--color-inverse-on-surface)] shadow-elevation-2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexub/react",
3
- "version": "3.3.0",
3
+ "version": "3.5.0",
4
4
  "description": "React component library for Nexub Design System — 90+ accessible, themeable UI components built on Radix UI primitives.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -79,13 +79,13 @@
79
79
  "date-fns": "^4.4.0",
80
80
  "react-day-picker": "^10.0.2",
81
81
  "tailwind-merge": "^3.7.0",
82
- "@nexub/icons": "3.3.0",
83
- "@nexub/core": "3.3.0"
82
+ "@nexub/core": "3.5.0",
83
+ "@nexub/icons": "3.5.0"
84
84
  },
85
85
  "peerDependencies": {
86
86
  "react": ">=18 <20",
87
87
  "react-dom": ">=18 <20",
88
- "@nexub/tokens": "^3.3.0"
88
+ "@nexub/tokens": "^3.5.0"
89
89
  },
90
90
  "devDependencies": {
91
91
  "@playwright/test": "1.64.0",
@@ -111,8 +111,8 @@
111
111
  "vaul": "1.1.2",
112
112
  "vite": "^8.3.5",
113
113
  "vitest": "^5.0.5",
114
- "@nexub/themes": "3.3.0",
115
- "@nexub/tokens": "3.3.0"
114
+ "@nexub/themes": "3.5.0",
115
+ "@nexub/tokens": "3.5.0"
116
116
  },
117
117
  "scripts": {
118
118
  "build": "rm -rf dist && tsup && tsc -p tsconfig.build.json && rm -f dist/vendor/*.d.ts && node scripts/check-dts.mjs && tailwindcss -i src/styles.css -o dist/styles.css --minify && cp -R ../themes/src/fonts dist/fonts",