@wherabouts/react-ui 0.1.0 → 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 +21 -0
- package/README.md +27 -9
- package/dist/index.cjs +246 -257
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +97 -45
- package/dist/index.d.ts +97 -45
- package/dist/index.js +246 -257
- package/dist/index.js.map +1 -1
- package/dist/styles.css +52 -40
- package/docs/README.md +16 -0
- package/docs/address-autocomplete.md +208 -0
- package/docs/address-field-group.md +152 -0
- package/docs/address-form-field.md +198 -0
- package/docs/forward-geocode-input.md +115 -0
- package/docs/reverse-geocode-input.md +124 -0
- package/package.json +26 -19
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:**
|
|
10
|
-
> (
|
|
11
|
-
> vary by
|
|
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
|
|
|
@@ -73,8 +73,8 @@ keyboard navigation, and customizable rendering.
|
|
|
73
73
|
<AddressAutocomplete
|
|
74
74
|
client={client}
|
|
75
75
|
onSelect={(address) => setAddress(address)}
|
|
76
|
-
minCharsToSearch={
|
|
77
|
-
debounceMs={
|
|
76
|
+
minCharsToSearch={4}
|
|
77
|
+
debounceMs={250}
|
|
78
78
|
maxSuggestions={8}
|
|
79
79
|
enableGeolocation
|
|
80
80
|
/>
|
|
@@ -86,9 +86,9 @@ keyboard navigation, and customizable rendering.
|
|
|
86
86
|
| `onSelect` | `(address: AddressWithParsed) => void` | — | Called when a suggestion is chosen. |
|
|
87
87
|
| `onQueryChange` | `(query: string) => void` | — | Called as the input text changes. |
|
|
88
88
|
| `placeholder` | `string` | — | Input placeholder. |
|
|
89
|
-
| `debounceMs` | `number` | `
|
|
90
|
-
| `minCharsToSearch` | `number` | `
|
|
91
|
-
| `maxSuggestions` | `number` | `
|
|
89
|
+
| `debounceMs` | `number` | `300` | Debounce before querying the API. |
|
|
90
|
+
| `minCharsToSearch` | `number` | `2` | Minimum characters before searching. |
|
|
91
|
+
| `maxSuggestions` | `number` | `5` | Max suggestions to show. |
|
|
92
92
|
| `enableGeolocation` | `boolean` | `false` | Use the browser's location to bias results (proximity). |
|
|
93
93
|
| `userLat` / `userLng` | `number` | — | Explicit proximity bias instead of geolocation. |
|
|
94
94
|
| `sessionToken` | `string` | — | Group a run of keystrokes into one billable search (see `newSessionToken()` in the SDK). |
|
|
@@ -159,6 +159,24 @@ full address.
|
|
|
159
159
|
- Exported types: `AddressWithParsed`, `AddressI18nStrings`, `AddressValidateFn`,
|
|
160
160
|
`AddressSuggestionInput`, and each component's `*Props`.
|
|
161
161
|
|
|
162
|
+
## Per-component documentation
|
|
163
|
+
|
|
164
|
+
Full per-component guides — multiple examples, accessibility notes, and recipes —
|
|
165
|
+
live in [`docs/`](./docs/README.md).
|
|
166
|
+
|
|
167
|
+
## Interactive docs (Storybook)
|
|
168
|
+
|
|
169
|
+
This package ships a Storybook with live, interactive examples of every component.
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
pnpm --filter @wherabouts/react-ui storybook
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Live stories call the real API. Set `VITE_DEMO_API_KEY` (a publishable,
|
|
176
|
+
origin-scoped key) and optionally `VITE_DEMO_API_BASE_URL` (default
|
|
177
|
+
`https://api.wherabouts.com`) to enable results; without a key, components still
|
|
178
|
+
render with a configuration banner.
|
|
179
|
+
|
|
162
180
|
## Styling
|
|
163
181
|
|
|
164
182
|
The package ships a prebuilt `styles.css` (import it once, as shown above). Components use
|
|
@@ -172,5 +190,5 @@ payloads are fully typed.
|
|
|
172
190
|
|
|
173
191
|
## License
|
|
174
192
|
|
|
175
|
-
|
|
193
|
+
MIT — © Wherabouts.
|
|
176
194
|
</content>
|