@purpurds/modal 7.10.1 → 7.12.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
@@ -9,7 +9,7 @@ function L(e, t, { checkForDefaultPrevented: r = !0 } = {}) {
9
9
  return t == null ? void 0 : t(a);
10
10
  };
11
11
  }
12
- function Me(e, t) {
12
+ function $e(e, t) {
13
13
  if (typeof e == "function")
14
14
  return e(t);
15
15
  e != null && (e.current = t);
@@ -18,19 +18,19 @@ function lt(...e) {
18
18
  return (t) => {
19
19
  let r = !1;
20
20
  const o = e.map((a) => {
21
- const n = Me(a, t);
21
+ const n = $e(a, t);
22
22
  return !r && typeof n == "function" && (r = !0), n;
23
23
  });
24
24
  if (r)
25
25
  return () => {
26
26
  for (let a = 0; a < o.length; a++) {
27
27
  const n = o[a];
28
- typeof n == "function" ? n() : Me(e[a], null);
28
+ typeof n == "function" ? n() : $e(e[a], null);
29
29
  }
30
30
  };
31
31
  };
32
32
  }
33
- function q(...e) {
33
+ function B(...e) {
34
34
  return s.useCallback(lt(...e), e);
35
35
  }
36
36
  function tr(e, t) {
@@ -106,7 +106,7 @@ function le(e) {
106
106
  r((o) => o ?? String(ar++));
107
107
  }, [e]), e || (t ? `radix-${t}` : "");
108
108
  }
109
- function F(e) {
109
+ function k(e) {
110
110
  const t = s.useRef(e);
111
111
  return s.useEffect(() => {
112
112
  t.current = e;
@@ -121,7 +121,7 @@ function ir({
121
121
  onChange: r = () => {
122
122
  }
123
123
  }) {
124
- const [o, a] = ur({ defaultProp: t, onChange: r }), n = e !== void 0, i = n ? e : o, u = F(r), p = s.useCallback(
124
+ const [o, a] = ur({ defaultProp: t, onChange: r }), n = e !== void 0, i = n ? e : o, u = k(r), p = s.useCallback(
125
125
  (l) => {
126
126
  if (n) {
127
127
  const v = typeof l == "function" ? l(e) : l;
@@ -137,7 +137,7 @@ function ur({
137
137
  defaultProp: e,
138
138
  onChange: t
139
139
  }) {
140
- const r = s.useState(e), [o] = r, a = s.useRef(o), n = F(t);
140
+ const r = s.useState(e), [o] = r, a = s.useRef(o), n = k(t);
141
141
  return s.useEffect(() => {
142
142
  a.current !== o && (n(o), a.current = o);
143
143
  }, [o, a, n]), r;
@@ -196,7 +196,7 @@ var pr = [
196
196
  "span",
197
197
  "svg",
198
198
  "ul"
199
- ], $ = pr.reduce((e, t) => {
199
+ ], M = pr.reduce((e, t) => {
200
200
  const r = s.forwardRef((o, a) => {
201
201
  const { asChild: n, ...i } = o, u = n ? Oe : t;
202
202
  return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ d(u, { ...i, ref: a });
@@ -207,7 +207,7 @@ function fr(e, t) {
207
207
  e && Jt.flushSync(() => e.dispatchEvent(t));
208
208
  }
209
209
  function vr(e, t = globalThis == null ? void 0 : globalThis.document) {
210
- const r = F(e);
210
+ const r = k(e);
211
211
  s.useEffect(() => {
212
212
  const o = (a) => {
213
213
  a.key === "Escape" && r(a);
@@ -215,7 +215,7 @@ function vr(e, t = globalThis == null ? void 0 : globalThis.document) {
215
215
  return t.addEventListener("keydown", o, { capture: !0 }), () => t.removeEventListener("keydown", o, { capture: !0 });
216
216
  }, [r, t]);
217
217
  }
218
- var hr = "DismissableLayer", Ce = "dismissableLayer.update", mr = "dismissableLayer.pointerDownOutside", gr = "dismissableLayer.focusOutside", $e, dt = s.createContext({
218
+ var hr = "DismissableLayer", Ce = "dismissableLayer.update", mr = "dismissableLayer.pointerDownOutside", gr = "dismissableLayer.focusOutside", Me, dt = s.createContext({
219
219
  layers: /* @__PURE__ */ new Set(),
220
220
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
221
221
  branches: /* @__PURE__ */ new Set()
@@ -229,7 +229,7 @@ var hr = "DismissableLayer", Ce = "dismissableLayer.update", mr = "dismissableLa
229
229
  onInteractOutside: i,
230
230
  onDismiss: u,
231
231
  ...p
232
- } = e, l = s.useContext(dt), [f, v] = s.useState(null), h = (f == null ? void 0 : f.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, g] = s.useState({}), b = q(t, (y) => v(y)), c = Array.from(l.layers), [m] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), _ = c.indexOf(m), S = f ? c.indexOf(f) : -1, w = l.layersWithOutsidePointerEventsDisabled.size > 0, E = S >= _, C = br((y) => {
232
+ } = e, l = s.useContext(dt), [f, v] = s.useState(null), h = (f == null ? void 0 : f.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, g] = s.useState({}), b = B(t, (y) => v(y)), c = Array.from(l.layers), [m] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), _ = c.indexOf(m), S = f ? c.indexOf(f) : -1, w = l.layersWithOutsidePointerEventsDisabled.size > 0, E = S >= _, C = br((y) => {
233
233
  const x = y.target, R = [...l.branches].some((z) => z.contains(x));
234
234
  !E || R || (a == null || a(y), i == null || i(y), y.defaultPrevented || u == null || u());
235
235
  }, h), P = wr((y) => {
@@ -240,8 +240,8 @@ var hr = "DismissableLayer", Ce = "dismissableLayer.update", mr = "dismissableLa
240
240
  S === l.layers.size - 1 && (o == null || o(y), !y.defaultPrevented && u && (y.preventDefault(), u()));
241
241
  }, h), s.useEffect(() => {
242
242
  if (f)
243
- return r && (l.layersWithOutsidePointerEventsDisabled.size === 0 && ($e = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), l.layersWithOutsidePointerEventsDisabled.add(f)), l.layers.add(f), Ie(), () => {
244
- r && l.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = $e);
243
+ return r && (l.layersWithOutsidePointerEventsDisabled.size === 0 && (Me = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), l.layersWithOutsidePointerEventsDisabled.add(f)), l.layers.add(f), Ie(), () => {
244
+ r && l.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = Me);
245
245
  };
246
246
  }, [f, h, r, l]), s.useEffect(() => () => {
247
247
  f && (l.layers.delete(f), l.layersWithOutsidePointerEventsDisabled.delete(f), Ie());
@@ -249,7 +249,7 @@ var hr = "DismissableLayer", Ce = "dismissableLayer.update", mr = "dismissableLa
249
249
  const y = () => g({});
250
250
  return document.addEventListener(Ce, y), () => document.removeEventListener(Ce, y);
251
251
  }, []), /* @__PURE__ */ d(
252
- $.div,
252
+ M.div,
253
253
  {
254
254
  ...p,
255
255
  ref: b,
@@ -269,18 +269,18 @@ var hr = "DismissableLayer", Ce = "dismissableLayer.update", mr = "dismissableLa
269
269
  );
270
270
  pt.displayName = hr;
271
271
  var _r = "DismissableLayerBranch", yr = s.forwardRef((e, t) => {
272
- const r = s.useContext(dt), o = s.useRef(null), a = q(t, o);
272
+ const r = s.useContext(dt), o = s.useRef(null), a = B(t, o);
273
273
  return s.useEffect(() => {
274
274
  const n = o.current;
275
275
  if (n)
276
276
  return r.branches.add(n), () => {
277
277
  r.branches.delete(n);
278
278
  };
279
- }, [r.branches]), /* @__PURE__ */ d($.div, { ...e, ref: a });
279
+ }, [r.branches]), /* @__PURE__ */ d(M.div, { ...e, ref: a });
280
280
  });
281
281
  yr.displayName = _r;
282
282
  function br(e, t = globalThis == null ? void 0 : globalThis.document) {
283
- const r = F(e), o = s.useRef(!1), a = s.useRef(() => {
283
+ const r = k(e), o = s.useRef(!1), a = s.useRef(() => {
284
284
  });
285
285
  return s.useEffect(() => {
286
286
  const n = (u) => {
@@ -310,7 +310,7 @@ function br(e, t = globalThis == null ? void 0 : globalThis.document) {
310
310
  };
311
311
  }
312
312
  function wr(e, t = globalThis == null ? void 0 : globalThis.document) {
313
- const r = F(e), o = s.useRef(!1);
313
+ const r = k(e), o = s.useRef(!1);
314
314
  return s.useEffect(() => {
315
315
  const a = (n) => {
316
316
  n.target && !o.current && ft(gr, r, { originalEvent: n }, {
@@ -338,7 +338,7 @@ var de = "focusScope.autoFocusOnMount", pe = "focusScope.autoFocusOnUnmount", Le
338
338
  onMountAutoFocus: a,
339
339
  onUnmountAutoFocus: n,
340
340
  ...i
341
- } = e, [u, p] = s.useState(null), l = F(a), f = F(n), v = s.useRef(null), h = q(t, (c) => p(c)), g = s.useRef({
341
+ } = e, [u, p] = s.useState(null), l = k(a), f = k(n), v = s.useRef(null), h = B(t, (c) => p(c)), g = s.useRef({
342
342
  paused: !1,
343
343
  pause() {
344
344
  this.paused = !0;
@@ -370,7 +370,7 @@ var de = "focusScope.autoFocusOnMount", pe = "focusScope.autoFocusOnUnmount", Le
370
370
  }
371
371
  }, [o, u, g.paused]), s.useEffect(() => {
372
372
  if (u) {
373
- Fe.add(g);
373
+ ke.add(g);
374
374
  const c = document.activeElement;
375
375
  if (!u.contains(c)) {
376
376
  const _ = new CustomEvent(de, Le);
@@ -379,7 +379,7 @@ var de = "focusScope.autoFocusOnMount", pe = "focusScope.autoFocusOnUnmount", Le
379
379
  return () => {
380
380
  u.removeEventListener(de, l), setTimeout(() => {
381
381
  const _ = new CustomEvent(pe, Le);
382
- u.addEventListener(pe, f), u.dispatchEvent(_), _.defaultPrevented || I(c ?? document.body, { select: !0 }), u.removeEventListener(pe, f), Fe.remove(g);
382
+ u.addEventListener(pe, f), u.dispatchEvent(_), _.defaultPrevented || I(c ?? document.body, { select: !0 }), u.removeEventListener(pe, f), ke.remove(g);
383
383
  }, 0);
384
384
  };
385
385
  }
@@ -395,7 +395,7 @@ var de = "focusScope.autoFocusOnMount", pe = "focusScope.autoFocusOnUnmount", Le
395
395
  },
396
396
  [r, o, g.paused]
397
397
  );
398
- return /* @__PURE__ */ d($.div, { tabIndex: -1, ...i, ref: h, onKeyDown: b });
398
+ return /* @__PURE__ */ d(M.div, { tabIndex: -1, ...i, ref: h, onKeyDown: b });
399
399
  });
400
400
  vt.displayName = Er;
401
401
  function Cr(e, { select: t = !1 } = {}) {
@@ -404,7 +404,7 @@ function Cr(e, { select: t = !1 } = {}) {
404
404
  if (I(o, { select: t }), document.activeElement !== r) return;
405
405
  }
406
406
  function Sr(e) {
407
- const t = ht(e), r = ke(t, e), o = ke(t.reverse(), e);
407
+ const t = ht(e), r = Fe(t, e), o = Fe(t.reverse(), e);
408
408
  return [r, o];
409
409
  }
410
410
  function ht(e) {
@@ -417,7 +417,7 @@ function ht(e) {
417
417
  for (; r.nextNode(); ) t.push(r.currentNode);
418
418
  return t;
419
419
  }
420
- function ke(e, t) {
420
+ function Fe(e, t) {
421
421
  for (const r of e)
422
422
  if (!Nr(r, { upTo: t })) return r;
423
423
  }
@@ -439,7 +439,7 @@ function I(e, { select: t = !1 } = {}) {
439
439
  e.focus({ preventScroll: !0 }), e !== r && Pr(e) && t && e.select();
440
440
  }
441
441
  }
442
- var Fe = Or();
442
+ var ke = Or();
443
443
  function Or() {
444
444
  let e = [];
445
445
  return {
@@ -465,14 +465,14 @@ var xr = "Portal", mt = s.forwardRef((e, t) => {
465
465
  const { container: r, ...o } = e, [a, n] = s.useState(!1);
466
466
  ie(() => n(!0), []);
467
467
  const i = r || a && ((u = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : u.body);
468
- return i ? er.createPortal(/* @__PURE__ */ d($.div, { ...o, ref: t }), i) : null;
468
+ return i ? er.createPortal(/* @__PURE__ */ d(M.div, { ...o, ref: t }), i) : null;
469
469
  });
470
470
  mt.displayName = xr;
471
471
  function Ar(e, t) {
472
472
  return s.useReducer((r, o) => t[r][o] ?? r, e);
473
473
  }
474
474
  var se = (e) => {
475
- const { present: t, children: r } = e, o = Dr(t), a = typeof r == "function" ? r({ present: o.isPresent }) : s.Children.only(r), n = q(o.ref, Tr(a));
475
+ const { present: t, children: r } = e, o = Dr(t), a = typeof r == "function" ? r({ present: o.isPresent }) : s.Children.only(r), n = B(o.ref, Tr(a));
476
476
  return typeof r == "function" || o.isPresent ? s.cloneElement(a, { ref: n }) : null;
477
477
  };
478
478
  se.displayName = "Presence";
@@ -534,26 +534,26 @@ function Tr(e) {
534
534
  return r ? e.ref : (t = (a = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : a.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
535
535
  }
536
536
  var fe = 0;
537
- function Mr() {
537
+ function $r() {
538
538
  s.useEffect(() => {
539
539
  const e = document.querySelectorAll("[data-radix-focus-guard]");
540
- return document.body.insertAdjacentElement("afterbegin", e[0] ?? qe()), document.body.insertAdjacentElement("beforeend", e[1] ?? qe()), fe++, () => {
540
+ return document.body.insertAdjacentElement("afterbegin", e[0] ?? Be()), document.body.insertAdjacentElement("beforeend", e[1] ?? Be()), fe++, () => {
541
541
  fe === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), fe--;
542
542
  };
543
543
  }, []);
544
544
  }
545
- function qe() {
545
+ function Be() {
546
546
  const e = document.createElement("span");
547
547
  return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
548
548
  }
549
- var M = function() {
550
- return M = Object.assign || function(t) {
549
+ var $ = function() {
550
+ return $ = Object.assign || function(t) {
551
551
  for (var r, o = 1, a = arguments.length; o < a; o++) {
552
552
  r = arguments[o];
553
553
  for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && (t[n] = r[n]);
554
554
  }
555
555
  return t;
556
- }, M.apply(this, arguments);
556
+ }, $.apply(this, arguments);
557
557
  };
558
558
  function gt(e, t) {
559
559
  var r = {};
@@ -563,7 +563,7 @@ function gt(e, t) {
563
563
  t.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (r[o[a]] = e[o[a]]);
564
564
  return r;
565
565
  }
566
- function $r(e, t, r) {
566
+ function Mr(e, t, r) {
567
567
  if (r || arguments.length === 2) for (var o = 0, a = t.length, n; o < a; o++)
568
568
  (n || !(o in t)) && (n || (n = Array.prototype.slice.call(t, 0, o)), n[o] = t[o]);
569
569
  return e.concat(n || Array.prototype.slice.call(t));
@@ -572,7 +572,7 @@ var ne = "right-scroll-bar-position", oe = "width-before-scroll-bar", Ir = "with
572
572
  function ve(e, t) {
573
573
  return typeof e == "function" ? e(t) : e && (e.current = t), e;
574
574
  }
575
- function kr(e, t) {
575
+ function Fr(e, t) {
576
576
  var r = ye(function() {
577
577
  return {
578
578
  // value
@@ -593,15 +593,15 @@ function kr(e, t) {
593
593
  })[0];
594
594
  return r.callback = t, r.facade;
595
595
  }
596
- var Fr = typeof window < "u" ? s.useLayoutEffect : s.useEffect, Be = /* @__PURE__ */ new WeakMap();
596
+ var kr = typeof window < "u" ? s.useLayoutEffect : s.useEffect, je = /* @__PURE__ */ new WeakMap();
597
597
  function Wr(e, t) {
598
- var r = kr(null, function(o) {
598
+ var r = Fr(null, function(o) {
599
599
  return e.forEach(function(a) {
600
600
  return ve(a, o);
601
601
  });
602
602
  });
603
- return Fr(function() {
604
- var o = Be.get(r);
603
+ return kr(function() {
604
+ var o = je.get(r);
605
605
  if (o) {
606
606
  var a = new Set(o), n = new Set(e), i = r.current;
607
607
  a.forEach(function(u) {
@@ -610,14 +610,14 @@ function Wr(e, t) {
610
610
  a.has(u) || ve(u, i);
611
611
  });
612
612
  }
613
- Be.set(r, e);
613
+ je.set(r, e);
614
614
  }, [e]), r;
615
615
  }
616
- function qr(e) {
616
+ function Br(e) {
617
617
  return e;
618
618
  }
619
- function Br(e, t) {
620
- t === void 0 && (t = qr);
619
+ function jr(e, t) {
620
+ t === void 0 && (t = Br);
621
621
  var r = [], o = !1, a = {
622
622
  read: function() {
623
623
  if (o)
@@ -671,10 +671,10 @@ function Br(e, t) {
671
671
  };
672
672
  return a;
673
673
  }
674
- function jr(e) {
674
+ function qr(e) {
675
675
  e === void 0 && (e = {});
676
- var t = Br(null);
677
- return t.options = M({ async: !0, ssr: !1 }, e), t;
676
+ var t = jr(null);
677
+ return t.options = $({ async: !0, ssr: !1 }, e), t;
678
678
  }
679
679
  var _t = function(e) {
680
680
  var t = e.sideCar, r = gt(e, ["sideCar"]);
@@ -683,24 +683,24 @@ var _t = function(e) {
683
683
  var o = t.read();
684
684
  if (!o)
685
685
  throw new Error("Sidecar medium not found");
686
- return s.createElement(o, M({}, r));
686
+ return s.createElement(o, $({}, r));
687
687
  };
688
688
  _t.isSideCarExport = !0;
689
689
  function Ur(e, t) {
690
690
  return e.useMedium(t), _t;
691
691
  }
692
- var yt = jr(), he = function() {
692
+ var yt = qr(), he = function() {
693
693
  }, ce = s.forwardRef(function(e, t) {
694
694
  var r = s.useRef(null), o = s.useState({
695
695
  onScrollCapture: he,
696
696
  onWheelCapture: he,
697
697
  onTouchMoveCapture: he
698
- }), a = o[0], n = o[1], i = e.forwardProps, u = e.children, p = e.className, l = e.removeScrollBar, f = e.enabled, v = e.shards, h = e.sideCar, g = e.noIsolation, b = e.inert, c = e.allowPinchZoom, m = e.as, _ = m === void 0 ? "div" : m, S = e.gapMode, w = gt(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), E = h, C = Wr([r, t]), P = M(M({}, w), a);
698
+ }), a = o[0], n = o[1], i = e.forwardProps, u = e.children, p = e.className, l = e.removeScrollBar, f = e.enabled, v = e.shards, h = e.sideCar, g = e.noIsolation, b = e.inert, c = e.allowPinchZoom, m = e.as, _ = m === void 0 ? "div" : m, S = e.gapMode, w = gt(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), E = h, C = Wr([r, t]), P = $($({}, w), a);
699
699
  return s.createElement(
700
700
  s.Fragment,
701
701
  null,
702
702
  f && s.createElement(E, { sideCar: yt, removeScrollBar: l, shards: v, noIsolation: g, inert: b, setCallbacks: n, allowPinchZoom: !!c, lockRef: r, gapMode: S }),
703
- i ? s.cloneElement(s.Children.only(u), M(M({}, P), { ref: C })) : s.createElement(_, M({}, P, { className: p, ref: C }), u)
703
+ i ? s.cloneElement(s.Children.only(u), $($({}, P), { ref: C })) : s.createElement(_, $({}, P, { className: p, ref: C }), u)
704
704
  );
705
705
  });
706
706
  ce.defaultProps = {
@@ -820,13 +820,13 @@ var Gr = function() {
820
820
  `).concat(Lr, ": ").concat(u, `px;
821
821
  }
822
822
  `);
823
- }, je = function() {
823
+ }, qe = function() {
824
824
  var e = parseInt(document.body.getAttribute(H) || "0", 10);
825
825
  return isFinite(e) ? e : 0;
826
826
  }, tn = function() {
827
827
  s.useEffect(function() {
828
- return document.body.setAttribute(H, (je() + 1).toString()), function() {
829
- var e = je() - 1;
828
+ return document.body.setAttribute(H, (qe() + 1).toString()), function() {
829
+ var e = qe() - 1;
830
830
  e <= 0 ? document.body.removeAttribute(H) : document.body.setAttribute(H, e.toString());
831
831
  };
832
832
  }, []);
@@ -849,7 +849,7 @@ if (typeof window < "u")
849
849
  } catch {
850
850
  Se = !1;
851
851
  }
852
- var j = Se ? { passive: !1 } : !1, nn = function(e) {
852
+ var q = Se ? { passive: !1 } : !1, nn = function(e) {
853
853
  return e.tagName === "TEXTAREA";
854
854
  }, wt = function(e, t) {
855
855
  if (!(e instanceof Element))
@@ -929,7 +929,7 @@ function vn(e) {
929
929
  }, [e]), s.useEffect(function() {
930
930
  if (e.inert) {
931
931
  document.body.classList.add("block-interactivity-".concat(a));
932
- var c = $r([e.lockRef.current], (e.shards || []).map(He), !0).filter(Boolean);
932
+ var c = Mr([e.lockRef.current], (e.shards || []).map(He), !0).filter(Boolean);
933
933
  return c.forEach(function(m) {
934
934
  return m.classList.add("allow-interactivity-".concat(a));
935
935
  }), function() {
@@ -990,10 +990,10 @@ function vn(e) {
990
990
  onScrollCapture: v,
991
991
  onWheelCapture: v,
992
992
  onTouchMoveCapture: h
993
- }), document.addEventListener("wheel", p, j), document.addEventListener("touchmove", p, j), document.addEventListener("touchstart", f, j), function() {
993
+ }), document.addEventListener("wheel", p, q), document.addEventListener("touchmove", p, q), document.addEventListener("touchstart", f, q), function() {
994
994
  U = U.filter(function(c) {
995
995
  return c !== n;
996
- }), document.removeEventListener("wheel", p, j), document.removeEventListener("touchmove", p, j), document.removeEventListener("touchstart", f, j);
996
+ }), document.removeEventListener("wheel", p, q), document.removeEventListener("touchmove", p, q), document.removeEventListener("touchstart", f, q);
997
997
  };
998
998
  }, []);
999
999
  var g = e.removeScrollBar, b = e.inert;
@@ -1011,7 +1011,7 @@ function hn(e) {
1011
1011
  }
1012
1012
  const mn = Ur(yt, vn);
1013
1013
  var St = s.forwardRef(function(e, t) {
1014
- return s.createElement(ce, M({}, e, { ref: t, sideCar: mn }));
1014
+ return s.createElement(ce, $({}, e, { ref: t, sideCar: mn }));
1015
1015
  });
1016
1016
  St.classNames = ce.classNames;
1017
1017
  var gn = function(e) {
@@ -1095,9 +1095,9 @@ var gn = function(e) {
1095
1095
  Ot.displayName = Re;
1096
1096
  var Rt = "DialogTrigger", xt = s.forwardRef(
1097
1097
  (e, t) => {
1098
- const { __scopeDialog: r, ...o } = e, a = A(Rt, r), n = q(t, a.triggerRef);
1098
+ const { __scopeDialog: r, ...o } = e, a = A(Rt, r), n = B(t, a.triggerRef);
1099
1099
  return /* @__PURE__ */ d(
1100
- $.button,
1100
+ M.button,
1101
1101
  {
1102
1102
  type: "button",
1103
1103
  "aria-haspopup": "dialog",
@@ -1133,7 +1133,7 @@ var Cn = s.forwardRef(
1133
1133
  // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
1134
1134
  // ie. when `Overlay` and `Content` are siblings
1135
1135
  /* @__PURE__ */ d(St, { as: Oe, allowPinchZoom: !0, shards: [a.contentRef], children: /* @__PURE__ */ d(
1136
- $.div,
1136
+ M.div,
1137
1137
  {
1138
1138
  "data-state": De(a.open),
1139
1139
  ...o,
@@ -1143,21 +1143,21 @@ var Cn = s.forwardRef(
1143
1143
  ) })
1144
1144
  );
1145
1145
  }
1146
- ), W = "DialogContent", Mt = s.forwardRef(
1146
+ ), W = "DialogContent", $t = s.forwardRef(
1147
1147
  (e, t) => {
1148
1148
  const r = At(W, e.__scopeDialog), { forceMount: o = r.forceMount, ...a } = e, n = A(W, e.__scopeDialog);
1149
1149
  return /* @__PURE__ */ d(se, { present: o || n.open, children: n.modal ? /* @__PURE__ */ d(Sn, { ...a, ref: t }) : /* @__PURE__ */ d(Nn, { ...a, ref: t }) });
1150
1150
  }
1151
1151
  );
1152
- Mt.displayName = W;
1152
+ $t.displayName = W;
1153
1153
  var Sn = s.forwardRef(
1154
1154
  (e, t) => {
1155
- const r = A(W, e.__scopeDialog), o = s.useRef(null), a = q(t, r.contentRef, o);
1155
+ const r = A(W, e.__scopeDialog), o = s.useRef(null), a = B(t, r.contentRef, o);
1156
1156
  return s.useEffect(() => {
1157
1157
  const n = o.current;
1158
1158
  if (n) return bn(n);
1159
1159
  }, []), /* @__PURE__ */ d(
1160
- $t,
1160
+ Mt,
1161
1161
  {
1162
1162
  ...e,
1163
1163
  ref: a,
@@ -1182,7 +1182,7 @@ var Sn = s.forwardRef(
1182
1182
  (e, t) => {
1183
1183
  const r = A(W, e.__scopeDialog), o = s.useRef(!1), a = s.useRef(!1);
1184
1184
  return /* @__PURE__ */ d(
1185
- $t,
1185
+ Mt,
1186
1186
  {
1187
1187
  ...e,
1188
1188
  ref: t,
@@ -1201,10 +1201,10 @@ var Sn = s.forwardRef(
1201
1201
  }
1202
1202
  );
1203
1203
  }
1204
- ), $t = s.forwardRef(
1204
+ ), Mt = s.forwardRef(
1205
1205
  (e, t) => {
1206
- const { __scopeDialog: r, trapFocus: o, onOpenAutoFocus: a, onCloseAutoFocus: n, ...i } = e, u = A(W, r), p = s.useRef(null), l = q(t, p);
1207
- return Mr(), /* @__PURE__ */ T(ae, { children: [
1206
+ const { __scopeDialog: r, trapFocus: o, onOpenAutoFocus: a, onCloseAutoFocus: n, ...i } = e, u = A(W, r), p = s.useRef(null), l = B(t, p);
1207
+ return $r(), /* @__PURE__ */ T(ae, { children: [
1208
1208
  /* @__PURE__ */ d(
1209
1209
  vt,
1210
1210
  {
@@ -1237,22 +1237,22 @@ var Sn = s.forwardRef(
1237
1237
  ), Ae = "DialogTitle", It = s.forwardRef(
1238
1238
  (e, t) => {
1239
1239
  const { __scopeDialog: r, ...o } = e, a = A(Ae, r);
1240
- return /* @__PURE__ */ d($.h2, { id: a.titleId, ...o, ref: t });
1240
+ return /* @__PURE__ */ d(M.h2, { id: a.titleId, ...o, ref: t });
1241
1241
  }
1242
1242
  );
1243
1243
  It.displayName = Ae;
1244
- var Lt = "DialogDescription", kt = s.forwardRef(
1244
+ var Lt = "DialogDescription", Ft = s.forwardRef(
1245
1245
  (e, t) => {
1246
1246
  const { __scopeDialog: r, ...o } = e, a = A(Lt, r);
1247
- return /* @__PURE__ */ d($.p, { id: a.descriptionId, ...o, ref: t });
1247
+ return /* @__PURE__ */ d(M.p, { id: a.descriptionId, ...o, ref: t });
1248
1248
  }
1249
1249
  );
1250
- kt.displayName = Lt;
1251
- var Ft = "DialogClose", Wt = s.forwardRef(
1250
+ Ft.displayName = Lt;
1251
+ var kt = "DialogClose", Wt = s.forwardRef(
1252
1252
  (e, t) => {
1253
- const { __scopeDialog: r, ...o } = e, a = A(Ft, r);
1253
+ const { __scopeDialog: r, ...o } = e, a = A(kt, r);
1254
1254
  return /* @__PURE__ */ d(
1255
- $.button,
1255
+ M.button,
1256
1256
  {
1257
1257
  type: "button",
1258
1258
  ...o,
@@ -1262,16 +1262,16 @@ var Ft = "DialogClose", Wt = s.forwardRef(
1262
1262
  );
1263
1263
  }
1264
1264
  );
1265
- Wt.displayName = Ft;
1265
+ Wt.displayName = kt;
1266
1266
  function De(e) {
1267
1267
  return e ? "open" : "closed";
1268
1268
  }
1269
- var qt = "DialogTitleWarning", [Vo, Bt] = tr(qt, {
1269
+ var Bt = "DialogTitleWarning", [Vo, jt] = tr(Bt, {
1270
1270
  contentName: W,
1271
1271
  titleName: Ae,
1272
1272
  docsSlug: "dialog"
1273
1273
  }), Pn = ({ titleId: e }) => {
1274
- const t = Bt(qt), r = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
1274
+ const t = jt(Bt), r = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
1275
1275
 
1276
1276
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
1277
1277
 
@@ -1280,17 +1280,17 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
1280
1280
  e && (document.getElementById(e) || console.error(r));
1281
1281
  }, [r, e]), null;
1282
1282
  }, On = "DialogDescriptionWarning", Rn = ({ contentRef: e, descriptionId: t }) => {
1283
- const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Bt(On).contentName}}.`;
1283
+ const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jt(On).contentName}}.`;
1284
1284
  return s.useEffect(() => {
1285
1285
  var n;
1286
1286
  const a = (n = e.current) == null ? void 0 : n.getAttribute("aria-describedby");
1287
1287
  t && a && (document.getElementById(t) || console.warn(o));
1288
1288
  }, [o, e, t]), null;
1289
- }, xn = Ot, An = xt, Dn = Dt, Tn = Tt, Mn = Mt, $n = It, ze = kt, In = Wt;
1289
+ }, xn = Ot, An = xt, Dn = Dt, Tn = Tt, $n = $t, Mn = It, ze = Ft, In = Wt;
1290
1290
  const Ln = {
1291
1291
  LG: "lg"
1292
1292
  };
1293
- function kn(e) {
1293
+ function Fn(e) {
1294
1294
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1295
1295
  }
1296
1296
  var Ke = { exports: {} };
@@ -1300,7 +1300,7 @@ var Ke = { exports: {} };
1300
1300
  http://jedwatson.github.io/classnames
1301
1301
  */
1302
1302
  var Ge;
1303
- function Fn() {
1303
+ function kn() {
1304
1304
  return Ge || (Ge = 1, function(e) {
1305
1305
  (function() {
1306
1306
  var t = {}.hasOwnProperty;
@@ -1332,20 +1332,20 @@ function Fn() {
1332
1332
  })();
1333
1333
  }(Ke)), Ke.exports;
1334
1334
  }
1335
- var Wn = Fn();
1336
- const qn = /* @__PURE__ */ kn(Wn), Bn = "_rotate_12t9p_1", jn = "_dash_12t9p_1", Un = {
1335
+ var Wn = kn();
1336
+ const Bn = /* @__PURE__ */ Fn(Wn), jn = "_rotate_12t9p_1", qn = "_dash_12t9p_1", Un = {
1337
1337
  "purpur-spinner": "_purpur-spinner_12t9p_2",
1338
- rotate: Bn,
1338
+ rotate: jn,
1339
1339
  "purpur-spinner--xxs": "_purpur-spinner--xxs_12t9p_6",
1340
1340
  "purpur-spinner--xs": "_purpur-spinner--xs_12t9p_10",
1341
1341
  "purpur-spinner--sm": "_purpur-spinner--sm_12t9p_14",
1342
1342
  "purpur-spinner--md": "_purpur-spinner--md_12t9p_18",
1343
1343
  "purpur-spinner--lg": "_purpur-spinner--lg_12t9p_22",
1344
1344
  "purpur-spinner__circle": "_purpur-spinner__circle_12t9p_26",
1345
- dash: jn,
1345
+ dash: qn,
1346
1346
  "purpur-spinner__circle--disabled": "_purpur-spinner__circle--disabled_12t9p_41",
1347
1347
  "purpur-spinner__circle--negative": "_purpur-spinner__circle--negative_12t9p_44"
1348
- }, Ye = qn.bind(Un), K = "purpur-spinner", Vn = {
1348
+ }, Ye = Bn.bind(Un), K = "purpur-spinner", Vn = {
1349
1349
  SM: "sm"
1350
1350
  }, Hn = ({
1351
1351
  disabled: e = !1,
@@ -1429,7 +1429,7 @@ const Yn = /* @__PURE__ */ zn(Gn), Xn = {
1429
1429
  "purpur-button--tertiary-purple-negative": "_purpur-button--tertiary-purple-negative_w455q_166",
1430
1430
  "purpur-button--text-negative": "_purpur-button--text-negative_w455q_181",
1431
1431
  "purpur-button--text": "_purpur-button--text_w455q_181"
1432
- }, Zn = Yn.bind(Xn), k = "purpur-button", jt = Pe(
1432
+ }, Zn = Yn.bind(Xn), F = "purpur-button", qt = Pe(
1433
1433
  ({
1434
1434
  children: e,
1435
1435
  className: t,
@@ -1448,15 +1448,15 @@ const Yn = /* @__PURE__ */ zn(Gn), Xn = {
1448
1448
  return null;
1449
1449
  const g = Zn(
1450
1450
  [
1451
- k,
1452
- `${k}--${i ? `${l}-negative` : l}`,
1453
- `${k}--${p}`
1451
+ F,
1452
+ `${F}--${i ? `${l}-negative` : l}`,
1453
+ `${F}--${p}`
1454
1454
  ],
1455
1455
  {
1456
- [`${k}--icon-only`]: a,
1457
- [`${k}--negative`]: i,
1458
- [`${k}--full-width`]: o,
1459
- [`${k}--disabled`]: r || n
1456
+ [`${F}--icon-only`]: a,
1457
+ [`${F}--negative`]: i,
1458
+ [`${F}--full-width`]: o,
1459
+ [`${F}--disabled`]: r || n
1460
1460
  },
1461
1461
  t
1462
1462
  ), b = (m) => {
@@ -1487,7 +1487,7 @@ const Yn = /* @__PURE__ */ zn(Gn), Xn = {
1487
1487
  );
1488
1488
  }
1489
1489
  );
1490
- jt.displayName = "Button";
1490
+ qt.displayName = "Button";
1491
1491
  function Qn(e) {
1492
1492
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1493
1493
  }
@@ -1532,21 +1532,25 @@ function Jn() {
1532
1532
  }
1533
1533
  var eo = Jn();
1534
1534
  const to = /* @__PURE__ */ Qn(eo), te = {
1535
- "purpur-heading": "_purpur-heading_k9fhq_1",
1536
- "purpur-heading--hyphens": "_purpur-heading--hyphens_k9fhq_8",
1537
- "purpur-heading--negative": "_purpur-heading--negative_k9fhq_11",
1538
- "purpur-heading--subsection-100": "_purpur-heading--subsection-100_k9fhq_14",
1539
- "purpur-heading--title-100": "_purpur-heading--title-100_k9fhq_20",
1540
- "purpur-heading--title-200": "_purpur-heading--title-200_k9fhq_26",
1541
- "purpur-heading--title-300": "_purpur-heading--title-300_k9fhq_32",
1542
- "purpur-heading--title-400": "_purpur-heading--title-400_k9fhq_38",
1543
- "purpur-heading--title-500": "_purpur-heading--title-500_k9fhq_44",
1544
- "purpur-heading--title-600": "_purpur-heading--title-600_k9fhq_50",
1545
- "purpur-heading--title-700": "_purpur-heading--title-700_k9fhq_56",
1546
- "purpur-heading--display-25": "_purpur-heading--display-25_k9fhq_62",
1547
- "purpur-heading--display-50": "_purpur-heading--display-50_k9fhq_68",
1548
- "purpur-heading--display-100": "_purpur-heading--display-100_k9fhq_74",
1549
- "purpur-heading--display-200": "_purpur-heading--display-200_k9fhq_80"
1535
+ "purpur-heading": "_purpur-heading_vo751_1",
1536
+ "purpur-heading--hyphens": "_purpur-heading--hyphens_vo751_8",
1537
+ "purpur-heading--negative": "_purpur-heading--negative_vo751_11",
1538
+ "purpur-heading--subsection-100": "_purpur-heading--subsection-100_vo751_14",
1539
+ "purpur-heading--title-100": "_purpur-heading--title-100_vo751_20",
1540
+ "purpur-heading--title-200": "_purpur-heading--title-200_vo751_26",
1541
+ "purpur-heading--title-300": "_purpur-heading--title-300_vo751_32",
1542
+ "purpur-heading--title-400": "_purpur-heading--title-400_vo751_38",
1543
+ "purpur-heading--title-500": "_purpur-heading--title-500_vo751_44",
1544
+ "purpur-heading--title-600": "_purpur-heading--title-600_vo751_50",
1545
+ "purpur-heading--title-700": "_purpur-heading--title-700_vo751_56",
1546
+ "purpur-heading--display-5": "_purpur-heading--display-5_vo751_62",
1547
+ "purpur-heading--display-10": "_purpur-heading--display-10_vo751_68",
1548
+ "purpur-heading--display-15": "_purpur-heading--display-15_vo751_74",
1549
+ "purpur-heading--display-20": "_purpur-heading--display-20_vo751_80",
1550
+ "purpur-heading--display-25": "_purpur-heading--display-25_vo751_86",
1551
+ "purpur-heading--display-50": "_purpur-heading--display-50_vo751_92",
1552
+ "purpur-heading--display-100": "_purpur-heading--display-100_vo751_98",
1553
+ "purpur-heading--display-200": "_purpur-heading--display-200_vo751_104"
1550
1554
  }, ro = {
1551
1555
  TITLE100: "title-100"
1552
1556
  }, re = "purpur-heading", Ut = ({
@@ -1838,7 +1842,7 @@ var _e = { exports: {} };
1838
1842
  http://jedwatson.github.io/classnames
1839
1843
  */
1840
1844
  var it;
1841
- function Mo() {
1845
+ function $o() {
1842
1846
  return it || (it = 1, function(e) {
1843
1847
  (function() {
1844
1848
  var t = {}.hasOwnProperty;
@@ -1870,8 +1874,8 @@ function Mo() {
1870
1874
  })();
1871
1875
  }(_e)), _e.exports;
1872
1876
  }
1873
- var $o = Mo();
1874
- const Io = /* @__PURE__ */ To($o), Lo = "_fadeIn_4aird_1", ko = {
1877
+ var Mo = $o();
1878
+ const Io = /* @__PURE__ */ To(Mo), Lo = "_fadeIn_4aird_1", Fo = {
1875
1879
  "purpur-modal-content": "_purpur-modal-content_4aird_1",
1876
1880
  fadeIn: Lo,
1877
1881
  "purpur-modal-content__overlay": "_purpur-modal-content__overlay_4aird_30",
@@ -1891,7 +1895,7 @@ const Io = /* @__PURE__ */ To($o), Lo = "_fadeIn_4aird_1", ko = {
1891
1895
  "purpur-modal-content__actions": "_purpur-modal-content__actions_4aird_123",
1892
1896
  "purpur-modal-content__actions-separator": "_purpur-modal-content__actions-separator_4aird_175",
1893
1897
  "purpur-modal-content--sticky-footer": "_purpur-modal-content--sticky-footer_4aird_185"
1894
- }, ut = (e) => e.showCloseButton === !0, O = Io.bind(ko), N = "purpur-modal-content", Fo = Pe(
1898
+ }, ut = (e) => e.showCloseButton === !0, O = Io.bind(Fo), N = "purpur-modal-content", ko = Pe(
1895
1899
  ({
1896
1900
  ["data-testid"]: e,
1897
1901
  actions: t,
@@ -1916,7 +1920,7 @@ const Io = /* @__PURE__ */ To($o), Lo = "_fadeIn_4aird_1", ko = {
1916
1920
  o
1917
1921
  ), R = (D) => e ? `${e} ${D}` : void 0, z = (D) => {
1918
1922
  n && D.preventDefault();
1919
- }, B = Qt(() => {
1923
+ }, j = Qt(() => {
1920
1924
  if (!P.current || !y.current)
1921
1925
  return;
1922
1926
  const D = window.getComputedStyle(P.current, null), Y = parseFloat(D.getPropertyValue("height")), Zt = y.current.offsetHeight;
@@ -1934,14 +1938,14 @@ const Io = /* @__PURE__ */ To($o), Lo = "_fadeIn_4aird_1", ko = {
1934
1938
  }, Xt = (D) => {
1935
1939
  n && !m && D.preventDefault();
1936
1940
  };
1937
- return we(() => (window.addEventListener("resize", B), () => {
1938
- window.removeEventListener("resize", B);
1939
- }), [B]), we(() => {
1940
- B();
1941
- }, [f, r, B]), /* @__PURE__ */ T(Dn, { children: [
1941
+ return we(() => (window.addEventListener("resize", j), () => {
1942
+ window.removeEventListener("resize", j);
1943
+ }), [j]), we(() => {
1944
+ j();
1945
+ }, [f, r, j]), /* @__PURE__ */ T(Dn, { children: [
1942
1946
  /* @__PURE__ */ d(Tn, { className: O(`${N}__overlay`), style: { zIndex: v } }),
1943
1947
  /* @__PURE__ */ T(
1944
- Mn,
1948
+ $n,
1945
1949
  {
1946
1950
  ..._,
1947
1951
  className: x,
@@ -1950,7 +1954,7 @@ const Io = /* @__PURE__ */ To($o), Lo = "_fadeIn_4aird_1", ko = {
1950
1954
  ...!a && { "aria-describedby": void 0 },
1951
1955
  onPointerDownOutside: z,
1952
1956
  onOpenAutoFocus: () => {
1953
- B(), Yt();
1957
+ j(), Yt();
1954
1958
  },
1955
1959
  onEscapeKeyDown: Xt,
1956
1960
  onCloseAutoFocus: h,
@@ -1976,7 +1980,7 @@ const Io = /* @__PURE__ */ To($o), Lo = "_fadeIn_4aird_1", ko = {
1976
1980
  }
1977
1981
  ),
1978
1982
  /* @__PURE__ */ d(
1979
- $n,
1983
+ Mn,
1980
1984
  {
1981
1985
  asChild: !0,
1982
1986
  className: O(`${N}__title`),
@@ -2021,7 +2025,7 @@ const Io = /* @__PURE__ */ To($o), Lo = "_fadeIn_4aird_1", ko = {
2021
2025
  scrollbarWidth: r,
2022
2026
  ["data-testid"]: o
2023
2027
  }) => /* @__PURE__ */ d(In, { asChild: !0, children: /* @__PURE__ */ d(
2024
- jt,
2028
+ qt,
2025
2029
  {
2026
2030
  variant: t ? "primary" : "tertiary-purple",
2027
2031
  negative: t,
@@ -2055,7 +2059,7 @@ const Io = /* @__PURE__ */ To($o), Lo = "_fadeIn_4aird_1", ko = {
2055
2059
  onOpenChange: o
2056
2060
  }) => /* @__PURE__ */ d(xn, { open: r, onOpenChange: o, "data-testid": e, children: t });
2057
2061
  Te.Trigger = Wo;
2058
- Te.Content = Fo;
2062
+ Te.Content = ko;
2059
2063
  Te.displayName = "Modal";
2060
2064
  export {
2061
2065
  Te as Modal