@brightlocal/ui-components 2.14.0 → 2.15.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/README.md +3 -2
- package/component-meta.json +147 -5
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +318 -304
- package/dist/list.cjs +1 -1
- package/dist/list.d.ts.map +1 -1
- package/dist/list.js +21 -15
- package/dist/map.cjs +1 -1
- package/dist/map.d.ts +259 -46
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +460 -185
- package/dist/stepper.cjs +1 -0
- package/dist/stepper.d.ts +176 -0
- package/dist/stepper.d.ts.map +1 -0
- package/dist/stepper.js +351 -0
- package/package.json +5 -4
- package/src/components/list.tsx +8 -2
- package/src/components/map.tsx +681 -134
- package/src/components/stepper.tsx +708 -0
- package/src/index.ts +1 -0
- package/src/types/assets.d.ts +9 -0
package/dist/map.js
CHANGED
|
@@ -1,256 +1,531 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { jsx as o, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import { cva as M } from "class-variance-authority";
|
|
4
|
+
import { RefreshCw as N, TriangleAlert as T, Store as C } from "@brightlocal/icons";
|
|
5
|
+
import { GlobeyFixingFault as P, MapBackground as S } from "@brightlocal/illustrations";
|
|
6
|
+
import { Button as b } from "@brightlocal/ui-components/button";
|
|
7
|
+
import { Card as L, CardContent as R } from "@brightlocal/ui-components/card";
|
|
6
8
|
import { cn as p } from "@brightlocal/ui-components/lib/utils";
|
|
7
|
-
import { Popover as
|
|
8
|
-
const
|
|
9
|
+
import { Popover as A, PopoverAnchor as E, PopoverContent as I } from "@brightlocal/ui-components/popover";
|
|
10
|
+
const ae = {
|
|
9
11
|
/** Default road map view */
|
|
10
12
|
ROADMAP: "roadmap",
|
|
11
|
-
/** Satellite imagery */
|
|
13
|
+
/** @deprecated Satellite imagery — prefer cloud-based map styling via Map ID */
|
|
12
14
|
SATELLITE: "satellite"
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
}, j = ["water", "landscape", "road", "poi", "transit"];
|
|
16
|
+
function D(e, t) {
|
|
17
|
+
return [
|
|
18
|
+
...j.map((a) => ({
|
|
19
|
+
featureType: a,
|
|
20
|
+
elementType: "geometry",
|
|
21
|
+
stylers: [{ saturation: e, lightness: t }]
|
|
22
|
+
})),
|
|
23
|
+
{
|
|
24
|
+
elementType: "labels.text.fill",
|
|
25
|
+
stylers: [{ saturation: e, lightness: t - 10 }]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
elementType: "labels.icon",
|
|
29
|
+
stylers: [{ saturation: e, lightness: t }]
|
|
30
|
+
}
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
const h = [
|
|
34
|
+
{ elementType: "geometry", stylers: [{ color: "#444444" }] },
|
|
35
|
+
{ elementType: "labels.text.fill", stylers: [{ color: "#aaaaaa" }] },
|
|
36
|
+
{ elementType: "labels.text.stroke", stylers: [{ color: "#323232" }] },
|
|
37
|
+
{
|
|
38
|
+
featureType: "water",
|
|
39
|
+
elementType: "geometry",
|
|
40
|
+
stylers: [{ color: "#30405a" }]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
featureType: "landscape",
|
|
44
|
+
elementType: "geometry",
|
|
45
|
+
stylers: [{ color: "#4b4b4b" }]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
featureType: "road",
|
|
49
|
+
elementType: "geometry",
|
|
50
|
+
stylers: [{ color: "#5c5c5c" }]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
featureType: "road",
|
|
54
|
+
elementType: "geometry.stroke",
|
|
55
|
+
stylers: [{ color: "#3e3e3e" }]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
featureType: "poi",
|
|
59
|
+
elementType: "geometry",
|
|
60
|
+
stylers: [{ color: "#525252" }]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
featureType: "transit",
|
|
64
|
+
elementType: "geometry",
|
|
65
|
+
stylers: [{ color: "#505050" }]
|
|
66
|
+
},
|
|
67
|
+
{ elementType: "labels.icon", stylers: [{ visibility: "off" }] }
|
|
68
|
+
], B = {
|
|
69
|
+
default: { light: [], dark: h },
|
|
70
|
+
muted: { light: D(-40, 20), dark: h }
|
|
71
|
+
};
|
|
72
|
+
function k() {
|
|
73
|
+
const [e, t] = d.useState(
|
|
74
|
+
() => typeof document < "u" && document.body.classList.contains("dark")
|
|
75
|
+
);
|
|
76
|
+
return d.useEffect(() => {
|
|
77
|
+
const a = new MutationObserver(() => {
|
|
78
|
+
t(document.body.classList.contains("dark"));
|
|
79
|
+
});
|
|
80
|
+
return a.observe(document.body, {
|
|
81
|
+
attributes: !0,
|
|
82
|
+
attributeFilter: ["class"]
|
|
83
|
+
}), () => a.disconnect();
|
|
84
|
+
}, []), e;
|
|
85
|
+
}
|
|
86
|
+
function re(e = "default") {
|
|
87
|
+
const t = k();
|
|
88
|
+
return B[e][t ? "dark" : "light"];
|
|
89
|
+
}
|
|
90
|
+
const v = {
|
|
91
|
+
primary: "strong",
|
|
92
|
+
secondary: "moderate",
|
|
93
|
+
warning: "moderate",
|
|
94
|
+
destructive: "unranked",
|
|
95
|
+
outline: "unranked"
|
|
96
|
+
};
|
|
97
|
+
function z(e) {
|
|
98
|
+
return e in v;
|
|
99
|
+
}
|
|
100
|
+
function $(e) {
|
|
101
|
+
return z(e) ? v[e] : e;
|
|
102
|
+
}
|
|
103
|
+
const y = {
|
|
104
|
+
strong: "bg-primary dark:bg-green-400",
|
|
105
|
+
moderate: "bg-chart-4",
|
|
106
|
+
weak: "bg-orange-400",
|
|
107
|
+
unranked: "bg-red-600",
|
|
108
|
+
error: "bg-warning-background dark:bg-orange-200"
|
|
109
|
+
}, F = M(
|
|
110
|
+
"inline-flex items-center justify-center rounded-full font-sans text-sm font-semibold text-foreground dark:text-neutral-900 border-2 border-white shadow-sm transition-shadow duration-200 ease-out hover:shadow-md",
|
|
111
|
+
{
|
|
112
|
+
variants: {
|
|
113
|
+
variant: {
|
|
114
|
+
strong: `${y.strong}`,
|
|
115
|
+
moderate: `${y.moderate}`,
|
|
116
|
+
weak: `${y.weak}`,
|
|
117
|
+
unranked: `${y.unranked} text-white dark:text-white`,
|
|
118
|
+
error: `${y.error}`
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
defaultVariants: {
|
|
122
|
+
variant: "strong"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
), x = d.forwardRef(
|
|
20
126
|
({
|
|
21
|
-
value:
|
|
22
|
-
variant:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
127
|
+
value: e,
|
|
128
|
+
variant: t = "strong",
|
|
129
|
+
loading: a = !1,
|
|
130
|
+
pulse: n,
|
|
131
|
+
// eslint-disable-line @typescript-eslint/no-unused-vars -- absorbed from ...props to prevent DOM passthrough
|
|
132
|
+
dataHook: l,
|
|
133
|
+
className: s,
|
|
134
|
+
trackingEl: r,
|
|
27
135
|
trackingLabel: i,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
136
|
+
style: c,
|
|
137
|
+
...m
|
|
138
|
+
}, u) => {
|
|
139
|
+
const g = $(t);
|
|
140
|
+
return /* @__PURE__ */ o(
|
|
141
|
+
"div",
|
|
142
|
+
{
|
|
143
|
+
ref: u,
|
|
144
|
+
className: p(
|
|
145
|
+
a ? "border-border bg-accent rounded-full border" : F({ variant: g }),
|
|
146
|
+
"size-8 p-0",
|
|
147
|
+
s
|
|
148
|
+
),
|
|
149
|
+
"data-hook": l,
|
|
150
|
+
"data-slot": "map-grid-pin",
|
|
151
|
+
"data-state": a ? "loading" : void 0,
|
|
152
|
+
"data-tracking-el": r || "map-grid-pin",
|
|
153
|
+
"data-tracking-label": i,
|
|
154
|
+
style: c,
|
|
155
|
+
...m,
|
|
156
|
+
children: g === "error" && !a ? /* @__PURE__ */ o(
|
|
157
|
+
T,
|
|
158
|
+
{
|
|
159
|
+
"aria-hidden": "true",
|
|
160
|
+
className: "text-warning-foreground",
|
|
161
|
+
size: 14
|
|
162
|
+
}
|
|
163
|
+
) : String(e)
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
x.displayName = "MapGridPin";
|
|
169
|
+
const G = d.forwardRef(
|
|
170
|
+
({
|
|
171
|
+
icon: e,
|
|
172
|
+
animateIn: t = !1,
|
|
173
|
+
value: a,
|
|
174
|
+
variant: n,
|
|
175
|
+
pulse: l,
|
|
176
|
+
dataHook: s,
|
|
177
|
+
className: r,
|
|
178
|
+
trackingEl: i,
|
|
179
|
+
trackingLabel: c,
|
|
180
|
+
ariaLabel: m,
|
|
181
|
+
...u
|
|
182
|
+
}, g) => a !== void 0 || n !== void 0 || l !== void 0 ? /* @__PURE__ */ o(
|
|
183
|
+
x,
|
|
184
|
+
{
|
|
185
|
+
ref: g,
|
|
186
|
+
className: r,
|
|
187
|
+
dataHook: s,
|
|
188
|
+
pulse: l,
|
|
189
|
+
trackingEl: i,
|
|
190
|
+
trackingLabel: c,
|
|
191
|
+
value: a ?? 1,
|
|
192
|
+
variant: n,
|
|
193
|
+
...u
|
|
194
|
+
}
|
|
195
|
+
) : /* @__PURE__ */ o(
|
|
196
|
+
"div",
|
|
31
197
|
{
|
|
32
|
-
ref:
|
|
198
|
+
ref: g,
|
|
199
|
+
"aria-label": m ?? "Location",
|
|
33
200
|
className: p(
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
n
|
|
201
|
+
"relative inline-flex h-[46px] w-[38px] items-start justify-center",
|
|
202
|
+
r
|
|
37
203
|
),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
204
|
+
"data-hook": s,
|
|
205
|
+
"data-slot": "map-location-pin",
|
|
206
|
+
"data-tracking-el": i || "map-location-pin",
|
|
207
|
+
"data-tracking-label": c,
|
|
208
|
+
role: "img",
|
|
209
|
+
...u,
|
|
210
|
+
children: /* @__PURE__ */ f(
|
|
211
|
+
"span",
|
|
212
|
+
{
|
|
213
|
+
"aria-hidden": "true",
|
|
214
|
+
className: p(
|
|
215
|
+
"relative flex size-full",
|
|
216
|
+
t && "animate-pop-in origin-bottom will-change-transform motion-reduce:animate-none"
|
|
217
|
+
),
|
|
218
|
+
children: [
|
|
219
|
+
/* @__PURE__ */ f(
|
|
220
|
+
"svg",
|
|
221
|
+
{
|
|
222
|
+
"aria-hidden": "true",
|
|
223
|
+
className: "size-full overflow-visible drop-shadow-sm",
|
|
224
|
+
fill: "none",
|
|
225
|
+
viewBox: "0 0 38 46",
|
|
226
|
+
children: [
|
|
227
|
+
/* @__PURE__ */ o(
|
|
228
|
+
"path",
|
|
229
|
+
{
|
|
230
|
+
className: "fill-white",
|
|
231
|
+
d: "M38 19.15C38 29.21 29.4 35.77 20.38 44.63C19.61 45.39 18.37 45.41 17.58 44.67C8.01 35.79 0 29.23 0 19.15C0 8.57 8.51 0 19 0C29.49 0 38 8.57 38 19.15Z"
|
|
232
|
+
}
|
|
233
|
+
),
|
|
234
|
+
/* @__PURE__ */ o("circle", { className: "fill-sky-500", cx: "19", cy: "19", r: "16" })
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
),
|
|
238
|
+
/* @__PURE__ */ o("span", { className: "absolute top-[19px] left-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center text-white", children: e ?? /* @__PURE__ */ o(C, { size: 16 }) })
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
)
|
|
48
242
|
}
|
|
49
243
|
)
|
|
50
244
|
);
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
({
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
245
|
+
G.displayName = "MapLocationPin";
|
|
246
|
+
const V = d.forwardRef(
|
|
247
|
+
({
|
|
248
|
+
className: e,
|
|
249
|
+
dataHook: t,
|
|
250
|
+
trackingEl: a,
|
|
251
|
+
trackingLabel: n,
|
|
252
|
+
children: l,
|
|
253
|
+
iconOnly: s = !0,
|
|
254
|
+
...r
|
|
255
|
+
}, i) => {
|
|
256
|
+
const c = k();
|
|
257
|
+
return /* @__PURE__ */ o(
|
|
258
|
+
b,
|
|
259
|
+
{
|
|
260
|
+
ref: i,
|
|
261
|
+
className: e,
|
|
262
|
+
"data-slot": "map-control-button",
|
|
263
|
+
dataHook: t,
|
|
264
|
+
iconOnly: s,
|
|
265
|
+
trackingEl: a || "map-control-button",
|
|
266
|
+
trackingLabel: n,
|
|
267
|
+
variant: c ? "secondary" : "outline",
|
|
268
|
+
...r,
|
|
269
|
+
children: l
|
|
270
|
+
}
|
|
271
|
+
);
|
|
272
|
+
}
|
|
71
273
|
);
|
|
72
|
-
|
|
73
|
-
const
|
|
274
|
+
V.displayName = "MapControlButton";
|
|
275
|
+
const O = d.forwardRef(
|
|
74
276
|
({
|
|
75
|
-
className:
|
|
76
|
-
|
|
277
|
+
className: e,
|
|
278
|
+
children: t,
|
|
77
279
|
dataHook: a,
|
|
78
|
-
trackingEl:
|
|
79
|
-
trackingLabel:
|
|
80
|
-
|
|
81
|
-
|
|
280
|
+
trackingEl: n,
|
|
281
|
+
trackingLabel: l,
|
|
282
|
+
ariaLabel: s,
|
|
283
|
+
...r
|
|
284
|
+
}, i) => /* @__PURE__ */ f(
|
|
82
285
|
"div",
|
|
83
286
|
{
|
|
84
287
|
ref: i,
|
|
85
|
-
"aria-
|
|
288
|
+
"aria-label": s ?? "Loading map",
|
|
86
289
|
className: p(
|
|
87
|
-
"
|
|
88
|
-
|
|
290
|
+
"border-border relative flex h-full w-full items-center justify-center overflow-hidden rounded-lg border",
|
|
291
|
+
e
|
|
89
292
|
),
|
|
90
293
|
"data-hook": a,
|
|
91
294
|
"data-slot": "map-loading-state",
|
|
92
|
-
"data-tracking-el":
|
|
93
|
-
"data-tracking-label":
|
|
295
|
+
"data-tracking-el": n || "map-loading-state",
|
|
296
|
+
"data-tracking-label": l,
|
|
94
297
|
role: "status",
|
|
95
|
-
...
|
|
298
|
+
...r,
|
|
96
299
|
children: [
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
|
|
99
|
-
{
|
|
100
|
-
"aria-hidden": "true",
|
|
101
|
-
className: "size-4 animate-spin rounded-full border-2 border-current border-t-transparent"
|
|
102
|
-
}
|
|
103
|
-
),
|
|
104
|
-
r
|
|
300
|
+
/* @__PURE__ */ o(w, {}),
|
|
301
|
+
t && /* @__PURE__ */ o("div", { className: "relative", children: t })
|
|
105
302
|
]
|
|
106
303
|
}
|
|
107
304
|
)
|
|
108
305
|
);
|
|
109
|
-
|
|
110
|
-
const
|
|
306
|
+
O.displayName = "MapLoadingState";
|
|
307
|
+
const w = d.memo(function({
|
|
308
|
+
rounded: t
|
|
309
|
+
}) {
|
|
310
|
+
return /* @__PURE__ */ o(
|
|
311
|
+
S,
|
|
312
|
+
{
|
|
313
|
+
"aria-hidden": "true",
|
|
314
|
+
className: p(
|
|
315
|
+
"absolute inset-0 h-full w-full object-cover",
|
|
316
|
+
t && "rounded-[inherit]"
|
|
317
|
+
),
|
|
318
|
+
mode: "auto"
|
|
319
|
+
}
|
|
320
|
+
);
|
|
321
|
+
}), _ = d.forwardRef(
|
|
111
322
|
({
|
|
112
|
-
className:
|
|
113
|
-
title:
|
|
114
|
-
message: a = "
|
|
115
|
-
onRetry:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
323
|
+
className: e,
|
|
324
|
+
title: t = "We couldn't load your map rankings.",
|
|
325
|
+
message: a = "Reloading usually fixes it, and it won't use any credits",
|
|
326
|
+
onRetry: n,
|
|
327
|
+
retryLoading: l = !1,
|
|
328
|
+
retryLabel: s = "Reload",
|
|
329
|
+
dataHook: r,
|
|
330
|
+
trackingEl: i,
|
|
331
|
+
trackingLabel: c,
|
|
332
|
+
...m
|
|
333
|
+
}, u) => /* @__PURE__ */ f(
|
|
121
334
|
"div",
|
|
122
335
|
{
|
|
123
|
-
ref:
|
|
336
|
+
ref: u,
|
|
124
337
|
className: p(
|
|
125
|
-
"
|
|
126
|
-
|
|
338
|
+
"border-border relative flex h-full w-full flex-col items-center justify-center gap-4 rounded-lg border p-4 text-center sm:gap-6 sm:p-8",
|
|
339
|
+
e
|
|
127
340
|
),
|
|
128
|
-
"data-hook":
|
|
341
|
+
"data-hook": r,
|
|
129
342
|
"data-slot": "map-error-state",
|
|
130
|
-
"data-tracking-el":
|
|
131
|
-
"data-tracking-label":
|
|
343
|
+
"data-tracking-el": i || "map-error-state",
|
|
344
|
+
"data-tracking-label": c,
|
|
132
345
|
role: "alert",
|
|
133
|
-
...
|
|
346
|
+
...m,
|
|
134
347
|
children: [
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
"
|
|
139
|
-
className: "text-muted-foreground/60",
|
|
140
|
-
size: 40,
|
|
141
|
-
strokeWidth: 1.5
|
|
142
|
-
}
|
|
143
|
-
),
|
|
144
|
-
/* @__PURE__ */ m("div", { className: "flex flex-col gap-1", children: [
|
|
145
|
-
/* @__PURE__ */ l(
|
|
146
|
-
"h3",
|
|
348
|
+
/* @__PURE__ */ o(w, { rounded: !0 }),
|
|
349
|
+
/* @__PURE__ */ f("div", { className: "relative flex flex-col items-center gap-4 sm:gap-6", children: [
|
|
350
|
+
/* @__PURE__ */ o(
|
|
351
|
+
"div",
|
|
147
352
|
{
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
353
|
+
"aria-hidden": "true",
|
|
354
|
+
className: "flex items-center justify-center",
|
|
355
|
+
"data-slot": "map-error-illustration",
|
|
356
|
+
children: /* @__PURE__ */ o(P, { className: "h-auto w-full max-w-41" })
|
|
151
357
|
}
|
|
152
358
|
),
|
|
153
|
-
|
|
154
|
-
|
|
359
|
+
/* @__PURE__ */ f("div", { className: "flex flex-col gap-2", children: [
|
|
360
|
+
/* @__PURE__ */ o(
|
|
361
|
+
"h3",
|
|
362
|
+
{
|
|
363
|
+
className: "text-foreground text-lg font-medium",
|
|
364
|
+
"data-slot": "map-error-title",
|
|
365
|
+
children: t
|
|
366
|
+
}
|
|
367
|
+
),
|
|
368
|
+
a && /* @__PURE__ */ o(
|
|
369
|
+
"p",
|
|
370
|
+
{
|
|
371
|
+
className: "text-muted-foreground text-sm",
|
|
372
|
+
"data-slot": "map-error-message",
|
|
373
|
+
children: a
|
|
374
|
+
}
|
|
375
|
+
)
|
|
376
|
+
] }),
|
|
377
|
+
n && /* @__PURE__ */ f(
|
|
378
|
+
b,
|
|
155
379
|
{
|
|
156
|
-
className: "
|
|
157
|
-
|
|
158
|
-
|
|
380
|
+
className: "mt-1",
|
|
381
|
+
dataHook: `${r}-retry`,
|
|
382
|
+
loading: l,
|
|
383
|
+
size: "sm",
|
|
384
|
+
variant: "primary",
|
|
385
|
+
onClick: n,
|
|
386
|
+
children: [
|
|
387
|
+
!l && /* @__PURE__ */ o(N, { "aria-hidden": "true" }),
|
|
388
|
+
s
|
|
389
|
+
]
|
|
159
390
|
}
|
|
160
391
|
)
|
|
161
|
-
] })
|
|
162
|
-
o && /* @__PURE__ */ l(
|
|
163
|
-
u,
|
|
164
|
-
{
|
|
165
|
-
className: "mt-1",
|
|
166
|
-
dataHook: `${n}-retry`,
|
|
167
|
-
size: "sm",
|
|
168
|
-
variant: "primary",
|
|
169
|
-
onClick: o,
|
|
170
|
-
children: "Try again"
|
|
171
|
-
}
|
|
172
|
-
)
|
|
392
|
+
] })
|
|
173
393
|
]
|
|
174
394
|
}
|
|
175
395
|
)
|
|
176
396
|
);
|
|
177
|
-
|
|
178
|
-
const
|
|
179
|
-
({
|
|
180
|
-
|
|
397
|
+
_.displayName = "MapErrorState";
|
|
398
|
+
const W = d.forwardRef(
|
|
399
|
+
({ variant: e, color: t, dataHook: a, className: n, children: l, ...s }, r) => {
|
|
400
|
+
const i = e ? y[e] : t;
|
|
401
|
+
return /* @__PURE__ */ f(
|
|
402
|
+
"span",
|
|
403
|
+
{
|
|
404
|
+
ref: r,
|
|
405
|
+
className: p(
|
|
406
|
+
"text-foreground flex items-center gap-1 font-sans text-xs",
|
|
407
|
+
n
|
|
408
|
+
),
|
|
409
|
+
"data-hook": a,
|
|
410
|
+
"data-slot": "map-legend-item",
|
|
411
|
+
...s,
|
|
412
|
+
children: [
|
|
413
|
+
/* @__PURE__ */ o(
|
|
414
|
+
"span",
|
|
415
|
+
{
|
|
416
|
+
"aria-hidden": "true",
|
|
417
|
+
className: p("inline-block size-2 shrink-0 rounded-full", i)
|
|
418
|
+
}
|
|
419
|
+
),
|
|
420
|
+
l
|
|
421
|
+
]
|
|
422
|
+
}
|
|
423
|
+
);
|
|
424
|
+
}
|
|
425
|
+
);
|
|
426
|
+
W.displayName = "MapLegendItem";
|
|
427
|
+
const Y = d.forwardRef(
|
|
428
|
+
({
|
|
429
|
+
className: e,
|
|
430
|
+
dataHook: t,
|
|
431
|
+
trackingEl: a,
|
|
432
|
+
trackingLabel: n,
|
|
433
|
+
ariaLabel: l,
|
|
434
|
+
children: s,
|
|
435
|
+
...r
|
|
436
|
+
}, i) => /* @__PURE__ */ o(
|
|
437
|
+
L,
|
|
181
438
|
{
|
|
182
439
|
ref: i,
|
|
183
|
-
|
|
440
|
+
"aria-label": l ?? "Map legend",
|
|
441
|
+
className: p(
|
|
442
|
+
"inline-flex w-auto flex-row items-center bg-white font-sans dark:bg-neutral-800",
|
|
443
|
+
e
|
|
444
|
+
),
|
|
184
445
|
"data-slot": "map-legend",
|
|
185
|
-
dataHook:
|
|
446
|
+
dataHook: t,
|
|
186
447
|
density: "condensed",
|
|
187
448
|
maxWidth: "none",
|
|
449
|
+
role: "group",
|
|
188
450
|
trackingEl: a || "map-legend",
|
|
189
|
-
trackingLabel:
|
|
190
|
-
variant: "
|
|
191
|
-
...
|
|
192
|
-
children: /* @__PURE__ */
|
|
451
|
+
trackingLabel: n,
|
|
452
|
+
variant: "border",
|
|
453
|
+
...r,
|
|
454
|
+
children: /* @__PURE__ */ o(R, { className: "flex items-center gap-3", children: s })
|
|
193
455
|
}
|
|
194
456
|
)
|
|
195
457
|
);
|
|
196
|
-
|
|
197
|
-
function
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
}, []),
|
|
201
|
-
|
|
202
|
-
}, [
|
|
203
|
-
|
|
204
|
-
|
|
458
|
+
Y.displayName = "MapLegend";
|
|
459
|
+
function oe(e) {
|
|
460
|
+
const { hoverWhenOpen: t = !1 } = e ?? {}, [a, n] = d.useState(null), [l, s] = d.useState(null), r = d.useCallback((m) => {
|
|
461
|
+
s(m), n(m);
|
|
462
|
+
}, []), i = d.useCallback(() => {
|
|
463
|
+
n(null);
|
|
464
|
+
}, []), c = d.useCallback(
|
|
465
|
+
(m) => {
|
|
466
|
+
const u = {
|
|
467
|
+
onClick: () => r(m)
|
|
468
|
+
};
|
|
469
|
+
return t && (u.onPointerEnter = (g) => {
|
|
470
|
+
g.pointerType === "mouse" && a != null && r(m);
|
|
471
|
+
}), u;
|
|
472
|
+
},
|
|
473
|
+
[t, r, a]
|
|
474
|
+
);
|
|
205
475
|
return {
|
|
206
|
-
activeItem:
|
|
207
|
-
anchorItem:
|
|
208
|
-
showItem:
|
|
209
|
-
|
|
210
|
-
|
|
476
|
+
activeItem: a,
|
|
477
|
+
anchorItem: l,
|
|
478
|
+
showItem: r,
|
|
479
|
+
close: i,
|
|
480
|
+
getInteractionProps: c
|
|
211
481
|
};
|
|
212
482
|
}
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
const
|
|
483
|
+
const ne = A, K = E;
|
|
484
|
+
K.displayName = "MapPopoverAnchor";
|
|
485
|
+
const U = d.forwardRef(
|
|
216
486
|
({
|
|
217
|
-
className:
|
|
218
|
-
side:
|
|
487
|
+
className: e,
|
|
488
|
+
side: t = "top",
|
|
219
489
|
sideOffset: a = 4,
|
|
220
|
-
dataHook:
|
|
221
|
-
trackingEl:
|
|
222
|
-
trackingLabel:
|
|
223
|
-
...
|
|
224
|
-
},
|
|
225
|
-
|
|
490
|
+
dataHook: n,
|
|
491
|
+
trackingEl: l,
|
|
492
|
+
trackingLabel: s,
|
|
493
|
+
...r
|
|
494
|
+
}, i) => /* @__PURE__ */ o(
|
|
495
|
+
I,
|
|
226
496
|
{
|
|
227
|
-
ref:
|
|
497
|
+
ref: i,
|
|
228
498
|
className: p(
|
|
229
|
-
"w-auto p-3 data-[state=closed]:animate-none data-[state=closed]:opacity-0",
|
|
230
|
-
|
|
499
|
+
"w-auto max-w-68.25 p-3 data-[state=closed]:animate-none data-[state=closed]:opacity-0",
|
|
500
|
+
e
|
|
231
501
|
),
|
|
232
502
|
"data-slot": "map-popover-content",
|
|
233
|
-
"data-tracking-el":
|
|
234
|
-
"data-tracking-label":
|
|
235
|
-
dataHook:
|
|
236
|
-
side:
|
|
503
|
+
"data-tracking-el": l || "map-popover",
|
|
504
|
+
"data-tracking-label": s,
|
|
505
|
+
dataHook: n,
|
|
506
|
+
side: t,
|
|
237
507
|
sideOffset: a,
|
|
508
|
+
onCloseAutoFocus: (c) => c.preventDefault(),
|
|
238
509
|
onOpenAutoFocus: (c) => c.preventDefault(),
|
|
239
|
-
...
|
|
510
|
+
...r
|
|
240
511
|
}
|
|
241
512
|
)
|
|
242
513
|
);
|
|
243
|
-
|
|
514
|
+
U.displayName = "MapPopoverContent";
|
|
244
515
|
export {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
516
|
+
B as MAP_STYLES,
|
|
517
|
+
V as MapControlButton,
|
|
518
|
+
_ as MapErrorState,
|
|
519
|
+
x as MapGridPin,
|
|
520
|
+
Y as MapLegend,
|
|
521
|
+
W as MapLegendItem,
|
|
522
|
+
O as MapLoadingState,
|
|
523
|
+
G as MapLocationPin,
|
|
524
|
+
ne as MapPopover,
|
|
525
|
+
K as MapPopoverAnchor,
|
|
526
|
+
U as MapPopoverContent,
|
|
527
|
+
ae as MapTypeId,
|
|
528
|
+
y as mapGridPinColorMap,
|
|
529
|
+
oe as useMapPopoverClick,
|
|
530
|
+
re as useMapStyles
|
|
256
531
|
};
|