@purpurds/modal 5.34.4 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/modal.es.js CHANGED
@@ -181,7 +181,7 @@ Re.displayName = "Slot";
181
181
  const Pe = /* @__PURE__ */ x((e, n) => {
182
182
  const { children: t, ...o } = e;
183
183
  return /* @__PURE__ */ B(t) ? /* @__PURE__ */ ae(t, {
184
- ...Xt(o, t.props),
184
+ ...Kt(o, t.props),
185
185
  ref: n ? at(n, t.ref) : t.ref
186
186
  }) : L.count(t) > 1 ? L.only(null) : null;
187
187
  });
@@ -190,7 +190,7 @@ const Ht = ({ children: e }) => /* @__PURE__ */ _(Le, null, e);
190
190
  function Vt(e) {
191
191
  return /* @__PURE__ */ B(e) && e.type === Ht;
192
192
  }
193
- function Xt(e, n) {
193
+ function Kt(e, n) {
194
194
  const t = {
195
195
  ...n
196
196
  };
@@ -211,7 +211,7 @@ function Xt(e, n) {
211
211
  ...t
212
212
  };
213
213
  }
214
- const Kt = [
214
+ const Xt = [
215
215
  "a",
216
216
  "button",
217
217
  "div",
@@ -228,7 +228,7 @@ const Kt = [
228
228
  "span",
229
229
  "svg",
230
230
  "ul"
231
- ], U = Kt.reduce((e, n) => {
231
+ ], U = Xt.reduce((e, n) => {
232
232
  const t = /* @__PURE__ */ x((o, a) => {
233
233
  const { asChild: r, ...u } = o, i = r ? Re : n;
234
234
  return A(() => {
@@ -926,13 +926,13 @@ var Pn = function() {
926
926
  `).concat(gn, ": ").concat(i, `px;
927
927
  }
928
928
  `);
929
- }, Xe = function() {
929
+ }, Ke = function() {
930
930
  var e = parseInt(document.body.getAttribute(Y) || "0", 10);
931
931
  return isFinite(e) ? e : 0;
932
932
  }, Mn = function() {
933
933
  m.useEffect(function() {
934
- return document.body.setAttribute(Y, (Xe() + 1).toString()), function() {
935
- var e = Xe() - 1;
934
+ return document.body.setAttribute(Y, (Ke() + 1).toString()), function() {
935
+ var e = Ke() - 1;
936
936
  e <= 0 ? document.body.removeAttribute(Y) : document.body.setAttribute(Y, e.toString());
937
937
  };
938
938
  }, []);
@@ -955,7 +955,7 @@ if (typeof window < "u")
955
955
  } catch {
956
956
  Te = !1;
957
957
  }
958
- var X = Te ? { passive: !1 } : !1, Fn = function(e) {
958
+ var K = Te ? { passive: !1 } : !1, Fn = function(e) {
959
959
  return e.tagName === "TEXTAREA";
960
960
  }, pt = function(e, n) {
961
961
  var t = window.getComputedStyle(e);
@@ -968,7 +968,7 @@ var X = Te ? { passive: !1 } : !1, Fn = function(e) {
968
968
  return pt(e, "overflowY");
969
969
  }, qn = function(e) {
970
970
  return pt(e, "overflowX");
971
- }, Ke = function(e, n) {
971
+ }, Xe = function(e, n) {
972
972
  var t = n;
973
973
  do {
974
974
  typeof ShadowRoot < "u" && t instanceof ShadowRoot && (t = t.host);
@@ -1025,9 +1025,9 @@ var X = Te ? { passive: !1 } : !1, Fn = function(e) {
1025
1025
  .block-interactivity-`.concat(e, ` {pointer-events: none;}
1026
1026
  .allow-interactivity-`).concat(e, ` {pointer-events: all;}
1027
1027
  `);
1028
- }, Xn = 0, K = [];
1029
- function Kn(e) {
1030
- var n = m.useRef([]), t = m.useRef([0, 0]), o = m.useRef(), a = m.useState(Xn++)[0], r = m.useState(function() {
1028
+ }, Kn = 0, X = [];
1029
+ function Xn(e) {
1030
+ var n = m.useRef([]), t = m.useRef([0, 0]), o = m.useRef(), a = m.useState(Kn++)[0], r = m.useState(function() {
1031
1031
  return dt();
1032
1032
  })[0], u = m.useRef(e);
1033
1033
  m.useEffect(function() {
@@ -1051,10 +1051,10 @@ function Kn(e) {
1051
1051
  var g = se(c), C = t.current, y = "deltaX" in c ? c.deltaX : C[0] - g[0], $ = "deltaY" in c ? c.deltaY : C[1] - g[1], S, W = c.target, D = Math.abs(y) > Math.abs($) ? "h" : "v";
1052
1052
  if ("touches" in c && D === "h" && W.type === "range")
1053
1053
  return !1;
1054
- var E = Ke(D, W);
1054
+ var E = Xe(D, W);
1055
1055
  if (!E)
1056
1056
  return !0;
1057
- if (E ? S = D : (S = D === "v" ? "h" : "v", E = Ke(D, W)), !E)
1057
+ if (E ? S = D : (S = D === "v" ? "h" : "v", E = Xe(D, W)), !E)
1058
1058
  return !1;
1059
1059
  if (!o.current && "changedTouches" in c && (y || $) && (o.current = S), !S)
1060
1060
  return !0;
@@ -1062,7 +1062,7 @@ function Kn(e) {
1062
1062
  return zn(I, h, c, I === "h" ? y : $);
1063
1063
  }, []), s = m.useCallback(function(c) {
1064
1064
  var h = c;
1065
- if (!(!K.length || K[K.length - 1] !== r)) {
1065
+ if (!(!X.length || X[X.length - 1] !== r)) {
1066
1066
  var g = "deltaY" in h ? Ge(h) : se(h), C = n.current.filter(function(S) {
1067
1067
  return S.name === h.type && S.target === h.target && Hn(S.delta, g);
1068
1068
  })[0];
@@ -1092,14 +1092,14 @@ function Kn(e) {
1092
1092
  d(c.type, se(c), c.target, i(c, e.lockRef.current));
1093
1093
  }, []);
1094
1094
  m.useEffect(function() {
1095
- return K.push(r), e.setCallbacks({
1095
+ return X.push(r), e.setCallbacks({
1096
1096
  onScrollCapture: l,
1097
1097
  onWheelCapture: l,
1098
1098
  onTouchMoveCapture: f
1099
- }), document.addEventListener("wheel", s, X), document.addEventListener("touchmove", s, X), document.addEventListener("touchstart", p, X), function() {
1100
- K = K.filter(function(c) {
1099
+ }), document.addEventListener("wheel", s, K), document.addEventListener("touchmove", s, K), document.addEventListener("touchstart", p, K), function() {
1100
+ X = X.filter(function(c) {
1101
1101
  return c !== r;
1102
- }), document.removeEventListener("wheel", s, X), document.removeEventListener("touchmove", s, X), document.removeEventListener("touchstart", p, X);
1102
+ }), document.removeEventListener("wheel", s, K), document.removeEventListener("touchmove", s, K), document.removeEventListener("touchstart", p, K);
1103
1103
  };
1104
1104
  }, []);
1105
1105
  var v = e.removeScrollBar, w = e.inert;
@@ -1110,7 +1110,7 @@ function Kn(e) {
1110
1110
  v ? m.createElement(kn, { gapMode: "margin" }) : null
1111
1111
  );
1112
1112
  }
1113
- const Gn = Sn(lt, Kn);
1113
+ const Gn = Sn(lt, Xn);
1114
1114
  var ht = m.forwardRef(function(e, n) {
1115
1115
  return m.createElement(_e, k({}, e, { ref: n, sideCar: Gn }));
1116
1116
  });
@@ -1683,20 +1683,7 @@ const Wr = /* @__PURE__ */ Br(Ur), zr = {
1683
1683
  "purpur-icon--md": "_purpur-icon--md_8u1lq_16",
1684
1684
  "purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
1685
1685
  "purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
1686
- }, Hr = {
1687
- name: "close",
1688
- svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.864 4.864a.9.9 0 0 1 1.273 0L12 10.727l5.864-5.863a.9.9 0 0 1 1.272 1.272L13.273 12l5.863 5.864a.9.9 0 1 1-1.272 1.272L12 13.273l-5.863 5.863a.9.9 0 0 1-1.273-1.272L10.727 12 4.864 6.136a.9.9 0 0 1 0-1.272Z" clip-rule="evenodd"/></svg>',
1689
- keywords: ["close"],
1690
- category: "utility"
1691
- }, Ot = (e) => /* @__PURE__ */ b(
1692
- Nt,
1693
- {
1694
- ...e,
1695
- svg: Hr
1696
- }
1697
- );
1698
- Ot.displayName = "IconClose";
1699
- const Vr = Wr.bind(zr), Je = "purpur-icon", Xr = "md", Kr = (e) => e.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), Gr = ({ content: e = "", title: n } = {}) => {
1686
+ }, Hr = Wr.bind(zr), Je = "purpur-icon", Vr = "md", Kr = (e) => e.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), Xr = ({ content: e = "", title: n } = {}) => {
1700
1687
  const t = [
1701
1688
  { name: "xmlns", value: "http://www.w3.org/2000/svg" },
1702
1689
  { name: "fill", value: "currentColor" },
@@ -1704,18 +1691,18 @@ const Vr = Wr.bind(zr), Je = "purpur-icon", Xr = "md", Kr = (e) => e.filter((n)
1704
1691
  n ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
1705
1692
  ], o = n ? `<title>${n}</title>` : "";
1706
1693
  return `<svg ${Kr(t)}>${o}${e}</svg>`;
1707
- }, Yr = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), Nt = ({
1694
+ }, Gr = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), Ot = ({
1708
1695
  ["data-testid"]: e,
1709
1696
  svg: n,
1710
1697
  allyTitle: t,
1711
1698
  className: o,
1712
- size: a = Xr,
1699
+ size: a = Vr,
1713
1700
  ...r
1714
1701
  }) => {
1715
- const u = Gr({
1716
- content: Yr(n.svg),
1702
+ const u = Xr({
1703
+ content: Gr(n.svg),
1717
1704
  title: t
1718
- }), i = Vr(o, Je, `${Je}--${a}`);
1705
+ }), i = Hr(o, Je, `${Je}--${a}`);
1719
1706
  return /* @__PURE__ */ b(
1720
1707
  "span",
1721
1708
  {
@@ -1727,7 +1714,14 @@ const Vr = Wr.bind(zr), Je = "purpur-icon", Xr = "md", Kr = (e) => e.filter((n)
1727
1714
  }
1728
1715
  );
1729
1716
  };
1730
- Nt.displayName = "Icon";
1717
+ Ot.displayName = "Icon";
1718
+ const Yr = {
1719
+ name: "close",
1720
+ svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.864 4.864a.9.9 0 0 1 1.273 0L12 10.727l5.864-5.863a.9.9 0 0 1 1.272 1.272L13.273 12l5.863 5.864a.9.9 0 1 1-1.272 1.272L12 13.273l-5.863 5.863a.9.9 0 0 1-1.273-1.272L10.727 12 4.864 6.136a.9.9 0 0 1 0-1.272Z" clip-rule="evenodd"/></svg>',
1721
+ keywords: ["close"],
1722
+ category: "utility"
1723
+ }, Nt = (e) => /* @__PURE__ */ b(Ot, { ...e, svg: Yr });
1724
+ Nt.displayName = "IconClose";
1731
1725
  function Zr(e) {
1732
1726
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1733
1727
  }
@@ -2131,7 +2125,7 @@ const vo = /* @__PURE__ */ po(fo), ho = "_fadeIn_1ifm3_1", mo = {
2131
2125
  "aria-label": e,
2132
2126
  className: T(`${O}__close-button`),
2133
2127
  "data-testid": t,
2134
- children: /* @__PURE__ */ b(Ot, {})
2128
+ children: /* @__PURE__ */ b(Nt, {})
2135
2129
  }
2136
2130
  ) }), _o = 3, nt = ({
2137
2131
  actions: e,