Cal.comdesign-system

Maps Address Field

Address autocomplete via Cal’s Google Places proxy, with optional free-text fallback.

Address field used for in-person locations, form-builder address questions, and discover business profiles. Production imports the lazy wrapper so Places deps stay out of the initial bundle.

Ownership

Feature — not @coss/ui/shared. Suggestions come from POST /api/google-places/autocomplete (server-side API key). By default, when Places is unconfigured the field falls back to free text. Discover passes strictPlaces so free-text fallback is disabled and the input locks when Places is unavailable. That proxy contract and validity semantics (onValidityChange) keep it Feature-owned.

Example

Use the lazy Feature import in product code. Discover requires a Places city selection for physical businesses and blocks free-form text when Places is down:

This is the canonical composition when place confirmation matters — Discover wires onValidityChange + strictPlaces. Event-type in-person address (LocationInput) and booking edit-location omit validity gating and wire the field through React Hook Form Controller. The real component owns debouncing, request cancellation, suggestion caching, Places attribution, and (by default) free-text fallback when the proxy is unconfigured.

API

Implementation lives in google-maps-address.tsx; product code should import google-maps-address-lazy.

Call sites

Example URLs

Not exhaustive — a few places you can open locally (e.g. http://localhost:3000) to see this in product.

Source