@adoptaunabuelo/react-components 0.1.12 → 0.1.13

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,3 +1,4 @@
1
+ /// <reference types="google.maps" />
1
2
  import { ReactElement, CSSProperties } from 'react';
2
3
  import { InputStyledProps } from './InputStyled';
3
4
  declare const Input: (props: Props) => import("react/jsx-runtime").JSX.Element;
@@ -15,4 +16,9 @@ export interface Props extends InputStyledProps {
15
16
  country?: string;
16
17
  design?: 'primary' | 'secondary';
17
18
  onPhoneChange?: (item: any) => void;
19
+ onLocationChange?: (result: {
20
+ address: string;
21
+ geocoder: google.maps.GeocoderResult;
22
+ location: google.maps.LatLngLiteral;
23
+ }) => void;
18
24
  }
@@ -4,6 +4,7 @@ declare const InputLocation: (props: Props) => import("react/jsx-runtime").JSX.E
4
4
  export default InputLocation;
5
5
  export interface Props extends InputSecondaryProps {
6
6
  onLocationChange?: (result: {
7
+ address: string;
7
8
  geocoder: google.maps.GeocoderResult;
8
9
  location: google.maps.LatLngLiteral;
9
10
  }) => void;
package/dist/esm/index.js CHANGED
@@ -499,7 +499,7 @@ var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__p
499
499
  :hover{
500
500
  background-color: ${Color.background.soft};
501
501
  }
502
- `,InputLocation=e=>{const[t,a]=useState(void 0);return jsx(_default,Object.assign({value:t,onChange:e=>{a(e)},onSelect:t=>__awaiter$1(void 0,void 0,void 0,(function*(){a(t);const r=yield geocodeByAddress(t),n=yield getLatLng(r[0]);e.onLocationChange&&e.onLocationChange({geocoder:r[0],location:n})})),searchOptions:{types:["geocode"]}},{children:({getInputProps:a,suggestions:r,getSuggestionItemProps:n})=>jsxs(SearchView,{children:[jsx(InputSecondary,Object.assign({},a({className:"location-search-input",placeholder:e.placeholder}),{containerStyle:{flex:1},value:t})),r.length>0&&jsx(DropdownMenu,Object.assign({role:"menu"},{children:r.map(((e,t)=>jsx(SuggestionView,Object.assign({},n(e),{role:"cell"+t},{children:jsx(Text,Object.assign({type:"p2",style:{textOverflow:"ellipsis"}},{children:e.description}))}))))}))]})}))},Input=e=>"range"===e.type?jsx(InputRange,Object.assign({},e)):"location"===e.type?jsx(InputLocation,Object.assign({},e)):"secondary"===e.design?jsx(InputSecondary,Object.assign({},e)):jsx(InputPrimary,Object.assign({},e)),Container=qe.div`
502
+ `,InputLocation=e=>{const[t,a]=useState(void 0);return jsx(_default,Object.assign({value:t,onChange:e=>{a(e)},onSelect:t=>__awaiter$1(void 0,void 0,void 0,(function*(){a(t);const r=yield geocodeByAddress(t),n=yield getLatLng(r[0]);e.onLocationChange&&e.onLocationChange({address:t,geocoder:r[0],location:n})})),searchOptions:{types:["geocode"]}},{children:({getInputProps:a,suggestions:r,getSuggestionItemProps:n})=>jsxs(SearchView,{children:[jsx(InputSecondary,Object.assign({},a({className:"location-search-input",placeholder:e.placeholder}),{containerStyle:{flex:1},value:t})),r.length>0&&jsx(DropdownMenu,Object.assign({role:"menu"},{children:r.map(((e,t)=>jsx(SuggestionView,Object.assign({},n(e),{role:"cell"+t},{children:jsx(Text,Object.assign({type:"p2",style:{textOverflow:"ellipsis"}},{children:e.description}))}))))}))]})}))},Input=e=>"range"===e.type?jsx(InputRange,Object.assign({},e)):"location"===e.type?jsx(InputLocation,Object.assign({},e)):"secondary"===e.design?jsx(InputSecondary,Object.assign({},e)):jsx(InputPrimary,Object.assign({},e)),Container=qe.div`
503
503
  position: relative;
504
504
  `,SelectStyled=qe.div`
505
505
  display: flex;