@purpurds/drawer 5.20.1 → 5.21.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 +8 -8
- package/dist/drawer.cjs.js.map +1 -1
- package/dist/drawer.es.js +139 -137
- package/dist/drawer.es.js.map +1 -1
- package/package.json +13 -13
package/dist/drawer.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _, jsxs as Y, Fragment as lr } from "react/jsx-runtime";
|
|
2
2
|
import * as $ from "react";
|
|
3
|
-
import Ue, { useCallback as ae, createContext as de, useMemo as Se, createElement as h, useContext as Te, useLayoutEffect as ur, useRef as A, useEffect as D, useState as N, forwardRef as w, Children as Z, isValidElement as Ee, cloneElement as Qe, Fragment as Je, useReducer as
|
|
4
|
-
import dr, { flushSync as
|
|
3
|
+
import Ue, { useCallback as ae, createContext as de, useMemo as Se, createElement as h, useContext as Te, useLayoutEffect as ur, useRef as A, useEffect as D, useState as N, forwardRef as w, Children as Z, isValidElement as Ee, cloneElement as Qe, Fragment as Je, useReducer as yt } from "react";
|
|
4
|
+
import dr, { flushSync as St } from "react-dom";
|
|
5
5
|
function y() {
|
|
6
6
|
return y = Object.assign ? Object.assign.bind() : function(e) {
|
|
7
7
|
for (var r = 1; r < arguments.length; r++) {
|
|
@@ -19,15 +19,15 @@ function L(e, r, { checkForDefaultPrevented: t = !0 } = {}) {
|
|
|
19
19
|
function fr(e, r) {
|
|
20
20
|
typeof e == "function" ? e(r) : e != null && (e.current = r);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function Et(...e) {
|
|
23
23
|
return (r) => e.forEach(
|
|
24
24
|
(t) => fr(t, r)
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
27
|
function k(...e) {
|
|
28
|
-
return ae(
|
|
28
|
+
return ae(Et(...e), e);
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function xt(e, r = []) {
|
|
31
31
|
let t = [];
|
|
32
32
|
function o(n, i) {
|
|
33
33
|
const c = /* @__PURE__ */ de(i), l = t.length;
|
|
@@ -182,7 +182,7 @@ const He = /* @__PURE__ */ w((e, r) => {
|
|
|
182
182
|
const { children: t, ...o } = e;
|
|
183
183
|
return /* @__PURE__ */ Ee(t) ? /* @__PURE__ */ Qe(t, {
|
|
184
184
|
...$r(o, t.props),
|
|
185
|
-
ref: r ?
|
|
185
|
+
ref: r ? Et(r, t.ref) : t.ref
|
|
186
186
|
}) : Z.count(t) > 1 ? Z.only(null) : null;
|
|
187
187
|
});
|
|
188
188
|
He.displayName = "SlotClone";
|
|
@@ -243,7 +243,7 @@ const wr = [
|
|
|
243
243
|
};
|
|
244
244
|
}, {});
|
|
245
245
|
function yr(e, r) {
|
|
246
|
-
e &&
|
|
246
|
+
e && St(
|
|
247
247
|
() => e.dispatchEvent(r)
|
|
248
248
|
);
|
|
249
249
|
}
|
|
@@ -260,7 +260,7 @@ function Sr(e, r = globalThis == null ? void 0 : globalThis.document) {
|
|
|
260
260
|
]);
|
|
261
261
|
}
|
|
262
262
|
const Ye = "dismissableLayer.update", Er = "dismissableLayer.pointerDownOutside", xr = "dismissableLayer.focusOutside";
|
|
263
|
-
let
|
|
263
|
+
let at;
|
|
264
264
|
const Cr = /* @__PURE__ */ de({
|
|
265
265
|
layers: /* @__PURE__ */ new Set(),
|
|
266
266
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
@@ -291,8 +291,8 @@ const Cr = /* @__PURE__ */ de({
|
|
|
291
291
|
S === u.layers.size - 1 && (a == null || a(x), !x.defaultPrevented && l && (x.preventDefault(), l()));
|
|
292
292
|
}, v), D(() => {
|
|
293
293
|
if (d)
|
|
294
|
-
return o && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (
|
|
295
|
-
o && u.layersWithOutsidePointerEventsDisabled.size === 1 && (v.body.style.pointerEvents =
|
|
294
|
+
return o && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (at = v.body.style.pointerEvents, v.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(d)), u.layers.add(d), ct(), () => {
|
|
295
|
+
o && u.layersWithOutsidePointerEventsDisabled.size === 1 && (v.body.style.pointerEvents = at);
|
|
296
296
|
};
|
|
297
297
|
}, [
|
|
298
298
|
d,
|
|
@@ -300,7 +300,7 @@ const Cr = /* @__PURE__ */ de({
|
|
|
300
300
|
o,
|
|
301
301
|
u
|
|
302
302
|
]), D(() => () => {
|
|
303
|
-
d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d),
|
|
303
|
+
d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d), ct());
|
|
304
304
|
}, [
|
|
305
305
|
d,
|
|
306
306
|
u
|
|
@@ -325,7 +325,7 @@ function Tr(e, r = globalThis == null ? void 0 : globalThis.document) {
|
|
|
325
325
|
const n = (c) => {
|
|
326
326
|
if (c.target && !o.current) {
|
|
327
327
|
let s = function() {
|
|
328
|
-
|
|
328
|
+
Ct(Er, t, l, {
|
|
329
329
|
discrete: !0
|
|
330
330
|
});
|
|
331
331
|
};
|
|
@@ -356,7 +356,7 @@ function Ar(e, r = globalThis == null ? void 0 : globalThis.document) {
|
|
|
356
356
|
const t = M(e), o = A(!1);
|
|
357
357
|
return D(() => {
|
|
358
358
|
const a = (n) => {
|
|
359
|
-
n.target && !o.current &&
|
|
359
|
+
n.target && !o.current && Ct(xr, t, {
|
|
360
360
|
originalEvent: n
|
|
361
361
|
}, {
|
|
362
362
|
discrete: !1
|
|
@@ -371,11 +371,11 @@ function Ar(e, r = globalThis == null ? void 0 : globalThis.document) {
|
|
|
371
371
|
onBlurCapture: () => o.current = !1
|
|
372
372
|
};
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function ct() {
|
|
375
375
|
const e = new CustomEvent(Ye);
|
|
376
376
|
document.dispatchEvent(e);
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function Ct(e, r, t, { discrete: o }) {
|
|
379
379
|
const a = t.originalEvent.target, n = new CustomEvent(e, {
|
|
380
380
|
bubbles: !1,
|
|
381
381
|
cancelable: !0,
|
|
@@ -385,7 +385,7 @@ function xt(e, r, t, { discrete: o }) {
|
|
|
385
385
|
once: !0
|
|
386
386
|
}), o ? yr(a, n) : a.dispatchEvent(n);
|
|
387
387
|
}
|
|
388
|
-
const Le = "focusScope.autoFocusOnMount", Re = "focusScope.autoFocusOnUnmount",
|
|
388
|
+
const Le = "focusScope.autoFocusOnMount", Re = "focusScope.autoFocusOnUnmount", it = {
|
|
389
389
|
bubbles: !1,
|
|
390
390
|
cancelable: !0
|
|
391
391
|
}, Dr = /* @__PURE__ */ w((e, r) => {
|
|
@@ -434,20 +434,20 @@ const Le = "focusScope.autoFocusOnMount", Re = "focusScope.autoFocusOnUnmount",
|
|
|
434
434
|
v.paused
|
|
435
435
|
]), D(() => {
|
|
436
436
|
if (c) {
|
|
437
|
-
|
|
437
|
+
lt.add(v);
|
|
438
438
|
const p = document.activeElement;
|
|
439
439
|
if (!c.contains(p)) {
|
|
440
|
-
const g = new CustomEvent(Le,
|
|
441
|
-
c.addEventListener(Le, s), c.dispatchEvent(g), g.defaultPrevented || (Nr(Ir(
|
|
440
|
+
const g = new CustomEvent(Le, it);
|
|
441
|
+
c.addEventListener(Le, s), c.dispatchEvent(g), g.defaultPrevented || (Nr(Ir(Pt(c)), {
|
|
442
442
|
select: !0
|
|
443
443
|
}), document.activeElement === p && V(c));
|
|
444
444
|
}
|
|
445
445
|
return () => {
|
|
446
446
|
c.removeEventListener(Le, s), setTimeout(() => {
|
|
447
|
-
const g = new CustomEvent(Re,
|
|
447
|
+
const g = new CustomEvent(Re, it);
|
|
448
448
|
c.addEventListener(Re, u), c.dispatchEvent(g), g.defaultPrevented || V(p ?? document.body, {
|
|
449
449
|
select: !0
|
|
450
|
-
}), c.removeEventListener(Re, u),
|
|
450
|
+
}), c.removeEventListener(Re, u), lt.remove(v);
|
|
451
451
|
}, 0);
|
|
452
452
|
};
|
|
453
453
|
}
|
|
@@ -488,13 +488,13 @@ function Nr(e, { select: r = !1 } = {}) {
|
|
|
488
488
|
}), document.activeElement !== t) return;
|
|
489
489
|
}
|
|
490
490
|
function Or(e) {
|
|
491
|
-
const r =
|
|
491
|
+
const r = Pt(e), t = st(r, e), o = st(r.reverse(), e);
|
|
492
492
|
return [
|
|
493
493
|
t,
|
|
494
494
|
o
|
|
495
495
|
];
|
|
496
496
|
}
|
|
497
|
-
function
|
|
497
|
+
function Pt(e) {
|
|
498
498
|
const r = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
499
499
|
acceptNode: (o) => {
|
|
500
500
|
const a = o.tagName === "INPUT" && o.type === "hidden";
|
|
@@ -504,7 +504,7 @@ function Ct(e) {
|
|
|
504
504
|
for (; t.nextNode(); ) r.push(t.currentNode);
|
|
505
505
|
return r;
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function st(e, r) {
|
|
508
508
|
for (const t of e)
|
|
509
509
|
if (!Lr(t, {
|
|
510
510
|
upTo: r
|
|
@@ -530,21 +530,21 @@ function V(e, { select: r = !1 } = {}) {
|
|
|
530
530
|
}), e !== t && Rr(e) && r && e.select();
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
|
-
const
|
|
533
|
+
const lt = Mr();
|
|
534
534
|
function Mr() {
|
|
535
535
|
let e = [];
|
|
536
536
|
return {
|
|
537
537
|
add(r) {
|
|
538
538
|
const t = e[0];
|
|
539
|
-
r !== t && (t == null || t.pause()), e =
|
|
539
|
+
r !== t && (t == null || t.pause()), e = ut(e, r), e.unshift(r);
|
|
540
540
|
},
|
|
541
541
|
remove(r) {
|
|
542
542
|
var t;
|
|
543
|
-
e =
|
|
543
|
+
e = ut(e, r), (t = e[0]) === null || t === void 0 || t.resume();
|
|
544
544
|
}
|
|
545
545
|
};
|
|
546
546
|
}
|
|
547
|
-
function
|
|
547
|
+
function ut(e, r) {
|
|
548
548
|
const t = [
|
|
549
549
|
...e
|
|
550
550
|
], o = t.indexOf(r);
|
|
@@ -563,7 +563,7 @@ const kr = /* @__PURE__ */ w((e, r) => {
|
|
|
563
563
|
})), o) : null;
|
|
564
564
|
});
|
|
565
565
|
function Fr(e, r) {
|
|
566
|
-
return
|
|
566
|
+
return yt((t, o) => {
|
|
567
567
|
const a = r[t][o];
|
|
568
568
|
return a ?? t;
|
|
569
569
|
}, e);
|
|
@@ -609,7 +609,7 @@ function jr(e) {
|
|
|
609
609
|
if (r) {
|
|
610
610
|
const s = (d) => {
|
|
611
611
|
const v = pe(o.current).includes(d.animationName);
|
|
612
|
-
d.target === r && v &&
|
|
612
|
+
d.target === r && v && St(
|
|
613
613
|
() => l("ANIMATION_END")
|
|
614
614
|
);
|
|
615
615
|
}, u = (d) => {
|
|
@@ -641,14 +641,14 @@ function Wr() {
|
|
|
641
641
|
D(() => {
|
|
642
642
|
var e, r;
|
|
643
643
|
const t = document.querySelectorAll("[data-radix-focus-guard]");
|
|
644
|
-
return document.body.insertAdjacentElement("afterbegin", (e = t[0]) !== null && e !== void 0 ? e :
|
|
644
|
+
return document.body.insertAdjacentElement("afterbegin", (e = t[0]) !== null && e !== void 0 ? e : dt()), document.body.insertAdjacentElement("beforeend", (r = t[1]) !== null && r !== void 0 ? r : dt()), Me++, () => {
|
|
645
645
|
Me === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach(
|
|
646
646
|
(o) => o.remove()
|
|
647
647
|
), Me--;
|
|
648
648
|
};
|
|
649
649
|
}, []);
|
|
650
650
|
}
|
|
651
|
-
function
|
|
651
|
+
function dt() {
|
|
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
|
}
|
|
@@ -661,7 +661,7 @@ var z = function() {
|
|
|
661
661
|
return r;
|
|
662
662
|
}, z.apply(this, arguments);
|
|
663
663
|
};
|
|
664
|
-
function
|
|
664
|
+
function Tt(e, r) {
|
|
665
665
|
var t = {};
|
|
666
666
|
for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && r.indexOf(o) < 0 && (t[o] = e[o]);
|
|
667
667
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -699,7 +699,7 @@ function Yr(e, r) {
|
|
|
699
699
|
})[0];
|
|
700
700
|
return t.callback = r, t.facade;
|
|
701
701
|
}
|
|
702
|
-
var Xr = typeof window < "u" ? $.useLayoutEffect : $.useEffect,
|
|
702
|
+
var Xr = typeof window < "u" ? $.useLayoutEffect : $.useEffect, ft = /* @__PURE__ */ new WeakMap();
|
|
703
703
|
function Br(e, r) {
|
|
704
704
|
var t = Yr(null, function(o) {
|
|
705
705
|
return e.forEach(function(a) {
|
|
@@ -707,7 +707,7 @@ function Br(e, r) {
|
|
|
707
707
|
});
|
|
708
708
|
});
|
|
709
709
|
return Xr(function() {
|
|
710
|
-
var o =
|
|
710
|
+
var o = ft.get(t);
|
|
711
711
|
if (o) {
|
|
712
712
|
var a = new Set(o), n = new Set(e), i = t.current;
|
|
713
713
|
a.forEach(function(c) {
|
|
@@ -716,7 +716,7 @@ function Br(e, r) {
|
|
|
716
716
|
a.has(c) || Ie(c, i);
|
|
717
717
|
});
|
|
718
718
|
}
|
|
719
|
-
|
|
719
|
+
ft.set(t, e);
|
|
720
720
|
}, [e]), t;
|
|
721
721
|
}
|
|
722
722
|
function Vr(e) {
|
|
@@ -782,8 +782,8 @@ function Kr(e) {
|
|
|
782
782
|
var r = qr(null);
|
|
783
783
|
return r.options = z({ async: !0, ssr: !1 }, e), r;
|
|
784
784
|
}
|
|
785
|
-
var
|
|
786
|
-
var r = e.sideCar, t =
|
|
785
|
+
var At = function(e) {
|
|
786
|
+
var r = e.sideCar, t = Tt(e, ["sideCar"]);
|
|
787
787
|
if (!r)
|
|
788
788
|
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
789
789
|
var o = r.read();
|
|
@@ -791,21 +791,21 @@ var Tt = function(e) {
|
|
|
791
791
|
throw new Error("Sidecar medium not found");
|
|
792
792
|
return $.createElement(o, z({}, t));
|
|
793
793
|
};
|
|
794
|
-
|
|
794
|
+
At.isSideCarExport = !0;
|
|
795
795
|
function Gr(e, r) {
|
|
796
|
-
return e.useMedium(r),
|
|
796
|
+
return e.useMedium(r), At;
|
|
797
797
|
}
|
|
798
|
-
var
|
|
798
|
+
var Dt = Kr(), ke = function() {
|
|
799
799
|
}, Ae = $.forwardRef(function(e, r) {
|
|
800
800
|
var t = $.useRef(null), o = $.useState({
|
|
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, P =
|
|
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 = Tt(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
|
-
u && $.createElement(S, { sideCar:
|
|
808
|
+
u && $.createElement(S, { sideCar: Dt, removeScrollBar: s, shards: d, noIsolation: v, inert: m, setCallbacks: n, allowPinchZoom: !!p, lockRef: t }),
|
|
809
809
|
i ? $.cloneElement($.Children.only(c), z(z({}, T), { ref: E })) : $.createElement(g, z({}, T, { className: l, ref: E }), c)
|
|
810
810
|
);
|
|
811
811
|
});
|
|
@@ -856,7 +856,7 @@ var tn = function() {
|
|
|
856
856
|
};
|
|
857
857
|
}, [r && t]);
|
|
858
858
|
};
|
|
859
|
-
},
|
|
859
|
+
}, Nt = function() {
|
|
860
860
|
var e = rn(), r = function(t) {
|
|
861
861
|
var o = t.styles, a = t.dynamic;
|
|
862
862
|
return e(o, a), null;
|
|
@@ -882,7 +882,7 @@ var tn = function() {
|
|
|
882
882
|
right: r[2],
|
|
883
883
|
gap: Math.max(0, o - t + r[2] - r[0])
|
|
884
884
|
};
|
|
885
|
-
}, cn =
|
|
885
|
+
}, cn = Nt(), oe = "data-scroll-locked", sn = function(e, r, t, o) {
|
|
886
886
|
var a = e.left, n = e.top, i = e.right, c = e.gap;
|
|
887
887
|
return t === void 0 && (t = "margin"), `
|
|
888
888
|
.`.concat(Ur, ` {
|
|
@@ -926,13 +926,13 @@ var tn = function() {
|
|
|
926
926
|
`).concat(Hr, ": ").concat(c, `px;
|
|
927
927
|
}
|
|
928
928
|
`);
|
|
929
|
-
},
|
|
929
|
+
}, pt = 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, (pt() + 1).toString()), function() {
|
|
935
|
+
var e = pt() - 1;
|
|
936
936
|
e <= 0 ? document.body.removeAttribute(oe) : document.body.setAttribute(oe, e.toString());
|
|
937
937
|
};
|
|
938
938
|
}, []);
|
|
@@ -957,7 +957,7 @@ if (typeof window < "u")
|
|
|
957
957
|
}
|
|
958
958
|
var J = Xe ? { passive: !1 } : !1, dn = function(e) {
|
|
959
959
|
return e.tagName === "TEXTAREA";
|
|
960
|
-
},
|
|
960
|
+
}, Ot = function(e, r) {
|
|
961
961
|
var t = window.getComputedStyle(e);
|
|
962
962
|
return (
|
|
963
963
|
// not-not-scrollable
|
|
@@ -965,16 +965,16 @@ var J = Xe ? { passive: !1 } : !1, dn = function(e) {
|
|
|
965
965
|
!(t.overflowY === t.overflowX && !dn(e) && t[r] === "visible")
|
|
966
966
|
);
|
|
967
967
|
}, fn = function(e) {
|
|
968
|
-
return
|
|
968
|
+
return Ot(e, "overflowY");
|
|
969
969
|
}, pn = function(e) {
|
|
970
|
-
return
|
|
971
|
-
},
|
|
970
|
+
return Ot(e, "overflowX");
|
|
971
|
+
}, vt = function(e, r) {
|
|
972
972
|
var t = r;
|
|
973
973
|
do {
|
|
974
974
|
typeof ShadowRoot < "u" && t instanceof ShadowRoot && (t = t.host);
|
|
975
|
-
var o =
|
|
975
|
+
var o = Lt(e, t);
|
|
976
976
|
if (o) {
|
|
977
|
-
var a =
|
|
977
|
+
var a = Rt(e, t), n = a[1], i = a[2];
|
|
978
978
|
if (n > i)
|
|
979
979
|
return !0;
|
|
980
980
|
}
|
|
@@ -995,17 +995,17 @@ var J = Xe ? { passive: !1 } : !1, dn = function(e) {
|
|
|
995
995
|
t,
|
|
996
996
|
o
|
|
997
997
|
];
|
|
998
|
-
}, Ot = function(e, r) {
|
|
999
|
-
return e === "v" ? fn(r) : pn(r);
|
|
1000
998
|
}, Lt = function(e, r) {
|
|
999
|
+
return e === "v" ? fn(r) : pn(r);
|
|
1000
|
+
}, Rt = 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
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 =
|
|
1008
|
-
(m || g) &&
|
|
1007
|
+
var v = Rt(e, c), m = v[0], p = v[1], b = v[2], g = p - b - n * m;
|
|
1008
|
+
(m || g) && Lt(e, c) && (d += g, f += m), c = c.parentNode;
|
|
1009
1009
|
} while (
|
|
1010
1010
|
// portaled content
|
|
1011
1011
|
!l && c !== document.body || // self content
|
|
@@ -1014,9 +1014,9 @@ var J = Xe ? { passive: !1 } : !1, dn = function(e) {
|
|
|
1014
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
|
-
}, vt = function(e) {
|
|
1018
|
-
return [e.deltaX, e.deltaY];
|
|
1019
1017
|
}, ht = function(e) {
|
|
1018
|
+
return [e.deltaX, e.deltaY];
|
|
1019
|
+
}, bt = function(e) {
|
|
1020
1020
|
return e && "current" in e ? e.current : e;
|
|
1021
1021
|
}, gn = function(e, r) {
|
|
1022
1022
|
return e[0] === r[0] && e[1] === r[1];
|
|
@@ -1028,14 +1028,14 @@ var J = Xe ? { passive: !1 } : !1, dn = function(e) {
|
|
|
1028
1028
|
}, $n = 0, ee = [];
|
|
1029
1029
|
function wn(e) {
|
|
1030
1030
|
var r = $.useRef([]), t = $.useRef([0, 0]), o = $.useRef(), a = $.useState($n++)[0], n = $.useState(function() {
|
|
1031
|
-
return
|
|
1031
|
+
return Nt();
|
|
1032
1032
|
})[0], i = $.useRef(e);
|
|
1033
1033
|
$.useEffect(function() {
|
|
1034
1034
|
i.current = e;
|
|
1035
1035
|
}, [e]), $.useEffect(function() {
|
|
1036
1036
|
if (e.inert) {
|
|
1037
1037
|
document.body.classList.add("block-interactivity-".concat(a));
|
|
1038
|
-
var p = zr([e.lockRef.current], (e.shards || []).map(
|
|
1038
|
+
var p = zr([e.lockRef.current], (e.shards || []).map(bt), !0).filter(Boolean);
|
|
1039
1039
|
return p.forEach(function(b) {
|
|
1040
1040
|
return b.classList.add("allow-interactivity-".concat(a));
|
|
1041
1041
|
}), function() {
|
|
@@ -1051,10 +1051,10 @@ function wn(e) {
|
|
|
1051
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
|
-
var x =
|
|
1054
|
+
var x = vt(O, I);
|
|
1055
1055
|
if (!x)
|
|
1056
1056
|
return !0;
|
|
1057
|
-
if (x ? T = O : (T = O === "v" ? "h" : "v", x =
|
|
1057
|
+
if (x ? T = O : (T = O === "v" ? "h" : "v", x = vt(O, I)), !x)
|
|
1058
1058
|
return !1;
|
|
1059
1059
|
if (!o.current && "changedTouches" in p && (S || E) && (o.current = T), !T)
|
|
1060
1060
|
return !0;
|
|
@@ -1063,7 +1063,7 @@ function wn(e) {
|
|
|
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 ?
|
|
1066
|
+
var g = "deltaY" in b ? ht(b) : he(b), P = r.current.filter(function(T) {
|
|
1067
1067
|
return T.name === b.type && T.target === b.target && gn(T.delta, g);
|
|
1068
1068
|
})[0];
|
|
1069
1069
|
if (P && P.should) {
|
|
@@ -1071,7 +1071,7 @@ function wn(e) {
|
|
|
1071
1071
|
return;
|
|
1072
1072
|
}
|
|
1073
1073
|
if (!P) {
|
|
1074
|
-
var S = (i.current.shards || []).map(
|
|
1074
|
+
var S = (i.current.shards || []).map(bt).filter(Boolean).filter(function(T) {
|
|
1075
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();
|
|
@@ -1087,7 +1087,7 @@ function wn(e) {
|
|
|
1087
1087
|
}, []), u = $.useCallback(function(p) {
|
|
1088
1088
|
t.current = he(p), o.current = void 0;
|
|
1089
1089
|
}, []), d = $.useCallback(function(p) {
|
|
1090
|
-
s(p.type,
|
|
1090
|
+
s(p.type, ht(p), p.target, c(p, e.lockRef.current));
|
|
1091
1091
|
}, []), f = $.useCallback(function(p) {
|
|
1092
1092
|
s(p.type, he(p), p.target, c(p, e.lockRef.current));
|
|
1093
1093
|
}, []);
|
|
@@ -1110,23 +1110,23 @@ function wn(e) {
|
|
|
1110
1110
|
v ? $.createElement(un, { gapMode: "margin" }) : null
|
|
1111
1111
|
);
|
|
1112
1112
|
}
|
|
1113
|
-
const yn = Gr(
|
|
1114
|
-
var
|
|
1113
|
+
const yn = Gr(Dt, wn);
|
|
1114
|
+
var Mt = $.forwardRef(function(e, r) {
|
|
1115
1115
|
return $.createElement(Ae, z({}, e, { ref: r, sideCar: yn }));
|
|
1116
1116
|
});
|
|
1117
|
-
|
|
1117
|
+
Mt.classNames = Ae.classNames;
|
|
1118
1118
|
var Sn = function(e) {
|
|
1119
1119
|
if (typeof document > "u")
|
|
1120
1120
|
return null;
|
|
1121
1121
|
var r = Array.isArray(e) ? e[0] : e;
|
|
1122
1122
|
return r.ownerDocument.body;
|
|
1123
|
-
}, te = /* @__PURE__ */ new WeakMap(), be = /* @__PURE__ */ new WeakMap(), me = {}, je = 0,
|
|
1124
|
-
return e && (e.host ||
|
|
1123
|
+
}, te = /* @__PURE__ */ new WeakMap(), be = /* @__PURE__ */ new WeakMap(), me = {}, je = 0, It = function(e) {
|
|
1124
|
+
return e && (e.host || It(e.parentNode));
|
|
1125
1125
|
}, En = function(e, r) {
|
|
1126
1126
|
return r.map(function(t) {
|
|
1127
1127
|
if (e.contains(t))
|
|
1128
1128
|
return t;
|
|
1129
|
-
var o =
|
|
1129
|
+
var o = It(t);
|
|
1130
1130
|
return o && e.contains(o) ? o : (console.error("aria-hidden", t, "in not contained inside", e, ". Doing nothing"), null);
|
|
1131
1131
|
}).filter(function(t) {
|
|
1132
1132
|
return !!t;
|
|
@@ -1164,7 +1164,7 @@ var Sn = function(e) {
|
|
|
1164
1164
|
return null;
|
|
1165
1165
|
};
|
|
1166
1166
|
};
|
|
1167
|
-
const
|
|
1167
|
+
const kt = "Dialog", [Ft, ga] = xt(kt), [Pn, j] = Ft(kt), Tn = (e) => {
|
|
1168
1168
|
const { __scopeDialog: r, children: t, open: o, defaultOpen: a, onOpenChange: n, modal: i = !0 } = e, c = A(null), l = A(null), [s = !1, u] = br({
|
|
1169
1169
|
prop: o,
|
|
1170
1170
|
defaultProp: a,
|
|
@@ -1201,10 +1201,10 @@ const It = "Dialog", [kt, ga] = Et(It), [Pn, j] = kt(It), Tn = (e) => {
|
|
|
1201
1201
|
ref: n,
|
|
1202
1202
|
onClick: L(e.onClick, a.onOpenToggle)
|
|
1203
1203
|
}));
|
|
1204
|
-
}),
|
|
1204
|
+
}), jt = "DialogPortal", [Nn, Wt] = Ft(jt, {
|
|
1205
1205
|
forceMount: void 0
|
|
1206
1206
|
}), On = (e) => {
|
|
1207
|
-
const { __scopeDialog: r, forceMount: t, children: o, container: a } = e, n = j(
|
|
1207
|
+
const { __scopeDialog: r, forceMount: t, children: o, container: a } = e, n = j(jt, r);
|
|
1208
1208
|
return /* @__PURE__ */ h(Nn, {
|
|
1209
1209
|
scope: r,
|
|
1210
1210
|
forceMount: t
|
|
@@ -1218,7 +1218,7 @@ const It = "Dialog", [kt, ga] = Et(It), [Pn, j] = kt(It), Tn = (e) => {
|
|
|
1218
1218
|
}, i))
|
|
1219
1219
|
));
|
|
1220
1220
|
}, Be = "DialogOverlay", Ln = /* @__PURE__ */ w((e, r) => {
|
|
1221
|
-
const t =
|
|
1221
|
+
const t = Wt(Be, e.__scopeDialog), { forceMount: o = t.forceMount, ...a } = e, n = j(Be, e.__scopeDialog);
|
|
1222
1222
|
return n.modal ? /* @__PURE__ */ h(q, {
|
|
1223
1223
|
present: o || n.open
|
|
1224
1224
|
}, /* @__PURE__ */ h(Rn, y({}, a, {
|
|
@@ -1229,7 +1229,7 @@ const It = "Dialog", [kt, ga] = Et(It), [Pn, j] = kt(It), Tn = (e) => {
|
|
|
1229
1229
|
return (
|
|
1230
1230
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
1231
1231
|
// ie. when `Overlay` and `Content` are siblings
|
|
1232
|
-
/* @__PURE__ */ h(
|
|
1232
|
+
/* @__PURE__ */ h(Mt, {
|
|
1233
1233
|
as: et,
|
|
1234
1234
|
allowPinchZoom: !0,
|
|
1235
1235
|
shards: [
|
|
@@ -1246,7 +1246,7 @@ const It = "Dialog", [kt, ga] = Et(It), [Pn, j] = kt(It), Tn = (e) => {
|
|
|
1246
1246
|
})))
|
|
1247
1247
|
);
|
|
1248
1248
|
}), fe = "DialogContent", Mn = /* @__PURE__ */ w((e, r) => {
|
|
1249
|
-
const t =
|
|
1249
|
+
const t = Wt(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, {
|
|
@@ -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(zt, 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(zt, y({}, e, {
|
|
1282
1282
|
ref: r,
|
|
1283
1283
|
trapFocus: !1,
|
|
1284
1284
|
disableOutsidePointerEvents: !1,
|
|
@@ -1297,7 +1297,7 @@ 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
|
+
}), zt = /* @__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
1302
|
return Wr(), /* @__PURE__ */ h(Je, null, /* @__PURE__ */ h(Dr, {
|
|
1303
1303
|
asChild: !0,
|
|
@@ -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,
|
|
1347
|
+
const Yn = Tn, Xn = Dn, Bn = On, Vn = Ln, qn = Mn, mt = 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 Ut = { exports: {} };
|
|
1352
1352
|
/*!
|
|
1353
1353
|
Copyright (c) 2018 Jed Watson.
|
|
1354
1354
|
Licensed under the MIT License (MIT), see
|
|
@@ -1383,9 +1383,9 @@ var zt = { exports: {} };
|
|
|
1383
1383
|
}
|
|
1384
1384
|
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
1385
1385
|
})();
|
|
1386
|
-
})(
|
|
1387
|
-
var Qn =
|
|
1388
|
-
const Q = /* @__PURE__ */ Zn(Qn),
|
|
1386
|
+
})(Ut);
|
|
1387
|
+
var Qn = Ut.exports;
|
|
1388
|
+
const Q = /* @__PURE__ */ Zn(Qn), Ht = 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,
|
|
1391
1391
|
drawerLargeScreenAnimation: to,
|
|
@@ -1441,18 +1441,18 @@ const io = {
|
|
|
1441
1441
|
if (!e.current)
|
|
1442
1442
|
return;
|
|
1443
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)) :
|
|
1444
|
+
d ? (r.current = m, o(p)) : gt(m, 0) ? (r.current = m, t(), s.target.setPointerCapture(s.pointerId)) : Math.abs(u) > v && (e.current = null);
|
|
1445
1445
|
},
|
|
1446
1446
|
onPointerUp: (s) => {
|
|
1447
1447
|
const u = r.current, d = s.target;
|
|
1448
1448
|
if (d.hasPointerCapture(s.pointerId) && d.releasePointerCapture(s.pointerId), r.current = null, e.current = null, u) {
|
|
1449
1449
|
const f = s.currentTarget, v = { originalEvent: s, delta: u };
|
|
1450
|
-
|
|
1450
|
+
gt(u, 0) && u.y > 200 ? n(v) : a(), f.addEventListener("click", (m) => m.preventDefault(), {
|
|
1451
1451
|
once: !0
|
|
1452
1452
|
});
|
|
1453
1453
|
}
|
|
1454
1454
|
}
|
|
1455
|
-
}),
|
|
1455
|
+
}), gt = (e, r = 0) => Math.abs(e.y) > r, uo = Q.bind(so), fo = "purpur-drawer-handle", Yt = w(
|
|
1456
1456
|
({
|
|
1457
1457
|
["data-testid"]: e = "purpur-drawer-handle",
|
|
1458
1458
|
className: r,
|
|
@@ -1484,7 +1484,7 @@ const io = {
|
|
|
1484
1484
|
);
|
|
1485
1485
|
}
|
|
1486
1486
|
);
|
|
1487
|
-
|
|
1487
|
+
Yt.displayName = "DrawerHandle";
|
|
1488
1488
|
const po = {
|
|
1489
1489
|
PRIMARY: "primary",
|
|
1490
1490
|
SECONDARY: "secondary",
|
|
@@ -1497,7 +1497,7 @@ const po = {
|
|
|
1497
1497
|
function ho(e) {
|
|
1498
1498
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1499
1499
|
}
|
|
1500
|
-
var
|
|
1500
|
+
var Xt = { exports: {} };
|
|
1501
1501
|
/*!
|
|
1502
1502
|
Copyright (c) 2018 Jed Watson.
|
|
1503
1503
|
Licensed under the MIT License (MIT), see
|
|
@@ -1532,9 +1532,9 @@ var Yt = { exports: {} };
|
|
|
1532
1532
|
}
|
|
1533
1533
|
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
1534
1534
|
})();
|
|
1535
|
-
})(
|
|
1536
|
-
var bo =
|
|
1537
|
-
const
|
|
1535
|
+
})(Xt);
|
|
1536
|
+
var bo = Xt.exports;
|
|
1537
|
+
const _t = /* @__PURE__ */ ho(bo), mo = "_rotate_1xozj_1", go = "_dash_1xozj_1", ce = {
|
|
1538
1538
|
"purpur-spinner": "_purpur-spinner_1xozj_1",
|
|
1539
1539
|
rotate: mo,
|
|
1540
1540
|
"purpur-spinner--xxs": "_purpur-spinner--xxs_1xozj_4",
|
|
@@ -1561,13 +1561,13 @@ const gt = /* @__PURE__ */ ho(bo), mo = "_rotate_1xozj_1", go = "_dash_1xozj_1",
|
|
|
1561
1561
|
}) => /* @__PURE__ */ _(
|
|
1562
1562
|
"div",
|
|
1563
1563
|
{
|
|
1564
|
-
className:
|
|
1564
|
+
className: _t([ce[ie], ce[`${ie}--${o}`]]),
|
|
1565
1565
|
"data-testid": e,
|
|
1566
1566
|
...a,
|
|
1567
1567
|
children: /* @__PURE__ */ _("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ _(
|
|
1568
1568
|
"circle",
|
|
1569
1569
|
{
|
|
1570
|
-
className:
|
|
1570
|
+
className: _t(ce[`${ie}__circle`], {
|
|
1571
1571
|
[ce[`${ie}__circle--disabled`]]: r,
|
|
1572
1572
|
[ce[`${ie}__circle--negative`]]: t
|
|
1573
1573
|
}),
|
|
@@ -1581,7 +1581,7 @@ const gt = /* @__PURE__ */ ho(bo), mo = "_rotate_1xozj_1", go = "_dash_1xozj_1",
|
|
|
1581
1581
|
function wo(e) {
|
|
1582
1582
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1583
1583
|
}
|
|
1584
|
-
var
|
|
1584
|
+
var Bt = { exports: {} };
|
|
1585
1585
|
/*!
|
|
1586
1586
|
Copyright (c) 2018 Jed Watson.
|
|
1587
1587
|
Licensed under the MIT License (MIT), see
|
|
@@ -1616,8 +1616,8 @@ var Xt = { exports: {} };
|
|
|
1616
1616
|
}
|
|
1617
1617
|
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
1618
1618
|
})();
|
|
1619
|
-
})(
|
|
1620
|
-
var yo =
|
|
1619
|
+
})(Bt);
|
|
1620
|
+
var yo = Bt.exports;
|
|
1621
1621
|
const So = /* @__PURE__ */ wo(yo), Eo = {
|
|
1622
1622
|
"purpur-button": "_purpur-button_1acxn_1",
|
|
1623
1623
|
"purpur-button--sm": "_purpur-button--sm_1acxn_33",
|
|
@@ -1699,7 +1699,7 @@ Ve.displayName = "Button";
|
|
|
1699
1699
|
function Po(e) {
|
|
1700
1700
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1701
1701
|
}
|
|
1702
|
-
var
|
|
1702
|
+
var Vt = { exports: {} };
|
|
1703
1703
|
/*!
|
|
1704
1704
|
Copyright (c) 2018 Jed Watson.
|
|
1705
1705
|
Licensed under the MIT License (MIT), see
|
|
@@ -1734,8 +1734,8 @@ var Bt = { exports: {} };
|
|
|
1734
1734
|
}
|
|
1735
1735
|
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
1736
1736
|
})();
|
|
1737
|
-
})(
|
|
1738
|
-
var To =
|
|
1737
|
+
})(Vt);
|
|
1738
|
+
var To = Vt.exports;
|
|
1739
1739
|
const Ao = /* @__PURE__ */ Po(To), ge = {
|
|
1740
1740
|
"purpur-heading": "_purpur-heading_k9fhq_1",
|
|
1741
1741
|
"purpur-heading--hyphens": "_purpur-heading--hyphens_k9fhq_8",
|
|
@@ -1786,7 +1786,7 @@ Ke.displayName = "Heading";
|
|
|
1786
1786
|
function Do(e) {
|
|
1787
1787
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1788
1788
|
}
|
|
1789
|
-
var
|
|
1789
|
+
var qt = { exports: {} };
|
|
1790
1790
|
/*!
|
|
1791
1791
|
Copyright (c) 2018 Jed Watson.
|
|
1792
1792
|
Licensed under the MIT License (MIT), see
|
|
@@ -1821,8 +1821,8 @@ var Vt = { exports: {} };
|
|
|
1821
1821
|
}
|
|
1822
1822
|
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
1823
1823
|
})();
|
|
1824
|
-
})(
|
|
1825
|
-
var No =
|
|
1824
|
+
})(qt);
|
|
1825
|
+
var No = qt.exports;
|
|
1826
1826
|
const Oo = /* @__PURE__ */ Do(No), Lo = {
|
|
1827
1827
|
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
1828
1828
|
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
@@ -1841,23 +1841,23 @@ const Oo = /* @__PURE__ */ Do(No), Lo = {
|
|
|
1841
1841
|
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.864 4.864a.9.9 0 0 1 1.273 0L12 10.727l5.864-5.863a.9.9 0 0 1 1.272 1.272L13.273 12l5.863 5.864a.9.9 0 1 1-1.272 1.272L12 13.273l-5.863 5.863a.9.9 0 0 1-1.273-1.272L10.727 12 4.864 6.136a.9.9 0 0 1 0-1.272Z" clip-rule="evenodd"/></svg>',
|
|
1842
1842
|
keywords: ["close"],
|
|
1843
1843
|
category: "utility"
|
|
1844
|
-
},
|
|
1845
|
-
|
|
1844
|
+
}, Kt = (e) => /* @__PURE__ */ _(
|
|
1845
|
+
rt,
|
|
1846
1846
|
{
|
|
1847
1847
|
...e,
|
|
1848
1848
|
svg: Ro
|
|
1849
1849
|
}
|
|
1850
1850
|
);
|
|
1851
|
-
|
|
1852
|
-
const
|
|
1853
|
-
|
|
1851
|
+
Kt.displayName = "IconArrowLeft";
|
|
1852
|
+
const Gt = (e) => /* @__PURE__ */ _(
|
|
1853
|
+
rt,
|
|
1854
1854
|
{
|
|
1855
1855
|
...e,
|
|
1856
1856
|
svg: Mo
|
|
1857
1857
|
}
|
|
1858
1858
|
);
|
|
1859
|
-
|
|
1860
|
-
const Io = Oo.bind(Lo),
|
|
1859
|
+
Gt.displayName = "IconClose";
|
|
1860
|
+
const Io = Oo.bind(Lo), $t = "purpur-icon", ko = "md", Fo = (e) => e.filter((r) => Object.keys(r).length >= 1).map((r) => `${r.name}="${r.value}"`).join(" "), jo = ({ content: e = "", title: r } = {}) => {
|
|
1861
1861
|
const t = [
|
|
1862
1862
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
1863
1863
|
{ name: "fill", value: "currentColor" },
|
|
@@ -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
|
-
}, Wo = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(),
|
|
1868
|
+
}, Wo = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), rt = ({
|
|
1869
1869
|
["data-testid"]: e,
|
|
1870
1870
|
svg: r,
|
|
1871
1871
|
allyTitle: t,
|
|
@@ -1876,7 +1876,7 @@ const Io = Oo.bind(Lo), _t = "purpur-icon", ko = "md", Fo = (e) => e.filter((r)
|
|
|
1876
1876
|
const i = jo({
|
|
1877
1877
|
content: Wo(r.svg),
|
|
1878
1878
|
title: t
|
|
1879
|
-
}), c = Io(o,
|
|
1879
|
+
}), c = Io(o, $t, `${$t}--${a}`);
|
|
1880
1880
|
return /* @__PURE__ */ _(
|
|
1881
1881
|
"span",
|
|
1882
1882
|
{
|
|
@@ -1887,7 +1887,9 @@ const Io = Oo.bind(Lo), _t = "purpur-icon", ko = "md", Fo = (e) => e.filter((r)
|
|
|
1887
1887
|
...n
|
|
1888
1888
|
}
|
|
1889
1889
|
);
|
|
1890
|
-
}
|
|
1890
|
+
};
|
|
1891
|
+
rt.displayName = "Icon";
|
|
1892
|
+
const zo = {
|
|
1891
1893
|
"purpur-drawer-header__row": "_purpur-drawer-header__row_1yg5w_1",
|
|
1892
1894
|
"purpur-drawer-header__row--with-back-button": "_purpur-drawer-header__row--with-back-button_1yg5w_6",
|
|
1893
1895
|
"purpur-drawer-header__left": "_purpur-drawer-header__left_1yg5w_9",
|
|
@@ -1935,11 +1937,11 @@ const Io = Oo.bind(Lo), _t = "purpur-icon", ko = "md", Fo = (e) => e.filter((r)
|
|
|
1935
1937
|
size: "sm",
|
|
1936
1938
|
variant: o ? ze.TERTIARY_PURPLE : ze.TEXT,
|
|
1937
1939
|
children: [
|
|
1938
|
-
/* @__PURE__ */ _(
|
|
1940
|
+
/* @__PURE__ */ _(Kt, { size: "sm" }),
|
|
1939
1941
|
!o && t
|
|
1940
1942
|
]
|
|
1941
1943
|
}
|
|
1942
|
-
) : /* @__PURE__ */ _(
|
|
1944
|
+
) : /* @__PURE__ */ _(mt, { asChild: !0, children: /* @__PURE__ */ _(
|
|
1943
1945
|
Ke,
|
|
1944
1946
|
{
|
|
1945
1947
|
"data-testid": `${e}-title`,
|
|
@@ -1956,13 +1958,13 @@ const Io = Oo.bind(Lo), _t = "purpur-icon", ko = "md", Fo = (e) => e.filter((r)
|
|
|
1956
1958
|
iconOnly: !0,
|
|
1957
1959
|
size: "sm",
|
|
1958
1960
|
variant: ze.TERTIARY_PURPLE,
|
|
1959
|
-
children: /* @__PURE__ */ _(
|
|
1961
|
+
children: /* @__PURE__ */ _(Gt, { size: "sm" })
|
|
1960
1962
|
}
|
|
1961
1963
|
) }) })
|
|
1962
1964
|
]
|
|
1963
1965
|
}
|
|
1964
1966
|
),
|
|
1965
|
-
r && t && i && /* @__PURE__ */ _(
|
|
1967
|
+
r && t && i && /* @__PURE__ */ _(mt, { asChild: !0, children: /* @__PURE__ */ _(
|
|
1966
1968
|
Ke,
|
|
1967
1969
|
{
|
|
1968
1970
|
className: G(`${H}__heading`),
|
|
@@ -1985,12 +1987,12 @@ function Yo(e, [r, t]) {
|
|
|
1985
1987
|
return Math.min(t, Math.max(r, e));
|
|
1986
1988
|
}
|
|
1987
1989
|
function Xo(e, r) {
|
|
1988
|
-
return
|
|
1990
|
+
return yt((t, o) => {
|
|
1989
1991
|
const a = r[t][o];
|
|
1990
1992
|
return a ?? t;
|
|
1991
1993
|
}, e);
|
|
1992
1994
|
}
|
|
1993
|
-
const Qt = "ScrollArea", [Jt, _a] =
|
|
1995
|
+
const Qt = "ScrollArea", [Jt, _a] = xt(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__ */ w((e, r) => {
|
|
1994
1996
|
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
1997
|
r,
|
|
1996
1998
|
(W) => l(W)
|
|
@@ -2077,7 +2079,7 @@ const Qt = "ScrollArea", [Jt, _a] = Et(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__
|
|
|
2077
2079
|
})) : a.type === "auto" ? /* @__PURE__ */ h(er, y({}, o, {
|
|
2078
2080
|
ref: r,
|
|
2079
2081
|
forceMount: t
|
|
2080
|
-
})) : a.type === "always" ? /* @__PURE__ */ h(
|
|
2082
|
+
})) : a.type === "always" ? /* @__PURE__ */ h(nt, y({}, o, {
|
|
2081
2083
|
ref: r
|
|
2082
2084
|
})) : null;
|
|
2083
2085
|
}), Zo = /* @__PURE__ */ w((e, r) => {
|
|
@@ -2159,7 +2161,7 @@ const Qt = "ScrollArea", [Jt, _a] = Et(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__
|
|
|
2159
2161
|
i
|
|
2160
2162
|
]), /* @__PURE__ */ h(q, {
|
|
2161
2163
|
present: t || c !== "hidden"
|
|
2162
|
-
}, /* @__PURE__ */ h(
|
|
2164
|
+
}, /* @__PURE__ */ h(nt, y({
|
|
2163
2165
|
"data-state": c === "hidden" ? "hidden" : "visible"
|
|
2164
2166
|
}, o, {
|
|
2165
2167
|
ref: r,
|
|
@@ -2181,12 +2183,12 @@ const Qt = "ScrollArea", [Jt, _a] = Et(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__
|
|
|
2181
2183
|
}, 10);
|
|
2182
2184
|
return Pe(t.viewport, l), Pe(t.content, l), /* @__PURE__ */ h(q, {
|
|
2183
2185
|
present: o || n
|
|
2184
|
-
}, /* @__PURE__ */ h(
|
|
2186
|
+
}, /* @__PURE__ */ h(nt, y({
|
|
2185
2187
|
"data-state": n ? "visible" : "hidden"
|
|
2186
2188
|
}, a, {
|
|
2187
2189
|
ref: r
|
|
2188
2190
|
})));
|
|
2189
|
-
}),
|
|
2191
|
+
}), nt = /* @__PURE__ */ w((e, r) => {
|
|
2190
2192
|
const { orientation: t = "vertical", ...o } = e, a = U(X, e.__scopeScrollArea), n = A(null), i = A(0), [c, l] = N({
|
|
2191
2193
|
content: 0,
|
|
2192
2194
|
viewport: 0,
|
|
@@ -2211,7 +2213,7 @@ const Qt = "ScrollArea", [Jt, _a] = Et(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__
|
|
|
2211
2213
|
ref: r,
|
|
2212
2214
|
onThumbPositionChange: () => {
|
|
2213
2215
|
if (a.viewport && n.current) {
|
|
2214
|
-
const f = a.viewport.scrollLeft, v =
|
|
2216
|
+
const f = a.viewport.scrollLeft, v = wt(f, c, a.dir);
|
|
2215
2217
|
n.current.style.transform = `translate3d(${v}px, 0, 0)`;
|
|
2216
2218
|
}
|
|
2217
2219
|
},
|
|
@@ -2225,7 +2227,7 @@ const Qt = "ScrollArea", [Jt, _a] = Et(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__
|
|
|
2225
2227
|
ref: r,
|
|
2226
2228
|
onThumbPositionChange: () => {
|
|
2227
2229
|
if (a.viewport && n.current) {
|
|
2228
|
-
const f = a.viewport.scrollTop, v =
|
|
2230
|
+
const f = a.viewport.scrollTop, v = wt(f, c);
|
|
2229
2231
|
n.current.style.transform = `translate3d(0, ${v}px, 0)`;
|
|
2230
2232
|
}
|
|
2231
2233
|
},
|
|
@@ -2440,7 +2442,7 @@ function oa(e, r, t, o = "ltr") {
|
|
|
2440
2442
|
s
|
|
2441
2443
|
], d)(e);
|
|
2442
2444
|
}
|
|
2443
|
-
function
|
|
2445
|
+
function wt(e, r, t = "ltr") {
|
|
2444
2446
|
const o = De(r), a = r.scrollbar.paddingStart + r.scrollbar.paddingEnd, n = r.scrollbar.size - a, i = r.content - r.viewport, c = n - o, l = t === "ltr" ? [
|
|
2445
2447
|
0,
|
|
2446
2448
|
i
|
|
@@ -2573,7 +2575,7 @@ const re = Q.bind(io), B = "purpur-drawer-frame", cr = w(
|
|
|
2573
2575
|
...b,
|
|
2574
2576
|
children: [
|
|
2575
2577
|
/* @__PURE__ */ _(
|
|
2576
|
-
|
|
2578
|
+
Yt,
|
|
2577
2579
|
{
|
|
2578
2580
|
onSwipeStart: u,
|
|
2579
2581
|
onSwipeMove: d,
|
|
@@ -2693,7 +2695,7 @@ const da = (e, r) => ({
|
|
|
2693
2695
|
zIndex: v,
|
|
2694
2696
|
...m
|
|
2695
2697
|
}, p) => {
|
|
2696
|
-
const b = ue([i, $e]), g = A(null), P = Te(
|
|
2698
|
+
const b = ue([i, $e]), g = A(null), P = Te(Ht), { onAnimationEnd: S, onSwipeStart: E, onSwipeMove: T, onSwipeCancel: I, onSwipeEnd: O } = da(g, P), x = (C) => {
|
|
2697
2699
|
l && C.preventDefault();
|
|
2698
2700
|
};
|
|
2699
2701
|
return /* @__PURE__ */ _(Bn, { children: /* @__PURE__ */ _(
|
|
@@ -2768,7 +2770,7 @@ const sr = w(
|
|
|
2768
2770
|
)
|
|
2769
2771
|
);
|
|
2770
2772
|
sr.displayName = "DrawerTrigger";
|
|
2771
|
-
const fa = Q.bind(Jn), pa = "purpur-drawer",
|
|
2773
|
+
const fa = Q.bind(Jn), pa = "purpur-drawer", ot = ({
|
|
2772
2774
|
["data-testid"]: e = "purpur-drawer",
|
|
2773
2775
|
children: r,
|
|
2774
2776
|
className: t,
|
|
@@ -2781,12 +2783,12 @@ const fa = Q.bind(Jn), pa = "purpur-drawer", nt = ({
|
|
|
2781
2783
|
};
|
|
2782
2784
|
return D(() => {
|
|
2783
2785
|
c(a);
|
|
2784
|
-
}, [a]), /* @__PURE__ */ _(
|
|
2786
|
+
}, [a]), /* @__PURE__ */ _(Ht.Provider, { value: s, children: /* @__PURE__ */ _("div", { className: l, "data-testid": e, ...n, children: /* @__PURE__ */ _(Yn, { open: i, onOpenChange: s, children: r }) }) });
|
|
2785
2787
|
};
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2788
|
+
ot.Trigger = sr;
|
|
2789
|
+
ot.Content = ir;
|
|
2790
|
+
ot.displayName = "Drawer";
|
|
2789
2791
|
export {
|
|
2790
|
-
|
|
2792
|
+
ot as Drawer
|
|
2791
2793
|
};
|
|
2792
2794
|
//# sourceMappingURL=drawer.es.js.map
|