@krosoft/react 0.0.77 → 0.0.79

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.
Files changed (97) hide show
  1. package/dist/{LoadingState-CqRLmkxn.js → LoadingState-DQjGcT2l.js} +5 -5
  2. package/dist/MetricCard-4VI9Ki0g.js +83 -0
  3. package/dist/SearchInput-Cf5NHhnz.js +698 -0
  4. package/dist/TableFilter-DgChe4aX.js +406 -0
  5. package/dist/TableSettings-4YLJSh4G.js +2064 -0
  6. package/dist/{ThemeSelector-sTd9T2OD.js → ThemeSelector-MqD5QvHl.js} +8 -8
  7. package/dist/{Topbar-BqC05zWP.js → Topbar-DifQ00kV.js} +26 -27
  8. package/dist/{badge-kADcbb2Y.js → badge-Bw-aBz_H.js} +1 -1
  9. package/dist/components/core/cards/KpiCard.d.ts +1 -1
  10. package/dist/components/core/cards/KpiCard.d.ts.map +1 -1
  11. package/dist/components/core/cards/MetricCard.d.ts +20 -8
  12. package/dist/components/core/cards/MetricCard.d.ts.map +1 -1
  13. package/dist/components/core/cards/index.js +1 -1
  14. package/dist/components/core/filters/ActiveFilters.d.ts +10 -0
  15. package/dist/components/core/filters/ActiveFilters.d.ts.map +1 -0
  16. package/dist/components/core/filters/AdvancedFilters.d.ts +11 -0
  17. package/dist/components/core/filters/AdvancedFilters.d.ts.map +1 -0
  18. package/dist/components/core/filters/FilterField.d.ts +11 -0
  19. package/dist/components/core/filters/FilterField.d.ts.map +1 -0
  20. package/dist/components/core/filters/SearchableFilterPill.d.ts +15 -0
  21. package/dist/components/core/filters/SearchableFilterPill.d.ts.map +1 -0
  22. package/dist/components/core/filters/TableFilter.d.ts +17 -0
  23. package/dist/components/core/filters/TableFilter.d.ts.map +1 -0
  24. package/dist/components/core/filters/index.d.ts +5 -0
  25. package/dist/components/core/filters/index.d.ts.map +1 -0
  26. package/dist/components/core/filters/index.js +7 -0
  27. package/dist/components/core/index.d.ts +2 -0
  28. package/dist/components/core/index.d.ts.map +1 -1
  29. package/dist/components/core/index.js +34 -26
  30. package/dist/components/core/inputs/DatePicker.d.ts +9 -0
  31. package/dist/components/core/inputs/DatePicker.d.ts.map +1 -0
  32. package/dist/components/core/inputs/MultiSelect.d.ts +17 -0
  33. package/dist/components/core/inputs/MultiSelect.d.ts.map +1 -0
  34. package/dist/components/core/inputs/SearchInput.d.ts.map +1 -1
  35. package/dist/components/core/inputs/SearchableSelect.d.ts +14 -0
  36. package/dist/components/core/inputs/SearchableSelect.d.ts.map +1 -0
  37. package/dist/components/core/inputs/index.d.ts +3 -1
  38. package/dist/components/core/inputs/index.d.ts.map +1 -1
  39. package/dist/components/core/inputs/index.js +6 -3
  40. package/dist/components/core/navbar/index.js +1 -1
  41. package/dist/components/core/states/index.js +1 -1
  42. package/dist/components/core/table/DataTable.d.ts +17 -2
  43. package/dist/components/core/table/DataTable.d.ts.map +1 -1
  44. package/dist/components/core/table/TableBody.d.ts +2 -2
  45. package/dist/components/core/table/TableBody.d.ts.map +1 -1
  46. package/dist/components/core/table/TableHeader.d.ts +1 -1
  47. package/dist/components/core/table/TableHeader.d.ts.map +1 -1
  48. package/dist/components/core/table/index.d.ts +1 -3
  49. package/dist/components/core/table/index.d.ts.map +1 -1
  50. package/dist/components/core/table/index.js +9 -9
  51. package/dist/components/core/theme/ThemeSelector.d.ts +2 -1
  52. package/dist/components/core/theme/ThemeSelector.d.ts.map +1 -1
  53. package/dist/components/core/theme/index.js +1 -1
  54. package/dist/components/index.js +86 -63
  55. package/dist/components/ui/badge.d.ts +1 -1
  56. package/dist/components/ui/badge.d.ts.map +1 -1
  57. package/dist/components/ui/button.d.ts.map +1 -1
  58. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  59. package/dist/components/ui/index.d.ts +4 -1
  60. package/dist/components/ui/index.d.ts.map +1 -1
  61. package/dist/components/ui/index.js +50 -35
  62. package/dist/components/ui/label.d.ts +6 -0
  63. package/dist/components/ui/label.d.ts.map +1 -0
  64. package/dist/components/ui/select.d.ts +1 -1
  65. package/dist/components/ui/select.d.ts.map +1 -1
  66. package/dist/components/ui/sheet.d.ts.map +1 -1
  67. package/dist/components/ui/toast.d.ts +1 -1
  68. package/dist/components/ui/toast.d.ts.map +1 -1
  69. package/dist/{floating-ui.react-dom-BPCyLQfI.js → floating-ui.react-dom-BIcsGc3t.js} +553 -526
  70. package/dist/hooks/index.js +1 -1
  71. package/dist/hooks/ui/useDataTable.d.ts +1 -1
  72. package/dist/hooks/ui/useDataTable.d.ts.map +1 -1
  73. package/dist/hooks/ui/useToast.d.ts +5 -13
  74. package/dist/hooks/ui/useToast.d.ts.map +1 -1
  75. package/dist/popover-UjRQmYGN.js +5889 -0
  76. package/dist/select-CtU681LB.js +2070 -0
  77. package/dist/tailwind/index.d.ts.map +1 -1
  78. package/dist/tooltip-DzQngJZK.js +828 -0
  79. package/dist/types/FilterFieldConfig.d.ts +16 -0
  80. package/dist/types/FilterFieldConfig.d.ts.map +1 -0
  81. package/dist/types/FilterSection.d.ts +6 -0
  82. package/dist/types/FilterSection.d.ts.map +1 -0
  83. package/dist/types/index.d.ts +0 -1
  84. package/dist/types/index.d.ts.map +1 -1
  85. package/dist/{useTheme-D__o7mLN.js → useTheme-DsHPKCDp.js} +24 -18
  86. package/package.json +5 -3
  87. package/dist/Combination-CzdDhqdB.js +0 -564
  88. package/dist/DataTable-CjFA9p4V.js +0 -2216
  89. package/dist/DateRangePicker-rrXXEYz8.js +0 -1240
  90. package/dist/MetricCard-88djqC4o.js +0 -66
  91. package/dist/calendar-BMReToKR.js +0 -3911
  92. package/dist/checkbox-BI6Lm_p-.js +0 -358
  93. package/dist/chevron-down-ki5-dwtL.js +0 -11
  94. package/dist/select-B-hcmC3K.js +0 -1468
  95. package/dist/tooltip-gI1Mp9DG.js +0 -779
  96. package/dist/types/DataTableProps.d.ts +0 -19
  97. package/dist/types/DataTableProps.d.ts.map +0 -1
@@ -1,564 +0,0 @@
1
- import * as i from "react";
2
- import { useState as ue } from "react";
3
- import { c as le } from "./createLucideIcon-CRdjzt2A.js";
4
- import "react/jsx-runtime";
5
- function tt(e) {
6
- const t = i.useRef({ value: e, previous: e });
7
- return i.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
8
- }
9
- /**
10
- * @license lucide-react v1.16.0 - ISC
11
- *
12
- * This source code is licensed under the ISC license.
13
- * See the LICENSE file in the root directory of this source tree.
14
- */
15
- const se = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], rt = le("check", se);
16
- var fe = i.createContext(void 0);
17
- function nt(e) {
18
- const t = i.useContext(fe);
19
- return e || t || "ltr";
20
- }
21
- var X = 0;
22
- function at() {
23
- i.useEffect(() => {
24
- const e = document.querySelectorAll("[data-radix-focus-guard]");
25
- return document.body.insertAdjacentElement("afterbegin", e[0] ?? _()), document.body.insertAdjacentElement("beforeend", e[1] ?? _()), X++, () => {
26
- X === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), X--;
27
- };
28
- }, []);
29
- }
30
- function _() {
31
- const e = document.createElement("span");
32
- 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;
33
- }
34
- var de = function(e) {
35
- if (typeof document > "u")
36
- return null;
37
- var t = Array.isArray(e) ? e[0] : e;
38
- return t.ownerDocument.body;
39
- }, A = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), L = {}, Y = 0, J = function(e) {
40
- return e && (e.host || J(e.parentNode));
41
- }, ve = function(e, t) {
42
- return t.map(function(r) {
43
- if (e.contains(r))
44
- return r;
45
- var n = J(r);
46
- return n && e.contains(n) ? n : (console.error("aria-hidden", r, "in not contained inside", e, ". Doing nothing"), null);
47
- }).filter(function(r) {
48
- return !!r;
49
- });
50
- }, he = function(e, t, r, n) {
51
- var a = ve(t, Array.isArray(e) ? e : [e]);
52
- L[r] || (L[r] = /* @__PURE__ */ new WeakMap());
53
- var o = L[r], l = [], c = /* @__PURE__ */ new Set(), p = new Set(a), g = function(f) {
54
- !f || c.has(f) || (c.add(f), g(f.parentNode));
55
- };
56
- a.forEach(g);
57
- var v = function(f) {
58
- !f || p.has(f) || Array.prototype.forEach.call(f.children, function(d) {
59
- if (c.has(d))
60
- v(d);
61
- else
62
- try {
63
- var b = d.getAttribute(n), w = b !== null && b !== "false", u = (A.get(d) || 0) + 1, s = (o.get(d) || 0) + 1;
64
- A.set(d, u), o.set(d, s), l.push(d), u === 1 && w && T.set(d, !0), s === 1 && d.setAttribute(r, "true"), w || d.setAttribute(n, "true");
65
- } catch (h) {
66
- console.error("aria-hidden: cannot operate on ", d, h);
67
- }
68
- });
69
- };
70
- return v(t), c.clear(), Y++, function() {
71
- l.forEach(function(f) {
72
- var d = A.get(f) - 1, b = o.get(f) - 1;
73
- A.set(f, d), o.set(f, b), d || (T.has(f) || f.removeAttribute(n), T.delete(f)), b || f.removeAttribute(r);
74
- }), Y--, Y || (A = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), L = {});
75
- };
76
- }, ot = function(e, t, r) {
77
- r === void 0 && (r = "data-aria-hidden");
78
- var n = Array.from(Array.isArray(e) ? e : [e]), a = de(e);
79
- return a ? (n.push.apply(n, Array.from(a.querySelectorAll("[aria-live], script"))), he(n, a, r, "aria-hidden")) : function() {
80
- return null;
81
- };
82
- }, C = function() {
83
- return C = Object.assign || function(t) {
84
- for (var r, n = 1, a = arguments.length; n < a; n++) {
85
- r = arguments[n];
86
- for (var o in r) Object.prototype.hasOwnProperty.call(r, o) && (t[o] = r[o]);
87
- }
88
- return t;
89
- }, C.apply(this, arguments);
90
- };
91
- function ee(e, t) {
92
- var r = {};
93
- for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
94
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
95
- for (var a = 0, n = Object.getOwnPropertySymbols(e); a < n.length; a++)
96
- t.indexOf(n[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[a]) && (r[n[a]] = e[n[a]]);
97
- return r;
98
- }
99
- function me(e, t, r) {
100
- if (r || arguments.length === 2) for (var n = 0, a = t.length, o; n < a; n++)
101
- (o || !(n in t)) && (o || (o = Array.prototype.slice.call(t, 0, n)), o[n] = t[n]);
102
- return e.concat(o || Array.prototype.slice.call(t));
103
- }
104
- var O = "right-scroll-bar-position", D = "width-before-scroll-bar", ge = "with-scroll-bars-hidden", ye = "--removed-body-scroll-bar-size";
105
- function V(e, t) {
106
- return typeof e == "function" ? e(t) : e && (e.current = t), e;
107
- }
108
- function pe(e, t) {
109
- var r = ue(function() {
110
- return {
111
- // value
112
- value: e,
113
- // last callback
114
- callback: t,
115
- // "memoized" public interface
116
- facade: {
117
- get current() {
118
- return r.value;
119
- },
120
- set current(n) {
121
- var a = r.value;
122
- a !== n && (r.value = n, r.callback(n, a));
123
- }
124
- }
125
- };
126
- })[0];
127
- return r.callback = t, r.facade;
128
- }
129
- var be = typeof window < "u" ? i.useLayoutEffect : i.useEffect, q = /* @__PURE__ */ new WeakMap();
130
- function Se(e, t) {
131
- var r = pe(null, function(n) {
132
- return e.forEach(function(a) {
133
- return V(a, n);
134
- });
135
- });
136
- return be(function() {
137
- var n = q.get(r);
138
- if (n) {
139
- var a = new Set(n), o = new Set(e), l = r.current;
140
- a.forEach(function(c) {
141
- o.has(c) || V(c, null);
142
- }), o.forEach(function(c) {
143
- a.has(c) || V(c, l);
144
- });
145
- }
146
- q.set(r, e);
147
- }, [e]), r;
148
- }
149
- function we(e) {
150
- return e;
151
- }
152
- function Ce(e, t) {
153
- t === void 0 && (t = we);
154
- var r = [], n = !1, a = {
155
- read: function() {
156
- if (n)
157
- throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
158
- return r.length ? r[r.length - 1] : e;
159
- },
160
- useMedium: function(o) {
161
- var l = t(o, n);
162
- return r.push(l), function() {
163
- r = r.filter(function(c) {
164
- return c !== l;
165
- });
166
- };
167
- },
168
- assignSyncMedium: function(o) {
169
- for (n = !0; r.length; ) {
170
- var l = r;
171
- r = [], l.forEach(o);
172
- }
173
- r = {
174
- push: function(c) {
175
- return o(c);
176
- },
177
- filter: function() {
178
- return r;
179
- }
180
- };
181
- },
182
- assignMedium: function(o) {
183
- n = !0;
184
- var l = [];
185
- if (r.length) {
186
- var c = r;
187
- r = [], c.forEach(o), l = r;
188
- }
189
- var p = function() {
190
- var v = l;
191
- l = [], v.forEach(o);
192
- }, g = function() {
193
- return Promise.resolve().then(p);
194
- };
195
- g(), r = {
196
- push: function(v) {
197
- l.push(v), g();
198
- },
199
- filter: function(v) {
200
- return l = l.filter(v), r;
201
- }
202
- };
203
- }
204
- };
205
- return a;
206
- }
207
- function Ee(e) {
208
- e === void 0 && (e = {});
209
- var t = Ce(null);
210
- return t.options = C({ async: !0, ssr: !1 }, e), t;
211
- }
212
- var te = function(e) {
213
- var t = e.sideCar, r = ee(e, ["sideCar"]);
214
- if (!t)
215
- throw new Error("Sidecar: please provide `sideCar` property to import the right car");
216
- var n = t.read();
217
- if (!n)
218
- throw new Error("Sidecar medium not found");
219
- return i.createElement(n, C({}, r));
220
- };
221
- te.isSideCarExport = !0;
222
- function Re(e, t) {
223
- return e.useMedium(t), te;
224
- }
225
- var re = Ee(), F = function() {
226
- }, I = i.forwardRef(function(e, t) {
227
- var r = i.useRef(null), n = i.useState({
228
- onScrollCapture: F,
229
- onWheelCapture: F,
230
- onTouchMoveCapture: F
231
- }), a = n[0], o = n[1], l = e.forwardProps, c = e.children, p = e.className, g = e.removeScrollBar, v = e.enabled, f = e.shards, d = e.sideCar, b = e.noRelative, w = e.noIsolation, u = e.inert, s = e.allowPinchZoom, h = e.as, m = h === void 0 ? "div" : h, S = e.gapMode, E = ee(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), y = d, R = Se([r, t]), k = C(C({}, E), a);
232
- return i.createElement(
233
- i.Fragment,
234
- null,
235
- v && i.createElement(y, { sideCar: re, removeScrollBar: g, shards: f, noRelative: b, noIsolation: w, inert: u, setCallbacks: o, allowPinchZoom: !!s, lockRef: r, gapMode: S }),
236
- l ? i.cloneElement(i.Children.only(c), C(C({}, k), { ref: R })) : i.createElement(m, C({}, k, { className: p, ref: R }), c)
237
- );
238
- });
239
- I.defaultProps = {
240
- enabled: !0,
241
- removeScrollBar: !0,
242
- inert: !1
243
- };
244
- I.classNames = {
245
- fullWidth: D,
246
- zeroRight: O
247
- };
248
- var ke = function() {
249
- if (typeof __webpack_nonce__ < "u")
250
- return __webpack_nonce__;
251
- };
252
- function Ae() {
253
- if (!document)
254
- return null;
255
- var e = document.createElement("style");
256
- e.type = "text/css";
257
- var t = ke();
258
- return t && e.setAttribute("nonce", t), e;
259
- }
260
- function Me(e, t) {
261
- e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
262
- }
263
- function Pe(e) {
264
- var t = document.head || document.getElementsByTagName("head")[0];
265
- t.appendChild(e);
266
- }
267
- var xe = function() {
268
- var e = 0, t = null;
269
- return {
270
- add: function(r) {
271
- e == 0 && (t = Ae()) && (Me(t, r), Pe(t)), e++;
272
- },
273
- remove: function() {
274
- e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
275
- }
276
- };
277
- }, Ne = function() {
278
- var e = xe();
279
- return function(t, r) {
280
- i.useEffect(function() {
281
- return e.add(t), function() {
282
- e.remove();
283
- };
284
- }, [t && r]);
285
- };
286
- }, ne = function() {
287
- var e = Ne(), t = function(r) {
288
- var n = r.styles, a = r.dynamic;
289
- return e(n, a), null;
290
- };
291
- return t;
292
- }, Te = {
293
- left: 0,
294
- top: 0,
295
- right: 0,
296
- gap: 0
297
- }, H = function(e) {
298
- return parseInt(e || "", 10) || 0;
299
- }, Le = function(e) {
300
- var t = window.getComputedStyle(document.body), r = t[e === "padding" ? "paddingLeft" : "marginLeft"], n = t[e === "padding" ? "paddingTop" : "marginTop"], a = t[e === "padding" ? "paddingRight" : "marginRight"];
301
- return [H(r), H(n), H(a)];
302
- }, We = function(e) {
303
- if (e === void 0 && (e = "margin"), typeof window > "u")
304
- return Te;
305
- var t = Le(e), r = document.documentElement.clientWidth, n = window.innerWidth;
306
- return {
307
- left: t[0],
308
- top: t[1],
309
- right: t[2],
310
- gap: Math.max(0, n - r + t[2] - t[0])
311
- };
312
- }, Be = ne(), x = "data-scroll-locked", Oe = function(e, t, r, n) {
313
- var a = e.left, o = e.top, l = e.right, c = e.gap;
314
- return r === void 0 && (r = "margin"), `
315
- .`.concat(ge, ` {
316
- overflow: hidden `).concat(n, `;
317
- padding-right: `).concat(c, "px ").concat(n, `;
318
- }
319
- body[`).concat(x, `] {
320
- overflow: hidden `).concat(n, `;
321
- overscroll-behavior: contain;
322
- `).concat([
323
- t && "position: relative ".concat(n, ";"),
324
- r === "margin" && `
325
- padding-left: `.concat(a, `px;
326
- padding-top: `).concat(o, `px;
327
- padding-right: `).concat(l, `px;
328
- margin-left:0;
329
- margin-top:0;
330
- margin-right: `).concat(c, "px ").concat(n, `;
331
- `),
332
- r === "padding" && "padding-right: ".concat(c, "px ").concat(n, ";")
333
- ].filter(Boolean).join(""), `
334
- }
335
-
336
- .`).concat(O, ` {
337
- right: `).concat(c, "px ").concat(n, `;
338
- }
339
-
340
- .`).concat(D, ` {
341
- margin-right: `).concat(c, "px ").concat(n, `;
342
- }
343
-
344
- .`).concat(O, " .").concat(O, ` {
345
- right: 0 `).concat(n, `;
346
- }
347
-
348
- .`).concat(D, " .").concat(D, ` {
349
- margin-right: 0 `).concat(n, `;
350
- }
351
-
352
- body[`).concat(x, `] {
353
- `).concat(ye, ": ").concat(c, `px;
354
- }
355
- `);
356
- }, Q = function() {
357
- var e = parseInt(document.body.getAttribute(x) || "0", 10);
358
- return isFinite(e) ? e : 0;
359
- }, De = function() {
360
- i.useEffect(function() {
361
- return document.body.setAttribute(x, (Q() + 1).toString()), function() {
362
- var e = Q() - 1;
363
- e <= 0 ? document.body.removeAttribute(x) : document.body.setAttribute(x, e.toString());
364
- };
365
- }, []);
366
- }, Ie = function(e) {
367
- var t = e.noRelative, r = e.noImportant, n = e.gapMode, a = n === void 0 ? "margin" : n;
368
- De();
369
- var o = i.useMemo(function() {
370
- return We(a);
371
- }, [a]);
372
- return i.createElement(Be, { styles: Oe(o, !t, a, r ? "" : "!important") });
373
- }, G = !1;
374
- if (typeof window < "u")
375
- try {
376
- var W = Object.defineProperty({}, "passive", {
377
- get: function() {
378
- return G = !0, !0;
379
- }
380
- });
381
- window.addEventListener("test", W, W), window.removeEventListener("test", W, W);
382
- } catch {
383
- G = !1;
384
- }
385
- var M = G ? { passive: !1 } : !1, je = function(e) {
386
- return e.tagName === "TEXTAREA";
387
- }, ae = function(e, t) {
388
- if (!(e instanceof Element))
389
- return !1;
390
- var r = window.getComputedStyle(e);
391
- return (
392
- // not-not-scrollable
393
- r[t] !== "hidden" && // contains scroll inside self
394
- !(r.overflowY === r.overflowX && !je(e) && r[t] === "visible")
395
- );
396
- }, Xe = function(e) {
397
- return ae(e, "overflowY");
398
- }, Ye = function(e) {
399
- return ae(e, "overflowX");
400
- }, K = function(e, t) {
401
- var r = t.ownerDocument, n = t;
402
- do {
403
- typeof ShadowRoot < "u" && n instanceof ShadowRoot && (n = n.host);
404
- var a = oe(e, n);
405
- if (a) {
406
- var o = ce(e, n), l = o[1], c = o[2];
407
- if (l > c)
408
- return !0;
409
- }
410
- n = n.parentNode;
411
- } while (n && n !== r.body);
412
- return !1;
413
- }, Ve = function(e) {
414
- var t = e.scrollTop, r = e.scrollHeight, n = e.clientHeight;
415
- return [
416
- t,
417
- r,
418
- n
419
- ];
420
- }, Fe = function(e) {
421
- var t = e.scrollLeft, r = e.scrollWidth, n = e.clientWidth;
422
- return [
423
- t,
424
- r,
425
- n
426
- ];
427
- }, oe = function(e, t) {
428
- return e === "v" ? Xe(t) : Ye(t);
429
- }, ce = function(e, t) {
430
- return e === "v" ? Ve(t) : Fe(t);
431
- }, He = function(e, t) {
432
- return e === "h" && t === "rtl" ? -1 : 1;
433
- }, Ge = function(e, t, r, n, a) {
434
- var o = He(e, window.getComputedStyle(t).direction), l = o * n, c = r.target, p = t.contains(c), g = !1, v = l > 0, f = 0, d = 0;
435
- do {
436
- if (!c)
437
- break;
438
- var b = ce(e, c), w = b[0], u = b[1], s = b[2], h = u - s - o * w;
439
- (w || h) && oe(e, c) && (f += h, d += w);
440
- var m = c.parentNode;
441
- c = m && m.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? m.host : m;
442
- } while (
443
- // portaled content
444
- !p && c !== document.body || // self content
445
- p && (t.contains(c) || t === c)
446
- );
447
- return (v && Math.abs(f) < 1 || !v && Math.abs(d) < 1) && (g = !0), g;
448
- }, B = function(e) {
449
- return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
450
- }, U = function(e) {
451
- return [e.deltaX, e.deltaY];
452
- }, $ = function(e) {
453
- return e && "current" in e ? e.current : e;
454
- }, ze = function(e, t) {
455
- return e[0] === t[0] && e[1] === t[1];
456
- }, Ze = function(e) {
457
- return `
458
- .block-interactivity-`.concat(e, ` {pointer-events: none;}
459
- .allow-interactivity-`).concat(e, ` {pointer-events: all;}
460
- `);
461
- }, _e = 0, P = [];
462
- function qe(e) {
463
- var t = i.useRef([]), r = i.useRef([0, 0]), n = i.useRef(), a = i.useState(_e++)[0], o = i.useState(ne)[0], l = i.useRef(e);
464
- i.useEffect(function() {
465
- l.current = e;
466
- }, [e]), i.useEffect(function() {
467
- if (e.inert) {
468
- document.body.classList.add("block-interactivity-".concat(a));
469
- var u = me([e.lockRef.current], (e.shards || []).map($), !0).filter(Boolean);
470
- return u.forEach(function(s) {
471
- return s.classList.add("allow-interactivity-".concat(a));
472
- }), function() {
473
- document.body.classList.remove("block-interactivity-".concat(a)), u.forEach(function(s) {
474
- return s.classList.remove("allow-interactivity-".concat(a));
475
- });
476
- };
477
- }
478
- }, [e.inert, e.lockRef.current, e.shards]);
479
- var c = i.useCallback(function(u, s) {
480
- if ("touches" in u && u.touches.length === 2 || u.type === "wheel" && u.ctrlKey)
481
- return !l.current.allowPinchZoom;
482
- var h = B(u), m = r.current, S = "deltaX" in u ? u.deltaX : m[0] - h[0], E = "deltaY" in u ? u.deltaY : m[1] - h[1], y, R = u.target, k = Math.abs(S) > Math.abs(E) ? "h" : "v";
483
- if ("touches" in u && k === "h" && R.type === "range")
484
- return !1;
485
- var z = window.getSelection(), j = z && z.anchorNode, ie = j ? j === R || j.contains(R) : !1;
486
- if (ie)
487
- return !1;
488
- var N = K(k, R);
489
- if (!N)
490
- return !0;
491
- if (N ? y = k : (y = k === "v" ? "h" : "v", N = K(k, R)), !N)
492
- return !1;
493
- if (!n.current && "changedTouches" in u && (S || E) && (n.current = y), !y)
494
- return !0;
495
- var Z = n.current || y;
496
- return Ge(Z, s, u, Z === "h" ? S : E);
497
- }, []), p = i.useCallback(function(u) {
498
- var s = u;
499
- if (!(!P.length || P[P.length - 1] !== o)) {
500
- var h = "deltaY" in s ? U(s) : B(s), m = t.current.filter(function(y) {
501
- return y.name === s.type && (y.target === s.target || s.target === y.shadowParent) && ze(y.delta, h);
502
- })[0];
503
- if (m && m.should) {
504
- s.cancelable && s.preventDefault();
505
- return;
506
- }
507
- if (!m) {
508
- var S = (l.current.shards || []).map($).filter(Boolean).filter(function(y) {
509
- return y.contains(s.target);
510
- }), E = S.length > 0 ? c(s, S[0]) : !l.current.noIsolation;
511
- E && s.cancelable && s.preventDefault();
512
- }
513
- }
514
- }, []), g = i.useCallback(function(u, s, h, m) {
515
- var S = { name: u, delta: s, target: h, should: m, shadowParent: Qe(h) };
516
- t.current.push(S), setTimeout(function() {
517
- t.current = t.current.filter(function(E) {
518
- return E !== S;
519
- });
520
- }, 1);
521
- }, []), v = i.useCallback(function(u) {
522
- r.current = B(u), n.current = void 0;
523
- }, []), f = i.useCallback(function(u) {
524
- g(u.type, U(u), u.target, c(u, e.lockRef.current));
525
- }, []), d = i.useCallback(function(u) {
526
- g(u.type, B(u), u.target, c(u, e.lockRef.current));
527
- }, []);
528
- i.useEffect(function() {
529
- return P.push(o), e.setCallbacks({
530
- onScrollCapture: f,
531
- onWheelCapture: f,
532
- onTouchMoveCapture: d
533
- }), document.addEventListener("wheel", p, M), document.addEventListener("touchmove", p, M), document.addEventListener("touchstart", v, M), function() {
534
- P = P.filter(function(u) {
535
- return u !== o;
536
- }), document.removeEventListener("wheel", p, M), document.removeEventListener("touchmove", p, M), document.removeEventListener("touchstart", v, M);
537
- };
538
- }, []);
539
- var b = e.removeScrollBar, w = e.inert;
540
- return i.createElement(
541
- i.Fragment,
542
- null,
543
- w ? i.createElement(o, { styles: Ze(a) }) : null,
544
- b ? i.createElement(Ie, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
545
- );
546
- }
547
- function Qe(e) {
548
- for (var t = null; e !== null; )
549
- e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
550
- return t;
551
- }
552
- const Ke = Re(re, qe);
553
- var Ue = i.forwardRef(function(e, t) {
554
- return i.createElement(I, C({}, e, { ref: t, sideCar: Ke }));
555
- });
556
- Ue.classNames = I.classNames;
557
- export {
558
- rt as C,
559
- Ue as R,
560
- at as a,
561
- nt as b,
562
- ot as h,
563
- tt as u
564
- };