@mountainpass/addressr-svelte 0.6.1 → 0.7.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.
Files changed (2) hide show
  1. package/README.md +20 -0
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -162,6 +162,26 @@ Implements the WAI-ARIA combobox pattern:
162
162
  - Accessible label always present
163
163
  - Infinite scroll with loading indicator
164
164
 
165
+ ## Postcode, Locality, and State search
166
+
167
+ For narrower lookups (postcode-only picker on a shipping form, suburb autocomplete, state dropdown) the package also exports three drop-in components and matching headless stores. Each mirrors `AddressAutocomplete`'s a11y, keyboard, and slot contract; the only difference is `onSelect` receives the `SearchResult` directly (no follow-up detail fetch — see ADR 006).
168
+
169
+ ```svelte
170
+ <script>
171
+ import {
172
+ PostcodeAutocomplete,
173
+ LocalityAutocomplete,
174
+ StateAutocomplete,
175
+ } from '@mountainpass/addressr-svelte';
176
+ </script>
177
+
178
+ <PostcodeAutocomplete apiKey="..." onSelect={(r) => console.log(r.postcode, r.localities)} />
179
+ <LocalityAutocomplete apiKey="..." onSelect={(r) => console.log(r.name, r.state.abbreviation, r.postcode)} />
180
+ <StateAutocomplete apiKey="..." onSelect={(r) => console.log(r.name, r.abbreviation)} />
181
+ ```
182
+
183
+ Headless equivalents `createPostcodeSearch`, `createLocalitySearch`, `createStateSearch` are also exported and follow the same shape as `createAddressSearch`.
184
+
165
185
  ## Re-exports
166
186
 
167
187
  This package re-exports everything from [`@mountainpass/addressr-core`](../core) for convenience -- `createAddressrClient`, `parseHighlight`, and all types.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mountainpass/addressr-svelte",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "description": "Svelte address autocomplete component for Australian address search via Addressr",
5
5
  "author": {
6
6
  "name": "Mountain Pass",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@windyroad/link-header": "^1.0.1",
38
- "@mountainpass/addressr-core": "0.6.1"
38
+ "@mountainpass/addressr-core": "0.7.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@sveltejs/vite-plugin-svelte": "^5.0.3",