@purpurds/drawer 5.18.2 → 5.19.0
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/LICENSE.txt +3 -3
- package/dist/drawer.cjs.js +5 -5
- package/dist/drawer.cjs.js.map +1 -1
- package/dist/drawer.es.js +149 -151
- package/dist/drawer.es.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +6 -6
- package/src/drawer-content.module.scss +2 -2
- package/src/drawer.module.scss +0 -1
- package/src/drawer.stories.tsx +78 -34
package/dist/drawer.es.js
CHANGED
|
@@ -16,12 +16,12 @@ function L(e, r, { checkForDefaultPrevented: t = !0 } = {}) {
|
|
|
16
16
|
if (e == null || e(a), t === !1 || !a.defaultPrevented) return r == null ? void 0 : r(a);
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function fr(e, r) {
|
|
20
20
|
typeof e == "function" ? e(r) : e != null && (e.current = r);
|
|
21
21
|
}
|
|
22
22
|
function St(...e) {
|
|
23
23
|
return (r) => e.forEach(
|
|
24
|
-
(t) =>
|
|
24
|
+
(t) => fr(t, r)
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
27
|
function k(...e) {
|
|
@@ -36,16 +36,16 @@ function Et(e, r = []) {
|
|
|
36
36
|
i
|
|
37
37
|
];
|
|
38
38
|
function s(d) {
|
|
39
|
-
const { scope:
|
|
39
|
+
const { scope: f, children: v, ...m } = d, p = (f == null ? void 0 : f[e][l]) || c, b = Se(
|
|
40
40
|
() => m,
|
|
41
41
|
Object.values(m)
|
|
42
42
|
);
|
|
43
|
-
return /* @__PURE__ */ h(
|
|
43
|
+
return /* @__PURE__ */ h(p.Provider, {
|
|
44
44
|
value: b
|
|
45
45
|
}, v);
|
|
46
46
|
}
|
|
47
|
-
function u(d,
|
|
48
|
-
const v = (
|
|
47
|
+
function u(d, f) {
|
|
48
|
+
const v = (f == null ? void 0 : f[e][l]) || c, m = Te(v);
|
|
49
49
|
if (m) return m;
|
|
50
50
|
if (i !== void 0) return i;
|
|
51
51
|
throw new Error(`\`${d}\` must be used within \`${n}\``);
|
|
@@ -75,10 +75,10 @@ function Et(e, r = []) {
|
|
|
75
75
|
};
|
|
76
76
|
return a.scopeName = e, [
|
|
77
77
|
o,
|
|
78
|
-
|
|
78
|
+
pr(a, ...r)
|
|
79
79
|
];
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function pr(...e) {
|
|
82
82
|
const r = e[0];
|
|
83
83
|
if (e.length === 1) return r;
|
|
84
84
|
const t = () => {
|
|
@@ -267,9 +267,9 @@ const Cr = /* @__PURE__ */ de({
|
|
|
267
267
|
branches: /* @__PURE__ */ new Set()
|
|
268
268
|
}), Pr = /* @__PURE__ */ w((e, r) => {
|
|
269
269
|
var t;
|
|
270
|
-
const { disableOutsidePointerEvents: o = !1, onEscapeKeyDown: a, onPointerDownOutside: n, onFocusOutside: i, onInteractOutside: c, onDismiss: l, ...s } = e, u = Te(Cr), [d,
|
|
270
|
+
const { disableOutsidePointerEvents: o = !1, onEscapeKeyDown: a, onPointerDownOutside: n, onFocusOutside: i, onInteractOutside: c, onDismiss: l, ...s } = e, u = Te(Cr), [d, f] = N(null), v = (t = d == null ? void 0 : d.ownerDocument) !== null && t !== void 0 ? t : globalThis == null ? void 0 : globalThis.document, [, m] = N({}), p = k(
|
|
271
271
|
r,
|
|
272
|
-
(x) =>
|
|
272
|
+
(x) => f(x)
|
|
273
273
|
), b = Array.from(u.layers), [g] = [
|
|
274
274
|
...u.layersWithOutsidePointerEventsDisabled
|
|
275
275
|
].slice(-1), C = b.indexOf(g), S = d ? b.indexOf(d) : -1, E = u.layersWithOutsidePointerEventsDisabled.size > 0, P = S >= C, I = Tr((x) => {
|
|
@@ -308,7 +308,7 @@ const Cr = /* @__PURE__ */ de({
|
|
|
308
308
|
const x = () => m({});
|
|
309
309
|
return document.addEventListener(Ye, x), () => document.removeEventListener(Ye, x);
|
|
310
310
|
}, []), /* @__PURE__ */ h(F.div, y({}, s, {
|
|
311
|
-
ref:
|
|
311
|
+
ref: p,
|
|
312
312
|
style: {
|
|
313
313
|
pointerEvents: E ? P ? "auto" : "none" : void 0,
|
|
314
314
|
...e.style
|
|
@@ -389,9 +389,9 @@ const Le = "focusScope.autoFocusOnMount", Re = "focusScope.autoFocusOnUnmount",
|
|
|
389
389
|
bubbles: !1,
|
|
390
390
|
cancelable: !0
|
|
391
391
|
}, Dr = /* @__PURE__ */ w((e, r) => {
|
|
392
|
-
const { loop: t = !1, trapped: o = !1, onMountAutoFocus: a, onUnmountAutoFocus: n, ...i } = e, [c, l] = N(null), s = M(a), u = M(n), d = A(null),
|
|
392
|
+
const { loop: t = !1, trapped: o = !1, onMountAutoFocus: a, onUnmountAutoFocus: n, ...i } = e, [c, l] = N(null), s = M(a), u = M(n), d = A(null), f = k(
|
|
393
393
|
r,
|
|
394
|
-
(
|
|
394
|
+
(p) => l(p)
|
|
395
395
|
), v = A({
|
|
396
396
|
paused: !1,
|
|
397
397
|
pause() {
|
|
@@ -403,7 +403,7 @@ const Le = "focusScope.autoFocusOnMount", Re = "focusScope.autoFocusOnUnmount",
|
|
|
403
403
|
}).current;
|
|
404
404
|
D(() => {
|
|
405
405
|
if (o) {
|
|
406
|
-
let
|
|
406
|
+
let p = function(S) {
|
|
407
407
|
if (v.paused || !c) return;
|
|
408
408
|
const E = S.target;
|
|
409
409
|
c.contains(E) ? d.current = E : V(d.current, {
|
|
@@ -419,13 +419,13 @@ const Le = "focusScope.autoFocusOnMount", Re = "focusScope.autoFocusOnUnmount",
|
|
|
419
419
|
if (document.activeElement === document.body)
|
|
420
420
|
for (const P of S) P.removedNodes.length > 0 && V(c);
|
|
421
421
|
};
|
|
422
|
-
document.addEventListener("focusin",
|
|
422
|
+
document.addEventListener("focusin", p), document.addEventListener("focusout", b);
|
|
423
423
|
const C = new MutationObserver(g);
|
|
424
424
|
return c && C.observe(c, {
|
|
425
425
|
childList: !0,
|
|
426
426
|
subtree: !0
|
|
427
427
|
}), () => {
|
|
428
|
-
document.removeEventListener("focusin",
|
|
428
|
+
document.removeEventListener("focusin", p), document.removeEventListener("focusout", b), C.disconnect();
|
|
429
429
|
};
|
|
430
430
|
}
|
|
431
431
|
}, [
|
|
@@ -435,17 +435,17 @@ const Le = "focusScope.autoFocusOnMount", Re = "focusScope.autoFocusOnUnmount",
|
|
|
435
435
|
]), D(() => {
|
|
436
436
|
if (c) {
|
|
437
437
|
st.add(v);
|
|
438
|
-
const
|
|
439
|
-
if (!c.contains(
|
|
438
|
+
const p = document.activeElement;
|
|
439
|
+
if (!c.contains(p)) {
|
|
440
440
|
const g = new CustomEvent(Le, ct);
|
|
441
441
|
c.addEventListener(Le, s), c.dispatchEvent(g), g.defaultPrevented || (Nr(Ir(Ct(c)), {
|
|
442
442
|
select: !0
|
|
443
|
-
}), document.activeElement ===
|
|
443
|
+
}), document.activeElement === p && V(c));
|
|
444
444
|
}
|
|
445
445
|
return () => {
|
|
446
446
|
c.removeEventListener(Le, s), setTimeout(() => {
|
|
447
447
|
const g = new CustomEvent(Re, ct);
|
|
448
|
-
c.addEventListener(Re, u), c.dispatchEvent(g), g.defaultPrevented || V(
|
|
448
|
+
c.addEventListener(Re, u), c.dispatchEvent(g), g.defaultPrevented || V(p ?? document.body, {
|
|
449
449
|
select: !0
|
|
450
450
|
}), c.removeEventListener(Re, u), st.remove(v);
|
|
451
451
|
}, 0);
|
|
@@ -457,16 +457,16 @@ const Le = "focusScope.autoFocusOnMount", Re = "focusScope.autoFocusOnUnmount",
|
|
|
457
457
|
u,
|
|
458
458
|
v
|
|
459
459
|
]);
|
|
460
|
-
const m = ae((
|
|
460
|
+
const m = ae((p) => {
|
|
461
461
|
if (!t && !o || v.paused) return;
|
|
462
|
-
const b =
|
|
462
|
+
const b = p.key === "Tab" && !p.altKey && !p.ctrlKey && !p.metaKey, g = document.activeElement;
|
|
463
463
|
if (b && g) {
|
|
464
|
-
const C =
|
|
465
|
-
S && E ? !
|
|
464
|
+
const C = p.currentTarget, [S, E] = Or(C);
|
|
465
|
+
S && E ? !p.shiftKey && g === E ? (p.preventDefault(), t && V(S, {
|
|
466
466
|
select: !0
|
|
467
|
-
})) :
|
|
467
|
+
})) : p.shiftKey && g === S && (p.preventDefault(), t && V(E, {
|
|
468
468
|
select: !0
|
|
469
|
-
})) : g === C &&
|
|
469
|
+
})) : g === C && p.preventDefault();
|
|
470
470
|
}
|
|
471
471
|
}, [
|
|
472
472
|
t,
|
|
@@ -476,7 +476,7 @@ const Le = "focusScope.autoFocusOnMount", Re = "focusScope.autoFocusOnUnmount",
|
|
|
476
476
|
return /* @__PURE__ */ h(F.div, y({
|
|
477
477
|
tabIndex: -1
|
|
478
478
|
}, i, {
|
|
479
|
-
ref:
|
|
479
|
+
ref: f,
|
|
480
480
|
onKeyDown: m
|
|
481
481
|
}));
|
|
482
482
|
});
|
|
@@ -592,15 +592,15 @@ function jr(e) {
|
|
|
592
592
|
}
|
|
593
593
|
});
|
|
594
594
|
return D(() => {
|
|
595
|
-
const s =
|
|
595
|
+
const s = pe(o.current);
|
|
596
596
|
n.current = c === "mounted" ? s : "none";
|
|
597
597
|
}, [
|
|
598
598
|
c
|
|
599
599
|
]), xe(() => {
|
|
600
600
|
const s = o.current, u = a.current;
|
|
601
601
|
if (u !== e) {
|
|
602
|
-
const
|
|
603
|
-
e ? l("MOUNT") : v === "none" || (s == null ? void 0 : s.display) === "none" ? l("UNMOUNT") : l(u &&
|
|
602
|
+
const f = n.current, v = pe(s);
|
|
603
|
+
e ? l("MOUNT") : v === "none" || (s == null ? void 0 : s.display) === "none" ? l("UNMOUNT") : l(u && f !== v ? "ANIMATION_OUT" : "UNMOUNT"), a.current = e;
|
|
604
604
|
}
|
|
605
605
|
}, [
|
|
606
606
|
e,
|
|
@@ -608,12 +608,12 @@ function jr(e) {
|
|
|
608
608
|
]), xe(() => {
|
|
609
609
|
if (r) {
|
|
610
610
|
const s = (d) => {
|
|
611
|
-
const v =
|
|
611
|
+
const v = pe(o.current).includes(d.animationName);
|
|
612
612
|
d.target === r && v && yt(
|
|
613
613
|
() => l("ANIMATION_END")
|
|
614
614
|
);
|
|
615
615
|
}, u = (d) => {
|
|
616
|
-
d.target === r && (n.current =
|
|
616
|
+
d.target === r && (n.current = pe(o.current));
|
|
617
617
|
};
|
|
618
618
|
return r.addEventListener("animationstart", u), r.addEventListener("animationcancel", s), r.addEventListener("animationend", s), () => {
|
|
619
619
|
r.removeEventListener("animationstart", u), r.removeEventListener("animationcancel", s), r.removeEventListener("animationend", s);
|
|
@@ -633,7 +633,7 @@ function jr(e) {
|
|
|
633
633
|
}, [])
|
|
634
634
|
};
|
|
635
635
|
}
|
|
636
|
-
function
|
|
636
|
+
function pe(e) {
|
|
637
637
|
return (e == null ? void 0 : e.animationName) || "none";
|
|
638
638
|
}
|
|
639
639
|
let Me = 0;
|
|
@@ -801,11 +801,11 @@ var At = Kr(), ke = function() {
|
|
|
801
801
|
onScrollCapture: ke,
|
|
802
802
|
onWheelCapture: ke,
|
|
803
803
|
onTouchMoveCapture: ke
|
|
804
|
-
}), a = o[0], n = o[1], i = e.forwardProps, c = e.children, l = e.className, s = e.removeScrollBar, u = e.enabled, d = e.shards,
|
|
804
|
+
}), a = o[0], n = o[1], i = e.forwardProps, c = e.children, l = e.className, s = e.removeScrollBar, u = e.enabled, d = e.shards, f = e.sideCar, v = e.noIsolation, m = e.inert, p = e.allowPinchZoom, b = e.as, g = b === void 0 ? "div" : b, C = Pt(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]), S = f, E = Br([t, r]), P = W(W({}, C), a);
|
|
805
805
|
return $.createElement(
|
|
806
806
|
$.Fragment,
|
|
807
807
|
null,
|
|
808
|
-
u && $.createElement(S, { sideCar: At, removeScrollBar: s, shards: d, noIsolation: v, inert: m, setCallbacks: n, allowPinchZoom: !!
|
|
808
|
+
u && $.createElement(S, { sideCar: At, removeScrollBar: s, shards: d, noIsolation: v, inert: m, setCallbacks: n, allowPinchZoom: !!p, lockRef: t }),
|
|
809
809
|
i ? $.cloneElement($.Children.only(c), W(W({}, P), { ref: E })) : $.createElement(g, W({}, P, { className: l, ref: E }), c)
|
|
810
810
|
);
|
|
811
811
|
});
|
|
@@ -926,13 +926,13 @@ var tn = function() {
|
|
|
926
926
|
`).concat(Hr, ": ").concat(c, `px;
|
|
927
927
|
}
|
|
928
928
|
`);
|
|
929
|
-
},
|
|
929
|
+
}, ft = function() {
|
|
930
930
|
var e = parseInt(document.body.getAttribute(oe) || "0", 10);
|
|
931
931
|
return isFinite(e) ? e : 0;
|
|
932
932
|
}, ln = function() {
|
|
933
933
|
$.useEffect(function() {
|
|
934
|
-
return document.body.setAttribute(oe, (
|
|
935
|
-
var e =
|
|
934
|
+
return document.body.setAttribute(oe, (ft() + 1).toString()), function() {
|
|
935
|
+
var e = ft() - 1;
|
|
936
936
|
e <= 0 ? document.body.removeAttribute(oe) : document.body.setAttribute(oe, e.toString());
|
|
937
937
|
};
|
|
938
938
|
}, []);
|
|
@@ -964,11 +964,11 @@ var J = Xe ? { passive: !1 } : !1, dn = function(e) {
|
|
|
964
964
|
t[r] !== "hidden" && // contains scroll inside self
|
|
965
965
|
!(t.overflowY === t.overflowX && !dn(e) && t[r] === "visible")
|
|
966
966
|
);
|
|
967
|
-
}, pn = function(e) {
|
|
968
|
-
return Nt(e, "overflowY");
|
|
969
967
|
}, fn = function(e) {
|
|
968
|
+
return Nt(e, "overflowY");
|
|
969
|
+
}, pn = function(e) {
|
|
970
970
|
return Nt(e, "overflowX");
|
|
971
|
-
},
|
|
971
|
+
}, pt = function(e, r) {
|
|
972
972
|
var t = r;
|
|
973
973
|
do {
|
|
974
974
|
typeof ShadowRoot < "u" && t instanceof ShadowRoot && (t = t.host);
|
|
@@ -996,22 +996,22 @@ var J = Xe ? { passive: !1 } : !1, dn = function(e) {
|
|
|
996
996
|
o
|
|
997
997
|
];
|
|
998
998
|
}, Ot = function(e, r) {
|
|
999
|
-
return e === "v" ?
|
|
999
|
+
return e === "v" ? fn(r) : pn(r);
|
|
1000
1000
|
}, Lt = function(e, r) {
|
|
1001
1001
|
return e === "v" ? vn(r) : hn(r);
|
|
1002
1002
|
}, bn = function(e, r) {
|
|
1003
1003
|
return e === "h" && r === "rtl" ? -1 : 1;
|
|
1004
1004
|
}, mn = function(e, r, t, o, a) {
|
|
1005
|
-
var n = bn(e, window.getComputedStyle(r).direction), i = n * o, c = t.target, l = r.contains(c), s = !1, u = i > 0, d = 0,
|
|
1005
|
+
var n = bn(e, window.getComputedStyle(r).direction), i = n * o, c = t.target, l = r.contains(c), s = !1, u = i > 0, d = 0, f = 0;
|
|
1006
1006
|
do {
|
|
1007
|
-
var v = Lt(e, c), m = v[0],
|
|
1008
|
-
(m || g) && Ot(e, c) && (d += g,
|
|
1007
|
+
var v = Lt(e, c), m = v[0], p = v[1], b = v[2], g = p - b - n * m;
|
|
1008
|
+
(m || g) && Ot(e, c) && (d += g, f += m), c = c.parentNode;
|
|
1009
1009
|
} while (
|
|
1010
1010
|
// portaled content
|
|
1011
1011
|
!l && c !== document.body || // self content
|
|
1012
1012
|
l && (r.contains(c) || r === c)
|
|
1013
1013
|
);
|
|
1014
|
-
return (u && (d === 0 || !a) || !u && (
|
|
1014
|
+
return (u && (d === 0 || !a) || !u && (f === 0 || !a)) && (s = !0), s;
|
|
1015
1015
|
}, he = function(e) {
|
|
1016
1016
|
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
1017
1017
|
}, vt = function(e) {
|
|
@@ -1035,33 +1035,33 @@ function wn(e) {
|
|
|
1035
1035
|
}, [e]), $.useEffect(function() {
|
|
1036
1036
|
if (e.inert) {
|
|
1037
1037
|
document.body.classList.add("block-interactivity-".concat(a));
|
|
1038
|
-
var
|
|
1039
|
-
return
|
|
1038
|
+
var p = Wr([e.lockRef.current], (e.shards || []).map(ht), !0).filter(Boolean);
|
|
1039
|
+
return p.forEach(function(b) {
|
|
1040
1040
|
return b.classList.add("allow-interactivity-".concat(a));
|
|
1041
1041
|
}), function() {
|
|
1042
|
-
document.body.classList.remove("block-interactivity-".concat(a)),
|
|
1042
|
+
document.body.classList.remove("block-interactivity-".concat(a)), p.forEach(function(b) {
|
|
1043
1043
|
return b.classList.remove("allow-interactivity-".concat(a));
|
|
1044
1044
|
});
|
|
1045
1045
|
};
|
|
1046
1046
|
}
|
|
1047
1047
|
}, [e.inert, e.lockRef.current, e.shards]);
|
|
1048
|
-
var c = $.useCallback(function(
|
|
1049
|
-
if ("touches" in
|
|
1048
|
+
var c = $.useCallback(function(p, b) {
|
|
1049
|
+
if ("touches" in p && p.touches.length === 2)
|
|
1050
1050
|
return !i.current.allowPinchZoom;
|
|
1051
|
-
var g = he(
|
|
1052
|
-
if ("touches" in
|
|
1051
|
+
var g = he(p), C = t.current, S = "deltaX" in p ? p.deltaX : C[0] - g[0], E = "deltaY" in p ? p.deltaY : C[1] - g[1], P, I = p.target, O = Math.abs(S) > Math.abs(E) ? "h" : "v";
|
|
1052
|
+
if ("touches" in p && O === "h" && I.type === "range")
|
|
1053
1053
|
return !1;
|
|
1054
|
-
var x =
|
|
1054
|
+
var x = pt(O, I);
|
|
1055
1055
|
if (!x)
|
|
1056
1056
|
return !0;
|
|
1057
|
-
if (x ? P = O : (P = O === "v" ? "h" : "v", x =
|
|
1057
|
+
if (x ? P = O : (P = O === "v" ? "h" : "v", x = pt(O, I)), !x)
|
|
1058
1058
|
return !1;
|
|
1059
|
-
if (!o.current && "changedTouches" in
|
|
1059
|
+
if (!o.current && "changedTouches" in p && (S || E) && (o.current = P), !P)
|
|
1060
1060
|
return !0;
|
|
1061
1061
|
var T = o.current || P;
|
|
1062
|
-
return mn(T, b,
|
|
1063
|
-
}, []), l = $.useCallback(function(
|
|
1064
|
-
var b =
|
|
1062
|
+
return mn(T, b, p, T === "h" ? S : E, !0);
|
|
1063
|
+
}, []), l = $.useCallback(function(p) {
|
|
1064
|
+
var b = p;
|
|
1065
1065
|
if (!(!ee.length || ee[ee.length - 1] !== n)) {
|
|
1066
1066
|
var g = "deltaY" in b ? vt(b) : he(b), C = r.current.filter(function(P) {
|
|
1067
1067
|
return P.name === b.type && P.target === b.target && gn(P.delta, g);
|
|
@@ -1077,28 +1077,28 @@ function wn(e) {
|
|
|
1077
1077
|
E && b.cancelable && b.preventDefault();
|
|
1078
1078
|
}
|
|
1079
1079
|
}
|
|
1080
|
-
}, []), s = $.useCallback(function(
|
|
1081
|
-
var S = { name:
|
|
1080
|
+
}, []), s = $.useCallback(function(p, b, g, C) {
|
|
1081
|
+
var S = { name: p, delta: b, target: g, should: C };
|
|
1082
1082
|
r.current.push(S), setTimeout(function() {
|
|
1083
1083
|
r.current = r.current.filter(function(E) {
|
|
1084
1084
|
return E !== S;
|
|
1085
1085
|
});
|
|
1086
1086
|
}, 1);
|
|
1087
|
-
}, []), u = $.useCallback(function(
|
|
1088
|
-
t.current = he(
|
|
1089
|
-
}, []), d = $.useCallback(function(
|
|
1090
|
-
s(
|
|
1091
|
-
}, []),
|
|
1092
|
-
s(
|
|
1087
|
+
}, []), u = $.useCallback(function(p) {
|
|
1088
|
+
t.current = he(p), o.current = void 0;
|
|
1089
|
+
}, []), d = $.useCallback(function(p) {
|
|
1090
|
+
s(p.type, vt(p), p.target, c(p, e.lockRef.current));
|
|
1091
|
+
}, []), f = $.useCallback(function(p) {
|
|
1092
|
+
s(p.type, he(p), p.target, c(p, e.lockRef.current));
|
|
1093
1093
|
}, []);
|
|
1094
1094
|
$.useEffect(function() {
|
|
1095
1095
|
return ee.push(n), e.setCallbacks({
|
|
1096
1096
|
onScrollCapture: d,
|
|
1097
1097
|
onWheelCapture: d,
|
|
1098
|
-
onTouchMoveCapture:
|
|
1098
|
+
onTouchMoveCapture: f
|
|
1099
1099
|
}), document.addEventListener("wheel", l, J), document.addEventListener("touchmove", l, J), document.addEventListener("touchstart", u, J), function() {
|
|
1100
|
-
ee = ee.filter(function(
|
|
1101
|
-
return
|
|
1100
|
+
ee = ee.filter(function(p) {
|
|
1101
|
+
return p !== n;
|
|
1102
1102
|
}), document.removeEventListener("wheel", l, J), document.removeEventListener("touchmove", l, J), document.removeEventListener("touchstart", u, J);
|
|
1103
1103
|
};
|
|
1104
1104
|
}, []);
|
|
@@ -1139,22 +1139,22 @@ var Sn = function(e) {
|
|
|
1139
1139
|
};
|
|
1140
1140
|
a.forEach(s);
|
|
1141
1141
|
var u = function(d) {
|
|
1142
|
-
!d || l.has(d) || Array.prototype.forEach.call(d.children, function(
|
|
1143
|
-
if (c.has(
|
|
1144
|
-
u(
|
|
1142
|
+
!d || l.has(d) || Array.prototype.forEach.call(d.children, function(f) {
|
|
1143
|
+
if (c.has(f))
|
|
1144
|
+
u(f);
|
|
1145
1145
|
else
|
|
1146
1146
|
try {
|
|
1147
|
-
var v =
|
|
1148
|
-
te.set(
|
|
1147
|
+
var v = f.getAttribute(o), m = v !== null && v !== "false", p = (te.get(f) || 0) + 1, b = (n.get(f) || 0) + 1;
|
|
1148
|
+
te.set(f, p), n.set(f, b), i.push(f), p === 1 && m && be.set(f, !0), b === 1 && f.setAttribute(t, "true"), m || f.setAttribute(o, "true");
|
|
1149
1149
|
} catch (g) {
|
|
1150
|
-
console.error("aria-hidden: cannot operate on ",
|
|
1150
|
+
console.error("aria-hidden: cannot operate on ", f, g);
|
|
1151
1151
|
}
|
|
1152
1152
|
});
|
|
1153
1153
|
};
|
|
1154
1154
|
return u(r), c.clear(), je++, function() {
|
|
1155
1155
|
i.forEach(function(d) {
|
|
1156
|
-
var
|
|
1157
|
-
te.set(d,
|
|
1156
|
+
var f = te.get(d) - 1, v = n.get(d) - 1;
|
|
1157
|
+
te.set(d, f), n.set(d, v), f || (be.has(d) || d.removeAttribute(o), be.delete(d)), v || d.removeAttribute(t);
|
|
1158
1158
|
}), je--, je || (te = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), be = /* @__PURE__ */ new WeakMap(), me = {});
|
|
1159
1159
|
};
|
|
1160
1160
|
}, Cn = function(e, r, t) {
|
|
@@ -1245,8 +1245,8 @@ const It = "Dialog", [kt, ga] = Et(It), [Pn, j] = kt(It), Tn = (e) => {
|
|
|
1245
1245
|
}
|
|
1246
1246
|
})))
|
|
1247
1247
|
);
|
|
1248
|
-
}),
|
|
1249
|
-
const t = jt(
|
|
1248
|
+
}), fe = "DialogContent", Mn = /* @__PURE__ */ w((e, r) => {
|
|
1249
|
+
const t = jt(fe, e.__scopeDialog), { forceMount: o = t.forceMount, ...a } = e, n = j(fe, e.__scopeDialog);
|
|
1250
1250
|
return /* @__PURE__ */ h(q, {
|
|
1251
1251
|
present: o || n.open
|
|
1252
1252
|
}, n.modal ? /* @__PURE__ */ h(In, y({}, a, {
|
|
@@ -1255,7 +1255,7 @@ const It = "Dialog", [kt, ga] = Et(It), [Pn, j] = kt(It), Tn = (e) => {
|
|
|
1255
1255
|
ref: r
|
|
1256
1256
|
})));
|
|
1257
1257
|
}), In = /* @__PURE__ */ w((e, r) => {
|
|
1258
|
-
const t = j(
|
|
1258
|
+
const t = j(fe, e.__scopeDialog), o = A(null), a = k(r, t.contentRef, o);
|
|
1259
1259
|
return D(() => {
|
|
1260
1260
|
const n = o.current;
|
|
1261
1261
|
if (n) return Cn(n);
|
|
@@ -1277,7 +1277,7 @@ const It = "Dialog", [kt, ga] = Et(It), [Pn, j] = kt(It), Tn = (e) => {
|
|
|
1277
1277
|
)
|
|
1278
1278
|
}));
|
|
1279
1279
|
}), kn = /* @__PURE__ */ w((e, r) => {
|
|
1280
|
-
const t = j(
|
|
1280
|
+
const t = j(fe, e.__scopeDialog), o = A(!1), a = A(!1);
|
|
1281
1281
|
return /* @__PURE__ */ h(zt, y({}, e, {
|
|
1282
1282
|
ref: r,
|
|
1283
1283
|
trapFocus: !1,
|
|
@@ -1298,7 +1298,7 @@ const It = "Dialog", [kt, ga] = Et(It), [Pn, j] = kt(It), Tn = (e) => {
|
|
|
1298
1298
|
}
|
|
1299
1299
|
}));
|
|
1300
1300
|
}), zt = /* @__PURE__ */ w((e, r) => {
|
|
1301
|
-
const { __scopeDialog: t, trapFocus: o, onOpenAutoFocus: a, onCloseAutoFocus: n, ...i } = e, c = j(
|
|
1301
|
+
const { __scopeDialog: t, trapFocus: o, onOpenAutoFocus: a, onCloseAutoFocus: n, ...i } = e, c = j(fe, t), l = A(null), s = k(r, l);
|
|
1302
1302
|
return zr(), /* @__PURE__ */ h(Je, null, /* @__PURE__ */ h(Dr, {
|
|
1303
1303
|
asChild: !0,
|
|
1304
1304
|
loop: !0,
|
|
@@ -1385,17 +1385,15 @@ var Wt = { exports: {} };
|
|
|
1385
1385
|
})();
|
|
1386
1386
|
})(Wt);
|
|
1387
1387
|
var Qn = Wt.exports;
|
|
1388
|
-
const Q = /* @__PURE__ */ Zn(Qn), Ut = de(null), Jn = {
|
|
1389
|
-
"purpur-drawer": "_purpur-
|
|
1390
|
-
}, eo = "_drawerSmallScreenAnimation_1j9c0_1", to = "_drawerLargeScreenAnimation_1j9c0_1", ro = "_slideDown_1j9c0_1", no = "_overlayAnimation_1j9c0_1", oo = {
|
|
1391
|
-
"purpur-drawer-content": "_purpur-drawer-content_1j9c0_1",
|
|
1388
|
+
const Q = /* @__PURE__ */ Zn(Qn), Ut = de(null), Jn = {}, eo = "_drawerSmallScreenAnimation_10vdf_1", to = "_drawerLargeScreenAnimation_10vdf_1", ro = "_slideDown_10vdf_1", no = "_overlayAnimation_10vdf_1", oo = {
|
|
1389
|
+
"purpur-drawer-content": "_purpur-drawer-content_10vdf_1",
|
|
1392
1390
|
drawerSmallScreenAnimation: eo,
|
|
1393
1391
|
drawerLargeScreenAnimation: to,
|
|
1394
|
-
"purpur-drawer-content__content-container": "_purpur-drawer-content__content-
|
|
1395
|
-
"purpur-drawer-content__drawer-frame": "_purpur-drawer-content__drawer-
|
|
1392
|
+
"purpur-drawer-content__content-container": "_purpur-drawer-content__content-container_10vdf_22",
|
|
1393
|
+
"purpur-drawer-content__drawer-frame": "_purpur-drawer-content__drawer-frame_10vdf_27",
|
|
1396
1394
|
slideDown: ro,
|
|
1397
|
-
"purpur-drawer-content__description": "_purpur-drawer-
|
|
1398
|
-
"purpur-drawer-overlay": "_purpur-drawer-
|
|
1395
|
+
"purpur-drawer-content__description": "_purpur-drawer-content__description_10vdf_37",
|
|
1396
|
+
"purpur-drawer-overlay": "_purpur-drawer-overlay_10vdf_48",
|
|
1399
1397
|
overlayAnimation: no
|
|
1400
1398
|
}, ao = {
|
|
1401
1399
|
"purpur-drawer-container--header": "_purpur-drawer-container--header_1r6tb_1",
|
|
@@ -1442,19 +1440,19 @@ const io = {
|
|
|
1442
1440
|
onPointerMove: (s) => {
|
|
1443
1441
|
if (!e.current)
|
|
1444
1442
|
return;
|
|
1445
|
-
const u = s.clientY - e.current.y, d = !!r.current,
|
|
1446
|
-
d ? (r.current = m, o(
|
|
1443
|
+
const u = s.clientY - e.current.y, d = !!r.current, f = Math.max(0, u), v = s.pointerType === "touch" ? 10 : 2, m = { y: f }, p = { originalEvent: s, delta: m };
|
|
1444
|
+
d ? (r.current = m, o(p)) : mt(m, 0) ? (r.current = m, t(), s.target.setPointerCapture(s.pointerId)) : Math.abs(u) > v && (e.current = null);
|
|
1447
1445
|
},
|
|
1448
1446
|
onPointerUp: (s) => {
|
|
1449
1447
|
const u = r.current, d = s.target;
|
|
1450
1448
|
if (d.hasPointerCapture(s.pointerId) && d.releasePointerCapture(s.pointerId), r.current = null, e.current = null, u) {
|
|
1451
|
-
const
|
|
1452
|
-
mt(u, 0) && u.y > 200 ? n(v) : a(),
|
|
1449
|
+
const f = s.currentTarget, v = { originalEvent: s, delta: u };
|
|
1450
|
+
mt(u, 0) && u.y > 200 ? n(v) : a(), f.addEventListener("click", (m) => m.preventDefault(), {
|
|
1453
1451
|
once: !0
|
|
1454
1452
|
});
|
|
1455
1453
|
}
|
|
1456
1454
|
}
|
|
1457
|
-
}), mt = (e, r = 0) => Math.abs(e.y) > r, uo = Q.bind(so),
|
|
1455
|
+
}), mt = (e, r = 0) => Math.abs(e.y) > r, uo = Q.bind(so), fo = "purpur-drawer-handle", Ht = w(
|
|
1458
1456
|
({
|
|
1459
1457
|
["data-testid"]: e = "purpur-drawer-handle",
|
|
1460
1458
|
className: r,
|
|
@@ -1464,7 +1462,7 @@ const io = {
|
|
|
1464
1462
|
onSwipeEnd: n,
|
|
1465
1463
|
...i
|
|
1466
1464
|
}, c) => {
|
|
1467
|
-
const l = uo([r,
|
|
1465
|
+
const l = uo([r, fo]), s = Ue.useRef(null), u = Ue.useRef(null), { onPointerDown: d, onPointerMove: f, onPointerUp: v } = lo(
|
|
1468
1466
|
u,
|
|
1469
1467
|
s,
|
|
1470
1468
|
t,
|
|
@@ -1478,7 +1476,7 @@ const io = {
|
|
|
1478
1476
|
className: l,
|
|
1479
1477
|
"data-testid": e,
|
|
1480
1478
|
onPointerDown: d,
|
|
1481
|
-
onPointerMove:
|
|
1479
|
+
onPointerMove: f,
|
|
1482
1480
|
onPointerUp: v,
|
|
1483
1481
|
ref: c,
|
|
1484
1482
|
...i
|
|
@@ -1487,7 +1485,7 @@ const io = {
|
|
|
1487
1485
|
}
|
|
1488
1486
|
);
|
|
1489
1487
|
Ht.displayName = "DrawerHandle";
|
|
1490
|
-
const
|
|
1488
|
+
const po = {
|
|
1491
1489
|
PRIMARY: "primary",
|
|
1492
1490
|
SECONDARY: "secondary",
|
|
1493
1491
|
EXPRESSIVE: "expressive"
|
|
@@ -1642,7 +1640,7 @@ const So = /* @__PURE__ */ wo(yo), Eo = {
|
|
|
1642
1640
|
"purpur-button--text-negative": "_purpur-button--text-negative_1acxn_175",
|
|
1643
1641
|
"purpur-button--text": "_purpur-button--text_1acxn_175"
|
|
1644
1642
|
}, We = {
|
|
1645
|
-
...
|
|
1643
|
+
...po,
|
|
1646
1644
|
DESTRUCTIVE: "destructive",
|
|
1647
1645
|
TERTIARY_PURPLE: "tertiary-purple",
|
|
1648
1646
|
TEXT: "text"
|
|
@@ -1659,7 +1657,7 @@ const So = /* @__PURE__ */ wo(yo), Eo = {
|
|
|
1659
1657
|
size: s = "md",
|
|
1660
1658
|
variant: u,
|
|
1661
1659
|
type: d = "button",
|
|
1662
|
-
...
|
|
1660
|
+
...f
|
|
1663
1661
|
}, v) => {
|
|
1664
1662
|
if (n && u === "destructive")
|
|
1665
1663
|
return null;
|
|
@@ -1676,9 +1674,9 @@ const So = /* @__PURE__ */ wo(yo), Eo = {
|
|
|
1676
1674
|
[`${K}--disabled`]: o || i
|
|
1677
1675
|
},
|
|
1678
1676
|
r
|
|
1679
|
-
),
|
|
1677
|
+
), p = (g) => {
|
|
1680
1678
|
o || i ? g.preventDefault() : l && l(g);
|
|
1681
|
-
}, b = !!
|
|
1679
|
+
}, b = !!f["aria-disabled"] || o || i;
|
|
1682
1680
|
return /* @__PURE__ */ Y(
|
|
1683
1681
|
"button",
|
|
1684
1682
|
{
|
|
@@ -1687,8 +1685,8 @@ const So = /* @__PURE__ */ wo(yo), Eo = {
|
|
|
1687
1685
|
type: d,
|
|
1688
1686
|
ref: v,
|
|
1689
1687
|
"aria-disabled": b,
|
|
1690
|
-
onClick:
|
|
1691
|
-
...
|
|
1688
|
+
onClick: p,
|
|
1689
|
+
...f,
|
|
1692
1690
|
children: [
|
|
1693
1691
|
i && /* @__PURE__ */ _($o, { size: s === vo.LG ? "xs" : "xxs", negative: c, disabled: b }),
|
|
1694
1692
|
" ",
|
|
@@ -1993,7 +1991,7 @@ function Xo(e, r) {
|
|
|
1993
1991
|
}, e);
|
|
1994
1992
|
}
|
|
1995
1993
|
const Qt = "ScrollArea", [Jt, _a] = Et(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__ */ w((e, r) => {
|
|
1996
|
-
const { __scopeScrollArea: t, type: o = "hover", dir: a, scrollHideDelay: n = 600, ...i } = e, [c, l] = N(null), [s, u] = N(null), [d,
|
|
1994
|
+
const { __scopeScrollArea: t, type: o = "hover", dir: a, scrollHideDelay: n = 600, ...i } = e, [c, l] = N(null), [s, u] = N(null), [d, f] = N(null), [v, m] = N(null), [p, b] = N(null), [g, C] = N(0), [S, E] = N(0), [P, I] = N(!1), [O, x] = N(!1), T = k(
|
|
1997
1995
|
r,
|
|
1998
1996
|
(z) => l(z)
|
|
1999
1997
|
), R = Ho(a);
|
|
@@ -2006,12 +2004,12 @@ const Qt = "ScrollArea", [Jt, _a] = Et(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__
|
|
|
2006
2004
|
viewport: s,
|
|
2007
2005
|
onViewportChange: u,
|
|
2008
2006
|
content: d,
|
|
2009
|
-
onContentChange:
|
|
2007
|
+
onContentChange: f,
|
|
2010
2008
|
scrollbarX: v,
|
|
2011
2009
|
onScrollbarXChange: m,
|
|
2012
2010
|
scrollbarXEnabled: P,
|
|
2013
2011
|
onScrollbarXEnabledChange: I,
|
|
2014
|
-
scrollbarY:
|
|
2012
|
+
scrollbarY: p,
|
|
2015
2013
|
onScrollbarYChange: b,
|
|
2016
2014
|
scrollbarYEnabled: O,
|
|
2017
2015
|
onScrollbarYEnabledChange: x,
|
|
@@ -2148,11 +2146,11 @@ const Qt = "ScrollArea", [Jt, _a] = Et(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__
|
|
|
2148
2146
|
const s = a.viewport, u = n ? "scrollLeft" : "scrollTop";
|
|
2149
2147
|
if (s) {
|
|
2150
2148
|
let d = s[u];
|
|
2151
|
-
const
|
|
2149
|
+
const f = () => {
|
|
2152
2150
|
const v = s[u];
|
|
2153
2151
|
d !== v && (l("SCROLL"), i()), d = v;
|
|
2154
2152
|
};
|
|
2155
|
-
return s.addEventListener("scroll",
|
|
2153
|
+
return s.addEventListener("scroll", f), () => s.removeEventListener("scroll", f);
|
|
2156
2154
|
}
|
|
2157
2155
|
}, [
|
|
2158
2156
|
a.viewport,
|
|
@@ -2202,40 +2200,40 @@ const Qt = "ScrollArea", [Jt, _a] = Et(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__
|
|
|
2202
2200
|
sizes: c,
|
|
2203
2201
|
onSizesChange: l,
|
|
2204
2202
|
hasThumb: s > 0 && s < 1,
|
|
2205
|
-
onThumbChange: (
|
|
2203
|
+
onThumbChange: (f) => n.current = f,
|
|
2206
2204
|
onThumbPointerUp: () => i.current = 0,
|
|
2207
|
-
onThumbPointerDown: (
|
|
2205
|
+
onThumbPointerDown: (f) => i.current = f
|
|
2208
2206
|
};
|
|
2209
|
-
function d(
|
|
2210
|
-
return oa(
|
|
2207
|
+
function d(f, v) {
|
|
2208
|
+
return oa(f, i.current, c, v);
|
|
2211
2209
|
}
|
|
2212
2210
|
return t === "horizontal" ? /* @__PURE__ */ h(Jo, y({}, u, {
|
|
2213
2211
|
ref: r,
|
|
2214
2212
|
onThumbPositionChange: () => {
|
|
2215
2213
|
if (a.viewport && n.current) {
|
|
2216
|
-
const
|
|
2214
|
+
const f = a.viewport.scrollLeft, v = $t(f, c, a.dir);
|
|
2217
2215
|
n.current.style.transform = `translate3d(${v}px, 0, 0)`;
|
|
2218
2216
|
}
|
|
2219
2217
|
},
|
|
2220
|
-
onWheelScroll: (
|
|
2221
|
-
a.viewport && (a.viewport.scrollLeft =
|
|
2218
|
+
onWheelScroll: (f) => {
|
|
2219
|
+
a.viewport && (a.viewport.scrollLeft = f);
|
|
2222
2220
|
},
|
|
2223
|
-
onDragScroll: (
|
|
2224
|
-
a.viewport && (a.viewport.scrollLeft = d(
|
|
2221
|
+
onDragScroll: (f) => {
|
|
2222
|
+
a.viewport && (a.viewport.scrollLeft = d(f, a.dir));
|
|
2225
2223
|
}
|
|
2226
2224
|
})) : t === "vertical" ? /* @__PURE__ */ h(ea, y({}, u, {
|
|
2227
2225
|
ref: r,
|
|
2228
2226
|
onThumbPositionChange: () => {
|
|
2229
2227
|
if (a.viewport && n.current) {
|
|
2230
|
-
const
|
|
2228
|
+
const f = a.viewport.scrollTop, v = $t(f, c);
|
|
2231
2229
|
n.current.style.transform = `translate3d(0, ${v}px, 0)`;
|
|
2232
2230
|
}
|
|
2233
2231
|
},
|
|
2234
|
-
onWheelScroll: (
|
|
2235
|
-
a.viewport && (a.viewport.scrollTop =
|
|
2232
|
+
onWheelScroll: (f) => {
|
|
2233
|
+
a.viewport && (a.viewport.scrollTop = f);
|
|
2236
2234
|
},
|
|
2237
|
-
onDragScroll: (
|
|
2238
|
-
a.viewport && (a.viewport.scrollTop = d(
|
|
2235
|
+
onDragScroll: (f) => {
|
|
2236
|
+
a.viewport && (a.viewport.scrollTop = d(f));
|
|
2239
2237
|
}
|
|
2240
2238
|
})) : null;
|
|
2241
2239
|
}), Jo = /* @__PURE__ */ w((e, r) => {
|
|
@@ -2260,8 +2258,8 @@ const Qt = "ScrollArea", [Jt, _a] = Et(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__
|
|
|
2260
2258
|
onDragScroll: (u) => e.onDragScroll(u.x),
|
|
2261
2259
|
onWheelScroll: (u, d) => {
|
|
2262
2260
|
if (n.viewport) {
|
|
2263
|
-
const
|
|
2264
|
-
e.onWheelScroll(
|
|
2261
|
+
const f = n.viewport.scrollLeft + u.deltaX;
|
|
2262
|
+
e.onWheelScroll(f), ar(f, d) && u.preventDefault();
|
|
2265
2263
|
}
|
|
2266
2264
|
},
|
|
2267
2265
|
onResize: () => {
|
|
@@ -2299,8 +2297,8 @@ const Qt = "ScrollArea", [Jt, _a] = Et(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__
|
|
|
2299
2297
|
onDragScroll: (u) => e.onDragScroll(u.y),
|
|
2300
2298
|
onWheelScroll: (u, d) => {
|
|
2301
2299
|
if (n.viewport) {
|
|
2302
|
-
const
|
|
2303
|
-
e.onWheelScroll(
|
|
2300
|
+
const f = n.viewport.scrollTop + u.deltaY;
|
|
2301
|
+
e.onWheelScroll(f), ar(f, d) && u.preventDefault();
|
|
2304
2302
|
}
|
|
2305
2303
|
},
|
|
2306
2304
|
onResize: () => {
|
|
@@ -2316,9 +2314,9 @@ const Qt = "ScrollArea", [Jt, _a] = Et(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__
|
|
|
2316
2314
|
}
|
|
2317
2315
|
}));
|
|
2318
2316
|
}), [ta, tr] = Jt(X), rr = /* @__PURE__ */ w((e, r) => {
|
|
2319
|
-
const { __scopeScrollArea: t, sizes: o, hasThumb: a, onThumbChange: n, onThumbPointerUp: i, onThumbPointerDown: c, onThumbPositionChange: l, onDragScroll: s, onWheelScroll: u, onResize: d, ...
|
|
2317
|
+
const { __scopeScrollArea: t, sizes: o, hasThumb: a, onThumbChange: n, onThumbPointerUp: i, onThumbPointerDown: c, onThumbPositionChange: l, onDragScroll: s, onWheelScroll: u, onResize: d, ...f } = e, v = U(X, t), [m, p] = N(null), b = k(
|
|
2320
2318
|
r,
|
|
2321
|
-
(T) =>
|
|
2319
|
+
(T) => p(T)
|
|
2322
2320
|
), g = A(null), C = A(""), S = v.viewport, E = o.content - o.viewport, P = M(u), I = M(l), O = Ne(d, 10);
|
|
2323
2321
|
function x(T) {
|
|
2324
2322
|
if (g.current) {
|
|
@@ -2355,11 +2353,11 @@ const Qt = "ScrollArea", [Jt, _a] = Et(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__
|
|
|
2355
2353
|
onThumbPointerUp: M(i),
|
|
2356
2354
|
onThumbPositionChange: I,
|
|
2357
2355
|
onThumbPointerDown: M(c)
|
|
2358
|
-
}, /* @__PURE__ */ h(F.div, y({},
|
|
2356
|
+
}, /* @__PURE__ */ h(F.div, y({}, f, {
|
|
2359
2357
|
ref: b,
|
|
2360
2358
|
style: {
|
|
2361
2359
|
position: "absolute",
|
|
2362
|
-
...
|
|
2360
|
+
...f.style
|
|
2363
2361
|
},
|
|
2364
2362
|
onPointerDown: L(e.onPointerDown, (T) => {
|
|
2365
2363
|
T.button === 0 && (T.target.setPointerCapture(T.pointerId), g.current = m.getBoundingClientRect(), C.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", v.viewport && (v.viewport.style.scrollBehavior = "auto"), x(T));
|
|
@@ -2387,13 +2385,13 @@ const Qt = "ScrollArea", [Jt, _a] = Et(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__
|
|
|
2387
2385
|
return D(() => {
|
|
2388
2386
|
const d = n.viewport;
|
|
2389
2387
|
if (d) {
|
|
2390
|
-
const
|
|
2388
|
+
const f = () => {
|
|
2391
2389
|
if (u(), !s.current) {
|
|
2392
2390
|
const v = aa(d, c);
|
|
2393
2391
|
s.current = v, c();
|
|
2394
2392
|
}
|
|
2395
2393
|
};
|
|
2396
|
-
return c(), d.addEventListener("scroll",
|
|
2394
|
+
return c(), d.addEventListener("scroll", f), () => d.removeEventListener("scroll", f);
|
|
2397
2395
|
}
|
|
2398
2396
|
}, [
|
|
2399
2397
|
n.viewport,
|
|
@@ -2409,10 +2407,10 @@ const Qt = "ScrollArea", [Jt, _a] = Et(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__
|
|
|
2409
2407
|
...o
|
|
2410
2408
|
},
|
|
2411
2409
|
onPointerDownCapture: L(e.onPointerDownCapture, (d) => {
|
|
2412
|
-
const v = d.target.getBoundingClientRect(), m = d.clientX - v.left,
|
|
2410
|
+
const v = d.target.getBoundingClientRect(), m = d.clientX - v.left, p = d.clientY - v.top;
|
|
2413
2411
|
i.onThumbPointerDown({
|
|
2414
2412
|
x: m,
|
|
2415
|
-
y:
|
|
2413
|
+
y: p
|
|
2416
2414
|
});
|
|
2417
2415
|
}),
|
|
2418
2416
|
onPointerUp: L(e.onPointerUp, i.onThumbPointerUp)
|
|
@@ -2552,17 +2550,17 @@ const re = Q.bind(io), B = "purpur-drawer-frame", cr = w(
|
|
|
2552
2550
|
onBackButtonClick: s,
|
|
2553
2551
|
onSwipeStart: u,
|
|
2554
2552
|
onSwipeMove: d,
|
|
2555
|
-
onSwipeCancel:
|
|
2553
|
+
onSwipeCancel: f,
|
|
2556
2554
|
onSwipeEnd: v,
|
|
2557
2555
|
title: m,
|
|
2558
|
-
stickyFooter:
|
|
2556
|
+
stickyFooter: p,
|
|
2559
2557
|
...b
|
|
2560
2558
|
}, g) => {
|
|
2561
2559
|
const C = re([
|
|
2562
2560
|
n,
|
|
2563
2561
|
B,
|
|
2564
2562
|
{
|
|
2565
|
-
[`${B}--sticky-footer`]:
|
|
2563
|
+
[`${B}--sticky-footer`]: p
|
|
2566
2564
|
}
|
|
2567
2565
|
]);
|
|
2568
2566
|
return /* @__PURE__ */ Y(
|
|
@@ -2579,7 +2577,7 @@ const re = Q.bind(io), B = "purpur-drawer-frame", cr = w(
|
|
|
2579
2577
|
{
|
|
2580
2578
|
onSwipeStart: u,
|
|
2581
2579
|
onSwipeMove: d,
|
|
2582
|
-
onSwipeCancel:
|
|
2580
|
+
onSwipeCancel: f,
|
|
2583
2581
|
onSwipeEnd: v
|
|
2584
2582
|
}
|
|
2585
2583
|
),
|
|
@@ -2588,7 +2586,7 @@ const re = Q.bind(io), B = "purpur-drawer-frame", cr = w(
|
|
|
2588
2586
|
{
|
|
2589
2587
|
className: re(`${B}__header`),
|
|
2590
2588
|
variant: "header",
|
|
2591
|
-
stickyFooter:
|
|
2589
|
+
stickyFooter: p,
|
|
2592
2590
|
children: /* @__PURE__ */ _(
|
|
2593
2591
|
Zt,
|
|
2594
2592
|
{
|
|
@@ -2602,7 +2600,7 @@ const re = Q.bind(io), B = "purpur-drawer-frame", cr = w(
|
|
|
2602
2600
|
)
|
|
2603
2601
|
}
|
|
2604
2602
|
),
|
|
2605
|
-
|
|
2603
|
+
p ? /* @__PURE__ */ Y(lr, { children: [
|
|
2606
2604
|
/* @__PURE__ */ _(
|
|
2607
2605
|
Ze,
|
|
2608
2606
|
{
|
|
@@ -2617,7 +2615,7 @@ const re = Q.bind(io), B = "purpur-drawer-frame", cr = w(
|
|
|
2617
2615
|
className: re(`${B}__footer`),
|
|
2618
2616
|
"data-testid": `${e}-sticky-footer`,
|
|
2619
2617
|
variant: "footer",
|
|
2620
|
-
stickyFooter:
|
|
2618
|
+
stickyFooter: p,
|
|
2621
2619
|
children: c
|
|
2622
2620
|
}
|
|
2623
2621
|
)
|
|
@@ -2634,12 +2632,12 @@ const re = Q.bind(io), B = "purpur-drawer-frame", cr = w(
|
|
|
2634
2632
|
{ [`${B}__content-container--no-footer`]: !c }
|
|
2635
2633
|
]),
|
|
2636
2634
|
children: [
|
|
2637
|
-
/* @__PURE__ */ _(ne, { stickyFooter:
|
|
2635
|
+
/* @__PURE__ */ _(ne, { stickyFooter: p, children: a }),
|
|
2638
2636
|
c && /* @__PURE__ */ _(
|
|
2639
2637
|
ne,
|
|
2640
2638
|
{
|
|
2641
2639
|
"data-testid": `${e}-footer`,
|
|
2642
|
-
stickyFooter:
|
|
2640
|
+
stickyFooter: p,
|
|
2643
2641
|
variant: "footer",
|
|
2644
2642
|
children: c
|
|
2645
2643
|
}
|
|
@@ -2691,10 +2689,10 @@ const da = (e, r) => ({
|
|
|
2691
2689
|
footerContent: s,
|
|
2692
2690
|
onBackButtonClick: u,
|
|
2693
2691
|
stickyFooter: d = !1,
|
|
2694
|
-
title:
|
|
2692
|
+
title: f,
|
|
2695
2693
|
...v
|
|
2696
2694
|
}, m) => {
|
|
2697
|
-
const
|
|
2695
|
+
const p = ue([i, $e]), b = A(null), g = Te(Ut), { onAnimationEnd: C, onSwipeStart: S, onSwipeMove: E, onSwipeCancel: P, onSwipeEnd: I } = da(b, g), O = (x) => {
|
|
2698
2696
|
l && x.preventDefault();
|
|
2699
2697
|
};
|
|
2700
2698
|
return /* @__PURE__ */ _(Bn, { children: /* @__PURE__ */ _(
|
|
@@ -2706,7 +2704,7 @@ const da = (e, r) => ({
|
|
|
2706
2704
|
qn,
|
|
2707
2705
|
{
|
|
2708
2706
|
onPointerDownOutside: O,
|
|
2709
|
-
className:
|
|
2707
|
+
className: p,
|
|
2710
2708
|
"data-testid": e,
|
|
2711
2709
|
ref: m,
|
|
2712
2710
|
...v,
|
|
@@ -2727,7 +2725,7 @@ const da = (e, r) => ({
|
|
|
2727
2725
|
onSwipeCancel: P,
|
|
2728
2726
|
onSwipeEnd: I,
|
|
2729
2727
|
stickyFooter: d,
|
|
2730
|
-
title:
|
|
2728
|
+
title: f,
|
|
2731
2729
|
children: a ? /* @__PURE__ */ Y("div", { className: ue(`${$e}__content-container`), children: [
|
|
2732
2730
|
/* @__PURE__ */ _(
|
|
2733
2731
|
Kn,
|
|
@@ -2767,7 +2765,7 @@ const sr = w(
|
|
|
2767
2765
|
)
|
|
2768
2766
|
);
|
|
2769
2767
|
sr.displayName = "DrawerTrigger";
|
|
2770
|
-
const
|
|
2768
|
+
const fa = Q.bind(Jn), pa = "purpur-drawer", nt = ({
|
|
2771
2769
|
["data-testid"]: e = "purpur-drawer",
|
|
2772
2770
|
children: r,
|
|
2773
2771
|
className: t,
|
|
@@ -2775,7 +2773,7 @@ const pa = Q.bind(Jn), fa = "purpur-drawer", nt = ({
|
|
|
2775
2773
|
open: a = !1,
|
|
2776
2774
|
...n
|
|
2777
2775
|
}) => {
|
|
2778
|
-
const [i, c] = Ue.useState(a), l =
|
|
2776
|
+
const [i, c] = Ue.useState(a), l = fa([t, pa]), s = (u) => {
|
|
2779
2777
|
c(u), o == null || o(u);
|
|
2780
2778
|
};
|
|
2781
2779
|
return D(() => {
|