@purpurds/drawer 8.8.0 → 8.9.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 +4 -4
- package/dist/drawer.cjs.js +4 -24
- package/dist/drawer.cjs.js.map +1 -1
- package/dist/drawer.es.js +257 -304
- package/dist/drawer.es.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +24 -24
- package/src/drawer.test.tsx +9 -7
package/dist/drawer.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as f, jsxs as
|
|
1
|
+
import { jsx as f, jsxs as A, Fragment as re } from "react/jsx-runtime";
|
|
2
2
|
import * as c from "react";
|
|
3
3
|
import ke, { useState as $r, createContext as Lr, forwardRef as Y, useRef as Je, useContext as Mr, useEffect as Ir } from "react";
|
|
4
4
|
import * as kr from "react-dom";
|
|
5
5
|
import Wr from "react-dom";
|
|
6
|
-
function
|
|
6
|
+
function D(e, t, { checkForDefaultPrevented: r = !0 } = {}) {
|
|
7
7
|
return function(a) {
|
|
8
|
-
if (e
|
|
9
|
-
return t
|
|
8
|
+
if (e?.(a), r === !1 || !a.defaultPrevented)
|
|
9
|
+
return t?.(a);
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
function et(e, t) {
|
|
@@ -14,7 +14,7 @@ function et(e, t) {
|
|
|
14
14
|
return e(t);
|
|
15
15
|
e != null && (e.current = t);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function At(...e) {
|
|
18
18
|
return (t) => {
|
|
19
19
|
let r = !1;
|
|
20
20
|
const o = e.map((a) => {
|
|
@@ -31,7 +31,7 @@ function Dt(...e) {
|
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
function $(...e) {
|
|
34
|
-
return c.useCallback(
|
|
34
|
+
return c.useCallback(At(...e), e);
|
|
35
35
|
}
|
|
36
36
|
function Fr(e, t) {
|
|
37
37
|
const r = c.createContext(t), o = (n) => {
|
|
@@ -47,20 +47,18 @@ function Fr(e, t) {
|
|
|
47
47
|
}
|
|
48
48
|
return [o, a];
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Ot(e, t = []) {
|
|
51
51
|
let r = [];
|
|
52
52
|
function o(n, s) {
|
|
53
53
|
const i = c.createContext(s), u = r.length;
|
|
54
54
|
r = [...r, s];
|
|
55
55
|
const l = (p) => {
|
|
56
|
-
|
|
57
|
-
const { scope: h, children: m, ..._ } = p, v = ((b = h == null ? void 0 : h[e]) == null ? void 0 : b[u]) || i, g = c.useMemo(() => _, Object.values(_));
|
|
56
|
+
const { scope: h, children: m, ..._ } = p, v = h?.[e]?.[u] || i, g = c.useMemo(() => _, Object.values(_));
|
|
58
57
|
return /* @__PURE__ */ f(v.Provider, { value: g, children: m });
|
|
59
58
|
};
|
|
60
59
|
l.displayName = n + "Provider";
|
|
61
60
|
function d(p, h) {
|
|
62
|
-
|
|
63
|
-
const m = ((v = h == null ? void 0 : h[e]) == null ? void 0 : v[u]) || i, _ = c.useContext(m);
|
|
61
|
+
const m = h?.[e]?.[u] || i, _ = c.useContext(m);
|
|
64
62
|
if (_) return _;
|
|
65
63
|
if (s !== void 0) return s;
|
|
66
64
|
throw new Error(`\`${p}\` must be used within \`${n}\``);
|
|
@@ -70,7 +68,7 @@ function Tt(e, t = []) {
|
|
|
70
68
|
const a = () => {
|
|
71
69
|
const n = r.map((s) => c.createContext(s));
|
|
72
70
|
return function(i) {
|
|
73
|
-
const u =
|
|
71
|
+
const u = i?.[e] || n;
|
|
74
72
|
return c.useMemo(
|
|
75
73
|
() => ({ [`__scope${e}`]: { ...i, [e]: u } }),
|
|
76
74
|
[i, u]
|
|
@@ -97,7 +95,7 @@ function jr(...e) {
|
|
|
97
95
|
};
|
|
98
96
|
return r.scopeName = t.scopeName, r;
|
|
99
97
|
}
|
|
100
|
-
var ne = globalThis
|
|
98
|
+
var ne = globalThis?.document ? c.useLayoutEffect : () => {
|
|
101
99
|
}, Ur = c[" useId ".trim().toString()] || (() => {
|
|
102
100
|
}), Br = 0;
|
|
103
101
|
function Re(e) {
|
|
@@ -129,10 +127,9 @@ function Yr({
|
|
|
129
127
|
}
|
|
130
128
|
const l = c.useCallback(
|
|
131
129
|
(d) => {
|
|
132
|
-
var p;
|
|
133
130
|
if (i) {
|
|
134
|
-
const
|
|
135
|
-
|
|
131
|
+
const p = zr(d) ? d(e) : d;
|
|
132
|
+
p !== e && s.current?.(p);
|
|
136
133
|
} else
|
|
137
134
|
n(d);
|
|
138
135
|
},
|
|
@@ -148,17 +145,16 @@ function Vr({
|
|
|
148
145
|
return Hr(() => {
|
|
149
146
|
n.current = t;
|
|
150
147
|
}, [t]), c.useEffect(() => {
|
|
151
|
-
|
|
152
|
-
a.current !== r && ((s = n.current) == null || s.call(n, r), a.current = r);
|
|
148
|
+
a.current !== r && (n.current?.(r), a.current = r);
|
|
153
149
|
}, [r, a]), [r, o, n];
|
|
154
150
|
}
|
|
155
151
|
function zr(e) {
|
|
156
152
|
return typeof e == "function";
|
|
157
153
|
}
|
|
158
154
|
// @__NO_SIDE_EFFECTS__
|
|
159
|
-
function
|
|
155
|
+
function Tt(e) {
|
|
160
156
|
const t = /* @__PURE__ */ Xr(e), r = c.forwardRef((o, a) => {
|
|
161
|
-
const { children: n, ...s } = o, i = c.Children.toArray(n), u = i.find(
|
|
157
|
+
const { children: n, ...s } = o, i = c.Children.toArray(n), u = i.find(Kr);
|
|
162
158
|
if (u) {
|
|
163
159
|
const l = u.props.children, d = i.map((p) => p === u ? c.Children.count(l) > 1 ? c.Children.only(null) : c.isValidElement(l) ? l.props.children : null : p);
|
|
164
160
|
return /* @__PURE__ */ f(t, { ...s, ref: a, children: c.isValidElement(l) ? c.cloneElement(l, void 0, d) : null });
|
|
@@ -172,18 +168,18 @@ function Xr(e) {
|
|
|
172
168
|
const t = c.forwardRef((r, o) => {
|
|
173
169
|
const { children: a, ...n } = r;
|
|
174
170
|
if (c.isValidElement(a)) {
|
|
175
|
-
const s = Zr(a), i =
|
|
176
|
-
return a.type !== c.Fragment && (i.ref = o ?
|
|
171
|
+
const s = Zr(a), i = Gr(n, a.props);
|
|
172
|
+
return a.type !== c.Fragment && (i.ref = o ? At(o, s) : s), c.cloneElement(a, i);
|
|
177
173
|
}
|
|
178
174
|
return c.Children.count(a) > 1 ? c.Children.only(null) : null;
|
|
179
175
|
});
|
|
180
176
|
return t.displayName = `${e}.SlotClone`, t;
|
|
181
177
|
}
|
|
182
178
|
var qr = Symbol("radix.slottable");
|
|
183
|
-
function
|
|
179
|
+
function Kr(e) {
|
|
184
180
|
return c.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === qr;
|
|
185
181
|
}
|
|
186
|
-
function
|
|
182
|
+
function Gr(e, t) {
|
|
187
183
|
const r = { ...t };
|
|
188
184
|
for (const o in t) {
|
|
189
185
|
const a = e[o], n = t[o];
|
|
@@ -195,9 +191,8 @@ function Kr(e, t) {
|
|
|
195
191
|
return { ...e, ...r };
|
|
196
192
|
}
|
|
197
193
|
function Zr(e) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
return r ? e.ref : (t = (a = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : a.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
|
|
194
|
+
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning;
|
|
195
|
+
return r ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
|
|
201
196
|
}
|
|
202
197
|
var Qr = [
|
|
203
198
|
"a",
|
|
@@ -217,8 +212,8 @@ var Qr = [
|
|
|
217
212
|
"span",
|
|
218
213
|
"svg",
|
|
219
214
|
"ul"
|
|
220
|
-
],
|
|
221
|
-
const r = /* @__PURE__ */
|
|
215
|
+
], O = Qr.reduce((e, t) => {
|
|
216
|
+
const r = /* @__PURE__ */ Tt(`Primitive.${t}`), o = c.forwardRef((a, n) => {
|
|
222
217
|
const { asChild: s, ...i } = a, u = s ? r : t;
|
|
223
218
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(u, { ...i, ref: n });
|
|
224
219
|
});
|
|
@@ -231,12 +226,9 @@ function L(e) {
|
|
|
231
226
|
const t = c.useRef(e);
|
|
232
227
|
return c.useEffect(() => {
|
|
233
228
|
t.current = e;
|
|
234
|
-
}), c.useMemo(() => (...r) =>
|
|
235
|
-
var o;
|
|
236
|
-
return (o = t.current) == null ? void 0 : o.call(t, ...r);
|
|
237
|
-
}, []);
|
|
229
|
+
}), c.useMemo(() => (...r) => t.current?.(...r), []);
|
|
238
230
|
}
|
|
239
|
-
function en(e, t = globalThis
|
|
231
|
+
function en(e, t = globalThis?.document) {
|
|
240
232
|
const r = L(e);
|
|
241
233
|
c.useEffect(() => {
|
|
242
234
|
const o = (a) => {
|
|
@@ -259,15 +251,15 @@ var tn = "DismissableLayer", We = "dismissableLayer.update", rn = "dismissableLa
|
|
|
259
251
|
onInteractOutside: s,
|
|
260
252
|
onDismiss: i,
|
|
261
253
|
...u
|
|
262
|
-
} = e, l = c.useContext($t), [d, p] = c.useState(null), h =
|
|
254
|
+
} = e, l = c.useContext($t), [d, p] = c.useState(null), h = d?.ownerDocument ?? globalThis?.document, [, m] = c.useState({}), _ = $(t, (S) => p(S)), v = Array.from(l.layers), [g] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), y = v.indexOf(g), b = d ? v.indexOf(d) : -1, E = l.layersWithOutsidePointerEventsDisabled.size > 0, w = b >= y, C = sn((S) => {
|
|
263
255
|
const x = S.target, P = [...l.branches].some((N) => N.contains(x));
|
|
264
|
-
!w || P || (a
|
|
256
|
+
!w || P || (a?.(S), s?.(S), S.defaultPrevented || i?.());
|
|
265
257
|
}, h), R = cn((S) => {
|
|
266
258
|
const x = S.target;
|
|
267
|
-
[...l.branches].some((N) => N.contains(x)) || (n
|
|
259
|
+
[...l.branches].some((N) => N.contains(x)) || (n?.(S), s?.(S), S.defaultPrevented || i?.());
|
|
268
260
|
}, h);
|
|
269
261
|
return en((S) => {
|
|
270
|
-
|
|
262
|
+
b === l.layers.size - 1 && (o?.(S), !S.defaultPrevented && i && (S.preventDefault(), i()));
|
|
271
263
|
}, h), c.useEffect(() => {
|
|
272
264
|
if (d)
|
|
273
265
|
return r && (l.layersWithOutsidePointerEventsDisabled.size === 0 && (tt = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), l.layersWithOutsidePointerEventsDisabled.add(d)), l.layers.add(d), rt(), () => {
|
|
@@ -279,7 +271,7 @@ var tn = "DismissableLayer", We = "dismissableLayer.update", rn = "dismissableLa
|
|
|
279
271
|
const S = () => m({});
|
|
280
272
|
return document.addEventListener(We, S), () => document.removeEventListener(We, S);
|
|
281
273
|
}, []), /* @__PURE__ */ f(
|
|
282
|
-
|
|
274
|
+
O.div,
|
|
283
275
|
{
|
|
284
276
|
...u,
|
|
285
277
|
ref: _,
|
|
@@ -287,9 +279,9 @@ var tn = "DismissableLayer", We = "dismissableLayer.update", rn = "dismissableLa
|
|
|
287
279
|
pointerEvents: E ? w ? "auto" : "none" : void 0,
|
|
288
280
|
...e.style
|
|
289
281
|
},
|
|
290
|
-
onFocusCapture:
|
|
291
|
-
onBlurCapture:
|
|
292
|
-
onPointerDownCapture:
|
|
282
|
+
onFocusCapture: D(e.onFocusCapture, R.onFocusCapture),
|
|
283
|
+
onBlurCapture: D(e.onBlurCapture, R.onBlurCapture),
|
|
284
|
+
onPointerDownCapture: D(
|
|
293
285
|
e.onPointerDownCapture,
|
|
294
286
|
C.onPointerDownCapture
|
|
295
287
|
)
|
|
@@ -306,10 +298,10 @@ var on = "DismissableLayerBranch", an = c.forwardRef((e, t) => {
|
|
|
306
298
|
return r.branches.add(n), () => {
|
|
307
299
|
r.branches.delete(n);
|
|
308
300
|
};
|
|
309
|
-
}, [r.branches]), /* @__PURE__ */ f(
|
|
301
|
+
}, [r.branches]), /* @__PURE__ */ f(O.div, { ...e, ref: a });
|
|
310
302
|
});
|
|
311
303
|
an.displayName = on;
|
|
312
|
-
function sn(e, t = globalThis
|
|
304
|
+
function sn(e, t = globalThis?.document) {
|
|
313
305
|
const r = L(e), o = c.useRef(!1), a = c.useRef(() => {
|
|
314
306
|
});
|
|
315
307
|
return c.useEffect(() => {
|
|
@@ -339,7 +331,7 @@ function sn(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
|
339
331
|
onPointerDownCapture: () => o.current = !0
|
|
340
332
|
};
|
|
341
333
|
}
|
|
342
|
-
function cn(e, t = globalThis
|
|
334
|
+
function cn(e, t = globalThis?.document) {
|
|
343
335
|
const r = L(e), o = c.useRef(!1);
|
|
344
336
|
return c.useEffect(() => {
|
|
345
337
|
const a = (n) => {
|
|
@@ -387,15 +379,15 @@ var Ne = "focusScope.autoFocusOnMount", xe = "focusScope.autoFocusOnUnmount", nt
|
|
|
387
379
|
if (m.paused || !i) return;
|
|
388
380
|
const w = E.relatedTarget;
|
|
389
381
|
w !== null && (i.contains(w) || H(p.current, { select: !0 }));
|
|
390
|
-
},
|
|
382
|
+
}, y = function(E) {
|
|
391
383
|
if (document.activeElement === document.body)
|
|
392
384
|
for (const C of E)
|
|
393
385
|
C.removedNodes.length > 0 && H(i);
|
|
394
386
|
};
|
|
395
387
|
document.addEventListener("focusin", v), document.addEventListener("focusout", g);
|
|
396
|
-
const
|
|
397
|
-
return i &&
|
|
398
|
-
document.removeEventListener("focusin", v), document.removeEventListener("focusout", g),
|
|
388
|
+
const b = new MutationObserver(y);
|
|
389
|
+
return i && b.observe(i, { childList: !0, subtree: !0 }), () => {
|
|
390
|
+
document.removeEventListener("focusin", v), document.removeEventListener("focusout", g), b.disconnect();
|
|
399
391
|
};
|
|
400
392
|
}
|
|
401
393
|
}, [o, i, m.paused]), c.useEffect(() => {
|
|
@@ -403,13 +395,13 @@ var Ne = "focusScope.autoFocusOnMount", xe = "focusScope.autoFocusOnUnmount", nt
|
|
|
403
395
|
at.add(m);
|
|
404
396
|
const v = document.activeElement;
|
|
405
397
|
if (!i.contains(v)) {
|
|
406
|
-
const
|
|
407
|
-
i.addEventListener(Ne, l), i.dispatchEvent(
|
|
398
|
+
const y = new CustomEvent(Ne, nt);
|
|
399
|
+
i.addEventListener(Ne, l), i.dispatchEvent(y), y.defaultPrevented || (un(vn(kt(i)), { select: !0 }), document.activeElement === v && H(i));
|
|
408
400
|
}
|
|
409
401
|
return () => {
|
|
410
402
|
i.removeEventListener(Ne, l), setTimeout(() => {
|
|
411
|
-
const
|
|
412
|
-
i.addEventListener(xe, d), i.dispatchEvent(
|
|
403
|
+
const y = new CustomEvent(xe, nt);
|
|
404
|
+
i.addEventListener(xe, d), i.dispatchEvent(y), y.defaultPrevented || H(v ?? document.body, { select: !0 }), i.removeEventListener(xe, d), at.remove(m);
|
|
413
405
|
}, 0);
|
|
414
406
|
};
|
|
415
407
|
}
|
|
@@ -417,15 +409,15 @@ var Ne = "focusScope.autoFocusOnMount", xe = "focusScope.autoFocusOnUnmount", nt
|
|
|
417
409
|
const _ = c.useCallback(
|
|
418
410
|
(v) => {
|
|
419
411
|
if (!r && !o || m.paused) return;
|
|
420
|
-
const g = v.key === "Tab" && !v.altKey && !v.ctrlKey && !v.metaKey,
|
|
421
|
-
if (g &&
|
|
422
|
-
const
|
|
423
|
-
E && w ? !v.shiftKey &&
|
|
412
|
+
const g = v.key === "Tab" && !v.altKey && !v.ctrlKey && !v.metaKey, y = document.activeElement;
|
|
413
|
+
if (g && y) {
|
|
414
|
+
const b = v.currentTarget, [E, w] = dn(b);
|
|
415
|
+
E && w ? !v.shiftKey && y === w ? (v.preventDefault(), r && H(E, { select: !0 })) : v.shiftKey && y === E && (v.preventDefault(), r && H(w, { select: !0 })) : y === b && v.preventDefault();
|
|
424
416
|
}
|
|
425
417
|
},
|
|
426
418
|
[r, o, m.paused]
|
|
427
419
|
);
|
|
428
|
-
return /* @__PURE__ */ f(
|
|
420
|
+
return /* @__PURE__ */ f(O.div, { tabIndex: -1, ...s, ref: h, onKeyDown: _ });
|
|
429
421
|
});
|
|
430
422
|
It.displayName = ln;
|
|
431
423
|
function un(e, { select: t = !1 } = {}) {
|
|
@@ -475,11 +467,10 @@ function hn() {
|
|
|
475
467
|
return {
|
|
476
468
|
add(t) {
|
|
477
469
|
const r = e[0];
|
|
478
|
-
t !== r &&
|
|
470
|
+
t !== r && r?.pause(), e = it(e, t), e.unshift(t);
|
|
479
471
|
},
|
|
480
472
|
remove(t) {
|
|
481
|
-
|
|
482
|
-
e = it(e, t), (r = e[0]) == null || r.resume();
|
|
473
|
+
e = it(e, t), e[0]?.resume();
|
|
483
474
|
}
|
|
484
475
|
};
|
|
485
476
|
}
|
|
@@ -491,18 +482,17 @@ function vn(e) {
|
|
|
491
482
|
return e.filter((t) => t.tagName !== "A");
|
|
492
483
|
}
|
|
493
484
|
var mn = "Portal", Wt = c.forwardRef((e, t) => {
|
|
494
|
-
var i;
|
|
495
485
|
const { container: r, ...o } = e, [a, n] = c.useState(!1);
|
|
496
486
|
ne(() => n(!0), []);
|
|
497
|
-
const s = r || a &&
|
|
498
|
-
return s ? Wr.createPortal(/* @__PURE__ */ f(
|
|
487
|
+
const s = r || a && globalThis?.document?.body;
|
|
488
|
+
return s ? Wr.createPortal(/* @__PURE__ */ f(O.div, { ...o, ref: t }), s) : null;
|
|
499
489
|
});
|
|
500
490
|
Wt.displayName = mn;
|
|
501
491
|
function gn(e, t) {
|
|
502
492
|
return c.useReducer((r, o) => t[r][o] ?? r, e);
|
|
503
493
|
}
|
|
504
494
|
var V = (e) => {
|
|
505
|
-
const { present: t, children: r } = e, o = _n(t), a = typeof r == "function" ? r({ present: o.isPresent }) : c.Children.only(r), n = $(o.ref,
|
|
495
|
+
const { present: t, children: r } = e, o = _n(t), a = typeof r == "function" ? r({ present: o.isPresent }) : c.Children.only(r), n = $(o.ref, yn(a));
|
|
506
496
|
return typeof r == "function" || o.isPresent ? c.cloneElement(a, { ref: n }) : null;
|
|
507
497
|
};
|
|
508
498
|
V.displayName = "Presence";
|
|
@@ -527,7 +517,7 @@ function _n(e) {
|
|
|
527
517
|
const l = o.current, d = a.current;
|
|
528
518
|
if (d !== e) {
|
|
529
519
|
const h = n.current, m = le(l);
|
|
530
|
-
e ? u("MOUNT") : m === "none" ||
|
|
520
|
+
e ? u("MOUNT") : m === "none" || l?.display === "none" ? u("UNMOUNT") : u(d && h !== m ? "ANIMATION_OUT" : "UNMOUNT"), a.current = e;
|
|
531
521
|
}
|
|
532
522
|
}, [e, u]), ne(() => {
|
|
533
523
|
if (t) {
|
|
@@ -556,19 +546,18 @@ function _n(e) {
|
|
|
556
546
|
};
|
|
557
547
|
}
|
|
558
548
|
function le(e) {
|
|
559
|
-
return
|
|
549
|
+
return e?.animationName || "none";
|
|
560
550
|
}
|
|
561
|
-
function
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
return r ? e.ref : (t = (a = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : a.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
|
|
551
|
+
function yn(e) {
|
|
552
|
+
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning;
|
|
553
|
+
return r ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
|
|
565
554
|
}
|
|
566
|
-
var
|
|
567
|
-
function
|
|
555
|
+
var De = 0;
|
|
556
|
+
function bn() {
|
|
568
557
|
c.useEffect(() => {
|
|
569
558
|
const e = document.querySelectorAll("[data-radix-focus-guard]");
|
|
570
|
-
return document.body.insertAdjacentElement("afterbegin", e[0] ?? st()), document.body.insertAdjacentElement("beforeend", e[1] ?? st()),
|
|
571
|
-
|
|
559
|
+
return document.body.insertAdjacentElement("afterbegin", e[0] ?? st()), document.body.insertAdjacentElement("beforeend", e[1] ?? st()), De++, () => {
|
|
560
|
+
De === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), De--;
|
|
572
561
|
};
|
|
573
562
|
}, []);
|
|
574
563
|
}
|
|
@@ -599,7 +588,7 @@ function wn(e, t, r) {
|
|
|
599
588
|
return e.concat(n || Array.prototype.slice.call(t));
|
|
600
589
|
}
|
|
601
590
|
var ge = "right-scroll-bar-position", _e = "width-before-scroll-bar", Sn = "with-scroll-bars-hidden", En = "--removed-body-scroll-bar-size";
|
|
602
|
-
function
|
|
591
|
+
function Ae(e, t) {
|
|
603
592
|
return typeof e == "function" ? e(t) : e && (e.current = t), e;
|
|
604
593
|
}
|
|
605
594
|
function Cn(e, t) {
|
|
@@ -627,7 +616,7 @@ var Pn = typeof window < "u" ? c.useLayoutEffect : c.useEffect, ct = /* @__PURE_
|
|
|
627
616
|
function Rn(e, t) {
|
|
628
617
|
var r = Cn(null, function(o) {
|
|
629
618
|
return e.forEach(function(a) {
|
|
630
|
-
return
|
|
619
|
+
return Ae(a, o);
|
|
631
620
|
});
|
|
632
621
|
});
|
|
633
622
|
return Pn(function() {
|
|
@@ -635,9 +624,9 @@ function Rn(e, t) {
|
|
|
635
624
|
if (o) {
|
|
636
625
|
var a = new Set(o), n = new Set(e), s = r.current;
|
|
637
626
|
a.forEach(function(i) {
|
|
638
|
-
n.has(i) ||
|
|
627
|
+
n.has(i) || Ae(i, null);
|
|
639
628
|
}), n.forEach(function(i) {
|
|
640
|
-
a.has(i) ||
|
|
629
|
+
a.has(i) || Ae(i, s);
|
|
641
630
|
});
|
|
642
631
|
}
|
|
643
632
|
ct.set(r, e);
|
|
@@ -701,7 +690,7 @@ function xn(e, t) {
|
|
|
701
690
|
};
|
|
702
691
|
return a;
|
|
703
692
|
}
|
|
704
|
-
function
|
|
693
|
+
function Dn(e) {
|
|
705
694
|
e === void 0 && (e = {});
|
|
706
695
|
var t = xn(null);
|
|
707
696
|
return t.options = k({ async: !0, ssr: !1 }, e), t;
|
|
@@ -716,21 +705,21 @@ var jt = function(e) {
|
|
|
716
705
|
return c.createElement(o, k({}, r));
|
|
717
706
|
};
|
|
718
707
|
jt.isSideCarExport = !0;
|
|
719
|
-
function
|
|
708
|
+
function An(e, t) {
|
|
720
709
|
return e.useMedium(t), jt;
|
|
721
710
|
}
|
|
722
|
-
var Ut =
|
|
711
|
+
var Ut = Dn(), Oe = function() {
|
|
723
712
|
}, Se = c.forwardRef(function(e, t) {
|
|
724
713
|
var r = c.useRef(null), o = c.useState({
|
|
725
|
-
onScrollCapture:
|
|
726
|
-
onWheelCapture:
|
|
727
|
-
onTouchMoveCapture:
|
|
728
|
-
}), a = o[0], n = o[1], s = e.forwardProps, i = e.children, u = e.className, l = e.removeScrollBar, d = e.enabled, p = e.shards, h = e.sideCar, m = e.noRelative, _ = e.noIsolation, v = e.inert, g = e.allowPinchZoom,
|
|
714
|
+
onScrollCapture: Oe,
|
|
715
|
+
onWheelCapture: Oe,
|
|
716
|
+
onTouchMoveCapture: Oe
|
|
717
|
+
}), a = o[0], n = o[1], s = e.forwardProps, i = e.children, u = e.className, l = e.removeScrollBar, d = e.enabled, p = e.shards, h = e.sideCar, m = e.noRelative, _ = e.noIsolation, v = e.inert, g = e.allowPinchZoom, y = e.as, b = y === void 0 ? "div" : y, E = e.gapMode, w = Ft(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), C = h, R = Rn([r, t]), S = k(k({}, w), a);
|
|
729
718
|
return c.createElement(
|
|
730
719
|
c.Fragment,
|
|
731
720
|
null,
|
|
732
721
|
d && c.createElement(C, { sideCar: Ut, removeScrollBar: l, shards: p, noRelative: m, noIsolation: _, inert: v, setCallbacks: n, allowPinchZoom: !!g, lockRef: r, gapMode: E }),
|
|
733
|
-
s ? c.cloneElement(c.Children.only(i), k(k({}, S), { ref: R })) : c.createElement(
|
|
722
|
+
s ? c.cloneElement(c.Children.only(i), k(k({}, S), { ref: R })) : c.createElement(b, k({}, S, { className: u, ref: R }), i)
|
|
734
723
|
);
|
|
735
724
|
});
|
|
736
725
|
Se.defaultProps = {
|
|
@@ -742,16 +731,16 @@ Se.classNames = {
|
|
|
742
731
|
fullWidth: _e,
|
|
743
732
|
zeroRight: ge
|
|
744
733
|
};
|
|
745
|
-
var
|
|
734
|
+
var On = function() {
|
|
746
735
|
if (typeof __webpack_nonce__ < "u")
|
|
747
736
|
return __webpack_nonce__;
|
|
748
737
|
};
|
|
749
|
-
function
|
|
738
|
+
function Tn() {
|
|
750
739
|
if (!document)
|
|
751
740
|
return null;
|
|
752
741
|
var e = document.createElement("style");
|
|
753
742
|
e.type = "text/css";
|
|
754
|
-
var t =
|
|
743
|
+
var t = On();
|
|
755
744
|
return t && e.setAttribute("nonce", t), e;
|
|
756
745
|
}
|
|
757
746
|
function $n(e, t) {
|
|
@@ -765,7 +754,7 @@ var Mn = function() {
|
|
|
765
754
|
var e = 0, t = null;
|
|
766
755
|
return {
|
|
767
756
|
add: function(r) {
|
|
768
|
-
e == 0 && (t =
|
|
757
|
+
e == 0 && (t = Tn()) && ($n(t, r), Ln(t)), e++;
|
|
769
758
|
},
|
|
770
759
|
remove: function() {
|
|
771
760
|
e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
|
|
@@ -791,11 +780,11 @@ var Mn = function() {
|
|
|
791
780
|
top: 0,
|
|
792
781
|
right: 0,
|
|
793
782
|
gap: 0
|
|
794
|
-
},
|
|
783
|
+
}, Te = function(e) {
|
|
795
784
|
return parseInt(e || "", 10) || 0;
|
|
796
785
|
}, Wn = function(e) {
|
|
797
786
|
var t = window.getComputedStyle(document.body), r = t[e === "padding" ? "paddingLeft" : "marginLeft"], o = t[e === "padding" ? "paddingTop" : "marginTop"], a = t[e === "padding" ? "paddingRight" : "marginRight"];
|
|
798
|
-
return [
|
|
787
|
+
return [Te(r), Te(o), Te(a)];
|
|
799
788
|
}, Fn = function(e) {
|
|
800
789
|
if (e === void 0 && (e = "margin"), typeof window > "u")
|
|
801
790
|
return kn;
|
|
@@ -925,17 +914,17 @@ var q = Fe ? { passive: !1 } : !1, Yn = function(e) {
|
|
|
925
914
|
return e === "v" ? Vn(t) : zn(t);
|
|
926
915
|
}, Vt = function(e, t) {
|
|
927
916
|
return e === "v" ? Xn(t) : qn(t);
|
|
928
|
-
},
|
|
917
|
+
}, Kn = function(e, t) {
|
|
929
918
|
return e === "h" && t === "rtl" ? -1 : 1;
|
|
930
|
-
},
|
|
931
|
-
var n =
|
|
919
|
+
}, Gn = function(e, t, r, o, a) {
|
|
920
|
+
var n = Kn(e, window.getComputedStyle(t).direction), s = n * o, i = r.target, u = t.contains(i), l = !1, d = s > 0, p = 0, h = 0;
|
|
932
921
|
do {
|
|
933
922
|
if (!i)
|
|
934
923
|
break;
|
|
935
|
-
var m = Vt(e, i), _ = m[0], v = m[1], g = m[2],
|
|
936
|
-
(_ ||
|
|
937
|
-
var
|
|
938
|
-
i =
|
|
924
|
+
var m = Vt(e, i), _ = m[0], v = m[1], g = m[2], y = v - g - n * _;
|
|
925
|
+
(_ || y) && Yt(e, i) && (p += y, h += _);
|
|
926
|
+
var b = i.parentNode;
|
|
927
|
+
i = b && b.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? b.host : b;
|
|
939
928
|
} while (
|
|
940
929
|
// portaled content
|
|
941
930
|
!u && i !== document.body || // self content
|
|
@@ -955,7 +944,7 @@ var q = Fe ? { passive: !1 } : !1, Yn = function(e) {
|
|
|
955
944
|
.block-interactivity-`.concat(e, ` {pointer-events: none;}
|
|
956
945
|
.allow-interactivity-`).concat(e, ` {pointer-events: all;}
|
|
957
946
|
`);
|
|
958
|
-
}, Jn = 0,
|
|
947
|
+
}, Jn = 0, K = [];
|
|
959
948
|
function eo(e) {
|
|
960
949
|
var t = c.useRef([]), r = c.useRef([0, 0]), o = c.useRef(), a = c.useState(Jn++)[0], n = c.useState(Bt)[0], s = c.useRef(e);
|
|
961
950
|
c.useEffect(function() {
|
|
@@ -976,7 +965,7 @@ function eo(e) {
|
|
|
976
965
|
var i = c.useCallback(function(v, g) {
|
|
977
966
|
if ("touches" in v && v.touches.length === 2 || v.type === "wheel" && v.ctrlKey)
|
|
978
967
|
return !s.current.allowPinchZoom;
|
|
979
|
-
var
|
|
968
|
+
var y = de(v), b = r.current, E = "deltaX" in v ? v.deltaX : b[0] - y[0], w = "deltaY" in v ? v.deltaY : b[1] - y[1], C, R = v.target, S = Math.abs(E) > Math.abs(w) ? "h" : "v";
|
|
980
969
|
if ("touches" in v && S === "h" && R.type === "range")
|
|
981
970
|
return !1;
|
|
982
971
|
var x = ut(S, R);
|
|
@@ -987,26 +976,26 @@ function eo(e) {
|
|
|
987
976
|
if (!o.current && "changedTouches" in v && (E || w) && (o.current = C), !C)
|
|
988
977
|
return !0;
|
|
989
978
|
var P = o.current || C;
|
|
990
|
-
return
|
|
979
|
+
return Gn(P, g, v, P === "h" ? E : w);
|
|
991
980
|
}, []), u = c.useCallback(function(v) {
|
|
992
981
|
var g = v;
|
|
993
|
-
if (!(!
|
|
994
|
-
var
|
|
995
|
-
return C.name === g.type && (C.target === g.target || g.target === C.shadowParent) && Zn(C.delta,
|
|
982
|
+
if (!(!K.length || K[K.length - 1] !== n)) {
|
|
983
|
+
var y = "deltaY" in g ? dt(g) : de(g), b = t.current.filter(function(C) {
|
|
984
|
+
return C.name === g.type && (C.target === g.target || g.target === C.shadowParent) && Zn(C.delta, y);
|
|
996
985
|
})[0];
|
|
997
|
-
if (
|
|
986
|
+
if (b && b.should) {
|
|
998
987
|
g.cancelable && g.preventDefault();
|
|
999
988
|
return;
|
|
1000
989
|
}
|
|
1001
|
-
if (!
|
|
990
|
+
if (!b) {
|
|
1002
991
|
var E = (s.current.shards || []).map(ft).filter(Boolean).filter(function(C) {
|
|
1003
992
|
return C.contains(g.target);
|
|
1004
993
|
}), w = E.length > 0 ? i(g, E[0]) : !s.current.noIsolation;
|
|
1005
994
|
w && g.cancelable && g.preventDefault();
|
|
1006
995
|
}
|
|
1007
996
|
}
|
|
1008
|
-
}, []), l = c.useCallback(function(v, g,
|
|
1009
|
-
var E = { name: v, delta: g, target:
|
|
997
|
+
}, []), l = c.useCallback(function(v, g, y, b) {
|
|
998
|
+
var E = { name: v, delta: g, target: y, should: b, shadowParent: to(y) };
|
|
1010
999
|
t.current.push(E), setTimeout(function() {
|
|
1011
1000
|
t.current = t.current.filter(function(w) {
|
|
1012
1001
|
return w !== E;
|
|
@@ -1020,12 +1009,12 @@ function eo(e) {
|
|
|
1020
1009
|
l(v.type, de(v), v.target, i(v, e.lockRef.current));
|
|
1021
1010
|
}, []);
|
|
1022
1011
|
c.useEffect(function() {
|
|
1023
|
-
return
|
|
1012
|
+
return K.push(n), e.setCallbacks({
|
|
1024
1013
|
onScrollCapture: p,
|
|
1025
1014
|
onWheelCapture: p,
|
|
1026
1015
|
onTouchMoveCapture: h
|
|
1027
1016
|
}), document.addEventListener("wheel", u, q), document.addEventListener("touchmove", u, q), document.addEventListener("touchstart", d, q), function() {
|
|
1028
|
-
|
|
1017
|
+
K = K.filter(function(v) {
|
|
1029
1018
|
return v !== n;
|
|
1030
1019
|
}), document.removeEventListener("wheel", u, q), document.removeEventListener("touchmove", u, q), document.removeEventListener("touchstart", d, q);
|
|
1031
1020
|
};
|
|
@@ -1043,7 +1032,7 @@ function to(e) {
|
|
|
1043
1032
|
e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
|
|
1044
1033
|
return t;
|
|
1045
1034
|
}
|
|
1046
|
-
const ro =
|
|
1035
|
+
const ro = An(Ut, eo);
|
|
1047
1036
|
var zt = c.forwardRef(function(e, t) {
|
|
1048
1037
|
return c.createElement(Se, k({}, e, { ref: t, sideCar: ro }));
|
|
1049
1038
|
});
|
|
@@ -1053,7 +1042,7 @@ var no = function(e) {
|
|
|
1053
1042
|
return null;
|
|
1054
1043
|
var t = Array.isArray(e) ? e[0] : e;
|
|
1055
1044
|
return t.ownerDocument.body;
|
|
1056
|
-
},
|
|
1045
|
+
}, G = /* @__PURE__ */ new WeakMap(), fe = /* @__PURE__ */ new WeakMap(), pe = {}, $e = 0, Xt = function(e) {
|
|
1057
1046
|
return e && (e.host || Xt(e.parentNode));
|
|
1058
1047
|
}, oo = function(e, t) {
|
|
1059
1048
|
return t.map(function(r) {
|
|
@@ -1077,18 +1066,18 @@ var no = function(e) {
|
|
|
1077
1066
|
d(h);
|
|
1078
1067
|
else
|
|
1079
1068
|
try {
|
|
1080
|
-
var m = h.getAttribute(o), _ = m !== null && m !== "false", v = (
|
|
1081
|
-
|
|
1082
|
-
} catch (
|
|
1083
|
-
console.error("aria-hidden: cannot operate on ", h,
|
|
1069
|
+
var m = h.getAttribute(o), _ = m !== null && m !== "false", v = (G.get(h) || 0) + 1, g = (n.get(h) || 0) + 1;
|
|
1070
|
+
G.set(h, v), n.set(h, g), s.push(h), v === 1 && _ && fe.set(h, !0), g === 1 && h.setAttribute(r, "true"), _ || h.setAttribute(o, "true");
|
|
1071
|
+
} catch (y) {
|
|
1072
|
+
console.error("aria-hidden: cannot operate on ", h, y);
|
|
1084
1073
|
}
|
|
1085
1074
|
});
|
|
1086
1075
|
};
|
|
1087
1076
|
return d(t), i.clear(), $e++, function() {
|
|
1088
1077
|
s.forEach(function(p) {
|
|
1089
|
-
var h =
|
|
1090
|
-
|
|
1091
|
-
}), $e--, $e || (
|
|
1078
|
+
var h = G.get(p) - 1, m = n.get(p) - 1;
|
|
1079
|
+
G.set(p, h), n.set(p, m), h || (fe.has(p) || p.removeAttribute(o), fe.delete(p)), m || p.removeAttribute(r);
|
|
1080
|
+
}), $e--, $e || (G = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), fe = /* @__PURE__ */ new WeakMap(), pe = {});
|
|
1092
1081
|
};
|
|
1093
1082
|
}, io = function(e, t, r) {
|
|
1094
1083
|
r === void 0 && (r = "data-aria-hidden");
|
|
@@ -1096,7 +1085,7 @@ var no = function(e) {
|
|
|
1096
1085
|
return a ? (o.push.apply(o, Array.from(a.querySelectorAll("[aria-live], script"))), ao(o, a, r, "aria-hidden")) : function() {
|
|
1097
1086
|
return null;
|
|
1098
1087
|
};
|
|
1099
|
-
}, Ee = "Dialog", [qt] =
|
|
1088
|
+
}, Ee = "Dialog", [qt] = Ot(Ee), [so, I] = qt(Ee), Kt = (e) => {
|
|
1100
1089
|
const {
|
|
1101
1090
|
__scopeDialog: t,
|
|
1102
1091
|
children: r,
|
|
@@ -1127,12 +1116,12 @@ var no = function(e) {
|
|
|
1127
1116
|
}
|
|
1128
1117
|
);
|
|
1129
1118
|
};
|
|
1130
|
-
|
|
1131
|
-
var
|
|
1119
|
+
Kt.displayName = Ee;
|
|
1120
|
+
var Gt = "DialogTrigger", Zt = c.forwardRef(
|
|
1132
1121
|
(e, t) => {
|
|
1133
|
-
const { __scopeDialog: r, ...o } = e, a = I(
|
|
1122
|
+
const { __scopeDialog: r, ...o } = e, a = I(Gt, r), n = $(t, a.triggerRef);
|
|
1134
1123
|
return /* @__PURE__ */ f(
|
|
1135
|
-
|
|
1124
|
+
O.button,
|
|
1136
1125
|
{
|
|
1137
1126
|
type: "button",
|
|
1138
1127
|
"aria-haspopup": "dialog",
|
|
@@ -1141,12 +1130,12 @@ var Kt = "DialogTrigger", Zt = c.forwardRef(
|
|
|
1141
1130
|
"data-state": Ve(a.open),
|
|
1142
1131
|
...o,
|
|
1143
1132
|
ref: n,
|
|
1144
|
-
onClick:
|
|
1133
|
+
onClick: D(e.onClick, a.onOpenToggle)
|
|
1145
1134
|
}
|
|
1146
1135
|
);
|
|
1147
1136
|
}
|
|
1148
1137
|
);
|
|
1149
|
-
Zt.displayName =
|
|
1138
|
+
Zt.displayName = Gt;
|
|
1150
1139
|
var He = "DialogPortal", [co, Qt] = qt(He, {
|
|
1151
1140
|
forceMount: void 0
|
|
1152
1141
|
}), Jt = (e) => {
|
|
@@ -1154,21 +1143,21 @@ var He = "DialogPortal", [co, Qt] = qt(He, {
|
|
|
1154
1143
|
return /* @__PURE__ */ f(co, { scope: t, forceMount: r, children: c.Children.map(o, (s) => /* @__PURE__ */ f(V, { present: r || n.open, children: /* @__PURE__ */ f(Wt, { asChild: !0, container: a, children: s }) })) });
|
|
1155
1144
|
};
|
|
1156
1145
|
Jt.displayName = He;
|
|
1157
|
-
var
|
|
1146
|
+
var ye = "DialogOverlay", er = c.forwardRef(
|
|
1158
1147
|
(e, t) => {
|
|
1159
|
-
const r = Qt(
|
|
1148
|
+
const r = Qt(ye, e.__scopeDialog), { forceMount: o = r.forceMount, ...a } = e, n = I(ye, e.__scopeDialog);
|
|
1160
1149
|
return n.modal ? /* @__PURE__ */ f(V, { present: o || n.open, children: /* @__PURE__ */ f(uo, { ...a, ref: t }) }) : null;
|
|
1161
1150
|
}
|
|
1162
1151
|
);
|
|
1163
|
-
er.displayName =
|
|
1164
|
-
var lo = /* @__PURE__ */
|
|
1152
|
+
er.displayName = ye;
|
|
1153
|
+
var lo = /* @__PURE__ */ Tt("DialogOverlay.RemoveScroll"), uo = c.forwardRef(
|
|
1165
1154
|
(e, t) => {
|
|
1166
|
-
const { __scopeDialog: r, ...o } = e, a = I(
|
|
1155
|
+
const { __scopeDialog: r, ...o } = e, a = I(ye, r);
|
|
1167
1156
|
return (
|
|
1168
1157
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
1169
1158
|
// ie. when `Overlay` and `Content` are siblings
|
|
1170
1159
|
/* @__PURE__ */ f(zt, { as: lo, allowPinchZoom: !0, shards: [a.contentRef], children: /* @__PURE__ */ f(
|
|
1171
|
-
|
|
1160
|
+
O.div,
|
|
1172
1161
|
{
|
|
1173
1162
|
"data-state": Ve(a.open),
|
|
1174
1163
|
...o,
|
|
@@ -1198,15 +1187,14 @@ var fo = c.forwardRef(
|
|
|
1198
1187
|
ref: a,
|
|
1199
1188
|
trapFocus: r.open,
|
|
1200
1189
|
disableOutsidePointerEvents: !0,
|
|
1201
|
-
onCloseAutoFocus:
|
|
1202
|
-
|
|
1203
|
-
n.preventDefault(), (s = r.triggerRef.current) == null || s.focus();
|
|
1190
|
+
onCloseAutoFocus: D(e.onCloseAutoFocus, (n) => {
|
|
1191
|
+
n.preventDefault(), r.triggerRef.current?.focus();
|
|
1204
1192
|
}),
|
|
1205
|
-
onPointerDownOutside:
|
|
1193
|
+
onPointerDownOutside: D(e.onPointerDownOutside, (n) => {
|
|
1206
1194
|
const s = n.detail.originalEvent, i = s.button === 0 && s.ctrlKey === !0;
|
|
1207
1195
|
(s.button === 2 || i) && n.preventDefault();
|
|
1208
1196
|
}),
|
|
1209
|
-
onFocusOutside:
|
|
1197
|
+
onFocusOutside: D(
|
|
1210
1198
|
e.onFocusOutside,
|
|
1211
1199
|
(n) => n.preventDefault()
|
|
1212
1200
|
)
|
|
@@ -1224,14 +1212,12 @@ var fo = c.forwardRef(
|
|
|
1224
1212
|
trapFocus: !1,
|
|
1225
1213
|
disableOutsidePointerEvents: !1,
|
|
1226
1214
|
onCloseAutoFocus: (n) => {
|
|
1227
|
-
|
|
1228
|
-
(s = e.onCloseAutoFocus) == null || s.call(e, n), n.defaultPrevented || (o.current || (i = r.triggerRef.current) == null || i.focus(), n.preventDefault()), o.current = !1, a.current = !1;
|
|
1215
|
+
e.onCloseAutoFocus?.(n), n.defaultPrevented || (o.current || r.triggerRef.current?.focus(), n.preventDefault()), o.current = !1, a.current = !1;
|
|
1229
1216
|
},
|
|
1230
1217
|
onInteractOutside: (n) => {
|
|
1231
|
-
|
|
1232
|
-
(u = e.onInteractOutside) == null || u.call(e, n), n.defaultPrevented || (o.current = !0, n.detail.originalEvent.type === "pointerdown" && (a.current = !0));
|
|
1218
|
+
e.onInteractOutside?.(n), n.defaultPrevented || (o.current = !0, n.detail.originalEvent.type === "pointerdown" && (a.current = !0));
|
|
1233
1219
|
const s = n.target;
|
|
1234
|
-
|
|
1220
|
+
r.triggerRef.current?.contains(s) && n.preventDefault(), n.detail.originalEvent.type === "focusin" && a.current && n.preventDefault();
|
|
1235
1221
|
}
|
|
1236
1222
|
}
|
|
1237
1223
|
);
|
|
@@ -1239,7 +1225,7 @@ var fo = c.forwardRef(
|
|
|
1239
1225
|
), rr = c.forwardRef(
|
|
1240
1226
|
(e, t) => {
|
|
1241
1227
|
const { __scopeDialog: r, trapFocus: o, onOpenAutoFocus: a, onCloseAutoFocus: n, ...s } = e, i = I(X, r), u = c.useRef(null), l = $(t, u);
|
|
1242
|
-
return
|
|
1228
|
+
return bn(), /* @__PURE__ */ A(re, { children: [
|
|
1243
1229
|
/* @__PURE__ */ f(
|
|
1244
1230
|
It,
|
|
1245
1231
|
{
|
|
@@ -1263,7 +1249,7 @@ var fo = c.forwardRef(
|
|
|
1263
1249
|
)
|
|
1264
1250
|
}
|
|
1265
1251
|
),
|
|
1266
|
-
/* @__PURE__ */
|
|
1252
|
+
/* @__PURE__ */ A(re, { children: [
|
|
1267
1253
|
/* @__PURE__ */ f(ho, { titleId: i.titleId }),
|
|
1268
1254
|
/* @__PURE__ */ f(mo, { contentRef: u, descriptionId: i.descriptionId })
|
|
1269
1255
|
] })
|
|
@@ -1272,14 +1258,14 @@ var fo = c.forwardRef(
|
|
|
1272
1258
|
), Ye = "DialogTitle", nr = c.forwardRef(
|
|
1273
1259
|
(e, t) => {
|
|
1274
1260
|
const { __scopeDialog: r, ...o } = e, a = I(Ye, r);
|
|
1275
|
-
return /* @__PURE__ */ f(
|
|
1261
|
+
return /* @__PURE__ */ f(O.h2, { id: a.titleId, ...o, ref: t });
|
|
1276
1262
|
}
|
|
1277
1263
|
);
|
|
1278
1264
|
nr.displayName = Ye;
|
|
1279
1265
|
var or = "DialogDescription", ar = c.forwardRef(
|
|
1280
1266
|
(e, t) => {
|
|
1281
1267
|
const { __scopeDialog: r, ...o } = e, a = I(or, r);
|
|
1282
|
-
return /* @__PURE__ */ f(
|
|
1268
|
+
return /* @__PURE__ */ f(O.p, { id: a.descriptionId, ...o, ref: t });
|
|
1283
1269
|
}
|
|
1284
1270
|
);
|
|
1285
1271
|
ar.displayName = or;
|
|
@@ -1287,12 +1273,12 @@ var ir = "DialogClose", sr = c.forwardRef(
|
|
|
1287
1273
|
(e, t) => {
|
|
1288
1274
|
const { __scopeDialog: r, ...o } = e, a = I(ir, r);
|
|
1289
1275
|
return /* @__PURE__ */ f(
|
|
1290
|
-
|
|
1276
|
+
O.button,
|
|
1291
1277
|
{
|
|
1292
1278
|
type: "button",
|
|
1293
1279
|
...o,
|
|
1294
1280
|
ref: t,
|
|
1295
|
-
onClick:
|
|
1281
|
+
onClick: D(e.onClick, () => a.onOpenChange(!1))
|
|
1296
1282
|
}
|
|
1297
1283
|
);
|
|
1298
1284
|
}
|
|
@@ -1317,21 +1303,15 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
1317
1303
|
}, vo = "DialogDescriptionWarning", mo = ({ contentRef: e, descriptionId: t }) => {
|
|
1318
1304
|
const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${lr(vo).contentName}}.`;
|
|
1319
1305
|
return c.useEffect(() => {
|
|
1320
|
-
|
|
1321
|
-
const a = (n = e.current) == null ? void 0 : n.getAttribute("aria-describedby");
|
|
1306
|
+
const a = e.current?.getAttribute("aria-describedby");
|
|
1322
1307
|
t && a && (document.getElementById(t) || console.warn(o));
|
|
1323
1308
|
}, [o, e, t]), null;
|
|
1324
|
-
}, go =
|
|
1309
|
+
}, go = Kt, _o = Zt, yo = Jt, bo = er, wo = tr, he = nr, So = ar, Eo = sr;
|
|
1325
1310
|
const ur = Lr(null);
|
|
1326
1311
|
function Co(e) {
|
|
1327
1312
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1328
1313
|
}
|
|
1329
1314
|
var Le = { exports: {} };
|
|
1330
|
-
/*!
|
|
1331
|
-
Copyright (c) 2018 Jed Watson.
|
|
1332
|
-
Licensed under the MIT License (MIT), see
|
|
1333
|
-
http://jedwatson.github.io/classnames
|
|
1334
|
-
*/
|
|
1335
1315
|
var pt;
|
|
1336
1316
|
function Po() {
|
|
1337
1317
|
return pt || (pt = 1, (function(e) {
|
|
@@ -1366,17 +1346,17 @@ function Po() {
|
|
|
1366
1346
|
})(Le)), Le.exports;
|
|
1367
1347
|
}
|
|
1368
1348
|
var Ro = Po();
|
|
1369
|
-
const ae = /* @__PURE__ */ Co(Ro), No = "_slideUp_71yig_1", xo = "_slideDown_71yig_1",
|
|
1349
|
+
const ae = /* @__PURE__ */ Co(Ro), No = "_slideUp_71yig_1", xo = "_slideDown_71yig_1", Do = "_slideInRight_71yig_1", Ao = "_slideInLeft_71yig_1", Oo = "_slideOutRight_71yig_1", To = "_slideOutLeft_71yig_1", $o = "_fadeIn_71yig_1", Lo = "_fadeOut_71yig_1", Mo = {
|
|
1370
1350
|
"purpur-drawer-content": "_purpur-drawer-content_71yig_1",
|
|
1371
1351
|
slideUp: No,
|
|
1372
1352
|
slideDown: xo,
|
|
1373
1353
|
"purpur-drawer-content--left": "_purpur-drawer-content--left_71yig_21",
|
|
1374
1354
|
"purpur-drawer-content--right": "_purpur-drawer-content--right_71yig_24",
|
|
1375
1355
|
"purpur-drawer-content--fit-to-content": "_purpur-drawer-content--fit-to-content_71yig_27",
|
|
1376
|
-
slideInRight:
|
|
1377
|
-
slideInLeft:
|
|
1378
|
-
slideOutRight:
|
|
1379
|
-
slideOutLeft:
|
|
1356
|
+
slideInRight: Do,
|
|
1357
|
+
slideInLeft: Ao,
|
|
1358
|
+
slideOutRight: Oo,
|
|
1359
|
+
slideOutLeft: To,
|
|
1380
1360
|
"purpur-drawer-content__content-container": "_purpur-drawer-content__content-container_71yig_63",
|
|
1381
1361
|
"purpur-drawer-content__description": "_purpur-drawer-content__description_71yig_68",
|
|
1382
1362
|
"purpur-drawer-overlay": "_purpur-drawer-overlay_71yig_79",
|
|
@@ -1481,13 +1461,7 @@ const Ho = {
|
|
|
1481
1461
|
function Yo(e) {
|
|
1482
1462
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1483
1463
|
}
|
|
1484
|
-
var vt = { exports: {} };
|
|
1485
|
-
/*!
|
|
1486
|
-
Copyright (c) 2018 Jed Watson.
|
|
1487
|
-
Licensed under the MIT License (MIT), see
|
|
1488
|
-
http://jedwatson.github.io/classnames
|
|
1489
|
-
*/
|
|
1490
|
-
var mt;
|
|
1464
|
+
var vt = { exports: {} }, mt;
|
|
1491
1465
|
function Vo() {
|
|
1492
1466
|
return mt || (mt = 1, (function(e) {
|
|
1493
1467
|
(function() {
|
|
@@ -1521,7 +1495,7 @@ function Vo() {
|
|
|
1521
1495
|
})(vt)), vt.exports;
|
|
1522
1496
|
}
|
|
1523
1497
|
var zo = Vo();
|
|
1524
|
-
const Xo = /* @__PURE__ */ Yo(zo), qo = "_rotate_12t9p_1",
|
|
1498
|
+
const Xo = /* @__PURE__ */ Yo(zo), qo = "_rotate_12t9p_1", Ko = "_dash_12t9p_1", Go = {
|
|
1525
1499
|
"purpur-spinner": "_purpur-spinner_12t9p_2",
|
|
1526
1500
|
rotate: qo,
|
|
1527
1501
|
"purpur-spinner--xxs": "_purpur-spinner--xxs_12t9p_6",
|
|
@@ -1530,10 +1504,10 @@ const Xo = /* @__PURE__ */ Yo(zo), qo = "_rotate_12t9p_1", Go = "_dash_12t9p_1",
|
|
|
1530
1504
|
"purpur-spinner--md": "_purpur-spinner--md_12t9p_18",
|
|
1531
1505
|
"purpur-spinner--lg": "_purpur-spinner--lg_12t9p_22",
|
|
1532
1506
|
"purpur-spinner__circle": "_purpur-spinner__circle_12t9p_26",
|
|
1533
|
-
dash:
|
|
1507
|
+
dash: Ko,
|
|
1534
1508
|
"purpur-spinner__circle--disabled": "_purpur-spinner__circle--disabled_12t9p_41",
|
|
1535
1509
|
"purpur-spinner__circle--negative": "_purpur-spinner__circle--negative_12t9p_44"
|
|
1536
|
-
}, gt = Xo.bind(
|
|
1510
|
+
}, gt = Xo.bind(Go), ie = "purpur-spinner", Zo = {
|
|
1537
1511
|
SM: "sm"
|
|
1538
1512
|
}, fr = ({
|
|
1539
1513
|
disabled: e = !1,
|
|
@@ -1557,15 +1531,9 @@ fr.displayName = "Spinner";
|
|
|
1557
1531
|
function Qo(e) {
|
|
1558
1532
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1559
1533
|
}
|
|
1560
|
-
var _t = { exports: {} };
|
|
1561
|
-
/*!
|
|
1562
|
-
Copyright (c) 2018 Jed Watson.
|
|
1563
|
-
Licensed under the MIT License (MIT), see
|
|
1564
|
-
http://jedwatson.github.io/classnames
|
|
1565
|
-
*/
|
|
1566
|
-
var bt;
|
|
1534
|
+
var _t = { exports: {} }, yt;
|
|
1567
1535
|
function Jo() {
|
|
1568
|
-
return
|
|
1536
|
+
return yt || (yt = 1, (function(e) {
|
|
1569
1537
|
(function() {
|
|
1570
1538
|
var t = {}.hasOwnProperty;
|
|
1571
1539
|
function r() {
|
|
@@ -1623,7 +1591,7 @@ const ta = /* @__PURE__ */ Qo(ea), ra = {
|
|
|
1623
1591
|
}, Ie = {
|
|
1624
1592
|
TERTIARY_PURPLE: "tertiary-purple",
|
|
1625
1593
|
TEXT: "text"
|
|
1626
|
-
},
|
|
1594
|
+
}, bt = ta.bind(ra), U = "purpur-button", je = Y(
|
|
1627
1595
|
({
|
|
1628
1596
|
children: e,
|
|
1629
1597
|
className: t,
|
|
@@ -1640,7 +1608,7 @@ const ta = /* @__PURE__ */ Qo(ea), ra = {
|
|
|
1640
1608
|
}, h) => {
|
|
1641
1609
|
if (a && l === "destructive")
|
|
1642
1610
|
return null;
|
|
1643
|
-
const m =
|
|
1611
|
+
const m = bt(
|
|
1644
1612
|
[
|
|
1645
1613
|
U,
|
|
1646
1614
|
`${U}--${s ? `${l}-negative` : l}`,
|
|
@@ -1656,7 +1624,7 @@ const ta = /* @__PURE__ */ Qo(ea), ra = {
|
|
|
1656
1624
|
), _ = (g) => {
|
|
1657
1625
|
r || n ? g.preventDefault() : i && i(g);
|
|
1658
1626
|
}, v = !!p["aria-disabled"] || r || n;
|
|
1659
|
-
return /* @__PURE__ */
|
|
1627
|
+
return /* @__PURE__ */ A(
|
|
1660
1628
|
"button",
|
|
1661
1629
|
{
|
|
1662
1630
|
className: m,
|
|
@@ -1672,7 +1640,7 @@ const ta = /* @__PURE__ */ Qo(ea), ra = {
|
|
|
1672
1640
|
size: u === Ho.LG ? "xs" : "xxs",
|
|
1673
1641
|
negative: s,
|
|
1674
1642
|
disabled: v,
|
|
1675
|
-
className:
|
|
1643
|
+
className: bt(`${U}__spinner`)
|
|
1676
1644
|
}
|
|
1677
1645
|
),
|
|
1678
1646
|
" ",
|
|
@@ -1686,13 +1654,7 @@ je.displayName = "Button";
|
|
|
1686
1654
|
function na(e) {
|
|
1687
1655
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1688
1656
|
}
|
|
1689
|
-
var wt = { exports: {} };
|
|
1690
|
-
/*!
|
|
1691
|
-
Copyright (c) 2018 Jed Watson.
|
|
1692
|
-
Licensed under the MIT License (MIT), see
|
|
1693
|
-
http://jedwatson.github.io/classnames
|
|
1694
|
-
*/
|
|
1695
|
-
var St;
|
|
1657
|
+
var wt = { exports: {} }, St;
|
|
1696
1658
|
function oa() {
|
|
1697
1659
|
return St || (St = 1, (function(e) {
|
|
1698
1660
|
(function() {
|
|
@@ -1774,13 +1736,7 @@ Ue.displayName = "Heading";
|
|
|
1774
1736
|
function ca(e) {
|
|
1775
1737
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1776
1738
|
}
|
|
1777
|
-
var Ct = { exports: {} };
|
|
1778
|
-
/*!
|
|
1779
|
-
Copyright (c) 2018 Jed Watson.
|
|
1780
|
-
Licensed under the MIT License (MIT), see
|
|
1781
|
-
http://jedwatson.github.io/classnames
|
|
1782
|
-
*/
|
|
1783
|
-
var Pt;
|
|
1739
|
+
var Ct = { exports: {} }, Pt;
|
|
1784
1740
|
function la() {
|
|
1785
1741
|
return Pt || (Pt = 1, (function(e) {
|
|
1786
1742
|
(function() {
|
|
@@ -1845,19 +1801,19 @@ const _a = {
|
|
|
1845
1801
|
category: "utility"
|
|
1846
1802
|
}, pr = (e) => /* @__PURE__ */ f(ze, { ...e, svg: _a });
|
|
1847
1803
|
pr.displayName = "IconChevronLeft";
|
|
1848
|
-
const
|
|
1804
|
+
const ya = {
|
|
1849
1805
|
name: "close",
|
|
1850
1806
|
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>',
|
|
1851
1807
|
keywords: ["close"],
|
|
1852
1808
|
category: "utility"
|
|
1853
|
-
}, hr = (e) => /* @__PURE__ */ f(ze, { ...e, svg:
|
|
1809
|
+
}, hr = (e) => /* @__PURE__ */ f(ze, { ...e, svg: ya });
|
|
1854
1810
|
hr.displayName = "IconClose";
|
|
1855
1811
|
function Nt(e, t) {
|
|
1856
1812
|
if (typeof e == "function")
|
|
1857
1813
|
return e(t);
|
|
1858
1814
|
e != null && (e.current = t);
|
|
1859
1815
|
}
|
|
1860
|
-
function
|
|
1816
|
+
function ba(...e) {
|
|
1861
1817
|
return (t) => {
|
|
1862
1818
|
let r = !1;
|
|
1863
1819
|
const o = e.map((a) => {
|
|
@@ -1891,7 +1847,7 @@ function Sa(e) {
|
|
|
1891
1847
|
const { children: a, ...n } = r;
|
|
1892
1848
|
if (c.isValidElement(a)) {
|
|
1893
1849
|
const s = Ra(a), i = Pa(n, a.props);
|
|
1894
|
-
return a.type !== c.Fragment && (i.ref = o ?
|
|
1850
|
+
return a.type !== c.Fragment && (i.ref = o ? ba(o, s) : s), c.cloneElement(a, i);
|
|
1895
1851
|
}
|
|
1896
1852
|
return c.Children.count(a) > 1 ? c.Children.only(null) : null;
|
|
1897
1853
|
});
|
|
@@ -1912,9 +1868,8 @@ function Pa(e, t) {
|
|
|
1912
1868
|
return { ...e, ...r };
|
|
1913
1869
|
}
|
|
1914
1870
|
function Ra(e) {
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
return a ? e.ref : (o = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, a = o && "isReactWarning" in o && o.isReactWarning, a ? e.props.ref : e.props.ref || e.ref);
|
|
1871
|
+
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning;
|
|
1872
|
+
return r ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
|
|
1918
1873
|
}
|
|
1919
1874
|
var Na = [
|
|
1920
1875
|
"a",
|
|
@@ -1939,7 +1894,7 @@ var Na = [
|
|
|
1939
1894
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(u, { ...i, ref: n });
|
|
1940
1895
|
});
|
|
1941
1896
|
return o.displayName = `Primitive.${t}`, { ...e, [t]: o };
|
|
1942
|
-
}, {}),
|
|
1897
|
+
}, {}), Da = "VisuallyHidden", vr = c.forwardRef(
|
|
1943
1898
|
(e, t) => /* @__PURE__ */ f(
|
|
1944
1899
|
xa.span,
|
|
1945
1900
|
{
|
|
@@ -1962,9 +1917,9 @@ var Na = [
|
|
|
1962
1917
|
}
|
|
1963
1918
|
)
|
|
1964
1919
|
);
|
|
1965
|
-
vr.displayName =
|
|
1966
|
-
var
|
|
1967
|
-
const xt = ({ asChild: e, children: t, ...r }) => /* @__PURE__ */ f(
|
|
1920
|
+
vr.displayName = Da;
|
|
1921
|
+
var Aa = vr;
|
|
1922
|
+
const xt = ({ asChild: e, children: t, ...r }) => /* @__PURE__ */ f(Aa, { asChild: e, ...r, children: t }), Oa = {
|
|
1968
1923
|
"purpur-drawer-header": "_purpur-drawer-header_1iujy_1",
|
|
1969
1924
|
"purpur-drawer-header__row": "_purpur-drawer-header__row_1iujy_4",
|
|
1970
1925
|
"purpur-drawer-header__row--with-back-button": "_purpur-drawer-header__row--with-back-button_1iujy_7",
|
|
@@ -1972,7 +1927,7 @@ const xt = ({ asChild: e, children: t, ...r }) => /* @__PURE__ */ f(Da, { asChil
|
|
|
1972
1927
|
"purpur-drawer-header__right": "_purpur-drawer-header__right_1iujy_13",
|
|
1973
1928
|
"purpur-drawer-header__close-button": "_purpur-drawer-header__close-button_1iujy_16",
|
|
1974
1929
|
"purpur-drawer-header__back-button--only-icon": "_purpur-drawer-header__back-button--only-icon_1iujy_27"
|
|
1975
|
-
}, Z = ae.bind(
|
|
1930
|
+
}, Z = ae.bind(Oa), B = "purpur-drawer-header", mr = Y(
|
|
1976
1931
|
({
|
|
1977
1932
|
["data-testid"]: e = "purpur-drawer-header",
|
|
1978
1933
|
backButton: t,
|
|
@@ -1986,8 +1941,8 @@ const xt = ({ asChild: e, children: t, ...r }) => /* @__PURE__ */ f(Da, { asChil
|
|
|
1986
1941
|
...l
|
|
1987
1942
|
}, d) => {
|
|
1988
1943
|
const p = Z([B, a]), h = !!(t && r && i);
|
|
1989
|
-
return /* @__PURE__ */
|
|
1990
|
-
/* @__PURE__ */
|
|
1944
|
+
return /* @__PURE__ */ A("div", { className: p, "data-testid": e, ref: d, ...l, children: [
|
|
1945
|
+
/* @__PURE__ */ A(
|
|
1991
1946
|
"div",
|
|
1992
1947
|
{
|
|
1993
1948
|
className: Z([
|
|
@@ -1998,7 +1953,7 @@ const xt = ({ asChild: e, children: t, ...r }) => /* @__PURE__ */ f(Da, { asChil
|
|
|
1998
1953
|
]),
|
|
1999
1954
|
"data-testid": `${e}-row`,
|
|
2000
1955
|
children: [
|
|
2001
|
-
/* @__PURE__ */ f("div", { className: Z(`${B}__left`), children: h ? /* @__PURE__ */
|
|
1956
|
+
/* @__PURE__ */ f("div", { className: Z(`${B}__left`), children: h ? /* @__PURE__ */ A(
|
|
2002
1957
|
je,
|
|
2003
1958
|
{
|
|
2004
1959
|
"aria-label": o ? r : "",
|
|
@@ -2018,7 +1973,7 @@ const xt = ({ asChild: e, children: t, ...r }) => /* @__PURE__ */ f(Da, { asChil
|
|
|
2018
1973
|
!o && r
|
|
2019
1974
|
]
|
|
2020
1975
|
}
|
|
2021
|
-
) : s ? /* @__PURE__ */
|
|
1976
|
+
) : s ? /* @__PURE__ */ A(re, { children: [
|
|
2022
1977
|
s,
|
|
2023
1978
|
/* @__PURE__ */ f(xt, { asChild: !0, children: /* @__PURE__ */ f(he, { children: u }) })
|
|
2024
1979
|
] }) : /* @__PURE__ */ f(he, { asChild: !0, children: /* @__PURE__ */ f(
|
|
@@ -2045,7 +2000,7 @@ const xt = ({ asChild: e, children: t, ...r }) => /* @__PURE__ */ f(Da, { asChil
|
|
|
2045
2000
|
]
|
|
2046
2001
|
}
|
|
2047
2002
|
),
|
|
2048
|
-
h && (s ? /* @__PURE__ */
|
|
2003
|
+
h && (s ? /* @__PURE__ */ A(re, { children: [
|
|
2049
2004
|
s,
|
|
2050
2005
|
/* @__PURE__ */ f(xt, { asChild: !0, children: /* @__PURE__ */ f(he, { children: u }) })
|
|
2051
2006
|
] }) : /* @__PURE__ */ f(he, { asChild: !0, children: /* @__PURE__ */ f(
|
|
@@ -2062,9 +2017,9 @@ const xt = ({ asChild: e, children: t, ...r }) => /* @__PURE__ */ f(Da, { asChil
|
|
|
2062
2017
|
}
|
|
2063
2018
|
);
|
|
2064
2019
|
mr.displayName = "DrawerHeader";
|
|
2065
|
-
var
|
|
2020
|
+
var Ta = c.createContext(void 0);
|
|
2066
2021
|
function $a(e) {
|
|
2067
|
-
const t = c.useContext(
|
|
2022
|
+
const t = c.useContext(Ta);
|
|
2068
2023
|
return e || t || "ltr";
|
|
2069
2024
|
}
|
|
2070
2025
|
function La(e, [t, r]) {
|
|
@@ -2073,7 +2028,7 @@ function La(e, [t, r]) {
|
|
|
2073
2028
|
function Ma(e, t) {
|
|
2074
2029
|
return c.useReducer((r, o) => t[r][o] ?? r, e);
|
|
2075
2030
|
}
|
|
2076
|
-
var Xe = "ScrollArea", [gr] =
|
|
2031
|
+
var Xe = "ScrollArea", [gr] = Ot(Xe), [Ia, M] = gr(Xe), _r = c.forwardRef(
|
|
2077
2032
|
(e, t) => {
|
|
2078
2033
|
const {
|
|
2079
2034
|
__scopeScrollArea: r,
|
|
@@ -2081,7 +2036,7 @@ var Xe = "ScrollArea", [gr] = Tt(Xe), [Ia, M] = gr(Xe), _r = c.forwardRef(
|
|
|
2081
2036
|
dir: a,
|
|
2082
2037
|
scrollHideDelay: n = 600,
|
|
2083
2038
|
...s
|
|
2084
|
-
} = e, [i, u] = c.useState(null), [l, d] = c.useState(null), [p, h] = c.useState(null), [m, _] = c.useState(null), [v, g] = c.useState(null), [
|
|
2039
|
+
} = e, [i, u] = c.useState(null), [l, d] = c.useState(null), [p, h] = c.useState(null), [m, _] = c.useState(null), [v, g] = c.useState(null), [y, b] = c.useState(0), [E, w] = c.useState(0), [C, R] = c.useState(!1), [S, x] = c.useState(!1), P = $(t, (F) => u(F)), N = $a(a);
|
|
2085
2040
|
return /* @__PURE__ */ f(
|
|
2086
2041
|
Ia,
|
|
2087
2042
|
{
|
|
@@ -2102,10 +2057,10 @@ var Xe = "ScrollArea", [gr] = Tt(Xe), [Ia, M] = gr(Xe), _r = c.forwardRef(
|
|
|
2102
2057
|
onScrollbarYChange: g,
|
|
2103
2058
|
scrollbarYEnabled: S,
|
|
2104
2059
|
onScrollbarYEnabledChange: x,
|
|
2105
|
-
onCornerWidthChange:
|
|
2060
|
+
onCornerWidthChange: b,
|
|
2106
2061
|
onCornerHeightChange: w,
|
|
2107
2062
|
children: /* @__PURE__ */ f(
|
|
2108
|
-
|
|
2063
|
+
O.div,
|
|
2109
2064
|
{
|
|
2110
2065
|
dir: N,
|
|
2111
2066
|
...s,
|
|
@@ -2113,7 +2068,7 @@ var Xe = "ScrollArea", [gr] = Tt(Xe), [Ia, M] = gr(Xe), _r = c.forwardRef(
|
|
|
2113
2068
|
style: {
|
|
2114
2069
|
position: "relative",
|
|
2115
2070
|
// Pass corner sizes as CSS vars to reduce re-renders of context consumers
|
|
2116
|
-
"--radix-scroll-area-corner-width":
|
|
2071
|
+
"--radix-scroll-area-corner-width": y + "px",
|
|
2117
2072
|
"--radix-scroll-area-corner-height": E + "px",
|
|
2118
2073
|
...e.style
|
|
2119
2074
|
}
|
|
@@ -2124,10 +2079,10 @@ var Xe = "ScrollArea", [gr] = Tt(Xe), [Ia, M] = gr(Xe), _r = c.forwardRef(
|
|
|
2124
2079
|
}
|
|
2125
2080
|
);
|
|
2126
2081
|
_r.displayName = Xe;
|
|
2127
|
-
var
|
|
2082
|
+
var yr = "ScrollAreaViewport", br = c.forwardRef(
|
|
2128
2083
|
(e, t) => {
|
|
2129
|
-
const { __scopeScrollArea: r, children: o, nonce: a, ...n } = e, s = M(
|
|
2130
|
-
return /* @__PURE__ */
|
|
2084
|
+
const { __scopeScrollArea: r, children: o, nonce: a, ...n } = e, s = M(yr, r), i = c.useRef(null), u = $(t, i, s.onViewportChange);
|
|
2085
|
+
return /* @__PURE__ */ A(re, { children: [
|
|
2131
2086
|
/* @__PURE__ */ f(
|
|
2132
2087
|
"style",
|
|
2133
2088
|
{
|
|
@@ -2138,7 +2093,7 @@ var br = "ScrollAreaViewport", yr = c.forwardRef(
|
|
|
2138
2093
|
}
|
|
2139
2094
|
),
|
|
2140
2095
|
/* @__PURE__ */ f(
|
|
2141
|
-
|
|
2096
|
+
O.div,
|
|
2142
2097
|
{
|
|
2143
2098
|
"data-radix-scroll-area-viewport": "",
|
|
2144
2099
|
...n,
|
|
@@ -2165,7 +2120,7 @@ var br = "ScrollAreaViewport", yr = c.forwardRef(
|
|
|
2165
2120
|
] });
|
|
2166
2121
|
}
|
|
2167
2122
|
);
|
|
2168
|
-
|
|
2123
|
+
br.displayName = yr;
|
|
2169
2124
|
var W = "ScrollAreaScrollbar", wr = c.forwardRef(
|
|
2170
2125
|
(e, t) => {
|
|
2171
2126
|
const { forceMount: r, ...o } = e, a = M(W, e.__scopeScrollArea), { onScrollbarXEnabledChange: n, onScrollbarYEnabledChange: s } = a, i = e.orientation === "horizontal";
|
|
@@ -2238,8 +2193,8 @@ var ka = c.forwardRef((e, t) => {
|
|
|
2238
2193
|
"data-state": i === "hidden" ? "hidden" : "visible",
|
|
2239
2194
|
...o,
|
|
2240
2195
|
ref: t,
|
|
2241
|
-
onPointerEnter:
|
|
2242
|
-
onPointerLeave:
|
|
2196
|
+
onPointerEnter: D(e.onPointerEnter, () => u("POINTER_ENTER")),
|
|
2197
|
+
onPointerLeave: D(e.onPointerLeave, () => u("POINTER_LEAVE"))
|
|
2243
2198
|
}
|
|
2244
2199
|
) });
|
|
2245
2200
|
}), Sr = c.forwardRef((e, t) => {
|
|
@@ -2281,7 +2236,7 @@ var ka = c.forwardRef((e, t) => {
|
|
|
2281
2236
|
ref: t,
|
|
2282
2237
|
onThumbPositionChange: () => {
|
|
2283
2238
|
if (a.viewport && n.current) {
|
|
2284
|
-
const h = a.viewport.scrollLeft, m =
|
|
2239
|
+
const h = a.viewport.scrollLeft, m = Dt(h, i, a.dir);
|
|
2285
2240
|
n.current.style.transform = `translate3d(${m}px, 0, 0)`;
|
|
2286
2241
|
}
|
|
2287
2242
|
},
|
|
@@ -2299,7 +2254,7 @@ var ka = c.forwardRef((e, t) => {
|
|
|
2299
2254
|
ref: t,
|
|
2300
2255
|
onThumbPositionChange: () => {
|
|
2301
2256
|
if (a.viewport && n.current) {
|
|
2302
|
-
const h = a.viewport.scrollTop, m =
|
|
2257
|
+
const h = a.viewport.scrollTop, m = Dt(h, i);
|
|
2303
2258
|
n.current.style.transform = `translate3d(0, ${m}px, 0)`;
|
|
2304
2259
|
}
|
|
2305
2260
|
},
|
|
@@ -2403,17 +2358,17 @@ var ka = c.forwardRef((e, t) => {
|
|
|
2403
2358
|
onWheelScroll: d,
|
|
2404
2359
|
onResize: p,
|
|
2405
2360
|
...h
|
|
2406
|
-
} = e, m = M(W, r), [_, v] = c.useState(null), g = $(t, (P) => v(P)),
|
|
2361
|
+
} = e, m = M(W, r), [_, v] = c.useState(null), g = $(t, (P) => v(P)), y = c.useRef(null), b = c.useRef(""), E = m.viewport, w = o.content - o.viewport, C = L(d), R = L(u), S = Pe(p, 10);
|
|
2407
2362
|
function x(P) {
|
|
2408
|
-
if (
|
|
2409
|
-
const N = P.clientX -
|
|
2363
|
+
if (y.current) {
|
|
2364
|
+
const N = P.clientX - y.current.left, F = P.clientY - y.current.top;
|
|
2410
2365
|
l({ x: N, y: F });
|
|
2411
2366
|
}
|
|
2412
2367
|
}
|
|
2413
2368
|
return c.useEffect(() => {
|
|
2414
2369
|
const P = (N) => {
|
|
2415
2370
|
const F = N.target;
|
|
2416
|
-
|
|
2371
|
+
_?.contains(F) && C(N, w);
|
|
2417
2372
|
};
|
|
2418
2373
|
return document.addEventListener("wheel", P, { passive: !1 }), () => document.removeEventListener("wheel", P, { passive: !1 });
|
|
2419
2374
|
}, [E, _, w, C]), c.useEffect(R, [o, R]), oe(_, S), oe(m.content, S), /* @__PURE__ */ f(
|
|
@@ -2427,31 +2382,31 @@ var ka = c.forwardRef((e, t) => {
|
|
|
2427
2382
|
onThumbPositionChange: R,
|
|
2428
2383
|
onThumbPointerDown: L(i),
|
|
2429
2384
|
children: /* @__PURE__ */ f(
|
|
2430
|
-
|
|
2385
|
+
O.div,
|
|
2431
2386
|
{
|
|
2432
2387
|
...h,
|
|
2433
2388
|
ref: g,
|
|
2434
2389
|
style: { position: "absolute", ...h.style },
|
|
2435
|
-
onPointerDown:
|
|
2436
|
-
P.button === 0 && (P.target.setPointerCapture(P.pointerId),
|
|
2390
|
+
onPointerDown: D(e.onPointerDown, (P) => {
|
|
2391
|
+
P.button === 0 && (P.target.setPointerCapture(P.pointerId), y.current = _.getBoundingClientRect(), b.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", m.viewport && (m.viewport.style.scrollBehavior = "auto"), x(P));
|
|
2437
2392
|
}),
|
|
2438
|
-
onPointerMove:
|
|
2439
|
-
onPointerUp:
|
|
2393
|
+
onPointerMove: D(e.onPointerMove, x),
|
|
2394
|
+
onPointerUp: D(e.onPointerUp, (P) => {
|
|
2440
2395
|
const N = P.target;
|
|
2441
|
-
N.hasPointerCapture(P.pointerId) && N.releasePointerCapture(P.pointerId), document.body.style.webkitUserSelect =
|
|
2396
|
+
N.hasPointerCapture(P.pointerId) && N.releasePointerCapture(P.pointerId), document.body.style.webkitUserSelect = b.current, m.viewport && (m.viewport.style.scrollBehavior = ""), y.current = null;
|
|
2442
2397
|
})
|
|
2443
2398
|
}
|
|
2444
2399
|
)
|
|
2445
2400
|
}
|
|
2446
2401
|
);
|
|
2447
|
-
}),
|
|
2402
|
+
}), be = "ScrollAreaThumb", Pr = c.forwardRef(
|
|
2448
2403
|
(e, t) => {
|
|
2449
|
-
const { forceMount: r, ...o } = e, a = Er(
|
|
2404
|
+
const { forceMount: r, ...o } = e, a = Er(be, e.__scopeScrollArea);
|
|
2450
2405
|
return /* @__PURE__ */ f(V, { present: r || a.hasThumb, children: /* @__PURE__ */ f(Ba, { ref: t, ...o }) });
|
|
2451
2406
|
}
|
|
2452
2407
|
), Ba = c.forwardRef(
|
|
2453
2408
|
(e, t) => {
|
|
2454
|
-
const { __scopeScrollArea: r, style: o, ...a } = e, n = M(
|
|
2409
|
+
const { __scopeScrollArea: r, style: o, ...a } = e, n = M(be, r), s = Er(be, r), { onThumbPositionChange: i } = s, u = $(
|
|
2455
2410
|
t,
|
|
2456
2411
|
(p) => s.onThumbChange(p)
|
|
2457
2412
|
), l = c.useRef(void 0), d = Pe(() => {
|
|
@@ -2469,7 +2424,7 @@ var ka = c.forwardRef((e, t) => {
|
|
|
2469
2424
|
return i(), p.addEventListener("scroll", h), () => p.removeEventListener("scroll", h);
|
|
2470
2425
|
}
|
|
2471
2426
|
}, [n.viewport, d, i]), /* @__PURE__ */ f(
|
|
2472
|
-
|
|
2427
|
+
O.div,
|
|
2473
2428
|
{
|
|
2474
2429
|
"data-state": s.hasThumb ? "visible" : "hidden",
|
|
2475
2430
|
...a,
|
|
@@ -2479,35 +2434,33 @@ var ka = c.forwardRef((e, t) => {
|
|
|
2479
2434
|
height: "var(--radix-scroll-area-thumb-height)",
|
|
2480
2435
|
...o
|
|
2481
2436
|
},
|
|
2482
|
-
onPointerDownCapture:
|
|
2437
|
+
onPointerDownCapture: D(e.onPointerDownCapture, (p) => {
|
|
2483
2438
|
const m = p.target.getBoundingClientRect(), _ = p.clientX - m.left, v = p.clientY - m.top;
|
|
2484
2439
|
s.onThumbPointerDown({ x: _, y: v });
|
|
2485
2440
|
}),
|
|
2486
|
-
onPointerUp:
|
|
2441
|
+
onPointerUp: D(e.onPointerUp, s.onThumbPointerUp)
|
|
2487
2442
|
}
|
|
2488
2443
|
);
|
|
2489
2444
|
}
|
|
2490
2445
|
);
|
|
2491
|
-
Pr.displayName =
|
|
2492
|
-
var
|
|
2446
|
+
Pr.displayName = be;
|
|
2447
|
+
var Ke = "ScrollAreaCorner", Ha = c.forwardRef(
|
|
2493
2448
|
(e, t) => {
|
|
2494
|
-
const r = M(
|
|
2449
|
+
const r = M(Ke, e.__scopeScrollArea), o = !!(r.scrollbarX && r.scrollbarY);
|
|
2495
2450
|
return r.type !== "scroll" && o ? /* @__PURE__ */ f(Ya, { ...e, ref: t }) : null;
|
|
2496
2451
|
}
|
|
2497
2452
|
);
|
|
2498
|
-
Ha.displayName =
|
|
2453
|
+
Ha.displayName = Ke;
|
|
2499
2454
|
var Ya = c.forwardRef((e, t) => {
|
|
2500
|
-
const { __scopeScrollArea: r, ...o } = e, a = M(
|
|
2455
|
+
const { __scopeScrollArea: r, ...o } = e, a = M(Ke, r), [n, s] = c.useState(0), [i, u] = c.useState(0), l = !!(n && i);
|
|
2501
2456
|
return oe(a.scrollbarX, () => {
|
|
2502
|
-
|
|
2503
|
-
const d = ((p = a.scrollbarX) == null ? void 0 : p.offsetHeight) || 0;
|
|
2457
|
+
const d = a.scrollbarX?.offsetHeight || 0;
|
|
2504
2458
|
a.onCornerHeightChange(d), u(d);
|
|
2505
2459
|
}), oe(a.scrollbarY, () => {
|
|
2506
|
-
|
|
2507
|
-
const d = ((p = a.scrollbarY) == null ? void 0 : p.offsetWidth) || 0;
|
|
2460
|
+
const d = a.scrollbarY?.offsetWidth || 0;
|
|
2508
2461
|
a.onCornerWidthChange(d), s(d);
|
|
2509
2462
|
}), l ? /* @__PURE__ */ f(
|
|
2510
|
-
|
|
2463
|
+
O.div,
|
|
2511
2464
|
{
|
|
2512
2465
|
...o,
|
|
2513
2466
|
ref: t,
|
|
@@ -2538,7 +2491,7 @@ function Va(e, t, r, o = "ltr") {
|
|
|
2538
2491
|
const a = Ce(r), n = a / 2, s = t || n, i = a - s, u = r.scrollbar.paddingStart + s, l = r.scrollbar.size - r.scrollbar.paddingEnd - i, d = r.content - r.viewport, p = o === "ltr" ? [0, d] : [d * -1, 0];
|
|
2539
2492
|
return Nr([u, l], p)(e);
|
|
2540
2493
|
}
|
|
2541
|
-
function
|
|
2494
|
+
function Dt(e, t, r = "ltr") {
|
|
2542
2495
|
const o = Ce(t), a = t.scrollbar.paddingStart + t.scrollbar.paddingEnd, n = t.scrollbar.size - a, s = t.content - t.viewport, i = n - o, u = r === "ltr" ? [0, s] : [s * -1, 0], l = La(e, u);
|
|
2543
2496
|
return Nr([0, s], [0, i])(l);
|
|
2544
2497
|
}
|
|
@@ -2580,7 +2533,7 @@ function oe(e, t) {
|
|
|
2580
2533
|
}
|
|
2581
2534
|
}, [e, r]);
|
|
2582
2535
|
}
|
|
2583
|
-
var Xa = _r, qa =
|
|
2536
|
+
var Xa = _r, qa = br, Ka = wr, Ga = Pr;
|
|
2584
2537
|
const Za = {
|
|
2585
2538
|
"purpur-drawer-scroll-area__root": "_purpur-drawer-scroll-area__root_1hyos_1",
|
|
2586
2539
|
"purpur-drawer-scroll-area__root--fit-to-content": "_purpur-drawer-scroll-area__root--fit-to-content_1hyos_4",
|
|
@@ -2596,7 +2549,7 @@ const Za = {
|
|
|
2596
2549
|
...a
|
|
2597
2550
|
}, n) => {
|
|
2598
2551
|
const s = se([Q, r]);
|
|
2599
|
-
return /* @__PURE__ */ f("div", { className: s, "data-testid": e, ref: n, ...a, children: /* @__PURE__ */
|
|
2552
|
+
return /* @__PURE__ */ f("div", { className: s, "data-testid": e, ref: n, ...a, children: /* @__PURE__ */ A(
|
|
2600
2553
|
Xa,
|
|
2601
2554
|
{
|
|
2602
2555
|
className: se(`${Q}__root`, {
|
|
@@ -2605,11 +2558,11 @@ const Za = {
|
|
|
2605
2558
|
children: [
|
|
2606
2559
|
/* @__PURE__ */ f(qa, { className: se(`${Q}__viewport`), children: t }),
|
|
2607
2560
|
/* @__PURE__ */ f(
|
|
2608
|
-
|
|
2561
|
+
Ka,
|
|
2609
2562
|
{
|
|
2610
2563
|
className: se(`${Q}__scrollbar`),
|
|
2611
2564
|
orientation: "vertical",
|
|
2612
|
-
children: /* @__PURE__ */ f(
|
|
2565
|
+
children: /* @__PURE__ */ f(Ga, { className: se(`${Q}__thumb`) })
|
|
2613
2566
|
}
|
|
2614
2567
|
)
|
|
2615
2568
|
]
|
|
@@ -2618,7 +2571,7 @@ const Za = {
|
|
|
2618
2571
|
}
|
|
2619
2572
|
);
|
|
2620
2573
|
Be.displayName = "DrawerScrollArea";
|
|
2621
|
-
const J = ae.bind(Wo),
|
|
2574
|
+
const J = ae.bind(Wo), T = "purpur-drawer-frame", Dr = Y(
|
|
2622
2575
|
({
|
|
2623
2576
|
["data-testid"]: e = "purpur-drawer-frame",
|
|
2624
2577
|
backButton: t,
|
|
@@ -2637,22 +2590,22 @@ const J = ae.bind(Wo), O = "purpur-drawer-frame", Ar = Y(
|
|
|
2637
2590
|
onSwipeEnd: _,
|
|
2638
2591
|
title: v,
|
|
2639
2592
|
stickyFooter: g,
|
|
2640
|
-
position:
|
|
2641
|
-
...
|
|
2593
|
+
position: y = "right",
|
|
2594
|
+
...b
|
|
2642
2595
|
}, E) => {
|
|
2643
2596
|
const w = !!(t && r && d), C = J([
|
|
2644
|
-
|
|
2597
|
+
T,
|
|
2645
2598
|
{
|
|
2646
|
-
[`${
|
|
2647
|
-
[`${
|
|
2648
|
-
[`${
|
|
2649
|
-
[`${
|
|
2650
|
-
[`${
|
|
2651
|
-
[`${
|
|
2599
|
+
[`${T}--fit-to-content`]: i,
|
|
2600
|
+
[`${T}--sticky-footer`]: g,
|
|
2601
|
+
[`${T}--left`]: y === "left",
|
|
2602
|
+
[`${T}--right`]: y === "right",
|
|
2603
|
+
[`${T}--without-back-button`]: !w,
|
|
2604
|
+
[`${T}--with-back-button`]: w
|
|
2652
2605
|
},
|
|
2653
2606
|
n
|
|
2654
2607
|
]);
|
|
2655
|
-
return /* @__PURE__ */
|
|
2608
|
+
return /* @__PURE__ */ A("div", { className: C, "data-testid": e, ref: E, ...b, children: [
|
|
2656
2609
|
/* @__PURE__ */ f(
|
|
2657
2610
|
dr,
|
|
2658
2611
|
{
|
|
@@ -2665,7 +2618,7 @@ const J = ae.bind(Wo), O = "purpur-drawer-frame", Ar = Y(
|
|
|
2665
2618
|
/* @__PURE__ */ f(
|
|
2666
2619
|
ee,
|
|
2667
2620
|
{
|
|
2668
|
-
className: J(`${
|
|
2621
|
+
className: J(`${T}__header`),
|
|
2669
2622
|
variant: "header",
|
|
2670
2623
|
stickyFooter: g,
|
|
2671
2624
|
children: /* @__PURE__ */ f(
|
|
@@ -2682,11 +2635,11 @@ const J = ae.bind(Wo), O = "purpur-drawer-frame", Ar = Y(
|
|
|
2682
2635
|
)
|
|
2683
2636
|
}
|
|
2684
2637
|
),
|
|
2685
|
-
g ? /* @__PURE__ */
|
|
2638
|
+
g ? /* @__PURE__ */ A(re, { children: [
|
|
2686
2639
|
/* @__PURE__ */ f(
|
|
2687
2640
|
Be,
|
|
2688
2641
|
{
|
|
2689
|
-
className: J(`${
|
|
2642
|
+
className: J(`${T}__body`),
|
|
2690
2643
|
"data-testid": `${e}-sticky-footer-scroll-area`,
|
|
2691
2644
|
fitToContent: i,
|
|
2692
2645
|
children: /* @__PURE__ */ f(ee, { stickyFooter: !0, children: a })
|
|
@@ -2695,7 +2648,7 @@ const J = ae.bind(Wo), O = "purpur-drawer-frame", Ar = Y(
|
|
|
2695
2648
|
u && /* @__PURE__ */ f(
|
|
2696
2649
|
ee,
|
|
2697
2650
|
{
|
|
2698
|
-
className: J(`${
|
|
2651
|
+
className: J(`${T}__footer`),
|
|
2699
2652
|
"data-testid": `${e}-sticky-footer`,
|
|
2700
2653
|
variant: "footer",
|
|
2701
2654
|
stickyFooter: g,
|
|
@@ -2705,15 +2658,15 @@ const J = ae.bind(Wo), O = "purpur-drawer-frame", Ar = Y(
|
|
|
2705
2658
|
] }) : /* @__PURE__ */ f(
|
|
2706
2659
|
Be,
|
|
2707
2660
|
{
|
|
2708
|
-
className: J(`${
|
|
2661
|
+
className: J(`${T}__body`),
|
|
2709
2662
|
"data-testid": `${e}-scroll-area`,
|
|
2710
2663
|
fitToContent: i,
|
|
2711
|
-
children: /* @__PURE__ */
|
|
2664
|
+
children: /* @__PURE__ */ A(
|
|
2712
2665
|
"div",
|
|
2713
2666
|
{
|
|
2714
2667
|
className: J([
|
|
2715
|
-
`${
|
|
2716
|
-
{ [`${
|
|
2668
|
+
`${T}__content-container`,
|
|
2669
|
+
{ [`${T}__content-container--no-footer`]: !u }
|
|
2717
2670
|
]),
|
|
2718
2671
|
children: [
|
|
2719
2672
|
/* @__PURE__ */ f(ee, { stickyFooter: g, children: a }),
|
|
@@ -2734,7 +2687,7 @@ const J = ae.bind(Wo), O = "purpur-drawer-frame", Ar = Y(
|
|
|
2734
2687
|
] });
|
|
2735
2688
|
}
|
|
2736
2689
|
);
|
|
2737
|
-
|
|
2690
|
+
Dr.displayName = "DrawerFrame";
|
|
2738
2691
|
const Qa = (e, t) => ({
|
|
2739
2692
|
onSwipeStart: () => {
|
|
2740
2693
|
e.current && e.current.setAttribute("data-swipe", "start");
|
|
@@ -2752,9 +2705,9 @@ const Qa = (e, t) => ({
|
|
|
2752
2705
|
if (!e.current)
|
|
2753
2706
|
return;
|
|
2754
2707
|
const { y: i } = s.delta;
|
|
2755
|
-
e.current.setAttribute("data-swipe", "end"), e.current.style.removeProperty("--purpur-drawer-swipe-move-y"), e.current.style.setProperty("--purpur-drawer-swipe-end-y", `${i}px`), t
|
|
2708
|
+
e.current.setAttribute("data-swipe", "end"), e.current.style.removeProperty("--purpur-drawer-swipe-move-y"), e.current.style.setProperty("--purpur-drawer-swipe-end-y", `${i}px`), t?.(!1);
|
|
2756
2709
|
}
|
|
2757
|
-
}), ce = ae.bind(Mo), z = "purpur-drawer-content",
|
|
2710
|
+
}), ce = ae.bind(Mo), z = "purpur-drawer-content", Ar = Y(
|
|
2758
2711
|
({
|
|
2759
2712
|
["data-testid"]: e = "purpur-drawer-content",
|
|
2760
2713
|
backButton: t = !1,
|
|
@@ -2773,8 +2726,8 @@ const Qa = (e, t) => ({
|
|
|
2773
2726
|
title: _,
|
|
2774
2727
|
zIndex: v,
|
|
2775
2728
|
position: g = "right",
|
|
2776
|
-
...
|
|
2777
|
-
},
|
|
2729
|
+
...y
|
|
2730
|
+
}, b) => {
|
|
2778
2731
|
const E = ce([
|
|
2779
2732
|
z,
|
|
2780
2733
|
{
|
|
@@ -2784,13 +2737,13 @@ const Qa = (e, t) => ({
|
|
|
2784
2737
|
},
|
|
2785
2738
|
s
|
|
2786
2739
|
]), w = Je(null), C = Je(null), R = (j) => {
|
|
2787
|
-
C.current = j, typeof
|
|
2740
|
+
C.current = j, typeof b == "function" ? b(j) : b && (b.current = j);
|
|
2788
2741
|
}, S = Mr(ur), { onSwipeStart: x, onSwipeMove: P, onSwipeCancel: N, onSwipeEnd: F } = Qa(
|
|
2789
2742
|
C,
|
|
2790
2743
|
S
|
|
2791
2744
|
), Ze = (j) => {
|
|
2792
2745
|
u && j.preventDefault();
|
|
2793
|
-
},
|
|
2746
|
+
}, Tr = () => {
|
|
2794
2747
|
const j = w.current;
|
|
2795
2748
|
if (j) {
|
|
2796
2749
|
const Qe = j.querySelector("h2");
|
|
@@ -2799,8 +2752,8 @@ const Qa = (e, t) => ({
|
|
|
2799
2752
|
});
|
|
2800
2753
|
}
|
|
2801
2754
|
};
|
|
2802
|
-
return /* @__PURE__ */ f(
|
|
2803
|
-
|
|
2755
|
+
return /* @__PURE__ */ f(yo, { children: /* @__PURE__ */ f(
|
|
2756
|
+
bo,
|
|
2804
2757
|
{
|
|
2805
2758
|
className: ce("purpur-drawer-overlay"),
|
|
2806
2759
|
style: v ? { zIndex: v } : void 0,
|
|
@@ -2809,14 +2762,14 @@ const Qa = (e, t) => ({
|
|
|
2809
2762
|
wo,
|
|
2810
2763
|
{
|
|
2811
2764
|
onPointerDownOutside: Ze,
|
|
2812
|
-
onOpenAutoFocus:
|
|
2765
|
+
onOpenAutoFocus: Tr,
|
|
2813
2766
|
className: E,
|
|
2814
2767
|
"data-testid": e,
|
|
2815
2768
|
ref: R,
|
|
2816
2769
|
...!a && { "aria-describedby": void 0 },
|
|
2817
|
-
...
|
|
2770
|
+
...y,
|
|
2818
2771
|
children: /* @__PURE__ */ f(
|
|
2819
|
-
|
|
2772
|
+
Dr,
|
|
2820
2773
|
{
|
|
2821
2774
|
backButton: t,
|
|
2822
2775
|
backButtonText: r,
|
|
@@ -2835,7 +2788,7 @@ const Qa = (e, t) => ({
|
|
|
2835
2788
|
stickyFooter: m,
|
|
2836
2789
|
title: _,
|
|
2837
2790
|
position: g,
|
|
2838
|
-
children: a ? /* @__PURE__ */
|
|
2791
|
+
children: a ? /* @__PURE__ */ A("div", { className: ce(`${z}__content-container`), children: [
|
|
2839
2792
|
/* @__PURE__ */ f(
|
|
2840
2793
|
So,
|
|
2841
2794
|
{
|
|
@@ -2854,12 +2807,12 @@ const Qa = (e, t) => ({
|
|
|
2854
2807
|
) });
|
|
2855
2808
|
}
|
|
2856
2809
|
);
|
|
2857
|
-
|
|
2858
|
-
const
|
|
2810
|
+
Ar.displayName = "DrawerContent";
|
|
2811
|
+
const Or = Y(
|
|
2859
2812
|
({ ["data-testid"]: e = "purpur-drawer-trigger", children: t, ...r }, o) => /* @__PURE__ */ f(_o, { asChild: !0, "data-testid": e, ref: o, ...r, children: t })
|
|
2860
2813
|
);
|
|
2861
|
-
|
|
2862
|
-
const
|
|
2814
|
+
Or.displayName = "DrawerTrigger";
|
|
2815
|
+
const Ge = ({
|
|
2863
2816
|
["data-testid"]: e = "purpur-drawer",
|
|
2864
2817
|
children: t,
|
|
2865
2818
|
className: r,
|
|
@@ -2868,16 +2821,16 @@ const Ke = ({
|
|
|
2868
2821
|
...n
|
|
2869
2822
|
}) => {
|
|
2870
2823
|
const [s, i] = ke.useState(a), u = (l) => {
|
|
2871
|
-
i(l), o
|
|
2824
|
+
i(l), o?.(l);
|
|
2872
2825
|
};
|
|
2873
2826
|
return Ir(() => {
|
|
2874
2827
|
i(a);
|
|
2875
2828
|
}, [a]), /* @__PURE__ */ f(ur.Provider, { value: u, children: /* @__PURE__ */ f("div", { className: r, "data-testid": e, ...n, children: /* @__PURE__ */ f(go, { open: s, onOpenChange: u, children: t }) }) });
|
|
2876
2829
|
};
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2830
|
+
Ge.Trigger = Or;
|
|
2831
|
+
Ge.Content = Ar;
|
|
2832
|
+
Ge.displayName = "Drawer";
|
|
2880
2833
|
export {
|
|
2881
|
-
|
|
2834
|
+
Ge as Drawer
|
|
2882
2835
|
};
|
|
2883
2836
|
//# sourceMappingURL=drawer.es.js.map
|