@sarunyu/system-one 4.9.13 → 4.9.18

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/dist/index.cjs CHANGED
@@ -4186,7 +4186,7 @@ const Toast = React.forwardRef(function Toast2({
4186
4186
  );
4187
4187
  });
4188
4188
  Toast.displayName = "Toast";
4189
- function ToastStack({ items, className, renderItem }) {
4189
+ function ToastStack({ items = [], className, renderItem }) {
4190
4190
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex flex-col gap-2", className), children: items.map(
4191
4191
  (item) => renderItem ? /* @__PURE__ */ jsxRuntime.jsx("div", { children: renderItem(item) }, item.id) : /* @__PURE__ */ jsxRuntime.jsx(Toast, { ...item }, item.id)
4192
4192
  ) });
@@ -4194,6 +4194,9 @@ function ToastStack({ items, className, renderItem }) {
4194
4194
  function Toaster({ items, renderItem, className, duration = 4e3, onRemove }) {
4195
4195
  const timers = React.useRef(/* @__PURE__ */ new Map());
4196
4196
  React.useEffect(() => {
4197
+ if (duration > 0 && !onRemove) {
4198
+ console.warn("[Toaster] duration is set but onRemove is not provided — toasts will never dismiss. Pass onRemove={(id) => setToasts(t => t.filter(x => x.id !== id))} to enable auto-dismiss.");
4199
+ }
4197
4200
  if (!onRemove || duration === 0) return;
4198
4201
  items.forEach((item) => {
4199
4202
  if (!timers.current.has(item.id)) {