@purpurds/drawer 5.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LICENSE.txt +478 -0
- package/dist/drawer-container.d.ts +11 -0
- package/dist/drawer-container.d.ts.map +1 -0
- package/dist/drawer-content.d.ts +27 -0
- package/dist/drawer-content.d.ts.map +1 -0
- package/dist/drawer-frame.d.ts +23 -0
- package/dist/drawer-frame.d.ts.map +1 -0
- package/dist/drawer-handle.d.ts +13 -0
- package/dist/drawer-handle.d.ts.map +1 -0
- package/dist/drawer-header.d.ts +14 -0
- package/dist/drawer-header.d.ts.map +1 -0
- package/dist/drawer-scroll-area.d.ts +9 -0
- package/dist/drawer-scroll-area.d.ts.map +1 -0
- package/dist/drawer-trigger.d.ts +9 -0
- package/dist/drawer-trigger.d.ts.map +1 -0
- package/dist/drawer.cjs.js +62 -0
- package/dist/drawer.cjs.js.map +1 -0
- package/dist/drawer.context.d.ts +4 -0
- package/dist/drawer.context.d.ts.map +1 -0
- package/dist/drawer.d.ts +17 -0
- package/dist/drawer.d.ts.map +1 -0
- package/dist/drawer.es.js +2791 -0
- package/dist/drawer.es.js.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/use-swipe-to-dismiss.hook.d.ts +13 -0
- package/dist/use-swipe-to-dismiss.hook.d.ts.map +1 -0
- package/dist/use-swipe-tracking.hook.d.ts +15 -0
- package/dist/use-swipe-tracking.hook.d.ts.map +1 -0
- package/package.json +67 -0
- package/src/drawer-container.module.scss +24 -0
- package/src/drawer-container.test.tsx +74 -0
- package/src/drawer-container.tsx +48 -0
- package/src/drawer-content.module.scss +101 -0
- package/src/drawer-content.test.tsx +80 -0
- package/src/drawer-content.tsx +124 -0
- package/src/drawer-frame.module.scss +44 -0
- package/src/drawer-frame.test.tsx +139 -0
- package/src/drawer-frame.tsx +140 -0
- package/src/drawer-handle.module.scss +23 -0
- package/src/drawer-handle.test.tsx +37 -0
- package/src/drawer-handle.tsx +59 -0
- package/src/drawer-header.module.scss +29 -0
- package/src/drawer-header.test.tsx +173 -0
- package/src/drawer-header.tsx +117 -0
- package/src/drawer-scroll-area.module.scss +42 -0
- package/src/drawer-scroll-area.test.tsx +28 -0
- package/src/drawer-scroll-area.tsx +45 -0
- package/src/drawer-trigger.test.tsx +33 -0
- package/src/drawer-trigger.tsx +34 -0
- package/src/drawer.context.ts +5 -0
- package/src/drawer.module.scss +3 -0
- package/src/drawer.stories.tsx +197 -0
- package/src/drawer.test.tsx +210 -0
- package/src/drawer.tsx +59 -0
- package/src/global.d.ts +4 -0
- package/src/types.ts +3 -0
- package/src/use-swipe-to-dismiss.hook.ts +60 -0
- package/src/use-swipe-tracking.hook.ts +78 -0
|
@@ -0,0 +1,2791 @@
|
|
|
1
|
+
import { jsx as _, jsxs as Y, Fragment as lr } from "react/jsx-runtime";
|
|
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 wt } from "react";
|
|
4
|
+
import dr, { flushSync as yt } from "react-dom";
|
|
5
|
+
function y() {
|
|
6
|
+
return y = Object.assign ? Object.assign.bind() : function(e) {
|
|
7
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
8
|
+
var t = arguments[r];
|
|
9
|
+
for (var o in t) ({}).hasOwnProperty.call(t, o) && (e[o] = t[o]);
|
|
10
|
+
}
|
|
11
|
+
return e;
|
|
12
|
+
}, y.apply(null, arguments);
|
|
13
|
+
}
|
|
14
|
+
function L(e, r, { checkForDefaultPrevented: t = !0 } = {}) {
|
|
15
|
+
return function(a) {
|
|
16
|
+
if (e == null || e(a), t === !1 || !a.defaultPrevented) return r == null ? void 0 : r(a);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function pr(e, r) {
|
|
20
|
+
typeof e == "function" ? e(r) : e != null && (e.current = r);
|
|
21
|
+
}
|
|
22
|
+
function St(...e) {
|
|
23
|
+
return (r) => e.forEach(
|
|
24
|
+
(t) => pr(t, r)
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
function k(...e) {
|
|
28
|
+
return ae(St(...e), e);
|
|
29
|
+
}
|
|
30
|
+
function Et(e, r = []) {
|
|
31
|
+
let t = [];
|
|
32
|
+
function o(n, i) {
|
|
33
|
+
const c = /* @__PURE__ */ de(i), l = t.length;
|
|
34
|
+
t = [
|
|
35
|
+
...t,
|
|
36
|
+
i
|
|
37
|
+
];
|
|
38
|
+
function s(d) {
|
|
39
|
+
const { scope: p, children: v, ...m } = d, f = (p == null ? void 0 : p[e][l]) || c, b = Se(
|
|
40
|
+
() => m,
|
|
41
|
+
Object.values(m)
|
|
42
|
+
);
|
|
43
|
+
return /* @__PURE__ */ h(f.Provider, {
|
|
44
|
+
value: b
|
|
45
|
+
}, v);
|
|
46
|
+
}
|
|
47
|
+
function u(d, p) {
|
|
48
|
+
const v = (p == null ? void 0 : p[e][l]) || c, m = Te(v);
|
|
49
|
+
if (m) return m;
|
|
50
|
+
if (i !== void 0) return i;
|
|
51
|
+
throw new Error(`\`${d}\` must be used within \`${n}\``);
|
|
52
|
+
}
|
|
53
|
+
return s.displayName = n + "Provider", [
|
|
54
|
+
s,
|
|
55
|
+
u
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
const a = () => {
|
|
59
|
+
const n = t.map((i) => /* @__PURE__ */ de(i));
|
|
60
|
+
return function(c) {
|
|
61
|
+
const l = (c == null ? void 0 : c[e]) || n;
|
|
62
|
+
return Se(
|
|
63
|
+
() => ({
|
|
64
|
+
[`__scope${e}`]: {
|
|
65
|
+
...c,
|
|
66
|
+
[e]: l
|
|
67
|
+
}
|
|
68
|
+
}),
|
|
69
|
+
[
|
|
70
|
+
c,
|
|
71
|
+
l
|
|
72
|
+
]
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
return a.scopeName = e, [
|
|
77
|
+
o,
|
|
78
|
+
fr(a, ...r)
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
function fr(...e) {
|
|
82
|
+
const r = e[0];
|
|
83
|
+
if (e.length === 1) return r;
|
|
84
|
+
const t = () => {
|
|
85
|
+
const o = e.map(
|
|
86
|
+
(a) => ({
|
|
87
|
+
useScope: a(),
|
|
88
|
+
scopeName: a.scopeName
|
|
89
|
+
})
|
|
90
|
+
);
|
|
91
|
+
return function(n) {
|
|
92
|
+
const i = o.reduce((c, { useScope: l, scopeName: s }) => {
|
|
93
|
+
const d = l(n)[`__scope${s}`];
|
|
94
|
+
return {
|
|
95
|
+
...c,
|
|
96
|
+
...d
|
|
97
|
+
};
|
|
98
|
+
}, {});
|
|
99
|
+
return Se(
|
|
100
|
+
() => ({
|
|
101
|
+
[`__scope${r.scopeName}`]: i
|
|
102
|
+
}),
|
|
103
|
+
[
|
|
104
|
+
i
|
|
105
|
+
]
|
|
106
|
+
);
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
return t.scopeName = r.scopeName, t;
|
|
110
|
+
}
|
|
111
|
+
const xe = globalThis != null && globalThis.document ? ur : () => {
|
|
112
|
+
}, vr = $.useId || (() => {
|
|
113
|
+
});
|
|
114
|
+
let hr = 0;
|
|
115
|
+
function Oe(e) {
|
|
116
|
+
const [r, t] = $.useState(vr());
|
|
117
|
+
return xe(() => {
|
|
118
|
+
e || t(
|
|
119
|
+
(o) => o ?? String(hr++)
|
|
120
|
+
);
|
|
121
|
+
}, [
|
|
122
|
+
e
|
|
123
|
+
]), e || (r ? `radix-${r}` : "");
|
|
124
|
+
}
|
|
125
|
+
function M(e) {
|
|
126
|
+
const r = A(e);
|
|
127
|
+
return D(() => {
|
|
128
|
+
r.current = e;
|
|
129
|
+
}), Se(
|
|
130
|
+
() => (...t) => {
|
|
131
|
+
var o;
|
|
132
|
+
return (o = r.current) === null || o === void 0 ? void 0 : o.call(r, ...t);
|
|
133
|
+
},
|
|
134
|
+
[]
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
function br({ prop: e, defaultProp: r, onChange: t = () => {
|
|
138
|
+
} }) {
|
|
139
|
+
const [o, a] = mr({
|
|
140
|
+
defaultProp: r,
|
|
141
|
+
onChange: t
|
|
142
|
+
}), n = e !== void 0, i = n ? e : o, c = M(t), l = ae((s) => {
|
|
143
|
+
if (n) {
|
|
144
|
+
const d = typeof s == "function" ? s(e) : s;
|
|
145
|
+
d !== e && c(d);
|
|
146
|
+
} else a(s);
|
|
147
|
+
}, [
|
|
148
|
+
n,
|
|
149
|
+
e,
|
|
150
|
+
a,
|
|
151
|
+
c
|
|
152
|
+
]);
|
|
153
|
+
return [
|
|
154
|
+
i,
|
|
155
|
+
l
|
|
156
|
+
];
|
|
157
|
+
}
|
|
158
|
+
function mr({ defaultProp: e, onChange: r }) {
|
|
159
|
+
const t = N(e), [o] = t, a = A(o), n = M(r);
|
|
160
|
+
return D(() => {
|
|
161
|
+
a.current !== o && (n(o), a.current = o);
|
|
162
|
+
}, [
|
|
163
|
+
o,
|
|
164
|
+
a,
|
|
165
|
+
n
|
|
166
|
+
]), t;
|
|
167
|
+
}
|
|
168
|
+
const et = /* @__PURE__ */ w((e, r) => {
|
|
169
|
+
const { children: t, ...o } = e, a = Z.toArray(t), n = a.find(_r);
|
|
170
|
+
if (n) {
|
|
171
|
+
const i = n.props.children, c = a.map((l) => l === n ? Z.count(i) > 1 ? Z.only(null) : /* @__PURE__ */ Ee(i) ? i.props.children : null : l);
|
|
172
|
+
return /* @__PURE__ */ h(He, y({}, o, {
|
|
173
|
+
ref: r
|
|
174
|
+
}), /* @__PURE__ */ Ee(i) ? /* @__PURE__ */ Qe(i, void 0, c) : null);
|
|
175
|
+
}
|
|
176
|
+
return /* @__PURE__ */ h(He, y({}, o, {
|
|
177
|
+
ref: r
|
|
178
|
+
}), t);
|
|
179
|
+
});
|
|
180
|
+
et.displayName = "Slot";
|
|
181
|
+
const He = /* @__PURE__ */ w((e, r) => {
|
|
182
|
+
const { children: t, ...o } = e;
|
|
183
|
+
return /* @__PURE__ */ Ee(t) ? /* @__PURE__ */ Qe(t, {
|
|
184
|
+
...$r(o, t.props),
|
|
185
|
+
ref: r ? St(r, t.ref) : t.ref
|
|
186
|
+
}) : Z.count(t) > 1 ? Z.only(null) : null;
|
|
187
|
+
});
|
|
188
|
+
He.displayName = "SlotClone";
|
|
189
|
+
const gr = ({ children: e }) => /* @__PURE__ */ h(Je, null, e);
|
|
190
|
+
function _r(e) {
|
|
191
|
+
return /* @__PURE__ */ Ee(e) && e.type === gr;
|
|
192
|
+
}
|
|
193
|
+
function $r(e, r) {
|
|
194
|
+
const t = {
|
|
195
|
+
...r
|
|
196
|
+
};
|
|
197
|
+
for (const o in r) {
|
|
198
|
+
const a = e[o], n = r[o];
|
|
199
|
+
/^on[A-Z]/.test(o) ? a && n ? t[o] = (...c) => {
|
|
200
|
+
n(...c), a(...c);
|
|
201
|
+
} : a && (t[o] = a) : o === "style" ? t[o] = {
|
|
202
|
+
...a,
|
|
203
|
+
...n
|
|
204
|
+
} : o === "className" && (t[o] = [
|
|
205
|
+
a,
|
|
206
|
+
n
|
|
207
|
+
].filter(Boolean).join(" "));
|
|
208
|
+
}
|
|
209
|
+
return {
|
|
210
|
+
...e,
|
|
211
|
+
...t
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
const wr = [
|
|
215
|
+
"a",
|
|
216
|
+
"button",
|
|
217
|
+
"div",
|
|
218
|
+
"form",
|
|
219
|
+
"h2",
|
|
220
|
+
"h3",
|
|
221
|
+
"img",
|
|
222
|
+
"input",
|
|
223
|
+
"label",
|
|
224
|
+
"li",
|
|
225
|
+
"nav",
|
|
226
|
+
"ol",
|
|
227
|
+
"p",
|
|
228
|
+
"span",
|
|
229
|
+
"svg",
|
|
230
|
+
"ul"
|
|
231
|
+
], F = wr.reduce((e, r) => {
|
|
232
|
+
const t = /* @__PURE__ */ w((o, a) => {
|
|
233
|
+
const { asChild: n, ...i } = o, c = n ? et : r;
|
|
234
|
+
return D(() => {
|
|
235
|
+
window[Symbol.for("radix-ui")] = !0;
|
|
236
|
+
}, []), /* @__PURE__ */ h(c, y({}, i, {
|
|
237
|
+
ref: a
|
|
238
|
+
}));
|
|
239
|
+
});
|
|
240
|
+
return t.displayName = `Primitive.${r}`, {
|
|
241
|
+
...e,
|
|
242
|
+
[r]: t
|
|
243
|
+
};
|
|
244
|
+
}, {});
|
|
245
|
+
function yr(e, r) {
|
|
246
|
+
e && yt(
|
|
247
|
+
() => e.dispatchEvent(r)
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
function Sr(e, r = globalThis == null ? void 0 : globalThis.document) {
|
|
251
|
+
const t = M(e);
|
|
252
|
+
D(() => {
|
|
253
|
+
const o = (a) => {
|
|
254
|
+
a.key === "Escape" && t(a);
|
|
255
|
+
};
|
|
256
|
+
return r.addEventListener("keydown", o), () => r.removeEventListener("keydown", o);
|
|
257
|
+
}, [
|
|
258
|
+
t,
|
|
259
|
+
r
|
|
260
|
+
]);
|
|
261
|
+
}
|
|
262
|
+
const Ye = "dismissableLayer.update", Er = "dismissableLayer.pointerDownOutside", xr = "dismissableLayer.focusOutside";
|
|
263
|
+
let ot;
|
|
264
|
+
const Cr = /* @__PURE__ */ de({
|
|
265
|
+
layers: /* @__PURE__ */ new Set(),
|
|
266
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
267
|
+
branches: /* @__PURE__ */ new Set()
|
|
268
|
+
}), Pr = /* @__PURE__ */ w((e, r) => {
|
|
269
|
+
var t;
|
|
270
|
+
const { disableOutsidePointerEvents: o = !1, onEscapeKeyDown: a, onPointerDownOutside: n, onFocusOutside: i, onInteractOutside: c, onDismiss: l, ...s } = e, u = Te(Cr), [d, p] = N(null), v = (t = d == null ? void 0 : d.ownerDocument) !== null && t !== void 0 ? t : globalThis == null ? void 0 : globalThis.document, [, m] = N({}), f = k(
|
|
271
|
+
r,
|
|
272
|
+
(x) => p(x)
|
|
273
|
+
), b = Array.from(u.layers), [g] = [
|
|
274
|
+
...u.layersWithOutsidePointerEventsDisabled
|
|
275
|
+
].slice(-1), C = b.indexOf(g), S = d ? b.indexOf(d) : -1, E = u.layersWithOutsidePointerEventsDisabled.size > 0, P = S >= C, I = Tr((x) => {
|
|
276
|
+
const T = x.target, R = [
|
|
277
|
+
...u.branches
|
|
278
|
+
].some(
|
|
279
|
+
(z) => z.contains(T)
|
|
280
|
+
);
|
|
281
|
+
!P || R || (n == null || n(x), c == null || c(x), x.defaultPrevented || l == null || l());
|
|
282
|
+
}, v), O = Ar((x) => {
|
|
283
|
+
const T = x.target;
|
|
284
|
+
[
|
|
285
|
+
...u.branches
|
|
286
|
+
].some(
|
|
287
|
+
(z) => z.contains(T)
|
|
288
|
+
) || (i == null || i(x), c == null || c(x), x.defaultPrevented || l == null || l());
|
|
289
|
+
}, v);
|
|
290
|
+
return Sr((x) => {
|
|
291
|
+
S === u.layers.size - 1 && (a == null || a(x), !x.defaultPrevented && l && (x.preventDefault(), l()));
|
|
292
|
+
}, v), D(() => {
|
|
293
|
+
if (d)
|
|
294
|
+
return o && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (ot = v.body.style.pointerEvents, v.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(d)), u.layers.add(d), at(), () => {
|
|
295
|
+
o && u.layersWithOutsidePointerEventsDisabled.size === 1 && (v.body.style.pointerEvents = ot);
|
|
296
|
+
};
|
|
297
|
+
}, [
|
|
298
|
+
d,
|
|
299
|
+
v,
|
|
300
|
+
o,
|
|
301
|
+
u
|
|
302
|
+
]), D(() => () => {
|
|
303
|
+
d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d), at());
|
|
304
|
+
}, [
|
|
305
|
+
d,
|
|
306
|
+
u
|
|
307
|
+
]), D(() => {
|
|
308
|
+
const x = () => m({});
|
|
309
|
+
return document.addEventListener(Ye, x), () => document.removeEventListener(Ye, x);
|
|
310
|
+
}, []), /* @__PURE__ */ h(F.div, y({}, s, {
|
|
311
|
+
ref: f,
|
|
312
|
+
style: {
|
|
313
|
+
pointerEvents: E ? P ? "auto" : "none" : void 0,
|
|
314
|
+
...e.style
|
|
315
|
+
},
|
|
316
|
+
onFocusCapture: L(e.onFocusCapture, O.onFocusCapture),
|
|
317
|
+
onBlurCapture: L(e.onBlurCapture, O.onBlurCapture),
|
|
318
|
+
onPointerDownCapture: L(e.onPointerDownCapture, I.onPointerDownCapture)
|
|
319
|
+
}));
|
|
320
|
+
});
|
|
321
|
+
function Tr(e, r = globalThis == null ? void 0 : globalThis.document) {
|
|
322
|
+
const t = M(e), o = A(!1), a = A(() => {
|
|
323
|
+
});
|
|
324
|
+
return D(() => {
|
|
325
|
+
const n = (c) => {
|
|
326
|
+
if (c.target && !o.current) {
|
|
327
|
+
let s = function() {
|
|
328
|
+
xt(Er, t, l, {
|
|
329
|
+
discrete: !0
|
|
330
|
+
});
|
|
331
|
+
};
|
|
332
|
+
const l = {
|
|
333
|
+
originalEvent: c
|
|
334
|
+
};
|
|
335
|
+
c.pointerType === "touch" ? (r.removeEventListener("click", a.current), a.current = s, r.addEventListener("click", a.current, {
|
|
336
|
+
once: !0
|
|
337
|
+
})) : s();
|
|
338
|
+
} else
|
|
339
|
+
r.removeEventListener("click", a.current);
|
|
340
|
+
o.current = !1;
|
|
341
|
+
}, i = window.setTimeout(() => {
|
|
342
|
+
r.addEventListener("pointerdown", n);
|
|
343
|
+
}, 0);
|
|
344
|
+
return () => {
|
|
345
|
+
window.clearTimeout(i), r.removeEventListener("pointerdown", n), r.removeEventListener("click", a.current);
|
|
346
|
+
};
|
|
347
|
+
}, [
|
|
348
|
+
r,
|
|
349
|
+
t
|
|
350
|
+
]), {
|
|
351
|
+
// ensures we check React component tree (not just DOM tree)
|
|
352
|
+
onPointerDownCapture: () => o.current = !0
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
function Ar(e, r = globalThis == null ? void 0 : globalThis.document) {
|
|
356
|
+
const t = M(e), o = A(!1);
|
|
357
|
+
return D(() => {
|
|
358
|
+
const a = (n) => {
|
|
359
|
+
n.target && !o.current && xt(xr, t, {
|
|
360
|
+
originalEvent: n
|
|
361
|
+
}, {
|
|
362
|
+
discrete: !1
|
|
363
|
+
});
|
|
364
|
+
};
|
|
365
|
+
return r.addEventListener("focusin", a), () => r.removeEventListener("focusin", a);
|
|
366
|
+
}, [
|
|
367
|
+
r,
|
|
368
|
+
t
|
|
369
|
+
]), {
|
|
370
|
+
onFocusCapture: () => o.current = !0,
|
|
371
|
+
onBlurCapture: () => o.current = !1
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
function at() {
|
|
375
|
+
const e = new CustomEvent(Ye);
|
|
376
|
+
document.dispatchEvent(e);
|
|
377
|
+
}
|
|
378
|
+
function xt(e, r, t, { discrete: o }) {
|
|
379
|
+
const a = t.originalEvent.target, n = new CustomEvent(e, {
|
|
380
|
+
bubbles: !1,
|
|
381
|
+
cancelable: !0,
|
|
382
|
+
detail: t
|
|
383
|
+
});
|
|
384
|
+
r && a.addEventListener(e, r, {
|
|
385
|
+
once: !0
|
|
386
|
+
}), o ? yr(a, n) : a.dispatchEvent(n);
|
|
387
|
+
}
|
|
388
|
+
const Le = "focusScope.autoFocusOnMount", Re = "focusScope.autoFocusOnUnmount", ct = {
|
|
389
|
+
bubbles: !1,
|
|
390
|
+
cancelable: !0
|
|
391
|
+
}, Dr = /* @__PURE__ */ w((e, r) => {
|
|
392
|
+
const { loop: t = !1, trapped: o = !1, onMountAutoFocus: a, onUnmountAutoFocus: n, ...i } = e, [c, l] = N(null), s = M(a), u = M(n), d = A(null), p = k(
|
|
393
|
+
r,
|
|
394
|
+
(f) => l(f)
|
|
395
|
+
), v = A({
|
|
396
|
+
paused: !1,
|
|
397
|
+
pause() {
|
|
398
|
+
this.paused = !0;
|
|
399
|
+
},
|
|
400
|
+
resume() {
|
|
401
|
+
this.paused = !1;
|
|
402
|
+
}
|
|
403
|
+
}).current;
|
|
404
|
+
D(() => {
|
|
405
|
+
if (o) {
|
|
406
|
+
let f = function(S) {
|
|
407
|
+
if (v.paused || !c) return;
|
|
408
|
+
const E = S.target;
|
|
409
|
+
c.contains(E) ? d.current = E : V(d.current, {
|
|
410
|
+
select: !0
|
|
411
|
+
});
|
|
412
|
+
}, b = function(S) {
|
|
413
|
+
if (v.paused || !c) return;
|
|
414
|
+
const E = S.relatedTarget;
|
|
415
|
+
E !== null && (c.contains(E) || V(d.current, {
|
|
416
|
+
select: !0
|
|
417
|
+
}));
|
|
418
|
+
}, g = function(S) {
|
|
419
|
+
if (document.activeElement === document.body)
|
|
420
|
+
for (const P of S) P.removedNodes.length > 0 && V(c);
|
|
421
|
+
};
|
|
422
|
+
document.addEventListener("focusin", f), document.addEventListener("focusout", b);
|
|
423
|
+
const C = new MutationObserver(g);
|
|
424
|
+
return c && C.observe(c, {
|
|
425
|
+
childList: !0,
|
|
426
|
+
subtree: !0
|
|
427
|
+
}), () => {
|
|
428
|
+
document.removeEventListener("focusin", f), document.removeEventListener("focusout", b), C.disconnect();
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
}, [
|
|
432
|
+
o,
|
|
433
|
+
c,
|
|
434
|
+
v.paused
|
|
435
|
+
]), D(() => {
|
|
436
|
+
if (c) {
|
|
437
|
+
st.add(v);
|
|
438
|
+
const f = document.activeElement;
|
|
439
|
+
if (!c.contains(f)) {
|
|
440
|
+
const g = new CustomEvent(Le, ct);
|
|
441
|
+
c.addEventListener(Le, s), c.dispatchEvent(g), g.defaultPrevented || (Nr(Ir(Ct(c)), {
|
|
442
|
+
select: !0
|
|
443
|
+
}), document.activeElement === f && V(c));
|
|
444
|
+
}
|
|
445
|
+
return () => {
|
|
446
|
+
c.removeEventListener(Le, s), setTimeout(() => {
|
|
447
|
+
const g = new CustomEvent(Re, ct);
|
|
448
|
+
c.addEventListener(Re, u), c.dispatchEvent(g), g.defaultPrevented || V(f ?? document.body, {
|
|
449
|
+
select: !0
|
|
450
|
+
}), c.removeEventListener(Re, u), st.remove(v);
|
|
451
|
+
}, 0);
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
}, [
|
|
455
|
+
c,
|
|
456
|
+
s,
|
|
457
|
+
u,
|
|
458
|
+
v
|
|
459
|
+
]);
|
|
460
|
+
const m = ae((f) => {
|
|
461
|
+
if (!t && !o || v.paused) return;
|
|
462
|
+
const b = f.key === "Tab" && !f.altKey && !f.ctrlKey && !f.metaKey, g = document.activeElement;
|
|
463
|
+
if (b && g) {
|
|
464
|
+
const C = f.currentTarget, [S, E] = Or(C);
|
|
465
|
+
S && E ? !f.shiftKey && g === E ? (f.preventDefault(), t && V(S, {
|
|
466
|
+
select: !0
|
|
467
|
+
})) : f.shiftKey && g === S && (f.preventDefault(), t && V(E, {
|
|
468
|
+
select: !0
|
|
469
|
+
})) : g === C && f.preventDefault();
|
|
470
|
+
}
|
|
471
|
+
}, [
|
|
472
|
+
t,
|
|
473
|
+
o,
|
|
474
|
+
v.paused
|
|
475
|
+
]);
|
|
476
|
+
return /* @__PURE__ */ h(F.div, y({
|
|
477
|
+
tabIndex: -1
|
|
478
|
+
}, i, {
|
|
479
|
+
ref: p,
|
|
480
|
+
onKeyDown: m
|
|
481
|
+
}));
|
|
482
|
+
});
|
|
483
|
+
function Nr(e, { select: r = !1 } = {}) {
|
|
484
|
+
const t = document.activeElement;
|
|
485
|
+
for (const o of e)
|
|
486
|
+
if (V(o, {
|
|
487
|
+
select: r
|
|
488
|
+
}), document.activeElement !== t) return;
|
|
489
|
+
}
|
|
490
|
+
function Or(e) {
|
|
491
|
+
const r = Ct(e), t = it(r, e), o = it(r.reverse(), e);
|
|
492
|
+
return [
|
|
493
|
+
t,
|
|
494
|
+
o
|
|
495
|
+
];
|
|
496
|
+
}
|
|
497
|
+
function Ct(e) {
|
|
498
|
+
const r = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
499
|
+
acceptNode: (o) => {
|
|
500
|
+
const a = o.tagName === "INPUT" && o.type === "hidden";
|
|
501
|
+
return o.disabled || o.hidden || a ? NodeFilter.FILTER_SKIP : o.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
for (; t.nextNode(); ) r.push(t.currentNode);
|
|
505
|
+
return r;
|
|
506
|
+
}
|
|
507
|
+
function it(e, r) {
|
|
508
|
+
for (const t of e)
|
|
509
|
+
if (!Lr(t, {
|
|
510
|
+
upTo: r
|
|
511
|
+
})) return t;
|
|
512
|
+
}
|
|
513
|
+
function Lr(e, { upTo: r }) {
|
|
514
|
+
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
515
|
+
for (; e; ) {
|
|
516
|
+
if (r !== void 0 && e === r) return !1;
|
|
517
|
+
if (getComputedStyle(e).display === "none") return !0;
|
|
518
|
+
e = e.parentElement;
|
|
519
|
+
}
|
|
520
|
+
return !1;
|
|
521
|
+
}
|
|
522
|
+
function Rr(e) {
|
|
523
|
+
return e instanceof HTMLInputElement && "select" in e;
|
|
524
|
+
}
|
|
525
|
+
function V(e, { select: r = !1 } = {}) {
|
|
526
|
+
if (e && e.focus) {
|
|
527
|
+
const t = document.activeElement;
|
|
528
|
+
e.focus({
|
|
529
|
+
preventScroll: !0
|
|
530
|
+
}), e !== t && Rr(e) && r && e.select();
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
const st = Mr();
|
|
534
|
+
function Mr() {
|
|
535
|
+
let e = [];
|
|
536
|
+
return {
|
|
537
|
+
add(r) {
|
|
538
|
+
const t = e[0];
|
|
539
|
+
r !== t && (t == null || t.pause()), e = lt(e, r), e.unshift(r);
|
|
540
|
+
},
|
|
541
|
+
remove(r) {
|
|
542
|
+
var t;
|
|
543
|
+
e = lt(e, r), (t = e[0]) === null || t === void 0 || t.resume();
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
function lt(e, r) {
|
|
548
|
+
const t = [
|
|
549
|
+
...e
|
|
550
|
+
], o = t.indexOf(r);
|
|
551
|
+
return o !== -1 && t.splice(o, 1), t;
|
|
552
|
+
}
|
|
553
|
+
function Ir(e) {
|
|
554
|
+
return e.filter(
|
|
555
|
+
(r) => r.tagName !== "A"
|
|
556
|
+
);
|
|
557
|
+
}
|
|
558
|
+
const kr = /* @__PURE__ */ w((e, r) => {
|
|
559
|
+
var t;
|
|
560
|
+
const { container: o = globalThis == null || (t = globalThis.document) === null || t === void 0 ? void 0 : t.body, ...a } = e;
|
|
561
|
+
return o ? /* @__PURE__ */ dr.createPortal(/* @__PURE__ */ h(F.div, y({}, a, {
|
|
562
|
+
ref: r
|
|
563
|
+
})), o) : null;
|
|
564
|
+
});
|
|
565
|
+
function Fr(e, r) {
|
|
566
|
+
return wt((t, o) => {
|
|
567
|
+
const a = r[t][o];
|
|
568
|
+
return a ?? t;
|
|
569
|
+
}, e);
|
|
570
|
+
}
|
|
571
|
+
const q = (e) => {
|
|
572
|
+
const { present: r, children: t } = e, o = jr(r), a = typeof t == "function" ? t({
|
|
573
|
+
present: o.isPresent
|
|
574
|
+
}) : Z.only(t), n = k(o.ref, a.ref);
|
|
575
|
+
return typeof t == "function" || o.isPresent ? /* @__PURE__ */ Qe(a, {
|
|
576
|
+
ref: n
|
|
577
|
+
}) : null;
|
|
578
|
+
};
|
|
579
|
+
q.displayName = "Presence";
|
|
580
|
+
function jr(e) {
|
|
581
|
+
const [r, t] = N(), o = A({}), a = A(e), n = A("none"), i = e ? "mounted" : "unmounted", [c, l] = Fr(i, {
|
|
582
|
+
mounted: {
|
|
583
|
+
UNMOUNT: "unmounted",
|
|
584
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
585
|
+
},
|
|
586
|
+
unmountSuspended: {
|
|
587
|
+
MOUNT: "mounted",
|
|
588
|
+
ANIMATION_END: "unmounted"
|
|
589
|
+
},
|
|
590
|
+
unmounted: {
|
|
591
|
+
MOUNT: "mounted"
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
return D(() => {
|
|
595
|
+
const s = fe(o.current);
|
|
596
|
+
n.current = c === "mounted" ? s : "none";
|
|
597
|
+
}, [
|
|
598
|
+
c
|
|
599
|
+
]), xe(() => {
|
|
600
|
+
const s = o.current, u = a.current;
|
|
601
|
+
if (u !== e) {
|
|
602
|
+
const p = n.current, v = fe(s);
|
|
603
|
+
e ? l("MOUNT") : v === "none" || (s == null ? void 0 : s.display) === "none" ? l("UNMOUNT") : l(u && p !== v ? "ANIMATION_OUT" : "UNMOUNT"), a.current = e;
|
|
604
|
+
}
|
|
605
|
+
}, [
|
|
606
|
+
e,
|
|
607
|
+
l
|
|
608
|
+
]), xe(() => {
|
|
609
|
+
if (r) {
|
|
610
|
+
const s = (d) => {
|
|
611
|
+
const v = fe(o.current).includes(d.animationName);
|
|
612
|
+
d.target === r && v && yt(
|
|
613
|
+
() => l("ANIMATION_END")
|
|
614
|
+
);
|
|
615
|
+
}, u = (d) => {
|
|
616
|
+
d.target === r && (n.current = fe(o.current));
|
|
617
|
+
};
|
|
618
|
+
return r.addEventListener("animationstart", u), r.addEventListener("animationcancel", s), r.addEventListener("animationend", s), () => {
|
|
619
|
+
r.removeEventListener("animationstart", u), r.removeEventListener("animationcancel", s), r.removeEventListener("animationend", s);
|
|
620
|
+
};
|
|
621
|
+
} else
|
|
622
|
+
l("ANIMATION_END");
|
|
623
|
+
}, [
|
|
624
|
+
r,
|
|
625
|
+
l
|
|
626
|
+
]), {
|
|
627
|
+
isPresent: [
|
|
628
|
+
"mounted",
|
|
629
|
+
"unmountSuspended"
|
|
630
|
+
].includes(c),
|
|
631
|
+
ref: ae((s) => {
|
|
632
|
+
s && (o.current = getComputedStyle(s)), t(s);
|
|
633
|
+
}, [])
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
function fe(e) {
|
|
637
|
+
return (e == null ? void 0 : e.animationName) || "none";
|
|
638
|
+
}
|
|
639
|
+
let Me = 0;
|
|
640
|
+
function zr() {
|
|
641
|
+
D(() => {
|
|
642
|
+
var e, r;
|
|
643
|
+
const t = document.querySelectorAll("[data-radix-focus-guard]");
|
|
644
|
+
return document.body.insertAdjacentElement("afterbegin", (e = t[0]) !== null && e !== void 0 ? e : ut()), document.body.insertAdjacentElement("beforeend", (r = t[1]) !== null && r !== void 0 ? r : ut()), Me++, () => {
|
|
645
|
+
Me === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach(
|
|
646
|
+
(o) => o.remove()
|
|
647
|
+
), Me--;
|
|
648
|
+
};
|
|
649
|
+
}, []);
|
|
650
|
+
}
|
|
651
|
+
function ut() {
|
|
652
|
+
const e = document.createElement("span");
|
|
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
|
+
}
|
|
655
|
+
var W = function() {
|
|
656
|
+
return W = Object.assign || function(r) {
|
|
657
|
+
for (var t, o = 1, a = arguments.length; o < a; o++) {
|
|
658
|
+
t = arguments[o];
|
|
659
|
+
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (r[n] = t[n]);
|
|
660
|
+
}
|
|
661
|
+
return r;
|
|
662
|
+
}, W.apply(this, arguments);
|
|
663
|
+
};
|
|
664
|
+
function Pt(e, r) {
|
|
665
|
+
var t = {};
|
|
666
|
+
for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && r.indexOf(o) < 0 && (t[o] = e[o]);
|
|
667
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
668
|
+
for (var a = 0, o = Object.getOwnPropertySymbols(e); a < o.length; a++)
|
|
669
|
+
r.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (t[o[a]] = e[o[a]]);
|
|
670
|
+
return t;
|
|
671
|
+
}
|
|
672
|
+
function Wr(e, r, t) {
|
|
673
|
+
if (t || arguments.length === 2) for (var o = 0, a = r.length, n; o < a; o++)
|
|
674
|
+
(n || !(o in r)) && (n || (n = Array.prototype.slice.call(r, 0, o)), n[o] = r[o]);
|
|
675
|
+
return e.concat(n || Array.prototype.slice.call(r));
|
|
676
|
+
}
|
|
677
|
+
var we = "right-scroll-bar-position", ye = "width-before-scroll-bar", Ur = "with-scroll-bars-hidden", Hr = "--removed-body-scroll-bar-size";
|
|
678
|
+
function Ie(e, r) {
|
|
679
|
+
return typeof e == "function" ? e(r) : e && (e.current = r), e;
|
|
680
|
+
}
|
|
681
|
+
function Yr(e, r) {
|
|
682
|
+
var t = N(function() {
|
|
683
|
+
return {
|
|
684
|
+
// value
|
|
685
|
+
value: e,
|
|
686
|
+
// last callback
|
|
687
|
+
callback: r,
|
|
688
|
+
// "memoized" public interface
|
|
689
|
+
facade: {
|
|
690
|
+
get current() {
|
|
691
|
+
return t.value;
|
|
692
|
+
},
|
|
693
|
+
set current(o) {
|
|
694
|
+
var a = t.value;
|
|
695
|
+
a !== o && (t.value = o, t.callback(o, a));
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
};
|
|
699
|
+
})[0];
|
|
700
|
+
return t.callback = r, t.facade;
|
|
701
|
+
}
|
|
702
|
+
var Xr = typeof window < "u" ? $.useLayoutEffect : $.useEffect, dt = /* @__PURE__ */ new WeakMap();
|
|
703
|
+
function Br(e, r) {
|
|
704
|
+
var t = Yr(null, function(o) {
|
|
705
|
+
return e.forEach(function(a) {
|
|
706
|
+
return Ie(a, o);
|
|
707
|
+
});
|
|
708
|
+
});
|
|
709
|
+
return Xr(function() {
|
|
710
|
+
var o = dt.get(t);
|
|
711
|
+
if (o) {
|
|
712
|
+
var a = new Set(o), n = new Set(e), i = t.current;
|
|
713
|
+
a.forEach(function(c) {
|
|
714
|
+
n.has(c) || Ie(c, null);
|
|
715
|
+
}), n.forEach(function(c) {
|
|
716
|
+
a.has(c) || Ie(c, i);
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
dt.set(t, e);
|
|
720
|
+
}, [e]), t;
|
|
721
|
+
}
|
|
722
|
+
function Vr(e) {
|
|
723
|
+
return e;
|
|
724
|
+
}
|
|
725
|
+
function qr(e, r) {
|
|
726
|
+
r === void 0 && (r = Vr);
|
|
727
|
+
var t = [], o = !1, a = {
|
|
728
|
+
read: function() {
|
|
729
|
+
if (o)
|
|
730
|
+
throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
|
|
731
|
+
return t.length ? t[t.length - 1] : e;
|
|
732
|
+
},
|
|
733
|
+
useMedium: function(n) {
|
|
734
|
+
var i = r(n, o);
|
|
735
|
+
return t.push(i), function() {
|
|
736
|
+
t = t.filter(function(c) {
|
|
737
|
+
return c !== i;
|
|
738
|
+
});
|
|
739
|
+
};
|
|
740
|
+
},
|
|
741
|
+
assignSyncMedium: function(n) {
|
|
742
|
+
for (o = !0; t.length; ) {
|
|
743
|
+
var i = t;
|
|
744
|
+
t = [], i.forEach(n);
|
|
745
|
+
}
|
|
746
|
+
t = {
|
|
747
|
+
push: function(c) {
|
|
748
|
+
return n(c);
|
|
749
|
+
},
|
|
750
|
+
filter: function() {
|
|
751
|
+
return t;
|
|
752
|
+
}
|
|
753
|
+
};
|
|
754
|
+
},
|
|
755
|
+
assignMedium: function(n) {
|
|
756
|
+
o = !0;
|
|
757
|
+
var i = [];
|
|
758
|
+
if (t.length) {
|
|
759
|
+
var c = t;
|
|
760
|
+
t = [], c.forEach(n), i = t;
|
|
761
|
+
}
|
|
762
|
+
var l = function() {
|
|
763
|
+
var u = i;
|
|
764
|
+
i = [], u.forEach(n);
|
|
765
|
+
}, s = function() {
|
|
766
|
+
return Promise.resolve().then(l);
|
|
767
|
+
};
|
|
768
|
+
s(), t = {
|
|
769
|
+
push: function(u) {
|
|
770
|
+
i.push(u), s();
|
|
771
|
+
},
|
|
772
|
+
filter: function(u) {
|
|
773
|
+
return i = i.filter(u), t;
|
|
774
|
+
}
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
};
|
|
778
|
+
return a;
|
|
779
|
+
}
|
|
780
|
+
function Kr(e) {
|
|
781
|
+
e === void 0 && (e = {});
|
|
782
|
+
var r = qr(null);
|
|
783
|
+
return r.options = W({ async: !0, ssr: !1 }, e), r;
|
|
784
|
+
}
|
|
785
|
+
var Tt = function(e) {
|
|
786
|
+
var r = e.sideCar, t = Pt(e, ["sideCar"]);
|
|
787
|
+
if (!r)
|
|
788
|
+
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
789
|
+
var o = r.read();
|
|
790
|
+
if (!o)
|
|
791
|
+
throw new Error("Sidecar medium not found");
|
|
792
|
+
return $.createElement(o, W({}, t));
|
|
793
|
+
};
|
|
794
|
+
Tt.isSideCarExport = !0;
|
|
795
|
+
function Gr(e, r) {
|
|
796
|
+
return e.useMedium(r), Tt;
|
|
797
|
+
}
|
|
798
|
+
var At = Kr(), ke = function() {
|
|
799
|
+
}, Ae = $.forwardRef(function(e, r) {
|
|
800
|
+
var t = $.useRef(null), o = $.useState({
|
|
801
|
+
onScrollCapture: ke,
|
|
802
|
+
onWheelCapture: ke,
|
|
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, p = e.sideCar, v = e.noIsolation, m = e.inert, f = e.allowPinchZoom, b = e.as, g = b === void 0 ? "div" : b, C = Pt(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]), S = p, E = Br([t, r]), P = W(W({}, C), a);
|
|
805
|
+
return $.createElement(
|
|
806
|
+
$.Fragment,
|
|
807
|
+
null,
|
|
808
|
+
u && $.createElement(S, { sideCar: At, removeScrollBar: s, shards: d, noIsolation: v, inert: m, setCallbacks: n, allowPinchZoom: !!f, lockRef: t }),
|
|
809
|
+
i ? $.cloneElement($.Children.only(c), W(W({}, P), { ref: E })) : $.createElement(g, W({}, P, { className: l, ref: E }), c)
|
|
810
|
+
);
|
|
811
|
+
});
|
|
812
|
+
Ae.defaultProps = {
|
|
813
|
+
enabled: !0,
|
|
814
|
+
removeScrollBar: !0,
|
|
815
|
+
inert: !1
|
|
816
|
+
};
|
|
817
|
+
Ae.classNames = {
|
|
818
|
+
fullWidth: ye,
|
|
819
|
+
zeroRight: we
|
|
820
|
+
};
|
|
821
|
+
var Zr = function() {
|
|
822
|
+
if (typeof __webpack_nonce__ < "u")
|
|
823
|
+
return __webpack_nonce__;
|
|
824
|
+
};
|
|
825
|
+
function Qr() {
|
|
826
|
+
if (!document)
|
|
827
|
+
return null;
|
|
828
|
+
var e = document.createElement("style");
|
|
829
|
+
e.type = "text/css";
|
|
830
|
+
var r = Zr();
|
|
831
|
+
return r && e.setAttribute("nonce", r), e;
|
|
832
|
+
}
|
|
833
|
+
function Jr(e, r) {
|
|
834
|
+
e.styleSheet ? e.styleSheet.cssText = r : e.appendChild(document.createTextNode(r));
|
|
835
|
+
}
|
|
836
|
+
function en(e) {
|
|
837
|
+
var r = document.head || document.getElementsByTagName("head")[0];
|
|
838
|
+
r.appendChild(e);
|
|
839
|
+
}
|
|
840
|
+
var tn = function() {
|
|
841
|
+
var e = 0, r = null;
|
|
842
|
+
return {
|
|
843
|
+
add: function(t) {
|
|
844
|
+
e == 0 && (r = Qr()) && (Jr(r, t), en(r)), e++;
|
|
845
|
+
},
|
|
846
|
+
remove: function() {
|
|
847
|
+
e--, !e && r && (r.parentNode && r.parentNode.removeChild(r), r = null);
|
|
848
|
+
}
|
|
849
|
+
};
|
|
850
|
+
}, rn = function() {
|
|
851
|
+
var e = tn();
|
|
852
|
+
return function(r, t) {
|
|
853
|
+
$.useEffect(function() {
|
|
854
|
+
return e.add(r), function() {
|
|
855
|
+
e.remove();
|
|
856
|
+
};
|
|
857
|
+
}, [r && t]);
|
|
858
|
+
};
|
|
859
|
+
}, Dt = function() {
|
|
860
|
+
var e = rn(), r = function(t) {
|
|
861
|
+
var o = t.styles, a = t.dynamic;
|
|
862
|
+
return e(o, a), null;
|
|
863
|
+
};
|
|
864
|
+
return r;
|
|
865
|
+
}, nn = {
|
|
866
|
+
left: 0,
|
|
867
|
+
top: 0,
|
|
868
|
+
right: 0,
|
|
869
|
+
gap: 0
|
|
870
|
+
}, Fe = function(e) {
|
|
871
|
+
return parseInt(e || "", 10) || 0;
|
|
872
|
+
}, on = function(e) {
|
|
873
|
+
var r = window.getComputedStyle(document.body), t = r[e === "padding" ? "paddingLeft" : "marginLeft"], o = r[e === "padding" ? "paddingTop" : "marginTop"], a = r[e === "padding" ? "paddingRight" : "marginRight"];
|
|
874
|
+
return [Fe(t), Fe(o), Fe(a)];
|
|
875
|
+
}, an = function(e) {
|
|
876
|
+
if (e === void 0 && (e = "margin"), typeof window > "u")
|
|
877
|
+
return nn;
|
|
878
|
+
var r = on(e), t = document.documentElement.clientWidth, o = window.innerWidth;
|
|
879
|
+
return {
|
|
880
|
+
left: r[0],
|
|
881
|
+
top: r[1],
|
|
882
|
+
right: r[2],
|
|
883
|
+
gap: Math.max(0, o - t + r[2] - r[0])
|
|
884
|
+
};
|
|
885
|
+
}, cn = Dt(), oe = "data-scroll-locked", sn = function(e, r, t, o) {
|
|
886
|
+
var a = e.left, n = e.top, i = e.right, c = e.gap;
|
|
887
|
+
return t === void 0 && (t = "margin"), `
|
|
888
|
+
.`.concat(Ur, ` {
|
|
889
|
+
overflow: hidden `).concat(o, `;
|
|
890
|
+
padding-right: `).concat(c, "px ").concat(o, `;
|
|
891
|
+
}
|
|
892
|
+
body[`).concat(oe, `] {
|
|
893
|
+
overflow: hidden `).concat(o, `;
|
|
894
|
+
overscroll-behavior: contain;
|
|
895
|
+
`).concat([
|
|
896
|
+
r && "position: relative ".concat(o, ";"),
|
|
897
|
+
t === "margin" && `
|
|
898
|
+
padding-left: `.concat(a, `px;
|
|
899
|
+
padding-top: `).concat(n, `px;
|
|
900
|
+
padding-right: `).concat(i, `px;
|
|
901
|
+
margin-left:0;
|
|
902
|
+
margin-top:0;
|
|
903
|
+
margin-right: `).concat(c, "px ").concat(o, `;
|
|
904
|
+
`),
|
|
905
|
+
t === "padding" && "padding-right: ".concat(c, "px ").concat(o, ";")
|
|
906
|
+
].filter(Boolean).join(""), `
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
.`).concat(we, ` {
|
|
910
|
+
right: `).concat(c, "px ").concat(o, `;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
.`).concat(ye, ` {
|
|
914
|
+
margin-right: `).concat(c, "px ").concat(o, `;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
.`).concat(we, " .").concat(we, ` {
|
|
918
|
+
right: 0 `).concat(o, `;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
.`).concat(ye, " .").concat(ye, ` {
|
|
922
|
+
margin-right: 0 `).concat(o, `;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
body[`).concat(oe, `] {
|
|
926
|
+
`).concat(Hr, ": ").concat(c, `px;
|
|
927
|
+
}
|
|
928
|
+
`);
|
|
929
|
+
}, pt = function() {
|
|
930
|
+
var e = parseInt(document.body.getAttribute(oe) || "0", 10);
|
|
931
|
+
return isFinite(e) ? e : 0;
|
|
932
|
+
}, ln = function() {
|
|
933
|
+
$.useEffect(function() {
|
|
934
|
+
return document.body.setAttribute(oe, (pt() + 1).toString()), function() {
|
|
935
|
+
var e = pt() - 1;
|
|
936
|
+
e <= 0 ? document.body.removeAttribute(oe) : document.body.setAttribute(oe, e.toString());
|
|
937
|
+
};
|
|
938
|
+
}, []);
|
|
939
|
+
}, un = function(e) {
|
|
940
|
+
var r = e.noRelative, t = e.noImportant, o = e.gapMode, a = o === void 0 ? "margin" : o;
|
|
941
|
+
ln();
|
|
942
|
+
var n = $.useMemo(function() {
|
|
943
|
+
return an(a);
|
|
944
|
+
}, [a]);
|
|
945
|
+
return $.createElement(cn, { styles: sn(n, !r, a, t ? "" : "!important") });
|
|
946
|
+
}, Xe = !1;
|
|
947
|
+
if (typeof window < "u")
|
|
948
|
+
try {
|
|
949
|
+
var ve = Object.defineProperty({}, "passive", {
|
|
950
|
+
get: function() {
|
|
951
|
+
return Xe = !0, !0;
|
|
952
|
+
}
|
|
953
|
+
});
|
|
954
|
+
window.addEventListener("test", ve, ve), window.removeEventListener("test", ve, ve);
|
|
955
|
+
} catch {
|
|
956
|
+
Xe = !1;
|
|
957
|
+
}
|
|
958
|
+
var J = Xe ? { passive: !1 } : !1, dn = function(e) {
|
|
959
|
+
return e.tagName === "TEXTAREA";
|
|
960
|
+
}, Nt = function(e, r) {
|
|
961
|
+
var t = window.getComputedStyle(e);
|
|
962
|
+
return (
|
|
963
|
+
// not-not-scrollable
|
|
964
|
+
t[r] !== "hidden" && // contains scroll inside self
|
|
965
|
+
!(t.overflowY === t.overflowX && !dn(e) && t[r] === "visible")
|
|
966
|
+
);
|
|
967
|
+
}, pn = function(e) {
|
|
968
|
+
return Nt(e, "overflowY");
|
|
969
|
+
}, fn = function(e) {
|
|
970
|
+
return Nt(e, "overflowX");
|
|
971
|
+
}, ft = function(e, r) {
|
|
972
|
+
var t = r;
|
|
973
|
+
do {
|
|
974
|
+
typeof ShadowRoot < "u" && t instanceof ShadowRoot && (t = t.host);
|
|
975
|
+
var o = Ot(e, t);
|
|
976
|
+
if (o) {
|
|
977
|
+
var a = Lt(e, t), n = a[1], i = a[2];
|
|
978
|
+
if (n > i)
|
|
979
|
+
return !0;
|
|
980
|
+
}
|
|
981
|
+
t = t.parentNode;
|
|
982
|
+
} while (t && t !== document.body);
|
|
983
|
+
return !1;
|
|
984
|
+
}, vn = function(e) {
|
|
985
|
+
var r = e.scrollTop, t = e.scrollHeight, o = e.clientHeight;
|
|
986
|
+
return [
|
|
987
|
+
r,
|
|
988
|
+
t,
|
|
989
|
+
o
|
|
990
|
+
];
|
|
991
|
+
}, hn = function(e) {
|
|
992
|
+
var r = e.scrollLeft, t = e.scrollWidth, o = e.clientWidth;
|
|
993
|
+
return [
|
|
994
|
+
r,
|
|
995
|
+
t,
|
|
996
|
+
o
|
|
997
|
+
];
|
|
998
|
+
}, Ot = function(e, r) {
|
|
999
|
+
return e === "v" ? pn(r) : fn(r);
|
|
1000
|
+
}, Lt = function(e, r) {
|
|
1001
|
+
return e === "v" ? vn(r) : hn(r);
|
|
1002
|
+
}, bn = function(e, r) {
|
|
1003
|
+
return e === "h" && r === "rtl" ? -1 : 1;
|
|
1004
|
+
}, mn = function(e, r, t, o, a) {
|
|
1005
|
+
var n = bn(e, window.getComputedStyle(r).direction), i = n * o, c = t.target, l = r.contains(c), s = !1, u = i > 0, d = 0, p = 0;
|
|
1006
|
+
do {
|
|
1007
|
+
var v = Lt(e, c), m = v[0], f = v[1], b = v[2], g = f - b - n * m;
|
|
1008
|
+
(m || g) && Ot(e, c) && (d += g, p += m), c = c.parentNode;
|
|
1009
|
+
} while (
|
|
1010
|
+
// portaled content
|
|
1011
|
+
!l && c !== document.body || // self content
|
|
1012
|
+
l && (r.contains(c) || r === c)
|
|
1013
|
+
);
|
|
1014
|
+
return (u && (d === 0 || !a) || !u && (p === 0 || !a)) && (s = !0), s;
|
|
1015
|
+
}, he = function(e) {
|
|
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
|
+
}, ht = function(e) {
|
|
1020
|
+
return e && "current" in e ? e.current : e;
|
|
1021
|
+
}, gn = function(e, r) {
|
|
1022
|
+
return e[0] === r[0] && e[1] === r[1];
|
|
1023
|
+
}, _n = function(e) {
|
|
1024
|
+
return `
|
|
1025
|
+
.block-interactivity-`.concat(e, ` {pointer-events: none;}
|
|
1026
|
+
.allow-interactivity-`).concat(e, ` {pointer-events: all;}
|
|
1027
|
+
`);
|
|
1028
|
+
}, $n = 0, ee = [];
|
|
1029
|
+
function wn(e) {
|
|
1030
|
+
var r = $.useRef([]), t = $.useRef([0, 0]), o = $.useRef(), a = $.useState($n++)[0], n = $.useState(function() {
|
|
1031
|
+
return Dt();
|
|
1032
|
+
})[0], i = $.useRef(e);
|
|
1033
|
+
$.useEffect(function() {
|
|
1034
|
+
i.current = e;
|
|
1035
|
+
}, [e]), $.useEffect(function() {
|
|
1036
|
+
if (e.inert) {
|
|
1037
|
+
document.body.classList.add("block-interactivity-".concat(a));
|
|
1038
|
+
var f = Wr([e.lockRef.current], (e.shards || []).map(ht), !0).filter(Boolean);
|
|
1039
|
+
return f.forEach(function(b) {
|
|
1040
|
+
return b.classList.add("allow-interactivity-".concat(a));
|
|
1041
|
+
}), function() {
|
|
1042
|
+
document.body.classList.remove("block-interactivity-".concat(a)), f.forEach(function(b) {
|
|
1043
|
+
return b.classList.remove("allow-interactivity-".concat(a));
|
|
1044
|
+
});
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
}, [e.inert, e.lockRef.current, e.shards]);
|
|
1048
|
+
var c = $.useCallback(function(f, b) {
|
|
1049
|
+
if ("touches" in f && f.touches.length === 2)
|
|
1050
|
+
return !i.current.allowPinchZoom;
|
|
1051
|
+
var g = he(f), C = t.current, S = "deltaX" in f ? f.deltaX : C[0] - g[0], E = "deltaY" in f ? f.deltaY : C[1] - g[1], P, I = f.target, O = Math.abs(S) > Math.abs(E) ? "h" : "v";
|
|
1052
|
+
if ("touches" in f && O === "h" && I.type === "range")
|
|
1053
|
+
return !1;
|
|
1054
|
+
var x = ft(O, I);
|
|
1055
|
+
if (!x)
|
|
1056
|
+
return !0;
|
|
1057
|
+
if (x ? P = O : (P = O === "v" ? "h" : "v", x = ft(O, I)), !x)
|
|
1058
|
+
return !1;
|
|
1059
|
+
if (!o.current && "changedTouches" in f && (S || E) && (o.current = P), !P)
|
|
1060
|
+
return !0;
|
|
1061
|
+
var T = o.current || P;
|
|
1062
|
+
return mn(T, b, f, T === "h" ? S : E, !0);
|
|
1063
|
+
}, []), l = $.useCallback(function(f) {
|
|
1064
|
+
var b = f;
|
|
1065
|
+
if (!(!ee.length || ee[ee.length - 1] !== n)) {
|
|
1066
|
+
var g = "deltaY" in b ? vt(b) : he(b), C = r.current.filter(function(P) {
|
|
1067
|
+
return P.name === b.type && P.target === b.target && gn(P.delta, g);
|
|
1068
|
+
})[0];
|
|
1069
|
+
if (C && C.should) {
|
|
1070
|
+
b.cancelable && b.preventDefault();
|
|
1071
|
+
return;
|
|
1072
|
+
}
|
|
1073
|
+
if (!C) {
|
|
1074
|
+
var S = (i.current.shards || []).map(ht).filter(Boolean).filter(function(P) {
|
|
1075
|
+
return P.contains(b.target);
|
|
1076
|
+
}), E = S.length > 0 ? c(b, S[0]) : !i.current.noIsolation;
|
|
1077
|
+
E && b.cancelable && b.preventDefault();
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
}, []), s = $.useCallback(function(f, b, g, C) {
|
|
1081
|
+
var S = { name: f, delta: b, target: g, should: C };
|
|
1082
|
+
r.current.push(S), setTimeout(function() {
|
|
1083
|
+
r.current = r.current.filter(function(E) {
|
|
1084
|
+
return E !== S;
|
|
1085
|
+
});
|
|
1086
|
+
}, 1);
|
|
1087
|
+
}, []), u = $.useCallback(function(f) {
|
|
1088
|
+
t.current = he(f), o.current = void 0;
|
|
1089
|
+
}, []), d = $.useCallback(function(f) {
|
|
1090
|
+
s(f.type, vt(f), f.target, c(f, e.lockRef.current));
|
|
1091
|
+
}, []), p = $.useCallback(function(f) {
|
|
1092
|
+
s(f.type, he(f), f.target, c(f, e.lockRef.current));
|
|
1093
|
+
}, []);
|
|
1094
|
+
$.useEffect(function() {
|
|
1095
|
+
return ee.push(n), e.setCallbacks({
|
|
1096
|
+
onScrollCapture: d,
|
|
1097
|
+
onWheelCapture: d,
|
|
1098
|
+
onTouchMoveCapture: p
|
|
1099
|
+
}), document.addEventListener("wheel", l, J), document.addEventListener("touchmove", l, J), document.addEventListener("touchstart", u, J), function() {
|
|
1100
|
+
ee = ee.filter(function(f) {
|
|
1101
|
+
return f !== n;
|
|
1102
|
+
}), document.removeEventListener("wheel", l, J), document.removeEventListener("touchmove", l, J), document.removeEventListener("touchstart", u, J);
|
|
1103
|
+
};
|
|
1104
|
+
}, []);
|
|
1105
|
+
var v = e.removeScrollBar, m = e.inert;
|
|
1106
|
+
return $.createElement(
|
|
1107
|
+
$.Fragment,
|
|
1108
|
+
null,
|
|
1109
|
+
m ? $.createElement(n, { styles: _n(a) }) : null,
|
|
1110
|
+
v ? $.createElement(un, { gapMode: "margin" }) : null
|
|
1111
|
+
);
|
|
1112
|
+
}
|
|
1113
|
+
const yn = Gr(At, wn);
|
|
1114
|
+
var Rt = $.forwardRef(function(e, r) {
|
|
1115
|
+
return $.createElement(Ae, W({}, e, { ref: r, sideCar: yn }));
|
|
1116
|
+
});
|
|
1117
|
+
Rt.classNames = Ae.classNames;
|
|
1118
|
+
var Sn = function(e) {
|
|
1119
|
+
if (typeof document > "u")
|
|
1120
|
+
return null;
|
|
1121
|
+
var r = Array.isArray(e) ? e[0] : e;
|
|
1122
|
+
return r.ownerDocument.body;
|
|
1123
|
+
}, te = /* @__PURE__ */ new WeakMap(), be = /* @__PURE__ */ new WeakMap(), me = {}, je = 0, Mt = function(e) {
|
|
1124
|
+
return e && (e.host || Mt(e.parentNode));
|
|
1125
|
+
}, En = function(e, r) {
|
|
1126
|
+
return r.map(function(t) {
|
|
1127
|
+
if (e.contains(t))
|
|
1128
|
+
return t;
|
|
1129
|
+
var o = Mt(t);
|
|
1130
|
+
return o && e.contains(o) ? o : (console.error("aria-hidden", t, "in not contained inside", e, ". Doing nothing"), null);
|
|
1131
|
+
}).filter(function(t) {
|
|
1132
|
+
return !!t;
|
|
1133
|
+
});
|
|
1134
|
+
}, xn = function(e, r, t, o) {
|
|
1135
|
+
var a = En(r, Array.isArray(e) ? e : [e]);
|
|
1136
|
+
me[t] || (me[t] = /* @__PURE__ */ new WeakMap());
|
|
1137
|
+
var n = me[t], i = [], c = /* @__PURE__ */ new Set(), l = new Set(a), s = function(d) {
|
|
1138
|
+
!d || c.has(d) || (c.add(d), s(d.parentNode));
|
|
1139
|
+
};
|
|
1140
|
+
a.forEach(s);
|
|
1141
|
+
var u = function(d) {
|
|
1142
|
+
!d || l.has(d) || Array.prototype.forEach.call(d.children, function(p) {
|
|
1143
|
+
if (c.has(p))
|
|
1144
|
+
u(p);
|
|
1145
|
+
else
|
|
1146
|
+
try {
|
|
1147
|
+
var v = p.getAttribute(o), m = v !== null && v !== "false", f = (te.get(p) || 0) + 1, b = (n.get(p) || 0) + 1;
|
|
1148
|
+
te.set(p, f), n.set(p, b), i.push(p), f === 1 && m && be.set(p, !0), b === 1 && p.setAttribute(t, "true"), m || p.setAttribute(o, "true");
|
|
1149
|
+
} catch (g) {
|
|
1150
|
+
console.error("aria-hidden: cannot operate on ", p, g);
|
|
1151
|
+
}
|
|
1152
|
+
});
|
|
1153
|
+
};
|
|
1154
|
+
return u(r), c.clear(), je++, function() {
|
|
1155
|
+
i.forEach(function(d) {
|
|
1156
|
+
var p = te.get(d) - 1, v = n.get(d) - 1;
|
|
1157
|
+
te.set(d, p), n.set(d, v), p || (be.has(d) || d.removeAttribute(o), be.delete(d)), v || d.removeAttribute(t);
|
|
1158
|
+
}), je--, je || (te = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), be = /* @__PURE__ */ new WeakMap(), me = {});
|
|
1159
|
+
};
|
|
1160
|
+
}, Cn = function(e, r, t) {
|
|
1161
|
+
t === void 0 && (t = "data-aria-hidden");
|
|
1162
|
+
var o = Array.from(Array.isArray(e) ? e : [e]), a = Sn(e);
|
|
1163
|
+
return a ? (o.push.apply(o, Array.from(a.querySelectorAll("[aria-live]"))), xn(o, a, t, "aria-hidden")) : function() {
|
|
1164
|
+
return null;
|
|
1165
|
+
};
|
|
1166
|
+
};
|
|
1167
|
+
const It = "Dialog", [kt, ga] = Et(It), [Pn, j] = kt(It), Tn = (e) => {
|
|
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
|
+
prop: o,
|
|
1170
|
+
defaultProp: a,
|
|
1171
|
+
onChange: n
|
|
1172
|
+
});
|
|
1173
|
+
return /* @__PURE__ */ h(Pn, {
|
|
1174
|
+
scope: r,
|
|
1175
|
+
triggerRef: c,
|
|
1176
|
+
contentRef: l,
|
|
1177
|
+
contentId: Oe(),
|
|
1178
|
+
titleId: Oe(),
|
|
1179
|
+
descriptionId: Oe(),
|
|
1180
|
+
open: s,
|
|
1181
|
+
onOpenChange: u,
|
|
1182
|
+
onOpenToggle: ae(
|
|
1183
|
+
() => u(
|
|
1184
|
+
(d) => !d
|
|
1185
|
+
),
|
|
1186
|
+
[
|
|
1187
|
+
u
|
|
1188
|
+
]
|
|
1189
|
+
),
|
|
1190
|
+
modal: i
|
|
1191
|
+
}, t);
|
|
1192
|
+
}, An = "DialogTrigger", Dn = /* @__PURE__ */ w((e, r) => {
|
|
1193
|
+
const { __scopeDialog: t, ...o } = e, a = j(An, t), n = k(r, a.triggerRef);
|
|
1194
|
+
return /* @__PURE__ */ h(F.button, y({
|
|
1195
|
+
type: "button",
|
|
1196
|
+
"aria-haspopup": "dialog",
|
|
1197
|
+
"aria-expanded": a.open,
|
|
1198
|
+
"aria-controls": a.contentId,
|
|
1199
|
+
"data-state": tt(a.open)
|
|
1200
|
+
}, o, {
|
|
1201
|
+
ref: n,
|
|
1202
|
+
onClick: L(e.onClick, a.onOpenToggle)
|
|
1203
|
+
}));
|
|
1204
|
+
}), Ft = "DialogPortal", [Nn, jt] = kt(Ft, {
|
|
1205
|
+
forceMount: void 0
|
|
1206
|
+
}), On = (e) => {
|
|
1207
|
+
const { __scopeDialog: r, forceMount: t, children: o, container: a } = e, n = j(Ft, r);
|
|
1208
|
+
return /* @__PURE__ */ h(Nn, {
|
|
1209
|
+
scope: r,
|
|
1210
|
+
forceMount: t
|
|
1211
|
+
}, Z.map(
|
|
1212
|
+
o,
|
|
1213
|
+
(i) => /* @__PURE__ */ h(q, {
|
|
1214
|
+
present: t || n.open
|
|
1215
|
+
}, /* @__PURE__ */ h(kr, {
|
|
1216
|
+
asChild: !0,
|
|
1217
|
+
container: a
|
|
1218
|
+
}, i))
|
|
1219
|
+
));
|
|
1220
|
+
}, Be = "DialogOverlay", Ln = /* @__PURE__ */ w((e, r) => {
|
|
1221
|
+
const t = jt(Be, e.__scopeDialog), { forceMount: o = t.forceMount, ...a } = e, n = j(Be, e.__scopeDialog);
|
|
1222
|
+
return n.modal ? /* @__PURE__ */ h(q, {
|
|
1223
|
+
present: o || n.open
|
|
1224
|
+
}, /* @__PURE__ */ h(Rn, y({}, a, {
|
|
1225
|
+
ref: r
|
|
1226
|
+
}))) : null;
|
|
1227
|
+
}), Rn = /* @__PURE__ */ w((e, r) => {
|
|
1228
|
+
const { __scopeDialog: t, ...o } = e, a = j(Be, t);
|
|
1229
|
+
return (
|
|
1230
|
+
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
1231
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
1232
|
+
/* @__PURE__ */ h(Rt, {
|
|
1233
|
+
as: et,
|
|
1234
|
+
allowPinchZoom: !0,
|
|
1235
|
+
shards: [
|
|
1236
|
+
a.contentRef
|
|
1237
|
+
]
|
|
1238
|
+
}, /* @__PURE__ */ h(F.div, y({
|
|
1239
|
+
"data-state": tt(a.open)
|
|
1240
|
+
}, o, {
|
|
1241
|
+
ref: r,
|
|
1242
|
+
style: {
|
|
1243
|
+
pointerEvents: "auto",
|
|
1244
|
+
...o.style
|
|
1245
|
+
}
|
|
1246
|
+
})))
|
|
1247
|
+
);
|
|
1248
|
+
}), pe = "DialogContent", Mn = /* @__PURE__ */ w((e, r) => {
|
|
1249
|
+
const t = jt(pe, e.__scopeDialog), { forceMount: o = t.forceMount, ...a } = e, n = j(pe, e.__scopeDialog);
|
|
1250
|
+
return /* @__PURE__ */ h(q, {
|
|
1251
|
+
present: o || n.open
|
|
1252
|
+
}, n.modal ? /* @__PURE__ */ h(In, y({}, a, {
|
|
1253
|
+
ref: r
|
|
1254
|
+
})) : /* @__PURE__ */ h(kn, y({}, a, {
|
|
1255
|
+
ref: r
|
|
1256
|
+
})));
|
|
1257
|
+
}), In = /* @__PURE__ */ w((e, r) => {
|
|
1258
|
+
const t = j(pe, e.__scopeDialog), o = A(null), a = k(r, t.contentRef, o);
|
|
1259
|
+
return D(() => {
|
|
1260
|
+
const n = o.current;
|
|
1261
|
+
if (n) return Cn(n);
|
|
1262
|
+
}, []), /* @__PURE__ */ h(zt, y({}, e, {
|
|
1263
|
+
ref: a,
|
|
1264
|
+
trapFocus: t.open,
|
|
1265
|
+
disableOutsidePointerEvents: !0,
|
|
1266
|
+
onCloseAutoFocus: L(e.onCloseAutoFocus, (n) => {
|
|
1267
|
+
var i;
|
|
1268
|
+
n.preventDefault(), (i = t.triggerRef.current) === null || i === void 0 || i.focus();
|
|
1269
|
+
}),
|
|
1270
|
+
onPointerDownOutside: L(e.onPointerDownOutside, (n) => {
|
|
1271
|
+
const i = n.detail.originalEvent, c = i.button === 0 && i.ctrlKey === !0;
|
|
1272
|
+
(i.button === 2 || c) && n.preventDefault();
|
|
1273
|
+
}),
|
|
1274
|
+
onFocusOutside: L(
|
|
1275
|
+
e.onFocusOutside,
|
|
1276
|
+
(n) => n.preventDefault()
|
|
1277
|
+
)
|
|
1278
|
+
}));
|
|
1279
|
+
}), kn = /* @__PURE__ */ w((e, r) => {
|
|
1280
|
+
const t = j(pe, e.__scopeDialog), o = A(!1), a = A(!1);
|
|
1281
|
+
return /* @__PURE__ */ h(zt, y({}, e, {
|
|
1282
|
+
ref: r,
|
|
1283
|
+
trapFocus: !1,
|
|
1284
|
+
disableOutsidePointerEvents: !1,
|
|
1285
|
+
onCloseAutoFocus: (n) => {
|
|
1286
|
+
var i;
|
|
1287
|
+
if ((i = e.onCloseAutoFocus) === null || i === void 0 || i.call(e, n), !n.defaultPrevented) {
|
|
1288
|
+
var c;
|
|
1289
|
+
o.current || (c = t.triggerRef.current) === null || c === void 0 || c.focus(), n.preventDefault();
|
|
1290
|
+
}
|
|
1291
|
+
o.current = !1, a.current = !1;
|
|
1292
|
+
},
|
|
1293
|
+
onInteractOutside: (n) => {
|
|
1294
|
+
var i, c;
|
|
1295
|
+
(i = e.onInteractOutside) === null || i === void 0 || i.call(e, n), n.defaultPrevented || (o.current = !0, n.detail.originalEvent.type === "pointerdown" && (a.current = !0));
|
|
1296
|
+
const l = n.target;
|
|
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
|
+
}
|
|
1299
|
+
}));
|
|
1300
|
+
}), zt = /* @__PURE__ */ w((e, r) => {
|
|
1301
|
+
const { __scopeDialog: t, trapFocus: o, onOpenAutoFocus: a, onCloseAutoFocus: n, ...i } = e, c = j(pe, t), l = A(null), s = k(r, l);
|
|
1302
|
+
return zr(), /* @__PURE__ */ h(Je, null, /* @__PURE__ */ h(Dr, {
|
|
1303
|
+
asChild: !0,
|
|
1304
|
+
loop: !0,
|
|
1305
|
+
trapped: o,
|
|
1306
|
+
onMountAutoFocus: a,
|
|
1307
|
+
onUnmountAutoFocus: n
|
|
1308
|
+
}, /* @__PURE__ */ h(Pr, y({
|
|
1309
|
+
role: "dialog",
|
|
1310
|
+
id: c.contentId,
|
|
1311
|
+
"aria-describedby": c.descriptionId,
|
|
1312
|
+
"aria-labelledby": c.titleId,
|
|
1313
|
+
"data-state": tt(c.open)
|
|
1314
|
+
}, i, {
|
|
1315
|
+
ref: s,
|
|
1316
|
+
onDismiss: () => c.onOpenChange(!1)
|
|
1317
|
+
}))), !1);
|
|
1318
|
+
}), Fn = "DialogTitle", jn = /* @__PURE__ */ w((e, r) => {
|
|
1319
|
+
const { __scopeDialog: t, ...o } = e, a = j(Fn, t);
|
|
1320
|
+
return /* @__PURE__ */ h(F.h2, y({
|
|
1321
|
+
id: a.titleId
|
|
1322
|
+
}, o, {
|
|
1323
|
+
ref: r
|
|
1324
|
+
}));
|
|
1325
|
+
}), zn = "DialogDescription", Wn = /* @__PURE__ */ w((e, r) => {
|
|
1326
|
+
const { __scopeDialog: t, ...o } = e, a = j(zn, t);
|
|
1327
|
+
return /* @__PURE__ */ h(F.p, y({
|
|
1328
|
+
id: a.descriptionId
|
|
1329
|
+
}, o, {
|
|
1330
|
+
ref: r
|
|
1331
|
+
}));
|
|
1332
|
+
}), Un = "DialogClose", Hn = /* @__PURE__ */ w((e, r) => {
|
|
1333
|
+
const { __scopeDialog: t, ...o } = e, a = j(Un, t);
|
|
1334
|
+
return /* @__PURE__ */ h(F.button, y({
|
|
1335
|
+
type: "button"
|
|
1336
|
+
}, o, {
|
|
1337
|
+
ref: r,
|
|
1338
|
+
onClick: L(
|
|
1339
|
+
e.onClick,
|
|
1340
|
+
() => a.onOpenChange(!1)
|
|
1341
|
+
)
|
|
1342
|
+
}));
|
|
1343
|
+
});
|
|
1344
|
+
function tt(e) {
|
|
1345
|
+
return e ? "open" : "closed";
|
|
1346
|
+
}
|
|
1347
|
+
const Yn = Tn, Xn = Dn, Bn = On, Vn = Ln, qn = Mn, bt = jn, Kn = Wn, Gn = Hn;
|
|
1348
|
+
function Zn(e) {
|
|
1349
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1350
|
+
}
|
|
1351
|
+
var Wt = { exports: {} };
|
|
1352
|
+
/*!
|
|
1353
|
+
Copyright (c) 2018 Jed Watson.
|
|
1354
|
+
Licensed under the MIT License (MIT), see
|
|
1355
|
+
http://jedwatson.github.io/classnames
|
|
1356
|
+
*/
|
|
1357
|
+
(function(e) {
|
|
1358
|
+
(function() {
|
|
1359
|
+
var r = {}.hasOwnProperty;
|
|
1360
|
+
function t() {
|
|
1361
|
+
for (var n = "", i = 0; i < arguments.length; i++) {
|
|
1362
|
+
var c = arguments[i];
|
|
1363
|
+
c && (n = a(n, o.call(this, c)));
|
|
1364
|
+
}
|
|
1365
|
+
return n;
|
|
1366
|
+
}
|
|
1367
|
+
function o(n) {
|
|
1368
|
+
if (typeof n == "string" || typeof n == "number")
|
|
1369
|
+
return this && this[n] || n;
|
|
1370
|
+
if (typeof n != "object")
|
|
1371
|
+
return "";
|
|
1372
|
+
if (Array.isArray(n))
|
|
1373
|
+
return t.apply(this, n);
|
|
1374
|
+
if (n.toString !== Object.prototype.toString && !n.toString.toString().includes("[native code]"))
|
|
1375
|
+
return n.toString();
|
|
1376
|
+
var i = "";
|
|
1377
|
+
for (var c in n)
|
|
1378
|
+
r.call(n, c) && n[c] && (i = a(i, this && this[c] || c));
|
|
1379
|
+
return i;
|
|
1380
|
+
}
|
|
1381
|
+
function a(n, i) {
|
|
1382
|
+
return i ? n ? n + " " + i : n + i : n;
|
|
1383
|
+
}
|
|
1384
|
+
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
1385
|
+
})();
|
|
1386
|
+
})(Wt);
|
|
1387
|
+
var Qn = Wt.exports;
|
|
1388
|
+
const Q = /* @__PURE__ */ Zn(Qn), Ut = de(null), Jn = {
|
|
1389
|
+
"purpur-drawer": "_purpur-drawer_xzrkg_1"
|
|
1390
|
+
}, eo = "_drawerSmallScreenAnimation_1j9c0_1", to = "_drawerLargeScreenAnimation_1j9c0_1", ro = "_slideDown_1j9c0_1", no = "_overlayAnimation_1j9c0_1", oo = {
|
|
1391
|
+
"purpur-drawer-content": "_purpur-drawer-content_1j9c0_1",
|
|
1392
|
+
drawerSmallScreenAnimation: eo,
|
|
1393
|
+
drawerLargeScreenAnimation: to,
|
|
1394
|
+
"purpur-drawer-content__content-container": "_purpur-drawer-content__content-container_1j9c0_22",
|
|
1395
|
+
"purpur-drawer-content__drawer-frame": "_purpur-drawer-content__drawer-frame_1j9c0_27",
|
|
1396
|
+
slideDown: ro,
|
|
1397
|
+
"purpur-drawer-content__description": "_purpur-drawer-content__description_1j9c0_37",
|
|
1398
|
+
"purpur-drawer-overlay": "_purpur-drawer-overlay_1j9c0_48",
|
|
1399
|
+
overlayAnimation: no
|
|
1400
|
+
}, ao = {
|
|
1401
|
+
"purpur-drawer-container--header": "_purpur-drawer-container--header_1r6tb_1",
|
|
1402
|
+
"purpur-drawer-container--body": "_purpur-drawer-container--body_1r6tb_5",
|
|
1403
|
+
"purpur-drawer-container--sticky": "_purpur-drawer-container--sticky_1r6tb_8",
|
|
1404
|
+
"purpur-drawer-container--footer": "_purpur-drawer-container--footer_1r6tb_11"
|
|
1405
|
+
}, co = Q.bind(ao), ze = "purpur-drawer-container", ne = w(
|
|
1406
|
+
({
|
|
1407
|
+
["data-testid"]: e = "purpur-drawer-container",
|
|
1408
|
+
children: r,
|
|
1409
|
+
className: t,
|
|
1410
|
+
variant: o = "body",
|
|
1411
|
+
stickyFooter: a,
|
|
1412
|
+
...n
|
|
1413
|
+
}, i) => {
|
|
1414
|
+
const c = co([
|
|
1415
|
+
t,
|
|
1416
|
+
ze,
|
|
1417
|
+
{
|
|
1418
|
+
[`${ze}--${o}`]: o
|
|
1419
|
+
},
|
|
1420
|
+
{
|
|
1421
|
+
[`${ze}--sticky`]: a
|
|
1422
|
+
}
|
|
1423
|
+
]);
|
|
1424
|
+
return /* @__PURE__ */ _("div", { className: c, "data-testid": e, ref: i, ...n, children: r });
|
|
1425
|
+
}
|
|
1426
|
+
);
|
|
1427
|
+
ne.displayName = "DrawerContainer";
|
|
1428
|
+
const io = {
|
|
1429
|
+
"purpur-drawer-frame": "_purpur-drawer-frame_jj7dt_1",
|
|
1430
|
+
"purpur-drawer-frame--sticky-footer": "_purpur-drawer-frame--sticky-footer_jj7dt_17",
|
|
1431
|
+
"purpur-drawer-frame__header": "_purpur-drawer-frame__header_jj7dt_20",
|
|
1432
|
+
"purpur-drawer-frame__body": "_purpur-drawer-frame__body_jj7dt_23",
|
|
1433
|
+
"purpur-drawer-frame__footer": "_purpur-drawer-frame__footer_jj7dt_27",
|
|
1434
|
+
"purpur-drawer-frame__content-container": "_purpur-drawer-frame__content-container_jj7dt_30",
|
|
1435
|
+
"purpur-drawer-frame__content-container--no-footer": "_purpur-drawer-frame__content-container--no-footer_jj7dt_35"
|
|
1436
|
+
}, so = {
|
|
1437
|
+
"purpur-drawer-handle": "_purpur-drawer-handle_3n0ew_1"
|
|
1438
|
+
}, lo = (e, r, t, o, a, n) => ({
|
|
1439
|
+
onPointerDown: (s) => {
|
|
1440
|
+
e.current = { y: s.clientY };
|
|
1441
|
+
},
|
|
1442
|
+
onPointerMove: (s) => {
|
|
1443
|
+
if (!e.current)
|
|
1444
|
+
return;
|
|
1445
|
+
const u = s.clientY - e.current.y, d = !!r.current, p = Math.max(0, u), v = s.pointerType === "touch" ? 10 : 2, m = { y: p }, f = { originalEvent: s, delta: m };
|
|
1446
|
+
d ? (r.current = m, o(f)) : mt(m, 0) ? (r.current = m, t(), s.target.setPointerCapture(s.pointerId)) : Math.abs(u) > v && (e.current = null);
|
|
1447
|
+
},
|
|
1448
|
+
onPointerUp: (s) => {
|
|
1449
|
+
const u = r.current, d = s.target;
|
|
1450
|
+
if (d.hasPointerCapture(s.pointerId) && d.releasePointerCapture(s.pointerId), r.current = null, e.current = null, u) {
|
|
1451
|
+
const p = s.currentTarget, v = { originalEvent: s, delta: u };
|
|
1452
|
+
mt(u, 0) && u.y > 200 ? n(v) : a(), p.addEventListener("click", (m) => m.preventDefault(), {
|
|
1453
|
+
once: !0
|
|
1454
|
+
});
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
}), mt = (e, r = 0) => Math.abs(e.y) > r, uo = Q.bind(so), po = "purpur-drawer-handle", Ht = w(
|
|
1458
|
+
({
|
|
1459
|
+
["data-testid"]: e = "purpur-drawer-handle",
|
|
1460
|
+
className: r,
|
|
1461
|
+
onSwipeStart: t,
|
|
1462
|
+
onSwipeMove: o,
|
|
1463
|
+
onSwipeCancel: a,
|
|
1464
|
+
onSwipeEnd: n,
|
|
1465
|
+
...i
|
|
1466
|
+
}, c) => {
|
|
1467
|
+
const l = uo([r, po]), s = Ue.useRef(null), u = Ue.useRef(null), { onPointerDown: d, onPointerMove: p, onPointerUp: v } = lo(
|
|
1468
|
+
u,
|
|
1469
|
+
s,
|
|
1470
|
+
t,
|
|
1471
|
+
o,
|
|
1472
|
+
a,
|
|
1473
|
+
n
|
|
1474
|
+
);
|
|
1475
|
+
return /* @__PURE__ */ _(
|
|
1476
|
+
"div",
|
|
1477
|
+
{
|
|
1478
|
+
className: l,
|
|
1479
|
+
"data-testid": e,
|
|
1480
|
+
onPointerDown: d,
|
|
1481
|
+
onPointerMove: p,
|
|
1482
|
+
onPointerUp: v,
|
|
1483
|
+
ref: c,
|
|
1484
|
+
...i
|
|
1485
|
+
}
|
|
1486
|
+
);
|
|
1487
|
+
}
|
|
1488
|
+
);
|
|
1489
|
+
Ht.displayName = "DrawerHandle";
|
|
1490
|
+
const fo = {
|
|
1491
|
+
PRIMARY: "primary",
|
|
1492
|
+
SECONDARY: "secondary",
|
|
1493
|
+
EXPRESSIVE: "expressive"
|
|
1494
|
+
}, vo = {
|
|
1495
|
+
SM: "sm",
|
|
1496
|
+
MD: "md",
|
|
1497
|
+
LG: "lg"
|
|
1498
|
+
};
|
|
1499
|
+
function ho(e) {
|
|
1500
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1501
|
+
}
|
|
1502
|
+
var Yt = { exports: {} };
|
|
1503
|
+
/*!
|
|
1504
|
+
Copyright (c) 2018 Jed Watson.
|
|
1505
|
+
Licensed under the MIT License (MIT), see
|
|
1506
|
+
http://jedwatson.github.io/classnames
|
|
1507
|
+
*/
|
|
1508
|
+
(function(e) {
|
|
1509
|
+
(function() {
|
|
1510
|
+
var r = {}.hasOwnProperty;
|
|
1511
|
+
function t() {
|
|
1512
|
+
for (var n = "", i = 0; i < arguments.length; i++) {
|
|
1513
|
+
var c = arguments[i];
|
|
1514
|
+
c && (n = a(n, o(c)));
|
|
1515
|
+
}
|
|
1516
|
+
return n;
|
|
1517
|
+
}
|
|
1518
|
+
function o(n) {
|
|
1519
|
+
if (typeof n == "string" || typeof n == "number")
|
|
1520
|
+
return n;
|
|
1521
|
+
if (typeof n != "object")
|
|
1522
|
+
return "";
|
|
1523
|
+
if (Array.isArray(n))
|
|
1524
|
+
return t.apply(null, n);
|
|
1525
|
+
if (n.toString !== Object.prototype.toString && !n.toString.toString().includes("[native code]"))
|
|
1526
|
+
return n.toString();
|
|
1527
|
+
var i = "";
|
|
1528
|
+
for (var c in n)
|
|
1529
|
+
r.call(n, c) && n[c] && (i = a(i, c));
|
|
1530
|
+
return i;
|
|
1531
|
+
}
|
|
1532
|
+
function a(n, i) {
|
|
1533
|
+
return i ? n ? n + " " + i : n + i : n;
|
|
1534
|
+
}
|
|
1535
|
+
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
1536
|
+
})();
|
|
1537
|
+
})(Yt);
|
|
1538
|
+
var bo = Yt.exports;
|
|
1539
|
+
const gt = /* @__PURE__ */ ho(bo), mo = "_rotate_1xozj_1", go = "_dash_1xozj_1", ce = {
|
|
1540
|
+
"purpur-spinner": "_purpur-spinner_1xozj_1",
|
|
1541
|
+
rotate: mo,
|
|
1542
|
+
"purpur-spinner--xxs": "_purpur-spinner--xxs_1xozj_4",
|
|
1543
|
+
"purpur-spinner--xs": "_purpur-spinner--xs_1xozj_8",
|
|
1544
|
+
"purpur-spinner--sm": "_purpur-spinner--sm_1xozj_12",
|
|
1545
|
+
"purpur-spinner--md": "_purpur-spinner--md_1xozj_16",
|
|
1546
|
+
"purpur-spinner--lg": "_purpur-spinner--lg_1xozj_20",
|
|
1547
|
+
"purpur-spinner__circle": "_purpur-spinner__circle_1xozj_24",
|
|
1548
|
+
dash: go,
|
|
1549
|
+
"purpur-spinner__circle--disabled": "_purpur-spinner__circle--disabled_1xozj_33",
|
|
1550
|
+
"purpur-spinner__circle--negative": "_purpur-spinner__circle--negative_1xozj_36"
|
|
1551
|
+
}, ie = "purpur-spinner", _o = {
|
|
1552
|
+
XXS: "xxs",
|
|
1553
|
+
XS: "xs",
|
|
1554
|
+
SM: "sm",
|
|
1555
|
+
MD: "md",
|
|
1556
|
+
LG: "lg"
|
|
1557
|
+
}, $o = ({
|
|
1558
|
+
["data-testid"]: e,
|
|
1559
|
+
disabled: r = !1,
|
|
1560
|
+
negative: t = !1,
|
|
1561
|
+
size: o = _o.SM,
|
|
1562
|
+
...a
|
|
1563
|
+
}) => /* @__PURE__ */ _(
|
|
1564
|
+
"div",
|
|
1565
|
+
{
|
|
1566
|
+
className: gt([ce[ie], ce[`${ie}--${o}`]]),
|
|
1567
|
+
"data-testid": e,
|
|
1568
|
+
...a,
|
|
1569
|
+
children: /* @__PURE__ */ _("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ _(
|
|
1570
|
+
"circle",
|
|
1571
|
+
{
|
|
1572
|
+
className: gt(ce[`${ie}__circle`], {
|
|
1573
|
+
[ce[`${ie}__circle--disabled`]]: r,
|
|
1574
|
+
[ce[`${ie}__circle--negative`]]: t
|
|
1575
|
+
}),
|
|
1576
|
+
cx: "25",
|
|
1577
|
+
cy: "25",
|
|
1578
|
+
r: "20"
|
|
1579
|
+
}
|
|
1580
|
+
) })
|
|
1581
|
+
}
|
|
1582
|
+
);
|
|
1583
|
+
function wo(e) {
|
|
1584
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1585
|
+
}
|
|
1586
|
+
var Xt = { exports: {} };
|
|
1587
|
+
/*!
|
|
1588
|
+
Copyright (c) 2018 Jed Watson.
|
|
1589
|
+
Licensed under the MIT License (MIT), see
|
|
1590
|
+
http://jedwatson.github.io/classnames
|
|
1591
|
+
*/
|
|
1592
|
+
(function(e) {
|
|
1593
|
+
(function() {
|
|
1594
|
+
var r = {}.hasOwnProperty;
|
|
1595
|
+
function t() {
|
|
1596
|
+
for (var n = "", i = 0; i < arguments.length; i++) {
|
|
1597
|
+
var c = arguments[i];
|
|
1598
|
+
c && (n = a(n, o.call(this, c)));
|
|
1599
|
+
}
|
|
1600
|
+
return n;
|
|
1601
|
+
}
|
|
1602
|
+
function o(n) {
|
|
1603
|
+
if (typeof n == "string" || typeof n == "number")
|
|
1604
|
+
return this && this[n] || n;
|
|
1605
|
+
if (typeof n != "object")
|
|
1606
|
+
return "";
|
|
1607
|
+
if (Array.isArray(n))
|
|
1608
|
+
return t.apply(this, n);
|
|
1609
|
+
if (n.toString !== Object.prototype.toString && !n.toString.toString().includes("[native code]"))
|
|
1610
|
+
return n.toString();
|
|
1611
|
+
var i = "";
|
|
1612
|
+
for (var c in n)
|
|
1613
|
+
r.call(n, c) && n[c] && (i = a(i, this && this[c] || c));
|
|
1614
|
+
return i;
|
|
1615
|
+
}
|
|
1616
|
+
function a(n, i) {
|
|
1617
|
+
return i ? n ? n + " " + i : n + i : n;
|
|
1618
|
+
}
|
|
1619
|
+
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
1620
|
+
})();
|
|
1621
|
+
})(Xt);
|
|
1622
|
+
var yo = Xt.exports;
|
|
1623
|
+
const So = /* @__PURE__ */ wo(yo), Eo = {
|
|
1624
|
+
"purpur-button": "_purpur-button_1acxn_1",
|
|
1625
|
+
"purpur-button--sm": "_purpur-button--sm_1acxn_33",
|
|
1626
|
+
"purpur-button--icon-only": "_purpur-button--icon-only_1acxn_36",
|
|
1627
|
+
"purpur-button--md": "_purpur-button--md_1acxn_39",
|
|
1628
|
+
"purpur-button--lg": "_purpur-button--lg_1acxn_45",
|
|
1629
|
+
"purpur-button--full-width": "_purpur-button--full-width_1acxn_51",
|
|
1630
|
+
"purpur-button--primary": "_purpur-button--primary_1acxn_54",
|
|
1631
|
+
"purpur-button--disabled": "_purpur-button--disabled_1acxn_58",
|
|
1632
|
+
"purpur-button--primary-negative": "_purpur-button--primary-negative_1acxn_64",
|
|
1633
|
+
"purpur-button--secondary": "_purpur-button--secondary_1acxn_76",
|
|
1634
|
+
"purpur-button--secondary-negative": "_purpur-button--secondary-negative_1acxn_87",
|
|
1635
|
+
"purpur-button--expressive": "_purpur-button--expressive_1acxn_98",
|
|
1636
|
+
"purpur-button--expressive-negative": "_purpur-button--expressive-negative_1acxn_108",
|
|
1637
|
+
"purpur-button--negative": "_purpur-button--negative_1acxn_120",
|
|
1638
|
+
"purpur-button--destructive": "_purpur-button--destructive_1acxn_127",
|
|
1639
|
+
"purpur-button--destructive-negative": "_purpur-button--destructive-negative_1acxn_137",
|
|
1640
|
+
"purpur-button--tertiary-purple": "_purpur-button--tertiary-purple_1acxn_147",
|
|
1641
|
+
"purpur-button--tertiary-purple-negative": "_purpur-button--tertiary-purple-negative_1acxn_160",
|
|
1642
|
+
"purpur-button--text-negative": "_purpur-button--text-negative_1acxn_175",
|
|
1643
|
+
"purpur-button--text": "_purpur-button--text_1acxn_175"
|
|
1644
|
+
}, We = {
|
|
1645
|
+
...fo,
|
|
1646
|
+
DESTRUCTIVE: "destructive",
|
|
1647
|
+
TERTIARY_PURPLE: "tertiary-purple",
|
|
1648
|
+
TEXT: "text"
|
|
1649
|
+
}, xo = So.bind(Eo), K = "purpur-button", Co = ({
|
|
1650
|
+
children: e,
|
|
1651
|
+
className: r,
|
|
1652
|
+
["data-testid"]: t,
|
|
1653
|
+
disabled: o = !1,
|
|
1654
|
+
fullWidth: a = !1,
|
|
1655
|
+
iconOnly: n,
|
|
1656
|
+
loading: i = !1,
|
|
1657
|
+
negative: c = !1,
|
|
1658
|
+
onClick: l,
|
|
1659
|
+
size: s = "md",
|
|
1660
|
+
variant: u,
|
|
1661
|
+
type: d = "button",
|
|
1662
|
+
...p
|
|
1663
|
+
}, v) => {
|
|
1664
|
+
if (n && u === "destructive")
|
|
1665
|
+
return null;
|
|
1666
|
+
const m = xo(
|
|
1667
|
+
[
|
|
1668
|
+
K,
|
|
1669
|
+
`${K}--${c ? `${u}-negative` : u}`,
|
|
1670
|
+
`${K}--${s}`
|
|
1671
|
+
],
|
|
1672
|
+
{
|
|
1673
|
+
[`${K}--icon-only`]: n,
|
|
1674
|
+
[`${K}--negative`]: c,
|
|
1675
|
+
[`${K}--full-width`]: a,
|
|
1676
|
+
[`${K}--disabled`]: o || i
|
|
1677
|
+
},
|
|
1678
|
+
r
|
|
1679
|
+
), f = (g) => {
|
|
1680
|
+
o || i ? g.preventDefault() : l && l(g);
|
|
1681
|
+
}, b = !!p["aria-disabled"] || o || i;
|
|
1682
|
+
return /* @__PURE__ */ Y(
|
|
1683
|
+
"button",
|
|
1684
|
+
{
|
|
1685
|
+
className: m,
|
|
1686
|
+
"data-testid": t,
|
|
1687
|
+
type: d,
|
|
1688
|
+
ref: v,
|
|
1689
|
+
"aria-disabled": b,
|
|
1690
|
+
onClick: f,
|
|
1691
|
+
...p,
|
|
1692
|
+
children: [
|
|
1693
|
+
i && /* @__PURE__ */ _($o, { size: s === vo.LG ? "xs" : "xxs", negative: c, disabled: b }),
|
|
1694
|
+
" ",
|
|
1695
|
+
e
|
|
1696
|
+
]
|
|
1697
|
+
}
|
|
1698
|
+
);
|
|
1699
|
+
}, Ve = w(Co);
|
|
1700
|
+
Ve.displayName = "Button";
|
|
1701
|
+
function Po(e) {
|
|
1702
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1703
|
+
}
|
|
1704
|
+
var Bt = { exports: {} };
|
|
1705
|
+
/*!
|
|
1706
|
+
Copyright (c) 2018 Jed Watson.
|
|
1707
|
+
Licensed under the MIT License (MIT), see
|
|
1708
|
+
http://jedwatson.github.io/classnames
|
|
1709
|
+
*/
|
|
1710
|
+
(function(e) {
|
|
1711
|
+
(function() {
|
|
1712
|
+
var r = {}.hasOwnProperty;
|
|
1713
|
+
function t() {
|
|
1714
|
+
for (var n = "", i = 0; i < arguments.length; i++) {
|
|
1715
|
+
var c = arguments[i];
|
|
1716
|
+
c && (n = a(n, o(c)));
|
|
1717
|
+
}
|
|
1718
|
+
return n;
|
|
1719
|
+
}
|
|
1720
|
+
function o(n) {
|
|
1721
|
+
if (typeof n == "string" || typeof n == "number")
|
|
1722
|
+
return n;
|
|
1723
|
+
if (typeof n != "object")
|
|
1724
|
+
return "";
|
|
1725
|
+
if (Array.isArray(n))
|
|
1726
|
+
return t.apply(null, n);
|
|
1727
|
+
if (n.toString !== Object.prototype.toString && !n.toString.toString().includes("[native code]"))
|
|
1728
|
+
return n.toString();
|
|
1729
|
+
var i = "";
|
|
1730
|
+
for (var c in n)
|
|
1731
|
+
r.call(n, c) && n[c] && (i = a(i, c));
|
|
1732
|
+
return i;
|
|
1733
|
+
}
|
|
1734
|
+
function a(n, i) {
|
|
1735
|
+
return i ? n ? n + " " + i : n + i : n;
|
|
1736
|
+
}
|
|
1737
|
+
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
1738
|
+
})();
|
|
1739
|
+
})(Bt);
|
|
1740
|
+
var To = Bt.exports;
|
|
1741
|
+
const Ao = /* @__PURE__ */ Po(To), ge = {
|
|
1742
|
+
"purpur-heading": "_purpur-heading_k9fhq_1",
|
|
1743
|
+
"purpur-heading--hyphens": "_purpur-heading--hyphens_k9fhq_8",
|
|
1744
|
+
"purpur-heading--negative": "_purpur-heading--negative_k9fhq_11",
|
|
1745
|
+
"purpur-heading--subsection-100": "_purpur-heading--subsection-100_k9fhq_14",
|
|
1746
|
+
"purpur-heading--title-100": "_purpur-heading--title-100_k9fhq_20",
|
|
1747
|
+
"purpur-heading--title-200": "_purpur-heading--title-200_k9fhq_26",
|
|
1748
|
+
"purpur-heading--title-300": "_purpur-heading--title-300_k9fhq_32",
|
|
1749
|
+
"purpur-heading--title-400": "_purpur-heading--title-400_k9fhq_38",
|
|
1750
|
+
"purpur-heading--title-500": "_purpur-heading--title-500_k9fhq_44",
|
|
1751
|
+
"purpur-heading--title-600": "_purpur-heading--title-600_k9fhq_50",
|
|
1752
|
+
"purpur-heading--title-700": "_purpur-heading--title-700_k9fhq_56",
|
|
1753
|
+
"purpur-heading--display-25": "_purpur-heading--display-25_k9fhq_62",
|
|
1754
|
+
"purpur-heading--display-50": "_purpur-heading--display-50_k9fhq_68",
|
|
1755
|
+
"purpur-heading--display-100": "_purpur-heading--display-100_k9fhq_74",
|
|
1756
|
+
"purpur-heading--display-200": "_purpur-heading--display-200_k9fhq_80"
|
|
1757
|
+
}, qe = {
|
|
1758
|
+
TITLE100: "title-100",
|
|
1759
|
+
TITLE200: "title-200",
|
|
1760
|
+
TITLE300: "title-300",
|
|
1761
|
+
TITLE400: "title-400",
|
|
1762
|
+
TITLE500: "title-500",
|
|
1763
|
+
TITLE600: "title-600",
|
|
1764
|
+
TITLE700: "title-700",
|
|
1765
|
+
SUBSECTION100: "subsection-100"
|
|
1766
|
+
}, _e = "purpur-heading", Ke = ({
|
|
1767
|
+
["data-testid"]: e,
|
|
1768
|
+
children: r,
|
|
1769
|
+
className: t = "",
|
|
1770
|
+
enableHyphenation: o = !1,
|
|
1771
|
+
negative: a = !1,
|
|
1772
|
+
tag: n,
|
|
1773
|
+
variant: i = qe.TITLE100,
|
|
1774
|
+
...c
|
|
1775
|
+
}) => {
|
|
1776
|
+
const l = n, s = Ao([
|
|
1777
|
+
t,
|
|
1778
|
+
ge[_e],
|
|
1779
|
+
ge[`${_e}--${i}`],
|
|
1780
|
+
{
|
|
1781
|
+
[ge[`${_e}--hyphens`]]: o,
|
|
1782
|
+
[ge[`${_e}--negative`]]: a
|
|
1783
|
+
}
|
|
1784
|
+
]);
|
|
1785
|
+
return /* @__PURE__ */ _(l, { ...c, className: s, "data-testid": e, children: r });
|
|
1786
|
+
};
|
|
1787
|
+
Ke.displayName = "Heading";
|
|
1788
|
+
function Do(e) {
|
|
1789
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1790
|
+
}
|
|
1791
|
+
var Vt = { exports: {} };
|
|
1792
|
+
/*!
|
|
1793
|
+
Copyright (c) 2018 Jed Watson.
|
|
1794
|
+
Licensed under the MIT License (MIT), see
|
|
1795
|
+
http://jedwatson.github.io/classnames
|
|
1796
|
+
*/
|
|
1797
|
+
(function(e) {
|
|
1798
|
+
(function() {
|
|
1799
|
+
var r = {}.hasOwnProperty;
|
|
1800
|
+
function t() {
|
|
1801
|
+
for (var n = "", i = 0; i < arguments.length; i++) {
|
|
1802
|
+
var c = arguments[i];
|
|
1803
|
+
c && (n = a(n, o.call(this, c)));
|
|
1804
|
+
}
|
|
1805
|
+
return n;
|
|
1806
|
+
}
|
|
1807
|
+
function o(n) {
|
|
1808
|
+
if (typeof n == "string" || typeof n == "number")
|
|
1809
|
+
return this && this[n] || n;
|
|
1810
|
+
if (typeof n != "object")
|
|
1811
|
+
return "";
|
|
1812
|
+
if (Array.isArray(n))
|
|
1813
|
+
return t.apply(this, n);
|
|
1814
|
+
if (n.toString !== Object.prototype.toString && !n.toString.toString().includes("[native code]"))
|
|
1815
|
+
return n.toString();
|
|
1816
|
+
var i = "";
|
|
1817
|
+
for (var c in n)
|
|
1818
|
+
r.call(n, c) && n[c] && (i = a(i, this && this[c] || c));
|
|
1819
|
+
return i;
|
|
1820
|
+
}
|
|
1821
|
+
function a(n, i) {
|
|
1822
|
+
return i ? n ? n + " " + i : n + i : n;
|
|
1823
|
+
}
|
|
1824
|
+
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
1825
|
+
})();
|
|
1826
|
+
})(Vt);
|
|
1827
|
+
var No = Vt.exports;
|
|
1828
|
+
const Oo = /* @__PURE__ */ Do(No), Lo = {
|
|
1829
|
+
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
1830
|
+
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
1831
|
+
"purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
|
|
1832
|
+
"purpur-icon--sm": "_purpur-icon--sm_8u1lq_12",
|
|
1833
|
+
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
|
1834
|
+
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
|
1835
|
+
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
|
1836
|
+
}, Ro = {
|
|
1837
|
+
name: "arrow-left",
|
|
1838
|
+
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M3.1 12a.9.9 0 0 1 .264-.636l5.5-5.5a.9.9 0 0 1 1.272 1.272L6.173 11.1H20a.9.9 0 0 1 0 1.8H6.173l3.963 3.964a.9.9 0 1 1-1.272 1.272l-5.5-5.5A.9.9 0 0 1 3.1 12Z" clip-rule="evenodd"/></svg>',
|
|
1839
|
+
keywords: ["arrow-left"],
|
|
1840
|
+
category: "utility"
|
|
1841
|
+
}, Mo = {
|
|
1842
|
+
name: "close",
|
|
1843
|
+
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>',
|
|
1844
|
+
keywords: ["close"],
|
|
1845
|
+
category: "utility"
|
|
1846
|
+
}, qt = (e) => /* @__PURE__ */ _(
|
|
1847
|
+
Gt,
|
|
1848
|
+
{
|
|
1849
|
+
...e,
|
|
1850
|
+
svg: Ro
|
|
1851
|
+
}
|
|
1852
|
+
);
|
|
1853
|
+
qt.displayName = "IconArrowLeft";
|
|
1854
|
+
const Kt = (e) => /* @__PURE__ */ _(
|
|
1855
|
+
Gt,
|
|
1856
|
+
{
|
|
1857
|
+
...e,
|
|
1858
|
+
svg: Mo
|
|
1859
|
+
}
|
|
1860
|
+
);
|
|
1861
|
+
Kt.displayName = "IconClose";
|
|
1862
|
+
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 } = {}) => {
|
|
1863
|
+
const t = [
|
|
1864
|
+
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
1865
|
+
{ name: "fill", value: "currentColor" },
|
|
1866
|
+
{ name: "viewBox", value: "0 0 24 24" },
|
|
1867
|
+
r ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
1868
|
+
], o = r ? `<title>${r}</title>` : "";
|
|
1869
|
+
return `<svg ${Fo(t)}>${o}${e}</svg>`;
|
|
1870
|
+
}, zo = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), Gt = ({
|
|
1871
|
+
["data-testid"]: e,
|
|
1872
|
+
svg: r,
|
|
1873
|
+
allyTitle: t,
|
|
1874
|
+
className: o,
|
|
1875
|
+
size: a = ko,
|
|
1876
|
+
...n
|
|
1877
|
+
}) => {
|
|
1878
|
+
const i = jo({
|
|
1879
|
+
content: zo(r.svg),
|
|
1880
|
+
title: t
|
|
1881
|
+
}), c = Io(o, _t, `${_t}--${a}`);
|
|
1882
|
+
return /* @__PURE__ */ _(
|
|
1883
|
+
"span",
|
|
1884
|
+
{
|
|
1885
|
+
"aria-label": t,
|
|
1886
|
+
className: c,
|
|
1887
|
+
"data-testid": e,
|
|
1888
|
+
dangerouslySetInnerHTML: { __html: i },
|
|
1889
|
+
...n
|
|
1890
|
+
}
|
|
1891
|
+
);
|
|
1892
|
+
}, Wo = {
|
|
1893
|
+
"purpur-drawer-header__row": "_purpur-drawer-header__row_1yg5w_1",
|
|
1894
|
+
"purpur-drawer-header__row--with-back-button": "_purpur-drawer-header__row--with-back-button_1yg5w_6",
|
|
1895
|
+
"purpur-drawer-header__left": "_purpur-drawer-header__left_1yg5w_9",
|
|
1896
|
+
"purpur-drawer-header__right": "_purpur-drawer-header__right_1yg5w_12",
|
|
1897
|
+
"purpur-drawer-header__close-button": "_purpur-drawer-header__close-button_1yg5w_15",
|
|
1898
|
+
"purpur-drawer-header__back-button--only-icon": "_purpur-drawer-header__back-button--only-icon_1yg5w_18"
|
|
1899
|
+
}, G = Q.bind(Wo), H = "purpur-drawer-header", Zt = w(
|
|
1900
|
+
({
|
|
1901
|
+
["data-testid"]: e = "purpur-drawer-header",
|
|
1902
|
+
backButton: r,
|
|
1903
|
+
backButtonText: t,
|
|
1904
|
+
backButtonOnlyIcon: o,
|
|
1905
|
+
className: a,
|
|
1906
|
+
closeButtonText: n,
|
|
1907
|
+
onBackButtonClick: i,
|
|
1908
|
+
title: c,
|
|
1909
|
+
...l
|
|
1910
|
+
}, s) => {
|
|
1911
|
+
const u = G([a, H]);
|
|
1912
|
+
return /* @__PURE__ */ Y("div", { className: u, "data-testid": e, ref: s, ...l, children: [
|
|
1913
|
+
/* @__PURE__ */ Y(
|
|
1914
|
+
"div",
|
|
1915
|
+
{
|
|
1916
|
+
className: G([
|
|
1917
|
+
`${H}__row`,
|
|
1918
|
+
{
|
|
1919
|
+
[`${H}__row--with-back-button`]: r && t && i
|
|
1920
|
+
}
|
|
1921
|
+
]),
|
|
1922
|
+
"data-testid": `${e}-row`,
|
|
1923
|
+
children: [
|
|
1924
|
+
/* @__PURE__ */ _("div", { className: G(`${H}__left`), children: r && t && i ? /* @__PURE__ */ Y(
|
|
1925
|
+
Ve,
|
|
1926
|
+
{
|
|
1927
|
+
"aria-label": o ? t : "",
|
|
1928
|
+
className: G([
|
|
1929
|
+
`${H}__back-button`,
|
|
1930
|
+
{
|
|
1931
|
+
[`${H}__back-button--only-icon`]: o
|
|
1932
|
+
}
|
|
1933
|
+
]),
|
|
1934
|
+
"data-testid": `${e}-back-button`,
|
|
1935
|
+
iconOnly: o,
|
|
1936
|
+
onClick: i,
|
|
1937
|
+
size: "sm",
|
|
1938
|
+
variant: o ? We.TERTIARY_PURPLE : We.TEXT,
|
|
1939
|
+
children: [
|
|
1940
|
+
/* @__PURE__ */ _(qt, { size: "sm" }),
|
|
1941
|
+
!o && t
|
|
1942
|
+
]
|
|
1943
|
+
}
|
|
1944
|
+
) : /* @__PURE__ */ _(bt, { asChild: !0, children: /* @__PURE__ */ _(
|
|
1945
|
+
Ke,
|
|
1946
|
+
{
|
|
1947
|
+
"data-testid": `${e}-title`,
|
|
1948
|
+
tag: "h2",
|
|
1949
|
+
variant: qe.TITLE200,
|
|
1950
|
+
children: c
|
|
1951
|
+
}
|
|
1952
|
+
) }) }),
|
|
1953
|
+
/* @__PURE__ */ _("div", { className: G(`${H}__right`), children: /* @__PURE__ */ _(Gn, { asChild: !0, children: /* @__PURE__ */ _(
|
|
1954
|
+
Ve,
|
|
1955
|
+
{
|
|
1956
|
+
"aria-label": n,
|
|
1957
|
+
className: G(`${H}__close-button`),
|
|
1958
|
+
iconOnly: !0,
|
|
1959
|
+
size: "sm",
|
|
1960
|
+
variant: We.TERTIARY_PURPLE,
|
|
1961
|
+
children: /* @__PURE__ */ _(Kt, { size: "sm" })
|
|
1962
|
+
}
|
|
1963
|
+
) }) })
|
|
1964
|
+
]
|
|
1965
|
+
}
|
|
1966
|
+
),
|
|
1967
|
+
r && t && i && /* @__PURE__ */ _(bt, { asChild: !0, children: /* @__PURE__ */ _(
|
|
1968
|
+
Ke,
|
|
1969
|
+
{
|
|
1970
|
+
className: G(`${H}__heading`),
|
|
1971
|
+
"data-testid": `${e}-title-with-back-button`,
|
|
1972
|
+
tag: "h2",
|
|
1973
|
+
variant: qe.TITLE200,
|
|
1974
|
+
children: c
|
|
1975
|
+
}
|
|
1976
|
+
) })
|
|
1977
|
+
] });
|
|
1978
|
+
}
|
|
1979
|
+
);
|
|
1980
|
+
Zt.displayName = "DrawerHeader";
|
|
1981
|
+
const Uo = /* @__PURE__ */ de(void 0);
|
|
1982
|
+
function Ho(e) {
|
|
1983
|
+
const r = Te(Uo);
|
|
1984
|
+
return e || r || "ltr";
|
|
1985
|
+
}
|
|
1986
|
+
function Yo(e, [r, t]) {
|
|
1987
|
+
return Math.min(t, Math.max(r, e));
|
|
1988
|
+
}
|
|
1989
|
+
function Xo(e, r) {
|
|
1990
|
+
return wt((t, o) => {
|
|
1991
|
+
const a = r[t][o];
|
|
1992
|
+
return a ?? t;
|
|
1993
|
+
}, e);
|
|
1994
|
+
}
|
|
1995
|
+
const Qt = "ScrollArea", [Jt, _a] = Et(Qt), [Bo, U] = Jt(Qt), Vo = /* @__PURE__ */ w((e, r) => {
|
|
1996
|
+
const { __scopeScrollArea: t, type: o = "hover", dir: a, scrollHideDelay: n = 600, ...i } = e, [c, l] = N(null), [s, u] = N(null), [d, p] = N(null), [v, m] = N(null), [f, b] = N(null), [g, C] = N(0), [S, E] = N(0), [P, I] = N(!1), [O, x] = N(!1), T = k(
|
|
1997
|
+
r,
|
|
1998
|
+
(z) => l(z)
|
|
1999
|
+
), R = Ho(a);
|
|
2000
|
+
return /* @__PURE__ */ h(Bo, {
|
|
2001
|
+
scope: t,
|
|
2002
|
+
type: o,
|
|
2003
|
+
dir: R,
|
|
2004
|
+
scrollHideDelay: n,
|
|
2005
|
+
scrollArea: c,
|
|
2006
|
+
viewport: s,
|
|
2007
|
+
onViewportChange: u,
|
|
2008
|
+
content: d,
|
|
2009
|
+
onContentChange: p,
|
|
2010
|
+
scrollbarX: v,
|
|
2011
|
+
onScrollbarXChange: m,
|
|
2012
|
+
scrollbarXEnabled: P,
|
|
2013
|
+
onScrollbarXEnabledChange: I,
|
|
2014
|
+
scrollbarY: f,
|
|
2015
|
+
onScrollbarYChange: b,
|
|
2016
|
+
scrollbarYEnabled: O,
|
|
2017
|
+
onScrollbarYEnabledChange: x,
|
|
2018
|
+
onCornerWidthChange: C,
|
|
2019
|
+
onCornerHeightChange: E
|
|
2020
|
+
}, /* @__PURE__ */ h(F.div, y({
|
|
2021
|
+
dir: R
|
|
2022
|
+
}, i, {
|
|
2023
|
+
ref: T,
|
|
2024
|
+
style: {
|
|
2025
|
+
position: "relative",
|
|
2026
|
+
// Pass corner sizes as CSS vars to reduce re-renders of context consumers
|
|
2027
|
+
"--radix-scroll-area-corner-width": g + "px",
|
|
2028
|
+
"--radix-scroll-area-corner-height": S + "px",
|
|
2029
|
+
...e.style
|
|
2030
|
+
}
|
|
2031
|
+
})));
|
|
2032
|
+
}), qo = "ScrollAreaViewport", Ko = /* @__PURE__ */ w((e, r) => {
|
|
2033
|
+
const { __scopeScrollArea: t, children: o, ...a } = e, n = U(qo, t), i = A(null), c = k(r, i, n.onViewportChange);
|
|
2034
|
+
return /* @__PURE__ */ h(Je, null, /* @__PURE__ */ h("style", {
|
|
2035
|
+
dangerouslySetInnerHTML: {
|
|
2036
|
+
__html: "[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"
|
|
2037
|
+
}
|
|
2038
|
+
}), /* @__PURE__ */ h(F.div, y({
|
|
2039
|
+
"data-radix-scroll-area-viewport": ""
|
|
2040
|
+
}, a, {
|
|
2041
|
+
ref: c,
|
|
2042
|
+
style: {
|
|
2043
|
+
/**
|
|
2044
|
+
* We don't support `visible` because the intention is to have at least one scrollbar
|
|
2045
|
+
* if this component is used and `visible` will behave like `auto` in that case
|
|
2046
|
+
* https://developer.mozilla.org/en-US/docs/Web/CSS/overflowed#description
|
|
2047
|
+
*
|
|
2048
|
+
* We don't handle `auto` because the intention is for the native implementation
|
|
2049
|
+
* to be hidden if using this component. We just want to ensure the node is scrollable
|
|
2050
|
+
* so could have used either `scroll` or `auto` here. We picked `scroll` to prevent
|
|
2051
|
+
* the browser from having to work out whether to render native scrollbars or not,
|
|
2052
|
+
* we tell it to with the intention of hiding them in CSS.
|
|
2053
|
+
*/
|
|
2054
|
+
overflowX: n.scrollbarXEnabled ? "scroll" : "hidden",
|
|
2055
|
+
overflowY: n.scrollbarYEnabled ? "scroll" : "hidden",
|
|
2056
|
+
...e.style
|
|
2057
|
+
}
|
|
2058
|
+
}), /* @__PURE__ */ h("div", {
|
|
2059
|
+
ref: n.onContentChange,
|
|
2060
|
+
style: {
|
|
2061
|
+
minWidth: "100%",
|
|
2062
|
+
display: "table"
|
|
2063
|
+
}
|
|
2064
|
+
}, o)));
|
|
2065
|
+
}), X = "ScrollAreaScrollbar", Go = /* @__PURE__ */ w((e, r) => {
|
|
2066
|
+
const { forceMount: t, ...o } = e, a = U(X, e.__scopeScrollArea), { onScrollbarXEnabledChange: n, onScrollbarYEnabledChange: i } = a, c = e.orientation === "horizontal";
|
|
2067
|
+
return D(() => (c ? n(!0) : i(!0), () => {
|
|
2068
|
+
c ? n(!1) : i(!1);
|
|
2069
|
+
}), [
|
|
2070
|
+
c,
|
|
2071
|
+
n,
|
|
2072
|
+
i
|
|
2073
|
+
]), a.type === "hover" ? /* @__PURE__ */ h(Zo, y({}, o, {
|
|
2074
|
+
ref: r,
|
|
2075
|
+
forceMount: t
|
|
2076
|
+
})) : a.type === "scroll" ? /* @__PURE__ */ h(Qo, y({}, o, {
|
|
2077
|
+
ref: r,
|
|
2078
|
+
forceMount: t
|
|
2079
|
+
})) : a.type === "auto" ? /* @__PURE__ */ h(er, y({}, o, {
|
|
2080
|
+
ref: r,
|
|
2081
|
+
forceMount: t
|
|
2082
|
+
})) : a.type === "always" ? /* @__PURE__ */ h(rt, y({}, o, {
|
|
2083
|
+
ref: r
|
|
2084
|
+
})) : null;
|
|
2085
|
+
}), Zo = /* @__PURE__ */ w((e, r) => {
|
|
2086
|
+
const { forceMount: t, ...o } = e, a = U(X, e.__scopeScrollArea), [n, i] = N(!1);
|
|
2087
|
+
return D(() => {
|
|
2088
|
+
const c = a.scrollArea;
|
|
2089
|
+
let l = 0;
|
|
2090
|
+
if (c) {
|
|
2091
|
+
const s = () => {
|
|
2092
|
+
window.clearTimeout(l), i(!0);
|
|
2093
|
+
}, u = () => {
|
|
2094
|
+
l = window.setTimeout(
|
|
2095
|
+
() => i(!1),
|
|
2096
|
+
a.scrollHideDelay
|
|
2097
|
+
);
|
|
2098
|
+
};
|
|
2099
|
+
return c.addEventListener("pointerenter", s), c.addEventListener("pointerleave", u), () => {
|
|
2100
|
+
window.clearTimeout(l), c.removeEventListener("pointerenter", s), c.removeEventListener("pointerleave", u);
|
|
2101
|
+
};
|
|
2102
|
+
}
|
|
2103
|
+
}, [
|
|
2104
|
+
a.scrollArea,
|
|
2105
|
+
a.scrollHideDelay
|
|
2106
|
+
]), /* @__PURE__ */ h(q, {
|
|
2107
|
+
present: t || n
|
|
2108
|
+
}, /* @__PURE__ */ h(er, y({
|
|
2109
|
+
"data-state": n ? "visible" : "hidden"
|
|
2110
|
+
}, o, {
|
|
2111
|
+
ref: r
|
|
2112
|
+
})));
|
|
2113
|
+
}), Qo = /* @__PURE__ */ w((e, r) => {
|
|
2114
|
+
const { forceMount: t, ...o } = e, a = U(X, e.__scopeScrollArea), n = e.orientation === "horizontal", i = Ne(
|
|
2115
|
+
() => l("SCROLL_END"),
|
|
2116
|
+
100
|
|
2117
|
+
), [c, l] = Xo("hidden", {
|
|
2118
|
+
hidden: {
|
|
2119
|
+
SCROLL: "scrolling"
|
|
2120
|
+
},
|
|
2121
|
+
scrolling: {
|
|
2122
|
+
SCROLL_END: "idle",
|
|
2123
|
+
POINTER_ENTER: "interacting"
|
|
2124
|
+
},
|
|
2125
|
+
interacting: {
|
|
2126
|
+
SCROLL: "interacting",
|
|
2127
|
+
POINTER_LEAVE: "idle"
|
|
2128
|
+
},
|
|
2129
|
+
idle: {
|
|
2130
|
+
HIDE: "hidden",
|
|
2131
|
+
SCROLL: "scrolling",
|
|
2132
|
+
POINTER_ENTER: "interacting"
|
|
2133
|
+
}
|
|
2134
|
+
});
|
|
2135
|
+
return D(() => {
|
|
2136
|
+
if (c === "idle") {
|
|
2137
|
+
const s = window.setTimeout(
|
|
2138
|
+
() => l("HIDE"),
|
|
2139
|
+
a.scrollHideDelay
|
|
2140
|
+
);
|
|
2141
|
+
return () => window.clearTimeout(s);
|
|
2142
|
+
}
|
|
2143
|
+
}, [
|
|
2144
|
+
c,
|
|
2145
|
+
a.scrollHideDelay,
|
|
2146
|
+
l
|
|
2147
|
+
]), D(() => {
|
|
2148
|
+
const s = a.viewport, u = n ? "scrollLeft" : "scrollTop";
|
|
2149
|
+
if (s) {
|
|
2150
|
+
let d = s[u];
|
|
2151
|
+
const p = () => {
|
|
2152
|
+
const v = s[u];
|
|
2153
|
+
d !== v && (l("SCROLL"), i()), d = v;
|
|
2154
|
+
};
|
|
2155
|
+
return s.addEventListener("scroll", p), () => s.removeEventListener("scroll", p);
|
|
2156
|
+
}
|
|
2157
|
+
}, [
|
|
2158
|
+
a.viewport,
|
|
2159
|
+
n,
|
|
2160
|
+
l,
|
|
2161
|
+
i
|
|
2162
|
+
]), /* @__PURE__ */ h(q, {
|
|
2163
|
+
present: t || c !== "hidden"
|
|
2164
|
+
}, /* @__PURE__ */ h(rt, y({
|
|
2165
|
+
"data-state": c === "hidden" ? "hidden" : "visible"
|
|
2166
|
+
}, o, {
|
|
2167
|
+
ref: r,
|
|
2168
|
+
onPointerEnter: L(
|
|
2169
|
+
e.onPointerEnter,
|
|
2170
|
+
() => l("POINTER_ENTER")
|
|
2171
|
+
),
|
|
2172
|
+
onPointerLeave: L(
|
|
2173
|
+
e.onPointerLeave,
|
|
2174
|
+
() => l("POINTER_LEAVE")
|
|
2175
|
+
)
|
|
2176
|
+
})));
|
|
2177
|
+
}), er = /* @__PURE__ */ w((e, r) => {
|
|
2178
|
+
const t = U(X, e.__scopeScrollArea), { forceMount: o, ...a } = e, [n, i] = N(!1), c = e.orientation === "horizontal", l = Ne(() => {
|
|
2179
|
+
if (t.viewport) {
|
|
2180
|
+
const s = t.viewport.offsetWidth < t.viewport.scrollWidth, u = t.viewport.offsetHeight < t.viewport.scrollHeight;
|
|
2181
|
+
i(c ? s : u);
|
|
2182
|
+
}
|
|
2183
|
+
}, 10);
|
|
2184
|
+
return Pe(t.viewport, l), Pe(t.content, l), /* @__PURE__ */ h(q, {
|
|
2185
|
+
present: o || n
|
|
2186
|
+
}, /* @__PURE__ */ h(rt, y({
|
|
2187
|
+
"data-state": n ? "visible" : "hidden"
|
|
2188
|
+
}, a, {
|
|
2189
|
+
ref: r
|
|
2190
|
+
})));
|
|
2191
|
+
}), rt = /* @__PURE__ */ w((e, r) => {
|
|
2192
|
+
const { orientation: t = "vertical", ...o } = e, a = U(X, e.__scopeScrollArea), n = A(null), i = A(0), [c, l] = N({
|
|
2193
|
+
content: 0,
|
|
2194
|
+
viewport: 0,
|
|
2195
|
+
scrollbar: {
|
|
2196
|
+
size: 0,
|
|
2197
|
+
paddingStart: 0,
|
|
2198
|
+
paddingEnd: 0
|
|
2199
|
+
}
|
|
2200
|
+
}), s = nr(c.viewport, c.content), u = {
|
|
2201
|
+
...o,
|
|
2202
|
+
sizes: c,
|
|
2203
|
+
onSizesChange: l,
|
|
2204
|
+
hasThumb: s > 0 && s < 1,
|
|
2205
|
+
onThumbChange: (p) => n.current = p,
|
|
2206
|
+
onThumbPointerUp: () => i.current = 0,
|
|
2207
|
+
onThumbPointerDown: (p) => i.current = p
|
|
2208
|
+
};
|
|
2209
|
+
function d(p, v) {
|
|
2210
|
+
return oa(p, i.current, c, v);
|
|
2211
|
+
}
|
|
2212
|
+
return t === "horizontal" ? /* @__PURE__ */ h(Jo, y({}, u, {
|
|
2213
|
+
ref: r,
|
|
2214
|
+
onThumbPositionChange: () => {
|
|
2215
|
+
if (a.viewport && n.current) {
|
|
2216
|
+
const p = a.viewport.scrollLeft, v = $t(p, c, a.dir);
|
|
2217
|
+
n.current.style.transform = `translate3d(${v}px, 0, 0)`;
|
|
2218
|
+
}
|
|
2219
|
+
},
|
|
2220
|
+
onWheelScroll: (p) => {
|
|
2221
|
+
a.viewport && (a.viewport.scrollLeft = p);
|
|
2222
|
+
},
|
|
2223
|
+
onDragScroll: (p) => {
|
|
2224
|
+
a.viewport && (a.viewport.scrollLeft = d(p, a.dir));
|
|
2225
|
+
}
|
|
2226
|
+
})) : t === "vertical" ? /* @__PURE__ */ h(ea, y({}, u, {
|
|
2227
|
+
ref: r,
|
|
2228
|
+
onThumbPositionChange: () => {
|
|
2229
|
+
if (a.viewport && n.current) {
|
|
2230
|
+
const p = a.viewport.scrollTop, v = $t(p, c);
|
|
2231
|
+
n.current.style.transform = `translate3d(0, ${v}px, 0)`;
|
|
2232
|
+
}
|
|
2233
|
+
},
|
|
2234
|
+
onWheelScroll: (p) => {
|
|
2235
|
+
a.viewport && (a.viewport.scrollTop = p);
|
|
2236
|
+
},
|
|
2237
|
+
onDragScroll: (p) => {
|
|
2238
|
+
a.viewport && (a.viewport.scrollTop = d(p));
|
|
2239
|
+
}
|
|
2240
|
+
})) : null;
|
|
2241
|
+
}), Jo = /* @__PURE__ */ w((e, r) => {
|
|
2242
|
+
const { sizes: t, onSizesChange: o, ...a } = e, n = U(X, e.__scopeScrollArea), [i, c] = N(), l = A(null), s = k(r, l, n.onScrollbarXChange);
|
|
2243
|
+
return D(() => {
|
|
2244
|
+
l.current && c(getComputedStyle(l.current));
|
|
2245
|
+
}, [
|
|
2246
|
+
l
|
|
2247
|
+
]), /* @__PURE__ */ h(rr, y({
|
|
2248
|
+
"data-orientation": "horizontal"
|
|
2249
|
+
}, a, {
|
|
2250
|
+
ref: s,
|
|
2251
|
+
sizes: t,
|
|
2252
|
+
style: {
|
|
2253
|
+
bottom: 0,
|
|
2254
|
+
left: n.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
2255
|
+
right: n.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
2256
|
+
"--radix-scroll-area-thumb-width": De(t) + "px",
|
|
2257
|
+
...e.style
|
|
2258
|
+
},
|
|
2259
|
+
onThumbPointerDown: (u) => e.onThumbPointerDown(u.x),
|
|
2260
|
+
onDragScroll: (u) => e.onDragScroll(u.x),
|
|
2261
|
+
onWheelScroll: (u, d) => {
|
|
2262
|
+
if (n.viewport) {
|
|
2263
|
+
const p = n.viewport.scrollLeft + u.deltaX;
|
|
2264
|
+
e.onWheelScroll(p), ar(p, d) && u.preventDefault();
|
|
2265
|
+
}
|
|
2266
|
+
},
|
|
2267
|
+
onResize: () => {
|
|
2268
|
+
l.current && n.viewport && i && o({
|
|
2269
|
+
content: n.viewport.scrollWidth,
|
|
2270
|
+
viewport: n.viewport.offsetWidth,
|
|
2271
|
+
scrollbar: {
|
|
2272
|
+
size: l.current.clientWidth,
|
|
2273
|
+
paddingStart: Ce(i.paddingLeft),
|
|
2274
|
+
paddingEnd: Ce(i.paddingRight)
|
|
2275
|
+
}
|
|
2276
|
+
});
|
|
2277
|
+
}
|
|
2278
|
+
}));
|
|
2279
|
+
}), ea = /* @__PURE__ */ w((e, r) => {
|
|
2280
|
+
const { sizes: t, onSizesChange: o, ...a } = e, n = U(X, e.__scopeScrollArea), [i, c] = N(), l = A(null), s = k(r, l, n.onScrollbarYChange);
|
|
2281
|
+
return D(() => {
|
|
2282
|
+
l.current && c(getComputedStyle(l.current));
|
|
2283
|
+
}, [
|
|
2284
|
+
l
|
|
2285
|
+
]), /* @__PURE__ */ h(rr, y({
|
|
2286
|
+
"data-orientation": "vertical"
|
|
2287
|
+
}, a, {
|
|
2288
|
+
ref: s,
|
|
2289
|
+
sizes: t,
|
|
2290
|
+
style: {
|
|
2291
|
+
top: 0,
|
|
2292
|
+
right: n.dir === "ltr" ? 0 : void 0,
|
|
2293
|
+
left: n.dir === "rtl" ? 0 : void 0,
|
|
2294
|
+
bottom: "var(--radix-scroll-area-corner-height)",
|
|
2295
|
+
"--radix-scroll-area-thumb-height": De(t) + "px",
|
|
2296
|
+
...e.style
|
|
2297
|
+
},
|
|
2298
|
+
onThumbPointerDown: (u) => e.onThumbPointerDown(u.y),
|
|
2299
|
+
onDragScroll: (u) => e.onDragScroll(u.y),
|
|
2300
|
+
onWheelScroll: (u, d) => {
|
|
2301
|
+
if (n.viewport) {
|
|
2302
|
+
const p = n.viewport.scrollTop + u.deltaY;
|
|
2303
|
+
e.onWheelScroll(p), ar(p, d) && u.preventDefault();
|
|
2304
|
+
}
|
|
2305
|
+
},
|
|
2306
|
+
onResize: () => {
|
|
2307
|
+
l.current && n.viewport && i && o({
|
|
2308
|
+
content: n.viewport.scrollHeight,
|
|
2309
|
+
viewport: n.viewport.offsetHeight,
|
|
2310
|
+
scrollbar: {
|
|
2311
|
+
size: l.current.clientHeight,
|
|
2312
|
+
paddingStart: Ce(i.paddingTop),
|
|
2313
|
+
paddingEnd: Ce(i.paddingBottom)
|
|
2314
|
+
}
|
|
2315
|
+
});
|
|
2316
|
+
}
|
|
2317
|
+
}));
|
|
2318
|
+
}), [ta, tr] = Jt(X), rr = /* @__PURE__ */ w((e, r) => {
|
|
2319
|
+
const { __scopeScrollArea: t, sizes: o, hasThumb: a, onThumbChange: n, onThumbPointerUp: i, onThumbPointerDown: c, onThumbPositionChange: l, onDragScroll: s, onWheelScroll: u, onResize: d, ...p } = e, v = U(X, t), [m, f] = N(null), b = k(
|
|
2320
|
+
r,
|
|
2321
|
+
(T) => f(T)
|
|
2322
|
+
), g = A(null), C = A(""), S = v.viewport, E = o.content - o.viewport, P = M(u), I = M(l), O = Ne(d, 10);
|
|
2323
|
+
function x(T) {
|
|
2324
|
+
if (g.current) {
|
|
2325
|
+
const R = T.clientX - g.current.left, z = T.clientY - g.current.top;
|
|
2326
|
+
s({
|
|
2327
|
+
x: R,
|
|
2328
|
+
y: z
|
|
2329
|
+
});
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
return D(() => {
|
|
2333
|
+
const T = (R) => {
|
|
2334
|
+
const z = R.target;
|
|
2335
|
+
(m == null ? void 0 : m.contains(z)) && P(R, E);
|
|
2336
|
+
};
|
|
2337
|
+
return document.addEventListener("wheel", T, {
|
|
2338
|
+
passive: !1
|
|
2339
|
+
}), () => document.removeEventListener("wheel", T, {
|
|
2340
|
+
passive: !1
|
|
2341
|
+
});
|
|
2342
|
+
}, [
|
|
2343
|
+
S,
|
|
2344
|
+
m,
|
|
2345
|
+
E,
|
|
2346
|
+
P
|
|
2347
|
+
]), D(I, [
|
|
2348
|
+
o,
|
|
2349
|
+
I
|
|
2350
|
+
]), Pe(m, O), Pe(v.content, O), /* @__PURE__ */ h(ta, {
|
|
2351
|
+
scope: t,
|
|
2352
|
+
scrollbar: m,
|
|
2353
|
+
hasThumb: a,
|
|
2354
|
+
onThumbChange: M(n),
|
|
2355
|
+
onThumbPointerUp: M(i),
|
|
2356
|
+
onThumbPositionChange: I,
|
|
2357
|
+
onThumbPointerDown: M(c)
|
|
2358
|
+
}, /* @__PURE__ */ h(F.div, y({}, p, {
|
|
2359
|
+
ref: b,
|
|
2360
|
+
style: {
|
|
2361
|
+
position: "absolute",
|
|
2362
|
+
...p.style
|
|
2363
|
+
},
|
|
2364
|
+
onPointerDown: L(e.onPointerDown, (T) => {
|
|
2365
|
+
T.button === 0 && (T.target.setPointerCapture(T.pointerId), g.current = m.getBoundingClientRect(), C.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", v.viewport && (v.viewport.style.scrollBehavior = "auto"), x(T));
|
|
2366
|
+
}),
|
|
2367
|
+
onPointerMove: L(e.onPointerMove, x),
|
|
2368
|
+
onPointerUp: L(e.onPointerUp, (T) => {
|
|
2369
|
+
const R = T.target;
|
|
2370
|
+
R.hasPointerCapture(T.pointerId) && R.releasePointerCapture(T.pointerId), document.body.style.webkitUserSelect = C.current, v.viewport && (v.viewport.style.scrollBehavior = ""), g.current = null;
|
|
2371
|
+
})
|
|
2372
|
+
})));
|
|
2373
|
+
}), Ge = "ScrollAreaThumb", ra = /* @__PURE__ */ w((e, r) => {
|
|
2374
|
+
const { forceMount: t, ...o } = e, a = tr(Ge, e.__scopeScrollArea);
|
|
2375
|
+
return /* @__PURE__ */ h(q, {
|
|
2376
|
+
present: t || a.hasThumb
|
|
2377
|
+
}, /* @__PURE__ */ h(na, y({
|
|
2378
|
+
ref: r
|
|
2379
|
+
}, o)));
|
|
2380
|
+
}), na = /* @__PURE__ */ w((e, r) => {
|
|
2381
|
+
const { __scopeScrollArea: t, style: o, ...a } = e, n = U(Ge, t), i = tr(Ge, t), { onThumbPositionChange: c } = i, l = k(
|
|
2382
|
+
r,
|
|
2383
|
+
(d) => i.onThumbChange(d)
|
|
2384
|
+
), s = A(), u = Ne(() => {
|
|
2385
|
+
s.current && (s.current(), s.current = void 0);
|
|
2386
|
+
}, 100);
|
|
2387
|
+
return D(() => {
|
|
2388
|
+
const d = n.viewport;
|
|
2389
|
+
if (d) {
|
|
2390
|
+
const p = () => {
|
|
2391
|
+
if (u(), !s.current) {
|
|
2392
|
+
const v = aa(d, c);
|
|
2393
|
+
s.current = v, c();
|
|
2394
|
+
}
|
|
2395
|
+
};
|
|
2396
|
+
return c(), d.addEventListener("scroll", p), () => d.removeEventListener("scroll", p);
|
|
2397
|
+
}
|
|
2398
|
+
}, [
|
|
2399
|
+
n.viewport,
|
|
2400
|
+
u,
|
|
2401
|
+
c
|
|
2402
|
+
]), /* @__PURE__ */ h(F.div, y({
|
|
2403
|
+
"data-state": i.hasThumb ? "visible" : "hidden"
|
|
2404
|
+
}, a, {
|
|
2405
|
+
ref: l,
|
|
2406
|
+
style: {
|
|
2407
|
+
width: "var(--radix-scroll-area-thumb-width)",
|
|
2408
|
+
height: "var(--radix-scroll-area-thumb-height)",
|
|
2409
|
+
...o
|
|
2410
|
+
},
|
|
2411
|
+
onPointerDownCapture: L(e.onPointerDownCapture, (d) => {
|
|
2412
|
+
const v = d.target.getBoundingClientRect(), m = d.clientX - v.left, f = d.clientY - v.top;
|
|
2413
|
+
i.onThumbPointerDown({
|
|
2414
|
+
x: m,
|
|
2415
|
+
y: f
|
|
2416
|
+
});
|
|
2417
|
+
}),
|
|
2418
|
+
onPointerUp: L(e.onPointerUp, i.onThumbPointerUp)
|
|
2419
|
+
}));
|
|
2420
|
+
});
|
|
2421
|
+
function Ce(e) {
|
|
2422
|
+
return e ? parseInt(e, 10) : 0;
|
|
2423
|
+
}
|
|
2424
|
+
function nr(e, r) {
|
|
2425
|
+
const t = e / r;
|
|
2426
|
+
return isNaN(t) ? 0 : t;
|
|
2427
|
+
}
|
|
2428
|
+
function De(e) {
|
|
2429
|
+
const r = nr(e.viewport, e.content), t = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, o = (e.scrollbar.size - t) * r;
|
|
2430
|
+
return Math.max(o, 18);
|
|
2431
|
+
}
|
|
2432
|
+
function oa(e, r, t, o = "ltr") {
|
|
2433
|
+
const a = De(t), n = a / 2, i = r || n, c = a - i, l = t.scrollbar.paddingStart + i, s = t.scrollbar.size - t.scrollbar.paddingEnd - c, u = t.content - t.viewport, d = o === "ltr" ? [
|
|
2434
|
+
0,
|
|
2435
|
+
u
|
|
2436
|
+
] : [
|
|
2437
|
+
u * -1,
|
|
2438
|
+
0
|
|
2439
|
+
];
|
|
2440
|
+
return or([
|
|
2441
|
+
l,
|
|
2442
|
+
s
|
|
2443
|
+
], d)(e);
|
|
2444
|
+
}
|
|
2445
|
+
function $t(e, r, t = "ltr") {
|
|
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" ? [
|
|
2447
|
+
0,
|
|
2448
|
+
i
|
|
2449
|
+
] : [
|
|
2450
|
+
i * -1,
|
|
2451
|
+
0
|
|
2452
|
+
], s = Yo(e, l);
|
|
2453
|
+
return or([
|
|
2454
|
+
0,
|
|
2455
|
+
i
|
|
2456
|
+
], [
|
|
2457
|
+
0,
|
|
2458
|
+
c
|
|
2459
|
+
])(s);
|
|
2460
|
+
}
|
|
2461
|
+
function or(e, r) {
|
|
2462
|
+
return (t) => {
|
|
2463
|
+
if (e[0] === e[1] || r[0] === r[1]) return r[0];
|
|
2464
|
+
const o = (r[1] - r[0]) / (e[1] - e[0]);
|
|
2465
|
+
return r[0] + o * (t - e[0]);
|
|
2466
|
+
};
|
|
2467
|
+
}
|
|
2468
|
+
function ar(e, r) {
|
|
2469
|
+
return e > 0 && e < r;
|
|
2470
|
+
}
|
|
2471
|
+
const aa = (e, r = () => {
|
|
2472
|
+
}) => {
|
|
2473
|
+
let t = {
|
|
2474
|
+
left: e.scrollLeft,
|
|
2475
|
+
top: e.scrollTop
|
|
2476
|
+
}, o = 0;
|
|
2477
|
+
return function a() {
|
|
2478
|
+
const n = {
|
|
2479
|
+
left: e.scrollLeft,
|
|
2480
|
+
top: e.scrollTop
|
|
2481
|
+
}, i = t.left !== n.left, c = t.top !== n.top;
|
|
2482
|
+
(i || c) && r(), t = n, o = window.requestAnimationFrame(a);
|
|
2483
|
+
}(), () => window.cancelAnimationFrame(o);
|
|
2484
|
+
};
|
|
2485
|
+
function Ne(e, r) {
|
|
2486
|
+
const t = M(e), o = A(0);
|
|
2487
|
+
return D(
|
|
2488
|
+
() => () => window.clearTimeout(o.current),
|
|
2489
|
+
[]
|
|
2490
|
+
), ae(() => {
|
|
2491
|
+
window.clearTimeout(o.current), o.current = window.setTimeout(t, r);
|
|
2492
|
+
}, [
|
|
2493
|
+
t,
|
|
2494
|
+
r
|
|
2495
|
+
]);
|
|
2496
|
+
}
|
|
2497
|
+
function Pe(e, r) {
|
|
2498
|
+
const t = M(r);
|
|
2499
|
+
xe(() => {
|
|
2500
|
+
let o = 0;
|
|
2501
|
+
if (e) {
|
|
2502
|
+
const a = new ResizeObserver(() => {
|
|
2503
|
+
cancelAnimationFrame(o), o = window.requestAnimationFrame(t);
|
|
2504
|
+
});
|
|
2505
|
+
return a.observe(e), () => {
|
|
2506
|
+
window.cancelAnimationFrame(o), a.unobserve(e);
|
|
2507
|
+
};
|
|
2508
|
+
}
|
|
2509
|
+
}, [
|
|
2510
|
+
e,
|
|
2511
|
+
t
|
|
2512
|
+
]);
|
|
2513
|
+
}
|
|
2514
|
+
const ca = Vo, ia = Ko, sa = Go, la = ra, ua = {
|
|
2515
|
+
"purpur-drawer-scroll-area__root": "_purpur-drawer-scroll-area__root_1p63i_1",
|
|
2516
|
+
"purpur-drawer-scroll-area__viewport": "_purpur-drawer-scroll-area__viewport_1p63i_4",
|
|
2517
|
+
"purpur-drawer-scroll-area__scrollbar": "_purpur-drawer-scroll-area__scrollbar_1p63i_7",
|
|
2518
|
+
"purpur-drawer-scroll-area__thumb": "_purpur-drawer-scroll-area__thumb_1p63i_18"
|
|
2519
|
+
}, se = Q.bind(ua), le = "purpur-drawer-scroll-area", Ze = w(
|
|
2520
|
+
({
|
|
2521
|
+
["data-testid"]: e = "purpur-drawer-scroll-area",
|
|
2522
|
+
children: r,
|
|
2523
|
+
className: t,
|
|
2524
|
+
...o
|
|
2525
|
+
}, a) => {
|
|
2526
|
+
const n = se([t, le]);
|
|
2527
|
+
return /* @__PURE__ */ _("div", { className: n, "data-testid": e, ref: a, ...o, children: /* @__PURE__ */ Y(ca, { className: se(`${le}__root`), children: [
|
|
2528
|
+
/* @__PURE__ */ _(ia, { className: se(`${le}__viewport`), children: r }),
|
|
2529
|
+
/* @__PURE__ */ _(
|
|
2530
|
+
sa,
|
|
2531
|
+
{
|
|
2532
|
+
className: se(`${le}__scrollbar`),
|
|
2533
|
+
orientation: "vertical",
|
|
2534
|
+
children: /* @__PURE__ */ _(la, { className: se(`${le}__thumb`) })
|
|
2535
|
+
}
|
|
2536
|
+
)
|
|
2537
|
+
] }) });
|
|
2538
|
+
}
|
|
2539
|
+
);
|
|
2540
|
+
Ze.displayName = "DrawerScrollArea";
|
|
2541
|
+
const re = Q.bind(io), B = "purpur-drawer-frame", cr = w(
|
|
2542
|
+
({
|
|
2543
|
+
["data-testid"]: e = "purpur-drawer-frame",
|
|
2544
|
+
backButton: r,
|
|
2545
|
+
backButtonText: t,
|
|
2546
|
+
backButtonOnlyIcon: o,
|
|
2547
|
+
children: a,
|
|
2548
|
+
className: n,
|
|
2549
|
+
closeButtonText: i,
|
|
2550
|
+
footerContent: c,
|
|
2551
|
+
onAnimationEnd: l,
|
|
2552
|
+
onBackButtonClick: s,
|
|
2553
|
+
onSwipeStart: u,
|
|
2554
|
+
onSwipeMove: d,
|
|
2555
|
+
onSwipeCancel: p,
|
|
2556
|
+
onSwipeEnd: v,
|
|
2557
|
+
title: m,
|
|
2558
|
+
stickyFooter: f,
|
|
2559
|
+
...b
|
|
2560
|
+
}, g) => {
|
|
2561
|
+
const C = re([
|
|
2562
|
+
n,
|
|
2563
|
+
B,
|
|
2564
|
+
{
|
|
2565
|
+
[`${B}--sticky-footer`]: f
|
|
2566
|
+
}
|
|
2567
|
+
]);
|
|
2568
|
+
return /* @__PURE__ */ Y(
|
|
2569
|
+
"div",
|
|
2570
|
+
{
|
|
2571
|
+
className: C,
|
|
2572
|
+
"data-testid": e,
|
|
2573
|
+
ref: g,
|
|
2574
|
+
onAnimationEnd: l,
|
|
2575
|
+
...b,
|
|
2576
|
+
children: [
|
|
2577
|
+
/* @__PURE__ */ _(
|
|
2578
|
+
Ht,
|
|
2579
|
+
{
|
|
2580
|
+
onSwipeStart: u,
|
|
2581
|
+
onSwipeMove: d,
|
|
2582
|
+
onSwipeCancel: p,
|
|
2583
|
+
onSwipeEnd: v
|
|
2584
|
+
}
|
|
2585
|
+
),
|
|
2586
|
+
/* @__PURE__ */ _(
|
|
2587
|
+
ne,
|
|
2588
|
+
{
|
|
2589
|
+
className: re(`${B}__header`),
|
|
2590
|
+
variant: "header",
|
|
2591
|
+
stickyFooter: f,
|
|
2592
|
+
children: /* @__PURE__ */ _(
|
|
2593
|
+
Zt,
|
|
2594
|
+
{
|
|
2595
|
+
title: m,
|
|
2596
|
+
backButtonOnlyIcon: o,
|
|
2597
|
+
backButton: r,
|
|
2598
|
+
backButtonText: t,
|
|
2599
|
+
closeButtonText: i,
|
|
2600
|
+
onBackButtonClick: s
|
|
2601
|
+
}
|
|
2602
|
+
)
|
|
2603
|
+
}
|
|
2604
|
+
),
|
|
2605
|
+
f ? /* @__PURE__ */ Y(lr, { children: [
|
|
2606
|
+
/* @__PURE__ */ _(
|
|
2607
|
+
Ze,
|
|
2608
|
+
{
|
|
2609
|
+
className: re(`${B}__body`),
|
|
2610
|
+
"data-testid": `${e}-sticky-footer-scroll-area`,
|
|
2611
|
+
children: /* @__PURE__ */ _(ne, { stickyFooter: !0, children: a })
|
|
2612
|
+
}
|
|
2613
|
+
),
|
|
2614
|
+
c && /* @__PURE__ */ _(
|
|
2615
|
+
ne,
|
|
2616
|
+
{
|
|
2617
|
+
className: re(`${B}__footer`),
|
|
2618
|
+
"data-testid": `${e}-sticky-footer`,
|
|
2619
|
+
variant: "footer",
|
|
2620
|
+
stickyFooter: f,
|
|
2621
|
+
children: c
|
|
2622
|
+
}
|
|
2623
|
+
)
|
|
2624
|
+
] }) : /* @__PURE__ */ _(
|
|
2625
|
+
Ze,
|
|
2626
|
+
{
|
|
2627
|
+
className: re(`${B}__body`),
|
|
2628
|
+
"data-testid": `${e}-scroll-area`,
|
|
2629
|
+
children: /* @__PURE__ */ Y(
|
|
2630
|
+
"div",
|
|
2631
|
+
{
|
|
2632
|
+
className: re([
|
|
2633
|
+
`${B}__content-container`,
|
|
2634
|
+
{ [`${B}__content-container--no-footer`]: !c }
|
|
2635
|
+
]),
|
|
2636
|
+
children: [
|
|
2637
|
+
/* @__PURE__ */ _(ne, { stickyFooter: f, children: a }),
|
|
2638
|
+
c && /* @__PURE__ */ _(
|
|
2639
|
+
ne,
|
|
2640
|
+
{
|
|
2641
|
+
"data-testid": `${e}-footer`,
|
|
2642
|
+
stickyFooter: f,
|
|
2643
|
+
variant: "footer",
|
|
2644
|
+
children: c
|
|
2645
|
+
}
|
|
2646
|
+
)
|
|
2647
|
+
]
|
|
2648
|
+
}
|
|
2649
|
+
)
|
|
2650
|
+
}
|
|
2651
|
+
)
|
|
2652
|
+
]
|
|
2653
|
+
}
|
|
2654
|
+
);
|
|
2655
|
+
}
|
|
2656
|
+
);
|
|
2657
|
+
cr.displayName = "DrawerFrame";
|
|
2658
|
+
const da = (e, r) => ({
|
|
2659
|
+
onAnimationEnd: (c) => {
|
|
2660
|
+
c.currentTarget.getAttribute("data-swipe") === "end" && r(!1);
|
|
2661
|
+
},
|
|
2662
|
+
onSwipeStart: () => {
|
|
2663
|
+
e.current && e.current.setAttribute("data-swipe", "start");
|
|
2664
|
+
},
|
|
2665
|
+
onSwipeMove: (c) => {
|
|
2666
|
+
if (!e.current)
|
|
2667
|
+
return;
|
|
2668
|
+
const { y: l } = c.delta;
|
|
2669
|
+
e.current.setAttribute("data-swipe", "move"), e.current.style.setProperty("--purpur-drawer-swipe-move-y", `${l}px`);
|
|
2670
|
+
},
|
|
2671
|
+
onSwipeCancel: () => {
|
|
2672
|
+
e.current && (e.current.setAttribute("data-swipe", "cancel"), e.current.style.removeProperty("--purpur-drawer-swipe-move-y"), e.current.style.removeProperty("--purpur-drawer-swipe-end-y"));
|
|
2673
|
+
},
|
|
2674
|
+
onSwipeEnd: (c) => {
|
|
2675
|
+
if (!e.current)
|
|
2676
|
+
return;
|
|
2677
|
+
const { y: l } = c.delta;
|
|
2678
|
+
e.current.setAttribute("data-swipe", "end"), e.current.style.removeProperty("--purpur-drawer-swipe-move-y"), e.current.style.setProperty("--purpur-drawer-swipe-end-y", `${l}px`);
|
|
2679
|
+
}
|
|
2680
|
+
}), ue = Q.bind(oo), $e = "purpur-drawer-content", ir = w(
|
|
2681
|
+
({
|
|
2682
|
+
["data-testid"]: e = "purpur-drawer-content",
|
|
2683
|
+
backButton: r = !1,
|
|
2684
|
+
backButtonText: t,
|
|
2685
|
+
backButtonOnlyIcon: o = !1,
|
|
2686
|
+
bodyText: a,
|
|
2687
|
+
children: n,
|
|
2688
|
+
className: i,
|
|
2689
|
+
closeButtonText: c,
|
|
2690
|
+
disableCloseOnClickOutside: l = !1,
|
|
2691
|
+
footerContent: s,
|
|
2692
|
+
onBackButtonClick: u,
|
|
2693
|
+
stickyFooter: d = !1,
|
|
2694
|
+
title: p,
|
|
2695
|
+
...v
|
|
2696
|
+
}, m) => {
|
|
2697
|
+
const f = ue([i, $e]), b = A(null), g = Te(Ut), { onAnimationEnd: C, onSwipeStart: S, onSwipeMove: E, onSwipeCancel: P, onSwipeEnd: I } = da(b, g), O = (x) => {
|
|
2698
|
+
l && x.preventDefault();
|
|
2699
|
+
};
|
|
2700
|
+
return /* @__PURE__ */ _(Bn, { children: /* @__PURE__ */ _(
|
|
2701
|
+
Vn,
|
|
2702
|
+
{
|
|
2703
|
+
className: ue("purpur-drawer-overlay"),
|
|
2704
|
+
"data-testid": `${e}-overlay`,
|
|
2705
|
+
children: /* @__PURE__ */ _(
|
|
2706
|
+
qn,
|
|
2707
|
+
{
|
|
2708
|
+
onPointerDownOutside: O,
|
|
2709
|
+
className: f,
|
|
2710
|
+
"data-testid": e,
|
|
2711
|
+
ref: m,
|
|
2712
|
+
...v,
|
|
2713
|
+
children: /* @__PURE__ */ _(
|
|
2714
|
+
cr,
|
|
2715
|
+
{
|
|
2716
|
+
backButton: r,
|
|
2717
|
+
backButtonText: t,
|
|
2718
|
+
backButtonOnlyIcon: o,
|
|
2719
|
+
closeButtonText: c,
|
|
2720
|
+
className: ue(`${$e}__drawer-frame`),
|
|
2721
|
+
footerContent: s,
|
|
2722
|
+
ref: b,
|
|
2723
|
+
onAnimationEnd: C,
|
|
2724
|
+
onBackButtonClick: u,
|
|
2725
|
+
onSwipeStart: S,
|
|
2726
|
+
onSwipeMove: E,
|
|
2727
|
+
onSwipeCancel: P,
|
|
2728
|
+
onSwipeEnd: I,
|
|
2729
|
+
stickyFooter: d,
|
|
2730
|
+
title: p,
|
|
2731
|
+
children: a ? /* @__PURE__ */ Y("div", { className: ue(`${$e}__content-container`), children: [
|
|
2732
|
+
/* @__PURE__ */ _(
|
|
2733
|
+
Kn,
|
|
2734
|
+
{
|
|
2735
|
+
className: ue(`${$e}__description`),
|
|
2736
|
+
"data-testid": `${e}-description`,
|
|
2737
|
+
children: a
|
|
2738
|
+
}
|
|
2739
|
+
),
|
|
2740
|
+
/* @__PURE__ */ _("div", { children: n })
|
|
2741
|
+
] }) : n
|
|
2742
|
+
}
|
|
2743
|
+
)
|
|
2744
|
+
}
|
|
2745
|
+
)
|
|
2746
|
+
}
|
|
2747
|
+
) });
|
|
2748
|
+
}
|
|
2749
|
+
);
|
|
2750
|
+
ir.displayName = "DrawerContent";
|
|
2751
|
+
const sr = w(
|
|
2752
|
+
({
|
|
2753
|
+
["data-testid"]: e = "purpur-drawer-trigger",
|
|
2754
|
+
children: r,
|
|
2755
|
+
className: t,
|
|
2756
|
+
...o
|
|
2757
|
+
}, a) => /* @__PURE__ */ _(
|
|
2758
|
+
Xn,
|
|
2759
|
+
{
|
|
2760
|
+
asChild: !0,
|
|
2761
|
+
className: t,
|
|
2762
|
+
"data-testid": e,
|
|
2763
|
+
ref: a,
|
|
2764
|
+
...o,
|
|
2765
|
+
children: r
|
|
2766
|
+
}
|
|
2767
|
+
)
|
|
2768
|
+
);
|
|
2769
|
+
sr.displayName = "DrawerTrigger";
|
|
2770
|
+
const pa = Q.bind(Jn), fa = "purpur-drawer", nt = ({
|
|
2771
|
+
["data-testid"]: e = "purpur-drawer",
|
|
2772
|
+
children: r,
|
|
2773
|
+
className: t,
|
|
2774
|
+
onOpenChange: o,
|
|
2775
|
+
open: a = !1,
|
|
2776
|
+
...n
|
|
2777
|
+
}) => {
|
|
2778
|
+
const [i, c] = Ue.useState(a), l = pa([t, fa]), s = (u) => {
|
|
2779
|
+
c(u), o == null || o(u);
|
|
2780
|
+
};
|
|
2781
|
+
return D(() => {
|
|
2782
|
+
c(a);
|
|
2783
|
+
}, [a]), /* @__PURE__ */ _(Ut.Provider, { value: s, children: /* @__PURE__ */ _("div", { className: l, "data-testid": e, ...n, children: /* @__PURE__ */ _(Yn, { open: i, onOpenChange: s, children: r }) }) });
|
|
2784
|
+
};
|
|
2785
|
+
nt.Trigger = sr;
|
|
2786
|
+
nt.Content = ir;
|
|
2787
|
+
nt.displayName = "Drawer";
|
|
2788
|
+
export {
|
|
2789
|
+
nt as Drawer
|
|
2790
|
+
};
|
|
2791
|
+
//# sourceMappingURL=drawer.es.js.map
|