@liner-fe/prism 1.13.22 → 1.13.24
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/lib/index.mjs +6 -4
- package/lib/index.mjs.map +2 -2
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -6961,21 +6961,23 @@ var Button = forwardRef((props, ref) => {
|
|
|
6961
6961
|
});
|
|
6962
6962
|
|
|
6963
6963
|
// src/components/Toast/hooks/useToast.ts
|
|
6964
|
-
import { atom,
|
|
6964
|
+
import { atom, useSetRecoilState } from "recoil";
|
|
6965
6965
|
var toastAtom = atom({
|
|
6966
6966
|
default: { list: [] },
|
|
6967
6967
|
key: "toastAtoms"
|
|
6968
6968
|
});
|
|
6969
6969
|
var ONE_SECOND = 1e3;
|
|
6970
6970
|
var useToast = /* @__PURE__ */ __name(() => {
|
|
6971
|
-
const
|
|
6971
|
+
const setToasts = useSetRecoilState(toastAtom);
|
|
6972
6972
|
return {
|
|
6973
6973
|
open: /* @__PURE__ */ __name((toast) => {
|
|
6974
6974
|
const toastId = Date.now() + Math.random();
|
|
6975
6975
|
const timer = toast.button ? ONE_SECOND * 5 : ONE_SECOND + 800;
|
|
6976
6976
|
const list = { toastId, timer, ...toast };
|
|
6977
|
-
setToasts({
|
|
6978
|
-
|
|
6977
|
+
setToasts((prev) => {
|
|
6978
|
+
return {
|
|
6979
|
+
list: [...prev.list, list]
|
|
6980
|
+
};
|
|
6979
6981
|
});
|
|
6980
6982
|
return { toastId };
|
|
6981
6983
|
}, "open"),
|