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