@arkyn/components 1.3.99 → 1.3.100

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  import { GoogleMapProps } from "@arkyn/types";
2
2
  import "./styles.css";
3
- declare function GoogleMap({ coordinates, zoom, draggable, googleMapsApiKey, className, ...rest }: GoogleMapProps): import("react/jsx-runtime").JSX.Element;
3
+ declare function GoogleMap({ coordinates, zoom, draggable, className, ...rest }: GoogleMapProps): import("react/jsx-runtime").JSX.Element;
4
4
  export { GoogleMap };
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/GoogleMap/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI9C,OAAO,cAAc,CAAC;AAEtB,iBAAS,SAAS,CAAC,EACjB,WAAW,EACX,IAAS,EACT,SAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,GAAG,IAAI,EACR,EAAE,cAAc,2CAkChB;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/GoogleMap/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI9C,OAAO,cAAc,CAAC;AAEtB,iBAAS,SAAS,CAAC,EACjB,WAAW,EACX,IAAS,EACT,SAAiB,EACjB,SAAS,EACT,GAAG,IAAI,EACR,EAAE,cAAc,2CAwBhB;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1,15 +1,15 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { LoadScript, GoogleMap as Map, Marker } from "@react-google-maps/api";
3
- import { LoaderIcon, MapPinned } from "lucide-react";
2
+ import { GoogleMap as Map, Marker } from "@react-google-maps/api";
3
+ import { MapPinned } from "lucide-react";
4
4
  import "./styles.css";
5
- function GoogleMap({ coordinates, zoom = 18, draggable = false, googleMapsApiKey, className, ...rest }) {
5
+ function GoogleMap({ coordinates, zoom = 18, draggable = false, className, ...rest }) {
6
6
  if (!coordinates) {
7
7
  return (_jsx("div", { className: "arkynGoogleMapPinnedEmpty " + className, ...rest, children: _jsx(MapPinned, {}) }));
8
8
  }
9
- return (_jsx("div", { className: "arkynGoogleMapPinned " + className, ...rest, children: _jsx(LoadScript, { libraries: ["maps", "marker"], googleMapsApiKey: googleMapsApiKey, loadingElement: _jsx("div", { className: "arkynGoogleMapPinnedEmpty " + className, ...rest, children: _jsx(LoaderIcon, {}) }), children: _jsx(Map, { zoom: zoom, center: coordinates, mapContainerStyle: {
10
- borderRadius: "var(--rounded-cards)",
11
- width: "100%",
12
- height: "100%",
13
- }, children: _jsx(Marker, { draggable: draggable, position: coordinates }) }) }) }));
9
+ return (_jsx("div", { className: "arkynGoogleMapPinned " + className, ...rest, children: _jsx(Map, { zoom: zoom, center: coordinates, mapContainerStyle: {
10
+ borderRadius: "var(--rounded-cards)",
11
+ width: "100%",
12
+ height: "100%",
13
+ }, children: _jsx(Marker, { draggable: draggable, position: coordinates }) }) }));
14
14
  }
15
15
  export { GoogleMap };
@@ -1,4 +1,4 @@
1
1
  import { GoogleSearchPlacesProps } from "@arkyn/types";
2
- declare function GoogleSearchPlaces({ googleMapsApiKey, onChange, options, ...rest }: GoogleSearchPlacesProps): import("react/jsx-runtime").JSX.Element;
2
+ declare function GoogleSearchPlaces({ onChange, options, ...rest }: GoogleSearchPlacesProps): import("react/jsx-runtime").JSX.Element;
3
3
  export { GoogleSearchPlaces };
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/GoogleSearchPlaces/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAYvD,iBAAS,kBAAkB,CAAC,EAC1B,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,GAAG,IAAI,EACR,EAAE,uBAAuB,2CAuDzB;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/GoogleSearchPlaces/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAYvD,iBAAS,kBAAkB,CAAC,EAC1B,QAAQ,EACR,OAAO,EACP,GAAG,IAAI,EACR,EAAE,uBAAuB,2CAiDzB;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { LoadScript, StandaloneSearchBox } from "@react-google-maps/api";
2
+ import { StandaloneSearchBox } from "@react-google-maps/api";
3
3
  import { useState } from "react";
4
4
  import { Input } from "../Input";
5
- function GoogleSearchPlaces({ googleMapsApiKey, onChange, options, ...rest }) {
5
+ function GoogleSearchPlaces({ onChange, options, ...rest }) {
6
6
  const [searchBox, setSearchBox] = useState(null);
7
7
  const handleLoad = (ref) => setSearchBox(ref);
8
8
  const handlePlacesChanged = () => {
@@ -34,6 +34,6 @@ function GoogleSearchPlaces({ googleMapsApiKey, onChange, options, ...rest }) {
34
34
  onChange && onChange(sendPlace);
35
35
  }
36
36
  };
37
- return (_jsx(LoadScript, { libraries: ["places"], googleMapsApiKey: googleMapsApiKey, loadingElement: _jsx(Input, { type: "text", ...rest }), children: _jsx(StandaloneSearchBox, { onLoad: handleLoad, onPlacesChanged: handlePlacesChanged, options: options, children: _jsx(Input, { type: "text", ...rest }) }) }));
37
+ return (_jsx(StandaloneSearchBox, { onLoad: handleLoad, onPlacesChanged: handlePlacesChanged, options: options, children: _jsx(Input, { type: "text", ...rest }) }));
38
38
  }
39
39
  export { GoogleSearchPlaces };
package/dist/index.d.ts CHANGED
@@ -28,6 +28,7 @@ export { useDrawer } from "./hooks/useDrawer";
28
28
  export { useModal } from "./hooks/useModal";
29
29
  export { useScopedParams } from "./hooks/useScopedParams";
30
30
  export { useToast } from "./hooks/useToast";
31
+ export { GoogleProvider } from "./provider/GoogleProvider";
31
32
  export { DrawerProvider } from "./provider/DrawerProvider";
32
33
  export { ModalProvider } from "./provider/ModalProvider";
33
34
  export { ToastProvider } from "./provider/ToastProvider";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,UAAU,GACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,SAAS,EACT,YAAY,EACZ,cAAc,EACd,WAAW,EACX,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MA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AE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC"}
package/dist/index.js CHANGED
@@ -34,6 +34,7 @@ export { useModal } from "./hooks/useModal";
34
34
  export { useScopedParams } from "./hooks/useScopedParams";
35
35
  export { useToast } from "./hooks/useToast";
36
36
  // Providers
37
+ export { GoogleProvider } from "./provider/GoogleProvider";
37
38
  export { DrawerProvider } from "./provider/DrawerProvider";
38
39
  export { ModalProvider } from "./provider/ModalProvider";
39
40
  export { ToastProvider } from "./provider/ToastProvider";
@@ -0,0 +1,4 @@
1
+ import { GoogleProviderProps } from "@arkyn/types";
2
+ declare function GoogleProvider(props: GoogleProviderProps): import("react/jsx-runtime").JSX.Element;
3
+ export { GoogleProvider };
4
+ //# sourceMappingURL=GoogleProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoogleProvider.d.ts","sourceRoot":"","sources":["../../src/provider/GoogleProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,iBAAS,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CAKjD;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { LoadScript } from "@react-google-maps/api";
3
+ function GoogleProvider(props) {
4
+ const googleKey = props.googleMapsApiKey + "&loading=async&callback=initMap";
5
+ return (_jsx(LoadScript, { googleMapsApiKey: googleKey, version: "weekly", ...props }));
6
+ }
7
+ export { GoogleProvider };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkyn/components",
3
- "version": "1.3.99",
3
+ "version": "1.3.100",
4
4
  "main": "./dist/bundle.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Lucas Gonçalves",
@@ -8,7 +8,6 @@ function GoogleMap({
8
8
  coordinates,
9
9
  zoom = 18,
10
10
  draggable = false,
11
- googleMapsApiKey,
12
11
  className,
13
12
  ...rest
14
13
  }: GoogleMapProps) {
@@ -22,27 +21,17 @@ function GoogleMap({
22
21
 
23
22
  return (
24
23
  <div className={"arkynGoogleMapPinned " + className} {...rest}>
25
- <LoadScript
26
- libraries={["maps", "marker"]}
27
- googleMapsApiKey={googleMapsApiKey}
28
- loadingElement={
29
- <div className={"arkynGoogleMapPinnedEmpty " + className} {...rest}>
30
- <LoaderIcon />
31
- </div>
32
- }
24
+ <Map
25
+ zoom={zoom}
26
+ center={coordinates}
27
+ mapContainerStyle={{
28
+ borderRadius: "var(--rounded-cards)",
29
+ width: "100%",
30
+ height: "100%",
31
+ }}
33
32
  >
34
- <Map
35
- zoom={zoom}
36
- center={coordinates}
37
- mapContainerStyle={{
38
- borderRadius: "var(--rounded-cards)",
39
- width: "100%",
40
- height: "100%",
41
- }}
42
- >
43
- <Marker draggable={draggable} position={coordinates} />
44
- </Map>
45
- </LoadScript>
33
+ <Marker draggable={draggable} position={coordinates} />
34
+ </Map>
46
35
  </div>
47
36
  );
48
37
  }
@@ -1,5 +1,5 @@
1
1
  import { GoogleSearchPlacesProps } from "@arkyn/types";
2
- import { LoadScript, StandaloneSearchBox } from "@react-google-maps/api";
2
+ import { StandaloneSearchBox } from "@react-google-maps/api";
3
3
  import { useState } from "react";
4
4
 
5
5
  import { Input } from "../Input";
@@ -11,7 +11,6 @@ type AddressComponentsType = {
11
11
  }[];
12
12
 
13
13
  function GoogleSearchPlaces({
14
- googleMapsApiKey,
15
14
  onChange,
16
15
  options,
17
16
  ...rest
@@ -56,19 +55,13 @@ function GoogleSearchPlaces({
56
55
  };
57
56
 
58
57
  return (
59
- <LoadScript
60
- libraries={["places"]}
61
- googleMapsApiKey={googleMapsApiKey}
62
- loadingElement={<Input type="text" {...rest} />}
58
+ <StandaloneSearchBox
59
+ onLoad={handleLoad}
60
+ onPlacesChanged={handlePlacesChanged}
61
+ options={options}
63
62
  >
64
- <StandaloneSearchBox
65
- onLoad={handleLoad}
66
- onPlacesChanged={handlePlacesChanged}
67
- options={options}
68
- >
69
- <Input type="text" {...rest} />
70
- </StandaloneSearchBox>
71
- </LoadScript>
63
+ <Input type="text" {...rest} />
64
+ </StandaloneSearchBox>
72
65
  );
73
66
  }
74
67
 
package/src/index.ts CHANGED
@@ -51,6 +51,7 @@ export { useScopedParams } from "./hooks/useScopedParams";
51
51
  export { useToast } from "./hooks/useToast";
52
52
 
53
53
  // Providers
54
+ export { GoogleProvider } from "./provider/GoogleProvider";
54
55
  export { DrawerProvider } from "./provider/DrawerProvider";
55
56
  export { ModalProvider } from "./provider/ModalProvider";
56
57
  export { ToastProvider } from "./provider/ToastProvider";
@@ -0,0 +1,11 @@
1
+ import { GoogleProviderProps } from "@arkyn/types";
2
+ import { LoadScript } from "@react-google-maps/api";
3
+
4
+ function GoogleProvider(props: GoogleProviderProps) {
5
+ const googleKey = props.googleMapsApiKey + "&loading=async&callback=initMap";
6
+ return (
7
+ <LoadScript googleMapsApiKey={googleKey} version="weekly" {...props} />
8
+ );
9
+ }
10
+
11
+ export { GoogleProvider };