@purpurds/drawer 5.19.0 → 5.19.1
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-content.d.ts +1 -0
- package/dist/drawer-content.d.ts.map +1 -1
- package/dist/drawer.cjs.js +3 -3
- package/dist/drawer.cjs.js.map +1 -1
- package/dist/drawer.es.js +98 -95
- package/dist/drawer.es.js.map +1 -1
- package/package.json +6 -6
- package/src/drawer-content.tsx +4 -0
- package/src/drawer.stories.tsx +1 -0
package/dist/drawer.es.js
CHANGED
|
@@ -272,19 +272,19 @@ const Cr = /* @__PURE__ */ de({
|
|
|
272
272
|
(x) => f(x)
|
|
273
273
|
), b = Array.from(u.layers), [g] = [
|
|
274
274
|
...u.layersWithOutsidePointerEventsDisabled
|
|
275
|
-
].slice(-1),
|
|
276
|
-
const
|
|
275
|
+
].slice(-1), P = b.indexOf(g), S = d ? b.indexOf(d) : -1, E = u.layersWithOutsidePointerEventsDisabled.size > 0, T = S >= P, I = Tr((x) => {
|
|
276
|
+
const C = x.target, R = [
|
|
277
277
|
...u.branches
|
|
278
278
|
].some(
|
|
279
|
-
(
|
|
279
|
+
(W) => W.contains(C)
|
|
280
280
|
);
|
|
281
|
-
!
|
|
281
|
+
!T || R || (n == null || n(x), c == null || c(x), x.defaultPrevented || l == null || l());
|
|
282
282
|
}, v), O = Ar((x) => {
|
|
283
|
-
const
|
|
283
|
+
const C = x.target;
|
|
284
284
|
[
|
|
285
285
|
...u.branches
|
|
286
286
|
].some(
|
|
287
|
-
(
|
|
287
|
+
(W) => W.contains(C)
|
|
288
288
|
) || (i == null || i(x), c == null || c(x), x.defaultPrevented || l == null || l());
|
|
289
289
|
}, v);
|
|
290
290
|
return Sr((x) => {
|
|
@@ -310,7 +310,7 @@ const Cr = /* @__PURE__ */ de({
|
|
|
310
310
|
}, []), /* @__PURE__ */ h(F.div, y({}, s, {
|
|
311
311
|
ref: p,
|
|
312
312
|
style: {
|
|
313
|
-
pointerEvents: E ?
|
|
313
|
+
pointerEvents: E ? T ? "auto" : "none" : void 0,
|
|
314
314
|
...e.style
|
|
315
315
|
},
|
|
316
316
|
onFocusCapture: L(e.onFocusCapture, O.onFocusCapture),
|
|
@@ -417,15 +417,15 @@ const Le = "focusScope.autoFocusOnMount", Re = "focusScope.autoFocusOnUnmount",
|
|
|
417
417
|
}));
|
|
418
418
|
}, g = function(S) {
|
|
419
419
|
if (document.activeElement === document.body)
|
|
420
|
-
for (const
|
|
420
|
+
for (const T of S) T.removedNodes.length > 0 && V(c);
|
|
421
421
|
};
|
|
422
422
|
document.addEventListener("focusin", p), document.addEventListener("focusout", b);
|
|
423
|
-
const
|
|
424
|
-
return c &&
|
|
423
|
+
const P = new MutationObserver(g);
|
|
424
|
+
return c && P.observe(c, {
|
|
425
425
|
childList: !0,
|
|
426
426
|
subtree: !0
|
|
427
427
|
}), () => {
|
|
428
|
-
document.removeEventListener("focusin", p), document.removeEventListener("focusout", b),
|
|
428
|
+
document.removeEventListener("focusin", p), document.removeEventListener("focusout", b), P.disconnect();
|
|
429
429
|
};
|
|
430
430
|
}
|
|
431
431
|
}, [
|
|
@@ -461,12 +461,12 @@ const Le = "focusScope.autoFocusOnMount", Re = "focusScope.autoFocusOnUnmount",
|
|
|
461
461
|
if (!t && !o || v.paused) return;
|
|
462
462
|
const b = p.key === "Tab" && !p.altKey && !p.ctrlKey && !p.metaKey, g = document.activeElement;
|
|
463
463
|
if (b && g) {
|
|
464
|
-
const
|
|
464
|
+
const P = p.currentTarget, [S, E] = Or(P);
|
|
465
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 ===
|
|
469
|
+
})) : g === P && p.preventDefault();
|
|
470
470
|
}
|
|
471
471
|
}, [
|
|
472
472
|
t,
|
|
@@ -637,7 +637,7 @@ function pe(e) {
|
|
|
637
637
|
return (e == null ? void 0 : e.animationName) || "none";
|
|
638
638
|
}
|
|
639
639
|
let Me = 0;
|
|
640
|
-
function
|
|
640
|
+
function Wr() {
|
|
641
641
|
D(() => {
|
|
642
642
|
var e, r;
|
|
643
643
|
const t = document.querySelectorAll("[data-radix-focus-guard]");
|
|
@@ -652,14 +652,14 @@ function ut() {
|
|
|
652
652
|
const e = document.createElement("span");
|
|
653
653
|
return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none", e;
|
|
654
654
|
}
|
|
655
|
-
var
|
|
656
|
-
return
|
|
655
|
+
var z = function() {
|
|
656
|
+
return z = Object.assign || function(r) {
|
|
657
657
|
for (var t, o = 1, a = arguments.length; o < a; o++) {
|
|
658
658
|
t = arguments[o];
|
|
659
659
|
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (r[n] = t[n]);
|
|
660
660
|
}
|
|
661
661
|
return r;
|
|
662
|
-
},
|
|
662
|
+
}, z.apply(this, arguments);
|
|
663
663
|
};
|
|
664
664
|
function Pt(e, r) {
|
|
665
665
|
var t = {};
|
|
@@ -669,7 +669,7 @@ function Pt(e, r) {
|
|
|
669
669
|
r.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (t[o[a]] = e[o[a]]);
|
|
670
670
|
return t;
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function zr(e, r, t) {
|
|
673
673
|
if (t || arguments.length === 2) for (var o = 0, a = r.length, n; o < a; o++)
|
|
674
674
|
(n || !(o in r)) && (n || (n = Array.prototype.slice.call(r, 0, o)), n[o] = r[o]);
|
|
675
675
|
return e.concat(n || Array.prototype.slice.call(r));
|
|
@@ -780,7 +780,7 @@ function qr(e, r) {
|
|
|
780
780
|
function Kr(e) {
|
|
781
781
|
e === void 0 && (e = {});
|
|
782
782
|
var r = qr(null);
|
|
783
|
-
return r.options =
|
|
783
|
+
return r.options = z({ async: !0, ssr: !1 }, e), r;
|
|
784
784
|
}
|
|
785
785
|
var Tt = function(e) {
|
|
786
786
|
var r = e.sideCar, t = Pt(e, ["sideCar"]);
|
|
@@ -789,7 +789,7 @@ var Tt = function(e) {
|
|
|
789
789
|
var o = r.read();
|
|
790
790
|
if (!o)
|
|
791
791
|
throw new Error("Sidecar medium not found");
|
|
792
|
-
return $.createElement(o,
|
|
792
|
+
return $.createElement(o, z({}, t));
|
|
793
793
|
};
|
|
794
794
|
Tt.isSideCarExport = !0;
|
|
795
795
|
function Gr(e, r) {
|
|
@@ -801,12 +801,12 @@ 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, f = e.sideCar, v = e.noIsolation, m = e.inert, p = e.allowPinchZoom, b = e.as, g = b === void 0 ? "div" : b,
|
|
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, P = Pt(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]), S = f, E = Br([t, r]), T = z(z({}, P), a);
|
|
805
805
|
return $.createElement(
|
|
806
806
|
$.Fragment,
|
|
807
807
|
null,
|
|
808
808
|
u && $.createElement(S, { sideCar: At, removeScrollBar: s, shards: d, noIsolation: v, inert: m, setCallbacks: n, allowPinchZoom: !!p, lockRef: t }),
|
|
809
|
-
i ? $.cloneElement($.Children.only(c),
|
|
809
|
+
i ? $.cloneElement($.Children.only(c), z(z({}, T), { ref: E })) : $.createElement(g, z({}, T, { className: l, ref: E }), c)
|
|
810
810
|
);
|
|
811
811
|
});
|
|
812
812
|
Ae.defaultProps = {
|
|
@@ -1035,7 +1035,7 @@ 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 p =
|
|
1038
|
+
var p = zr([e.lockRef.current], (e.shards || []).map(ht), !0).filter(Boolean);
|
|
1039
1039
|
return p.forEach(function(b) {
|
|
1040
1040
|
return b.classList.add("allow-interactivity-".concat(a));
|
|
1041
1041
|
}), function() {
|
|
@@ -1048,37 +1048,37 @@ function wn(e) {
|
|
|
1048
1048
|
var c = $.useCallback(function(p, b) {
|
|
1049
1049
|
if ("touches" in p && p.touches.length === 2)
|
|
1050
1050
|
return !i.current.allowPinchZoom;
|
|
1051
|
-
var g = he(p),
|
|
1051
|
+
var g = he(p), P = t.current, S = "deltaX" in p ? p.deltaX : P[0] - g[0], E = "deltaY" in p ? p.deltaY : P[1] - g[1], T, I = p.target, O = Math.abs(S) > Math.abs(E) ? "h" : "v";
|
|
1052
1052
|
if ("touches" in p && O === "h" && I.type === "range")
|
|
1053
1053
|
return !1;
|
|
1054
1054
|
var x = pt(O, I);
|
|
1055
1055
|
if (!x)
|
|
1056
1056
|
return !0;
|
|
1057
|
-
if (x ?
|
|
1057
|
+
if (x ? T = O : (T = O === "v" ? "h" : "v", x = pt(O, I)), !x)
|
|
1058
1058
|
return !1;
|
|
1059
|
-
if (!o.current && "changedTouches" in p && (S || E) && (o.current =
|
|
1059
|
+
if (!o.current && "changedTouches" in p && (S || E) && (o.current = T), !T)
|
|
1060
1060
|
return !0;
|
|
1061
|
-
var
|
|
1062
|
-
return mn(
|
|
1061
|
+
var C = o.current || T;
|
|
1062
|
+
return mn(C, b, p, C === "h" ? S : E, !0);
|
|
1063
1063
|
}, []), l = $.useCallback(function(p) {
|
|
1064
1064
|
var b = p;
|
|
1065
1065
|
if (!(!ee.length || ee[ee.length - 1] !== n)) {
|
|
1066
|
-
var g = "deltaY" in b ? vt(b) : he(b),
|
|
1067
|
-
return
|
|
1066
|
+
var g = "deltaY" in b ? vt(b) : he(b), P = r.current.filter(function(T) {
|
|
1067
|
+
return T.name === b.type && T.target === b.target && gn(T.delta, g);
|
|
1068
1068
|
})[0];
|
|
1069
|
-
if (
|
|
1069
|
+
if (P && P.should) {
|
|
1070
1070
|
b.cancelable && b.preventDefault();
|
|
1071
1071
|
return;
|
|
1072
1072
|
}
|
|
1073
|
-
if (!
|
|
1074
|
-
var S = (i.current.shards || []).map(ht).filter(Boolean).filter(function(
|
|
1075
|
-
return
|
|
1073
|
+
if (!P) {
|
|
1074
|
+
var S = (i.current.shards || []).map(ht).filter(Boolean).filter(function(T) {
|
|
1075
|
+
return T.contains(b.target);
|
|
1076
1076
|
}), E = S.length > 0 ? c(b, S[0]) : !i.current.noIsolation;
|
|
1077
1077
|
E && b.cancelable && b.preventDefault();
|
|
1078
1078
|
}
|
|
1079
1079
|
}
|
|
1080
|
-
}, []), s = $.useCallback(function(p, b, g,
|
|
1081
|
-
var S = { name: p, delta: b, target: g, should:
|
|
1080
|
+
}, []), s = $.useCallback(function(p, b, g, P) {
|
|
1081
|
+
var S = { name: p, delta: b, target: g, should: P };
|
|
1082
1082
|
r.current.push(S), setTimeout(function() {
|
|
1083
1083
|
r.current = r.current.filter(function(E) {
|
|
1084
1084
|
return E !== S;
|
|
@@ -1112,7 +1112,7 @@ function wn(e) {
|
|
|
1112
1112
|
}
|
|
1113
1113
|
const yn = Gr(At, wn);
|
|
1114
1114
|
var Rt = $.forwardRef(function(e, r) {
|
|
1115
|
-
return $.createElement(Ae,
|
|
1115
|
+
return $.createElement(Ae, z({}, e, { ref: r, sideCar: yn }));
|
|
1116
1116
|
});
|
|
1117
1117
|
Rt.classNames = Ae.classNames;
|
|
1118
1118
|
var Sn = function(e) {
|
|
@@ -1259,7 +1259,7 @@ const It = "Dialog", [kt, ga] = Et(It), [Pn, j] = kt(It), Tn = (e) => {
|
|
|
1259
1259
|
return D(() => {
|
|
1260
1260
|
const n = o.current;
|
|
1261
1261
|
if (n) return Cn(n);
|
|
1262
|
-
}, []), /* @__PURE__ */ h(
|
|
1262
|
+
}, []), /* @__PURE__ */ h(Wt, y({}, e, {
|
|
1263
1263
|
ref: a,
|
|
1264
1264
|
trapFocus: t.open,
|
|
1265
1265
|
disableOutsidePointerEvents: !0,
|
|
@@ -1278,7 +1278,7 @@ const It = "Dialog", [kt, ga] = Et(It), [Pn, j] = kt(It), Tn = (e) => {
|
|
|
1278
1278
|
}));
|
|
1279
1279
|
}), kn = /* @__PURE__ */ w((e, r) => {
|
|
1280
1280
|
const t = j(fe, e.__scopeDialog), o = A(!1), a = A(!1);
|
|
1281
|
-
return /* @__PURE__ */ h(
|
|
1281
|
+
return /* @__PURE__ */ h(Wt, y({}, e, {
|
|
1282
1282
|
ref: r,
|
|
1283
1283
|
trapFocus: !1,
|
|
1284
1284
|
disableOutsidePointerEvents: !1,
|
|
@@ -1297,9 +1297,9 @@ const It = "Dialog", [kt, ga] = Et(It), [Pn, j] = kt(It), Tn = (e) => {
|
|
|
1297
1297
|
((c = t.triggerRef.current) === null || c === void 0 ? void 0 : c.contains(l)) && n.preventDefault(), n.detail.originalEvent.type === "focusin" && a.current && n.preventDefault();
|
|
1298
1298
|
}
|
|
1299
1299
|
}));
|
|
1300
|
-
}),
|
|
1300
|
+
}), Wt = /* @__PURE__ */ w((e, r) => {
|
|
1301
1301
|
const { __scopeDialog: t, trapFocus: o, onOpenAutoFocus: a, onCloseAutoFocus: n, ...i } = e, c = j(fe, t), l = A(null), s = k(r, l);
|
|
1302
|
-
return
|
|
1302
|
+
return Wr(), /* @__PURE__ */ h(Je, null, /* @__PURE__ */ h(Dr, {
|
|
1303
1303
|
asChild: !0,
|
|
1304
1304
|
loop: !0,
|
|
1305
1305
|
trapped: o,
|
|
@@ -1322,8 +1322,8 @@ const It = "Dialog", [kt, ga] = Et(It), [Pn, j] = kt(It), Tn = (e) => {
|
|
|
1322
1322
|
}, o, {
|
|
1323
1323
|
ref: r
|
|
1324
1324
|
}));
|
|
1325
|
-
}),
|
|
1326
|
-
const { __scopeDialog: t, ...o } = e, a = j(
|
|
1325
|
+
}), Wn = "DialogDescription", zn = /* @__PURE__ */ w((e, r) => {
|
|
1326
|
+
const { __scopeDialog: t, ...o } = e, a = j(Wn, t);
|
|
1327
1327
|
return /* @__PURE__ */ h(F.p, y({
|
|
1328
1328
|
id: a.descriptionId
|
|
1329
1329
|
}, o, {
|
|
@@ -1344,11 +1344,11 @@ const It = "Dialog", [kt, ga] = Et(It), [Pn, j] = kt(It), Tn = (e) => {
|
|
|
1344
1344
|
function tt(e) {
|
|
1345
1345
|
return e ? "open" : "closed";
|
|
1346
1346
|
}
|
|
1347
|
-
const Yn = Tn, Xn = Dn, Bn = On, Vn = Ln, qn = Mn, bt = jn, Kn =
|
|
1347
|
+
const Yn = Tn, Xn = Dn, Bn = On, Vn = Ln, qn = Mn, bt = jn, Kn = zn, Gn = Hn;
|
|
1348
1348
|
function Zn(e) {
|
|
1349
1349
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1350
1350
|
}
|
|
1351
|
-
var
|
|
1351
|
+
var zt = { exports: {} };
|
|
1352
1352
|
/*!
|
|
1353
1353
|
Copyright (c) 2018 Jed Watson.
|
|
1354
1354
|
Licensed under the MIT License (MIT), see
|
|
@@ -1383,8 +1383,8 @@ var Wt = { exports: {} };
|
|
|
1383
1383
|
}
|
|
1384
1384
|
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
1385
1385
|
})();
|
|
1386
|
-
})(
|
|
1387
|
-
var Qn =
|
|
1386
|
+
})(zt);
|
|
1387
|
+
var Qn = zt.exports;
|
|
1388
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
1389
|
"purpur-drawer-content": "_purpur-drawer-content_10vdf_1",
|
|
1390
1390
|
drawerSmallScreenAnimation: eo,
|
|
@@ -1400,7 +1400,7 @@ const Q = /* @__PURE__ */ Zn(Qn), Ut = de(null), Jn = {}, eo = "_drawerSmallScre
|
|
|
1400
1400
|
"purpur-drawer-container--body": "_purpur-drawer-container--body_1r6tb_5",
|
|
1401
1401
|
"purpur-drawer-container--sticky": "_purpur-drawer-container--sticky_1r6tb_8",
|
|
1402
1402
|
"purpur-drawer-container--footer": "_purpur-drawer-container--footer_1r6tb_11"
|
|
1403
|
-
}, co = Q.bind(ao),
|
|
1403
|
+
}, co = Q.bind(ao), We = "purpur-drawer-container", ne = w(
|
|
1404
1404
|
({
|
|
1405
1405
|
["data-testid"]: e = "purpur-drawer-container",
|
|
1406
1406
|
children: r,
|
|
@@ -1411,12 +1411,12 @@ const Q = /* @__PURE__ */ Zn(Qn), Ut = de(null), Jn = {}, eo = "_drawerSmallScre
|
|
|
1411
1411
|
}, i) => {
|
|
1412
1412
|
const c = co([
|
|
1413
1413
|
t,
|
|
1414
|
-
|
|
1414
|
+
We,
|
|
1415
1415
|
{
|
|
1416
|
-
[`${
|
|
1416
|
+
[`${We}--${o}`]: o
|
|
1417
1417
|
},
|
|
1418
1418
|
{
|
|
1419
|
-
[`${
|
|
1419
|
+
[`${We}--sticky`]: a
|
|
1420
1420
|
}
|
|
1421
1421
|
]);
|
|
1422
1422
|
return /* @__PURE__ */ _("div", { className: c, "data-testid": e, ref: i, ...n, children: r });
|
|
@@ -1639,7 +1639,7 @@ const So = /* @__PURE__ */ wo(yo), Eo = {
|
|
|
1639
1639
|
"purpur-button--tertiary-purple-negative": "_purpur-button--tertiary-purple-negative_1acxn_160",
|
|
1640
1640
|
"purpur-button--text-negative": "_purpur-button--text-negative_1acxn_175",
|
|
1641
1641
|
"purpur-button--text": "_purpur-button--text_1acxn_175"
|
|
1642
|
-
},
|
|
1642
|
+
}, ze = {
|
|
1643
1643
|
...po,
|
|
1644
1644
|
DESTRUCTIVE: "destructive",
|
|
1645
1645
|
TERTIARY_PURPLE: "tertiary-purple",
|
|
@@ -1865,7 +1865,7 @@ const Io = Oo.bind(Lo), _t = "purpur-icon", ko = "md", Fo = (e) => e.filter((r)
|
|
|
1865
1865
|
r ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
1866
1866
|
], o = r ? `<title>${r}</title>` : "";
|
|
1867
1867
|
return `<svg ${Fo(t)}>${o}${e}</svg>`;
|
|
1868
|
-
},
|
|
1868
|
+
}, Wo = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), Gt = ({
|
|
1869
1869
|
["data-testid"]: e,
|
|
1870
1870
|
svg: r,
|
|
1871
1871
|
allyTitle: t,
|
|
@@ -1874,7 +1874,7 @@ const Io = Oo.bind(Lo), _t = "purpur-icon", ko = "md", Fo = (e) => e.filter((r)
|
|
|
1874
1874
|
...n
|
|
1875
1875
|
}) => {
|
|
1876
1876
|
const i = jo({
|
|
1877
|
-
content:
|
|
1877
|
+
content: Wo(r.svg),
|
|
1878
1878
|
title: t
|
|
1879
1879
|
}), c = Io(o, _t, `${_t}--${a}`);
|
|
1880
1880
|
return /* @__PURE__ */ _(
|
|
@@ -1887,14 +1887,14 @@ const Io = Oo.bind(Lo), _t = "purpur-icon", ko = "md", Fo = (e) => e.filter((r)
|
|
|
1887
1887
|
...n
|
|
1888
1888
|
}
|
|
1889
1889
|
);
|
|
1890
|
-
},
|
|
1890
|
+
}, zo = {
|
|
1891
1891
|
"purpur-drawer-header__row": "_purpur-drawer-header__row_1yg5w_1",
|
|
1892
1892
|
"purpur-drawer-header__row--with-back-button": "_purpur-drawer-header__row--with-back-button_1yg5w_6",
|
|
1893
1893
|
"purpur-drawer-header__left": "_purpur-drawer-header__left_1yg5w_9",
|
|
1894
1894
|
"purpur-drawer-header__right": "_purpur-drawer-header__right_1yg5w_12",
|
|
1895
1895
|
"purpur-drawer-header__close-button": "_purpur-drawer-header__close-button_1yg5w_15",
|
|
1896
1896
|
"purpur-drawer-header__back-button--only-icon": "_purpur-drawer-header__back-button--only-icon_1yg5w_18"
|
|
1897
|
-
}, G = Q.bind(
|
|
1897
|
+
}, G = Q.bind(zo), H = "purpur-drawer-header", Zt = w(
|
|
1898
1898
|
({
|
|
1899
1899
|
["data-testid"]: e = "purpur-drawer-header",
|
|
1900
1900
|
backButton: r,
|
|
@@ -1933,7 +1933,7 @@ const Io = Oo.bind(Lo), _t = "purpur-icon", ko = "md", Fo = (e) => e.filter((r)
|
|
|
1933
1933
|
iconOnly: o,
|
|
1934
1934
|
onClick: i,
|
|
1935
1935
|
size: "sm",
|
|
1936
|
-
variant: o ?
|
|
1936
|
+
variant: o ? ze.TERTIARY_PURPLE : ze.TEXT,
|
|
1937
1937
|
children: [
|
|
1938
1938
|
/* @__PURE__ */ _(qt, { size: "sm" }),
|
|
1939
1939
|
!o && t
|
|
@@ -1955,7 +1955,7 @@ const Io = Oo.bind(Lo), _t = "purpur-icon", ko = "md", Fo = (e) => e.filter((r)
|
|
|
1955
1955
|
className: G(`${H}__close-button`),
|
|
1956
1956
|
iconOnly: !0,
|
|
1957
1957
|
size: "sm",
|
|
1958
|
-
variant:
|
|
1958
|
+
variant: ze.TERTIARY_PURPLE,
|
|
1959
1959
|
children: /* @__PURE__ */ _(Kt, { size: "sm" })
|
|
1960
1960
|
}
|
|
1961
1961
|
) }) })
|
|
@@ -1991,9 +1991,9 @@ function Xo(e, r) {
|
|
|
1991
1991
|
}, e);
|
|
1992
1992
|
}
|
|
1993
1993
|
const Qt = "ScrollArea", [Jt, _a] = Et(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__ */ w((e, r) => {
|
|
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,
|
|
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, P] = N(0), [S, E] = N(0), [T, I] = N(!1), [O, x] = N(!1), C = k(
|
|
1995
1995
|
r,
|
|
1996
|
-
(
|
|
1996
|
+
(W) => l(W)
|
|
1997
1997
|
), R = Ho(a);
|
|
1998
1998
|
return /* @__PURE__ */ h(Bo, {
|
|
1999
1999
|
scope: t,
|
|
@@ -2007,18 +2007,18 @@ const Qt = "ScrollArea", [Jt, _a] = Et(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__
|
|
|
2007
2007
|
onContentChange: f,
|
|
2008
2008
|
scrollbarX: v,
|
|
2009
2009
|
onScrollbarXChange: m,
|
|
2010
|
-
scrollbarXEnabled:
|
|
2010
|
+
scrollbarXEnabled: T,
|
|
2011
2011
|
onScrollbarXEnabledChange: I,
|
|
2012
2012
|
scrollbarY: p,
|
|
2013
2013
|
onScrollbarYChange: b,
|
|
2014
2014
|
scrollbarYEnabled: O,
|
|
2015
2015
|
onScrollbarYEnabledChange: x,
|
|
2016
|
-
onCornerWidthChange:
|
|
2016
|
+
onCornerWidthChange: P,
|
|
2017
2017
|
onCornerHeightChange: E
|
|
2018
2018
|
}, /* @__PURE__ */ h(F.div, y({
|
|
2019
2019
|
dir: R
|
|
2020
2020
|
}, i, {
|
|
2021
|
-
ref:
|
|
2021
|
+
ref: C,
|
|
2022
2022
|
style: {
|
|
2023
2023
|
position: "relative",
|
|
2024
2024
|
// Pass corner sizes as CSS vars to reduce re-renders of context consumers
|
|
@@ -2316,32 +2316,32 @@ const Qt = "ScrollArea", [Jt, _a] = Et(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__
|
|
|
2316
2316
|
}), [ta, tr] = Jt(X), rr = /* @__PURE__ */ w((e, r) => {
|
|
2317
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(
|
|
2318
2318
|
r,
|
|
2319
|
-
(
|
|
2320
|
-
), g = A(null),
|
|
2321
|
-
function x(
|
|
2319
|
+
(C) => p(C)
|
|
2320
|
+
), g = A(null), P = A(""), S = v.viewport, E = o.content - o.viewport, T = M(u), I = M(l), O = Ne(d, 10);
|
|
2321
|
+
function x(C) {
|
|
2322
2322
|
if (g.current) {
|
|
2323
|
-
const R =
|
|
2323
|
+
const R = C.clientX - g.current.left, W = C.clientY - g.current.top;
|
|
2324
2324
|
s({
|
|
2325
2325
|
x: R,
|
|
2326
|
-
y:
|
|
2326
|
+
y: W
|
|
2327
2327
|
});
|
|
2328
2328
|
}
|
|
2329
2329
|
}
|
|
2330
2330
|
return D(() => {
|
|
2331
|
-
const
|
|
2332
|
-
const
|
|
2333
|
-
(m == null ? void 0 : m.contains(
|
|
2331
|
+
const C = (R) => {
|
|
2332
|
+
const W = R.target;
|
|
2333
|
+
(m == null ? void 0 : m.contains(W)) && T(R, E);
|
|
2334
2334
|
};
|
|
2335
|
-
return document.addEventListener("wheel",
|
|
2335
|
+
return document.addEventListener("wheel", C, {
|
|
2336
2336
|
passive: !1
|
|
2337
|
-
}), () => document.removeEventListener("wheel",
|
|
2337
|
+
}), () => document.removeEventListener("wheel", C, {
|
|
2338
2338
|
passive: !1
|
|
2339
2339
|
});
|
|
2340
2340
|
}, [
|
|
2341
2341
|
S,
|
|
2342
2342
|
m,
|
|
2343
2343
|
E,
|
|
2344
|
-
|
|
2344
|
+
T
|
|
2345
2345
|
]), D(I, [
|
|
2346
2346
|
o,
|
|
2347
2347
|
I
|
|
@@ -2359,13 +2359,13 @@ const Qt = "ScrollArea", [Jt, _a] = Et(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__
|
|
|
2359
2359
|
position: "absolute",
|
|
2360
2360
|
...f.style
|
|
2361
2361
|
},
|
|
2362
|
-
onPointerDown: L(e.onPointerDown, (
|
|
2363
|
-
|
|
2362
|
+
onPointerDown: L(e.onPointerDown, (C) => {
|
|
2363
|
+
C.button === 0 && (C.target.setPointerCapture(C.pointerId), g.current = m.getBoundingClientRect(), P.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", v.viewport && (v.viewport.style.scrollBehavior = "auto"), x(C));
|
|
2364
2364
|
}),
|
|
2365
2365
|
onPointerMove: L(e.onPointerMove, x),
|
|
2366
|
-
onPointerUp: L(e.onPointerUp, (
|
|
2367
|
-
const R =
|
|
2368
|
-
R.hasPointerCapture(
|
|
2366
|
+
onPointerUp: L(e.onPointerUp, (C) => {
|
|
2367
|
+
const R = C.target;
|
|
2368
|
+
R.hasPointerCapture(C.pointerId) && R.releasePointerCapture(C.pointerId), document.body.style.webkitUserSelect = P.current, v.viewport && (v.viewport.style.scrollBehavior = ""), g.current = null;
|
|
2369
2369
|
})
|
|
2370
2370
|
})));
|
|
2371
2371
|
}), Ge = "ScrollAreaThumb", ra = /* @__PURE__ */ w((e, r) => {
|
|
@@ -2556,7 +2556,7 @@ const re = Q.bind(io), B = "purpur-drawer-frame", cr = w(
|
|
|
2556
2556
|
stickyFooter: p,
|
|
2557
2557
|
...b
|
|
2558
2558
|
}, g) => {
|
|
2559
|
-
const
|
|
2559
|
+
const P = re([
|
|
2560
2560
|
n,
|
|
2561
2561
|
B,
|
|
2562
2562
|
{
|
|
@@ -2566,7 +2566,7 @@ const re = Q.bind(io), B = "purpur-drawer-frame", cr = w(
|
|
|
2566
2566
|
return /* @__PURE__ */ Y(
|
|
2567
2567
|
"div",
|
|
2568
2568
|
{
|
|
2569
|
-
className:
|
|
2569
|
+
className: P,
|
|
2570
2570
|
"data-testid": e,
|
|
2571
2571
|
ref: g,
|
|
2572
2572
|
onAnimationEnd: l,
|
|
@@ -2690,24 +2690,27 @@ const da = (e, r) => ({
|
|
|
2690
2690
|
onBackButtonClick: u,
|
|
2691
2691
|
stickyFooter: d = !1,
|
|
2692
2692
|
title: f,
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2693
|
+
zIndex: v,
|
|
2694
|
+
...m
|
|
2695
|
+
}, p) => {
|
|
2696
|
+
const b = ue([i, $e]), g = A(null), P = Te(Ut), { onAnimationEnd: S, onSwipeStart: E, onSwipeMove: T, onSwipeCancel: I, onSwipeEnd: O } = da(g, P), x = (C) => {
|
|
2697
|
+
l && C.preventDefault();
|
|
2697
2698
|
};
|
|
2698
2699
|
return /* @__PURE__ */ _(Bn, { children: /* @__PURE__ */ _(
|
|
2699
2700
|
Vn,
|
|
2700
2701
|
{
|
|
2701
2702
|
className: ue("purpur-drawer-overlay"),
|
|
2703
|
+
style: { zIndex: typeof v == "number" ? v : "auto" },
|
|
2702
2704
|
"data-testid": `${e}-overlay`,
|
|
2703
2705
|
children: /* @__PURE__ */ _(
|
|
2704
2706
|
qn,
|
|
2705
2707
|
{
|
|
2706
|
-
onPointerDownOutside:
|
|
2707
|
-
className:
|
|
2708
|
+
onPointerDownOutside: x,
|
|
2709
|
+
className: b,
|
|
2708
2710
|
"data-testid": e,
|
|
2709
|
-
ref:
|
|
2710
|
-
|
|
2711
|
+
ref: p,
|
|
2712
|
+
style: { zIndex: typeof v == "number" ? v + 1 : "auto" },
|
|
2713
|
+
...m,
|
|
2711
2714
|
children: /* @__PURE__ */ _(
|
|
2712
2715
|
cr,
|
|
2713
2716
|
{
|
|
@@ -2717,13 +2720,13 @@ const da = (e, r) => ({
|
|
|
2717
2720
|
closeButtonText: c,
|
|
2718
2721
|
className: ue(`${$e}__drawer-frame`),
|
|
2719
2722
|
footerContent: s,
|
|
2720
|
-
ref:
|
|
2721
|
-
onAnimationEnd:
|
|
2723
|
+
ref: g,
|
|
2724
|
+
onAnimationEnd: S,
|
|
2722
2725
|
onBackButtonClick: u,
|
|
2723
|
-
onSwipeStart:
|
|
2724
|
-
onSwipeMove:
|
|
2725
|
-
onSwipeCancel:
|
|
2726
|
-
onSwipeEnd:
|
|
2726
|
+
onSwipeStart: E,
|
|
2727
|
+
onSwipeMove: T,
|
|
2728
|
+
onSwipeCancel: I,
|
|
2729
|
+
onSwipeEnd: O,
|
|
2727
2730
|
stickyFooter: d,
|
|
2728
2731
|
title: f,
|
|
2729
2732
|
children: a ? /* @__PURE__ */ Y("div", { className: ue(`${$e}__content-container`), children: [
|