@arcadeai/design-system 1.7.0 → 1.7.3
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/components/index.js +449 -437
- package/dist/components/ui/atoms/alert-dialog.js +1 -1
- package/dist/components/ui/atoms/badge.d.ts +1 -1
- package/dist/components/ui/atoms/button.d.ts +1 -1
- package/dist/components/ui/atoms/command.js +1 -1
- package/dist/components/ui/atoms/dialog.js +1 -1
- package/dist/components/ui/atoms/dropdown-menu.js +1 -1
- package/dist/components/ui/atoms/index.d.ts +1 -0
- package/dist/components/ui/atoms/index.js +436 -424
- package/dist/components/ui/atoms/popover.js +1 -1
- package/dist/components/ui/atoms/select.js +1 -1
- package/dist/components/ui/atoms/sheet.js +1 -1
- package/dist/components/ui/index.js +449 -437
- package/dist/{Combination-CmNnuUVg.js → index-BvWMjxZ5.js} +178 -177
- package/dist/{index-Dkey23PG.js → index-D7PrNma3.js} +1 -1
- package/dist/main.js +467 -455
- package/package.json +73 -1
|
@@ -4,20 +4,7 @@ import { u as me } from "./index-5Bhkapwi.js";
|
|
|
4
4
|
import { P as pe } from "./index-CpDnqHCm.js";
|
|
5
5
|
import { u as z } from "./index-0ioNhtNM.js";
|
|
6
6
|
import { jsx as ge } from "react/jsx-runtime";
|
|
7
|
-
var U = 0
|
|
8
|
-
function gt() {
|
|
9
|
-
u.useEffect(() => {
|
|
10
|
-
const e = document.querySelectorAll("[data-radix-focus-guard]");
|
|
11
|
-
return document.body.insertAdjacentElement("afterbegin", e[0] ?? Z()), document.body.insertAdjacentElement("beforeend", e[1] ?? Z()), U++, () => {
|
|
12
|
-
U === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), U--;
|
|
13
|
-
};
|
|
14
|
-
}, []);
|
|
15
|
-
}
|
|
16
|
-
function Z() {
|
|
17
|
-
const e = document.createElement("span");
|
|
18
|
-
return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
|
|
19
|
-
}
|
|
20
|
-
var _ = "focusScope.autoFocusOnMount", j = "focusScope.autoFocusOnUnmount", q = { bubbles: !1, cancelable: !0 }, ye = "FocusScope", be = u.forwardRef((e, t) => {
|
|
7
|
+
var U = "focusScope.autoFocusOnMount", _ = "focusScope.autoFocusOnUnmount", Z = { bubbles: !1, cancelable: !0 }, ye = "FocusScope", be = u.forwardRef((e, t) => {
|
|
21
8
|
const {
|
|
22
9
|
loop: n = !1,
|
|
23
10
|
trapped: r = !1,
|
|
@@ -56,16 +43,16 @@ var _ = "focusScope.autoFocusOnMount", j = "focusScope.autoFocusOnUnmount", q =
|
|
|
56
43
|
}
|
|
57
44
|
}, [r, a, h.paused]), u.useEffect(() => {
|
|
58
45
|
if (a) {
|
|
59
|
-
|
|
46
|
+
Q.add(h);
|
|
60
47
|
const o = document.activeElement;
|
|
61
48
|
if (!a.contains(o)) {
|
|
62
|
-
const d = new CustomEvent(
|
|
63
|
-
a.addEventListener(
|
|
49
|
+
const d = new CustomEvent(U, Z);
|
|
50
|
+
a.addEventListener(U, b), a.dispatchEvent(d), d.defaultPrevented || (Ee(ke(oe(a)), { select: !0 }), document.activeElement === o && k(a));
|
|
64
51
|
}
|
|
65
52
|
return () => {
|
|
66
|
-
a.removeEventListener(
|
|
67
|
-
const d = new CustomEvent(
|
|
68
|
-
a.addEventListener(
|
|
53
|
+
a.removeEventListener(U, b), setTimeout(() => {
|
|
54
|
+
const d = new CustomEvent(_, Z);
|
|
55
|
+
a.addEventListener(_, g), a.dispatchEvent(d), d.defaultPrevented || k(o ?? document.body, { select: !0 }), a.removeEventListener(_, g), Q.remove(h);
|
|
69
56
|
}, 0);
|
|
70
57
|
};
|
|
71
58
|
}
|
|
@@ -90,7 +77,7 @@ function Ee(e, { select: t = !1 } = {}) {
|
|
|
90
77
|
if (k(r, { select: t }), document.activeElement !== n) return;
|
|
91
78
|
}
|
|
92
79
|
function Se(e) {
|
|
93
|
-
const t = oe(e), n =
|
|
80
|
+
const t = oe(e), n = q(t, e), r = q(t.reverse(), e);
|
|
94
81
|
return [n, r];
|
|
95
82
|
}
|
|
96
83
|
function oe(e) {
|
|
@@ -103,7 +90,7 @@ function oe(e) {
|
|
|
103
90
|
for (; n.nextNode(); ) t.push(n.currentNode);
|
|
104
91
|
return t;
|
|
105
92
|
}
|
|
106
|
-
function
|
|
93
|
+
function q(e, t) {
|
|
107
94
|
for (const n of e)
|
|
108
95
|
if (!we(n, { upTo: t })) return n;
|
|
109
96
|
}
|
|
@@ -125,75 +112,40 @@ function k(e, { select: t = !1 } = {}) {
|
|
|
125
112
|
e.focus({ preventScroll: !0 }), e !== n && Ce(e) && t && e.select();
|
|
126
113
|
}
|
|
127
114
|
}
|
|
128
|
-
var
|
|
115
|
+
var Q = Re();
|
|
129
116
|
function Re() {
|
|
130
117
|
let e = [];
|
|
131
118
|
return {
|
|
132
119
|
add(t) {
|
|
133
120
|
const n = e[0];
|
|
134
|
-
t !== n && n?.pause(), e =
|
|
121
|
+
t !== n && n?.pause(), e = $(e, t), e.unshift(t);
|
|
135
122
|
},
|
|
136
123
|
remove(t) {
|
|
137
|
-
e =
|
|
124
|
+
e = $(e, t), e[0]?.resume();
|
|
138
125
|
}
|
|
139
126
|
};
|
|
140
127
|
}
|
|
141
|
-
function
|
|
128
|
+
function $(e, t) {
|
|
142
129
|
const n = [...e], r = n.indexOf(t);
|
|
143
130
|
return r !== -1 && n.splice(r, 1), n;
|
|
144
131
|
}
|
|
145
132
|
function ke(e) {
|
|
146
133
|
return e.filter((t) => t.tagName !== "A");
|
|
147
134
|
}
|
|
148
|
-
var
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
},
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
return !!n;
|
|
163
|
-
});
|
|
164
|
-
}, Ne = function(e, t, n, r) {
|
|
165
|
-
var c = Te(t, Array.isArray(e) ? e : [e]);
|
|
166
|
-
L[n] || (L[n] = /* @__PURE__ */ new WeakMap());
|
|
167
|
-
var i = L[n], s = [], a = /* @__PURE__ */ new Set(), S = new Set(c), b = function(f) {
|
|
168
|
-
!f || a.has(f) || (a.add(f), b(f.parentNode));
|
|
169
|
-
};
|
|
170
|
-
c.forEach(b);
|
|
171
|
-
var g = function(f) {
|
|
172
|
-
!f || S.has(f) || Array.prototype.forEach.call(f.children, function(v) {
|
|
173
|
-
if (a.has(v))
|
|
174
|
-
g(v);
|
|
175
|
-
else
|
|
176
|
-
try {
|
|
177
|
-
var h = v.getAttribute(r), w = h !== null && h !== "false", o = (T.get(v) || 0) + 1, l = (i.get(v) || 0) + 1;
|
|
178
|
-
T.set(v, o), i.set(v, l), s.push(v), o === 1 && w && O.set(v, !0), l === 1 && v.setAttribute(n, "true"), w || v.setAttribute(r, "true");
|
|
179
|
-
} catch (d) {
|
|
180
|
-
console.error("aria-hidden: cannot operate on ", v, d);
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
};
|
|
184
|
-
return g(t), a.clear(), K++, function() {
|
|
185
|
-
s.forEach(function(f) {
|
|
186
|
-
var v = T.get(f) - 1, h = i.get(f) - 1;
|
|
187
|
-
T.set(f, v), i.set(f, h), v || (O.has(f) || f.removeAttribute(r), O.delete(f)), h || f.removeAttribute(n);
|
|
188
|
-
}), K--, K || (T = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), L = {});
|
|
189
|
-
};
|
|
190
|
-
}, yt = function(e, t, n) {
|
|
191
|
-
n === void 0 && (n = "data-aria-hidden");
|
|
192
|
-
var r = Array.from(Array.isArray(e) ? e : [e]), c = Ae(e);
|
|
193
|
-
return c ? (r.push.apply(r, Array.from(c.querySelectorAll("[aria-live], script"))), Ne(r, c, n, "aria-hidden")) : function() {
|
|
194
|
-
return null;
|
|
195
|
-
};
|
|
196
|
-
}, C = function() {
|
|
135
|
+
var j = 0;
|
|
136
|
+
function gt() {
|
|
137
|
+
u.useEffect(() => {
|
|
138
|
+
const e = document.querySelectorAll("[data-radix-focus-guard]");
|
|
139
|
+
return document.body.insertAdjacentElement("afterbegin", e[0] ?? J()), document.body.insertAdjacentElement("beforeend", e[1] ?? J()), j++, () => {
|
|
140
|
+
j === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), j--;
|
|
141
|
+
};
|
|
142
|
+
}, []);
|
|
143
|
+
}
|
|
144
|
+
function J() {
|
|
145
|
+
const e = document.createElement("span");
|
|
146
|
+
return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
|
|
147
|
+
}
|
|
148
|
+
var C = function() {
|
|
197
149
|
return C = Object.assign || function(t) {
|
|
198
150
|
for (var n, r = 1, c = arguments.length; r < c; r++) {
|
|
199
151
|
n = arguments[r];
|
|
@@ -202,7 +154,7 @@ var Ae = function(e) {
|
|
|
202
154
|
return t;
|
|
203
155
|
}, C.apply(this, arguments);
|
|
204
156
|
};
|
|
205
|
-
function
|
|
157
|
+
function ce(e, t) {
|
|
206
158
|
var n = {};
|
|
207
159
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
208
160
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -210,16 +162,16 @@ function ue(e, t) {
|
|
|
210
162
|
t.indexOf(r[c]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[c]) && (n[r[c]] = e[r[c]]);
|
|
211
163
|
return n;
|
|
212
164
|
}
|
|
213
|
-
function
|
|
165
|
+
function Ae(e, t, n) {
|
|
214
166
|
if (n || arguments.length === 2) for (var r = 0, c = t.length, i; r < c; r++)
|
|
215
167
|
(i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
|
|
216
168
|
return e.concat(i || Array.prototype.slice.call(t));
|
|
217
169
|
}
|
|
218
|
-
var W = "right-scroll-bar-position", B = "width-before-scroll-bar",
|
|
219
|
-
function
|
|
170
|
+
var W = "right-scroll-bar-position", B = "width-before-scroll-bar", Te = "with-scroll-bars-hidden", Ne = "--removed-body-scroll-bar-size";
|
|
171
|
+
function K(e, t) {
|
|
220
172
|
return typeof e == "function" ? e(t) : e && (e.current = t), e;
|
|
221
173
|
}
|
|
222
|
-
function
|
|
174
|
+
function Me(e, t) {
|
|
223
175
|
var n = he(function() {
|
|
224
176
|
return {
|
|
225
177
|
// value
|
|
@@ -240,31 +192,31 @@ function Oe(e, t) {
|
|
|
240
192
|
})[0];
|
|
241
193
|
return n.callback = t, n.facade;
|
|
242
194
|
}
|
|
243
|
-
var
|
|
244
|
-
function
|
|
245
|
-
var n =
|
|
195
|
+
var Fe = typeof window < "u" ? u.useLayoutEffect : u.useEffect, ee = /* @__PURE__ */ new WeakMap();
|
|
196
|
+
function Pe(e, t) {
|
|
197
|
+
var n = Me(null, function(r) {
|
|
246
198
|
return e.forEach(function(c) {
|
|
247
|
-
return
|
|
199
|
+
return K(c, r);
|
|
248
200
|
});
|
|
249
201
|
});
|
|
250
|
-
return
|
|
202
|
+
return Fe(function() {
|
|
251
203
|
var r = ee.get(n);
|
|
252
204
|
if (r) {
|
|
253
205
|
var c = new Set(r), i = new Set(e), s = n.current;
|
|
254
206
|
c.forEach(function(a) {
|
|
255
|
-
i.has(a) ||
|
|
207
|
+
i.has(a) || K(a, null);
|
|
256
208
|
}), i.forEach(function(a) {
|
|
257
|
-
c.has(a) ||
|
|
209
|
+
c.has(a) || K(a, s);
|
|
258
210
|
});
|
|
259
211
|
}
|
|
260
212
|
ee.set(n, e);
|
|
261
213
|
}, [e]), n;
|
|
262
214
|
}
|
|
263
|
-
function
|
|
215
|
+
function Oe(e) {
|
|
264
216
|
return e;
|
|
265
217
|
}
|
|
266
|
-
function
|
|
267
|
-
t === void 0 && (t =
|
|
218
|
+
function Le(e, t) {
|
|
219
|
+
t === void 0 && (t = Oe);
|
|
268
220
|
var n = [], r = !1, c = {
|
|
269
221
|
read: function() {
|
|
270
222
|
if (r)
|
|
@@ -318,13 +270,13 @@ function We(e, t) {
|
|
|
318
270
|
};
|
|
319
271
|
return c;
|
|
320
272
|
}
|
|
321
|
-
function
|
|
273
|
+
function Ie(e) {
|
|
322
274
|
e === void 0 && (e = {});
|
|
323
|
-
var t =
|
|
275
|
+
var t = Le(null);
|
|
324
276
|
return t.options = C({ async: !0, ssr: !1 }, e), t;
|
|
325
277
|
}
|
|
326
|
-
var
|
|
327
|
-
var t = e.sideCar, n =
|
|
278
|
+
var ue = function(e) {
|
|
279
|
+
var t = e.sideCar, n = ce(e, ["sideCar"]);
|
|
328
280
|
if (!t)
|
|
329
281
|
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
330
282
|
var r = t.read();
|
|
@@ -332,21 +284,21 @@ var ie = function(e) {
|
|
|
332
284
|
throw new Error("Sidecar medium not found");
|
|
333
285
|
return u.createElement(r, C({}, n));
|
|
334
286
|
};
|
|
335
|
-
|
|
336
|
-
function
|
|
337
|
-
return e.useMedium(t),
|
|
287
|
+
ue.isSideCarExport = !0;
|
|
288
|
+
function xe(e, t) {
|
|
289
|
+
return e.useMedium(t), ue;
|
|
338
290
|
}
|
|
339
|
-
var
|
|
291
|
+
var ie = Ie(), H = function() {
|
|
340
292
|
}, D = u.forwardRef(function(e, t) {
|
|
341
293
|
var n = u.useRef(null), r = u.useState({
|
|
342
|
-
onScrollCapture:
|
|
343
|
-
onWheelCapture:
|
|
344
|
-
onTouchMoveCapture:
|
|
345
|
-
}), c = r[0], i = r[1], s = e.forwardProps, a = e.children, S = e.className, b = e.removeScrollBar, g = e.enabled, f = e.shards, v = e.sideCar, h = e.noRelative, w = e.noIsolation, o = e.inert, l = e.allowPinchZoom, d = e.as, m = d === void 0 ? "div" : d, p = e.gapMode, y =
|
|
294
|
+
onScrollCapture: H,
|
|
295
|
+
onWheelCapture: H,
|
|
296
|
+
onTouchMoveCapture: H
|
|
297
|
+
}), c = r[0], i = r[1], s = e.forwardProps, a = e.children, S = e.className, b = e.removeScrollBar, g = e.enabled, f = e.shards, v = e.sideCar, h = e.noRelative, w = e.noIsolation, o = e.inert, l = e.allowPinchZoom, d = e.as, m = d === void 0 ? "div" : d, p = e.gapMode, y = ce(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), E = v, A = Pe([n, t]), R = C(C({}, y), c);
|
|
346
298
|
return u.createElement(
|
|
347
299
|
u.Fragment,
|
|
348
300
|
null,
|
|
349
|
-
g && u.createElement(E, { sideCar:
|
|
301
|
+
g && u.createElement(E, { sideCar: ie, removeScrollBar: b, shards: f, noRelative: h, noIsolation: w, inert: o, setCallbacks: i, allowPinchZoom: !!l, lockRef: n, gapMode: p }),
|
|
350
302
|
s ? u.cloneElement(u.Children.only(a), C(C({}, R), { ref: A })) : u.createElement(m, C({}, R, { className: S, ref: A }), a)
|
|
351
303
|
);
|
|
352
304
|
});
|
|
@@ -359,37 +311,37 @@ D.classNames = {
|
|
|
359
311
|
fullWidth: B,
|
|
360
312
|
zeroRight: W
|
|
361
313
|
};
|
|
362
|
-
var
|
|
314
|
+
var We = function() {
|
|
363
315
|
if (typeof __webpack_nonce__ < "u")
|
|
364
316
|
return __webpack_nonce__;
|
|
365
317
|
};
|
|
366
|
-
function
|
|
318
|
+
function Be() {
|
|
367
319
|
if (!document)
|
|
368
320
|
return null;
|
|
369
321
|
var e = document.createElement("style");
|
|
370
322
|
e.type = "text/css";
|
|
371
|
-
var t =
|
|
323
|
+
var t = We();
|
|
372
324
|
return t && e.setAttribute("nonce", t), e;
|
|
373
325
|
}
|
|
374
|
-
function
|
|
326
|
+
function De(e, t) {
|
|
375
327
|
e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
|
|
376
328
|
}
|
|
377
|
-
function
|
|
329
|
+
function Ue(e) {
|
|
378
330
|
var t = document.head || document.getElementsByTagName("head")[0];
|
|
379
331
|
t.appendChild(e);
|
|
380
332
|
}
|
|
381
|
-
var
|
|
333
|
+
var _e = function() {
|
|
382
334
|
var e = 0, t = null;
|
|
383
335
|
return {
|
|
384
336
|
add: function(n) {
|
|
385
|
-
e == 0 && (t =
|
|
337
|
+
e == 0 && (t = Be()) && (De(t, n), Ue(t)), e++;
|
|
386
338
|
},
|
|
387
339
|
remove: function() {
|
|
388
340
|
e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
|
|
389
341
|
}
|
|
390
342
|
};
|
|
391
|
-
},
|
|
392
|
-
var e =
|
|
343
|
+
}, je = function() {
|
|
344
|
+
var e = _e();
|
|
393
345
|
return function(t, n) {
|
|
394
346
|
u.useEffect(function() {
|
|
395
347
|
return e.add(t), function() {
|
|
@@ -397,36 +349,36 @@ var He = function() {
|
|
|
397
349
|
};
|
|
398
350
|
}, [t && n]);
|
|
399
351
|
};
|
|
400
|
-
},
|
|
401
|
-
var e =
|
|
352
|
+
}, le = function() {
|
|
353
|
+
var e = je(), t = function(n) {
|
|
402
354
|
var r = n.styles, c = n.dynamic;
|
|
403
355
|
return e(r, c), null;
|
|
404
356
|
};
|
|
405
357
|
return t;
|
|
406
|
-
},
|
|
358
|
+
}, Ke = {
|
|
407
359
|
left: 0,
|
|
408
360
|
top: 0,
|
|
409
361
|
right: 0,
|
|
410
362
|
gap: 0
|
|
411
|
-
},
|
|
363
|
+
}, V = function(e) {
|
|
412
364
|
return parseInt(e || "", 10) || 0;
|
|
413
|
-
},
|
|
365
|
+
}, He = function(e) {
|
|
414
366
|
var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], c = t[e === "padding" ? "paddingRight" : "marginRight"];
|
|
415
|
-
return [
|
|
416
|
-
},
|
|
367
|
+
return [V(n), V(r), V(c)];
|
|
368
|
+
}, Ve = function(e) {
|
|
417
369
|
if (e === void 0 && (e = "margin"), typeof window > "u")
|
|
418
|
-
return
|
|
419
|
-
var t =
|
|
370
|
+
return Ke;
|
|
371
|
+
var t = He(e), n = document.documentElement.clientWidth, r = window.innerWidth;
|
|
420
372
|
return {
|
|
421
373
|
left: t[0],
|
|
422
374
|
top: t[1],
|
|
423
375
|
right: t[2],
|
|
424
376
|
gap: Math.max(0, r - n + t[2] - t[0])
|
|
425
377
|
};
|
|
426
|
-
},
|
|
378
|
+
}, Xe = le(), F = "data-scroll-locked", Ye = function(e, t, n, r) {
|
|
427
379
|
var c = e.left, i = e.top, s = e.right, a = e.gap;
|
|
428
380
|
return n === void 0 && (n = "margin"), `
|
|
429
|
-
.`.concat(
|
|
381
|
+
.`.concat(Te, ` {
|
|
430
382
|
overflow: hidden `).concat(r, `;
|
|
431
383
|
padding-right: `).concat(a, "px ").concat(r, `;
|
|
432
384
|
}
|
|
@@ -464,93 +416,93 @@ var He = function() {
|
|
|
464
416
|
}
|
|
465
417
|
|
|
466
418
|
body[`).concat(F, `] {
|
|
467
|
-
`).concat(
|
|
419
|
+
`).concat(Ne, ": ").concat(a, `px;
|
|
468
420
|
}
|
|
469
421
|
`);
|
|
470
422
|
}, te = function() {
|
|
471
423
|
var e = parseInt(document.body.getAttribute(F) || "0", 10);
|
|
472
424
|
return isFinite(e) ? e : 0;
|
|
473
|
-
},
|
|
425
|
+
}, Ge = function() {
|
|
474
426
|
u.useEffect(function() {
|
|
475
427
|
return document.body.setAttribute(F, (te() + 1).toString()), function() {
|
|
476
428
|
var e = te() - 1;
|
|
477
429
|
e <= 0 ? document.body.removeAttribute(F) : document.body.setAttribute(F, e.toString());
|
|
478
430
|
};
|
|
479
431
|
}, []);
|
|
480
|
-
},
|
|
432
|
+
}, ze = function(e) {
|
|
481
433
|
var t = e.noRelative, n = e.noImportant, r = e.gapMode, c = r === void 0 ? "margin" : r;
|
|
482
|
-
|
|
434
|
+
Ge();
|
|
483
435
|
var i = u.useMemo(function() {
|
|
484
|
-
return
|
|
436
|
+
return Ve(c);
|
|
485
437
|
}, [c]);
|
|
486
|
-
return u.createElement(
|
|
438
|
+
return u.createElement(Xe, { styles: Ye(i, !t, c, n ? "" : "!important") });
|
|
487
439
|
}, Y = !1;
|
|
488
440
|
if (typeof window < "u")
|
|
489
441
|
try {
|
|
490
|
-
var
|
|
442
|
+
var O = Object.defineProperty({}, "passive", {
|
|
491
443
|
get: function() {
|
|
492
444
|
return Y = !0, !0;
|
|
493
445
|
}
|
|
494
446
|
});
|
|
495
|
-
window.addEventListener("test",
|
|
447
|
+
window.addEventListener("test", O, O), window.removeEventListener("test", O, O);
|
|
496
448
|
} catch {
|
|
497
449
|
Y = !1;
|
|
498
450
|
}
|
|
499
|
-
var
|
|
451
|
+
var T = Y ? { passive: !1 } : !1, Ze = function(e) {
|
|
500
452
|
return e.tagName === "TEXTAREA";
|
|
501
|
-
},
|
|
453
|
+
}, se = function(e, t) {
|
|
502
454
|
if (!(e instanceof Element))
|
|
503
455
|
return !1;
|
|
504
456
|
var n = window.getComputedStyle(e);
|
|
505
457
|
return (
|
|
506
458
|
// not-not-scrollable
|
|
507
459
|
n[t] !== "hidden" && // contains scroll inside self
|
|
508
|
-
!(n.overflowY === n.overflowX &&
|
|
460
|
+
!(n.overflowY === n.overflowX && !Ze(e) && n[t] === "visible")
|
|
509
461
|
);
|
|
510
|
-
},
|
|
511
|
-
return
|
|
512
|
-
},
|
|
513
|
-
return
|
|
462
|
+
}, qe = function(e) {
|
|
463
|
+
return se(e, "overflowY");
|
|
464
|
+
}, Qe = function(e) {
|
|
465
|
+
return se(e, "overflowX");
|
|
514
466
|
}, ne = function(e, t) {
|
|
515
467
|
var n = t.ownerDocument, r = t;
|
|
516
468
|
do {
|
|
517
469
|
typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
|
|
518
|
-
var c =
|
|
470
|
+
var c = fe(e, r);
|
|
519
471
|
if (c) {
|
|
520
|
-
var i =
|
|
472
|
+
var i = de(e, r), s = i[1], a = i[2];
|
|
521
473
|
if (s > a)
|
|
522
474
|
return !0;
|
|
523
475
|
}
|
|
524
476
|
r = r.parentNode;
|
|
525
477
|
} while (r && r !== n.body);
|
|
526
478
|
return !1;
|
|
527
|
-
},
|
|
479
|
+
}, $e = function(e) {
|
|
528
480
|
var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
|
|
529
481
|
return [
|
|
530
482
|
t,
|
|
531
483
|
n,
|
|
532
484
|
r
|
|
533
485
|
];
|
|
534
|
-
},
|
|
486
|
+
}, Je = function(e) {
|
|
535
487
|
var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
|
|
536
488
|
return [
|
|
537
489
|
t,
|
|
538
490
|
n,
|
|
539
491
|
r
|
|
540
492
|
];
|
|
493
|
+
}, fe = function(e, t) {
|
|
494
|
+
return e === "v" ? qe(t) : Qe(t);
|
|
541
495
|
}, de = function(e, t) {
|
|
542
|
-
return e === "v" ?
|
|
543
|
-
},
|
|
544
|
-
return e === "v" ? tt(t) : nt(t);
|
|
545
|
-
}, rt = function(e, t) {
|
|
496
|
+
return e === "v" ? $e(t) : Je(t);
|
|
497
|
+
}, et = function(e, t) {
|
|
546
498
|
return e === "h" && t === "rtl" ? -1 : 1;
|
|
547
|
-
},
|
|
548
|
-
var i =
|
|
499
|
+
}, tt = function(e, t, n, r, c) {
|
|
500
|
+
var i = et(e, window.getComputedStyle(t).direction), s = i * r, a = n.target, S = t.contains(a), b = !1, g = s > 0, f = 0, v = 0;
|
|
549
501
|
do {
|
|
550
502
|
if (!a)
|
|
551
503
|
break;
|
|
552
|
-
var h =
|
|
553
|
-
(w || d) &&
|
|
504
|
+
var h = de(e, a), w = h[0], o = h[1], l = h[2], d = o - l - i * w;
|
|
505
|
+
(w || d) && fe(e, a) && (f += d, v += w);
|
|
554
506
|
var m = a.parentNode;
|
|
555
507
|
a = m && m.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? m.host : m;
|
|
556
508
|
} while (
|
|
@@ -559,28 +511,28 @@ var N = Y ? { passive: !1 } : !1, $e = function(e) {
|
|
|
559
511
|
S && (t.contains(a) || t === a)
|
|
560
512
|
);
|
|
561
513
|
return (g && Math.abs(f) < 1 || !g && Math.abs(v) < 1) && (b = !0), b;
|
|
562
|
-
},
|
|
514
|
+
}, L = function(e) {
|
|
563
515
|
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
564
516
|
}, re = function(e) {
|
|
565
517
|
return [e.deltaX, e.deltaY];
|
|
566
518
|
}, ae = function(e) {
|
|
567
519
|
return e && "current" in e ? e.current : e;
|
|
568
|
-
},
|
|
520
|
+
}, nt = function(e, t) {
|
|
569
521
|
return e[0] === t[0] && e[1] === t[1];
|
|
570
|
-
},
|
|
522
|
+
}, rt = function(e) {
|
|
571
523
|
return `
|
|
572
524
|
.block-interactivity-`.concat(e, ` {pointer-events: none;}
|
|
573
525
|
.allow-interactivity-`).concat(e, ` {pointer-events: all;}
|
|
574
526
|
`);
|
|
575
|
-
},
|
|
576
|
-
function
|
|
577
|
-
var t = u.useRef([]), n = u.useRef([0, 0]), r = u.useRef(), c = u.useState(
|
|
527
|
+
}, at = 0, N = [];
|
|
528
|
+
function ot(e) {
|
|
529
|
+
var t = u.useRef([]), n = u.useRef([0, 0]), r = u.useRef(), c = u.useState(at++)[0], i = u.useState(le)[0], s = u.useRef(e);
|
|
578
530
|
u.useEffect(function() {
|
|
579
531
|
s.current = e;
|
|
580
532
|
}, [e]), u.useEffect(function() {
|
|
581
533
|
if (e.inert) {
|
|
582
534
|
document.body.classList.add("block-interactivity-".concat(c));
|
|
583
|
-
var o =
|
|
535
|
+
var o = Ae([e.lockRef.current], (e.shards || []).map(ae), !0).filter(Boolean);
|
|
584
536
|
return o.forEach(function(l) {
|
|
585
537
|
return l.classList.add("allow-interactivity-".concat(c));
|
|
586
538
|
}), function() {
|
|
@@ -593,7 +545,7 @@ function it(e) {
|
|
|
593
545
|
var a = u.useCallback(function(o, l) {
|
|
594
546
|
if ("touches" in o && o.touches.length === 2 || o.type === "wheel" && o.ctrlKey)
|
|
595
547
|
return !s.current.allowPinchZoom;
|
|
596
|
-
var d =
|
|
548
|
+
var d = L(o), m = n.current, p = "deltaX" in o ? o.deltaX : m[0] - d[0], y = "deltaY" in o ? o.deltaY : m[1] - d[1], E, A = o.target, R = Math.abs(p) > Math.abs(y) ? "h" : "v";
|
|
597
549
|
if ("touches" in o && R === "h" && A.type === "range")
|
|
598
550
|
return !1;
|
|
599
551
|
var P = ne(R, A);
|
|
@@ -604,12 +556,12 @@ function it(e) {
|
|
|
604
556
|
if (!r.current && "changedTouches" in o && (p || y) && (r.current = E), !E)
|
|
605
557
|
return !0;
|
|
606
558
|
var G = r.current || E;
|
|
607
|
-
return
|
|
559
|
+
return tt(G, l, o, G === "h" ? p : y);
|
|
608
560
|
}, []), S = u.useCallback(function(o) {
|
|
609
561
|
var l = o;
|
|
610
|
-
if (!(!
|
|
611
|
-
var d = "deltaY" in l ? re(l) :
|
|
612
|
-
return E.name === l.type && (E.target === l.target || l.target === E.shadowParent) &&
|
|
562
|
+
if (!(!N.length || N[N.length - 1] !== i)) {
|
|
563
|
+
var d = "deltaY" in l ? re(l) : L(l), m = t.current.filter(function(E) {
|
|
564
|
+
return E.name === l.type && (E.target === l.target || l.target === E.shadowParent) && nt(E.delta, d);
|
|
613
565
|
})[0];
|
|
614
566
|
if (m && m.should) {
|
|
615
567
|
l.cancelable && l.preventDefault();
|
|
@@ -623,51 +575,100 @@ function it(e) {
|
|
|
623
575
|
}
|
|
624
576
|
}
|
|
625
577
|
}, []), b = u.useCallback(function(o, l, d, m) {
|
|
626
|
-
var p = { name: o, delta: l, target: d, should: m, shadowParent:
|
|
578
|
+
var p = { name: o, delta: l, target: d, should: m, shadowParent: ct(d) };
|
|
627
579
|
t.current.push(p), setTimeout(function() {
|
|
628
580
|
t.current = t.current.filter(function(y) {
|
|
629
581
|
return y !== p;
|
|
630
582
|
});
|
|
631
583
|
}, 1);
|
|
632
584
|
}, []), g = u.useCallback(function(o) {
|
|
633
|
-
n.current =
|
|
585
|
+
n.current = L(o), r.current = void 0;
|
|
634
586
|
}, []), f = u.useCallback(function(o) {
|
|
635
587
|
b(o.type, re(o), o.target, a(o, e.lockRef.current));
|
|
636
588
|
}, []), v = u.useCallback(function(o) {
|
|
637
|
-
b(o.type,
|
|
589
|
+
b(o.type, L(o), o.target, a(o, e.lockRef.current));
|
|
638
590
|
}, []);
|
|
639
591
|
u.useEffect(function() {
|
|
640
|
-
return
|
|
592
|
+
return N.push(i), e.setCallbacks({
|
|
641
593
|
onScrollCapture: f,
|
|
642
594
|
onWheelCapture: f,
|
|
643
595
|
onTouchMoveCapture: v
|
|
644
|
-
}), document.addEventListener("wheel", S,
|
|
645
|
-
|
|
596
|
+
}), document.addEventListener("wheel", S, T), document.addEventListener("touchmove", S, T), document.addEventListener("touchstart", g, T), function() {
|
|
597
|
+
N = N.filter(function(o) {
|
|
646
598
|
return o !== i;
|
|
647
|
-
}), document.removeEventListener("wheel", S,
|
|
599
|
+
}), document.removeEventListener("wheel", S, T), document.removeEventListener("touchmove", S, T), document.removeEventListener("touchstart", g, T);
|
|
648
600
|
};
|
|
649
601
|
}, []);
|
|
650
602
|
var h = e.removeScrollBar, w = e.inert;
|
|
651
603
|
return u.createElement(
|
|
652
604
|
u.Fragment,
|
|
653
605
|
null,
|
|
654
|
-
w ? u.createElement(i, { styles:
|
|
655
|
-
h ? u.createElement(
|
|
606
|
+
w ? u.createElement(i, { styles: rt(c) }) : null,
|
|
607
|
+
h ? u.createElement(ze, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
|
|
656
608
|
);
|
|
657
609
|
}
|
|
658
|
-
function
|
|
610
|
+
function ct(e) {
|
|
659
611
|
for (var t = null; e !== null; )
|
|
660
612
|
e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
|
|
661
613
|
return t;
|
|
662
614
|
}
|
|
663
|
-
const
|
|
664
|
-
var
|
|
665
|
-
return u.createElement(D, C({}, e, { ref: t, sideCar:
|
|
615
|
+
const ut = xe(ie, ot);
|
|
616
|
+
var it = u.forwardRef(function(e, t) {
|
|
617
|
+
return u.createElement(D, C({}, e, { ref: t, sideCar: ut }));
|
|
666
618
|
});
|
|
667
|
-
|
|
619
|
+
it.classNames = D.classNames;
|
|
620
|
+
var lt = function(e) {
|
|
621
|
+
if (typeof document > "u")
|
|
622
|
+
return null;
|
|
623
|
+
var t = Array.isArray(e) ? e[0] : e;
|
|
624
|
+
return t.ownerDocument.body;
|
|
625
|
+
}, M = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), x = {}, X = 0, ve = function(e) {
|
|
626
|
+
return e && (e.host || ve(e.parentNode));
|
|
627
|
+
}, st = function(e, t) {
|
|
628
|
+
return t.map(function(n) {
|
|
629
|
+
if (e.contains(n))
|
|
630
|
+
return n;
|
|
631
|
+
var r = ve(n);
|
|
632
|
+
return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
|
|
633
|
+
}).filter(function(n) {
|
|
634
|
+
return !!n;
|
|
635
|
+
});
|
|
636
|
+
}, ft = function(e, t, n, r) {
|
|
637
|
+
var c = st(t, Array.isArray(e) ? e : [e]);
|
|
638
|
+
x[n] || (x[n] = /* @__PURE__ */ new WeakMap());
|
|
639
|
+
var i = x[n], s = [], a = /* @__PURE__ */ new Set(), S = new Set(c), b = function(f) {
|
|
640
|
+
!f || a.has(f) || (a.add(f), b(f.parentNode));
|
|
641
|
+
};
|
|
642
|
+
c.forEach(b);
|
|
643
|
+
var g = function(f) {
|
|
644
|
+
!f || S.has(f) || Array.prototype.forEach.call(f.children, function(v) {
|
|
645
|
+
if (a.has(v))
|
|
646
|
+
g(v);
|
|
647
|
+
else
|
|
648
|
+
try {
|
|
649
|
+
var h = v.getAttribute(r), w = h !== null && h !== "false", o = (M.get(v) || 0) + 1, l = (i.get(v) || 0) + 1;
|
|
650
|
+
M.set(v, o), i.set(v, l), s.push(v), o === 1 && w && I.set(v, !0), l === 1 && v.setAttribute(n, "true"), w || v.setAttribute(r, "true");
|
|
651
|
+
} catch (d) {
|
|
652
|
+
console.error("aria-hidden: cannot operate on ", v, d);
|
|
653
|
+
}
|
|
654
|
+
});
|
|
655
|
+
};
|
|
656
|
+
return g(t), a.clear(), X++, function() {
|
|
657
|
+
s.forEach(function(f) {
|
|
658
|
+
var v = M.get(f) - 1, h = i.get(f) - 1;
|
|
659
|
+
M.set(f, v), i.set(f, h), v || (I.has(f) || f.removeAttribute(r), I.delete(f)), h || f.removeAttribute(n);
|
|
660
|
+
}), X--, X || (M = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), x = {});
|
|
661
|
+
};
|
|
662
|
+
}, yt = function(e, t, n) {
|
|
663
|
+
n === void 0 && (n = "data-aria-hidden");
|
|
664
|
+
var r = Array.from(Array.isArray(e) ? e : [e]), c = lt(e);
|
|
665
|
+
return c ? (r.push.apply(r, Array.from(c.querySelectorAll("[aria-live], script"))), ft(r, c, n, "aria-hidden")) : function() {
|
|
666
|
+
return null;
|
|
667
|
+
};
|
|
668
|
+
};
|
|
668
669
|
export {
|
|
669
670
|
be as F,
|
|
670
|
-
|
|
671
|
+
it as R,
|
|
671
672
|
yt as h,
|
|
672
673
|
gt as u
|
|
673
674
|
};
|