@arkyn/components 1.3.99 → 1.3.101
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/bundle.js +1067 -1076
- package/dist/bundle.umd.cjs +16 -16
- package/dist/components/GoogleMap/index.d.ts +1 -1
- package/dist/components/GoogleMap/index.d.ts.map +1 -1
- package/dist/components/GoogleMap/index.js +8 -8
- package/dist/components/GoogleSearchPlaces/index.d.ts +1 -1
- package/dist/components/GoogleSearchPlaces/index.d.ts.map +1 -1
- package/dist/components/GoogleSearchPlaces/index.js +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/provider/GoogleProvider.d.ts +4 -0
- package/dist/provider/GoogleProvider.d.ts.map +1 -0
- package/dist/provider/GoogleProvider.js +7 -0
- package/package.json +1 -1
- package/src/components/GoogleMap/index.tsx +12 -23
- package/src/components/GoogleSearchPlaces/index.tsx +7 -14
- package/src/index.ts +1 -0
- package/src/provider/GoogleProvider.tsx +18 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
import { GoogleMapProps } from "@arkyn/types";
|
2
2
|
import "./styles.css";
|
3
|
-
declare function GoogleMap({ coordinates, zoom, draggable,
|
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,
|
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 {
|
3
|
-
import {
|
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,
|
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(
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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({
|
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,
|
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 {
|
2
|
+
import { StandaloneSearchBox } from "@react-google-maps/api";
|
3
3
|
import { useState } from "react";
|
4
4
|
import { Input } from "../Input";
|
5
|
-
function GoogleSearchPlaces({
|
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(
|
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";
|
package/dist/index.d.ts.map
CHANGED
@@ -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,MAAM,iCAAiC,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a,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 @@
|
|
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,EACtB,gBAAgB,EAChB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,mBAAmB,2CAQrB;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({ googleMapsApiKey, children, ...props }) {
|
4
|
+
const googleKey = googleMapsApiKey + "&loading=async&callback=initMap";
|
5
|
+
return (_jsx(LoadScript, { googleMapsApiKey: googleKey, version: "weekly", ...props, children: children }));
|
6
|
+
}
|
7
|
+
export { GoogleProvider };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { GoogleMapProps } from "@arkyn/types";
|
2
|
-
import {
|
3
|
-
import {
|
2
|
+
import { GoogleMap as Map, Marker } from "@react-google-maps/api";
|
3
|
+
import { MapPinned } from "lucide-react";
|
4
4
|
|
5
5
|
import "./styles.css";
|
6
6
|
|
@@ -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
|
-
<
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
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
|
-
<
|
35
|
-
|
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 {
|
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
|
-
<
|
60
|
-
|
61
|
-
|
62
|
-
|
58
|
+
<StandaloneSearchBox
|
59
|
+
onLoad={handleLoad}
|
60
|
+
onPlacesChanged={handlePlacesChanged}
|
61
|
+
options={options}
|
63
62
|
>
|
64
|
-
<
|
65
|
-
|
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,18 @@
|
|
1
|
+
import { GoogleProviderProps } from "@arkyn/types";
|
2
|
+
import { LoadScript } from "@react-google-maps/api";
|
3
|
+
|
4
|
+
function GoogleProvider({
|
5
|
+
googleMapsApiKey,
|
6
|
+
children,
|
7
|
+
...props
|
8
|
+
}: GoogleProviderProps) {
|
9
|
+
const googleKey = googleMapsApiKey + "&loading=async&callback=initMap";
|
10
|
+
|
11
|
+
return (
|
12
|
+
<LoadScript googleMapsApiKey={googleKey} version="weekly" {...props}>
|
13
|
+
{children}
|
14
|
+
</LoadScript>
|
15
|
+
);
|
16
|
+
}
|
17
|
+
|
18
|
+
export { GoogleProvider };
|