@pittorica/popover-react 0.23.1 → 0.23.2

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 (2) hide show
  1. package/dist/index.js +169 -167
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { jsxs as Zt, jsx as j } from "react/jsx-runtime";
1
+ import { jsxs as Zt, jsx as q } from "react/jsx-runtime";
2
2
  import * as g from "react";
3
3
  import { useLayoutEffect as gt, createContext as Jt, useState as Qt, useMemo as en, use as tn } from "react";
4
4
  import * as ht from "react-dom";
@@ -21,25 +21,25 @@ function we() {
21
21
  function re(e) {
22
22
  return _e(e) ? (e.nodeName || "").toLowerCase() : "#document";
23
23
  }
24
- function B(e) {
24
+ function $(e) {
25
25
  var t;
26
26
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
27
27
  }
28
- function K(e) {
28
+ function U(e) {
29
29
  var t;
30
30
  return (t = (_e(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
31
31
  }
32
32
  function _e(e) {
33
- return we() ? e instanceof Node || e instanceof B(e).Node : !1;
33
+ return we() ? e instanceof Node || e instanceof $(e).Node : !1;
34
34
  }
35
35
  function D(e) {
36
- return we() ? e instanceof Element || e instanceof B(e).Element : !1;
36
+ return we() ? e instanceof Element || e instanceof $(e).Element : !1;
37
37
  }
38
- function L(e) {
39
- return we() ? e instanceof HTMLElement || e instanceof B(e).HTMLElement : !1;
38
+ function N(e) {
39
+ return we() ? e instanceof HTMLElement || e instanceof $(e).HTMLElement : !1;
40
40
  }
41
41
  function Me(e) {
42
- return !we() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof B(e).ShadowRoot;
42
+ return !we() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof $(e).ShadowRoot;
43
43
  }
44
44
  const on = /* @__PURE__ */ new Set(["inline", "contents"]);
45
45
  function ae(e) {
@@ -71,13 +71,13 @@ function Ve(e) {
71
71
  return ln.some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || an.some((o) => (n.willChange || "").includes(o)) || un.some((o) => (n.contain || "").includes(o));
72
72
  }
73
73
  function fn(e) {
74
- let t = Y(e);
75
- for (; L(t) && !q(t); ) {
74
+ let t = X(e);
75
+ for (; N(t) && !Y(t); ) {
76
76
  if (Ve(t))
77
77
  return t;
78
78
  if (xe(t))
79
79
  return null;
80
- t = Y(t);
80
+ t = X(t);
81
81
  }
82
82
  return null;
83
83
  }
@@ -85,11 +85,11 @@ function Re() {
85
85
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
86
86
  }
87
87
  const dn = /* @__PURE__ */ new Set(["html", "body", "#document"]);
88
- function q(e) {
88
+ function Y(e) {
89
89
  return dn.has(re(e));
90
90
  }
91
91
  function W(e) {
92
- return B(e).getComputedStyle(e);
92
+ return $(e).getComputedStyle(e);
93
93
  }
94
94
  function Ee(e) {
95
95
  return D(e) ? {
@@ -100,7 +100,7 @@ function Ee(e) {
100
100
  scrollTop: e.scrollY
101
101
  };
102
102
  }
103
- function Y(e) {
103
+ function X(e) {
104
104
  if (re(e) === "html")
105
105
  return e;
106
106
  const t = (
@@ -108,18 +108,18 @@ function Y(e) {
108
108
  e.assignedSlot || // DOM Element detected.
109
109
  e.parentNode || // ShadowRoot detected.
110
110
  Me(e) && e.host || // Fallback.
111
- K(e)
111
+ U(e)
112
112
  );
113
113
  return Me(t) ? t.host : t;
114
114
  }
115
115
  function bt(e) {
116
- const t = Y(e);
117
- return q(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : L(t) && ae(t) ? t : bt(t);
116
+ const t = X(e);
117
+ return Y(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : N(t) && ae(t) ? t : bt(t);
118
118
  }
119
119
  function Z(e, t, n) {
120
120
  var o;
121
121
  t === void 0 && (t = []), n === void 0 && (n = !0);
122
- const r = bt(e), i = r === ((o = e.ownerDocument) == null ? void 0 : o.body), s = B(r);
122
+ const r = bt(e), i = r === ((o = e.ownerDocument) == null ? void 0 : o.body), s = $(r);
123
123
  if (i) {
124
124
  const c = ke(s);
125
125
  return t.concat(s, s.visualViewport || [], ae(r) ? r : [], c && n ? Z(c) : []);
@@ -129,7 +129,7 @@ function Z(e, t, n) {
129
129
  function ke(e) {
130
130
  return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
131
131
  }
132
- const pe = Math.min, J = Math.max, me = Math.round, ue = Math.floor, H = (e) => ({
132
+ const pe = Math.min, J = Math.max, me = Math.round, ue = Math.floor, K = (e) => ({
133
133
  x: e,
134
134
  y: e
135
135
  }), pn = {
@@ -477,7 +477,7 @@ function le(e) {
477
477
  return (e == null ? void 0 : e.ownerDocument) || document;
478
478
  }
479
479
  function Un(e) {
480
- return L(e) && e.matches(Wn);
480
+ return N(e) && e.matches(Wn);
481
481
  }
482
482
  function jn(e) {
483
483
  return e ? e.hasAttribute(Je) ? e : e.querySelector("[" + Je + "]") || e : null;
@@ -628,17 +628,17 @@ async function to(e, t) {
628
628
  } : {
629
629
  x: 1,
630
630
  y: 1
631
- }, C = he(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
631
+ }, S = he(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
632
632
  elements: c,
633
633
  rect: w,
634
634
  offsetParent: x,
635
635
  strategy: l
636
636
  }) : w);
637
637
  return {
638
- top: (y.top - C.top + h.top) / E.y,
639
- bottom: (C.bottom - y.bottom + h.bottom) / E.y,
640
- left: (y.left - C.left + h.left) / E.x,
641
- right: (C.right - y.right + h.right) / E.x
638
+ top: (y.top - S.top + h.top) / E.y,
639
+ bottom: (S.bottom - y.bottom + h.bottom) / E.y,
640
+ left: (y.left - S.left + h.left) / E.x,
641
+ right: (S.right - y.right + h.right) / E.x
642
642
  };
643
643
  }
644
644
  const no = async (e, t, n) => {
@@ -664,8 +664,8 @@ const no = async (e, t, n) => {
664
664
  } = c[b], {
665
665
  x,
666
666
  y: E,
667
- data: C,
668
- reset: T
667
+ data: S,
668
+ reset: C
669
669
  } = await w({
670
670
  x: u,
671
671
  y: f,
@@ -687,13 +687,13 @@ const no = async (e, t, n) => {
687
687
  ...d,
688
688
  [y]: {
689
689
  ...d[y],
690
- ...C
690
+ ...S
691
691
  }
692
- }, T && h <= 50 && (h++, typeof T == "object" && (T.placement && (m = T.placement), T.rects && (a = T.rects === !0 ? await s.getElementRects({
692
+ }, C && h <= 50 && (h++, typeof C == "object" && (C.placement && (m = C.placement), C.rects && (a = C.rects === !0 ? await s.getElementRects({
693
693
  reference: e,
694
694
  floating: t,
695
695
  strategy: r
696
- }) : T.rects), {
696
+ }) : C.rects), {
697
697
  x: u,
698
698
  y: f
699
699
  } = tt(a, m, l)), b = -1);
@@ -729,46 +729,46 @@ const no = async (e, t, n) => {
729
729
  } = Se(e, t);
730
730
  if ((n = i.arrow) != null && n.alignmentOffset)
731
731
  return {};
732
- const y = ee(r), w = G(c), x = ee(c) === c, E = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), C = m || (x || !p ? [ge(c)] : vn(c)), T = h !== "none";
733
- !m && T && C.push(...xn(c, p, h, E));
734
- const k = [c, ...C], F = await l.detectOverflow(t, b), $ = [];
735
- let S = ((o = i.flip) == null ? void 0 : o.overflows) || [];
736
- if (u && $.push(F[y]), f) {
732
+ const y = ee(r), w = G(c), x = ee(c) === c, E = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), S = m || (x || !p ? [ge(c)] : vn(c)), C = h !== "none";
733
+ !m && C && S.push(...xn(c, p, h, E));
734
+ const k = [c, ...S], F = await l.detectOverflow(t, b), _ = [];
735
+ let L = ((o = i.flip) == null ? void 0 : o.overflows) || [];
736
+ if (u && _.push(F[y]), f) {
737
737
  const R = hn(r, s, E);
738
- $.push(F[R[0]], F[R[1]]);
738
+ _.push(F[R[0]], F[R[1]]);
739
739
  }
740
- if (S = [...S, {
740
+ if (L = [...L, {
741
741
  placement: r,
742
- overflows: $
743
- }], !$.every((R) => R <= 0)) {
744
- var _, X;
745
- const R = (((_ = i.flip) == null ? void 0 : _.index) || 0) + 1, M = k[R];
742
+ overflows: _
743
+ }], !_.every((R) => R <= 0)) {
744
+ var A, H;
745
+ const R = (((A = i.flip) == null ? void 0 : A.index) || 0) + 1, M = k[R];
746
746
  if (M && (!(f === "alignment" ? w !== G(M) : !1) || // We leave the current main axis only if every placement on that axis
747
747
  // overflows the main axis.
748
- S.every((v) => G(v.placement) === w ? v.overflows[0] > 0 : !0)))
748
+ L.every((v) => G(v.placement) === w ? v.overflows[0] > 0 : !0)))
749
749
  return {
750
750
  data: {
751
751
  index: R,
752
- overflows: S
752
+ overflows: L
753
753
  },
754
754
  reset: {
755
755
  placement: M
756
756
  }
757
757
  };
758
- let O = (X = S.filter((P) => P.overflows[0] <= 0).sort((P, v) => P.overflows[1] - v.overflows[1])[0]) == null ? void 0 : X.placement;
758
+ let O = (H = L.filter((P) => P.overflows[0] <= 0).sort((P, v) => P.overflows[1] - v.overflows[1])[0]) == null ? void 0 : H.placement;
759
759
  if (!O)
760
760
  switch (d) {
761
761
  case "bestFit": {
762
762
  var V;
763
- const P = (V = S.filter((v) => {
764
- if (T) {
765
- const A = G(v.placement);
766
- return A === w || // Create a bias to the `y` side axis due to horizontal
763
+ const P = (V = L.filter((v) => {
764
+ if (C) {
765
+ const T = G(v.placement);
766
+ return T === w || // Create a bias to the `y` side axis due to horizontal
767
767
  // reading directions favoring greater width.
768
- A === "y";
768
+ T === "y";
769
769
  }
770
770
  return !0;
771
- }).map((v) => [v.placement, v.overflows.filter((A) => A > 0).reduce((A, I) => A + I, 0)]).sort((v, A) => v[1] - A[1])[0]) == null ? void 0 : V[0];
771
+ }).map((v) => [v.placement, v.overflows.filter((T) => T > 0).reduce((T, I) => T + I, 0)]).sort((v, T) => v[1] - T[1])[0]) == null ? void 0 : V[0];
772
772
  P && (O = P);
773
773
  break;
774
774
  }
@@ -897,7 +897,7 @@ const so = function(e) {
897
897
  function It(e) {
898
898
  const t = W(e);
899
899
  let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
900
- const r = L(e), i = r ? e.offsetWidth : n, s = r ? e.offsetHeight : o, c = me(n) !== i || me(o) !== s;
900
+ const r = N(e), i = r ? e.offsetWidth : n, s = r ? e.offsetHeight : o, c = me(n) !== i || me(o) !== s;
901
901
  return c && (n = i, o = s), {
902
902
  width: n,
903
903
  height: o,
@@ -909,8 +909,8 @@ function We(e) {
909
909
  }
910
910
  function oe(e) {
911
911
  const t = We(e);
912
- if (!L(t))
913
- return H(1);
912
+ if (!N(t))
913
+ return K(1);
914
914
  const n = t.getBoundingClientRect(), {
915
915
  width: o,
916
916
  height: r,
@@ -922,30 +922,30 @@ function oe(e) {
922
922
  y: c
923
923
  };
924
924
  }
925
- const lo = /* @__PURE__ */ H(0);
925
+ const lo = /* @__PURE__ */ K(0);
926
926
  function Dt(e) {
927
- const t = B(e);
927
+ const t = $(e);
928
928
  return !Re() || !t.visualViewport ? lo : {
929
929
  x: t.visualViewport.offsetLeft,
930
930
  y: t.visualViewport.offsetTop
931
931
  };
932
932
  }
933
933
  function ao(e, t, n) {
934
- return t === void 0 && (t = !1), !n || t && n !== B(e) ? !1 : t;
934
+ return t === void 0 && (t = !1), !n || t && n !== $(e) ? !1 : t;
935
935
  }
936
936
  function te(e, t, n, o) {
937
937
  t === void 0 && (t = !1), n === void 0 && (n = !1);
938
938
  const r = e.getBoundingClientRect(), i = We(e);
939
- let s = H(1);
939
+ let s = K(1);
940
940
  t && (o ? D(o) && (s = oe(o)) : s = oe(e));
941
- const c = ao(i, n, o) ? Dt(i) : H(0);
941
+ const c = ao(i, n, o) ? Dt(i) : K(0);
942
942
  let l = (r.left + c.x) / s.x, a = (r.top + c.y) / s.y, u = r.width / s.x, f = r.height / s.y;
943
943
  if (i) {
944
- const m = B(i), d = o && D(o) ? B(o) : o;
944
+ const m = $(i), d = o && D(o) ? $(o) : o;
945
945
  let h = m, p = ke(h);
946
946
  for (; p && o && d !== h; ) {
947
947
  const b = oe(p), y = p.getBoundingClientRect(), w = W(p), x = y.left + (p.clientLeft + parseFloat(w.paddingLeft)) * b.x, E = y.top + (p.clientTop + parseFloat(w.paddingTop)) * b.y;
948
- l *= b.x, a *= b.y, u *= b.x, f *= b.y, l += x, a += E, h = B(p), p = ke(h);
948
+ l *= b.x, a *= b.y, u *= b.x, f *= b.y, l += x, a += E, h = $(p), p = ke(h);
949
949
  }
950
950
  }
951
951
  return he({
@@ -957,7 +957,7 @@ function te(e, t, n, o) {
957
957
  }
958
958
  function Te(e, t) {
959
959
  const n = Ee(e).scrollLeft;
960
- return t ? t.left + n : te(K(e)).left + n;
960
+ return t ? t.left + n : te(U(e)).left + n;
961
961
  }
962
962
  function Mt(e, t) {
963
963
  const n = e.getBoundingClientRect(), o = n.left + t.scrollLeft - Te(e, n), r = n.top + t.scrollTop;
@@ -973,19 +973,19 @@ function uo(e) {
973
973
  offsetParent: o,
974
974
  strategy: r
975
975
  } = e;
976
- const i = r === "fixed", s = K(o), c = t ? xe(t.floating) : !1;
976
+ const i = r === "fixed", s = U(o), c = t ? xe(t.floating) : !1;
977
977
  if (o === s || c && i)
978
978
  return n;
979
979
  let l = {
980
980
  scrollLeft: 0,
981
981
  scrollTop: 0
982
- }, a = H(1);
983
- const u = H(0), f = L(o);
984
- if ((f || !f && !i) && ((re(o) !== "body" || ae(s)) && (l = Ee(o)), L(o))) {
982
+ }, a = K(1);
983
+ const u = K(0), f = N(o);
984
+ if ((f || !f && !i) && ((re(o) !== "body" || ae(s)) && (l = Ee(o)), N(o))) {
985
985
  const d = te(o);
986
986
  a = oe(o), u.x = d.x + o.clientLeft, u.y = d.y + o.clientTop;
987
987
  }
988
- const m = s && !f && !i ? Mt(s, l) : H(0);
988
+ const m = s && !f && !i ? Mt(s, l) : K(0);
989
989
  return {
990
990
  width: n.width * a.x,
991
991
  height: n.height * a.y,
@@ -997,7 +997,7 @@ function fo(e) {
997
997
  return Array.from(e.getClientRects());
998
998
  }
999
999
  function po(e) {
1000
- const t = K(e), n = Ee(e), o = e.ownerDocument.body, r = J(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), i = J(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
1000
+ const t = U(e), n = Ee(e), o = e.ownerDocument.body, r = J(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), i = J(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
1001
1001
  let s = -n.scrollLeft + Te(e);
1002
1002
  const c = -n.scrollTop;
1003
1003
  return W(o).direction === "rtl" && (s += J(t.clientWidth, o.clientWidth) - r), {
@@ -1009,7 +1009,7 @@ function po(e) {
1009
1009
  }
1010
1010
  const nt = 25;
1011
1011
  function mo(e, t) {
1012
- const n = B(e), o = K(e), r = n.visualViewport;
1012
+ const n = $(e), o = U(e), r = n.visualViewport;
1013
1013
  let i = o.clientWidth, s = o.clientHeight, c = 0, l = 0;
1014
1014
  if (r) {
1015
1015
  i = r.width, s = r.height;
@@ -1030,7 +1030,7 @@ function mo(e, t) {
1030
1030
  }
1031
1031
  const go = /* @__PURE__ */ new Set(["absolute", "fixed"]);
1032
1032
  function ho(e, t) {
1033
- const n = te(e, !0, t === "fixed"), o = n.top + e.clientTop, r = n.left + e.clientLeft, i = L(e) ? oe(e) : H(1), s = e.clientWidth * i.x, c = e.clientHeight * i.y, l = r * i.x, a = o * i.y;
1033
+ const n = te(e, !0, t === "fixed"), o = n.top + e.clientTop, r = n.left + e.clientLeft, i = N(e) ? oe(e) : K(1), s = e.clientWidth * i.x, c = e.clientHeight * i.y, l = r * i.x, a = o * i.y;
1034
1034
  return {
1035
1035
  width: s,
1036
1036
  height: c,
@@ -1043,7 +1043,7 @@ function ot(e, t, n) {
1043
1043
  if (t === "viewport")
1044
1044
  o = mo(e, n);
1045
1045
  else if (t === "document")
1046
- o = po(K(e));
1046
+ o = po(U(e));
1047
1047
  else if (D(t))
1048
1048
  o = ho(t, n);
1049
1049
  else {
@@ -1058,8 +1058,8 @@ function ot(e, t, n) {
1058
1058
  return he(o);
1059
1059
  }
1060
1060
  function kt(e, t) {
1061
- const n = Y(e);
1062
- return n === t || !D(n) || q(n) ? !1 : W(n).position === "fixed" || kt(n, t);
1061
+ const n = X(e);
1062
+ return n === t || !D(n) || Y(n) ? !1 : W(n).position === "fixed" || kt(n, t);
1063
1063
  }
1064
1064
  function vo(e, t) {
1065
1065
  const n = t.get(e);
@@ -1067,10 +1067,10 @@ function vo(e, t) {
1067
1067
  return n;
1068
1068
  let o = Z(e, [], !1).filter((c) => D(c) && re(c) !== "body"), r = null;
1069
1069
  const i = W(e).position === "fixed";
1070
- let s = i ? Y(e) : e;
1071
- for (; D(s) && !q(s); ) {
1070
+ let s = i ? X(e) : e;
1071
+ for (; D(s) && !Y(s); ) {
1072
1072
  const c = W(s), l = Ve(s);
1073
- !l && c.position === "fixed" && (r = null), (i ? !l && !r : !l && c.position === "static" && !!r && go.has(r.position) || ae(s) && !l && kt(e, s)) ? o = o.filter((u) => u !== s) : r = c, s = Y(s);
1073
+ !l && c.position === "fixed" && (r = null), (i ? !l && !r : !l && c.position === "static" && !!r && go.has(r.position) || ae(s) && !l && kt(e, s)) ? o = o.filter((u) => u !== s) : r = c, s = X(s);
1074
1074
  }
1075
1075
  return t.set(e, o), o;
1076
1076
  }
@@ -1103,12 +1103,12 @@ function yo(e) {
1103
1103
  };
1104
1104
  }
1105
1105
  function wo(e, t, n) {
1106
- const o = L(t), r = K(t), i = n === "fixed", s = te(e, !0, i, t);
1106
+ const o = N(t), r = U(t), i = n === "fixed", s = te(e, !0, i, t);
1107
1107
  let c = {
1108
1108
  scrollLeft: 0,
1109
1109
  scrollTop: 0
1110
1110
  };
1111
- const l = H(0);
1111
+ const l = K(0);
1112
1112
  function a() {
1113
1113
  l.x = Te(r);
1114
1114
  }
@@ -1118,7 +1118,7 @@ function wo(e, t, n) {
1118
1118
  l.x = d.x + t.clientLeft, l.y = d.y + t.clientTop;
1119
1119
  } else r && a();
1120
1120
  i && !o && r && a();
1121
- const u = r && !o && !i ? Mt(r, c) : H(0), f = s.left + c.scrollLeft - l.x - u.x, m = s.top + c.scrollTop - l.y - u.y;
1121
+ const u = r && !o && !i ? Mt(r, c) : K(0), f = s.left + c.scrollLeft - l.x - u.x, m = s.top + c.scrollTop - l.y - u.y;
1122
1122
  return {
1123
1123
  x: f,
1124
1124
  y: m,
@@ -1130,30 +1130,30 @@ function Pe(e) {
1130
1130
  return W(e).position === "static";
1131
1131
  }
1132
1132
  function rt(e, t) {
1133
- if (!L(e) || W(e).position === "fixed")
1133
+ if (!N(e) || W(e).position === "fixed")
1134
1134
  return null;
1135
1135
  if (t)
1136
1136
  return t(e);
1137
1137
  let n = e.offsetParent;
1138
- return K(e) === n && (n = n.ownerDocument.body), n;
1138
+ return U(e) === n && (n = n.ownerDocument.body), n;
1139
1139
  }
1140
1140
  function Ft(e, t) {
1141
- const n = B(e);
1141
+ const n = $(e);
1142
1142
  if (xe(e))
1143
1143
  return n;
1144
- if (!L(e)) {
1145
- let r = Y(e);
1146
- for (; r && !q(r); ) {
1144
+ if (!N(e)) {
1145
+ let r = X(e);
1146
+ for (; r && !Y(r); ) {
1147
1147
  if (D(r) && !Pe(r))
1148
1148
  return r;
1149
- r = Y(r);
1149
+ r = X(r);
1150
1150
  }
1151
1151
  return n;
1152
1152
  }
1153
1153
  let o = rt(e, t);
1154
1154
  for (; o && sn(o) && Pe(o); )
1155
1155
  o = rt(o, t);
1156
- return o && q(o) && Pe(o) && !Ve(o) ? n : o || fn(e) || n;
1156
+ return o && Y(o) && Pe(o) && !Ve(o) ? n : o || fn(e) || n;
1157
1157
  }
1158
1158
  const xo = async function(e) {
1159
1159
  const t = this.getOffsetParent || Ft, n = this.getDimensions, o = await n(e.floating);
@@ -1172,7 +1172,7 @@ function Ro(e) {
1172
1172
  }
1173
1173
  const Eo = {
1174
1174
  convertOffsetParentRelativeRectToViewportRelativeRect: uo,
1175
- getDocumentElement: K,
1175
+ getDocumentElement: U,
1176
1176
  getClippingRect: bo,
1177
1177
  getOffsetParent: Ft,
1178
1178
  getElementRects: xo,
@@ -1187,7 +1187,7 @@ function Lt(e, t) {
1187
1187
  }
1188
1188
  function So(e, t) {
1189
1189
  let n = null, o;
1190
- const r = K(e);
1190
+ const r = U(e);
1191
1191
  function i() {
1192
1192
  var c;
1193
1193
  clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
@@ -1207,8 +1207,8 @@ function So(e, t) {
1207
1207
  threshold: J(0, pe(1, l)) || 1
1208
1208
  };
1209
1209
  let E = !0;
1210
- function C(T) {
1211
- const k = T[0].intersectionRatio;
1210
+ function S(C) {
1211
+ const k = C[0].intersectionRatio;
1212
1212
  if (k !== l) {
1213
1213
  if (!E)
1214
1214
  return s();
@@ -1219,13 +1219,13 @@ function So(e, t) {
1219
1219
  k === 1 && !Lt(a, e.getBoundingClientRect()) && s(), E = !1;
1220
1220
  }
1221
1221
  try {
1222
- n = new IntersectionObserver(C, {
1222
+ n = new IntersectionObserver(S, {
1223
1223
  ...x,
1224
1224
  // Handle <iframe>s
1225
1225
  root: r.ownerDocument
1226
1226
  });
1227
1227
  } catch {
1228
- n = new IntersectionObserver(C, x);
1228
+ n = new IntersectionObserver(S, x);
1229
1229
  }
1230
1230
  n.observe(e);
1231
1231
  }
@@ -1349,31 +1349,31 @@ function Mo(e) {
1349
1349
  }), [m, d] = g.useState(o);
1350
1350
  ye(m, o) || d(o);
1351
1351
  const [h, p] = g.useState(null), [b, y] = g.useState(null), w = g.useCallback((v) => {
1352
- v !== T.current && (T.current = v, p(v));
1352
+ v !== C.current && (C.current = v, p(v));
1353
1353
  }, []), x = g.useCallback((v) => {
1354
1354
  v !== k.current && (k.current = v, y(v));
1355
- }, []), E = i || h, C = s || b, T = g.useRef(null), k = g.useRef(null), F = g.useRef(u), $ = l != null, S = Ie(l), _ = Ie(r), X = Ie(a), V = g.useCallback(() => {
1356
- if (!T.current || !k.current)
1355
+ }, []), E = i || h, S = s || b, C = g.useRef(null), k = g.useRef(null), F = g.useRef(u), _ = l != null, L = Ie(l), A = Ie(r), H = Ie(a), V = g.useCallback(() => {
1356
+ if (!C.current || !k.current)
1357
1357
  return;
1358
1358
  const v = {
1359
1359
  placement: t,
1360
1360
  strategy: n,
1361
1361
  middleware: m
1362
1362
  };
1363
- _.current && (v.platform = _.current), Po(T.current, k.current, v).then((A) => {
1363
+ A.current && (v.platform = A.current), Po(C.current, k.current, v).then((T) => {
1364
1364
  const I = {
1365
- ...A,
1365
+ ...T,
1366
1366
  // The floating element's position may be recomputed while it's closed
1367
1367
  // but still mounted (such as when transitioning out). To ensure
1368
1368
  // `isPositioned` will be `false` initially on the next open, avoid
1369
1369
  // setting it to `true` when `open === false` (must be specified).
1370
- isPositioned: X.current !== !1
1370
+ isPositioned: H.current !== !1
1371
1371
  };
1372
1372
  R.current && !ye(F.current, I) && (F.current = I, ht.flushSync(() => {
1373
1373
  f(I);
1374
1374
  }));
1375
1375
  });
1376
- }, [m, t, n, _, X]);
1376
+ }, [m, t, n, A, H]);
1377
1377
  de(() => {
1378
1378
  a === !1 && F.current.isPositioned && (F.current.isPositioned = !1, f((v) => ({
1379
1379
  ...v,
@@ -1384,21 +1384,21 @@ function Mo(e) {
1384
1384
  de(() => (R.current = !0, () => {
1385
1385
  R.current = !1;
1386
1386
  }), []), de(() => {
1387
- if (E && (T.current = E), C && (k.current = C), E && C) {
1388
- if (S.current)
1389
- return S.current(E, C, V);
1387
+ if (E && (C.current = E), S && (k.current = S), E && S) {
1388
+ if (L.current)
1389
+ return L.current(E, S, V);
1390
1390
  V();
1391
1391
  }
1392
- }, [E, C, V, S, $]);
1392
+ }, [E, S, V, L, _]);
1393
1393
  const M = g.useMemo(() => ({
1394
- reference: T,
1394
+ reference: C,
1395
1395
  floating: k,
1396
1396
  setReference: w,
1397
1397
  setFloating: x
1398
1398
  }), [w, x]), O = g.useMemo(() => ({
1399
1399
  reference: E,
1400
- floating: C
1401
- }), [E, C]), P = g.useMemo(() => {
1400
+ floating: S
1401
+ }), [E, S]), P = g.useMemo(() => {
1402
1402
  const v = {
1403
1403
  position: n,
1404
1404
  left: 0,
@@ -1406,16 +1406,16 @@ function Mo(e) {
1406
1406
  };
1407
1407
  if (!O.floating)
1408
1408
  return v;
1409
- const A = it(O.floating, u.x), I = it(O.floating, u.y);
1409
+ const T = it(O.floating, u.x), I = it(O.floating, u.y);
1410
1410
  return c ? {
1411
1411
  ...v,
1412
- transform: "translate(" + A + "px, " + I + "px)",
1412
+ transform: "translate(" + T + "px, " + I + "px)",
1413
1413
  ...Nt(O.floating) >= 1.5 && {
1414
1414
  willChange: "transform"
1415
1415
  }
1416
1416
  } : {
1417
1417
  position: n,
1418
- left: A,
1418
+ left: T,
1419
1419
  top: I
1420
1420
  };
1421
1421
  }, [n, c, O.floating, u.x, u.y]);
@@ -1514,7 +1514,7 @@ const jo = {
1514
1514
  [Ke("focus-guard")]: "",
1515
1515
  style: jo
1516
1516
  };
1517
- return /* @__PURE__ */ j("span", {
1517
+ return /* @__PURE__ */ q("span", {
1518
1518
  ...t,
1519
1519
  ...i
1520
1520
  });
@@ -1587,7 +1587,7 @@ function Xo(e) {
1587
1587
  portalNode: i,
1588
1588
  setFocusManagerState: c
1589
1589
  }), [r, i]),
1590
- children: [h && i && /* @__PURE__ */ j(ut, {
1590
+ children: [h && i && /* @__PURE__ */ q(ut, {
1591
1591
  "data-type": "outside",
1592
1592
  ref: l,
1593
1593
  onFocus: (p) => {
@@ -1599,10 +1599,10 @@ function Xo(e) {
1599
1599
  w == null || w.focus();
1600
1600
  }
1601
1601
  }
1602
- }), h && i && /* @__PURE__ */ j("span", {
1602
+ }), h && i && /* @__PURE__ */ q("span", {
1603
1603
  "aria-owns": i.id,
1604
1604
  style: qo
1605
- }), i && /* @__PURE__ */ ht.createPortal(t, i), h && i && /* @__PURE__ */ j(ut, {
1605
+ }), i && /* @__PURE__ */ ht.createPortal(t, i), h && i && /* @__PURE__ */ q(ut, {
1606
1606
  "data-type": "outside",
1607
1607
  ref: a,
1608
1608
  onFocus: (p) => {
@@ -1619,10 +1619,10 @@ function Xo(e) {
1619
1619
  }
1620
1620
  const zo = () => g.useContext(_t);
1621
1621
  function dt(e) {
1622
- return L(e.target) && e.target.tagName === "BUTTON";
1622
+ return N(e.target) && e.target.tagName === "BUTTON";
1623
1623
  }
1624
1624
  function Go(e) {
1625
- return L(e.target) && e.target.tagName === "A";
1625
+ return N(e.target) && e.target.tagName === "A";
1626
1626
  }
1627
1627
  function pt(e) {
1628
1628
  return Un(e);
@@ -1706,8 +1706,8 @@ function er(e, t) {
1706
1706
  escapeKey: x,
1707
1707
  outsidePress: E
1708
1708
  } = mt(d), {
1709
- escapeKey: C,
1710
- outsidePress: T
1709
+ escapeKey: S,
1710
+ outsidePress: C
1711
1711
  } = mt(h), k = g.useRef(!1), F = ne((R) => {
1712
1712
  var M;
1713
1713
  if (!n || !s || !c || R.key !== "Escape" || k.current)
@@ -1715,9 +1715,9 @@ function er(e, t) {
1715
1715
  const O = (M = i.current.floatingContext) == null ? void 0 : M.nodeId, P = p ? fe(p.nodesRef.current, O) : [];
1716
1716
  if (!x && (R.stopPropagation(), P.length > 0)) {
1717
1717
  let v = !0;
1718
- if (P.forEach((A) => {
1718
+ if (P.forEach((T) => {
1719
1719
  var I;
1720
- if ((I = A.context) != null && I.open && !A.context.dataRef.current.__escapeKeyBubbles) {
1720
+ if ((I = T.context) != null && I.open && !T.context.dataRef.current.__escapeKeyBubbles) {
1721
1721
  v = !1;
1722
1722
  return;
1723
1723
  }
@@ -1725,62 +1725,62 @@ function er(e, t) {
1725
1725
  return;
1726
1726
  }
1727
1727
  o(!1, qn(R) ? R.nativeEvent : R, "escape-key");
1728
- }), $ = ne((R) => {
1728
+ }), _ = ne((R) => {
1729
1729
  var M;
1730
1730
  const O = () => {
1731
1731
  var P;
1732
1732
  F(R), (P = se(R)) == null || P.removeEventListener("keydown", O);
1733
1733
  };
1734
1734
  (M = se(R)) == null || M.addEventListener("keydown", O);
1735
- }), S = ne((R) => {
1735
+ }), L = ne((R) => {
1736
1736
  var M;
1737
1737
  const O = i.current.insideReactTree;
1738
1738
  i.current.insideReactTree = !1;
1739
1739
  const P = w.current;
1740
1740
  if (w.current = !1, a === "click" && P || O || typeof y == "function" && !y(R))
1741
1741
  return;
1742
- const v = se(R), A = "[" + Ke("inert") + "]", I = le(r.floating).querySelectorAll(A);
1742
+ const v = se(R), T = "[" + Ke("inert") + "]", I = le(r.floating).querySelectorAll(T);
1743
1743
  let z = D(v) ? v : null;
1744
- for (; z && !q(z); ) {
1745
- const N = Y(z);
1746
- if (q(N) || !D(N))
1744
+ for (; z && !Y(z); ) {
1745
+ const B = X(z);
1746
+ if (Y(B) || !D(B))
1747
1747
  break;
1748
- z = N;
1748
+ z = B;
1749
1749
  }
1750
1750
  if (I.length && D(v) && !Kn(v) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
1751
1751
  !Be(v, r.floating) && // If the target root element contains none of the markers, then the
1752
1752
  // element was injected after the floating element rendered.
1753
- Array.from(I).every((N) => !Be(z, N)))
1753
+ Array.from(I).every((B) => !Be(z, B)))
1754
1754
  return;
1755
- if (L(v) && V) {
1756
- const N = q(v), U = W(v), ie = /auto|scroll/, Ut = N || ie.test(U.overflowX), jt = N || ie.test(U.overflowY), qt = Ut && v.clientWidth > 0 && v.scrollWidth > v.clientWidth, Yt = jt && v.clientHeight > 0 && v.scrollHeight > v.clientHeight, Xt = U.direction === "rtl", zt = Yt && (Xt ? R.offsetX <= v.offsetWidth - v.clientWidth : R.offsetX > v.clientWidth), Gt = qt && R.offsetY > v.clientHeight;
1755
+ if (N(v) && V) {
1756
+ const B = Y(v), j = W(v), ie = /auto|scroll/, Ut = B || ie.test(j.overflowX), jt = B || ie.test(j.overflowY), qt = Ut && v.clientWidth > 0 && v.scrollWidth > v.clientWidth, Yt = jt && v.clientHeight > 0 && v.scrollHeight > v.clientHeight, Xt = j.direction === "rtl", zt = Yt && (Xt ? R.offsetX <= v.offsetWidth - v.clientWidth : R.offsetX > v.clientWidth), Gt = qt && R.offsetY > v.clientHeight;
1757
1757
  if (zt || Gt)
1758
1758
  return;
1759
1759
  }
1760
- const je = (M = i.current.floatingContext) == null ? void 0 : M.nodeId, Kt = p && fe(p.nodesRef.current, je).some((N) => {
1761
- var U;
1762
- return Ae(R, (U = N.context) == null ? void 0 : U.elements.floating);
1760
+ const je = (M = i.current.floatingContext) == null ? void 0 : M.nodeId, Kt = p && fe(p.nodesRef.current, je).some((B) => {
1761
+ var j;
1762
+ return Ae(R, (j = B.context) == null ? void 0 : j.elements.floating);
1763
1763
  });
1764
1764
  if (Ae(R, r.floating) || Ae(R, r.domReference) || Kt)
1765
1765
  return;
1766
1766
  const qe = p ? fe(p.nodesRef.current, je) : [];
1767
1767
  if (qe.length > 0) {
1768
- let N = !0;
1769
- if (qe.forEach((U) => {
1768
+ let B = !0;
1769
+ if (qe.forEach((j) => {
1770
1770
  var ie;
1771
- if ((ie = U.context) != null && ie.open && !U.context.dataRef.current.__outsidePressBubbles) {
1772
- N = !1;
1771
+ if ((ie = j.context) != null && ie.open && !j.context.dataRef.current.__outsidePressBubbles) {
1772
+ B = !1;
1773
1773
  return;
1774
1774
  }
1775
- }), !N)
1775
+ }), !B)
1776
1776
  return;
1777
1777
  }
1778
1778
  o(!1, R, "outside-press");
1779
- }), _ = ne((R) => {
1779
+ }), A = ne((R) => {
1780
1780
  var M;
1781
1781
  const O = () => {
1782
1782
  var P;
1783
- S(R), (P = se(R)) == null || P.removeEventListener(a, O);
1783
+ L(R), (P = se(R)) == null || P.removeEventListener(a, O);
1784
1784
  };
1785
1785
  (M = se(R)) == null || M.addEventListener(a, O);
1786
1786
  });
@@ -1806,24 +1806,24 @@ function er(e, t) {
1806
1806
  );
1807
1807
  }
1808
1808
  const v = le(r.floating);
1809
- c && (v.addEventListener("keydown", C ? $ : F, C), v.addEventListener("compositionstart", O), v.addEventListener("compositionend", P)), y && v.addEventListener(a, T ? _ : S, T);
1810
- let A = [];
1811
- return m && (D(r.domReference) && (A = Z(r.domReference)), D(r.floating) && (A = A.concat(Z(r.floating))), !D(r.reference) && r.reference && r.reference.contextElement && (A = A.concat(Z(r.reference.contextElement)))), A = A.filter((I) => {
1809
+ c && (v.addEventListener("keydown", S ? _ : F, S), v.addEventListener("compositionstart", O), v.addEventListener("compositionend", P)), y && v.addEventListener(a, C ? A : L, C);
1810
+ let T = [];
1811
+ return m && (D(r.domReference) && (T = Z(r.domReference)), D(r.floating) && (T = T.concat(Z(r.floating))), !D(r.reference) && r.reference && r.reference.contextElement && (T = T.concat(Z(r.reference.contextElement)))), T = T.filter((I) => {
1812
1812
  var z;
1813
1813
  return I !== ((z = v.defaultView) == null ? void 0 : z.visualViewport);
1814
- }), A.forEach((I) => {
1814
+ }), T.forEach((I) => {
1815
1815
  I.addEventListener("scroll", M, {
1816
1816
  passive: !0
1817
1817
  });
1818
1818
  }), () => {
1819
- c && (v.removeEventListener("keydown", C ? $ : F, C), v.removeEventListener("compositionstart", O), v.removeEventListener("compositionend", P)), y && v.removeEventListener(a, T ? _ : S, T), A.forEach((I) => {
1819
+ c && (v.removeEventListener("keydown", S ? _ : F, S), v.removeEventListener("compositionstart", O), v.removeEventListener("compositionend", P)), y && v.removeEventListener(a, C ? A : L, C), T.forEach((I) => {
1820
1820
  I.removeEventListener("scroll", M);
1821
1821
  }), window.clearTimeout(R);
1822
1822
  };
1823
- }, [i, r, c, y, a, n, o, m, s, x, E, F, C, $, S, T, _]), g.useEffect(() => {
1823
+ }, [i, r, c, y, a, n, o, m, s, x, E, F, S, _, L, C, A]), g.useEffect(() => {
1824
1824
  i.current.insideReactTree = !1;
1825
1825
  }, [i, y, a]);
1826
- const X = g.useMemo(() => ({
1826
+ const H = g.useMemo(() => ({
1827
1827
  onKeyDown: F,
1828
1828
  ...u && {
1829
1829
  [Jo[f]]: (R) => {
@@ -1848,9 +1848,9 @@ function er(e, t) {
1848
1848
  }
1849
1849
  }), [F, a, i]);
1850
1850
  return g.useMemo(() => s ? {
1851
- reference: X,
1851
+ reference: H,
1852
1852
  floating: V
1853
- } : {}, [s, X, V]);
1853
+ } : {}, [s, H, V]);
1854
1854
  }
1855
1855
  function tr(e) {
1856
1856
  const {
@@ -2058,7 +2058,7 @@ function ir(e, t) {
2058
2058
  active: x,
2059
2059
  selected: E
2060
2060
  } = w;
2061
- const C = {
2061
+ const S = {
2062
2062
  role: "option",
2063
2063
  ...x && {
2064
2064
  id: f + "-fui-option"
@@ -2068,7 +2068,7 @@ function ir(e, t) {
2068
2068
  case "select":
2069
2069
  case "combobox":
2070
2070
  return {
2071
- ...C,
2071
+ ...S,
2072
2072
  "aria-selected": E
2073
2073
  };
2074
2074
  }
@@ -2115,31 +2115,33 @@ const Ue = ({
2115
2115
  className: w,
2116
2116
  href: x,
2117
2117
  target: E,
2118
- rel: C,
2119
- htmlFor: T,
2118
+ rel: S,
2119
+ htmlFor: C,
2120
2120
  type: k,
2121
- disabled: F,
2122
- ...$
2121
+ name: F,
2122
+ disabled: _,
2123
+ ...L
2123
2124
  }) => {
2124
- const S = {};
2125
- o && (S.display = o), h && (S.width = h), p && (S.height = p), b && (S.position = b), r && (S.margin = `var(--pittorica-space-${r})`), i && (S.marginTop = `var(--pittorica-space-${i})`), s && (S.marginRight = `var(--pittorica-space-${s})`), c && (S.marginBottom = `var(--pittorica-space-${c})`), l && (S.marginLeft = `var(--pittorica-space-${l})`), a && (S.padding = `var(--pittorica-space-${a})`), u && (S.paddingTop = `var(--pittorica-space-${u})`), f && (S.paddingRight = `var(--pittorica-space-${f})`), m && (S.paddingBottom = `var(--pittorica-space-${m})`), d && (S.paddingLeft = `var(--pittorica-space-${d})`);
2126
- const _ = {
2125
+ const A = {};
2126
+ o && (A.display = o), h && (A.width = h), p && (A.height = p), b && (A.position = b), r && (A.margin = `var(--pittorica-space-${r})`), i && (A.marginTop = `var(--pittorica-space-${i})`), s && (A.marginRight = `var(--pittorica-space-${s})`), c && (A.marginBottom = `var(--pittorica-space-${c})`), l && (A.marginLeft = `var(--pittorica-space-${l})`), a && (A.padding = `var(--pittorica-space-${a})`), u && (A.paddingTop = `var(--pittorica-space-${u})`), f && (A.paddingRight = `var(--pittorica-space-${f})`), m && (A.paddingBottom = `var(--pittorica-space-${m})`), d && (A.paddingLeft = `var(--pittorica-space-${d})`);
2127
+ const H = {
2127
2128
  ...y,
2128
- ...S
2129
+ ...A
2129
2130
  };
2130
- return /* @__PURE__ */ j(
2131
+ return /* @__PURE__ */ q(
2131
2132
  t,
2132
2133
  {
2133
2134
  ref: e,
2134
2135
  className: sr("pittorica-box", w),
2135
- style: _,
2136
+ style: H,
2136
2137
  href: x,
2137
2138
  target: E,
2138
- rel: C,
2139
- htmlFor: T,
2139
+ rel: S,
2140
+ htmlFor: C,
2140
2141
  type: k,
2141
- disabled: F,
2142
- ...$,
2142
+ name: F,
2143
+ disabled: _,
2144
+ ...L,
2143
2145
  children: n
2144
2146
  }
2145
2147
  );
@@ -2172,7 +2174,7 @@ const Wt = Jt(null), Ht = () => {
2172
2174
  }),
2173
2175
  [n, r, i, u, f]
2174
2176
  );
2175
- return /* @__PURE__ */ j(Wt, { value: m, children: e });
2177
+ return /* @__PURE__ */ q(Wt, { value: m, children: e });
2176
2178
  }, lr = ({
2177
2179
  children: e,
2178
2180
  ref: t
@@ -2180,7 +2182,7 @@ const Wt = Jt(null), Ht = () => {
2180
2182
  const { refs: n, getReferenceProps: o } = Ht(), r = (i) => {
2181
2183
  n.setReference(i), t && (typeof t == "function" ? t(i) : t.current = i);
2182
2184
  };
2183
- return /* @__PURE__ */ j(
2185
+ return /* @__PURE__ */ q(
2184
2186
  Ue,
2185
2187
  {
2186
2188
  as: "span",
@@ -2201,7 +2203,7 @@ const Wt = Jt(null), Ht = () => {
2201
2203
  const l = (a) => {
2202
2204
  i.setFloating(a), n && (typeof n == "function" ? n(a) : n.current = a);
2203
2205
  };
2204
- return /* @__PURE__ */ j(Xo, { children: /* @__PURE__ */ j(
2206
+ return /* @__PURE__ */ q(Xo, { children: /* @__PURE__ */ q(
2205
2207
  Ue,
2206
2208
  {
2207
2209
  ...o,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pittorica/popover-react",
3
- "version": "0.23.1",
3
+ "version": "0.23.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -11,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "@floating-ui/react": "^0.27.17",
13
13
  "clsx": "^2.1.1",
14
- "@pittorica/box-react": "0.23.1"
14
+ "@pittorica/box-react": "0.23.2"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@tabler/icons-react": "^3.36.1",
@@ -25,12 +25,12 @@
25
25
  "typescript": "^5.0.0",
26
26
  "vite": "^5.0.0",
27
27
  "vitest": "^2.1.9",
28
- "@pittorica/button-react": "0.23.1",
29
- "@pittorica/flex-react": "0.23.1",
30
- "@pittorica/icon-button-react": "0.23.1",
31
- "@pittorica/text-react": "0.23.1",
32
- "@pittorica/theme-react": "0.23.1",
33
- "pittorica": "0.23.1"
28
+ "@pittorica/button-react": "0.23.2",
29
+ "@pittorica/flex-react": "0.23.2",
30
+ "@pittorica/icon-button-react": "0.23.2",
31
+ "@pittorica/text-react": "0.23.2",
32
+ "@pittorica/theme-react": "0.23.2",
33
+ "pittorica": "0.23.2"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "react": ">=19",