mimir-ui-kit 1.37.12 → 1.37.14

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 re, useLayoutEffect as oe, forwardRef as ie, Fragment as O, isValidElement as ae, cloneElement as ue, createElement as se } from "react";
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";
2
2
  const R = typeof document < "u" ? U.useLayoutEffect : () => {
3
3
  };
4
- function ce(e) {
4
+ function se(e) {
5
5
  const n = m(null);
6
6
  return R(() => {
7
7
  n.current = e;
@@ -16,27 +16,24 @@ 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 le(e) {
19
+ function ce(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 de(e) {
23
+ function le(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 _(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 {
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 {
40
37
  isDefaultPrevented() {
41
38
  return this.nativeEvent.defaultPrevented;
42
39
  }
@@ -55,7 +52,7 @@ class be {
55
52
  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;
56
53
  }
57
54
  }
58
- function q(e) {
55
+ function _(e) {
59
56
  let n = m({
60
57
  isFocused: !1,
61
58
  observer: null
@@ -66,14 +63,14 @@ function q(e) {
66
63
  r.observer && (r.observer.disconnect(), r.observer = null);
67
64
  };
68
65
  }, []);
69
- let t = ce((r) => {
66
+ let t = se((r) => {
70
67
  e == null || e(r);
71
68
  });
72
69
  return h((r) => {
73
70
  if (r.target instanceof HTMLButtonElement || r.target instanceof HTMLInputElement || r.target instanceof HTMLTextAreaElement || r.target instanceof HTMLSelectElement) {
74
71
  n.current.isFocused = !0;
75
72
  let o = r.target, u = (c) => {
76
- n.current.isFocused = !1, o.disabled && t(new be("blur", c)), n.current.observer && (n.current.observer.disconnect(), n.current.observer = null);
73
+ n.current.isFocused = !1, o.disabled && t(new pe("blur", c)), n.current.observer && (n.current.observer.disconnect(), n.current.observer = null);
77
74
  };
78
75
  o.addEventListener("focusout", u, {
79
76
  once: !0
@@ -100,7 +97,7 @@ function q(e) {
100
97
  t
101
98
  ]);
102
99
  }
103
- function ge(e) {
100
+ function be(e) {
104
101
  let { isDisabled: n, onFocus: t, onBlur: r, onFocusChange: o } = e;
105
102
  const u = h((a) => {
106
103
  if (a.target === a.currentTarget)
@@ -108,7 +105,7 @@ function ge(e) {
108
105
  }, [
109
106
  r,
110
107
  o
111
- ]), c = q(u), i = h((a) => {
108
+ ]), c = _(u), i = h((a) => {
112
109
  const l = F(a.target);
113
110
  a.target === a.currentTarget && l.activeElement === a.target && (t && t(a), o && o(!0), c(a));
114
111
  }, [
@@ -124,29 +121,29 @@ function ge(e) {
124
121
  };
125
122
  }
126
123
  let L = null, C = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Map(), y = !1, I = !1;
127
- const he = {
124
+ const ge = {
128
125
  Tab: !0,
129
126
  Escape: !0
130
127
  };
131
128
  function B(e, n) {
132
129
  for (let t of C) t(e, n);
133
130
  }
134
- function me(e) {
135
- return !(e.metaKey || !fe() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
131
+ function he(e) {
132
+ return !(e.metaKey || !de() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
136
133
  }
137
134
  function k(e) {
138
- y = !0, me(e) && (L = "keyboard", B("keyboard", e));
135
+ y = !0, he(e) && (L = "keyboard", B("keyboard", e));
139
136
  }
140
137
  function b(e) {
141
138
  L = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (y = !0, B("pointer", e));
142
139
  }
143
- function G(e) {
144
- pe(e) && (y = !0, L = "virtual");
140
+ function q(e) {
141
+ ve(e) && (y = !0, L = "virtual");
145
142
  }
146
- function Y(e) {
143
+ function G(e) {
147
144
  e.target === window || e.target === document || (!y && !I && (L = "virtual", B("virtual", e)), y = !1, I = !1);
148
145
  }
149
- function z() {
146
+ function Y() {
150
147
  y = !1, I = !0;
151
148
  }
152
149
  function W(e) {
@@ -155,30 +152,30 @@ function W(e) {
155
152
  let r = n.HTMLElement.prototype.focus;
156
153
  n.HTMLElement.prototype.focus = function() {
157
154
  y = !0, r.apply(this, arguments);
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);
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);
160
157
  }, {
161
158
  once: !0
162
159
  }), T.set(n, {
163
160
  focus: r
164
161
  });
165
162
  }
166
- const Z = (e, n) => {
163
+ const z = (e, n) => {
167
164
  const t = $(e), r = F(e);
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));
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));
169
166
  };
170
- function $e(e) {
167
+ function me(e) {
171
168
  const n = F(e);
172
169
  let t;
173
170
  return n.readyState !== "loading" ? W(e) : (t = () => {
174
171
  W(e);
175
- }, n.addEventListener("DOMContentLoaded", t)), () => Z(e, t);
172
+ }, n.addEventListener("DOMContentLoaded", t)), () => z(e, t);
176
173
  }
177
- typeof document < "u" && $e();
178
- function J() {
174
+ typeof document < "u" && me();
175
+ function Z() {
179
176
  return L !== "pointer";
180
177
  }
181
- const ye = /* @__PURE__ */ new Set([
178
+ const $e = /* @__PURE__ */ new Set([
182
179
  "checkbox",
183
180
  "radio",
184
181
  "range",
@@ -189,22 +186,22 @@ const ye = /* @__PURE__ */ new Set([
189
186
  "submit",
190
187
  "reset"
191
188
  ]);
192
- function Ee(e, n, t) {
189
+ function ye(e, n, t) {
193
190
  var r;
194
191
  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;
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]);
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]);
196
193
  }
197
- function we(e, n, t) {
194
+ function Ee(e, n, t) {
198
195
  W(), w(() => {
199
196
  let r = (o, u) => {
200
- Ee(!!(t != null && t.isTextInput), o, u) && e(J());
197
+ ye(!!(t != null && t.isTextInput), o, u) && e(Z());
201
198
  };
202
199
  return C.add(r), () => {
203
200
  C.delete(r);
204
201
  };
205
202
  }, n);
206
203
  }
207
- function Te(e) {
204
+ function we(e) {
208
205
  let { isDisabled: n, onBlurWithin: t, onFocusWithin: r, onFocusWithinChange: o } = e, u = m({
209
206
  isFocusWithin: !1
210
207
  }), c = h((l) => {
@@ -213,7 +210,7 @@ function Te(e) {
213
210
  t,
214
211
  o,
215
212
  u
216
- ]), i = q(c), a = h((l) => {
213
+ ]), i = _(c), a = h((l) => {
217
214
  !u.current.isFocusWithin && document.activeElement === l.target && (r && r(l), o && o(!0), u.current.isFocusWithin = !0, i(l));
218
215
  }, [
219
216
  r,
@@ -242,21 +239,21 @@ function N() {
242
239
  function V(e) {
243
240
  e.pointerType === "touch" && N();
244
241
  }
245
- function Fe() {
242
+ function Te() {
246
243
  if (!(typeof document > "u"))
247
244
  return typeof PointerEvent < "u" ? document.addEventListener("pointerup", V) : document.addEventListener("touchend", N), A++, () => {
248
245
  A--, !(A > 0) && (typeof PointerEvent < "u" ? document.removeEventListener("pointerup", V) : document.removeEventListener("touchend", N));
249
246
  };
250
247
  }
251
- function Ie(e) {
248
+ function Ce(e) {
252
249
  let { onHoverStart: n, onHoverChange: t, onHoverEnd: r, isDisabled: o } = e, [u, c] = M(!1), i = m({
253
250
  isHovered: !1,
254
251
  ignoreEmulatedMouseEvents: !1,
255
252
  pointerType: "",
256
253
  target: null
257
254
  }).current;
258
- w(Fe, []);
259
- let { hoverProps: a, triggerHoverEnd: l } = re(() => {
255
+ w(Te, []);
256
+ let { hoverProps: a, triggerHoverEnd: l } = ne(() => {
260
257
  let d = (s, p) => {
261
258
  if (i.pointerType = p, o || p === "touch" || i.isHovered || !s.currentTarget.contains(s.target)) return;
262
259
  i.isHovered = !0;
@@ -308,24 +305,24 @@ function Ie(e) {
308
305
  isHovered: u
309
306
  };
310
307
  }
311
- function We(e = {}) {
308
+ function Ie(e = {}) {
312
309
  let { autoFocus: n = !1, isTextInput: t, within: r } = e, o = m({
313
310
  isFocused: !1,
314
- isFocusVisible: n || J()
311
+ isFocusVisible: n || Z()
315
312
  }), [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) => {
316
313
  o.current.isFocused = s, c(s), l();
317
314
  }, [
318
315
  l
319
316
  ]);
320
- we((s) => {
317
+ Ee((s) => {
321
318
  o.current.isFocusVisible = s, l();
322
319
  }, [], {
323
320
  isTextInput: t
324
321
  });
325
- let { focusProps: f } = ge({
322
+ let { focusProps: f } = be({
326
323
  isDisabled: r,
327
324
  onFocusChange: d
328
- }), { focusWithinProps: v } = Te({
325
+ }), { focusWithinProps: v } = we({
329
326
  isDisabled: !r,
330
327
  onFocusWithinChange: d
331
328
  });
@@ -335,8 +332,8 @@ function We(e = {}) {
335
332
  focusProps: r ? v : f
336
333
  };
337
334
  }
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 {
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 {
340
337
  constructor() {
341
338
  j(this, "current", this.detect()), j(this, "handoffState", "pending"), j(this, "currentId", 0);
342
339
  }
@@ -364,16 +361,16 @@ let He = class {
364
361
  get isHandoffComplete() {
365
362
  return this.handoffState === "complete";
366
363
  }
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;
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;
370
367
  }
371
- function Se(e) {
368
+ function He(e) {
372
369
  typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e).catch((n) => setTimeout(() => {
373
370
  throw n;
374
371
  }));
375
372
  }
376
- function X() {
373
+ function Q() {
377
374
  let e = [], n = { addEventListener(t, r, o, u) {
378
375
  return t.addEventListener(r, o, u), n.add(() => t.removeEventListener(r, o, u));
379
376
  }, requestAnimationFrame(...t) {
@@ -386,7 +383,7 @@ function X() {
386
383
  return n.add(() => clearTimeout(r));
387
384
  }, microTask(...t) {
388
385
  let r = { current: !0 };
389
- return Se(() => {
386
+ return He(() => {
390
387
  r.current && t[0]();
391
388
  }), n.add(() => {
392
389
  r.current = !1;
@@ -397,7 +394,7 @@ function X() {
397
394
  Object.assign(t.style, { [r]: u });
398
395
  });
399
396
  }, group(t) {
400
- let r = X();
397
+ let r = Q();
401
398
  return t(r), this.add(() => r.dispose());
402
399
  }, add(t) {
403
400
  return e.includes(t) || e.push(t), () => {
@@ -409,38 +406,38 @@ function X() {
409
406
  } };
410
407
  return n;
411
408
  }
412
- function Ve() {
413
- let [e] = M(X);
409
+ function Be() {
410
+ let [e] = M(Q);
414
411
  return w(() => () => e.dispose(), [e]), e;
415
412
  }
416
- let Me = (e, n) => {
417
- Q.isServer ? w(e, n) : oe(e, n);
413
+ let Se = (e, n) => {
414
+ J.isServer ? w(e, n) : re(e, n);
418
415
  };
419
- function ke(e) {
416
+ function Me(e) {
420
417
  let n = m(e);
421
- return Me(() => {
418
+ return Se(() => {
422
419
  n.current = e;
423
420
  }, [e]), n;
424
421
  }
425
- let De = function(e) {
426
- let n = ke(e);
422
+ let ke = function(e) {
423
+ let n = Me(e);
427
424
  return U.useCallback((...t) => n.current(...t), [n]);
428
425
  };
429
426
  function K(...e) {
430
427
  return Array.from(new Set(e.flatMap((n) => typeof n == "string" ? n.split(" ") : []))).filter(Boolean).join(" ");
431
428
  }
432
- function ee(e, n, ...t) {
429
+ function X(e, n, ...t) {
433
430
  if (e in n) {
434
431
  let o = n[e];
435
432
  return typeof o == "function" ? o(...t) : o;
436
433
  }
437
434
  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(", ")}.`);
438
- throw Error.captureStackTrace && Error.captureStackTrace(r, ee), r;
435
+ throw Error.captureStackTrace && Error.captureStackTrace(r, X), r;
439
436
  }
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);
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);
444
441
  if (u) return S(a, t, r, c, i);
445
442
  let l = o ?? 0;
446
443
  if (l & 2) {
@@ -449,7 +446,7 @@ function Ke({ ourProps: e, theirProps: n, slot: t, defaultTag: r, features: o, v
449
446
  }
450
447
  if (l & 1) {
451
448
  let { unmount: d = !0, ...f } = a;
452
- return ee(d ? 0 : 1, { 0() {
449
+ return X(d ? 0 : 1, { 0() {
453
450
  return null;
454
451
  }, 1() {
455
452
  return S({ ...f, hidden: !0, style: { display: "none" } }, t, r, c, i);
@@ -469,19 +466,19 @@ function S(e, n = {}, t, r, o) {
469
466
  for (let p of s) f[`data-${p}`] = "";
470
467
  }
471
468
  }
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) {
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) {
473
470
  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(`
474
471
  `), "", "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(`
475
472
  `)].join(`
476
473
  `));
477
474
  } else {
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"])));
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"])));
479
476
  for (let H in f) H in P && delete f[H];
480
- return ue(d, Object.assign({}, P, f, l, { ref: o(d.ref, l.ref) }, g));
477
+ return ae(d, Object.assign({}, P, f, l, { ref: o(d.ref, l.ref) }, g));
481
478
  }
482
- return se(u, Object.assign({}, x(a, ["ref"]), u !== O && l, u !== O && f), d);
479
+ return ue(u, Object.assign({}, x(a, ["ref"]), u !== O && l, u !== O && f), d);
483
480
  }
484
- function Ue() {
481
+ function Ke() {
485
482
  let e = m([]), n = h((t) => {
486
483
  for (let r of e.current) r != null && (typeof r == "function" ? r(t) : r.current = t);
487
484
  }, []);
@@ -489,12 +486,12 @@ function Ue() {
489
486
  if (!t.every((r) => r == null)) return e.current = t, n;
490
487
  };
491
488
  }
492
- function je(...e) {
489
+ function Ae(...e) {
493
490
  return e.every((n) => n == null) ? void 0 : (n) => {
494
491
  for (let t of e) t != null && (typeof t == "function" ? t(n) : t.current = n);
495
492
  };
496
493
  }
497
- function te(...e) {
494
+ function ee(...e) {
498
495
  if (e.length === 0) return {};
499
496
  if (e.length === 1) return e[0];
500
497
  let n = {}, t = {};
@@ -512,7 +509,7 @@ function te(...e) {
512
509
  } });
513
510
  return n;
514
511
  }
515
- function Re(...e) {
512
+ function Ue(...e) {
516
513
  if (e.length === 0) return {};
517
514
  if (e.length === 1) return e[0];
518
515
  let n = {}, t = {};
@@ -523,9 +520,9 @@ function Re(...e) {
523
520
  } });
524
521
  return n;
525
522
  }
526
- function _e(e) {
523
+ function Re(e) {
527
524
  var n;
528
- return Object.assign(ie(e), { displayName: (n = e.displayName) != null ? n : e.name });
525
+ return Object.assign(oe(e), { displayName: (n = e.displayName) != null ? n : e.name });
529
526
  }
530
527
  function E(e) {
531
528
  let n = Object.assign({}, e);
@@ -537,40 +534,40 @@ function x(e, n = []) {
537
534
  for (let r of n) r in t && delete t[r];
538
535
  return t;
539
536
  }
540
- let ne = Symbol();
541
- function qe(e, n = !0) {
542
- return Object.assign(e, { [ne]: n });
537
+ let te = Symbol();
538
+ function _e(e, n = !0) {
539
+ return Object.assign(e, { [te]: n });
543
540
  }
544
- function Ge(...e) {
541
+ function qe(...e) {
545
542
  let n = m(e);
546
543
  w(() => {
547
544
  n.current = e;
548
545
  }, [e]);
549
- let t = De((r) => {
546
+ let t = ke((r) => {
550
547
  for (let o of n.current) o != null && (typeof o == "function" ? o(r) : o.current = r);
551
548
  });
552
- return e.every((r) => r == null || (r == null ? void 0 : r[ne])) ? void 0 : t;
549
+ return e.every((r) => r == null || (r == null ? void 0 : r[te])) ? void 0 : t;
553
550
  }
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 || {});
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 || {});
555
552
  export {
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,
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,
568
565
  E as m,
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
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
576
573
  };
@@ -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-mgWkd2Vh.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-B0lm_zyn.js";
3
3
  import { createPortal as J } from "react-dom";
4
- import { T as P, s as S } from "./hidden-PvGXrYUY.js";
4
+ import { T as P, s as S } from "./hidden-DbgtYPOH.js";
5
5
  let A = v(void 0);
6
6
  function D() {
7
7
  return p(A);
@@ -0,0 +1,86 @@
1
+ import h, { useState as F, useCallback as c, useRef as m, createContext as A, useContext as E } from "react";
2
+ import { p as x, n as O, d as y } from "./keyboard-B0lm_zyn.js";
3
+ function k(e = 0) {
4
+ let [t, n] = F(e), l = c((o) => n(o), [t]), s = c((o) => n((u) => u | o), [t]), r = c((o) => (t & o) === o, [t]), a = c((o) => n((u) => u & ~o), [n]), i = c((o) => n((u) => u ^ o), [n]);
5
+ return { flags: t, setFlag: l, addFlag: s, hasFlag: r, removeFlag: a, toggleFlag: i };
6
+ }
7
+ var v;
8
+ typeof process < "u" && typeof globalThis < "u" && ((v = process == null ? void 0 : process.env) == null ? void 0 : v.NODE_ENV) === "test" && typeof Element.prototype.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 L(e) {
14
+ let t = {};
15
+ for (let n in e) e[n] === !0 && (t[`data-${n}`] = "");
16
+ return t;
17
+ }
18
+ function R(e, t, n, l) {
19
+ let [s, r] = F(n), { hasFlag: a, addFlag: i, removeFlag: o } = k(e && s ? 3 : 0), u = m(!1), d = m(!1), C = x();
20
+ return O(() => {
21
+ var f;
22
+ if (e) {
23
+ if (n && r(!0), !t) {
24
+ n && i(3);
25
+ return;
26
+ }
27
+ return (f = void 0) == null || f.call(l, 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 g;
33
+ d.current && typeof t.getAnimations == "function" && t.getAnimations().length > 0 || (u.current = !1, o(7), n || r(!1), (g = void 0) == null || g.call(l, n));
34
+ } });
35
+ }
36
+ }, [e, n, t, C]), 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: l, inFlight: s }) {
39
+ let r = y();
40
+ return P(e, { prepare: t, inFlight: s }), r.nextFrame(() => {
41
+ n(), r.requestAnimationFrame(() => {
42
+ r.add(j(e, l));
43
+ });
44
+ }), r.dispose;
45
+ }
46
+ function j(e, t) {
47
+ var n, l;
48
+ let s = y();
49
+ if (!e) return s.dispose;
50
+ let r = !1;
51
+ s.add(() => {
52
+ r = !0;
53
+ });
54
+ let a = (l = (n = e.getAnimations) == null ? void 0 : n.call(e).filter((i) => i instanceof CSSTransition)) != null ? l : [];
55
+ return a.length === 0 ? (t(), s.dispose) : (Promise.allSettled(a.map((i) => i.finished)).then(() => {
56
+ r || t();
57
+ }), s.dispose);
58
+ }
59
+ function P(e, { inFlight: t, prepare: n }) {
60
+ if (t != null && t.current) {
61
+ n();
62
+ return;
63
+ }
64
+ let l = e.style.transition;
65
+ e.style.transition = "none", n(), e.offsetHeight, e.style.transition = l;
66
+ }
67
+ let p = A(null);
68
+ p.displayName = "OpenClosedContext";
69
+ var S = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(S || {});
70
+ function T() {
71
+ return E(p);
72
+ }
73
+ function _({ value: e, children: t }) {
74
+ return h.createElement(p.Provider, { value: e }, t);
75
+ }
76
+ function w({ children: e }) {
77
+ return h.createElement(p.Provider, { value: null }, e);
78
+ }
79
+ export {
80
+ L as H,
81
+ R,
82
+ _ as c,
83
+ S as i,
84
+ w as s,
85
+ T as u
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-mgWkd2Vh.js";
2
+ import { p as g, o as c, u as m } from "./keyboard-B0lm_zyn.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.12",
4
+ "version": "1.37.14",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {