@sarunyu/system-one 4.9.12 → 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 +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/src/components/toast.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/llms.txt +16 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4167,7 +4167,7 @@ const Toast = forwardRef(function Toast2({
|
|
|
4167
4167
|
);
|
|
4168
4168
|
});
|
|
4169
4169
|
Toast.displayName = "Toast";
|
|
4170
|
-
function ToastStack({ items, className, renderItem }) {
|
|
4170
|
+
function ToastStack({ items = [], className, renderItem }) {
|
|
4171
4171
|
return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col gap-2", className), children: items.map(
|
|
4172
4172
|
(item) => renderItem ? /* @__PURE__ */ jsx("div", { children: renderItem(item) }, item.id) : /* @__PURE__ */ jsx(Toast, { ...item }, item.id)
|
|
4173
4173
|
) });
|
|
@@ -4175,6 +4175,9 @@ function ToastStack({ items, className, renderItem }) {
|
|
|
4175
4175
|
function Toaster({ items, renderItem, className, duration = 4e3, onRemove }) {
|
|
4176
4176
|
const timers = useRef(/* @__PURE__ */ new Map());
|
|
4177
4177
|
useEffect(() => {
|
|
4178
|
+
if (duration > 0 && !onRemove) {
|
|
4179
|
+
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.");
|
|
4180
|
+
}
|
|
4178
4181
|
if (!onRemove || duration === 0) return;
|
|
4179
4182
|
items.forEach((item) => {
|
|
4180
4183
|
if (!timers.current.has(item.id)) {
|