boottent-design 0.1.183 → 0.1.185
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/components.cjs.js +1 -1
- package/dist/components.es.js +202 -202
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +28 -25
- package/dist/{index-DO2H40nY.cjs → index-BydYbLSq.cjs} +29 -29
- package/dist/{index-DERz-mZx.js → index-D6lL3AG_.js} +3515 -3435
- package/dist/provider.cjs.js +1 -1
- package/dist/provider.es.js +110 -47
- package/dist/toast-form-D-mN24Yl.cjs +1 -0
- package/dist/toast-form-tgb0rBlD.js +195 -0
- package/dist/types/components.d.ts +34 -3
- package/dist/types/hooks.d.ts +83 -9
- package/dist/types/provider.d.ts +4 -0
- package/dist/types/types.d.ts +7 -2
- package/dist/types/ui.d.ts +34 -1
- package/dist/ui.cjs.js +3 -3
- package/dist/ui.es.js +182 -174
- package/dist/use-toastmodal-BhR-ysRN.js +280 -0
- package/dist/use-toastmodal-BiqEXQyI.cjs +1 -0
- package/package.json +1 -1
- package/dist/portal-manager-CHYJ8sxF.js +0 -111
- package/dist/portal-manager-CfN0m-a6.cjs +0 -1
- package/dist/toast-form-CAtNvqG5.cjs +0 -1
- package/dist/toast-form-W87kCvry.js +0 -203
- package/dist/use-toast-C2k0XaPV.js +0 -97
- package/dist/use-toast-CMqCb_5N.cjs +0 -1
package/dist/hooks.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./use-metadata-CZiZDN9j.cjs");require("react/jsx-runtime");const l=require("react"),e=require("./use-toastmodal-BiqEXQyI.cjs");require("./index-BoeM4gLz.cjs");const d=()=>{const[n,s]=l.useState([]);return l.useEffect(()=>{const t=(r,c)=>{s(c?a=>a.includes(r.id)?a:[...a,r.id]:a=>a.filter(u=>u!==r.id))},o=e.portalManager.subscribe(t);return s(e.portalManager.getOpenPortals()),()=>{o()}},[]),{modal:t=>{const{onClose:o=()=>{}}=t;return e.portalManager.showPortal("modal",{...t,onClose:o})},toast:t=>{let o;return typeof t=="string"?o={description:t}:o=t,e.portalManager.showPortal("toast",o)},alert:t=>{let o;return typeof t=="string"?o={description:t,onClose:()=>{}}:o={...t,onClose:t.onClose||(()=>{})},e.portalManager.showPortal("alert",o)},dialog:t=>{const{onClose:o=()=>{}}=t;return e.portalManager.showPortal("dialog",{...t,onClose:o})},custom:t=>{const{onClose:o=()=>{}}=t;return e.portalManager.showPortal("custom",{...t,onClose:o})},getIsOpen:t=>e.portalManager.getIsPortalOpen(t),closePortal:t=>{e.portalManager.closePortal(t)},closeAllPortals:()=>{e.portalManager.closeAllPortals()},openPortals:n}};exports.useMetadata=i.useMetadata;exports.modalReducer=e.modalReducer;exports.toast=e.toast;exports.toastModal=e.toastModal;exports.toastReducer=e.toastReducer;exports.useToast=e.useToast;exports.useToastModal=e.useToastModal;exports.usePortal=d;
|
package/dist/hooks.es.js
CHANGED
|
@@ -1,48 +1,51 @@
|
|
|
1
|
-
import { u as
|
|
1
|
+
import { u as R } from "./use-metadata-BrY8rtWx.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { p as
|
|
3
|
+
import { useState as u, useEffect as i } from "react";
|
|
4
|
+
import { p as s } from "./use-toastmodal-BhR-ysRN.js";
|
|
5
|
+
import { m as p, a as E, b as S, t as j, u as k, c as q } from "./use-toastmodal-BhR-ysRN.js";
|
|
5
6
|
import "./index-haM7BOE0.js";
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return r(e.getOpenPortals()), () => {
|
|
7
|
+
const A = () => {
|
|
8
|
+
const [a, r] = u([]);
|
|
9
|
+
return i(() => {
|
|
10
|
+
const t = (l, n) => {
|
|
11
|
+
r(n ? (e) => e.includes(l.id) ? e : [...e, l.id] : (e) => e.filter((c) => c !== l.id));
|
|
12
|
+
}, o = s.subscribe(t);
|
|
13
|
+
return r(s.getOpenPortals()), () => {
|
|
14
14
|
o();
|
|
15
15
|
};
|
|
16
16
|
}, []), { modal: (t) => {
|
|
17
17
|
const { onClose: o = () => {
|
|
18
18
|
} } = t;
|
|
19
|
-
return
|
|
19
|
+
return s.showPortal("modal", { ...t, onClose: o });
|
|
20
20
|
}, toast: (t) => {
|
|
21
21
|
let o;
|
|
22
|
-
return typeof t == "string" ? o = { description: t } : o = t,
|
|
22
|
+
return typeof t == "string" ? o = { description: t } : o = t, s.showPortal("toast", o);
|
|
23
23
|
}, alert: (t) => {
|
|
24
24
|
let o;
|
|
25
25
|
return typeof t == "string" ? o = { description: t, onClose: () => {
|
|
26
26
|
} } : o = { ...t, onClose: t.onClose || (() => {
|
|
27
|
-
}) },
|
|
27
|
+
}) }, s.showPortal("alert", o);
|
|
28
28
|
}, dialog: (t) => {
|
|
29
29
|
const { onClose: o = () => {
|
|
30
30
|
} } = t;
|
|
31
|
-
return
|
|
31
|
+
return s.showPortal("dialog", { ...t, onClose: o });
|
|
32
32
|
}, custom: (t) => {
|
|
33
33
|
const { onClose: o = () => {
|
|
34
34
|
} } = t;
|
|
35
|
-
return
|
|
36
|
-
}, getIsOpen: (t) =>
|
|
37
|
-
|
|
35
|
+
return s.showPortal("custom", { ...t, onClose: o });
|
|
36
|
+
}, getIsOpen: (t) => s.getIsPortalOpen(t), closePortal: (t) => {
|
|
37
|
+
s.closePortal(t);
|
|
38
38
|
}, closeAllPortals: () => {
|
|
39
|
-
|
|
40
|
-
}, openPortals:
|
|
39
|
+
s.closeAllPortals();
|
|
40
|
+
}, openPortals: a };
|
|
41
41
|
};
|
|
42
42
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
p as modalReducer,
|
|
44
|
+
E as toast,
|
|
45
|
+
S as toastModal,
|
|
46
|
+
j as toastReducer,
|
|
47
|
+
R as useMetadata,
|
|
48
|
+
A as usePortal,
|
|
49
|
+
k as useToast,
|
|
50
|
+
q as useToastModal
|
|
48
51
|
};
|