prometeo-design-system 5.7.1 → 5.7.2
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/DrawerMobile.es.js
CHANGED
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { c as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
const
|
|
6
|
-
const { children:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}, [
|
|
1
|
+
import { j as w } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
+
import { c as z } from "./cn-B6yFEsav.js";
|
|
3
|
+
import ce, { forwardRef as de, useState as A, useRef as h, useEffect as x, useCallback as i, useMemo as le, useImperativeHandle as ge } from "react";
|
|
4
|
+
import { createPortal as he } from "react-dom";
|
|
5
|
+
const X = 44, me = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", ye = de((f, l) => {
|
|
6
|
+
const { children: R, defaultOpen: L = !1, onClose: j, snapPoints: o = ["auto"], setSnap: d, snap: a, attachToParent: F = !1 } = f, [m, u] = A(a || "0%"), [N, C] = A(null), D = h(j), H = h(d), r = h(N), b = h(/* @__PURE__ */ new Set());
|
|
7
|
+
D.current = j, r.current = N, x(() => {
|
|
8
|
+
L && E();
|
|
9
|
+
}, [L]), x(() => {
|
|
10
10
|
H.current = d;
|
|
11
11
|
}, [d]);
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
}, []),
|
|
15
|
-
|
|
16
|
-
}, [o]),
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
const T = i(() => {
|
|
13
|
+
u("0%"), D.current?.(r.current), setTimeout(() => C(null), 300);
|
|
14
|
+
}, []), E = i((p, O) => {
|
|
15
|
+
u(p || o[0] || "60%"), C(O ?? null);
|
|
16
|
+
}, [o]), M = le(() => m !== "0%", [m]);
|
|
17
|
+
x(() => {
|
|
18
|
+
b.current.forEach((p) => {
|
|
19
19
|
try {
|
|
20
|
-
p(
|
|
20
|
+
p(M);
|
|
21
21
|
} catch {
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
}, [
|
|
25
|
-
open:
|
|
26
|
-
close:
|
|
27
|
-
isOpen:
|
|
28
|
-
subscribeOpenChange: (p) => (
|
|
29
|
-
|
|
24
|
+
}, [M]), ge(l, () => ({
|
|
25
|
+
open: E,
|
|
26
|
+
close: T,
|
|
27
|
+
isOpen: M,
|
|
28
|
+
subscribeOpenChange: (p) => (b.current.add(p), () => {
|
|
29
|
+
b.current.delete(p);
|
|
30
30
|
}),
|
|
31
31
|
getContext: () => r.current
|
|
32
|
-
}), [
|
|
33
|
-
const
|
|
34
|
-
return
|
|
35
|
-
}),
|
|
36
|
-
const r =
|
|
32
|
+
}), [E, T, M]);
|
|
33
|
+
const $ = a || m;
|
|
34
|
+
return F ? /* @__PURE__ */ w.jsx(ie, { ...f, snap: $, setSnap: u, context: N, children: R }) : he(/* @__PURE__ */ w.jsx(ie, { ...f, snap: $, setSnap: u, context: N, children: R }), document.body);
|
|
35
|
+
}), ie = ({ children: f, attachToParent: l = !1, className: R, classNameContent: L, classNameFooter: j, snap: o, snapPoints: d = [0, "auto", 1], setSnap: a, hideOnClose: F = !1, unmountChildrenOnClose: m = !1, header: u, modal: N = !1, closeOnOverlayClick: C = !1, context: D, footer: H }) => {
|
|
36
|
+
const r = h(null), b = h(null), T = h(null), E = h(null), M = h(null), $ = h(0), y = h(null), p = h(null), O = i(() => {
|
|
37
37
|
if (!r.current) return [];
|
|
38
|
-
const e =
|
|
38
|
+
const e = l && r.current.parentElement?.offsetHeight || window.innerHeight;
|
|
39
39
|
return d?.map((t) => {
|
|
40
40
|
if (t === "auto") {
|
|
41
|
-
const n =
|
|
42
|
-
return parseFloat(
|
|
41
|
+
const n = $.current, g = G(), c = Z(), s = P(), v = _(e, n, g, c, s);
|
|
42
|
+
return parseFloat(v) / 100 * e;
|
|
43
43
|
}
|
|
44
44
|
return typeof t == "string" && t.endsWith("%") ? parseFloat(t) > 100 ? e : parseFloat(t) / 100 * e : typeof t == "string" && t.endsWith("px") ? parseFloat(t) : typeof t == "number" && t >= 0 && t <= 1 ? t * e : typeof t == "number" ? t : 0;
|
|
45
45
|
}) || [];
|
|
46
|
-
}, [d,
|
|
47
|
-
const
|
|
48
|
-
return `${Math.round(
|
|
49
|
-
}, []),
|
|
50
|
-
const n =
|
|
46
|
+
}, [d, l]), G = i(() => 46, []), W = i(() => b.current?.scrollHeight ?? 0, []), Z = i(() => T.current?.scrollHeight ?? 0, []), P = i(() => E.current?.scrollHeight ?? 0, []), _ = i((e, t, n, g, c) => {
|
|
47
|
+
const s = n + c + t + g, v = Math.min(100, s / e * 100);
|
|
48
|
+
return `${Math.round(v)}%`;
|
|
49
|
+
}, []), ee = i((e, t) => {
|
|
50
|
+
const n = O();
|
|
51
51
|
if (n.length === 0) return e;
|
|
52
52
|
if (Math.abs(t) > 0.05)
|
|
53
53
|
if (t > 0) {
|
|
54
54
|
const c = n.filter((s) => s < e);
|
|
55
|
-
return c.length > 0 ? Math.max(...c) :
|
|
55
|
+
return c.length > 0 ? Math.max(...c) : F ? 0 : X;
|
|
56
56
|
} else {
|
|
57
57
|
const c = n.filter((s) => s > e);
|
|
58
58
|
if (c.length > 0)
|
|
59
59
|
return Math.min(...c);
|
|
60
60
|
}
|
|
61
61
|
return n.reduce((c, s) => Math.abs(s - e) < Math.abs(c - e) ? s : c);
|
|
62
|
-
}, [
|
|
63
|
-
if (
|
|
64
|
-
const t =
|
|
65
|
-
|
|
62
|
+
}, [O]), q = i((e) => {
|
|
63
|
+
if (a && d) {
|
|
64
|
+
const t = l && r.current?.parentElement?.offsetHeight || window.innerHeight, n = e <= X ? "0%" : `${Math.round(e / t * 100)}%`;
|
|
65
|
+
a(n);
|
|
66
66
|
}
|
|
67
|
-
}, [
|
|
68
|
-
r.current && (r.current.style.transition =
|
|
69
|
-
}, [
|
|
70
|
-
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
t > e ?
|
|
75
|
-
},
|
|
76
|
-
if (
|
|
77
|
-
const { scrollY: e } =
|
|
78
|
-
document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", window.scrollTo(0, e),
|
|
67
|
+
}, [a, d, l]), te = i((e) => {
|
|
68
|
+
r.current && (r.current.style.transition = me, r.current.style.height = `${e}px`, fe(e, $.current || W()));
|
|
69
|
+
}, [a, d, l]), ue = () => {
|
|
70
|
+
b.current?.classList.remove("prometeo-scrollbar-none");
|
|
71
|
+
}, ae = () => {
|
|
72
|
+
b.current?.classList.add("prometeo-scrollbar-none");
|
|
73
|
+
}, fe = (e, t) => {
|
|
74
|
+
t > e ? ue() : ae();
|
|
75
|
+
}, ne = i(() => {
|
|
76
|
+
if (p.current && l) {
|
|
77
|
+
const { scrollY: e } = p.current;
|
|
78
|
+
document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", window.scrollTo(0, e), p.current = null;
|
|
79
79
|
}
|
|
80
|
-
}, [
|
|
80
|
+
}, [l]), B = i((e) => {
|
|
81
81
|
if (!r.current) return;
|
|
82
82
|
const t = e.touches[0], n = r.current.offsetHeight;
|
|
83
|
-
|
|
83
|
+
y.current = {
|
|
84
84
|
isDragging: !1,
|
|
85
85
|
startY: t.clientY,
|
|
86
86
|
startHeight: n,
|
|
@@ -88,10 +88,10 @@ const U = 44, de = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", be = le((a, i)
|
|
|
88
88
|
lastTime: Date.now(),
|
|
89
89
|
velocity: 0
|
|
90
90
|
};
|
|
91
|
-
}, []),
|
|
91
|
+
}, []), re = i((e) => {
|
|
92
92
|
if (!r.current) return;
|
|
93
93
|
const t = e, n = r.current.offsetHeight;
|
|
94
|
-
|
|
94
|
+
y.current = {
|
|
95
95
|
isDragging: !1,
|
|
96
96
|
startY: t.clientY,
|
|
97
97
|
startHeight: n,
|
|
@@ -99,175 +99,180 @@ const U = 44, de = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", be = le((a, i)
|
|
|
99
99
|
lastTime: Date.now(),
|
|
100
100
|
velocity: 0
|
|
101
101
|
};
|
|
102
|
-
}, []),
|
|
103
|
-
if (!
|
|
104
|
-
const t = e.touches[0], n =
|
|
105
|
-
if (!n.isDragging && c && (n.isDragging = !0,
|
|
102
|
+
}, []), U = i((e) => {
|
|
103
|
+
if (!y.current || !r.current) return;
|
|
104
|
+
const t = e.touches[0], n = y.current, g = n.startY - t.clientY, c = n.isDragging || Math.abs(g) > 5;
|
|
105
|
+
if (!n.isDragging && c && (n.isDragging = !0, l)) {
|
|
106
106
|
const s = window.scrollY;
|
|
107
|
-
|
|
107
|
+
p.current = { scrollY: s }, document.body.style.position = "fixed", document.body.style.top = `-${s}px`, document.body.style.width = "100%";
|
|
108
108
|
}
|
|
109
109
|
if (c) {
|
|
110
110
|
e.preventDefault();
|
|
111
|
-
const s = Date.now(),
|
|
112
|
-
if (
|
|
113
|
-
const Q = (t.clientY - n.lastY) /
|
|
111
|
+
const s = Date.now(), v = s - n.lastTime;
|
|
112
|
+
if (v > 0) {
|
|
113
|
+
const Q = (t.clientY - n.lastY) / v;
|
|
114
114
|
n.velocity = n.velocity * 0.8 + Q * 0.2;
|
|
115
115
|
}
|
|
116
116
|
n.lastY = t.clientY, n.lastTime = s;
|
|
117
|
-
const
|
|
117
|
+
const I = n.startHeight + g, k = l && r.current.parentElement?.offsetHeight || window.innerHeight, K = Math.max(0, Math.min(I, k));
|
|
118
118
|
r.current.style.transition = "none", r.current.style.height = `${K}px`;
|
|
119
119
|
}
|
|
120
|
-
}, [
|
|
121
|
-
if (!
|
|
122
|
-
const t = e, n =
|
|
123
|
-
if (!n.isDragging && c && (n.isDragging = !0,
|
|
120
|
+
}, [l]), oe = i((e) => {
|
|
121
|
+
if (!y.current || !r.current) return;
|
|
122
|
+
const t = e, n = y.current, g = n.startY - t.clientY, c = n.isDragging || Math.abs(g) > 5;
|
|
123
|
+
if (!n.isDragging && c && (n.isDragging = !0, l)) {
|
|
124
124
|
const s = window.scrollY;
|
|
125
|
-
|
|
125
|
+
p.current = { scrollY: s }, document.body.style.position = "fixed", document.body.style.top = `-${s}px`, document.body.style.width = "100%";
|
|
126
126
|
}
|
|
127
127
|
if (c) {
|
|
128
128
|
e.preventDefault();
|
|
129
|
-
const s = Date.now(),
|
|
130
|
-
if (
|
|
131
|
-
const Q = (t.clientY - n.lastY) /
|
|
129
|
+
const s = Date.now(), v = s - n.lastTime;
|
|
130
|
+
if (v > 0) {
|
|
131
|
+
const Q = (t.clientY - n.lastY) / v;
|
|
132
132
|
n.velocity = n.velocity * 0.8 + Q * 0.2;
|
|
133
133
|
}
|
|
134
134
|
n.lastY = t.clientY, n.lastTime = s;
|
|
135
|
-
const
|
|
135
|
+
const I = n.startHeight + g, k = l && r.current.parentElement?.offsetHeight || window.innerHeight, K = Math.max(0, Math.min(I, k));
|
|
136
136
|
r.current.style.transition = "none", r.current.style.height = `${K}px`;
|
|
137
137
|
}
|
|
138
|
-
}, [
|
|
139
|
-
if (!
|
|
140
|
-
const e =
|
|
138
|
+
}, [l]), Y = i(() => {
|
|
139
|
+
if (!y.current || !r.current) return;
|
|
140
|
+
const e = y.current;
|
|
141
141
|
if (e.isDragging) {
|
|
142
|
-
|
|
143
|
-
const t = r.current.offsetHeight, n =
|
|
144
|
-
|
|
142
|
+
ne();
|
|
143
|
+
const t = r.current.offsetHeight, n = ee(t, e.velocity);
|
|
144
|
+
q(n);
|
|
145
145
|
}
|
|
146
|
-
|
|
147
|
-
}, [
|
|
148
|
-
|
|
149
|
-
const
|
|
146
|
+
y.current = null;
|
|
147
|
+
}, [ee, q, ne]), V = i((e) => {
|
|
148
|
+
re(e);
|
|
149
|
+
const t = (g) => oe(g), n = () => {
|
|
150
|
+
document.removeEventListener("mousemove", t, { capture: !0 }), document.removeEventListener("mouseup", n, { capture: !0 }), Y();
|
|
151
|
+
};
|
|
152
|
+
document.addEventListener("mousemove", t, { passive: !1, capture: !0 }), document.addEventListener("mouseup", n, { capture: !0 });
|
|
153
|
+
}, [re, oe, Y]);
|
|
154
|
+
x(() => {
|
|
155
|
+
const e = M.current;
|
|
150
156
|
if (e)
|
|
151
|
-
return e.addEventListener("touchstart",
|
|
152
|
-
e.removeEventListener("touchstart",
|
|
157
|
+
return e.addEventListener("touchstart", B, { passive: !1 }), e.addEventListener("touchmove", U, { passive: !1 }), e.addEventListener("touchend", Y), e.addEventListener("touchcancel", Y), e.addEventListener("mousedown", V, { passive: !1 }), () => {
|
|
158
|
+
e.removeEventListener("touchstart", B), e.removeEventListener("touchmove", U), e.removeEventListener("touchend", Y), e.removeEventListener("touchcancel", Y), e.removeEventListener("mousedown", V);
|
|
153
159
|
};
|
|
154
|
-
}, [
|
|
155
|
-
const
|
|
156
|
-
return
|
|
157
|
-
|
|
158
|
-
}, [
|
|
159
|
-
if (!
|
|
160
|
+
}, [B, U, Y, V]);
|
|
161
|
+
const S = le(() => o !== "0%", [o]), [J, se] = A(() => m ? o !== "0%" : !0);
|
|
162
|
+
return x(() => {
|
|
163
|
+
m && S && se(!0);
|
|
164
|
+
}, [S, m]), x(() => {
|
|
165
|
+
if (!m) return;
|
|
160
166
|
const e = r.current;
|
|
161
167
|
if (!e) return;
|
|
162
168
|
const t = (n) => {
|
|
163
|
-
n.propertyName === "height" && !
|
|
169
|
+
n.propertyName === "height" && !S && o === "0%" && se(!1);
|
|
164
170
|
};
|
|
165
171
|
return e.addEventListener("transitionend", t), () => {
|
|
166
172
|
e.removeEventListener("transitionend", t);
|
|
167
173
|
};
|
|
168
|
-
}, [
|
|
174
|
+
}, [S, o, m]), x(() => {
|
|
169
175
|
if (!r.current || !o) return;
|
|
170
|
-
const e =
|
|
176
|
+
const e = l && r.current.parentElement?.offsetHeight || window.innerHeight;
|
|
171
177
|
if (o === "auto") {
|
|
172
|
-
if (
|
|
173
|
-
|
|
178
|
+
if (m && !J) return;
|
|
179
|
+
te(e), requestAnimationFrame(() => {
|
|
174
180
|
requestAnimationFrame(() => {
|
|
175
|
-
const n = !H ||
|
|
176
|
-
if (
|
|
177
|
-
const c =
|
|
178
|
-
|
|
179
|
-
const s =
|
|
180
|
-
|
|
181
|
-
} else n &&
|
|
181
|
+
const n = !H || T.current, g = b.current && b.current.children.length > 0;
|
|
182
|
+
if (b.current && g && n) {
|
|
183
|
+
const c = W();
|
|
184
|
+
$.current = c;
|
|
185
|
+
const s = G(), v = Z(), I = P(), k = _(e, c, s, v, I);
|
|
186
|
+
a(k);
|
|
187
|
+
} else n && a("100%");
|
|
182
188
|
});
|
|
183
189
|
});
|
|
184
190
|
return;
|
|
185
191
|
}
|
|
186
192
|
let t = 0;
|
|
187
|
-
typeof o == "string" && o.endsWith("%") ? parseFloat(o) <= 0 ? t =
|
|
188
|
-
}, [o,
|
|
189
|
-
|
|
193
|
+
typeof o == "string" && o.endsWith("%") ? parseFloat(o) <= 0 ? t = F ? 0 : X : t = parseFloat(o) / 100 * e : typeof o == "string" && o.endsWith("px") ? t = parseFloat(o) : typeof o == "number" && (o >= 0 && o <= 1 ? t = o * e : t = o), te(t);
|
|
194
|
+
}, [o, l, W, G, _, a, J, H, m]), /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
|
|
195
|
+
N && /* @__PURE__ */ w.jsx(
|
|
190
196
|
"div",
|
|
191
197
|
{
|
|
192
|
-
className:
|
|
198
|
+
className: z(S ? "fixed inset-0 bg-black/40 z-55 cursor-default" : "hidden"),
|
|
193
199
|
onClick: (e) => {
|
|
194
|
-
e.preventDefault(), e.stopPropagation(), C &&
|
|
200
|
+
e.preventDefault(), e.stopPropagation(), C && q(0);
|
|
195
201
|
},
|
|
196
202
|
"aria-hidden": "true"
|
|
197
203
|
}
|
|
198
204
|
),
|
|
199
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ w.jsxs(
|
|
200
206
|
"div",
|
|
201
207
|
{
|
|
202
208
|
ref: r,
|
|
203
|
-
className:
|
|
209
|
+
className: z(
|
|
204
210
|
"h-0",
|
|
205
|
-
|
|
211
|
+
l ? "absolute" : "fixed",
|
|
206
212
|
"z-60 bottom-0 w-full overflow-hidden",
|
|
207
213
|
"bg-neutral-default-default",
|
|
208
214
|
"border-t border-neutral-strong-default rounded-t-[12px]",
|
|
209
|
-
|
|
210
|
-
|
|
215
|
+
S ? "" : "border-neutral-weak",
|
|
216
|
+
R,
|
|
211
217
|
"flex flex-col items-center",
|
|
212
218
|
"touch-none select-none"
|
|
213
219
|
),
|
|
214
220
|
children: [
|
|
215
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ w.jsx(
|
|
216
222
|
"div",
|
|
217
223
|
{
|
|
218
|
-
ref:
|
|
219
|
-
className: "w-full absolute top-0 h-11 flex items-center justify-center cursor-grab active:cursor-grabbing z-50 bg-inherit!",
|
|
220
|
-
children: /* @__PURE__ */
|
|
224
|
+
ref: M,
|
|
225
|
+
className: "w-full absolute top-0 h-11 flex items-center justify-center cursor-grab active:cursor-grabbing z-50 bg-inherit! ",
|
|
226
|
+
children: /* @__PURE__ */ w.jsx("span", { className: "w-12 h-1 rounded-full bg-neutral-weak-default" })
|
|
221
227
|
}
|
|
222
228
|
),
|
|
223
|
-
typeof
|
|
224
|
-
/* @__PURE__ */
|
|
229
|
+
typeof u == "string" ? /* @__PURE__ */ w.jsx("p", { ref: E, className: " prometeo-fonts-headline-small text-neutral-default-default w-full min-h-11 bg-inherit mt-11 z-50 px-4 text-balance", children: u }) : /* @__PURE__ */ w.jsx("div", { ref: E, className: "w-full mt-11", children: typeof u == "function" ? u(D) : ce.isValidElement(u) ? u : u && typeof u == "object" && "$$typeof" in u ? ce.createElement(u, { context: D }) : u }),
|
|
230
|
+
/* @__PURE__ */ w.jsx(
|
|
225
231
|
"div",
|
|
226
232
|
{
|
|
227
|
-
ref:
|
|
228
|
-
className:
|
|
233
|
+
ref: b,
|
|
234
|
+
className: z(
|
|
229
235
|
"drawer-mobile-content prometeo-scrollbar-thin-weak ",
|
|
230
|
-
|
|
236
|
+
S ? "drawer-mobile-content--open" : "drawer-mobile-content--closed",
|
|
231
237
|
"w-full h-full",
|
|
232
|
-
|
|
233
|
-
S
|
|
238
|
+
L
|
|
234
239
|
),
|
|
235
|
-
children: (!
|
|
240
|
+
children: (!m || J) && (typeof f == "function" ? f(D) : f)
|
|
236
241
|
}
|
|
237
242
|
),
|
|
238
|
-
H && /* @__PURE__ */
|
|
243
|
+
H && /* @__PURE__ */ w.jsx("div", { ref: T, className: z(
|
|
239
244
|
"w-full mt-2 flex items-center justify-center p-2",
|
|
240
245
|
"border-t border-neutral-strong-default",
|
|
241
|
-
|
|
242
|
-
), children: typeof H == "function" ? H(
|
|
246
|
+
j
|
|
247
|
+
), children: typeof H == "function" ? H(D) : H })
|
|
243
248
|
]
|
|
244
249
|
}
|
|
245
250
|
)
|
|
246
251
|
] });
|
|
247
|
-
},
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
}, []),
|
|
251
|
-
|
|
252
|
-
}, []), o =
|
|
253
|
-
return
|
|
254
|
-
const d =
|
|
252
|
+
}, He = () => {
|
|
253
|
+
const f = h(null), [l, R] = A(!1), L = i((d, a) => {
|
|
254
|
+
f.current?.open(d, a);
|
|
255
|
+
}, []), j = i(() => {
|
|
256
|
+
f.current?.close();
|
|
257
|
+
}, []), o = i(() => f.current?.getContext() ?? null, []);
|
|
258
|
+
return x(() => {
|
|
259
|
+
const d = f.current?.subscribeOpenChange;
|
|
255
260
|
if (!d) return;
|
|
256
|
-
const
|
|
257
|
-
|
|
261
|
+
const a = d((F) => {
|
|
262
|
+
R(F);
|
|
258
263
|
});
|
|
259
264
|
return () => {
|
|
260
|
-
|
|
265
|
+
a && a();
|
|
261
266
|
};
|
|
262
|
-
}, [
|
|
263
|
-
isOpen:
|
|
264
|
-
open:
|
|
265
|
-
close:
|
|
266
|
-
drawerRef:
|
|
267
|
+
}, [f.current?.subscribeOpenChange]), {
|
|
268
|
+
isOpen: l,
|
|
269
|
+
open: L,
|
|
270
|
+
close: j,
|
|
271
|
+
drawerRef: f,
|
|
267
272
|
getContext: o
|
|
268
273
|
};
|
|
269
274
|
};
|
|
270
275
|
export {
|
|
271
|
-
|
|
272
|
-
|
|
276
|
+
ye as default,
|
|
277
|
+
He as useDrawerMobile
|
|
273
278
|
};
|
|
@@ -9,7 +9,7 @@ export interface DrawerMobileProps<TContext = unknown> {
|
|
|
9
9
|
attachToParent?: boolean;
|
|
10
10
|
hideOnClose?: boolean;
|
|
11
11
|
unmountChildrenOnClose?: boolean;
|
|
12
|
-
header?: React.ReactNode | string;
|
|
12
|
+
header?: React.ReactNode | string | ((context: TContext | null) => React.ReactNode);
|
|
13
13
|
modal?: boolean;
|
|
14
14
|
closeOnOverlayClick?: boolean;
|
|
15
15
|
footer?: React.ReactNode | ((context: TContext | null) => React.ReactNode);
|
|
@@ -24,5 +24,7 @@ export interface DrawerMobileHandle<TContext = unknown> {
|
|
|
24
24
|
getContext: () => TContext | null;
|
|
25
25
|
subscribeOpenChange: (cb: (open: boolean) => void) => () => void;
|
|
26
26
|
}
|
|
27
|
-
declare const DrawerMobile:
|
|
27
|
+
declare const DrawerMobile: <TContext = unknown>(props: DrawerMobileProps<TContext> & {
|
|
28
|
+
ref: React.ForwardedRef<DrawerMobileHandle<TContext>>;
|
|
29
|
+
}) => React.ReactElement;
|
|
28
30
|
export default DrawerMobile;
|