@wherabouts/react-ui 0.1.1 → 0.3.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Wherabouts
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -6,9 +6,9 @@ address form fields. Built on [`@wherabouts/sdk`](https://www.npmjs.com/package/
6
6
  styled with Tailwind, and shipped with a prebuilt stylesheet so you can drop them in
7
7
  without any build setup.
8
8
 
9
- > **Coverage:** Authoritative Australian addresses (G-NAF). International coverage
10
- > (US, parts of the EU, and more) is in **beta** and rolling out — availability may
11
- > vary by deployment.
9
+ > **Coverage:** International authoritative open address datasets including
10
+ > Australia (G-NAF), the United States, Canada, and parts of Europe. Per-country
11
+ > depth and freshness vary by source.
12
12
 
13
13
  ## Requirements
14
14
 
@@ -190,5 +190,5 @@ payloads are fully typed.
190
190
 
191
191
  ## License
192
192
 
193
- UNLICENSED — © Wherabouts. See the repository for usage terms.
193
+ MIT — © Wherabouts.
194
194
  </content>
package/dist/index.cjs CHANGED
@@ -3,6 +3,7 @@
3
3
  var react$1 = require('@wherabouts/react');
4
4
  var react = require('react');
5
5
  var reactDom = require('react-dom');
6
+ var sdk = require('@wherabouts/sdk');
6
7
  var jsxRuntime = require('react/jsx-runtime');
7
8
 
8
9
  // src/components/address-autocomplete.tsx
@@ -2522,11 +2523,6 @@ var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
2522
2523
  function cn(...inputs) {
2523
2524
  return twMerge(clsx(inputs));
2524
2525
  }
2525
-
2526
- // src/utils/parse-address.ts
2527
- var COUNTRY_NAMES = {
2528
- AU: "Australia"
2529
- };
2530
2526
  function toAddressWithParsed(suggestion) {
2531
2527
  return {
2532
2528
  id: suggestion.id,
@@ -2537,7 +2533,7 @@ function toAddressWithParsed(suggestion) {
2537
2533
  suburb: suggestion.locality,
2538
2534
  state: suggestion.state,
2539
2535
  postcode: suggestion.postcode,
2540
- country: COUNTRY_NAMES[suggestion.country] ?? suggestion.country
2536
+ country: sdk.countryName(suggestion.country)
2541
2537
  };
2542
2538
  }
2543
2539
  var DEFAULT_I18N = {
@@ -2988,13 +2984,14 @@ function useForwardGeocode(client, query) {
2988
2984
  setError(null);
2989
2985
  return;
2990
2986
  }
2987
+ const activeQuery = query;
2991
2988
  const controller = new AbortController();
2992
2989
  async function fetch() {
2993
2990
  setLoading(true);
2994
2991
  setError(null);
2995
2992
  try {
2996
2993
  const response = await client.geocode.forward(
2997
- { q: query },
2994
+ { q: activeQuery },
2998
2995
  { signal: controller.signal }
2999
2996
  );
3000
2997
  if (controller.signal.aborted) {