@brightlocal/ui-components 2.15.0 → 2.17.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/component-meta.json +10 -9
- package/deprecations.json +189 -0
- package/dist/badge.d.ts +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +20 -4
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +95 -72
- package/dist/chart.cjs +4 -4
- package/dist/chart.d.ts +26 -0
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +75 -59
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.js +33 -33
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +10 -2
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +17 -2
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +53 -26
- package/dist/index.cjs +1 -1
- package/dist/index.js +366 -360
- package/dist/map.cjs +1 -1
- package/dist/map.d.ts +147 -4
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +375 -219
- package/dist/rating.cjs +1 -1
- package/dist/rating.d.ts +10 -0
- package/dist/rating.d.ts.map +1 -1
- package/dist/rating.js +38 -33
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +13 -2
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +38 -30
- package/package.json +18 -6
- package/src/components/card.tsx +62 -8
- package/src/components/chart.tsx +39 -1
- package/src/components/combobox.tsx +1 -1
- package/src/components/field.tsx +9 -1
- package/src/components/global-layout.tsx +60 -7
- package/src/components/map.tsx +414 -28
- package/src/components/rating.tsx +20 -1
- package/src/components/sheet.tsx +30 -5
package/dist/map.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { RefreshCw as
|
|
5
|
-
import { GlobeyFixingFault as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { Card as
|
|
8
|
-
import { cn as
|
|
9
|
-
import { Popover as
|
|
10
|
-
const
|
|
1
|
+
import { jsx as c, jsxs as y } from "react/jsx-runtime";
|
|
2
|
+
import * as u from "react";
|
|
3
|
+
import { cva as K } from "class-variance-authority";
|
|
4
|
+
import { RefreshCw as U, TriangleAlert as W, Store as Y } from "@brightlocal/icons";
|
|
5
|
+
import { GlobeyFixingFault as Z, MapBackground as q } from "@brightlocal/illustrations";
|
|
6
|
+
import { Button as T } from "@brightlocal/ui-components/button";
|
|
7
|
+
import { Card as H, CardContent as J } from "@brightlocal/ui-components/card";
|
|
8
|
+
import { cn as g } from "@brightlocal/ui-components/lib/utils";
|
|
9
|
+
import { Popover as Q, PopoverAnchor as X, PopoverContent as ee } from "@brightlocal/ui-components/popover";
|
|
10
|
+
const Se = {
|
|
11
11
|
/** Default road map view */
|
|
12
12
|
ROADMAP: "roadmap",
|
|
13
13
|
/** @deprecated Satellite imagery — prefer cloud-based map styling via Map ID */
|
|
14
14
|
SATELLITE: "satellite"
|
|
15
|
-
},
|
|
16
|
-
function
|
|
15
|
+
}, te = ["water", "landscape", "road", "poi", "transit"];
|
|
16
|
+
function re(e, t) {
|
|
17
17
|
return [
|
|
18
|
-
...
|
|
18
|
+
...te.map((a) => ({
|
|
19
19
|
featureType: a,
|
|
20
20
|
elementType: "geometry",
|
|
21
21
|
stylers: [{ saturation: e, lightness: t }]
|
|
@@ -30,7 +30,7 @@ function D(e, t) {
|
|
|
30
30
|
}
|
|
31
31
|
];
|
|
32
32
|
}
|
|
33
|
-
const
|
|
33
|
+
const $ = [
|
|
34
34
|
{ elementType: "geometry", stylers: [{ color: "#444444" }] },
|
|
35
35
|
{ elementType: "labels.text.fill", stylers: [{ color: "#aaaaaa" }] },
|
|
36
36
|
{ elementType: "labels.text.stroke", stylers: [{ color: "#323232" }] },
|
|
@@ -65,96 +65,136 @@ const h = [
|
|
|
65
65
|
stylers: [{ color: "#505050" }]
|
|
66
66
|
},
|
|
67
67
|
{ elementType: "labels.icon", stylers: [{ visibility: "off" }] }
|
|
68
|
-
],
|
|
69
|
-
default: { light: [], dark:
|
|
70
|
-
muted: { light:
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
], ae = {
|
|
69
|
+
default: { light: [], dark: $ },
|
|
70
|
+
muted: { light: re(-40, 20), dark: $ }
|
|
71
|
+
}, w = /* @__PURE__ */ new Set();
|
|
72
|
+
let M = typeof document < "u" && document.body.classList.contains("dark"), S = !1;
|
|
73
|
+
function oe() {
|
|
74
|
+
if (S || typeof document > "u") return;
|
|
75
|
+
S = !0, new MutationObserver(() => {
|
|
76
|
+
const t = document.body.classList.contains("dark");
|
|
77
|
+
if (t !== M) {
|
|
78
|
+
M = t;
|
|
79
|
+
for (const a of w) a();
|
|
80
|
+
}
|
|
81
|
+
}).observe(document.body, {
|
|
82
|
+
attributes: !0,
|
|
83
|
+
attributeFilter: ["class"]
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function ne(e) {
|
|
87
|
+
return w.add(e), oe(), () => {
|
|
88
|
+
w.delete(e);
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function se() {
|
|
92
|
+
return M;
|
|
93
|
+
}
|
|
94
|
+
function le() {
|
|
95
|
+
return !1;
|
|
96
|
+
}
|
|
97
|
+
function E() {
|
|
98
|
+
return u.useSyncExternalStore(
|
|
99
|
+
ne,
|
|
100
|
+
se,
|
|
101
|
+
le
|
|
75
102
|
);
|
|
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
103
|
}
|
|
86
|
-
function
|
|
87
|
-
const t =
|
|
88
|
-
return
|
|
104
|
+
function Te(e = "default") {
|
|
105
|
+
const t = E();
|
|
106
|
+
return ae[e][t ? "dark" : "light"];
|
|
89
107
|
}
|
|
90
|
-
const
|
|
108
|
+
const R = {
|
|
91
109
|
primary: "strong",
|
|
92
110
|
secondary: "moderate",
|
|
93
111
|
warning: "moderate",
|
|
94
112
|
destructive: "unranked",
|
|
95
113
|
outline: "unranked"
|
|
96
114
|
};
|
|
97
|
-
function
|
|
98
|
-
return e in
|
|
115
|
+
function ie(e) {
|
|
116
|
+
return e in R;
|
|
99
117
|
}
|
|
100
|
-
function
|
|
101
|
-
return
|
|
118
|
+
function ce(e) {
|
|
119
|
+
return ie(e) ? R[e] : e;
|
|
102
120
|
}
|
|
103
|
-
const
|
|
104
|
-
strong:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
121
|
+
const x = {
|
|
122
|
+
strong: {
|
|
123
|
+
className: "bg-primary dark:bg-green-400",
|
|
124
|
+
cssVar: "--ds-tailwind-colors-green-400",
|
|
125
|
+
fallback: "#2ae855"
|
|
126
|
+
},
|
|
127
|
+
moderate: {
|
|
128
|
+
className: "bg-chart-4",
|
|
129
|
+
cssVar: "--ds-tailwind-colors-yellow-400",
|
|
130
|
+
fallback: "#facc15"
|
|
131
|
+
},
|
|
132
|
+
weak: {
|
|
133
|
+
className: "bg-orange-400",
|
|
134
|
+
cssVar: "--ds-tailwind-colors-orange-400",
|
|
135
|
+
fallback: "#fb923c"
|
|
136
|
+
},
|
|
137
|
+
unranked: {
|
|
138
|
+
className: "bg-red-600",
|
|
139
|
+
cssVar: "--ds-tailwind-colors-red-600",
|
|
140
|
+
fallback: "#dc2626"
|
|
141
|
+
},
|
|
142
|
+
error: {
|
|
143
|
+
className: "bg-warning-background dark:bg-orange-200",
|
|
144
|
+
cssVar: "--ds-tailwind-colors-orange-200",
|
|
145
|
+
fallback: "#fed7aa"
|
|
146
|
+
}
|
|
147
|
+
}, h = Object.fromEntries(
|
|
148
|
+
Object.entries(x).map(([e, t]) => [e, t.className])
|
|
149
|
+
), de = K(
|
|
110
150
|
"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
151
|
{
|
|
112
152
|
variants: {
|
|
113
153
|
variant: {
|
|
114
|
-
strong: `${
|
|
115
|
-
moderate: `${
|
|
116
|
-
weak: `${
|
|
117
|
-
unranked: `${
|
|
118
|
-
error: `${
|
|
154
|
+
strong: `${h.strong}`,
|
|
155
|
+
moderate: `${h.moderate}`,
|
|
156
|
+
weak: `${h.weak}`,
|
|
157
|
+
unranked: `${h.unranked} text-white dark:text-white`,
|
|
158
|
+
error: `${h.error}`
|
|
119
159
|
}
|
|
120
160
|
},
|
|
121
161
|
defaultVariants: {
|
|
122
162
|
variant: "strong"
|
|
123
163
|
}
|
|
124
164
|
}
|
|
125
|
-
),
|
|
165
|
+
), O = u.forwardRef(
|
|
126
166
|
({
|
|
127
167
|
value: e,
|
|
128
168
|
variant: t = "strong",
|
|
129
169
|
loading: a = !1,
|
|
130
|
-
pulse:
|
|
170
|
+
pulse: s,
|
|
131
171
|
// eslint-disable-line @typescript-eslint/no-unused-vars -- absorbed from ...props to prevent DOM passthrough
|
|
132
|
-
dataHook:
|
|
133
|
-
className:
|
|
172
|
+
dataHook: n,
|
|
173
|
+
className: o,
|
|
134
174
|
trackingEl: r,
|
|
135
175
|
trackingLabel: i,
|
|
136
|
-
style:
|
|
137
|
-
...
|
|
138
|
-
},
|
|
139
|
-
const
|
|
140
|
-
return /* @__PURE__ */
|
|
176
|
+
style: l,
|
|
177
|
+
...d
|
|
178
|
+
}, f) => {
|
|
179
|
+
const m = ce(t);
|
|
180
|
+
return /* @__PURE__ */ c(
|
|
141
181
|
"div",
|
|
142
182
|
{
|
|
143
|
-
ref:
|
|
144
|
-
className:
|
|
145
|
-
a ? "border-border bg-accent rounded-full border" :
|
|
183
|
+
ref: f,
|
|
184
|
+
className: g(
|
|
185
|
+
a ? "border-border bg-accent rounded-full border" : de({ variant: m }),
|
|
146
186
|
"size-8 p-0",
|
|
147
|
-
|
|
187
|
+
o
|
|
148
188
|
),
|
|
149
|
-
"data-hook":
|
|
189
|
+
"data-hook": n,
|
|
150
190
|
"data-slot": "map-grid-pin",
|
|
151
191
|
"data-state": a ? "loading" : void 0,
|
|
152
192
|
"data-tracking-el": r || "map-grid-pin",
|
|
153
193
|
"data-tracking-label": i,
|
|
154
|
-
style:
|
|
155
|
-
...
|
|
156
|
-
children:
|
|
157
|
-
|
|
194
|
+
style: l,
|
|
195
|
+
...d,
|
|
196
|
+
children: m === "error" && !a ? /* @__PURE__ */ c(
|
|
197
|
+
W,
|
|
158
198
|
{
|
|
159
199
|
"aria-hidden": "true",
|
|
160
200
|
className: "text-warning-foreground",
|
|
@@ -165,58 +205,170 @@ const y = {
|
|
|
165
205
|
);
|
|
166
206
|
}
|
|
167
207
|
);
|
|
168
|
-
|
|
169
|
-
|
|
208
|
+
O.displayName = "MapGridPin";
|
|
209
|
+
function j() {
|
|
210
|
+
const t = {
|
|
211
|
+
colors: Object.fromEntries(
|
|
212
|
+
Object.entries(x).map(([s, n]) => [s, n.fallback])
|
|
213
|
+
),
|
|
214
|
+
fontFamily: "Inter, system-ui, sans-serif",
|
|
215
|
+
textColor: "#111412"
|
|
216
|
+
};
|
|
217
|
+
if (typeof document > "u") return t;
|
|
218
|
+
const a = getComputedStyle(document.documentElement);
|
|
219
|
+
return {
|
|
220
|
+
colors: Object.fromEntries(
|
|
221
|
+
Object.entries(x).map(([s, { cssVar: n, fallback: o }]) => [
|
|
222
|
+
s,
|
|
223
|
+
a.getPropertyValue(n).trim() || o
|
|
224
|
+
])
|
|
225
|
+
),
|
|
226
|
+
fontFamily: a.getPropertyValue("--ds-font-font-sans").trim() || t.fontFamily,
|
|
227
|
+
textColor: a.getPropertyValue("--ds-tailwind-colors-neutral-950").trim() || t.textColor
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
function Ee() {
|
|
231
|
+
return j().colors;
|
|
232
|
+
}
|
|
233
|
+
const Re = Object.fromEntries(
|
|
234
|
+
Object.entries(x).map(([e, t]) => [e, t.fallback])
|
|
235
|
+
), N = [
|
|
236
|
+
"strong",
|
|
237
|
+
"moderate",
|
|
238
|
+
"weak",
|
|
239
|
+
"unranked",
|
|
240
|
+
"error"
|
|
241
|
+
];
|
|
242
|
+
function L(e, t) {
|
|
243
|
+
const { colors: a, fontFamily: s, textColor: n } = j(), o = 40, r = o / 2, i = 2, l = r - i, d = l * 0.55, m = [...e].sort(
|
|
244
|
+
(p, b) => N.indexOf(p.variant) - N.indexOf(b.variant)
|
|
245
|
+
).filter((p) => p.count > 0), I = m.reduce((p, b) => p + b.count, 0) || 1, V = Math.max(Number(t) || 0, 1);
|
|
246
|
+
let k;
|
|
247
|
+
const C = m[0];
|
|
248
|
+
if (m.length <= 1) {
|
|
249
|
+
const p = C ? a[C.variant] : "#e5e7eb";
|
|
250
|
+
k = `<circle cx="${r}" cy="${r}" r="${l}" fill="${p}"/>`;
|
|
251
|
+
} else {
|
|
252
|
+
k = "";
|
|
253
|
+
let p = -Math.PI / 2;
|
|
254
|
+
for (const b of m) {
|
|
255
|
+
const P = b.count / I * Math.PI * 2, v = p + P, F = r + l * Math.cos(p), _ = r + l * Math.sin(p), z = r + l * Math.cos(v), B = r + l * Math.sin(v), G = P > Math.PI ? 1 : 0;
|
|
256
|
+
k += `<path d="M${r},${r}L${F.toFixed(2)},${_.toFixed(2)}A${l},${l} 0 ${G} 1 ${z.toFixed(2)},${B.toFixed(2)}Z" fill="${a[b.variant]}"/>`, p = v;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
const D = Math.round(o * 0.3);
|
|
260
|
+
return [
|
|
261
|
+
`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}" style="filter:drop-shadow(0 1px 2px rgba(0,0,0,.15))">`,
|
|
262
|
+
`<circle cx="${r}" cy="${r}" r="${r}" fill="white"/>`,
|
|
263
|
+
k,
|
|
264
|
+
`<circle cx="${r}" cy="${r}" r="${l}" fill="none" stroke="white" stroke-width="${i}"/>`,
|
|
265
|
+
`<circle cx="${r}" cy="${r}" r="${d}" fill="white"/>`,
|
|
266
|
+
`<text x="${r}" y="${r}" text-anchor="middle" dominant-baseline="central" font-family="${s}" font-size="${D}" font-weight="600" fill="${n}">${V}</text>`,
|
|
267
|
+
"</svg>"
|
|
268
|
+
].join("");
|
|
269
|
+
}
|
|
270
|
+
function Oe(e) {
|
|
271
|
+
if (typeof DOMParser > "u")
|
|
272
|
+
throw new Error(
|
|
273
|
+
"createClusterPinElement requires a browser environment (DOMParser). Use createClusterPinSvg for SSR."
|
|
274
|
+
);
|
|
275
|
+
const { markers: t, count: a, getVariant: s } = e, n = /* @__PURE__ */ new Map();
|
|
276
|
+
for (const f of t) {
|
|
277
|
+
const m = s(f);
|
|
278
|
+
n.set(m, (n.get(m) ?? 0) + 1);
|
|
279
|
+
}
|
|
280
|
+
const o = [];
|
|
281
|
+
for (const f of N) {
|
|
282
|
+
const m = n.get(f);
|
|
283
|
+
m && o.push({ variant: f, count: m });
|
|
284
|
+
}
|
|
285
|
+
const r = L(o, a), d = new DOMParser().parseFromString(r, "image/svg+xml").documentElement;
|
|
286
|
+
if (!(d instanceof SVGElement))
|
|
287
|
+
throw new Error("createClusterPinElement: failed to parse SVG");
|
|
288
|
+
return d;
|
|
289
|
+
}
|
|
290
|
+
const me = u.forwardRef(
|
|
291
|
+
({
|
|
292
|
+
segments: e,
|
|
293
|
+
count: t,
|
|
294
|
+
dataHook: a,
|
|
295
|
+
className: s,
|
|
296
|
+
trackingEl: n,
|
|
297
|
+
trackingLabel: o,
|
|
298
|
+
...r
|
|
299
|
+
}, i) => {
|
|
300
|
+
const l = JSON.stringify(e), d = u.useMemo(
|
|
301
|
+
() => L(e, t),
|
|
302
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- serialised key for stable comparison
|
|
303
|
+
[l, t]
|
|
304
|
+
);
|
|
305
|
+
return /* @__PURE__ */ c(
|
|
306
|
+
"div",
|
|
307
|
+
{
|
|
308
|
+
dangerouslySetInnerHTML: { __html: d },
|
|
309
|
+
ref: i,
|
|
310
|
+
className: g("inline-flex items-center justify-center", s),
|
|
311
|
+
"data-hook": a,
|
|
312
|
+
"data-slot": "map-cluster-pin",
|
|
313
|
+
"data-tracking-el": n || "map-cluster-pin",
|
|
314
|
+
"data-tracking-label": o,
|
|
315
|
+
...r
|
|
316
|
+
}
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
);
|
|
320
|
+
me.displayName = "MapClusterPin";
|
|
321
|
+
const ue = u.forwardRef(
|
|
170
322
|
({
|
|
171
323
|
icon: e,
|
|
172
324
|
animateIn: t = !1,
|
|
173
325
|
value: a,
|
|
174
|
-
variant:
|
|
175
|
-
pulse:
|
|
176
|
-
dataHook:
|
|
326
|
+
variant: s,
|
|
327
|
+
pulse: n,
|
|
328
|
+
dataHook: o,
|
|
177
329
|
className: r,
|
|
178
330
|
trackingEl: i,
|
|
179
|
-
trackingLabel:
|
|
180
|
-
ariaLabel:
|
|
181
|
-
...
|
|
182
|
-
},
|
|
183
|
-
|
|
331
|
+
trackingLabel: l,
|
|
332
|
+
ariaLabel: d,
|
|
333
|
+
...f
|
|
334
|
+
}, m) => a !== void 0 || s !== void 0 || n !== void 0 ? /* @__PURE__ */ c(
|
|
335
|
+
O,
|
|
184
336
|
{
|
|
185
|
-
ref:
|
|
337
|
+
ref: m,
|
|
186
338
|
className: r,
|
|
187
|
-
dataHook:
|
|
188
|
-
pulse:
|
|
339
|
+
dataHook: o,
|
|
340
|
+
pulse: n,
|
|
189
341
|
trackingEl: i,
|
|
190
|
-
trackingLabel:
|
|
342
|
+
trackingLabel: l,
|
|
191
343
|
value: a ?? 1,
|
|
192
|
-
variant:
|
|
193
|
-
...
|
|
344
|
+
variant: s,
|
|
345
|
+
...f
|
|
194
346
|
}
|
|
195
|
-
) : /* @__PURE__ */
|
|
347
|
+
) : /* @__PURE__ */ c(
|
|
196
348
|
"div",
|
|
197
349
|
{
|
|
198
|
-
ref:
|
|
199
|
-
"aria-label":
|
|
200
|
-
className:
|
|
350
|
+
ref: m,
|
|
351
|
+
"aria-label": d ?? "Location",
|
|
352
|
+
className: g(
|
|
201
353
|
"relative inline-flex h-[46px] w-[38px] items-start justify-center",
|
|
202
354
|
r
|
|
203
355
|
),
|
|
204
|
-
"data-hook":
|
|
356
|
+
"data-hook": o,
|
|
205
357
|
"data-slot": "map-location-pin",
|
|
206
358
|
"data-tracking-el": i || "map-location-pin",
|
|
207
|
-
"data-tracking-label":
|
|
359
|
+
"data-tracking-label": l,
|
|
208
360
|
role: "img",
|
|
209
|
-
...
|
|
210
|
-
children: /* @__PURE__ */
|
|
361
|
+
...f,
|
|
362
|
+
children: /* @__PURE__ */ y(
|
|
211
363
|
"span",
|
|
212
364
|
{
|
|
213
365
|
"aria-hidden": "true",
|
|
214
|
-
className:
|
|
366
|
+
className: g(
|
|
215
367
|
"relative flex size-full",
|
|
216
368
|
t && "animate-pop-in origin-bottom will-change-transform motion-reduce:animate-none"
|
|
217
369
|
),
|
|
218
370
|
children: [
|
|
219
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ y(
|
|
220
372
|
"svg",
|
|
221
373
|
{
|
|
222
374
|
"aria-hidden": "true",
|
|
@@ -224,140 +376,140 @@ const G = d.forwardRef(
|
|
|
224
376
|
fill: "none",
|
|
225
377
|
viewBox: "0 0 38 46",
|
|
226
378
|
children: [
|
|
227
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ c(
|
|
228
380
|
"path",
|
|
229
381
|
{
|
|
230
382
|
className: "fill-white",
|
|
231
383
|
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
384
|
}
|
|
233
385
|
),
|
|
234
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ c("circle", { className: "fill-sky-500", cx: "19", cy: "19", r: "16" })
|
|
235
387
|
]
|
|
236
388
|
}
|
|
237
389
|
),
|
|
238
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ c("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__ */ c(Y, { size: 16 }) })
|
|
239
391
|
]
|
|
240
392
|
}
|
|
241
393
|
)
|
|
242
394
|
}
|
|
243
395
|
)
|
|
244
396
|
);
|
|
245
|
-
|
|
246
|
-
const
|
|
397
|
+
ue.displayName = "MapLocationPin";
|
|
398
|
+
const fe = u.forwardRef(
|
|
247
399
|
({
|
|
248
400
|
className: e,
|
|
249
401
|
dataHook: t,
|
|
250
402
|
trackingEl: a,
|
|
251
|
-
trackingLabel:
|
|
252
|
-
children:
|
|
253
|
-
iconOnly:
|
|
403
|
+
trackingLabel: s,
|
|
404
|
+
children: n,
|
|
405
|
+
iconOnly: o = !0,
|
|
254
406
|
...r
|
|
255
407
|
}, i) => {
|
|
256
|
-
const
|
|
257
|
-
return /* @__PURE__ */
|
|
258
|
-
|
|
408
|
+
const l = E();
|
|
409
|
+
return /* @__PURE__ */ c(
|
|
410
|
+
T,
|
|
259
411
|
{
|
|
260
412
|
ref: i,
|
|
261
413
|
className: e,
|
|
262
414
|
"data-slot": "map-control-button",
|
|
263
415
|
dataHook: t,
|
|
264
|
-
iconOnly:
|
|
416
|
+
iconOnly: o,
|
|
265
417
|
trackingEl: a || "map-control-button",
|
|
266
|
-
trackingLabel:
|
|
267
|
-
variant:
|
|
418
|
+
trackingLabel: s,
|
|
419
|
+
variant: l ? "secondary" : "outline",
|
|
268
420
|
...r,
|
|
269
|
-
children:
|
|
421
|
+
children: n
|
|
270
422
|
}
|
|
271
423
|
);
|
|
272
424
|
}
|
|
273
425
|
);
|
|
274
|
-
|
|
275
|
-
const
|
|
426
|
+
fe.displayName = "MapControlButton";
|
|
427
|
+
const pe = u.forwardRef(
|
|
276
428
|
({
|
|
277
429
|
className: e,
|
|
278
430
|
children: t,
|
|
279
431
|
dataHook: a,
|
|
280
|
-
trackingEl:
|
|
281
|
-
trackingLabel:
|
|
282
|
-
ariaLabel:
|
|
432
|
+
trackingEl: s,
|
|
433
|
+
trackingLabel: n,
|
|
434
|
+
ariaLabel: o,
|
|
283
435
|
...r
|
|
284
|
-
}, i) => /* @__PURE__ */
|
|
436
|
+
}, i) => /* @__PURE__ */ y(
|
|
285
437
|
"div",
|
|
286
438
|
{
|
|
287
439
|
ref: i,
|
|
288
|
-
"aria-label":
|
|
289
|
-
className:
|
|
440
|
+
"aria-label": o ?? "Loading map",
|
|
441
|
+
className: g(
|
|
290
442
|
"border-border relative flex h-full w-full items-center justify-center overflow-hidden rounded-lg border",
|
|
291
443
|
e
|
|
292
444
|
),
|
|
293
445
|
"data-hook": a,
|
|
294
446
|
"data-slot": "map-loading-state",
|
|
295
|
-
"data-tracking-el":
|
|
296
|
-
"data-tracking-label":
|
|
447
|
+
"data-tracking-el": s || "map-loading-state",
|
|
448
|
+
"data-tracking-label": n,
|
|
297
449
|
role: "status",
|
|
298
450
|
...r,
|
|
299
451
|
children: [
|
|
300
|
-
/* @__PURE__ */
|
|
301
|
-
t && /* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ c(A, {}),
|
|
453
|
+
t && /* @__PURE__ */ c("div", { className: "relative", children: t })
|
|
302
454
|
]
|
|
303
455
|
}
|
|
304
456
|
)
|
|
305
457
|
);
|
|
306
|
-
|
|
307
|
-
const
|
|
458
|
+
pe.displayName = "MapLoadingState";
|
|
459
|
+
const A = u.memo(function({
|
|
308
460
|
rounded: t
|
|
309
461
|
}) {
|
|
310
|
-
return /* @__PURE__ */
|
|
311
|
-
|
|
462
|
+
return /* @__PURE__ */ c(
|
|
463
|
+
q,
|
|
312
464
|
{
|
|
313
465
|
"aria-hidden": "true",
|
|
314
|
-
className:
|
|
466
|
+
className: g(
|
|
315
467
|
"absolute inset-0 h-full w-full object-cover",
|
|
316
468
|
t && "rounded-[inherit]"
|
|
317
469
|
),
|
|
318
470
|
mode: "auto"
|
|
319
471
|
}
|
|
320
472
|
);
|
|
321
|
-
}),
|
|
473
|
+
}), ge = u.forwardRef(
|
|
322
474
|
({
|
|
323
475
|
className: e,
|
|
324
476
|
title: t = "We couldn't load your map rankings.",
|
|
325
477
|
message: a = "Reloading usually fixes it, and it won't use any credits",
|
|
326
|
-
onRetry:
|
|
327
|
-
retryLoading:
|
|
328
|
-
retryLabel:
|
|
478
|
+
onRetry: s,
|
|
479
|
+
retryLoading: n = !1,
|
|
480
|
+
retryLabel: o = "Reload",
|
|
329
481
|
dataHook: r,
|
|
330
482
|
trackingEl: i,
|
|
331
|
-
trackingLabel:
|
|
332
|
-
...
|
|
333
|
-
},
|
|
483
|
+
trackingLabel: l,
|
|
484
|
+
...d
|
|
485
|
+
}, f) => /* @__PURE__ */ y(
|
|
334
486
|
"div",
|
|
335
487
|
{
|
|
336
|
-
ref:
|
|
337
|
-
className:
|
|
488
|
+
ref: f,
|
|
489
|
+
className: g(
|
|
338
490
|
"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
491
|
e
|
|
340
492
|
),
|
|
341
493
|
"data-hook": r,
|
|
342
494
|
"data-slot": "map-error-state",
|
|
343
495
|
"data-tracking-el": i || "map-error-state",
|
|
344
|
-
"data-tracking-label":
|
|
496
|
+
"data-tracking-label": l,
|
|
345
497
|
role: "alert",
|
|
346
|
-
...
|
|
498
|
+
...d,
|
|
347
499
|
children: [
|
|
348
|
-
/* @__PURE__ */
|
|
349
|
-
/* @__PURE__ */
|
|
350
|
-
/* @__PURE__ */
|
|
500
|
+
/* @__PURE__ */ c(A, { rounded: !0 }),
|
|
501
|
+
/* @__PURE__ */ y("div", { className: "relative flex flex-col items-center gap-4 sm:gap-6", children: [
|
|
502
|
+
/* @__PURE__ */ c(
|
|
351
503
|
"div",
|
|
352
504
|
{
|
|
353
505
|
"aria-hidden": "true",
|
|
354
506
|
className: "flex items-center justify-center",
|
|
355
507
|
"data-slot": "map-error-illustration",
|
|
356
|
-
children: /* @__PURE__ */
|
|
508
|
+
children: /* @__PURE__ */ c(Z, { className: "h-auto w-full max-w-41" })
|
|
357
509
|
}
|
|
358
510
|
),
|
|
359
|
-
/* @__PURE__ */
|
|
360
|
-
/* @__PURE__ */
|
|
511
|
+
/* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: [
|
|
512
|
+
/* @__PURE__ */ c(
|
|
361
513
|
"h3",
|
|
362
514
|
{
|
|
363
515
|
className: "text-foreground text-lg font-medium",
|
|
@@ -365,7 +517,7 @@ const w = d.memo(function({
|
|
|
365
517
|
children: t
|
|
366
518
|
}
|
|
367
519
|
),
|
|
368
|
-
a && /* @__PURE__ */
|
|
520
|
+
a && /* @__PURE__ */ c(
|
|
369
521
|
"p",
|
|
370
522
|
{
|
|
371
523
|
className: "text-muted-foreground text-sm",
|
|
@@ -374,18 +526,18 @@ const w = d.memo(function({
|
|
|
374
526
|
}
|
|
375
527
|
)
|
|
376
528
|
] }),
|
|
377
|
-
|
|
378
|
-
|
|
529
|
+
s && /* @__PURE__ */ y(
|
|
530
|
+
T,
|
|
379
531
|
{
|
|
380
532
|
className: "mt-1",
|
|
381
533
|
dataHook: `${r}-retry`,
|
|
382
|
-
loading:
|
|
534
|
+
loading: n,
|
|
383
535
|
size: "sm",
|
|
384
536
|
variant: "primary",
|
|
385
|
-
onClick:
|
|
537
|
+
onClick: s,
|
|
386
538
|
children: [
|
|
387
|
-
!
|
|
388
|
-
|
|
539
|
+
!n && /* @__PURE__ */ c(U, { "aria-hidden": "true" }),
|
|
540
|
+
o
|
|
389
541
|
]
|
|
390
542
|
}
|
|
391
543
|
)
|
|
@@ -394,138 +546,142 @@ const w = d.memo(function({
|
|
|
394
546
|
}
|
|
395
547
|
)
|
|
396
548
|
);
|
|
397
|
-
|
|
398
|
-
const
|
|
399
|
-
({ variant: e, color: t, dataHook: a, className:
|
|
400
|
-
const i = e ?
|
|
401
|
-
return /* @__PURE__ */
|
|
549
|
+
ge.displayName = "MapErrorState";
|
|
550
|
+
const ye = u.forwardRef(
|
|
551
|
+
({ variant: e, color: t, dataHook: a, className: s, children: n, ...o }, r) => {
|
|
552
|
+
const i = e ? h[e] : t;
|
|
553
|
+
return /* @__PURE__ */ y(
|
|
402
554
|
"span",
|
|
403
555
|
{
|
|
404
556
|
ref: r,
|
|
405
|
-
className:
|
|
557
|
+
className: g(
|
|
406
558
|
"text-foreground flex items-center gap-1 font-sans text-xs",
|
|
407
|
-
|
|
559
|
+
s
|
|
408
560
|
),
|
|
409
561
|
"data-hook": a,
|
|
410
562
|
"data-slot": "map-legend-item",
|
|
411
|
-
...
|
|
563
|
+
...o,
|
|
412
564
|
children: [
|
|
413
|
-
/* @__PURE__ */
|
|
565
|
+
/* @__PURE__ */ c(
|
|
414
566
|
"span",
|
|
415
567
|
{
|
|
416
568
|
"aria-hidden": "true",
|
|
417
|
-
className:
|
|
569
|
+
className: g("inline-block size-2 shrink-0 rounded-full", i)
|
|
418
570
|
}
|
|
419
571
|
),
|
|
420
|
-
|
|
572
|
+
n
|
|
421
573
|
]
|
|
422
574
|
}
|
|
423
575
|
);
|
|
424
576
|
}
|
|
425
577
|
);
|
|
426
|
-
|
|
427
|
-
const
|
|
578
|
+
ye.displayName = "MapLegendItem";
|
|
579
|
+
const be = u.forwardRef(
|
|
428
580
|
({
|
|
429
581
|
className: e,
|
|
430
582
|
dataHook: t,
|
|
431
583
|
trackingEl: a,
|
|
432
|
-
trackingLabel:
|
|
433
|
-
ariaLabel:
|
|
434
|
-
children:
|
|
584
|
+
trackingLabel: s,
|
|
585
|
+
ariaLabel: n,
|
|
586
|
+
children: o,
|
|
435
587
|
...r
|
|
436
|
-
}, i) => /* @__PURE__ */
|
|
437
|
-
|
|
588
|
+
}, i) => /* @__PURE__ */ c(
|
|
589
|
+
H,
|
|
438
590
|
{
|
|
439
591
|
ref: i,
|
|
440
|
-
"aria-label":
|
|
441
|
-
className:
|
|
442
|
-
"inline-flex w-auto flex-row items-center bg-white font-sans dark:bg-neutral-800",
|
|
592
|
+
"aria-label": n ?? "Map legend",
|
|
593
|
+
className: g(
|
|
594
|
+
"inline-flex w-auto max-w-none flex-row items-center bg-white font-sans dark:bg-neutral-800",
|
|
443
595
|
e
|
|
444
596
|
),
|
|
445
597
|
"data-slot": "map-legend",
|
|
446
598
|
dataHook: t,
|
|
447
599
|
density: "condensed",
|
|
448
|
-
maxWidth: "none",
|
|
449
600
|
role: "group",
|
|
450
601
|
trackingEl: a || "map-legend",
|
|
451
|
-
trackingLabel:
|
|
602
|
+
trackingLabel: s,
|
|
452
603
|
variant: "border",
|
|
453
604
|
...r,
|
|
454
|
-
children: /* @__PURE__ */
|
|
605
|
+
children: /* @__PURE__ */ c(J, { className: "flex items-center gap-3", children: o })
|
|
455
606
|
}
|
|
456
607
|
)
|
|
457
608
|
);
|
|
458
|
-
|
|
459
|
-
function
|
|
460
|
-
const { hoverWhenOpen: t = !1 } = e ?? {}, [a,
|
|
461
|
-
|
|
462
|
-
}, []), i =
|
|
463
|
-
|
|
464
|
-
}, []),
|
|
465
|
-
(
|
|
466
|
-
const
|
|
467
|
-
onClick: () => r(
|
|
609
|
+
be.displayName = "MapLegend";
|
|
610
|
+
function je(e) {
|
|
611
|
+
const { hoverWhenOpen: t = !1 } = e ?? {}, [a, s] = u.useState(null), [n, o] = u.useState(null), r = u.useCallback((d) => {
|
|
612
|
+
o(d), s(d);
|
|
613
|
+
}, []), i = u.useCallback(() => {
|
|
614
|
+
s(null);
|
|
615
|
+
}, []), l = u.useCallback(
|
|
616
|
+
(d) => {
|
|
617
|
+
const f = {
|
|
618
|
+
onClick: () => r(d)
|
|
468
619
|
};
|
|
469
|
-
return t && (
|
|
470
|
-
|
|
471
|
-
}),
|
|
620
|
+
return t && (f.onPointerEnter = (m) => {
|
|
621
|
+
m.pointerType === "mouse" && a != null && r(d);
|
|
622
|
+
}), f;
|
|
472
623
|
},
|
|
473
624
|
[t, r, a]
|
|
474
625
|
);
|
|
475
626
|
return {
|
|
476
627
|
activeItem: a,
|
|
477
|
-
anchorItem:
|
|
628
|
+
anchorItem: n,
|
|
478
629
|
showItem: r,
|
|
479
630
|
close: i,
|
|
480
|
-
getInteractionProps:
|
|
631
|
+
getInteractionProps: l
|
|
481
632
|
};
|
|
482
633
|
}
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
const
|
|
634
|
+
const Le = Q, he = X;
|
|
635
|
+
he.displayName = "MapPopoverAnchor";
|
|
636
|
+
const ke = u.forwardRef(
|
|
486
637
|
({
|
|
487
638
|
className: e,
|
|
488
639
|
side: t = "top",
|
|
489
640
|
sideOffset: a = 4,
|
|
490
|
-
dataHook:
|
|
491
|
-
trackingEl:
|
|
492
|
-
trackingLabel:
|
|
641
|
+
dataHook: s,
|
|
642
|
+
trackingEl: n,
|
|
643
|
+
trackingLabel: o,
|
|
493
644
|
...r
|
|
494
|
-
}, i) => /* @__PURE__ */
|
|
495
|
-
|
|
645
|
+
}, i) => /* @__PURE__ */ c(
|
|
646
|
+
ee,
|
|
496
647
|
{
|
|
497
648
|
ref: i,
|
|
498
|
-
className:
|
|
649
|
+
className: g(
|
|
499
650
|
"w-auto max-w-68.25 p-3 data-[state=closed]:animate-none data-[state=closed]:opacity-0",
|
|
500
651
|
e
|
|
501
652
|
),
|
|
502
653
|
"data-slot": "map-popover-content",
|
|
503
|
-
"data-tracking-el":
|
|
504
|
-
"data-tracking-label":
|
|
505
|
-
dataHook:
|
|
654
|
+
"data-tracking-el": n || "map-popover",
|
|
655
|
+
"data-tracking-label": o,
|
|
656
|
+
dataHook: s,
|
|
506
657
|
side: t,
|
|
507
658
|
sideOffset: a,
|
|
508
|
-
onCloseAutoFocus: (
|
|
509
|
-
onOpenAutoFocus: (
|
|
659
|
+
onCloseAutoFocus: (l) => l.preventDefault(),
|
|
660
|
+
onOpenAutoFocus: (l) => l.preventDefault(),
|
|
510
661
|
...r
|
|
511
662
|
}
|
|
512
663
|
)
|
|
513
664
|
);
|
|
514
|
-
|
|
665
|
+
ke.displayName = "MapPopoverContent";
|
|
515
666
|
export {
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
667
|
+
ae as MAP_STYLES,
|
|
668
|
+
me as MapClusterPin,
|
|
669
|
+
fe as MapControlButton,
|
|
670
|
+
ge as MapErrorState,
|
|
671
|
+
O as MapGridPin,
|
|
672
|
+
be as MapLegend,
|
|
673
|
+
ye as MapLegendItem,
|
|
674
|
+
pe as MapLoadingState,
|
|
675
|
+
ue as MapLocationPin,
|
|
676
|
+
Le as MapPopover,
|
|
677
|
+
he as MapPopoverAnchor,
|
|
678
|
+
ke as MapPopoverContent,
|
|
679
|
+
Se as MapTypeId,
|
|
680
|
+
Re as clusterPinHexColors,
|
|
681
|
+
Oe as createClusterPinElement,
|
|
682
|
+
L as createClusterPinSvg,
|
|
683
|
+
h as mapGridPinColorMap,
|
|
684
|
+
Ee as resolveClusterPinColors,
|
|
685
|
+
je as useMapPopoverClick,
|
|
686
|
+
Te as useMapStyles
|
|
531
687
|
};
|