@rpcbase/ui 0.51.0 → 0.52.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.
@@ -1 +1 @@
1
- {"version":3,"file":"useMapsLibrary.d.ts","sourceRoot":"","sources":["../../lib/helpers/useMapsLibrary.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,cAAc,GAAI,GAAG,QAAQ,EAAE,SAAS,MAAM,oBAoB1D,CAAA"}
1
+ {"version":3,"file":"useMapsLibrary.d.ts","sourceRoot":"","sources":["../../lib/helpers/useMapsLibrary.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,cAAc,GAAI,GAAG,QAAQ,EAAE,SAAS,MAAM,oBAoB1D,CAAA"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as ve from "react";
2
- import _e, { useState as I, useEffect as $, useRef as C, useMemo as ye } from "react";
3
- import ie, { clsx as xe } from "clsx";
2
+ import _e, { useState as I, useEffect as $, useRef as C, useMemo as xe } from "react";
3
+ import ie, { clsx as ye } from "clsx";
4
4
  import * as N from "@radix-ui/react-dialog";
5
5
  import { XIcon as Ee } from "lucide-react";
6
6
  import { Link as we } from "react-router";
@@ -24,8 +24,8 @@ function Te() {
24
24
  var d = null;
25
25
  if (c !== void 0 && (d = "" + c), a.key !== void 0 && (d = "" + a.key), "key" in a) {
26
26
  c = {};
27
- for (var m in a)
28
- m !== "key" && (c[m] = a[m]);
27
+ for (var p in a)
28
+ p !== "key" && (c[p] = a[p]);
29
29
  } else c = a;
30
30
  return a = c.ref, {
31
31
  $$typeof: e,
@@ -53,14 +53,14 @@ function ke() {
53
53
  function e(t) {
54
54
  if (t == null) return null;
55
55
  if (typeof t == "function")
56
- return t.$$typeof === Z ? null : t.displayName || t.name || null;
56
+ return t.$$typeof === Q ? null : t.displayName || t.name || null;
57
57
  if (typeof t == "string") return t;
58
58
  switch (t) {
59
59
  case k:
60
60
  return "Fragment";
61
61
  case D:
62
62
  return "Profiler";
63
- case x:
63
+ case y:
64
64
  return "StrictMode";
65
65
  case O:
66
66
  return "Suspense";
@@ -138,9 +138,9 @@ function ke() {
138
138
  }
139
139
  return t.key !== void 0;
140
140
  }
141
- function m(t, i) {
141
+ function p(t, i) {
142
142
  function g() {
143
- Q || (Q = !0, console.error(
143
+ K || (K = !0, console.error(
144
144
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
145
145
  i
146
146
  ));
@@ -150,13 +150,13 @@ function ke() {
150
150
  configurable: !0
151
151
  });
152
152
  }
153
- function p() {
153
+ function m() {
154
154
  var t = e(this.type);
155
155
  return V[t] || (V[t] = !0, console.error(
156
156
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
157
157
  )), t = this.props.ref, t !== void 0 ? t : null;
158
158
  }
159
- function y(t, i, g, h, G, S) {
159
+ function x(t, i, g, h, G, S) {
160
160
  var _ = g.ref;
161
161
  return t = {
162
162
  $$typeof: w,
@@ -166,7 +166,7 @@ function ke() {
166
166
  _owner: h
167
167
  }, (_ !== void 0 ? _ : null) !== null ? Object.defineProperty(t, "ref", {
168
168
  enumerable: !1,
169
- get: p
169
+ get: m
170
170
  }) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
171
171
  configurable: !1,
172
172
  enumerable: !1,
@@ -225,10 +225,10 @@ React keys must be passed directly to JSX without using spread:
225
225
  for (var z in i)
226
226
  z !== "key" && (g[z] = i[z]);
227
227
  } else g = i;
228
- return _ && m(
228
+ return _ && p(
229
229
  g,
230
230
  typeof t == "function" ? t.displayName || t.name || "Unknown" : t
231
- ), y(
231
+ ), x(
232
232
  t,
233
233
  _,
234
234
  g,
@@ -243,7 +243,7 @@ React keys must be passed directly to JSX without using spread:
243
243
  function f(t) {
244
244
  return typeof t == "object" && t !== null && t.$$typeof === w;
245
245
  }
246
- var T = _e, w = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), k = Symbol.for("react.fragment"), x = Symbol.for("react.strict_mode"), D = Symbol.for("react.profiler"), j = Symbol.for("react.consumer"), R = Symbol.for("react.context"), A = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), F = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), Y = Symbol.for("react.lazy"), W = Symbol.for("react.activity"), Z = Symbol.for("react.client.reference"), U = T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, q = Object.prototype.hasOwnProperty, te = Array.isArray, B = console.createTask ? console.createTask : function() {
246
+ var T = _e, w = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), k = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), D = Symbol.for("react.profiler"), j = Symbol.for("react.consumer"), R = Symbol.for("react.context"), A = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), F = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), Y = Symbol.for("react.lazy"), W = Symbol.for("react.activity"), Q = Symbol.for("react.client.reference"), U = T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, q = Object.prototype.hasOwnProperty, te = Array.isArray, B = console.createTask ? console.createTask : function() {
247
247
  return null;
248
248
  };
249
249
  T = {
@@ -251,7 +251,7 @@ React keys must be passed directly to JSX without using spread:
251
251
  return t();
252
252
  }
253
253
  };
254
- var Q, V = {}, u = T.react_stack_bottom_frame.bind(
254
+ var K, V = {}, u = T.react_stack_bottom_frame.bind(
255
255
  T,
256
256
  c
257
257
  )(), E = B(n(c)), J = {};
@@ -287,11 +287,11 @@ function Re(e, r) {
287
287
  e.src = r;
288
288
  }
289
289
  const Pe = (e) => {
290
- var r, o, n, a = "The Google Maps JavaScript API", c = "google", d = "importLibrary", m = "__ib__", p = document, y = window, b = y[c] || (y[c] = {}), l = b.maps || (b.maps = {}), f = /* @__PURE__ */ new Set(), T = new URLSearchParams(), w = () => r || (r = new Promise(async (v, k) => {
291
- await (o = p.createElement("script")), T.set("libraries", [...f] + "");
290
+ var r, o, n, a = "The Google Maps JavaScript API", c = "google", d = "importLibrary", p = "__ib__", m = document, x = window, b = x[c] || (x[c] = {}), l = b.maps || (b.maps = {}), f = /* @__PURE__ */ new Set(), T = new URLSearchParams(), w = () => r || (r = new Promise(async (v, k) => {
291
+ await (o = m.createElement("script")), T.set("libraries", [...f] + "");
292
292
  for (n in e)
293
- T.set(n.replace(/[A-Z]/g, (x) => "_" + x[0].toLowerCase()), e[n]);
294
- T.set("callback", c + ".maps." + m), Re(o, "https://maps.googleapis.com/maps/api/js?" + T), l[m] = v, o.onerror = () => r = k(Error(a + " could not load.")), o.nonce = p.querySelector("script[nonce]")?.nonce || "", p.head.append(o);
293
+ T.set(n.replace(/[A-Z]/g, (y) => "_" + y[0].toLowerCase()), e[n]);
294
+ T.set("callback", c + ".maps." + p), Re(o, "https://maps.googleapis.com/maps/api/js?" + T), l[p] = v, o.onerror = () => r = k(Error(a + " could not load.")), o.nonce = m.querySelector("script[nonce]")?.nonce || "", m.head.append(o);
295
295
  }));
296
296
  l[d] ? console.warn(a + " only loads once. Ignoring:", e) : l[d] = (v, ...k) => f.add(v) && w().then(() => l[d](v, ...k));
297
297
  }, Ne = (e) => `The setOptions() function should only be called once. The options passed to the additional call (${JSON.stringify(e)}) will be ignored.`, Ae = (e) => `The google.maps.importLibrary() function is already defined, and @googlemaps/js-api-loader will use the existing function instead of overwriting it. The options passed to setOptions (${JSON.stringify(e)}) will be ignored.`, Oe = "No options were set before calling importLibrary. Make sure to configure the loader using setOptions().", Se = "There already is a script loading the Google Maps JavaScript API, and no google.maps.importLibrary function is defined. @googlemaps/js-api-loader will proceed to bootstrap the API with the specified options, but the existing script might cause problems using the API. Make sure to remove the script loading the API.", ge = process.env.NODE_ENV !== "production", le = ge ? (e) => {
@@ -318,17 +318,16 @@ function Ce(e) {
318
318
  const r = !!window.google?.maps?.importLibrary;
319
319
  r ? Ie(Ae(e)) : Me && document.querySelector('script[src*="maps.googleapis.com/maps/api/js"]') && le(Se), r || Pe(e);
320
320
  }
321
- let re = null, pe = null;
321
+ let re = null, me = null;
322
322
  const $e = (e) => {
323
- const o = e ?? void 0;
324
- if (!o) {
325
- const n = new Error("useMapsLibrary: missing Google Maps API key");
326
- return console.error(n.message), Promise.reject(n);
323
+ if (!e) {
324
+ const r = new Error("useMapsLibrary: missing Google Maps API key");
325
+ return console.error(r.message), Promise.reject(r);
327
326
  }
328
- return re ? pe !== o && console.warn(
327
+ return re ? me !== e && console.warn(
329
328
  "useMapsLibrary: ignoring attempt to re-initialize Google Maps with a different API key than the one already in use."
330
- ) : (pe = o, De({
331
- key: o,
329
+ ) : (me = e, De({
330
+ key: e,
332
331
  v: "weekly"
333
332
  }), re = Le("core").then(() => {
334
333
  })), re;
@@ -346,7 +345,7 @@ const $e = (e) => {
346
345
  }, [r]), o ? "loaded" : null;
347
346
  };
348
347
  function M(...e) {
349
- return xe(e);
348
+ return ye(e);
350
349
  }
351
350
  function he(e) {
352
351
  const { className: r, type: o, ...n } = e;
@@ -404,13 +403,13 @@ const ft = {
404
403
  return /* @__PURE__ */ s.jsx(s.Fragment, { children: r });
405
404
  const c = [];
406
405
  let d = 0;
407
- return n.forEach((m, p) => {
408
- if (a && m.startOffset >= r.length)
406
+ return n.forEach((p, m) => {
407
+ if (a && p.startOffset >= r.length)
409
408
  return;
410
- const y = m.startOffset, b = Math.min(m.endOffset, r.length);
411
- if (y > d && c.push(r.substring(d, y)), b > y) {
412
- const l = r.substring(y, b);
413
- c.push(/* @__PURE__ */ s.jsx("strong", { children: l }, p));
409
+ const x = p.startOffset, b = Math.min(p.endOffset, r.length);
410
+ if (x > d && c.push(r.substring(d, x)), b > x) {
411
+ const l = r.substring(x, b);
412
+ c.push(/* @__PURE__ */ s.jsx("strong", { children: l }, m));
414
413
  }
415
414
  d = Math.max(d, b);
416
415
  }), d < r.length && c.push(r.substring(d)), c.length === 0 ? /* @__PURE__ */ s.jsx(s.Fragment, { children: r }) : /* @__PURE__ */ s.jsx(s.Fragment, { children: c });
@@ -423,7 +422,7 @@ const ft = {
423
422
  }, qe = (e, r) => e.filter((o) => Ue(o, r)), Be = (e) => e.sort((r, o) => {
424
423
  const n = r.distanceMeters ?? Number.POSITIVE_INFINITY, a = o.distanceMeters ?? Number.POSITIVE_INFINITY;
425
424
  return n - a;
426
- }), Ve = (e, r) => Be(qe(We(e), r)), Je = (e, r) => ce(e).toLowerCase() === r.trim().toLowerCase(), pt = ({
425
+ }), Ve = (e, r) => Be(qe(We(e), r)), Je = (e, r) => ce(e).toLowerCase() === r.trim().toLowerCase(), mt = ({
427
426
  id: e,
428
427
  label: r,
429
428
  placeholder: o,
@@ -431,13 +430,13 @@ const ft = {
431
430
  onValueChange: a,
432
431
  disabled: c,
433
432
  name: d,
434
- className: m,
435
- autofillShimName: p,
436
- googleMapsApiKey: y,
433
+ className: p,
434
+ autofillShimName: m,
435
+ googleMapsApiKey: x,
437
436
  boundingBox: b,
438
437
  allowedTypes: l
439
438
  }) => {
440
- const [f, T] = I(n ?? ""), [w, v] = I([]), [k, x] = I(!1), [D, j] = I(-1), R = C(null), A = C(null), O = C(!1), F = C(!1), P = C(null), Y = ze("places", y), [W, Z] = I(null), U = ye(() => {
439
+ const [f, T] = I(n ?? ""), [w, v] = I([]), [k, y] = I(!1), [D, j] = I(-1), R = C(null), A = C(null), O = C(!1), F = C(!1), P = C(null), Y = ze("places", x), [W, Q] = I(null), U = xe(() => {
441
440
  if (!l)
442
441
  return Fe;
443
442
  const u = /* @__PURE__ */ new Set();
@@ -452,9 +451,9 @@ const ft = {
452
451
  return;
453
452
  let u = !0;
454
453
  return google.maps.importLibrary("places").then((E) => {
455
- u && Z(E);
454
+ u && Q(E);
456
455
  }).catch(() => {
457
- u && (console.error("AddressAutocompleteInput: failed to load places library"), Z(null));
456
+ u && (console.error("AddressAutocompleteInput: failed to load places library"), Q(null));
458
457
  }), () => {
459
458
  u = !1;
460
459
  };
@@ -468,13 +467,13 @@ const ft = {
468
467
  if (!u)
469
468
  return;
470
469
  if (f.trim() === "") {
471
- v([]), x(!1), P.current = null, n !== "" && a("");
470
+ v([]), y(!1), P.current = null, n !== "" && a("");
472
471
  return;
473
472
  }
474
473
  if (!W) return;
475
474
  const { AutocompleteSuggestion: t, AutocompleteSessionToken: i } = W;
476
475
  if (!t || !i) {
477
- console.error("AddressAutocompleteInput: missing AutocompleteSuggestion or AutocompleteSessionToken exports"), v([]), x(!1);
476
+ console.error("AddressAutocompleteInput: missing AutocompleteSuggestion or AutocompleteSessionToken exports"), v([]), y(!1);
478
477
  return;
479
478
  }
480
479
  P.current || (P.current = new i());
@@ -489,12 +488,12 @@ const ft = {
489
488
  return;
490
489
  const G = h.suggestions.map((z) => z.placePrediction).filter((z) => !!z), S = Ve(G, U), _ = S[0], L = _ && S.length === 1 && Je(_, f);
491
490
  if (!F.current && L) {
492
- v(S), x(!1);
491
+ v(S), y(!1);
493
492
  return;
494
493
  }
495
- S.length > 0 ? (v(S), F.current && x(!0), j(-1)) : (v([]), x(!1));
494
+ S.length > 0 ? (v(S), F.current && y(!0), j(-1)) : (v([]), y(!1));
496
495
  }).catch((h) => {
497
- u && (console.error("AddressAutocompleteInput: suggestion fetch failed", h), v([]), x(!1));
496
+ u && (console.error("AddressAutocompleteInput: suggestion fetch failed", h), v([]), y(!1));
498
497
  });
499
498
  }, 300);
500
499
  return () => {
@@ -502,7 +501,7 @@ const ft = {
502
501
  };
503
502
  }, [f, W, a, n, b, U]), $(() => {
504
503
  const u = (E) => {
505
- R.current && !R.current.contains(E.target) && A.current && !A.current.contains(E.target) && x(!1);
504
+ R.current && !R.current.contains(E.target) && A.current && !A.current.contains(E.target) && y(!1);
506
505
  };
507
506
  return document.addEventListener("mousedown", u), () => {
508
507
  document.removeEventListener("mousedown", u);
@@ -511,18 +510,18 @@ const ft = {
511
510
  const q = (u) => {
512
511
  O.current = !0;
513
512
  const E = ce(u);
514
- T(E), a(E), v([]), x(!1), P.current = null;
513
+ T(E), a(E), v([]), y(!1), P.current = null;
515
514
  }, te = (u) => {
516
515
  F.current = !0, T(u.target.value);
517
516
  }, B = (u) => {
518
517
  if (!k || w.length === 0) {
519
- u.key === "Enter" && (u.preventDefault(), a(f), x(!1), P.current = null);
518
+ u.key === "Enter" && (u.preventDefault(), a(f), y(!1), P.current = null);
520
519
  return;
521
520
  }
522
- u.key === "ArrowDown" ? (u.preventDefault(), j((E) => (E + 1) % w.length)) : u.key === "ArrowUp" ? (u.preventDefault(), j((E) => (E - 1 + w.length) % w.length)) : u.key === "Enter" ? (u.preventDefault(), D > -1 && w[D] ? q(w[D]) : (a(f), x(!1), P.current = null)) : u.key === "Escape" && x(!1);
523
- }, Q = () => {
524
- x(!1), n !== f && a(f), P.current = null;
525
- }, V = p ?? (d ? `${d}_shim` : void 0);
521
+ u.key === "ArrowDown" ? (u.preventDefault(), j((E) => (E + 1) % w.length)) : u.key === "ArrowUp" ? (u.preventDefault(), j((E) => (E - 1 + w.length) % w.length)) : u.key === "Enter" ? (u.preventDefault(), D > -1 && w[D] ? q(w[D]) : (a(f), y(!1), P.current = null)) : u.key === "Escape" && y(!1);
522
+ }, K = () => {
523
+ y(!1), n !== f && a(f), P.current = null;
524
+ }, V = m ?? (d ? `${d}_shim` : void 0);
526
525
  return /* @__PURE__ */ s.jsxs("div", { className: "relative", children: [
527
526
  V && /* @__PURE__ */ s.jsx(
528
527
  "input",
@@ -547,12 +546,12 @@ const ft = {
547
546
  onChange: te,
548
547
  onKeyDown: B,
549
548
  onFocus: () => {
550
- w.length > 0 && f && x(!0);
549
+ w.length > 0 && f && y(!0);
551
550
  },
552
- onBlur: Q,
551
+ onBlur: K,
553
552
  disabled: c,
554
553
  autoComplete: "off",
555
- className: M("w-full", m)
554
+ className: M("w-full", p)
556
555
  }
557
556
  ),
558
557
  k && w.length > 0 && /* @__PURE__ */ s.jsx(
@@ -577,7 +576,7 @@ const ft = {
577
576
  }
578
577
  )
579
578
  ] });
580
- }, mt = ({
579
+ }, pt = ({
581
580
  className: e,
582
581
  onClick: r,
583
582
  children: o,
@@ -608,14 +607,14 @@ const ft = {
608
607
  checked: a,
609
608
  onChange: c,
610
609
  color: d = "sky",
611
- ...m
610
+ ...p
612
611
  }) => {
613
- const p = Xe[d];
612
+ const m = Xe[d];
614
613
  return /* @__PURE__ */ s.jsx("div", { className: "flex h-6 shrink-0 items-center", children: /* @__PURE__ */ s.jsxs("div", { className: "group grid size-4 grid-cols-1", children: [
615
614
  /* @__PURE__ */ s.jsx(
616
615
  "input",
617
616
  {
618
- ...m,
617
+ ...p,
619
618
  id: e,
620
619
  name: r,
621
620
  type: "checkbox",
@@ -623,7 +622,7 @@ const ft = {
623
622
  defaultChecked: n,
624
623
  checked: a,
625
624
  onChange: c,
626
- className: `col-start-1 row-start-1 appearance-none cursor-pointer rounded-sm border border-gray-300 bg-white focus-visible:outline-2 focus-visible:outline-offset-2 disabled:border-gray-300 disabled:bg-gray-100 disabled:checked:bg-gray-100 forced-colors:appearance-auto ${p}`
625
+ className: `col-start-1 row-start-1 appearance-none cursor-pointer rounded-sm border border-gray-300 bg-white focus-visible:outline-2 focus-visible:outline-offset-2 disabled:border-gray-300 disabled:bg-gray-100 disabled:checked:bg-gray-100 forced-colors:appearance-auto ${m}`
627
626
  }
628
627
  ),
629
628
  /* @__PURE__ */ s.jsxs(
@@ -678,7 +677,7 @@ function vt({
678
677
  }) {
679
678
  return /* @__PURE__ */ s.jsx(N.Close, { "data-slot": "dialog-close", ...e });
680
679
  }
681
- function Ke({
680
+ function Ze({
682
681
  className: e,
683
682
  ...r
684
683
  }) {
@@ -694,7 +693,7 @@ function Ke({
694
693
  }
695
694
  );
696
695
  }
697
- const Ze = ve.forwardRef(({ className: e, children: r, showCloseButton: o = !0, showCloseButtonOutside: n = !1, ...a }, c) => /* @__PURE__ */ s.jsx(He, { "data-slot": "dialog-portal", children: /* @__PURE__ */ s.jsx(Ke, { children: /* @__PURE__ */ s.jsxs(
696
+ const Qe = ve.forwardRef(({ className: e, children: r, showCloseButton: o = !0, showCloseButtonOutside: n = !1, ...a }, c) => /* @__PURE__ */ s.jsx(He, { "data-slot": "dialog-portal", children: /* @__PURE__ */ s.jsx(Ze, { children: /* @__PURE__ */ s.jsxs(
698
697
  N.Content,
699
698
  {
700
699
  ref: c,
@@ -723,7 +722,7 @@ const Ze = ve.forwardRef(({ className: e, children: r, showCloseButton: o = !0,
723
722
  ]
724
723
  }
725
724
  ) }) }));
726
- Ze.displayName = N.Content.displayName;
725
+ Qe.displayName = N.Content.displayName;
727
726
  function _t({ className: e, ...r }) {
728
727
  return /* @__PURE__ */ s.jsx(
729
728
  "div",
@@ -734,7 +733,7 @@ function _t({ className: e, ...r }) {
734
733
  }
735
734
  );
736
735
  }
737
- function yt({ className: e, ...r }) {
736
+ function xt({ className: e, ...r }) {
738
737
  return /* @__PURE__ */ s.jsx(
739
738
  "div",
740
739
  {
@@ -744,7 +743,7 @@ function yt({ className: e, ...r }) {
744
743
  }
745
744
  );
746
745
  }
747
- function xt({
746
+ function yt({
748
747
  className: e,
749
748
  ...r
750
749
  }) {
@@ -770,10 +769,10 @@ function Et({
770
769
  }
771
770
  );
772
771
  }
773
- var Qe = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "#", "$", "%", "*", "+", ",", "-", ".", ":", ";", "=", "?", "@", "[", "]", "^", "_", "{", "|", "}", "~"], K = (e) => {
772
+ var Ke = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "#", "$", "%", "*", "+", ",", "-", ".", ":", ";", "=", "?", "@", "[", "]", "^", "_", "{", "|", "}", "~"], Z = (e) => {
774
773
  let r = 0;
775
774
  for (let o = 0; o < e.length; o++) {
776
- let n = e[o], a = Qe.indexOf(n);
775
+ let n = e[o], a = Ke.indexOf(n);
777
776
  r = r * 83 + a;
778
777
  }
779
778
  return r;
@@ -783,14 +782,14 @@ var Qe = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D",
783
782
  }, ne = (e) => {
784
783
  let r = Math.max(0, Math.min(1, e));
785
784
  return r <= 31308e-7 ? Math.trunc(r * 12.92 * 255 + 0.5) : Math.trunc((1.055 * Math.pow(r, 0.4166666666666667) - 0.055) * 255 + 0.5);
786
- }, et = (e) => e < 0 ? -1 : 1, se = (e, r) => et(e) * Math.pow(Math.abs(e), r), me = class extends Error {
785
+ }, et = (e) => e < 0 ? -1 : 1, se = (e, r) => et(e) * Math.pow(Math.abs(e), r), pe = class extends Error {
787
786
  constructor(e) {
788
787
  super(e), this.name = "ValidationError", this.message = e;
789
788
  }
790
789
  }, tt = (e) => {
791
- if (!e || e.length < 6) throw new me("The blurhash string must be at least 6 characters");
792
- let r = K(e[0]), o = Math.floor(r / 9) + 1, n = r % 9 + 1;
793
- if (e.length !== 4 + 2 * n * o) throw new me(`blurhash length mismatch: length is ${e.length} but it should be ${4 + 2 * n * o}`);
790
+ if (!e || e.length < 6) throw new pe("The blurhash string must be at least 6 characters");
791
+ let r = Z(e[0]), o = Math.floor(r / 9) + 1, n = r % 9 + 1;
792
+ if (e.length !== 4 + 2 * n * o) throw new pe(`blurhash length mismatch: length is ${e.length} but it should be ${4 + 2 * n * o}`);
794
793
  }, rt = (e) => {
795
794
  let r = e >> 16, o = e >> 8 & 255, n = e & 255;
796
795
  return [oe(r), oe(o), oe(n)];
@@ -799,23 +798,23 @@ var Qe = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D",
799
798
  return [se((o - 9) / 9, 2) * r, se((n - 9) / 9, 2) * r, se((a - 9) / 9, 2) * r];
800
799
  }, nt = (e, r, o, n) => {
801
800
  tt(e), n = n | 1;
802
- let a = K(e[0]), c = Math.floor(a / 9) + 1, d = a % 9 + 1, m = (K(e[1]) + 1) / 166, p = new Array(d * c);
803
- for (let l = 0; l < p.length; l++) if (l === 0) {
804
- let f = K(e.substring(2, 6));
805
- p[l] = rt(f);
801
+ let a = Z(e[0]), c = Math.floor(a / 9) + 1, d = a % 9 + 1, p = (Z(e[1]) + 1) / 166, m = new Array(d * c);
802
+ for (let l = 0; l < m.length; l++) if (l === 0) {
803
+ let f = Z(e.substring(2, 6));
804
+ m[l] = rt(f);
806
805
  } else {
807
- let f = K(e.substring(4 + l * 2, 6 + l * 2));
808
- p[l] = ot(f, m * n);
806
+ let f = Z(e.substring(4 + l * 2, 6 + l * 2));
807
+ m[l] = ot(f, p * n);
809
808
  }
810
- let y = r * 4, b = new Uint8ClampedArray(y * o);
809
+ let x = r * 4, b = new Uint8ClampedArray(x * o);
811
810
  for (let l = 0; l < o; l++) for (let f = 0; f < r; f++) {
812
811
  let T = 0, w = 0, v = 0;
813
812
  for (let j = 0; j < c; j++) for (let R = 0; R < d; R++) {
814
- let A = Math.cos(Math.PI * f * R / r) * Math.cos(Math.PI * l * j / o), O = p[R + j * d];
813
+ let A = Math.cos(Math.PI * f * R / r) * Math.cos(Math.PI * l * j / o), O = m[R + j * d];
815
814
  T += O[0] * A, w += O[1] * A, v += O[2] * A;
816
815
  }
817
- let k = ne(T), x = ne(w), D = ne(v);
818
- b[4 * f + 0 + l * y] = k, b[4 * f + 1 + l * y] = x, b[4 * f + 2 + l * y] = D, b[4 * f + 3 + l * y] = 255;
816
+ let k = ne(T), y = ne(w), D = ne(v);
817
+ b[4 * f + 0 + l * x] = k, b[4 * f + 1 + l * x] = y, b[4 * f + 2 + l * x] = D, b[4 * f + 3 + l * x] = 255;
819
818
  }
820
819
  return b;
821
820
  }, st = nt;
@@ -825,23 +824,23 @@ const wt = ({
825
824
  alt: o = "",
826
825
  className: n
827
826
  }) => {
828
- const [a, c] = I(!1), [d, m] = I(null), p = C(null);
827
+ const [a, c] = I(!1), [d, p] = I(null), m = C(null);
829
828
  $(() => {
830
829
  if (!r) return;
831
830
  const [l, f, T] = r, w = st(T, l, f), v = document.createElement("canvas"), k = v.getContext("2d");
832
831
  if (k) {
833
832
  v.width = l, v.height = f;
834
- const x = new ImageData(
833
+ const y = new ImageData(
835
834
  new Uint8ClampedArray(w),
836
835
  l,
837
836
  f
838
837
  );
839
- k.putImageData(x, 0, 0), m(v.toDataURL());
838
+ k.putImageData(y, 0, 0), p(v.toDataURL());
840
839
  }
841
840
  }, [r]), $(() => {
842
- p.current && p.current.complete && c(!0);
841
+ m.current && m.current.complete && c(!0);
843
842
  }, [e]);
844
- const y = () => {
843
+ const x = () => {
845
844
  }, b = () => {
846
845
  };
847
846
  return /* @__PURE__ */ s.jsxs(
@@ -849,7 +848,7 @@ const wt = ({
849
848
  {
850
849
  style: { position: "relative", overflow: "hidden" },
851
850
  className: n,
852
- onMouseEnter: y,
851
+ onMouseEnter: x,
853
852
  onMouseLeave: b,
854
853
  children: [
855
854
  d && !a && /* @__PURE__ */ s.jsx(
@@ -869,7 +868,7 @@ const wt = ({
869
868
  /* @__PURE__ */ s.jsx(
870
869
  "img",
871
870
  {
872
- ref: p,
871
+ ref: m,
873
872
  src: e,
874
873
  alt: o,
875
874
  style: {
@@ -898,20 +897,20 @@ const wt = ({
898
897
  isActive: a,
899
898
  children: c
900
899
  }) => {
901
- const [d, m] = I(!1), p = C(null), y = C(null), b = () => {
902
- p.current && clearTimeout(p.current), m(!0);
900
+ const [d, p] = I(!1), m = C(null), x = C(null), b = () => {
901
+ m.current && clearTimeout(m.current), p(!0);
903
902
  }, l = () => {
904
- p.current = setTimeout(() => {
905
- m(!1);
903
+ m.current = setTimeout(() => {
904
+ p(!1);
906
905
  }, 120);
907
906
  };
908
907
  return $(() => () => {
909
- p.current && clearTimeout(p.current);
908
+ m.current && clearTimeout(m.current);
910
909
  }, []), /* @__PURE__ */ s.jsxs(
911
910
  "div",
912
911
  {
913
912
  className: "flex",
914
- ref: y,
913
+ ref: x,
915
914
  onMouseEnter: b,
916
915
  onMouseLeave: l,
917
916
  children: [
@@ -920,7 +919,7 @@ const wt = ({
920
919
  {
921
920
  to: e,
922
921
  onClick: () => {
923
- m(!1);
922
+ p(!1);
924
923
  },
925
924
  className: ie(
926
925
  "relative z-10 -mb-px flex items-center border-b-2 pt-px text-sm font-medium text-gray-700 cursor-pointer transition-colors duration-200 ease-out hover:text-gray-800",
@@ -943,7 +942,7 @@ const wt = ({
943
942
  className: "absolute inset-0 top-1/2 bg-white shadow-sm"
944
943
  }
945
944
  ),
946
- /* @__PURE__ */ s.jsx("div", { className: "relative bg-white", children: c({ setIsOpen: m }) })
945
+ /* @__PURE__ */ s.jsx("div", { className: "relative bg-white", children: c({ setIsOpen: p }) })
947
946
  ]
948
947
  }
949
948
  )
@@ -954,19 +953,19 @@ const wt = ({
954
953
  MenuPopover: at
955
954
  };
956
955
  export {
957
- pt as AddressAutocompleteInput,
958
- mt as ApplePayButton,
956
+ mt as AddressAutocompleteInput,
957
+ pt as ApplePayButton,
959
958
  gt as Checkbox,
960
959
  ft as DEFAULT_ADDRESS_BOUNDING_BOX,
961
960
  ht as Dialog,
962
961
  vt as DialogClose,
963
- Ze as DialogContent,
962
+ Qe as DialogContent,
964
963
  Et as DialogDescription,
965
- yt as DialogFooter,
964
+ xt as DialogFooter,
966
965
  _t as DialogHeader,
967
- Ke as DialogOverlay,
966
+ Ze as DialogOverlay,
968
967
  He as DialogPortal,
969
- xt as DialogTitle,
968
+ yt as DialogTitle,
970
969
  bt as DialogTrigger,
971
970
  Tt as Header,
972
971
  wt as Image,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/ui",
3
- "version": "0.51.0",
3
+ "version": "0.52.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "type": "module",
6
6
  "files": [