boottent-design 0.1.78 → 0.1.80
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/boottent-design.hooks.cjs.js +1 -1
- package/dist/boottent-design.hooks.es.js +31 -2
- package/dist/boottent-design.layout.cjs.js +1 -1
- package/dist/boottent-design.layout.es.js +56 -6
- package/dist/boottent-design.provider.cjs.js +1 -1
- package/dist/boottent-design.provider.es.js +108 -2
- package/dist/boottent-design.ui.cjs.js +1 -1
- package/dist/boottent-design.ui.es.js +996 -27
- package/dist/boottent-design.utils.cjs.js +1 -1
- package/dist/boottent-design.utils.es.js +8 -2378
- package/dist/{index-BshWFt1Y.js → index-7TdmKUbH.js} +1 -1
- package/dist/index-BIxKM0nQ.cjs +1 -0
- package/dist/index-Bf4XH3AK.cjs +1 -0
- package/dist/index-WGpe0bEl.js +2380 -0
- package/dist/toggleButtonGroup-primitive-CibJg54C.cjs +52 -0
- package/dist/{toggleButtonGroup-primitive-DPb6avPH.js → toggleButtonGroup-primitive-ZAStZ2ee.js} +4010 -3271
- package/dist/types/feature.d.ts +220 -161
- package/dist/types/hooks.d.ts +222 -163
- package/dist/types/layout.d.ts +223 -163
- package/dist/types/provider.d.ts +220 -161
- package/dist/types/styles.d.ts +220 -161
- package/dist/types/types.d.ts +222 -163
- package/dist/types/ui.d.ts +378 -166
- package/dist/types/utils.d.ts +222 -163
- package/package.json +9 -4
- package/dist/boottent-design.main.cjs.js +0 -1
- package/dist/boottent-design.main.es.js +0 -48
- package/dist/index-BfapRZRW.js +0 -55
- package/dist/index-CMZc7WAs.js +0 -599
- package/dist/index-D286MlPY.cjs +0 -1
- package/dist/index-DDNLKhqC.cjs +0 -1
- package/dist/index-Ly7gJulk.cjs +0 -1
- package/dist/portal-provider-BB1ZUJea.cjs +0 -1
- package/dist/portal-provider-Z7EnJtHu.js +0 -110
- package/dist/toggleButtonGroup-primitive-CC3iAt_X.cjs +0 -52
- package/dist/types/main.d.ts +0 -1129
- package/dist/use-portal-BhH8jBDX.cjs +0 -1
- package/dist/use-portal-HyR5LGEj.js +0 -33
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { jsxs as m, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { P as p, T as C, g as h, f as P, M as b } from "./toggleButtonGroup-primitive-DPb6avPH.js";
|
|
3
|
-
import { useState as g, useEffect as c, useCallback as l } from "react";
|
|
4
|
-
import { p as f } from "./portal-manager-nNJ4SIa2.js";
|
|
5
|
-
import { toast as T } from "./boottent-design.utils.es.js";
|
|
6
|
-
const z = () => {
|
|
7
|
-
const [t, u] = g([]);
|
|
8
|
-
c(() => {
|
|
9
|
-
const s = f.subscribe(
|
|
10
|
-
(e, r) => {
|
|
11
|
-
u((i) => {
|
|
12
|
-
if (r) {
|
|
13
|
-
if (!i.find((o) => o.id === e.id))
|
|
14
|
-
return [...i, { ...e, isOpen: r }];
|
|
15
|
-
} else
|
|
16
|
-
return i.map(
|
|
17
|
-
(o) => o.id === e.id ? { ...o, isOpen: r } : o
|
|
18
|
-
);
|
|
19
|
-
return i;
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
return () => {
|
|
24
|
-
s();
|
|
25
|
-
};
|
|
26
|
-
}, []);
|
|
27
|
-
const n = l((s) => {
|
|
28
|
-
f.setPortalOpen(s, !1);
|
|
29
|
-
}, []);
|
|
30
|
-
c(() => {
|
|
31
|
-
const s = [];
|
|
32
|
-
return t.forEach((e) => {
|
|
33
|
-
if (!e.isOpen) {
|
|
34
|
-
const r = setTimeout(() => {
|
|
35
|
-
u((i) => i.filter((o) => o.id !== e.id));
|
|
36
|
-
}, 300);
|
|
37
|
-
s.push(r);
|
|
38
|
-
}
|
|
39
|
-
}), () => {
|
|
40
|
-
s.forEach((e) => clearTimeout(e));
|
|
41
|
-
};
|
|
42
|
-
}, [t]);
|
|
43
|
-
const d = l((s) => {
|
|
44
|
-
const e = s.props;
|
|
45
|
-
T({
|
|
46
|
-
title: e.title,
|
|
47
|
-
description: e.description,
|
|
48
|
-
action: e.action,
|
|
49
|
-
closeButton: e.closeButton,
|
|
50
|
-
variant: e.variant,
|
|
51
|
-
position: e.position,
|
|
52
|
-
size: e.size,
|
|
53
|
-
className: e.className
|
|
54
|
-
}), n(s.id);
|
|
55
|
-
}, [n]);
|
|
56
|
-
return c(() => {
|
|
57
|
-
t.forEach((s) => {
|
|
58
|
-
s.type === "toast" && s.isOpen && d(s);
|
|
59
|
-
});
|
|
60
|
-
}, [t, d]), /* @__PURE__ */ m(p, { children: [
|
|
61
|
-
/* @__PURE__ */ a(C, {}),
|
|
62
|
-
t.map((s) => {
|
|
63
|
-
var e;
|
|
64
|
-
if (!s.isOpen) return null;
|
|
65
|
-
switch (s.type) {
|
|
66
|
-
case "modal":
|
|
67
|
-
return /* @__PURE__ */ a(
|
|
68
|
-
b,
|
|
69
|
-
{
|
|
70
|
-
...s.props,
|
|
71
|
-
onClose: () => {
|
|
72
|
-
s.props.onClose && s.props.onClose(), n(s.id);
|
|
73
|
-
},
|
|
74
|
-
description: (e = s.props.description) == null ? void 0 : e.toString()
|
|
75
|
-
},
|
|
76
|
-
s.id
|
|
77
|
-
);
|
|
78
|
-
case "alert":
|
|
79
|
-
return /* @__PURE__ */ a(
|
|
80
|
-
P,
|
|
81
|
-
{
|
|
82
|
-
...s.props,
|
|
83
|
-
onClose: () => {
|
|
84
|
-
s.props.onClose && s.props.onClose(), n(s.id);
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
s.id
|
|
88
|
-
);
|
|
89
|
-
case "dialog":
|
|
90
|
-
return /* @__PURE__ */ a(
|
|
91
|
-
h,
|
|
92
|
-
{
|
|
93
|
-
...s.props,
|
|
94
|
-
onClose: () => {
|
|
95
|
-
s.props.onClose && s.props.onClose(), n(s.id);
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
s.id
|
|
99
|
-
);
|
|
100
|
-
case "toast":
|
|
101
|
-
return null;
|
|
102
|
-
default:
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
})
|
|
106
|
-
] });
|
|
107
|
-
};
|
|
108
|
-
export {
|
|
109
|
-
z as P
|
|
110
|
-
};
|