@rpcbase/ui 0.51.0 → 0.53.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,5 +1,4 @@
1
- export declare const DEFAULT_ADDRESS_BOUNDING_BOX: google.maps.LatLngBoundsLiteral;
2
- export declare const AddressAutocompleteInput: ({ id, label, placeholder, value, onValueChange, disabled, name, className, autofillShimName, googleMapsApiKey, boundingBox, allowedTypes, }: {
1
+ export declare const AddressAutocompleteInput: ({ id, label, placeholder, value, onValueChange, disabled, name, className, autofillShimName, googleMapsApiKey, locationRestriction, allowedTypes, }: {
3
2
  id: string;
4
3
  label: string;
5
4
  placeholder: string;
@@ -10,7 +9,7 @@ export declare const AddressAutocompleteInput: ({ id, label, placeholder, value,
10
9
  className?: string;
11
10
  autofillShimName?: string;
12
11
  googleMapsApiKey?: string;
13
- boundingBox: google.maps.LatLngBoundsLiteral | google.maps.LatLngBounds;
12
+ locationRestriction: google.maps.LatLngBoundsLiteral | google.maps.LatLngBounds;
14
13
  allowedTypes?: Iterable<string>;
15
14
  }) => import("react/jsx-runtime").JSX.Element;
16
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/AddressAutocompleteInput/index.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,IAAI,CAAC,mBAKtD,CAAA;AA8ID,eAAO,MAAM,wBAAwB,GAAI,6IAatC;IACD,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAA;IACvE,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;CAChC,4CAwRA,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/AddressAutocompleteInput/index.tsx"],"names":[],"mappings":"AAoJA,eAAO,MAAM,wBAAwB,GAAI,qJAatC;IACD,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,mBAAmB,EAAE,MAAM,CAAC,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAA;IAC/E,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;CAChC,4CAwRA,CAAA"}
@@ -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";
@@ -75,14 +75,14 @@ function ke() {
75
75
  ), t.$$typeof) {
76
76
  case v:
77
77
  return "Portal";
78
- case R:
78
+ case P:
79
79
  return t.displayName || "Context";
80
80
  case j:
81
81
  return (t._context.displayName || "Context") + ".Consumer";
82
82
  case A:
83
83
  var i = t.render;
84
84
  return t = t.displayName, t || (t = i.displayName || i.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
85
- case P:
85
+ case R:
86
86
  return i = t.displayName || null, i !== null ? i : e(t.type) || "Memo";
87
87
  case Y:
88
88
  i = t._payload, t = t._init;
@@ -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
- return V[t] || (V[t] = !0, console.error(
155
+ return B[t] || (B[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"), P = Symbol.for("react.context"), A = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), F = Symbol.for("react.suspense_list"), R = 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, V = console.createTask ? console.createTask : function() {
247
247
  return null;
248
248
  };
249
249
  T = {
@@ -251,10 +251,10 @@ 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, B = {}, u = T.react_stack_bottom_frame.bind(
255
255
  T,
256
256
  c
257
- )(), E = B(n(c)), J = {};
257
+ )(), E = V(n(c)), J = {};
258
258
  H.Fragment = k, H.jsx = function(t, i, g) {
259
259
  var h = 1e4 > U.recentlyCreatedOwnerStacks++;
260
260
  return b(
@@ -263,7 +263,7 @@ React keys must be passed directly to JSX without using spread:
263
263
  g,
264
264
  !1,
265
265
  h ? Error("react-stack-top-frame") : u,
266
- h ? B(n(t)) : E
266
+ h ? V(n(t)) : E
267
267
  );
268
268
  }, H.jsxs = function(t, i, g) {
269
269
  var h = 1e4 > U.recentlyCreatedOwnerStacks++;
@@ -273,7 +273,7 @@ React keys must be passed directly to JSX without using spread:
273
273
  g,
274
274
  !0,
275
275
  h ? Error("react-stack-top-frame") : u,
276
- h ? B(n(t)) : E
276
+ h ? V(n(t)) : E
277
277
  );
278
278
  };
279
279
  })()), H;
@@ -283,15 +283,15 @@ function je() {
283
283
  return fe || (fe = 1, process.env.NODE_ENV === "production" ? ee.exports = Te() : ee.exports = ke()), ee.exports;
284
284
  }
285
285
  var s = je();
286
- function Re(e, r) {
286
+ function Pe(e, r) {
287
287
  e.src = r;
288
288
  }
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] + "");
289
+ const Re = (e) => {
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), Pe(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) => {
@@ -316,19 +316,18 @@ async function Le(e) {
316
316
  }
317
317
  function Ce(e) {
318
318
  const r = !!window.google?.maps?.importLibrary;
319
- r ? Ie(Ae(e)) : Me && document.querySelector('script[src*="maps.googleapis.com/maps/api/js"]') && le(Se), r || Pe(e);
319
+ r ? Ie(Ae(e)) : Me && document.querySelector('script[src*="maps.googleapis.com/maps/api/js"]') && le(Se), r || Re(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;
@@ -363,12 +362,7 @@ function he(e) {
363
362
  );
364
363
  }
365
364
  he.displayName = "Input";
366
- const ft = {
367
- north: 48.17277,
368
- south: 46.948101,
369
- east: 2.580919,
370
- west: -2.216823
371
- }, Fe = /* @__PURE__ */ new Set([
365
+ const Fe = /* @__PURE__ */ new Set([
372
366
  "street_address",
373
367
  "route",
374
368
  "premise",
@@ -404,13 +398,13 @@ const ft = {
404
398
  return /* @__PURE__ */ s.jsx(s.Fragment, { children: r });
405
399
  const c = [];
406
400
  let d = 0;
407
- return n.forEach((m, p) => {
408
- if (a && m.startOffset >= r.length)
401
+ return n.forEach((p, m) => {
402
+ if (a && p.startOffset >= r.length)
409
403
  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));
404
+ const x = p.startOffset, b = Math.min(p.endOffset, r.length);
405
+ if (x > d && c.push(r.substring(d, x)), b > x) {
406
+ const l = r.substring(x, b);
407
+ c.push(/* @__PURE__ */ s.jsx("strong", { children: l }, m));
414
408
  }
415
409
  d = Math.max(d, b);
416
410
  }), 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 });
@@ -420,10 +414,10 @@ const ft = {
420
414
  const n = o.placeId;
421
415
  n && (r.has(n) || r.set(n, o));
422
416
  }), Array.from(r.values());
423
- }, qe = (e, r) => e.filter((o) => Ue(o, r)), Be = (e) => e.sort((r, o) => {
417
+ }, qe = (e, r) => e.filter((o) => Ue(o, r)), Ve = (e) => e.sort((r, o) => {
424
418
  const n = r.distanceMeters ?? Number.POSITIVE_INFINITY, a = o.distanceMeters ?? Number.POSITIVE_INFINITY;
425
419
  return n - a;
426
- }), Ve = (e, r) => Be(qe(We(e), r)), Je = (e, r) => ce(e).toLowerCase() === r.trim().toLowerCase(), pt = ({
420
+ }), Be = (e, r) => Ve(qe(We(e), r)), Je = (e, r) => ce(e).toLowerCase() === r.trim().toLowerCase(), ft = ({
427
421
  id: e,
428
422
  label: r,
429
423
  placeholder: o,
@@ -431,13 +425,13 @@ const ft = {
431
425
  onValueChange: a,
432
426
  disabled: c,
433
427
  name: d,
434
- className: m,
435
- autofillShimName: p,
436
- googleMapsApiKey: y,
437
- boundingBox: b,
428
+ className: p,
429
+ autofillShimName: m,
430
+ googleMapsApiKey: x,
431
+ locationRestriction: b,
438
432
  allowedTypes: l
439
433
  }) => {
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(() => {
434
+ const [f, T] = I(n ?? ""), [w, v] = I([]), [k, y] = I(!1), [D, j] = I(-1), P = C(null), A = C(null), O = C(!1), F = C(!1), R = C(null), Y = ze("places", x), [W, Q] = I(null), U = xe(() => {
441
435
  if (!l)
442
436
  return Fe;
443
437
  const u = /* @__PURE__ */ new Set();
@@ -452,9 +446,9 @@ const ft = {
452
446
  return;
453
447
  let u = !0;
454
448
  return google.maps.importLibrary("places").then((E) => {
455
- u && Z(E);
449
+ u && Q(E);
456
450
  }).catch(() => {
457
- u && (console.error("AddressAutocompleteInput: failed to load places library"), Z(null));
451
+ u && (console.error("AddressAutocompleteInput: failed to load places library"), Q(null));
458
452
  }), () => {
459
453
  u = !1;
460
454
  };
@@ -468,33 +462,33 @@ const ft = {
468
462
  if (!u)
469
463
  return;
470
464
  if (f.trim() === "") {
471
- v([]), x(!1), P.current = null, n !== "" && a("");
465
+ v([]), y(!1), R.current = null, n !== "" && a("");
472
466
  return;
473
467
  }
474
468
  if (!W) return;
475
469
  const { AutocompleteSuggestion: t, AutocompleteSessionToken: i } = W;
476
470
  if (!t || !i) {
477
- console.error("AddressAutocompleteInput: missing AutocompleteSuggestion or AutocompleteSessionToken exports"), v([]), x(!1);
471
+ console.error("AddressAutocompleteInput: missing AutocompleteSuggestion or AutocompleteSessionToken exports"), v([]), y(!1);
478
472
  return;
479
473
  }
480
- P.current || (P.current = new i());
474
+ R.current || (R.current = new i());
481
475
  const g = {
482
476
  input: f,
483
- sessionToken: P.current ?? void 0,
477
+ sessionToken: R.current ?? void 0,
484
478
  locationRestriction: b,
485
479
  includedRegionCodes: ["fr"]
486
480
  };
487
481
  t.fetchAutocompleteSuggestions(g).then((h) => {
488
482
  if (!u)
489
483
  return;
490
- const G = h.suggestions.map((z) => z.placePrediction).filter((z) => !!z), S = Ve(G, U), _ = S[0], L = _ && S.length === 1 && Je(_, f);
484
+ const G = h.suggestions.map((z) => z.placePrediction).filter((z) => !!z), S = Be(G, U), _ = S[0], L = _ && S.length === 1 && Je(_, f);
491
485
  if (!F.current && L) {
492
- v(S), x(!1);
486
+ v(S), y(!1);
493
487
  return;
494
488
  }
495
- S.length > 0 ? (v(S), F.current && x(!0), j(-1)) : (v([]), x(!1));
489
+ S.length > 0 ? (v(S), F.current && y(!0), j(-1)) : (v([]), y(!1));
496
490
  }).catch((h) => {
497
- u && (console.error("AddressAutocompleteInput: suggestion fetch failed", h), v([]), x(!1));
491
+ u && (console.error("AddressAutocompleteInput: suggestion fetch failed", h), v([]), y(!1));
498
492
  });
499
493
  }, 300);
500
494
  return () => {
@@ -502,7 +496,7 @@ const ft = {
502
496
  };
503
497
  }, [f, W, a, n, b, U]), $(() => {
504
498
  const u = (E) => {
505
- R.current && !R.current.contains(E.target) && A.current && !A.current.contains(E.target) && x(!1);
499
+ P.current && !P.current.contains(E.target) && A.current && !A.current.contains(E.target) && y(!1);
506
500
  };
507
501
  return document.addEventListener("mousedown", u), () => {
508
502
  document.removeEventListener("mousedown", u);
@@ -511,25 +505,25 @@ const ft = {
511
505
  const q = (u) => {
512
506
  O.current = !0;
513
507
  const E = ce(u);
514
- T(E), a(E), v([]), x(!1), P.current = null;
508
+ T(E), a(E), v([]), y(!1), R.current = null;
515
509
  }, te = (u) => {
516
510
  F.current = !0, T(u.target.value);
517
- }, B = (u) => {
511
+ }, V = (u) => {
518
512
  if (!k || w.length === 0) {
519
- u.key === "Enter" && (u.preventDefault(), a(f), x(!1), P.current = null);
513
+ u.key === "Enter" && (u.preventDefault(), a(f), y(!1), R.current = null);
520
514
  return;
521
515
  }
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);
516
+ 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), R.current = null)) : u.key === "Escape" && y(!1);
517
+ }, K = () => {
518
+ y(!1), n !== f && a(f), R.current = null;
519
+ }, B = m ?? (d ? `${d}_shim` : void 0);
526
520
  return /* @__PURE__ */ s.jsxs("div", { className: "relative", children: [
527
- V && /* @__PURE__ */ s.jsx(
521
+ B && /* @__PURE__ */ s.jsx(
528
522
  "input",
529
523
  {
530
524
  tabIndex: -1,
531
525
  autoComplete: "street-address",
532
- name: V,
526
+ name: B,
533
527
  "aria-hidden": "true",
534
528
  className: "pointer-events-none absolute left-0 top-0 h-0 w-0 opacity-0"
535
529
  }
@@ -538,21 +532,21 @@ const ft = {
538
532
  /* @__PURE__ */ s.jsx(
539
533
  he,
540
534
  {
541
- ref: R,
535
+ ref: P,
542
536
  id: e,
543
537
  type: "text",
544
538
  placeholder: o,
545
539
  name: d ?? `${e}_input`,
546
540
  value: f,
547
541
  onChange: te,
548
- onKeyDown: B,
542
+ onKeyDown: V,
549
543
  onFocus: () => {
550
- w.length > 0 && f && x(!0);
544
+ w.length > 0 && f && y(!0);
551
545
  },
552
- onBlur: Q,
546
+ onBlur: K,
553
547
  disabled: c,
554
548
  autoComplete: "off",
555
- className: M("w-full", m)
549
+ className: M("w-full", p)
556
550
  }
557
551
  ),
558
552
  k && w.length > 0 && /* @__PURE__ */ s.jsx(
@@ -600,7 +594,7 @@ const ft = {
600
594
  ), Xe = {
601
595
  red: "checked:border-red-700 checked:bg-red-700 indeterminate:border-red-700 indeterminate:bg-red-700 focus-visible:outline-red-700",
602
596
  sky: "checked:border-sky-600 checked:bg-sky-600 indeterminate:border-sky-600 indeterminate:bg-sky-600 focus-visible:outline-sky-600"
603
- }, gt = ({
597
+ }, pt = ({
604
598
  id: e,
605
599
  name: r,
606
600
  defaultValue: o,
@@ -608,14 +602,14 @@ const ft = {
608
602
  checked: a,
609
603
  onChange: c,
610
604
  color: d = "sky",
611
- ...m
605
+ ...p
612
606
  }) => {
613
- const p = Xe[d];
607
+ const m = Xe[d];
614
608
  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
609
  /* @__PURE__ */ s.jsx(
616
610
  "input",
617
611
  {
618
- ...m,
612
+ ...p,
619
613
  id: e,
620
614
  name: r,
621
615
  type: "checkbox",
@@ -623,7 +617,7 @@ const ft = {
623
617
  defaultChecked: n,
624
618
  checked: a,
625
619
  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}`
620
+ 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
621
  }
628
622
  ),
629
623
  /* @__PURE__ */ s.jsxs(
@@ -658,12 +652,12 @@ const ft = {
658
652
  )
659
653
  ] }) });
660
654
  };
661
- function ht({
655
+ function gt({
662
656
  ...e
663
657
  }) {
664
658
  return /* @__PURE__ */ s.jsx(N.Root, { "data-slot": "dialog", ...e });
665
659
  }
666
- function bt({
660
+ function ht({
667
661
  ...e
668
662
  }) {
669
663
  return /* @__PURE__ */ s.jsx(N.Trigger, { "data-slot": "dialog-trigger", ...e });
@@ -673,12 +667,12 @@ function He({
673
667
  }) {
674
668
  return /* @__PURE__ */ s.jsx(N.Portal, { "data-slot": "dialog-portal", ...e });
675
669
  }
676
- function vt({
670
+ function bt({
677
671
  ...e
678
672
  }) {
679
673
  return /* @__PURE__ */ s.jsx(N.Close, { "data-slot": "dialog-close", ...e });
680
674
  }
681
- function Ke({
675
+ function Ze({
682
676
  className: e,
683
677
  ...r
684
678
  }) {
@@ -694,7 +688,7 @@ function Ke({
694
688
  }
695
689
  );
696
690
  }
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(
691
+ 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
692
  N.Content,
699
693
  {
700
694
  ref: c,
@@ -723,8 +717,8 @@ const Ze = ve.forwardRef(({ className: e, children: r, showCloseButton: o = !0,
723
717
  ]
724
718
  }
725
719
  ) }) }));
726
- Ze.displayName = N.Content.displayName;
727
- function _t({ className: e, ...r }) {
720
+ Qe.displayName = N.Content.displayName;
721
+ function vt({ className: e, ...r }) {
728
722
  return /* @__PURE__ */ s.jsx(
729
723
  "div",
730
724
  {
@@ -734,7 +728,7 @@ function _t({ className: e, ...r }) {
734
728
  }
735
729
  );
736
730
  }
737
- function yt({ className: e, ...r }) {
731
+ function _t({ className: e, ...r }) {
738
732
  return /* @__PURE__ */ s.jsx(
739
733
  "div",
740
734
  {
@@ -757,7 +751,7 @@ function xt({
757
751
  }
758
752
  );
759
753
  }
760
- function Et({
754
+ function yt({
761
755
  className: e,
762
756
  ...r
763
757
  }) {
@@ -770,10 +764,10 @@ function Et({
770
764
  }
771
765
  );
772
766
  }
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) => {
767
+ 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
768
  let r = 0;
775
769
  for (let o = 0; o < e.length; o++) {
776
- let n = e[o], a = Qe.indexOf(n);
770
+ let n = e[o], a = Ke.indexOf(n);
777
771
  r = r * 83 + a;
778
772
  }
779
773
  return r;
@@ -783,14 +777,14 @@ var Qe = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D",
783
777
  }, ne = (e) => {
784
778
  let r = Math.max(0, Math.min(1, e));
785
779
  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 {
780
+ }, et = (e) => e < 0 ? -1 : 1, se = (e, r) => et(e) * Math.pow(Math.abs(e), r), pe = class extends Error {
787
781
  constructor(e) {
788
782
  super(e), this.name = "ValidationError", this.message = e;
789
783
  }
790
784
  }, 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}`);
785
+ if (!e || e.length < 6) throw new pe("The blurhash string must be at least 6 characters");
786
+ let r = Z(e[0]), o = Math.floor(r / 9) + 1, n = r % 9 + 1;
787
+ 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
788
  }, rt = (e) => {
795
789
  let r = e >> 16, o = e >> 8 & 255, n = e & 255;
796
790
  return [oe(r), oe(o), oe(n)];
@@ -799,49 +793,49 @@ var Qe = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D",
799
793
  return [se((o - 9) / 9, 2) * r, se((n - 9) / 9, 2) * r, se((a - 9) / 9, 2) * r];
800
794
  }, nt = (e, r, o, n) => {
801
795
  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);
796
+ 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);
797
+ for (let l = 0; l < m.length; l++) if (l === 0) {
798
+ let f = Z(e.substring(2, 6));
799
+ m[l] = rt(f);
806
800
  } else {
807
- let f = K(e.substring(4 + l * 2, 6 + l * 2));
808
- p[l] = ot(f, m * n);
801
+ let f = Z(e.substring(4 + l * 2, 6 + l * 2));
802
+ m[l] = ot(f, p * n);
809
803
  }
810
- let y = r * 4, b = new Uint8ClampedArray(y * o);
804
+ let x = r * 4, b = new Uint8ClampedArray(x * o);
811
805
  for (let l = 0; l < o; l++) for (let f = 0; f < r; f++) {
812
806
  let T = 0, w = 0, v = 0;
813
- 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];
807
+ for (let j = 0; j < c; j++) for (let P = 0; P < d; P++) {
808
+ let A = Math.cos(Math.PI * f * P / r) * Math.cos(Math.PI * l * j / o), O = m[P + j * d];
815
809
  T += O[0] * A, w += O[1] * A, v += O[2] * A;
816
810
  }
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;
811
+ let k = ne(T), y = ne(w), D = ne(v);
812
+ 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
813
  }
820
814
  return b;
821
815
  }, st = nt;
822
- const wt = ({
816
+ const Et = ({
823
817
  src: e,
824
818
  hash: r,
825
819
  alt: o = "",
826
820
  className: n
827
821
  }) => {
828
- const [a, c] = I(!1), [d, m] = I(null), p = C(null);
822
+ const [a, c] = I(!1), [d, p] = I(null), m = C(null);
829
823
  $(() => {
830
824
  if (!r) return;
831
825
  const [l, f, T] = r, w = st(T, l, f), v = document.createElement("canvas"), k = v.getContext("2d");
832
826
  if (k) {
833
827
  v.width = l, v.height = f;
834
- const x = new ImageData(
828
+ const y = new ImageData(
835
829
  new Uint8ClampedArray(w),
836
830
  l,
837
831
  f
838
832
  );
839
- k.putImageData(x, 0, 0), m(v.toDataURL());
833
+ k.putImageData(y, 0, 0), p(v.toDataURL());
840
834
  }
841
835
  }, [r]), $(() => {
842
- p.current && p.current.complete && c(!0);
836
+ m.current && m.current.complete && c(!0);
843
837
  }, [e]);
844
- const y = () => {
838
+ const x = () => {
845
839
  }, b = () => {
846
840
  };
847
841
  return /* @__PURE__ */ s.jsxs(
@@ -849,7 +843,7 @@ const wt = ({
849
843
  {
850
844
  style: { position: "relative", overflow: "hidden" },
851
845
  className: n,
852
- onMouseEnter: y,
846
+ onMouseEnter: x,
853
847
  onMouseLeave: b,
854
848
  children: [
855
849
  d && !a && /* @__PURE__ */ s.jsx(
@@ -869,7 +863,7 @@ const wt = ({
869
863
  /* @__PURE__ */ s.jsx(
870
864
  "img",
871
865
  {
872
- ref: p,
866
+ ref: m,
873
867
  src: e,
874
868
  alt: o,
875
869
  style: {
@@ -898,20 +892,20 @@ const wt = ({
898
892
  isActive: a,
899
893
  children: c
900
894
  }) => {
901
- const [d, m] = I(!1), p = C(null), y = C(null), b = () => {
902
- p.current && clearTimeout(p.current), m(!0);
895
+ const [d, p] = I(!1), m = C(null), x = C(null), b = () => {
896
+ m.current && clearTimeout(m.current), p(!0);
903
897
  }, l = () => {
904
- p.current = setTimeout(() => {
905
- m(!1);
898
+ m.current = setTimeout(() => {
899
+ p(!1);
906
900
  }, 120);
907
901
  };
908
902
  return $(() => () => {
909
- p.current && clearTimeout(p.current);
903
+ m.current && clearTimeout(m.current);
910
904
  }, []), /* @__PURE__ */ s.jsxs(
911
905
  "div",
912
906
  {
913
907
  className: "flex",
914
- ref: y,
908
+ ref: x,
915
909
  onMouseEnter: b,
916
910
  onMouseLeave: l,
917
911
  children: [
@@ -920,7 +914,7 @@ const wt = ({
920
914
  {
921
915
  to: e,
922
916
  onClick: () => {
923
- m(!1);
917
+ p(!1);
924
918
  },
925
919
  className: ie(
926
920
  "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,33 +937,32 @@ const wt = ({
943
937
  className: "absolute inset-0 top-1/2 bg-white shadow-sm"
944
938
  }
945
939
  ),
946
- /* @__PURE__ */ s.jsx("div", { className: "relative bg-white", children: c({ setIsOpen: m }) })
940
+ /* @__PURE__ */ s.jsx("div", { className: "relative bg-white", children: c({ setIsOpen: p }) })
947
941
  ]
948
942
  }
949
943
  )
950
944
  ]
951
945
  }
952
946
  );
953
- }, Tt = {
947
+ }, wt = {
954
948
  MenuPopover: at
955
949
  };
956
950
  export {
957
- pt as AddressAutocompleteInput,
951
+ ft as AddressAutocompleteInput,
958
952
  mt as ApplePayButton,
959
- gt as Checkbox,
960
- ft as DEFAULT_ADDRESS_BOUNDING_BOX,
961
- ht as Dialog,
962
- vt as DialogClose,
963
- Ze as DialogContent,
964
- Et as DialogDescription,
965
- yt as DialogFooter,
966
- _t as DialogHeader,
967
- Ke as DialogOverlay,
953
+ pt as Checkbox,
954
+ gt as Dialog,
955
+ bt as DialogClose,
956
+ Qe as DialogContent,
957
+ yt as DialogDescription,
958
+ _t as DialogFooter,
959
+ vt as DialogHeader,
960
+ Ze as DialogOverlay,
968
961
  He as DialogPortal,
969
962
  xt as DialogTitle,
970
- bt as DialogTrigger,
971
- Tt as Header,
972
- wt as Image,
963
+ ht as DialogTrigger,
964
+ wt as Header,
965
+ Et as Image,
973
966
  he as Input,
974
967
  dt as isMobileDevice
975
968
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/ui",
3
- "version": "0.51.0",
3
+ "version": "0.53.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "type": "module",
6
6
  "files": [