mimir-ui-kit 1.37.5 → 1.37.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
- import U, { useRef as m, useCallback as h, useEffect as w, useState as M, useMemo as ne, useLayoutEffect as re, forwardRef as oe, Fragment as O, isValidElement as ie, cloneElement as ae, createElement as ue } from "react";
1
+ import U, { useRef as m, useCallback as h, useEffect as w, useState as M, useMemo as re, useLayoutEffect as oe, forwardRef as ie, Fragment as O, isValidElement as ae, cloneElement as ue, createElement as se } from "react";
2
2
  const R = typeof document < "u" ? U.useLayoutEffect : () => {
3
3
  };
4
- function se(e) {
4
+ function ce(e) {
5
5
  const n = m(null);
6
6
  return R(() => {
7
7
  n.current = e;
@@ -16,24 +16,27 @@ const F = (e) => {
16
16
  var n;
17
17
  return (n = e == null ? void 0 : e.ownerDocument) !== null && n !== void 0 ? n : document;
18
18
  }, $ = (e) => e && "window" in e && e.window === e ? e : F(e).defaultView || window;
19
- function ce(e) {
19
+ function le(e) {
20
20
  var n;
21
21
  return typeof window > "u" || window.navigator == null ? !1 : ((n = window.navigator.userAgentData) === null || n === void 0 ? void 0 : n.brands.some((t) => e.test(t.brand))) || e.test(window.navigator.userAgent);
22
22
  }
23
- function le(e) {
23
+ function de(e) {
24
24
  var n;
25
25
  return typeof window < "u" && window.navigator != null ? e.test(((n = window.navigator.userAgentData) === null || n === void 0 ? void 0 : n.platform) || window.navigator.platform) : !1;
26
26
  }
27
- function de() {
28
- return le(/^Mac/i);
29
- }
30
- function fe() {
31
- return ce(/Android/i);
32
- }
33
- function ve(e) {
34
- return e.mozInputSource === 0 && e.isTrusted ? !0 : fe() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
35
- }
36
- class pe {
27
+ function _(e) {
28
+ let n = null;
29
+ return () => (n == null && (n = e()), n);
30
+ }
31
+ const fe = _(function() {
32
+ return de(/^Mac/i);
33
+ }), ve = _(function() {
34
+ return le(/Android/i);
35
+ });
36
+ function pe(e) {
37
+ return e.mozInputSource === 0 && e.isTrusted ? !0 : ve() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
38
+ }
39
+ class be {
37
40
  isDefaultPrevented() {
38
41
  return this.nativeEvent.defaultPrevented;
39
42
  }
@@ -52,7 +55,7 @@ class pe {
52
55
  this.nativeEvent = t, this.target = t.target, this.currentTarget = t.currentTarget, this.relatedTarget = t.relatedTarget, this.bubbles = t.bubbles, this.cancelable = t.cancelable, this.defaultPrevented = t.defaultPrevented, this.eventPhase = t.eventPhase, this.isTrusted = t.isTrusted, this.timeStamp = t.timeStamp, this.type = n;
53
56
  }
54
57
  }
55
- function _(e) {
58
+ function q(e) {
56
59
  let n = m({
57
60
  isFocused: !1,
58
61
  observer: null
@@ -63,14 +66,14 @@ function _(e) {
63
66
  r.observer && (r.observer.disconnect(), r.observer = null);
64
67
  };
65
68
  }, []);
66
- let t = se((r) => {
69
+ let t = ce((r) => {
67
70
  e == null || e(r);
68
71
  });
69
72
  return h((r) => {
70
73
  if (r.target instanceof HTMLButtonElement || r.target instanceof HTMLInputElement || r.target instanceof HTMLTextAreaElement || r.target instanceof HTMLSelectElement) {
71
74
  n.current.isFocused = !0;
72
75
  let o = r.target, u = (c) => {
73
- n.current.isFocused = !1, o.disabled && t(new pe("blur", c)), n.current.observer && (n.current.observer.disconnect(), n.current.observer = null);
76
+ n.current.isFocused = !1, o.disabled && t(new be("blur", c)), n.current.observer && (n.current.observer.disconnect(), n.current.observer = null);
74
77
  };
75
78
  o.addEventListener("focusout", u, {
76
79
  once: !0
@@ -97,7 +100,7 @@ function _(e) {
97
100
  t
98
101
  ]);
99
102
  }
100
- function be(e) {
103
+ function ge(e) {
101
104
  let { isDisabled: n, onFocus: t, onBlur: r, onFocusChange: o } = e;
102
105
  const u = h((a) => {
103
106
  if (a.target === a.currentTarget)
@@ -105,7 +108,7 @@ function be(e) {
105
108
  }, [
106
109
  r,
107
110
  o
108
- ]), c = _(u), i = h((a) => {
111
+ ]), c = q(u), i = h((a) => {
109
112
  const l = F(a.target);
110
113
  a.target === a.currentTarget && l.activeElement === a.target && (t && t(a), o && o(!0), c(a));
111
114
  }, [
@@ -121,29 +124,29 @@ function be(e) {
121
124
  };
122
125
  }
123
126
  let L = null, C = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Map(), y = !1, I = !1;
124
- const ge = {
127
+ const he = {
125
128
  Tab: !0,
126
129
  Escape: !0
127
130
  };
128
131
  function B(e, n) {
129
132
  for (let t of C) t(e, n);
130
133
  }
131
- function he(e) {
132
- return !(e.metaKey || !de() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
134
+ function me(e) {
135
+ return !(e.metaKey || !fe() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
133
136
  }
134
137
  function k(e) {
135
- y = !0, he(e) && (L = "keyboard", B("keyboard", e));
138
+ y = !0, me(e) && (L = "keyboard", B("keyboard", e));
136
139
  }
137
140
  function b(e) {
138
141
  L = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (y = !0, B("pointer", e));
139
142
  }
140
- function q(e) {
141
- ve(e) && (y = !0, L = "virtual");
142
- }
143
143
  function G(e) {
144
+ pe(e) && (y = !0, L = "virtual");
145
+ }
146
+ function Y(e) {
144
147
  e.target === window || e.target === document || (!y && !I && (L = "virtual", B("virtual", e)), y = !1, I = !1);
145
148
  }
146
- function Y() {
149
+ function z() {
147
150
  y = !1, I = !0;
148
151
  }
149
152
  function W(e) {
@@ -152,30 +155,30 @@ function W(e) {
152
155
  let r = n.HTMLElement.prototype.focus;
153
156
  n.HTMLElement.prototype.focus = function() {
154
157
  y = !0, r.apply(this, arguments);
155
- }, t.addEventListener("keydown", k, !0), t.addEventListener("keyup", k, !0), t.addEventListener("click", q, !0), n.addEventListener("focus", G, !0), n.addEventListener("blur", Y, !1), typeof PointerEvent < "u" ? (t.addEventListener("pointerdown", b, !0), t.addEventListener("pointermove", b, !0), t.addEventListener("pointerup", b, !0)) : (t.addEventListener("mousedown", b, !0), t.addEventListener("mousemove", b, !0), t.addEventListener("mouseup", b, !0)), n.addEventListener("beforeunload", () => {
156
- z(e);
158
+ }, t.addEventListener("keydown", k, !0), t.addEventListener("keyup", k, !0), t.addEventListener("click", G, !0), n.addEventListener("focus", Y, !0), n.addEventListener("blur", z, !1), typeof PointerEvent < "u" ? (t.addEventListener("pointerdown", b, !0), t.addEventListener("pointermove", b, !0), t.addEventListener("pointerup", b, !0)) : (t.addEventListener("mousedown", b, !0), t.addEventListener("mousemove", b, !0), t.addEventListener("mouseup", b, !0)), n.addEventListener("beforeunload", () => {
159
+ Z(e);
157
160
  }, {
158
161
  once: !0
159
162
  }), T.set(n, {
160
163
  focus: r
161
164
  });
162
165
  }
163
- const z = (e, n) => {
166
+ const Z = (e, n) => {
164
167
  const t = $(e), r = F(e);
165
- n && r.removeEventListener("DOMContentLoaded", n), T.has(t) && (t.HTMLElement.prototype.focus = T.get(t).focus, r.removeEventListener("keydown", k, !0), r.removeEventListener("keyup", k, !0), r.removeEventListener("click", q, !0), t.removeEventListener("focus", G, !0), t.removeEventListener("blur", Y, !1), typeof PointerEvent < "u" ? (r.removeEventListener("pointerdown", b, !0), r.removeEventListener("pointermove", b, !0), r.removeEventListener("pointerup", b, !0)) : (r.removeEventListener("mousedown", b, !0), r.removeEventListener("mousemove", b, !0), r.removeEventListener("mouseup", b, !0)), T.delete(t));
168
+ n && r.removeEventListener("DOMContentLoaded", n), T.has(t) && (t.HTMLElement.prototype.focus = T.get(t).focus, r.removeEventListener("keydown", k, !0), r.removeEventListener("keyup", k, !0), r.removeEventListener("click", G, !0), t.removeEventListener("focus", Y, !0), t.removeEventListener("blur", z, !1), typeof PointerEvent < "u" ? (r.removeEventListener("pointerdown", b, !0), r.removeEventListener("pointermove", b, !0), r.removeEventListener("pointerup", b, !0)) : (r.removeEventListener("mousedown", b, !0), r.removeEventListener("mousemove", b, !0), r.removeEventListener("mouseup", b, !0)), T.delete(t));
166
169
  };
167
- function me(e) {
170
+ function $e(e) {
168
171
  const n = F(e);
169
172
  let t;
170
173
  return n.readyState !== "loading" ? W(e) : (t = () => {
171
174
  W(e);
172
- }, n.addEventListener("DOMContentLoaded", t)), () => z(e, t);
175
+ }, n.addEventListener("DOMContentLoaded", t)), () => Z(e, t);
173
176
  }
174
- typeof document < "u" && me();
175
- function Z() {
177
+ typeof document < "u" && $e();
178
+ function J() {
176
179
  return L !== "pointer";
177
180
  }
178
- const $e = /* @__PURE__ */ new Set([
181
+ const ye = /* @__PURE__ */ new Set([
179
182
  "checkbox",
180
183
  "radio",
181
184
  "range",
@@ -186,22 +189,22 @@ const $e = /* @__PURE__ */ new Set([
186
189
  "submit",
187
190
  "reset"
188
191
  ]);
189
- function ye(e, n, t) {
192
+ function Ee(e, n, t) {
190
193
  var r;
191
194
  const o = typeof window < "u" ? $(t == null ? void 0 : t.target).HTMLInputElement : HTMLInputElement, u = typeof window < "u" ? $(t == null ? void 0 : t.target).HTMLTextAreaElement : HTMLTextAreaElement, c = typeof window < "u" ? $(t == null ? void 0 : t.target).HTMLElement : HTMLElement, i = typeof window < "u" ? $(t == null ? void 0 : t.target).KeyboardEvent : KeyboardEvent;
192
- return e = e || (t == null ? void 0 : t.target) instanceof o && !$e.has(t == null || (r = t.target) === null || r === void 0 ? void 0 : r.type) || (t == null ? void 0 : t.target) instanceof u || (t == null ? void 0 : t.target) instanceof c && (t == null ? void 0 : t.target.isContentEditable), !(e && n === "keyboard" && t instanceof i && !ge[t.key]);
195
+ return e = e || (t == null ? void 0 : t.target) instanceof o && !ye.has(t == null || (r = t.target) === null || r === void 0 ? void 0 : r.type) || (t == null ? void 0 : t.target) instanceof u || (t == null ? void 0 : t.target) instanceof c && (t == null ? void 0 : t.target.isContentEditable), !(e && n === "keyboard" && t instanceof i && !he[t.key]);
193
196
  }
194
- function Ee(e, n, t) {
197
+ function we(e, n, t) {
195
198
  W(), w(() => {
196
199
  let r = (o, u) => {
197
- ye(!!(t != null && t.isTextInput), o, u) && e(Z());
200
+ Ee(!!(t != null && t.isTextInput), o, u) && e(J());
198
201
  };
199
202
  return C.add(r), () => {
200
203
  C.delete(r);
201
204
  };
202
205
  }, n);
203
206
  }
204
- function we(e) {
207
+ function Te(e) {
205
208
  let { isDisabled: n, onBlurWithin: t, onFocusWithin: r, onFocusWithinChange: o } = e, u = m({
206
209
  isFocusWithin: !1
207
210
  }), c = h((l) => {
@@ -210,7 +213,7 @@ function we(e) {
210
213
  t,
211
214
  o,
212
215
  u
213
- ]), i = _(c), a = h((l) => {
216
+ ]), i = q(c), a = h((l) => {
214
217
  !u.current.isFocusWithin && document.activeElement === l.target && (r && r(l), o && o(!0), u.current.isFocusWithin = !0, i(l));
215
218
  }, [
216
219
  r,
@@ -239,21 +242,21 @@ function N() {
239
242
  function V(e) {
240
243
  e.pointerType === "touch" && N();
241
244
  }
242
- function Te() {
245
+ function Fe() {
243
246
  if (!(typeof document > "u"))
244
247
  return typeof PointerEvent < "u" ? document.addEventListener("pointerup", V) : document.addEventListener("touchend", N), A++, () => {
245
248
  A--, !(A > 0) && (typeof PointerEvent < "u" ? document.removeEventListener("pointerup", V) : document.removeEventListener("touchend", N));
246
249
  };
247
250
  }
248
- function Ce(e) {
251
+ function Ie(e) {
249
252
  let { onHoverStart: n, onHoverChange: t, onHoverEnd: r, isDisabled: o } = e, [u, c] = M(!1), i = m({
250
253
  isHovered: !1,
251
254
  ignoreEmulatedMouseEvents: !1,
252
255
  pointerType: "",
253
256
  target: null
254
257
  }).current;
255
- w(Te, []);
256
- let { hoverProps: a, triggerHoverEnd: l } = ne(() => {
258
+ w(Fe, []);
259
+ let { hoverProps: a, triggerHoverEnd: l } = re(() => {
257
260
  let d = (s, p) => {
258
261
  if (i.pointerType = p, o || p === "touch" || i.isHovered || !s.currentTarget.contains(s.target)) return;
259
262
  i.isHovered = !0;
@@ -305,24 +308,24 @@ function Ce(e) {
305
308
  isHovered: u
306
309
  };
307
310
  }
308
- function Ie(e = {}) {
311
+ function We(e = {}) {
309
312
  let { autoFocus: n = !1, isTextInput: t, within: r } = e, o = m({
310
313
  isFocused: !1,
311
- isFocusVisible: n || Z()
314
+ isFocusVisible: n || J()
312
315
  }), [u, c] = M(!1), [i, a] = M(() => o.current.isFocused && o.current.isFocusVisible), l = h(() => a(o.current.isFocused && o.current.isFocusVisible), []), d = h((s) => {
313
316
  o.current.isFocused = s, c(s), l();
314
317
  }, [
315
318
  l
316
319
  ]);
317
- Ee((s) => {
320
+ we((s) => {
318
321
  o.current.isFocusVisible = s, l();
319
322
  }, [], {
320
323
  isTextInput: t
321
324
  });
322
- let { focusProps: f } = be({
325
+ let { focusProps: f } = ge({
323
326
  isDisabled: r,
324
327
  onFocusChange: d
325
- }), { focusWithinProps: v } = we({
328
+ }), { focusWithinProps: v } = Te({
326
329
  isDisabled: !r,
327
330
  onFocusWithinChange: d
328
331
  });
@@ -332,8 +335,8 @@ function Ie(e = {}) {
332
335
  focusProps: r ? v : f
333
336
  };
334
337
  }
335
- var Fe = Object.defineProperty, Le = (e, n, t) => n in e ? Fe(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, j = (e, n, t) => (Le(e, typeof n != "symbol" ? n + "" : n, t), t);
336
- let Pe = class {
338
+ var Le = Object.defineProperty, Pe = (e, n, t) => n in e ? Le(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, j = (e, n, t) => (Pe(e, typeof n != "symbol" ? n + "" : n, t), t);
339
+ let He = class {
337
340
  constructor() {
338
341
  j(this, "current", this.detect()), j(this, "handoffState", "pending"), j(this, "currentId", 0);
339
342
  }
@@ -361,16 +364,16 @@ let Pe = class {
361
364
  get isHandoffComplete() {
362
365
  return this.handoffState === "complete";
363
366
  }
364
- }, J = new Pe();
365
- function Ne(e) {
366
- return J.isServer ? null : e instanceof Node ? e.ownerDocument : e != null && e.hasOwnProperty("current") && e.current instanceof Node ? e.current.ownerDocument : document;
367
+ }, Q = new He();
368
+ function Be(e) {
369
+ return Q.isServer ? null : e instanceof Node ? e.ownerDocument : e != null && e.hasOwnProperty("current") && e.current instanceof Node ? e.current.ownerDocument : document;
367
370
  }
368
- function He(e) {
371
+ function Se(e) {
369
372
  typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e).catch((n) => setTimeout(() => {
370
373
  throw n;
371
374
  }));
372
375
  }
373
- function Q() {
376
+ function X() {
374
377
  let e = [], n = { addEventListener(t, r, o, u) {
375
378
  return t.addEventListener(r, o, u), n.add(() => t.removeEventListener(r, o, u));
376
379
  }, requestAnimationFrame(...t) {
@@ -383,7 +386,7 @@ function Q() {
383
386
  return n.add(() => clearTimeout(r));
384
387
  }, microTask(...t) {
385
388
  let r = { current: !0 };
386
- return He(() => {
389
+ return Se(() => {
387
390
  r.current && t[0]();
388
391
  }), n.add(() => {
389
392
  r.current = !1;
@@ -394,7 +397,7 @@ function Q() {
394
397
  Object.assign(t.style, { [r]: u });
395
398
  });
396
399
  }, group(t) {
397
- let r = Q();
400
+ let r = X();
398
401
  return t(r), this.add(() => r.dispose());
399
402
  }, add(t) {
400
403
  return e.includes(t) || e.push(t), () => {
@@ -406,38 +409,38 @@ function Q() {
406
409
  } };
407
410
  return n;
408
411
  }
409
- function Be() {
410
- let [e] = M(Q);
412
+ function Ve() {
413
+ let [e] = M(X);
411
414
  return w(() => () => e.dispose(), [e]), e;
412
415
  }
413
- let Se = (e, n) => {
414
- J.isServer ? w(e, n) : re(e, n);
416
+ let Me = (e, n) => {
417
+ Q.isServer ? w(e, n) : oe(e, n);
415
418
  };
416
- function Me(e) {
419
+ function ke(e) {
417
420
  let n = m(e);
418
- return Se(() => {
421
+ return Me(() => {
419
422
  n.current = e;
420
423
  }, [e]), n;
421
424
  }
422
- let ke = function(e) {
423
- let n = Me(e);
425
+ let De = function(e) {
426
+ let n = ke(e);
424
427
  return U.useCallback((...t) => n.current(...t), [n]);
425
428
  };
426
429
  function K(...e) {
427
430
  return Array.from(new Set(e.flatMap((n) => typeof n == "string" ? n.split(" ") : []))).filter(Boolean).join(" ");
428
431
  }
429
- function X(e, n, ...t) {
432
+ function ee(e, n, ...t) {
430
433
  if (e in n) {
431
434
  let o = n[e];
432
435
  return typeof o == "function" ? o(...t) : o;
433
436
  }
434
437
  let r = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(n).map((o) => `"${o}"`).join(", ")}.`);
435
- throw Error.captureStackTrace && Error.captureStackTrace(r, X), r;
438
+ throw Error.captureStackTrace && Error.captureStackTrace(r, ee), r;
436
439
  }
437
- var De = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(De || {}), Oe = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(Oe || {});
438
- function Ve({ ourProps: e, theirProps: n, slot: t, defaultTag: r, features: o, visible: u = !0, name: c, mergeRefs: i }) {
439
- i = i ?? Ae;
440
- let a = ee(n, e);
440
+ var Oe = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(Oe || {}), Ae = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(Ae || {});
441
+ function Ke({ ourProps: e, theirProps: n, slot: t, defaultTag: r, features: o, visible: u = !0, name: c, mergeRefs: i }) {
442
+ i = i ?? je;
443
+ let a = te(n, e);
441
444
  if (u) return S(a, t, r, c, i);
442
445
  let l = o ?? 0;
443
446
  if (l & 2) {
@@ -446,7 +449,7 @@ function Ve({ ourProps: e, theirProps: n, slot: t, defaultTag: r, features: o, v
446
449
  }
447
450
  if (l & 1) {
448
451
  let { unmount: d = !0, ...f } = a;
449
- return X(d ? 0 : 1, { 0() {
452
+ return ee(d ? 0 : 1, { 0() {
450
453
  return null;
451
454
  }, 1() {
452
455
  return S({ ...f, hidden: !0, style: { display: "none" } }, t, r, c, i);
@@ -466,19 +469,19 @@ function S(e, n = {}, t, r, o) {
466
469
  for (let p of s) f[`data-${p}`] = "";
467
470
  }
468
471
  }
469
- if (u === O && (Object.keys(E(a)).length > 0 || Object.keys(E(f)).length > 0)) if (!ie(d) || Array.isArray(d) && d.length > 1) {
472
+ if (u === O && (Object.keys(E(a)).length > 0 || Object.keys(E(f)).length > 0)) if (!ae(d) || Array.isArray(d) && d.length > 1) {
470
473
  if (Object.keys(E(a)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${r} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(E(a)).concat(Object.keys(E(f))).map((v) => ` - ${v}`).join(`
471
474
  `), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', "Render a single element as the child so that we can forward the props onto that element."].map((v) => ` - ${v}`).join(`
472
475
  `)].join(`
473
476
  `));
474
477
  } else {
475
- let v = d.props, s = v == null ? void 0 : v.className, p = typeof s == "function" ? (...H) => K(s(...H), a.className) : K(s, a.className), g = p ? { className: p } : {}, P = ee(d.props, E(x(a, ["ref"])));
478
+ let v = d.props, s = v == null ? void 0 : v.className, p = typeof s == "function" ? (...H) => K(s(...H), a.className) : K(s, a.className), g = p ? { className: p } : {}, P = te(d.props, E(x(a, ["ref"])));
476
479
  for (let H in f) H in P && delete f[H];
477
- return ae(d, Object.assign({}, P, f, l, { ref: o(d.ref, l.ref) }, g));
480
+ return ue(d, Object.assign({}, P, f, l, { ref: o(d.ref, l.ref) }, g));
478
481
  }
479
- return ue(u, Object.assign({}, x(a, ["ref"]), u !== O && l, u !== O && f), d);
482
+ return se(u, Object.assign({}, x(a, ["ref"]), u !== O && l, u !== O && f), d);
480
483
  }
481
- function Ke() {
484
+ function Ue() {
482
485
  let e = m([]), n = h((t) => {
483
486
  for (let r of e.current) r != null && (typeof r == "function" ? r(t) : r.current = t);
484
487
  }, []);
@@ -486,12 +489,12 @@ function Ke() {
486
489
  if (!t.every((r) => r == null)) return e.current = t, n;
487
490
  };
488
491
  }
489
- function Ae(...e) {
492
+ function je(...e) {
490
493
  return e.every((n) => n == null) ? void 0 : (n) => {
491
494
  for (let t of e) t != null && (typeof t == "function" ? t(n) : t.current = n);
492
495
  };
493
496
  }
494
- function ee(...e) {
497
+ function te(...e) {
495
498
  if (e.length === 0) return {};
496
499
  if (e.length === 1) return e[0];
497
500
  let n = {}, t = {};
@@ -509,7 +512,7 @@ function ee(...e) {
509
512
  } });
510
513
  return n;
511
514
  }
512
- function Ue(...e) {
515
+ function Re(...e) {
513
516
  if (e.length === 0) return {};
514
517
  if (e.length === 1) return e[0];
515
518
  let n = {}, t = {};
@@ -520,9 +523,9 @@ function Ue(...e) {
520
523
  } });
521
524
  return n;
522
525
  }
523
- function Re(e) {
526
+ function _e(e) {
524
527
  var n;
525
- return Object.assign(oe(e), { displayName: (n = e.displayName) != null ? n : e.name });
528
+ return Object.assign(ie(e), { displayName: (n = e.displayName) != null ? n : e.name });
526
529
  }
527
530
  function E(e) {
528
531
  let n = Object.assign({}, e);
@@ -534,40 +537,40 @@ function x(e, n = []) {
534
537
  for (let r of n) r in t && delete t[r];
535
538
  return t;
536
539
  }
537
- let te = Symbol();
538
- function _e(e, n = !0) {
539
- return Object.assign(e, { [te]: n });
540
+ let ne = Symbol();
541
+ function qe(e, n = !0) {
542
+ return Object.assign(e, { [ne]: n });
540
543
  }
541
- function qe(...e) {
544
+ function Ge(...e) {
542
545
  let n = m(e);
543
546
  w(() => {
544
547
  n.current = e;
545
548
  }, [e]);
546
- let t = ke((r) => {
549
+ let t = De((r) => {
547
550
  for (let o of n.current) o != null && (typeof o == "function" ? o(r) : o.current = r);
548
551
  });
549
- return e.every((r) => r == null || (r == null ? void 0 : r[te])) ? void 0 : t;
552
+ return e.every((r) => r == null || (r == null ? void 0 : r[ne])) ? void 0 : t;
550
553
  }
551
- var je = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backspace = "Backspace", e.Delete = "Delete", e.ArrowLeft = "ArrowLeft", e.ArrowUp = "ArrowUp", e.ArrowRight = "ArrowRight", e.ArrowDown = "ArrowDown", e.Home = "Home", e.End = "End", e.PageUp = "PageUp", e.PageDown = "PageDown", e.Tab = "Tab", e))(je || {});
554
+ var xe = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backspace = "Backspace", e.Delete = "Delete", e.ArrowLeft = "ArrowLeft", e.ArrowUp = "ArrowUp", e.ArrowRight = "ArrowRight", e.ArrowDown = "ArrowDown", e.Home = "Home", e.End = "End", e.PageUp = "PageUp", e.PageDown = "PageDown", e.Tab = "Tab", e))(xe || {});
552
555
  export {
553
- Ie as $,
554
- Ue as D,
555
- Ve as H,
556
- Ke as I,
557
- De as M,
558
- _e as T,
559
- Re as W,
560
- X as a,
561
- Ce as b,
562
- je as c,
563
- Q as d,
564
- J as e,
556
+ We as $,
557
+ Re as D,
558
+ Ke as H,
559
+ Ue as I,
560
+ Oe as M,
561
+ qe as T,
562
+ _e as W,
563
+ ee as a,
564
+ Ie as b,
565
+ xe as c,
566
+ X as d,
567
+ Q as e,
565
568
  E as m,
566
- Se as n,
567
- ke as o,
568
- Be as p,
569
- Me as s,
570
- He as t,
571
- Ne as u,
572
- qe as y
569
+ Me as n,
570
+ De as o,
571
+ Ve as p,
572
+ ke as s,
573
+ Se as t,
574
+ Be as u,
575
+ Ge as y
573
576
  };
@@ -1,7 +1,7 @@
1
1
  import c, { createContext as v, useContext as p, useState as h, useRef as C, useEffect as N, useMemo as m, useId as O } from "react";
2
- import { o as y, p as z, m as K, W as w, y as j, n as H, H as L } from "./keyboard-B0lm_zyn.js";
2
+ import { o as y, p as z, m as K, W as w, y as j, n as H, H as L } from "./keyboard-mgWkd2Vh.js";
3
3
  import { createPortal as J } from "react-dom";
4
- import { T as P, s as S } from "./hidden-DbgtYPOH.js";
4
+ import { T as P, s as S } from "./hidden-PvGXrYUY.js";
5
5
  let A = v(void 0);
6
6
  function D() {
7
7
  return p(A);
@@ -0,0 +1,86 @@
1
+ import y, { useState as F, useCallback as p, useRef as g, createContext as A, useContext as x } from "react";
2
+ import { p as O, n as j, d as C } from "./keyboard-mgWkd2Vh.js";
3
+ function k(e = 0) {
4
+ let [t, n] = F(e), r = p((o) => n(o), [t]), s = p((o) => n((u) => u | o), [t]), l = p((o) => (t & o) === o, [t]), a = p((o) => n((u) => u & ~o), [n]), i = p((o) => n((u) => u ^ o), [n]);
5
+ return { flags: t, setFlag: r, addFlag: s, hasFlag: l, removeFlag: a, toggleFlag: i };
6
+ }
7
+ var v, h;
8
+ typeof process < "u" && typeof globalThis < "u" && typeof Element < "u" && ((v = process == null ? void 0 : process.env) == null ? void 0 : v.NODE_ENV) === "test" && typeof ((h = Element == null ? void 0 : Element.prototype) == null ? void 0 : h.getAnimations) > "u" && (Element.prototype.getAnimations = function() {
9
+ return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.", "Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.", "", "Example usage:", "```js", "import { mockAnimationsApi } from 'jsdom-testing-mocks'", "mockAnimationsApi()", "```"].join(`
10
+ `)), [];
11
+ });
12
+ var N = ((e) => (e[e.None = 0] = "None", e[e.Closed = 1] = "Closed", e[e.Enter = 2] = "Enter", e[e.Leave = 4] = "Leave", e))(N || {});
13
+ function T(e) {
14
+ let t = {};
15
+ for (let n in e) e[n] === !0 && (t[`data-${n}`] = "");
16
+ return t;
17
+ }
18
+ function _(e, t, n, r) {
19
+ let [s, l] = F(n), { hasFlag: a, addFlag: i, removeFlag: o } = k(e && s ? 3 : 0), u = g(!1), d = g(!1), E = O();
20
+ return j(() => {
21
+ var f;
22
+ if (e) {
23
+ if (n && l(!0), !t) {
24
+ n && i(3);
25
+ return;
26
+ }
27
+ return (f = void 0) == null || f.call(r, n), $(t, { inFlight: u, prepare() {
28
+ d.current ? d.current = !1 : d.current = u.current, u.current = !0, !d.current && (n ? (i(3), o(4)) : (i(4), o(2)));
29
+ }, run() {
30
+ d.current ? n ? (o(3), i(4)) : (o(4), i(3)) : n ? o(1) : i(1);
31
+ }, done() {
32
+ var m;
33
+ d.current && typeof t.getAnimations == "function" && t.getAnimations().length > 0 || (u.current = !1, o(7), n || l(!1), (m = void 0) == null || m.call(r, n));
34
+ } });
35
+ }
36
+ }, [e, n, t, E]), e ? [s, { closed: a(1), enter: a(2), leave: a(4), transition: a(2) || a(4) }] : [n, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }];
37
+ }
38
+ function $(e, { prepare: t, run: n, done: r, inFlight: s }) {
39
+ let l = C();
40
+ return S(e, { prepare: t, inFlight: s }), l.nextFrame(() => {
41
+ n(), l.requestAnimationFrame(() => {
42
+ l.add(P(e, r));
43
+ });
44
+ }), l.dispose;
45
+ }
46
+ function P(e, t) {
47
+ var n, r;
48
+ let s = C();
49
+ if (!e) return s.dispose;
50
+ let l = !1;
51
+ s.add(() => {
52
+ l = !0;
53
+ });
54
+ let a = (r = (n = e.getAnimations) == null ? void 0 : n.call(e).filter((i) => i instanceof CSSTransition)) != null ? r : [];
55
+ return a.length === 0 ? (t(), s.dispose) : (Promise.allSettled(a.map((i) => i.finished)).then(() => {
56
+ l || t();
57
+ }), s.dispose);
58
+ }
59
+ function S(e, { inFlight: t, prepare: n }) {
60
+ if (t != null && t.current) {
61
+ n();
62
+ return;
63
+ }
64
+ let r = e.style.transition;
65
+ e.style.transition = "none", n(), e.offsetHeight, e.style.transition = r;
66
+ }
67
+ let c = A(null);
68
+ c.displayName = "OpenClosedContext";
69
+ var b = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(b || {});
70
+ function w() {
71
+ return x(c);
72
+ }
73
+ function H({ value: e, children: t }) {
74
+ return y.createElement(c.Provider, { value: e }, t);
75
+ }
76
+ function q({ children: e }) {
77
+ return y.createElement(c.Provider, { value: null }, e);
78
+ }
79
+ export {
80
+ T as R,
81
+ H as c,
82
+ b as i,
83
+ q as s,
84
+ w as u,
85
+ _ as x
86
+ };
@@ -1,5 +1,5 @@
1
1
  import { useRef as f, useState as a } from "react";
2
- import { p as g, o as c, u as m } from "./keyboard-B0lm_zyn.js";
2
+ import { p as g, o as c, u as m } from "./keyboard-mgWkd2Vh.js";
3
3
  function h(t) {
4
4
  let e = t.width / 2, r = t.height / 2;
5
5
  return { top: t.clientY - r, right: t.clientX + e, bottom: t.clientY + r, left: t.clientX - e };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.37.5",
4
+ "version": "1.37.7",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {