@local-logic/maps 0.0.9 → 0.0.11
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.
- package/dist/IconBase.es-rM5tt24D.js +48 -0
- package/dist/{index-BZ2605rA.js → index-9RZYMoMG.js} +1 -1
- package/dist/index-B9QF7ewJ.js +73 -0
- package/dist/index-BCa658u4.js +24 -0
- package/dist/index-BMvwx9_l.js +96 -0
- package/dist/index-BOBkPCX5.js +772 -0
- package/dist/index-BOuko7CL.js +32 -0
- package/dist/index-BdXay-zF.js +62 -0
- package/dist/index-Bn_2qA7h.js +65 -0
- package/dist/{index-CPq7k7F4.js → index-BsnsAUt5.js} +1 -1
- package/dist/index-CNxLnZ8O.js +23 -0
- package/dist/{index-B43MtiHH.js → index-D5uhfwEH.js} +10 -9
- package/dist/index-DJ4SJ9IL.js +53 -0
- package/dist/index-DaEKTD5_.js +65 -0
- package/dist/index-Do_dW76Q.js +23 -0
- package/dist/index-Dyy8UNMs.js +50 -0
- package/dist/index.es.js +1 -1
- package/dist/{index.modern-EsUgbhzI.js → index.modern-CLRs8JwI.js} +7 -7
- package/dist/index.umd.js +134 -146
- package/dist/src/components/Map/Root/BaseMap/Google/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/BaseMap/Mapbox/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/BaseMap/Maptiler/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/BaseMap/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/CenterPin/Google/index.d.ts +4 -0
- package/dist/src/components/Map/Root/CenterPin/Google/index.d.ts.map +1 -0
- package/dist/src/components/Map/Root/CenterPin/Mapbox/index.d.ts +4 -0
- package/dist/src/components/Map/Root/CenterPin/Mapbox/index.d.ts.map +1 -0
- package/dist/src/components/Map/Root/CenterPin/Maptiler/index.d.ts +4 -0
- package/dist/src/components/Map/Root/CenterPin/Maptiler/index.d.ts.map +1 -0
- package/dist/src/components/Map/Root/CenterPin/index.d.ts +4 -0
- package/dist/src/components/Map/Root/CenterPin/index.d.ts.map +1 -0
- package/dist/src/components/Map/Root/CenterPin/styles.d.ts +4 -0
- package/dist/src/components/Map/Root/CenterPin/styles.d.ts.map +1 -0
- package/dist/src/components/Map/Root/CenterPin/types.d.ts +6 -0
- package/dist/src/components/Map/Root/CenterPin/types.d.ts.map +1 -0
- package/dist/src/components/Map/Root/Markers/Cluster/index.d.ts +4 -3
- package/dist/src/components/Map/Root/Markers/Cluster/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Markers/Cluster/styles.d.ts +2 -1
- package/dist/src/components/Map/Root/Markers/Cluster/styles.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Markers/Google/index.d.ts +1 -1
- package/dist/src/components/Map/Root/Markers/Google/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Markers/Mapbox/index.d.ts +1 -1
- package/dist/src/components/Map/Root/Markers/Mapbox/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Markers/Maptiler/index.d.ts +1 -1
- package/dist/src/components/Map/Root/Markers/Maptiler/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Markers/MarkerIcon/index.d.ts +6 -0
- package/dist/src/components/Map/Root/Markers/MarkerIcon/index.d.ts.map +1 -0
- package/dist/src/components/Map/Root/Markers/index.d.ts +1 -1
- package/dist/src/components/Map/Root/Markers/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Markers/styles.d.ts +2 -4
- package/dist/src/components/Map/Root/Markers/styles.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Markers/types.d.ts +18 -9
- package/dist/src/components/Map/Root/Markers/types.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Popup/Mapbox/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Popup/Maptiler/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/constants.d.ts +3 -0
- package/dist/src/components/Map/Root/constants.d.ts.map +1 -1
- package/dist/src/components/Map/Root/context.d.ts +2 -0
- package/dist/src/components/Map/Root/context.d.ts.map +1 -1
- package/dist/src/components/Map/Root/index.d.ts +1 -0
- package/dist/src/components/Map/Root/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/types.d.ts +10 -0
- package/dist/src/components/Map/Root/types.d.ts.map +1 -1
- package/dist/src/components/Map/index.d.ts +2 -2
- package/dist/src/components/Map/index.d.ts.map +1 -1
- package/dist/src/components/Map/index.stories.d.ts.map +1 -1
- package/dist/src/components/Map/storybook-data.d.ts.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/style.css +24 -1
- package/dist/styles-D2MYaLhP.js +47 -0
- package/package.json +5 -3
- package/dist/index-92HhWupr.js +0 -29
- package/dist/index-BF2kb4Y-.js +0 -42
- package/dist/index-C5-_i-6M.js +0 -64
- package/dist/index-CXjxZmYt.js +0 -144
- package/dist/index-CY0to_1B.js +0 -676
- package/dist/index-ChwN5abO.js +0 -29
- package/dist/index-CrIFr9oc.js +0 -47
- package/dist/index-D5-2anzJ.js +0 -29
- package/dist/index-J1MKzGEM.js +0 -31
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
import { createContext as h } from "react";
|
|
3
|
+
const p = h({
|
|
4
|
+
color: "currentColor",
|
|
5
|
+
size: "1em",
|
|
6
|
+
weight: "regular",
|
|
7
|
+
mirrored: !1
|
|
8
|
+
}), x = r.forwardRef(
|
|
9
|
+
(n, s) => {
|
|
10
|
+
const {
|
|
11
|
+
alt: t,
|
|
12
|
+
color: o,
|
|
13
|
+
size: e,
|
|
14
|
+
weight: l,
|
|
15
|
+
mirrored: a,
|
|
16
|
+
children: c,
|
|
17
|
+
weights: m,
|
|
18
|
+
...g
|
|
19
|
+
} = n, {
|
|
20
|
+
color: w = "currentColor",
|
|
21
|
+
size: i,
|
|
22
|
+
weight: u = "regular",
|
|
23
|
+
mirrored: f = !1,
|
|
24
|
+
...d
|
|
25
|
+
} = r.useContext(p);
|
|
26
|
+
return /* @__PURE__ */ r.createElement(
|
|
27
|
+
"svg",
|
|
28
|
+
{
|
|
29
|
+
ref: s,
|
|
30
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
31
|
+
width: e ?? i,
|
|
32
|
+
height: e ?? i,
|
|
33
|
+
fill: o ?? w,
|
|
34
|
+
viewBox: "0 0 256 256",
|
|
35
|
+
transform: a || f ? "scale(-1, 1)" : void 0,
|
|
36
|
+
...d,
|
|
37
|
+
...g
|
|
38
|
+
},
|
|
39
|
+
!!t && /* @__PURE__ */ r.createElement("title", null, t),
|
|
40
|
+
c,
|
|
41
|
+
m.get(l ?? u)
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
x.displayName = "IconBase";
|
|
46
|
+
export {
|
|
47
|
+
x as p
|
|
48
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect as m, useMemo as o } from "react";
|
|
3
|
-
import { u as s, I as d } from "./index.modern-
|
|
3
|
+
import { u as s, I as d } from "./index.modern-CLRs8JwI.js";
|
|
4
4
|
import { c as f } from "./styles-uPzJnzVS.js";
|
|
5
5
|
function v({
|
|
6
6
|
latitude: n,
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsxs as M, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useEffect as b } from "react";
|
|
3
|
+
import { A as C, M as O, C as i, u as P } from "./index.modern-CLRs8JwI.js";
|
|
4
|
+
import { u as p, d as l, a as v } from "./index-BOBkPCX5.js";
|
|
5
|
+
const y = {
|
|
6
|
+
"top-left": i.LEFT_TOP,
|
|
7
|
+
"top-right": i.RIGHT_TOP,
|
|
8
|
+
"bottom-left": i.LEFT_BOTTOM,
|
|
9
|
+
"bottom-right": i.RIGHT_BOTTOM
|
|
10
|
+
}, Z = ({ isMapLoaded: r }) => {
|
|
11
|
+
const o = P(), { setBounds: u, setZoom: t } = p(), a = () => {
|
|
12
|
+
var s;
|
|
13
|
+
if (!o)
|
|
14
|
+
return;
|
|
15
|
+
const e = (s = o.getBounds()) == null ? void 0 : s.toJSON(), n = o.getZoom();
|
|
16
|
+
e && u([e.west, e.south, e.east, e.north]), typeof n < "u" && t(n + 1);
|
|
17
|
+
};
|
|
18
|
+
return b(() => {
|
|
19
|
+
!r || !o || (a(), o.addListener("bounds_changed", () => {
|
|
20
|
+
a();
|
|
21
|
+
}));
|
|
22
|
+
}, [r, o]), null;
|
|
23
|
+
};
|
|
24
|
+
function B({ children: r }) {
|
|
25
|
+
const [o, u] = h(!1), {
|
|
26
|
+
mapProvider: t,
|
|
27
|
+
center: a,
|
|
28
|
+
// Google Maps zoom level starts at 0, so we add 1 to match our defaultMapValues
|
|
29
|
+
zoom: e = l.zoom + 1,
|
|
30
|
+
minZoom: n,
|
|
31
|
+
maxZoom: s,
|
|
32
|
+
pitch: f = l.pitch,
|
|
33
|
+
bearing: c = l.bearing,
|
|
34
|
+
cooperativeGestures: g = l.cooperativeGestures,
|
|
35
|
+
zoomPosition: m
|
|
36
|
+
} = p();
|
|
37
|
+
if (t.name !== "google")
|
|
38
|
+
return null;
|
|
39
|
+
const T = () => {
|
|
40
|
+
u(!0);
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ M(C, { apiKey: t.apiKey, children: [
|
|
43
|
+
/* @__PURE__ */ d(Z, { isMapLoaded: o }),
|
|
44
|
+
/* @__PURE__ */ d(
|
|
45
|
+
O,
|
|
46
|
+
{
|
|
47
|
+
mapId: t.theme || v.google,
|
|
48
|
+
defaultCenter: {
|
|
49
|
+
lat: a.latitude,
|
|
50
|
+
lng: a.longitude
|
|
51
|
+
},
|
|
52
|
+
defaultZoom: e,
|
|
53
|
+
defaultTilt: f,
|
|
54
|
+
defaultHeading: c,
|
|
55
|
+
gestureHandling: g ? "cooperative" : "greedy",
|
|
56
|
+
streetViewControl: !1,
|
|
57
|
+
fullscreenControl: !1,
|
|
58
|
+
clickableIcons: !1,
|
|
59
|
+
mapTypeControl: !1,
|
|
60
|
+
zoomControlOptions: {
|
|
61
|
+
position: m && y[m]
|
|
62
|
+
},
|
|
63
|
+
minZoom: typeof n == "number" ? n + 1 : void 0,
|
|
64
|
+
maxZoom: typeof s == "number" ? s + 1 : void 0,
|
|
65
|
+
onTilesLoaded: T,
|
|
66
|
+
children: r
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
] });
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
B as default
|
|
73
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsxs as n, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { a as e } from "./index.modern-CLRs8JwI.js";
|
|
3
|
+
import { c as o, S as a, o as s, i as r } from "./styles-D2MYaLhP.js";
|
|
4
|
+
function m({ marker: t }) {
|
|
5
|
+
return /* @__PURE__ */ n(
|
|
6
|
+
e,
|
|
7
|
+
{
|
|
8
|
+
position: {
|
|
9
|
+
lat: t.latitude,
|
|
10
|
+
lng: t.longitude
|
|
11
|
+
},
|
|
12
|
+
className: o.trim(),
|
|
13
|
+
zIndex: 10,
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ i(a, {}),
|
|
16
|
+
/* @__PURE__ */ i(s, { className: r })
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
`center-pin-marker-${t.longitude}-${t.latitude}`
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
m as default
|
|
24
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { jsx as t, jsxs as o, Fragment as f } from "react/jsx-runtime";
|
|
2
|
+
import * as e from "react";
|
|
3
|
+
import { useMemo as g } from "react";
|
|
4
|
+
import { u as Z, M as c } from "./index-BOBkPCX5.js";
|
|
5
|
+
import { p as A } from "./IconBase.es-rM5tt24D.js";
|
|
6
|
+
const p = /* @__PURE__ */ new Map([
|
|
7
|
+
[
|
|
8
|
+
"bold",
|
|
9
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M128,60a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,60Zm0,64a20,20,0,1,1,20-20A20,20,0,0,1,128,124Zm0-112a92.1,92.1,0,0,0-92,92c0,77.36,81.64,135.4,85.12,137.83a12,12,0,0,0,13.76,0,259,259,0,0,0,42.18-39C205.15,170.57,220,136.37,220,104A92.1,92.1,0,0,0,128,12Zm31.3,174.71A249.35,249.35,0,0,1,128,216.89a249.35,249.35,0,0,1-31.3-30.18C80,167.37,60,137.31,60,104a68,68,0,0,1,136,0C196,137.31,176,167.37,159.3,186.71Z" }))
|
|
10
|
+
],
|
|
11
|
+
[
|
|
12
|
+
"duotone",
|
|
13
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
|
|
14
|
+
"path",
|
|
15
|
+
{
|
|
16
|
+
d: "M128,24a80,80,0,0,0-80,80c0,72,80,128,80,128s80-56,80-128A80,80,0,0,0,128,24Zm0,112a32,32,0,1,1,32-32A32,32,0,0,1,128,136Z",
|
|
17
|
+
opacity: "0.2"
|
|
18
|
+
}
|
|
19
|
+
), /* @__PURE__ */ e.createElement("path", { d: "M128,64a40,40,0,1,0,40,40A40,40,0,0,0,128,64Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,128Zm0-112a88.1,88.1,0,0,0-88,88c0,31.4,14.51,64.68,42,96.25a254.19,254.19,0,0,0,41.45,38.3,8,8,0,0,0,9.18,0A254.19,254.19,0,0,0,174,200.25c27.45-31.57,42-64.85,42-96.25A88.1,88.1,0,0,0,128,16Zm0,206c-16.53-13-72-60.75-72-118a72,72,0,0,1,144,0C200,161.23,144.53,209,128,222Z" }))
|
|
20
|
+
],
|
|
21
|
+
[
|
|
22
|
+
"fill",
|
|
23
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M128,16a88.1,88.1,0,0,0-88,88c0,75.3,80,132.17,83.41,134.55a8,8,0,0,0,9.18,0C136,236.17,216,179.3,216,104A88.1,88.1,0,0,0,128,16Zm0,56a32,32,0,1,1-32,32A32,32,0,0,1,128,72Z" }))
|
|
24
|
+
],
|
|
25
|
+
[
|
|
26
|
+
"light",
|
|
27
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M128,66a38,38,0,1,0,38,38A38,38,0,0,0,128,66Zm0,64a26,26,0,1,1,26-26A26,26,0,0,1,128,130Zm0-112a86.1,86.1,0,0,0-86,86c0,30.91,14.34,63.74,41.47,94.94a252.32,252.32,0,0,0,41.09,38,6,6,0,0,0,6.88,0,252.32,252.32,0,0,0,41.09-38c27.13-31.2,41.47-64,41.47-94.94A86.1,86.1,0,0,0,128,18Zm0,206.51C113,212.93,54,163.62,54,104a74,74,0,0,1,148,0C202,163.62,143,212.93,128,224.51Z" }))
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"regular",
|
|
31
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M128,64a40,40,0,1,0,40,40A40,40,0,0,0,128,64Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,128Zm0-112a88.1,88.1,0,0,0-88,88c0,31.4,14.51,64.68,42,96.25a254.19,254.19,0,0,0,41.45,38.3,8,8,0,0,0,9.18,0A254.19,254.19,0,0,0,174,200.25c27.45-31.57,42-64.85,42-96.25A88.1,88.1,0,0,0,128,16Zm0,206c-16.53-13-72-60.75-72-118a72,72,0,0,1,144,0C200,161.23,144.53,209,128,222Z" }))
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
"thin",
|
|
35
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M128,68a36,36,0,1,0,36,36A36,36,0,0,0,128,68Zm0,64a28,28,0,1,1,28-28A28,28,0,0,1,128,132Zm0-112a84.09,84.09,0,0,0-84,84c0,30.42,14.17,62.79,41,93.62a250,250,0,0,0,40.73,37.66,4,4,0,0,0,4.58,0A250,250,0,0,0,171,197.62c26.81-30.83,41-63.2,41-93.62A84.09,84.09,0,0,0,128,20Zm37.1,172.23A254.62,254.62,0,0,1,128,227a254.62,254.62,0,0,1-37.1-34.81C73.15,171.8,52,139.9,52,104a76,76,0,0,1,152,0C204,139.9,182.85,171.8,165.1,192.23Z" }))
|
|
36
|
+
]
|
|
37
|
+
]), d = e.forwardRef((a, r) => /* @__PURE__ */ e.createElement(A, { ref: r, ...a, weights: p }));
|
|
38
|
+
d.displayName = "MapPinIcon";
|
|
39
|
+
const m = `
|
|
40
|
+
group/marker cursor-pointer rounded-full
|
|
41
|
+
relative h-7 w-7 flex items-center justify-center
|
|
42
|
+
text-base-white ring-1 ring-inset
|
|
43
|
+
transition-colors
|
|
44
|
+
|
|
45
|
+
bg-[var(--background)]
|
|
46
|
+
ring-[var(--fill)]
|
|
47
|
+
|
|
48
|
+
hover:bg-[var(--fill)]
|
|
49
|
+
|
|
50
|
+
data-[is-zoomed-out=true]:bg-[var(--fill)]
|
|
51
|
+
data-[is-zoomed-out=true]:h-4
|
|
52
|
+
data-[is-zoomed-out=true]:w-4
|
|
53
|
+
`, u = `
|
|
54
|
+
m-auto transition-all w-4 h-4
|
|
55
|
+
|
|
56
|
+
fill-[var(--fill)]
|
|
57
|
+
group-hover/marker:fill-[var(--background)]
|
|
58
|
+
|
|
59
|
+
group-data-[is-zoomed-out=true]/marker:hidden
|
|
60
|
+
`;
|
|
61
|
+
function h({ icon: a }) {
|
|
62
|
+
return typeof a < "u" ? /* @__PURE__ */ t(a, { className: u }) : /* @__PURE__ */ t(d, { className: u });
|
|
63
|
+
}
|
|
64
|
+
const E = `
|
|
65
|
+
relative flex
|
|
66
|
+
`, s = `
|
|
67
|
+
-ml-6 -z-10 last:-z-20
|
|
68
|
+
`;
|
|
69
|
+
function k({
|
|
70
|
+
colors: a,
|
|
71
|
+
icon: r
|
|
72
|
+
}) {
|
|
73
|
+
const { zoom: n, mapProvider: l } = Z(), i = g(() => l.name === "google" ? n - 1 < c + 1 : n < c, [n, l]);
|
|
74
|
+
return /* @__PURE__ */ o(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
className: E,
|
|
78
|
+
style: {
|
|
79
|
+
"--background": a == null ? void 0 : a.background,
|
|
80
|
+
"--fill": a == null ? void 0 : a.fill
|
|
81
|
+
},
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ t("div", { className: m, "data-is-zoomed-out": i, children: /* @__PURE__ */ t(h, { icon: r }) }),
|
|
84
|
+
!i && /* @__PURE__ */ o(f, { children: [
|
|
85
|
+
/* @__PURE__ */ t("div", { className: `${m} ${s}` }),
|
|
86
|
+
/* @__PURE__ */ t("div", { className: `${m} ${s}` })
|
|
87
|
+
] })
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
export {
|
|
93
|
+
k as C,
|
|
94
|
+
h as M,
|
|
95
|
+
m as c
|
|
96
|
+
};
|