@krak-stack/registry 0.2.2 → 0.4.0
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/CHANGELOG.md +16 -6
- package/README.md +8 -0
- package/dist/components/ui/color-picker.js +2 -3
- package/dist/components/ui/data-table.js +18 -11
- package/dist/components/ui/effect-form.js +2 -2
- package/dist/components/ui/form.d.ts +5 -5
- package/dist/components/ui/form.js +2 -2
- package/dist/components/ui/icon-input.js +2 -2
- package/dist/components/ui/{google-map.d.ts → map-menu-map.d.ts} +3 -1
- package/dist/components/ui/map-menu.d.ts +87 -0
- package/dist/components/ui/map-menu.js +1053 -0
- package/dist/components/ui/stepper.d.ts +37 -0
- package/dist/components/ui/stepper.js +244 -0
- package/dist/components/ui/virtualized-combobox.js +2 -2
- package/dist/services/events/client/audit-log-table.js +18 -11
- package/dist/services/webhooks/client/delivery-table.js +18 -11
- package/package.json +8 -4
- package/dist/components/ui/google-map.js +0 -441
|
@@ -1,441 +0,0 @@
|
|
|
1
|
-
// ../../src/components/ui/google-map.tsx
|
|
2
|
-
import { LocateFixed, Minus, Plus } from "lucide-react";
|
|
3
|
-
import {
|
|
4
|
-
useEffect,
|
|
5
|
-
useEffectEvent,
|
|
6
|
-
useRef,
|
|
7
|
-
useState,
|
|
8
|
-
useSyncExternalStore
|
|
9
|
-
} from "react";
|
|
10
|
-
import { Schema } from "effect";
|
|
11
|
-
|
|
12
|
-
// ../../src/lib/utils.ts
|
|
13
|
-
import { cn } from "cn";
|
|
14
|
-
|
|
15
|
-
// ../../src/components/ui/google-map.tsx
|
|
16
|
-
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
|
|
17
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
18
|
-
var googleMapsScriptId = "krak-stack-google-maps-script";
|
|
19
|
-
var googleMapsCallbackName = "__krakStackGoogleMapsInit";
|
|
20
|
-
var googleMapsPromise;
|
|
21
|
-
var defaultMessages = {
|
|
22
|
-
en: {
|
|
23
|
-
mapLabel: "Google map",
|
|
24
|
-
loading: "Loading map...",
|
|
25
|
-
missingKeyTitle: "Map unavailable",
|
|
26
|
-
missingKeyBody: "Provide a Google Maps API key to display the map.",
|
|
27
|
-
errorTitle: "Map unavailable",
|
|
28
|
-
errorBody: "Google Maps could not be loaded. Try again later.",
|
|
29
|
-
zoomIn: "Zoom in",
|
|
30
|
-
zoomOut: "Zoom out",
|
|
31
|
-
showArea: "Show selected area"
|
|
32
|
-
},
|
|
33
|
-
fr: {
|
|
34
|
-
mapLabel: "Carte Google",
|
|
35
|
-
loading: "Chargement de la carte...",
|
|
36
|
-
missingKeyTitle: "Carte indisponible",
|
|
37
|
-
missingKeyBody: "Fournissez une clé d’API Google Maps pour afficher la carte.",
|
|
38
|
-
errorTitle: "Carte indisponible",
|
|
39
|
-
errorBody: "Impossible de charger Google Maps. Réessayez plus tard.",
|
|
40
|
-
zoomIn: "Zoom avant",
|
|
41
|
-
zoomOut: "Zoom arrière",
|
|
42
|
-
showArea: "Afficher la zone sélectionnée"
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
var googleMapMessages = (locale, translations) => ({
|
|
46
|
-
...locale.startsWith("fr") ? defaultMessages.fr : defaultMessages.en,
|
|
47
|
-
...translations?.[locale.split("-")[0] ?? locale],
|
|
48
|
-
...translations?.[locale]
|
|
49
|
-
});
|
|
50
|
-
var isGoogleMapsReady = (api) => Boolean(api?.maps.Map && api.maps.Marker && api.maps.Circle && api.maps.event);
|
|
51
|
-
var loadGoogleMaps = (apiKey) => {
|
|
52
|
-
if (!globalThis.window || !globalThis.document) {
|
|
53
|
-
return Promise.reject(new Error("Google Maps requires a browser."));
|
|
54
|
-
}
|
|
55
|
-
const browserWindow = window;
|
|
56
|
-
if (isGoogleMapsReady(browserWindow.google)) {
|
|
57
|
-
return Promise.resolve(browserWindow.google);
|
|
58
|
-
}
|
|
59
|
-
if (googleMapsPromise)
|
|
60
|
-
return googleMapsPromise;
|
|
61
|
-
googleMapsPromise = new Promise((resolve, reject) => {
|
|
62
|
-
const resolveApi = () => {
|
|
63
|
-
if (isGoogleMapsReady(browserWindow.google)) {
|
|
64
|
-
resolve(browserWindow.google);
|
|
65
|
-
} else
|
|
66
|
-
reject(new Error("Google Maps failed to initialize."));
|
|
67
|
-
};
|
|
68
|
-
const rejectLoad = () => reject(new Error("Google Maps failed to load."));
|
|
69
|
-
browserWindow.__krakStackGoogleMapsInit = resolveApi;
|
|
70
|
-
const existingScript = document.getElementById(googleMapsScriptId);
|
|
71
|
-
if (existingScript) {
|
|
72
|
-
existingScript.addEventListener("error", rejectLoad, { once: true });
|
|
73
|
-
existingScript.addEventListener("load", resolveApi, { once: true });
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
const script = document.createElement("script");
|
|
77
|
-
script.id = googleMapsScriptId;
|
|
78
|
-
script.async = true;
|
|
79
|
-
script.src = `https://maps.googleapis.com/maps/api/js?key=${encodeURIComponent(apiKey)}&loading=async&callback=${googleMapsCallbackName}`;
|
|
80
|
-
script.addEventListener("error", rejectLoad, { once: true });
|
|
81
|
-
document.head.append(script);
|
|
82
|
-
}).catch((error) => {
|
|
83
|
-
googleMapsPromise = undefined;
|
|
84
|
-
browserWindow.__krakStackGoogleMapsInit = undefined;
|
|
85
|
-
document.getElementById(googleMapsScriptId)?.remove();
|
|
86
|
-
throw error;
|
|
87
|
-
});
|
|
88
|
-
return googleMapsPromise;
|
|
89
|
-
};
|
|
90
|
-
var clampZoom = (zoom, minZoom, maxZoom) => Math.min(maxZoom, Math.max(minZoom, zoom));
|
|
91
|
-
var mapOptions = (center, zoom, interactive, minZoom, maxZoom) => ({
|
|
92
|
-
center,
|
|
93
|
-
zoom: clampZoom(zoom, minZoom, maxZoom),
|
|
94
|
-
clickableIcons: interactive,
|
|
95
|
-
disableDefaultUI: true,
|
|
96
|
-
draggable: interactive,
|
|
97
|
-
fullscreenControl: false,
|
|
98
|
-
gestureHandling: interactive ? "auto" : "none",
|
|
99
|
-
keyboardShortcuts: interactive,
|
|
100
|
-
mapTypeControl: false,
|
|
101
|
-
maxZoom,
|
|
102
|
-
minZoom,
|
|
103
|
-
scrollwheel: interactive,
|
|
104
|
-
streetViewControl: false,
|
|
105
|
-
zoomControl: false
|
|
106
|
-
});
|
|
107
|
-
var createMapState = (loadState, currentZoom) => {
|
|
108
|
-
let snapshot = { loadState, currentZoom };
|
|
109
|
-
const listeners = new Set;
|
|
110
|
-
const update = (next) => {
|
|
111
|
-
if (next.loadState === snapshot.loadState && next.currentZoom === snapshot.currentZoom)
|
|
112
|
-
return;
|
|
113
|
-
snapshot = next;
|
|
114
|
-
for (const listener of listeners)
|
|
115
|
-
listener();
|
|
116
|
-
};
|
|
117
|
-
return {
|
|
118
|
-
getSnapshot: () => snapshot,
|
|
119
|
-
subscribe: (listener) => {
|
|
120
|
-
listeners.add(listener);
|
|
121
|
-
return () => {
|
|
122
|
-
listeners.delete(listener);
|
|
123
|
-
};
|
|
124
|
-
},
|
|
125
|
-
setLoadState: (loadState) => update({ ...snapshot, loadState }),
|
|
126
|
-
setCurrentZoom: (currentZoom) => update({ ...snapshot, currentZoom })
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
function GoogleMap({
|
|
130
|
-
apiKey,
|
|
131
|
-
center,
|
|
132
|
-
zoom,
|
|
133
|
-
marker,
|
|
134
|
-
radius,
|
|
135
|
-
interactive = true,
|
|
136
|
-
zoomControls = true,
|
|
137
|
-
fitRadius = false,
|
|
138
|
-
fitPadding = 32,
|
|
139
|
-
minZoom = 3,
|
|
140
|
-
maxZoom = 20,
|
|
141
|
-
className,
|
|
142
|
-
messages: messageOverrides,
|
|
143
|
-
locale: localeOverride
|
|
144
|
-
}) {
|
|
145
|
-
const locale = useKrakstackLocale(localeOverride);
|
|
146
|
-
const mapElementRef = useRef(null);
|
|
147
|
-
const apiRef = useRef(null);
|
|
148
|
-
const mapRef = useRef(null);
|
|
149
|
-
const markerRef = useRef(null);
|
|
150
|
-
const circleRef = useRef(null);
|
|
151
|
-
const zoomListenerRef = useRef(null);
|
|
152
|
-
const normalizedApiKey = apiKey.trim();
|
|
153
|
-
const normalizedMinZoom = Math.min(minZoom, maxZoom);
|
|
154
|
-
const normalizedMaxZoom = Math.max(minZoom, maxZoom);
|
|
155
|
-
const initialZoom = clampZoom(zoom, normalizedMinZoom, normalizedMaxZoom);
|
|
156
|
-
const [mapState] = useState(() => createMapState(normalizedApiKey ? "loading" : "missing-key", initialZoom));
|
|
157
|
-
const { loadState, currentZoom } = useSyncExternalStore(mapState.subscribe, mapState.getSnapshot, mapState.getSnapshot);
|
|
158
|
-
const { setLoadState, setCurrentZoom } = mapState;
|
|
159
|
-
const labels = googleMapMessages(locale, messageOverrides);
|
|
160
|
-
const markerOptions = Schema.is(Schema.Struct({ icon: Schema.optional(Schema.String) }))(marker) ? marker : undefined;
|
|
161
|
-
const markerEnabled = marker === true || markerOptions !== undefined;
|
|
162
|
-
const markerIcon = markerOptions?.icon;
|
|
163
|
-
const centerLat = center.lat;
|
|
164
|
-
const centerLng = center.lng;
|
|
165
|
-
const radiusMeters = radius?.radiusMeters;
|
|
166
|
-
const radiusFillColor = radius?.fillColor;
|
|
167
|
-
const radiusFillOpacity = radius?.fillOpacity;
|
|
168
|
-
const radiusStrokeColor = radius?.strokeColor;
|
|
169
|
-
const radiusStrokeOpacity = radius?.strokeOpacity;
|
|
170
|
-
const radiusStrokeWeight = radius?.strokeWeight;
|
|
171
|
-
const showSelectedArea = () => {
|
|
172
|
-
try {
|
|
173
|
-
const element = mapElementRef.current;
|
|
174
|
-
const bounds = circleRef.current?.getBounds()?.toJSON();
|
|
175
|
-
if (!element?.clientWidth || !element.clientHeight || !bounds)
|
|
176
|
-
return;
|
|
177
|
-
mapRef.current?.fitBounds(bounds, Math.max(0, fitPadding));
|
|
178
|
-
} catch {
|
|
179
|
-
setLoadState("error");
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
const fitSelection = useEffectEvent(showSelectedArea);
|
|
183
|
-
const initializeMap = useEffectEvent((api, element) => {
|
|
184
|
-
const map = new api.maps.Map(element, mapOptions(center, zoom, interactive, normalizedMinZoom, normalizedMaxZoom));
|
|
185
|
-
apiRef.current = api;
|
|
186
|
-
mapRef.current = map;
|
|
187
|
-
zoomListenerRef.current = api.maps.event.addListener(map, "zoom_changed", () => setCurrentZoom(map.getZoom() ?? zoom));
|
|
188
|
-
setCurrentZoom(clampZoom(zoom, normalizedMinZoom, normalizedMaxZoom));
|
|
189
|
-
setLoadState("ready");
|
|
190
|
-
});
|
|
191
|
-
useEffect(() => {
|
|
192
|
-
if (!normalizedApiKey) {
|
|
193
|
-
setLoadState("missing-key");
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
const element = mapElementRef.current;
|
|
197
|
-
if (!element)
|
|
198
|
-
return;
|
|
199
|
-
let mounted = true;
|
|
200
|
-
setLoadState("loading");
|
|
201
|
-
loadGoogleMaps(normalizedApiKey).then((api) => {
|
|
202
|
-
if (!mounted)
|
|
203
|
-
return;
|
|
204
|
-
try {
|
|
205
|
-
initializeMap(api, element);
|
|
206
|
-
} catch {
|
|
207
|
-
setLoadState("error");
|
|
208
|
-
}
|
|
209
|
-
}).catch(() => {
|
|
210
|
-
if (mounted)
|
|
211
|
-
setLoadState("error");
|
|
212
|
-
});
|
|
213
|
-
return () => {
|
|
214
|
-
mounted = false;
|
|
215
|
-
zoomListenerRef.current?.remove();
|
|
216
|
-
markerRef.current?.setMap(null);
|
|
217
|
-
circleRef.current?.setMap(null);
|
|
218
|
-
if (mapRef.current) {
|
|
219
|
-
apiRef.current?.maps.event.clearInstanceListeners(mapRef.current);
|
|
220
|
-
}
|
|
221
|
-
markerRef.current = null;
|
|
222
|
-
circleRef.current = null;
|
|
223
|
-
zoomListenerRef.current = null;
|
|
224
|
-
mapRef.current = null;
|
|
225
|
-
apiRef.current = null;
|
|
226
|
-
element.replaceChildren();
|
|
227
|
-
};
|
|
228
|
-
}, [normalizedApiKey, setLoadState]);
|
|
229
|
-
useEffect(() => {
|
|
230
|
-
const map = mapRef.current;
|
|
231
|
-
if (loadState !== "ready" || !map)
|
|
232
|
-
return;
|
|
233
|
-
const nextCenter = { lat: centerLat, lng: centerLng };
|
|
234
|
-
const nextZoom = clampZoom(zoom, normalizedMinZoom, normalizedMaxZoom);
|
|
235
|
-
try {
|
|
236
|
-
map.setOptions(mapOptions(nextCenter, nextZoom, interactive, normalizedMinZoom, normalizedMaxZoom));
|
|
237
|
-
map.setCenter(nextCenter);
|
|
238
|
-
map.setZoom(nextZoom);
|
|
239
|
-
setCurrentZoom(nextZoom);
|
|
240
|
-
} catch {
|
|
241
|
-
setLoadState("error");
|
|
242
|
-
}
|
|
243
|
-
}, [
|
|
244
|
-
centerLat,
|
|
245
|
-
centerLng,
|
|
246
|
-
zoom,
|
|
247
|
-
interactive,
|
|
248
|
-
fitRadius,
|
|
249
|
-
normalizedMinZoom,
|
|
250
|
-
normalizedMaxZoom,
|
|
251
|
-
loadState,
|
|
252
|
-
setLoadState,
|
|
253
|
-
setCurrentZoom
|
|
254
|
-
]);
|
|
255
|
-
useEffect(() => {
|
|
256
|
-
const api = apiRef.current;
|
|
257
|
-
const map = mapRef.current;
|
|
258
|
-
if (loadState !== "ready" || !api || !map)
|
|
259
|
-
return;
|
|
260
|
-
try {
|
|
261
|
-
const nextCenter = { lat: centerLat, lng: centerLng };
|
|
262
|
-
if (markerEnabled) {
|
|
263
|
-
if (markerRef.current) {
|
|
264
|
-
markerRef.current.setMap(map);
|
|
265
|
-
markerRef.current.setPosition(nextCenter);
|
|
266
|
-
markerRef.current.setIcon(markerIcon);
|
|
267
|
-
} else {
|
|
268
|
-
markerRef.current = new api.maps.Marker({
|
|
269
|
-
icon: markerIcon,
|
|
270
|
-
map,
|
|
271
|
-
position: nextCenter
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
} else {
|
|
275
|
-
markerRef.current?.setMap(null);
|
|
276
|
-
markerRef.current = null;
|
|
277
|
-
}
|
|
278
|
-
if (radiusMeters !== undefined) {
|
|
279
|
-
const style = {
|
|
280
|
-
fillColor: radiusFillColor ?? "#18181b",
|
|
281
|
-
fillOpacity: radiusFillOpacity ?? 0.12,
|
|
282
|
-
strokeColor: radiusStrokeColor ?? "#18181b",
|
|
283
|
-
strokeOpacity: radiusStrokeOpacity ?? 0.7,
|
|
284
|
-
strokeWeight: radiusStrokeWeight ?? 2
|
|
285
|
-
};
|
|
286
|
-
if (circleRef.current) {
|
|
287
|
-
circleRef.current.setMap(map);
|
|
288
|
-
circleRef.current.setCenter(nextCenter);
|
|
289
|
-
circleRef.current.setRadius(radiusMeters);
|
|
290
|
-
circleRef.current.setOptions(style);
|
|
291
|
-
} else {
|
|
292
|
-
circleRef.current = new api.maps.Circle({
|
|
293
|
-
...style,
|
|
294
|
-
center: nextCenter,
|
|
295
|
-
clickable: false,
|
|
296
|
-
map,
|
|
297
|
-
radius: radiusMeters
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
} else {
|
|
301
|
-
circleRef.current?.setMap(null);
|
|
302
|
-
circleRef.current = null;
|
|
303
|
-
}
|
|
304
|
-
} catch {
|
|
305
|
-
setLoadState("error");
|
|
306
|
-
}
|
|
307
|
-
}, [
|
|
308
|
-
centerLat,
|
|
309
|
-
centerLng,
|
|
310
|
-
loadState,
|
|
311
|
-
markerEnabled,
|
|
312
|
-
markerIcon,
|
|
313
|
-
radiusFillColor,
|
|
314
|
-
radiusFillOpacity,
|
|
315
|
-
radiusMeters,
|
|
316
|
-
radiusStrokeColor,
|
|
317
|
-
radiusStrokeOpacity,
|
|
318
|
-
radiusStrokeWeight,
|
|
319
|
-
setLoadState
|
|
320
|
-
]);
|
|
321
|
-
useEffect(() => {
|
|
322
|
-
const element = mapElementRef.current;
|
|
323
|
-
if (loadState !== "ready" || !fitRadius || radiusMeters === undefined || !element)
|
|
324
|
-
return;
|
|
325
|
-
fitSelection();
|
|
326
|
-
if (!globalThis.ResizeObserver)
|
|
327
|
-
return;
|
|
328
|
-
let width = element.clientWidth;
|
|
329
|
-
let height = element.clientHeight;
|
|
330
|
-
const observer = new ResizeObserver(() => {
|
|
331
|
-
const nextWidth = element.clientWidth;
|
|
332
|
-
const nextHeight = element.clientHeight;
|
|
333
|
-
if (nextWidth === width && nextHeight === height)
|
|
334
|
-
return;
|
|
335
|
-
width = nextWidth;
|
|
336
|
-
height = nextHeight;
|
|
337
|
-
fitSelection();
|
|
338
|
-
});
|
|
339
|
-
observer.observe(element);
|
|
340
|
-
return () => observer.disconnect();
|
|
341
|
-
}, [
|
|
342
|
-
loadState,
|
|
343
|
-
fitRadius,
|
|
344
|
-
fitPadding,
|
|
345
|
-
interactive,
|
|
346
|
-
centerLat,
|
|
347
|
-
centerLng,
|
|
348
|
-
radiusMeters,
|
|
349
|
-
normalizedMinZoom,
|
|
350
|
-
normalizedMaxZoom
|
|
351
|
-
]);
|
|
352
|
-
const changeZoom = (delta) => {
|
|
353
|
-
const map = mapRef.current;
|
|
354
|
-
if (!map)
|
|
355
|
-
return;
|
|
356
|
-
const nextZoom = clampZoom((map.getZoom() ?? currentZoom) + delta, normalizedMinZoom, normalizedMaxZoom);
|
|
357
|
-
map.setZoom(nextZoom);
|
|
358
|
-
setCurrentZoom(nextZoom);
|
|
359
|
-
};
|
|
360
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
361
|
-
className: cn("bg-muted relative isolate min-h-64 min-w-0 overflow-hidden rounded-lg border", className),
|
|
362
|
-
children: [
|
|
363
|
-
/* @__PURE__ */ jsx("div", {
|
|
364
|
-
ref: mapElementRef,
|
|
365
|
-
className: "h-full min-h-[inherit] w-full",
|
|
366
|
-
role: "region",
|
|
367
|
-
"aria-label": labels.mapLabel
|
|
368
|
-
}),
|
|
369
|
-
loadState === "ready" && zoomControls ? /* @__PURE__ */ jsxs("div", {
|
|
370
|
-
className: "bg-background/95 absolute top-3 right-3 z-10 overflow-hidden rounded-md border shadow-sm backdrop-blur",
|
|
371
|
-
children: [
|
|
372
|
-
fitRadius && radiusMeters !== undefined ? /* @__PURE__ */ jsxs(Fragment, {
|
|
373
|
-
children: [
|
|
374
|
-
/* @__PURE__ */ jsx("button", {
|
|
375
|
-
type: "button",
|
|
376
|
-
onClick: showSelectedArea,
|
|
377
|
-
"aria-label": labels.showArea,
|
|
378
|
-
title: labels.showArea,
|
|
379
|
-
className: "text-foreground hover:bg-accent focus-visible:ring-ring relative flex size-11 items-center justify-center focus-visible:z-10 focus-visible:ring-2 focus-visible:ring-inset",
|
|
380
|
-
children: /* @__PURE__ */ jsx(LocateFixed, {
|
|
381
|
-
className: "size-4"
|
|
382
|
-
})
|
|
383
|
-
}),
|
|
384
|
-
/* @__PURE__ */ jsx("div", {
|
|
385
|
-
className: "bg-border h-px"
|
|
386
|
-
})
|
|
387
|
-
]
|
|
388
|
-
}) : null,
|
|
389
|
-
/* @__PURE__ */ jsx("button", {
|
|
390
|
-
type: "button",
|
|
391
|
-
className: "text-foreground hover:bg-accent focus-visible:ring-ring relative flex size-11 items-center justify-center transition-colors focus-visible:z-10 focus-visible:ring-2 focus-visible:ring-inset disabled:pointer-events-none disabled:opacity-50",
|
|
392
|
-
disabled: currentZoom >= normalizedMaxZoom,
|
|
393
|
-
onClick: () => changeZoom(1),
|
|
394
|
-
"aria-label": labels.zoomIn,
|
|
395
|
-
children: /* @__PURE__ */ jsx(Plus, {
|
|
396
|
-
className: "size-4"
|
|
397
|
-
})
|
|
398
|
-
}),
|
|
399
|
-
/* @__PURE__ */ jsx("div", {
|
|
400
|
-
className: "bg-border h-px"
|
|
401
|
-
}),
|
|
402
|
-
/* @__PURE__ */ jsx("button", {
|
|
403
|
-
type: "button",
|
|
404
|
-
className: "text-foreground hover:bg-accent focus-visible:ring-ring relative flex size-11 items-center justify-center transition-colors focus-visible:z-10 focus-visible:ring-2 focus-visible:ring-inset disabled:pointer-events-none disabled:opacity-50",
|
|
405
|
-
disabled: currentZoom <= normalizedMinZoom,
|
|
406
|
-
onClick: () => changeZoom(-1),
|
|
407
|
-
"aria-label": labels.zoomOut,
|
|
408
|
-
children: /* @__PURE__ */ jsx(Minus, {
|
|
409
|
-
className: "size-4"
|
|
410
|
-
})
|
|
411
|
-
})
|
|
412
|
-
]
|
|
413
|
-
}) : null,
|
|
414
|
-
loadState === "loading" ? /* @__PURE__ */ jsx("div", {
|
|
415
|
-
className: "bg-background/75 text-muted-foreground absolute inset-0 grid place-items-center text-sm font-medium backdrop-blur-sm",
|
|
416
|
-
role: "status",
|
|
417
|
-
children: labels.loading
|
|
418
|
-
}) : null,
|
|
419
|
-
loadState === "missing-key" || loadState === "error" ? /* @__PURE__ */ jsx("div", {
|
|
420
|
-
className: "bg-background/85 absolute inset-0 grid place-items-center p-6 text-center backdrop-blur-sm",
|
|
421
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
422
|
-
className: "bg-card text-card-foreground max-w-sm rounded-lg border p-5 shadow-sm",
|
|
423
|
-
role: "alert",
|
|
424
|
-
children: [
|
|
425
|
-
/* @__PURE__ */ jsx("p", {
|
|
426
|
-
className: "text-sm font-semibold",
|
|
427
|
-
children: loadState === "missing-key" ? labels.missingKeyTitle : labels.errorTitle
|
|
428
|
-
}),
|
|
429
|
-
/* @__PURE__ */ jsx("p", {
|
|
430
|
-
className: "text-muted-foreground mt-2 text-xs",
|
|
431
|
-
children: loadState === "missing-key" ? labels.missingKeyBody : labels.errorBody
|
|
432
|
-
})
|
|
433
|
-
]
|
|
434
|
-
})
|
|
435
|
-
}) : null
|
|
436
|
-
]
|
|
437
|
-
});
|
|
438
|
-
}
|
|
439
|
-
export {
|
|
440
|
-
GoogleMap
|
|
441
|
-
};
|