@classic-homes/maps-react 0.7.0 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -99,7 +99,7 @@ var MapError = React6__namespace.forwardRef(
99
99
  {
100
100
  ref,
101
101
  className: cn(
102
- "flex flex-col items-center justify-center rounded-lg border border-destructive/50 bg-destructive/5",
102
+ "flex flex-col items-center justify-center rounded-lg border border-destructive bg-background",
103
103
  className
104
104
  ),
105
105
  style: { height: heightStyle },
@@ -137,7 +137,7 @@ var MapError = React6__namespace.forwardRef(
137
137
  "button",
138
138
  {
139
139
  onClick: onRetry,
140
- className: "mt-2 rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
140
+ className: "mt-2 rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
141
141
  children: "Retry"
142
142
  }
143
143
  )
@@ -155,7 +155,7 @@ var MapEmpty = React6__namespace.forwardRef(
155
155
  {
156
156
  ref,
157
157
  className: cn(
158
- "flex flex-col items-center justify-center rounded-lg border border-border bg-muted/50",
158
+ "flex flex-col items-center justify-center rounded-lg border border-border bg-muted",
159
159
  className
160
160
  ),
161
161
  style: { height: heightStyle },
@@ -1074,7 +1074,8 @@ var Marker2 = React6__namespace.forwardRef(
1074
1074
  ({
1075
1075
  id,
1076
1076
  coordinates,
1077
- color,
1077
+ // Heritage Teal, as in Svelte (MapLibre's own default is a light blue)
1078
+ color = mapsCore.markerColor,
1078
1079
  anchor = "bottom",
1079
1080
  offset,
1080
1081
  rotation,
@@ -1441,7 +1442,7 @@ var PopupHeader = React6__namespace.forwardRef(
1441
1442
  {
1442
1443
  ref,
1443
1444
  className: cn(
1444
- "flex items-start justify-between gap-2 border-b border-black dark:border-gray-400 bg-muted/30 px-4 py-3 pr-12",
1445
+ "flex items-start justify-between gap-2 border-b border-border bg-muted px-4 py-3 pr-12",
1445
1446
  className
1446
1447
  ),
1447
1448
  ...props,
@@ -1467,7 +1468,7 @@ var PopupFooter = React6__namespace.forwardRef(
1467
1468
  {
1468
1469
  ref,
1469
1470
  className: cn(
1470
- "flex justify-end gap-2 border-t border-black dark:border-gray-400 bg-muted/30 px-4 py-3",
1471
+ "flex justify-end gap-2 border-t border-border bg-muted px-4 py-3",
1471
1472
  className
1472
1473
  ),
1473
1474
  ...props,
@@ -2396,7 +2397,7 @@ var Legend = ({
2396
2397
  {
2397
2398
  ref: legendRef,
2398
2399
  className: cn(
2399
- "absolute bg-card rounded-lg shadow-lg border border-black dark:border-gray-400",
2400
+ "absolute bg-card rounded-lg shadow-lg border border-border",
2400
2401
  "text-sm min-w-[140px]",
2401
2402
  !visible && "invisible",
2402
2403
  className
@@ -2446,8 +2447,7 @@ var Legend = ({
2446
2447
  className: cn(
2447
2448
  "flex items-center gap-2 w-full text-left rounded px-1 -mx-1",
2448
2449
  onItemClick && "hover:bg-muted cursor-pointer",
2449
- !onItemClick && "cursor-default",
2450
- item.active === false && "opacity-50"
2450
+ !onItemClick && "cursor-default"
2451
2451
  ),
2452
2452
  onClick: () => handleItemClick(item, index),
2453
2453
  disabled: !onItemClick,
@@ -2455,11 +2455,21 @@ var Legend = ({
2455
2455
  /* @__PURE__ */ jsxRuntime.jsx(
2456
2456
  "span",
2457
2457
  {
2458
- className: "w-4 h-4 rounded flex-shrink-0",
2459
- style: { backgroundColor: item.color }
2458
+ className: "w-4 h-4 rounded flex-shrink-0 border border-foreground",
2459
+ style: {
2460
+ backgroundColor: item.active === false ? "transparent" : item.color
2461
+ }
2462
+ }
2463
+ ),
2464
+ /* @__PURE__ */ jsxRuntime.jsx(
2465
+ "span",
2466
+ {
2467
+ className: cn(
2468
+ item.active === false ? "text-muted-foreground line-through" : "text-foreground"
2469
+ ),
2470
+ children: item.label
2460
2471
  }
2461
2472
  ),
2462
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground", children: item.label }),
2463
2473
  item.value !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-xs", children: item.value })
2464
2474
  ]
2465
2475
  }
@@ -2525,7 +2535,7 @@ var LegendGroup = ({
2525
2535
  {
2526
2536
  ref: containerRef,
2527
2537
  className: cn(
2528
- "absolute bg-card rounded-lg shadow-lg border border-black dark:border-gray-400",
2538
+ "absolute bg-card rounded-lg shadow-lg border border-border",
2529
2539
  "text-sm min-w-[160px] max-w-[280px]",
2530
2540
  !visible && "invisible",
2531
2541
  className
@@ -2590,8 +2600,7 @@ var LegendGroup = ({
2590
2600
  className: cn(
2591
2601
  "flex items-center gap-2 w-full text-left rounded px-1 -mx-1",
2592
2602
  legend.onItemClick && "hover:bg-muted cursor-pointer",
2593
- !legend.onItemClick && "cursor-default",
2594
- item.active === false && "opacity-50"
2603
+ !legend.onItemClick && "cursor-default"
2595
2604
  ),
2596
2605
  onClick: () => handleItemClick(legend, item, index),
2597
2606
  disabled: !legend.onItemClick,
@@ -2599,11 +2608,22 @@ var LegendGroup = ({
2599
2608
  /* @__PURE__ */ jsxRuntime.jsx(
2600
2609
  "span",
2601
2610
  {
2602
- className: "w-4 h-4 rounded flex-shrink-0",
2603
- style: { backgroundColor: item.color }
2611
+ className: "w-4 h-4 rounded flex-shrink-0 border border-foreground",
2612
+ style: {
2613
+ backgroundColor: item.active === false ? "transparent" : item.color
2614
+ }
2615
+ }
2616
+ ),
2617
+ /* @__PURE__ */ jsxRuntime.jsx(
2618
+ "span",
2619
+ {
2620
+ className: cn(
2621
+ "truncate flex-1",
2622
+ item.active === false ? "text-muted-foreground line-through" : "text-foreground"
2623
+ ),
2624
+ children: item.label
2604
2625
  }
2605
2626
  ),
2606
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground truncate flex-1", children: item.label }),
2607
2627
  item.value !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-xs", children: item.value })
2608
2628
  ]
2609
2629
  }
@@ -2715,14 +2735,14 @@ var CoordinateDisplay = ({
2715
2735
  className: cn(
2716
2736
  "absolute bg-card rounded px-2 py-1",
2717
2737
  "text-xs font-mono text-muted-foreground",
2718
- "border border-black dark:border-gray-400 shadow-sm",
2738
+ "border border-border shadow-sm",
2719
2739
  "flex items-center gap-3",
2720
2740
  !visible && "invisible",
2721
2741
  className
2722
2742
  ),
2723
2743
  style: adjustedStyle,
2724
2744
  children: [
2725
- cursorLngLat ? /* @__PURE__ */ jsxRuntime.jsx("span", { title: "Cursor coordinates", children: formatCoord(cursorLngLat) }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/60", children: "Move cursor over map" }),
2745
+ cursorLngLat ? /* @__PURE__ */ jsxRuntime.jsx("span", { title: "Cursor coordinates", children: formatCoord(cursorLngLat) }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Move cursor over map" }),
2726
2746
  showZoom && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2727
2747
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-border", children: "|" }),
2728
2748
  /* @__PURE__ */ jsxRuntime.jsxs("span", { title: "Zoom level", children: [
@@ -2856,7 +2876,7 @@ var BasemapSwitcher = ({
2856
2876
  ref: panelRef,
2857
2877
  className: cn(
2858
2878
  "absolute classic-basemap-panel-enter",
2859
- "bg-card rounded-lg shadow-lg border border-black dark:border-gray-400",
2879
+ "bg-card rounded-lg shadow-lg border border-border",
2860
2880
  "p-2",
2861
2881
  isTop ? "top-full mt-1" : "bottom-full mb-1",
2862
2882
  position.includes("right") ? "right-0" : "left-0"
@@ -2889,8 +2909,9 @@ var BasemapSwitcher = ({
2889
2909
  tabIndex: index === tabStopIndex ? 0 : -1,
2890
2910
  className: cn(
2891
2911
  "flex flex-col items-center gap-1 p-1 rounded cursor-pointer",
2892
- "hover:bg-muted",
2893
- isActive && "ring-2 ring-primary"
2912
+ // Selected: Linen, a check and a bold label. The ring is the focus
2913
+ // indicator only, so arrowing onto an option never looks selected
2914
+ isActive ? "bg-accent" : "hover:bg-muted"
2894
2915
  ),
2895
2916
  onFocus: () => setTabStopIndex(index),
2896
2917
  onClick: () => handleSelect(basemap),
@@ -2909,7 +2930,34 @@ var BasemapSwitcher = ({
2909
2930
  }
2910
2931
  }
2911
2932
  ),
2912
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-foreground truncate w-full text-center leading-tight", children: basemap.label ?? basemap.name })
2933
+ /* @__PURE__ */ jsxRuntime.jsxs(
2934
+ "span",
2935
+ {
2936
+ className: cn(
2937
+ "text-[10px] text-foreground truncate w-full text-center leading-tight",
2938
+ isActive && "font-semibold"
2939
+ ),
2940
+ children: [
2941
+ isActive && /* @__PURE__ */ jsxRuntime.jsx(
2942
+ "svg",
2943
+ {
2944
+ "aria-hidden": "true",
2945
+ width: "10",
2946
+ height: "10",
2947
+ viewBox: "0 0 24 24",
2948
+ fill: "none",
2949
+ stroke: "currentColor",
2950
+ strokeWidth: "3",
2951
+ strokeLinecap: "round",
2952
+ strokeLinejoin: "round",
2953
+ style: { display: "inline", verticalAlign: "-1px", marginRight: 2 },
2954
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 6 9 17l-5-5" })
2955
+ }
2956
+ ),
2957
+ basemap.label ?? basemap.name
2958
+ ]
2959
+ }
2960
+ )
2913
2961
  ]
2914
2962
  },
2915
2963
  basemap.id
@@ -2926,7 +2974,7 @@ var BasemapSwitcher = ({
2926
2974
  type: "button",
2927
2975
  className: cn(
2928
2976
  "w-[40px] h-[40px] flex items-center justify-center",
2929
- "bg-card rounded shadow-lg border border-black dark:border-gray-400",
2977
+ "bg-card rounded shadow-lg border border-border",
2930
2978
  "hover:bg-muted cursor-pointer",
2931
2979
  "text-foreground"
2932
2980
  ),
@@ -3191,17 +3239,32 @@ var LayerManager = ({
3191
3239
  icon: paint["icon-opacity"] ?? 1
3192
3240
  };
3193
3241
  switch (layer.style.renderType) {
3194
- case "fill":
3195
- layerComponent = /* @__PURE__ */ jsxRuntime.jsx(
3196
- FillLayer,
3197
- {
3198
- ...layerProps,
3199
- fillColor: paint["fill-color"],
3200
- fillOpacity: baseOpacity.fill * state.opacity,
3201
- fillOutlineColor: paint["fill-outline-color"]
3202
- }
3203
- );
3242
+ case "fill": {
3243
+ const outline = mapsCore.getOutlineStyleForTheme(layer, theme);
3244
+ layerComponent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3245
+ /* @__PURE__ */ jsxRuntime.jsx(
3246
+ FillLayer,
3247
+ {
3248
+ ...layerProps,
3249
+ fillColor: paint["fill-color"],
3250
+ fillOpacity: baseOpacity.fill * state.opacity,
3251
+ fillOutlineColor: paint["fill-outline-color"]
3252
+ }
3253
+ ),
3254
+ outline && /* @__PURE__ */ jsxRuntime.jsx(
3255
+ LineLayer,
3256
+ {
3257
+ ...layerProps,
3258
+ id: `${layerProps.id}${mapsCore.OUTLINE_LAYER_SUFFIX}`,
3259
+ lineColor: outline["line-color"],
3260
+ lineWidth: outline["line-width"],
3261
+ lineOpacity: (outline["line-opacity"] ?? 1) * state.opacity,
3262
+ lineDasharray: outline["line-dasharray"]
3263
+ }
3264
+ )
3265
+ ] });
3204
3266
  break;
3267
+ }
3205
3268
  case "line":
3206
3269
  layerComponent = /* @__PURE__ */ jsxRuntime.jsx(
3207
3270
  LineLayer,
@@ -3398,7 +3461,7 @@ var LayerManager = ({
3398
3461
  {
3399
3462
  className: cn(
3400
3463
  "absolute classic-layer-panel-enter",
3401
- "bg-card rounded-lg shadow-lg border border-black dark:border-gray-400",
3464
+ "bg-card rounded-lg shadow-lg border border-border",
3402
3465
  "w-64",
3403
3466
  isTop ? "top-full mt-1" : "bottom-full mb-1",
3404
3467
  position.includes("right") ? "right-0" : "left-0"
@@ -3445,6 +3508,7 @@ var LayerManager = ({
3445
3508
  type: "button",
3446
3509
  className: "classic-layer-tab",
3447
3510
  "data-active": activeCategory === "all",
3511
+ "aria-pressed": activeCategory === "all",
3448
3512
  onClick: () => setActiveCategory("all"),
3449
3513
  children: "All"
3450
3514
  }
@@ -3455,6 +3519,7 @@ var LayerManager = ({
3455
3519
  type: "button",
3456
3520
  className: "classic-layer-tab",
3457
3521
  "data-active": activeCategory === cat,
3522
+ "aria-pressed": activeCategory === cat,
3458
3523
  onClick: () => setActiveCategory(cat),
3459
3524
  children: mapsCore.CATEGORY_META[cat].label
3460
3525
  },
@@ -3493,7 +3558,7 @@ var LayerManager = ({
3493
3558
  type: "button",
3494
3559
  className: cn(
3495
3560
  "w-[40px] h-[40px] flex items-center justify-center",
3496
- "bg-card rounded shadow-lg border border-black dark:border-gray-400",
3561
+ "bg-card rounded shadow-lg border border-border",
3497
3562
  "hover:bg-muted cursor-pointer",
3498
3563
  "text-foreground"
3499
3564
  ),
@@ -3587,7 +3652,9 @@ var DeckOverlay = ({
3587
3652
  const MapboxOverlay = deckMapbox.MapboxOverlay;
3588
3653
  MapboxOverlayRef.current = MapboxOverlay;
3589
3654
  const overlay = new MapboxOverlay({
3590
- interleaved,
3655
+ // deck.gl reads map.transform, which MapLibre 6 no longer has: every
3656
+ // interleaved frame would throw, so fall back to overlaid rendering
3657
+ interleaved: mapsCore.resolveDeckInterleaved(map, interleaved),
3591
3658
  layers: layersRef.current,
3592
3659
  onHover,
3593
3660
  onClick,
package/dist/index.css CHANGED
@@ -702,7 +702,7 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
702
702
  /* ../maps-core/src/styles/controls.css */
703
703
  .maplibregl-ctrl-group {
704
704
  background: hsl(var(--card)) !important;
705
- border: 1px solid black !important;
705
+ border: 1px solid hsl(var(--border)) !important;
706
706
  border-radius: 0.375rem !important;
707
707
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important;
708
708
  overflow: hidden !important;
@@ -725,14 +725,14 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
725
725
  }
726
726
  .maplibregl-ctrl-group button:focus {
727
727
  outline: none !important;
728
- box-shadow: 0 0 0 2px hsl(var(--ring)) !important;
728
+ box-shadow: inset 0 0 0 2px hsl(var(--ring)) !important;
729
729
  }
730
730
  .maplibregl-ctrl-group button:focus-visible {
731
731
  outline: none !important;
732
- box-shadow: 0 0 0 2px hsl(var(--ring)) !important;
732
+ box-shadow: inset 0 0 0 2px hsl(var(--ring)) !important;
733
733
  }
734
734
  .maplibregl-ctrl-group button + button {
735
- border-top: 1px solid black !important;
735
+ border-top: 1px solid hsl(var(--border)) !important;
736
736
  }
737
737
  .dark .maplibregl-ctrl-group button + button {
738
738
  border-top-color: rgb(156 163 175) !important;
@@ -750,7 +750,7 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
750
750
  }
751
751
  .maplibregl-ctrl-scale {
752
752
  background: hsl(var(--card)) !important;
753
- border: 1px solid black !important;
753
+ border: 1px solid hsl(var(--border)) !important;
754
754
  border-radius: 0.25rem !important;
755
755
  padding: 0 4px !important;
756
756
  font-family:
@@ -790,7 +790,7 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
790
790
  .maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {
791
791
  }
792
792
  .maplibregl-ctrl-attrib {
793
- background: hsl(var(--card) / 0.8) !important;
793
+ background: hsl(var(--card)) !important;
794
794
  padding: 2px 5px !important;
795
795
  font-size: 0.625rem !important;
796
796
  border-radius: 0.25rem !important;
@@ -804,8 +804,8 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
804
804
  text-decoration: underline !important;
805
805
  }
806
806
  .maplibregl-ctrl-attrib-button {
807
- background-color: hsl(var(--card) / 0.8) !important;
808
- border: 1px solid black !important;
807
+ background-color: hsl(var(--card)) !important;
808
+ border: 1px solid hsl(var(--border)) !important;
809
809
  border-radius: 0.25rem !important;
810
810
  }
811
811
  .dark .maplibregl-ctrl-attrib-button {
@@ -813,7 +813,7 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
813
813
  }
814
814
  .maplibregl-ctrl-attrib-button:focus {
815
815
  outline: none !important;
816
- box-shadow: 0 0 0 2px hsl(var(--ring)) !important;
816
+ box-shadow: inset 0 0 0 2px hsl(var(--ring)) !important;
817
817
  }
818
818
  .maplibregl-ctrl-logo {
819
819
  opacity: 0.7 !important;
@@ -920,7 +920,7 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
920
920
  border-radius: 0.375rem;
921
921
  }
922
922
  .classic-layer-item:hover {
923
- background-color: hsl(var(--muted) / 0.5);
923
+ background-color: hsl(var(--muted));
924
924
  }
925
925
  .classic-layer-item[data-dragging=true] {
926
926
  opacity: 0.5;
@@ -948,10 +948,13 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
948
948
  width: 100%;
949
949
  height: 4px;
950
950
  border-radius: 2px;
951
- background: hsl(var(--muted));
951
+ background: hsl(var(--outline, 70 9% 48%));
952
952
  outline: none;
953
953
  cursor: pointer;
954
954
  }
955
+ .classic-layer-opacity-slider:focus-visible {
956
+ box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
957
+ }
955
958
  .classic-layer-opacity-slider::-webkit-slider-thumb {
956
959
  -webkit-appearance: none;
957
960
  appearance: none;
@@ -979,11 +982,10 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
979
982
  }
980
983
  .classic-layer-drag-handle {
981
984
  cursor: grab;
982
- opacity: 0.4;
983
- transition: opacity 150ms ease;
985
+ color: hsl(var(--muted-foreground));
984
986
  }
985
987
  .classic-layer-drag-handle:hover {
986
- opacity: 1;
988
+ color: hsl(var(--foreground));
987
989
  }
988
990
  .classic-layer-drag-handle:active {
989
991
  cursor: grabbing;
@@ -1014,11 +1016,10 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
1014
1016
  color: hsl(var(--foreground));
1015
1017
  font-size: 0.875rem;
1016
1018
  outline: none;
1017
- transition: border-color 150ms ease, box-shadow 150ms ease;
1018
1019
  }
1019
- .classic-layer-search:focus {
1020
- border-color: hsl(var(--primary));
1021
- box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
1020
+ .classic-layer-search:focus-visible {
1021
+ border-color: hsl(var(--ring));
1022
+ box-shadow: 0 0 0 2px hsl(var(--ring));
1022
1023
  }
1023
1024
  .classic-layer-search::placeholder {
1024
1025
  color: hsl(var(--muted-foreground));
@@ -1027,7 +1028,7 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
1027
1028
  display: flex;
1028
1029
  gap: 0.25rem;
1029
1030
  padding: 0.25rem;
1030
- background-color: hsl(var(--muted) / 0.5);
1031
+ background-color: hsl(var(--muted));
1031
1032
  border-radius: 0.375rem;
1032
1033
  }
1033
1034
  .classic-layer-tab {
@@ -1044,9 +1045,14 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
1044
1045
  color: hsl(var(--foreground));
1045
1046
  }
1046
1047
  .classic-layer-tab[data-active=true] {
1047
- background-color: hsl(var(--background));
1048
- color: hsl(var(--foreground));
1049
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
1048
+ background-color: hsl(var(--accent));
1049
+ color: hsl(var(--accent-foreground));
1050
+ font-weight: 600;
1051
+ box-shadow: inset 0 -3px 0 hsl(var(--primary));
1052
+ }
1053
+ .classic-layer-tab:focus-visible {
1054
+ outline: 2px solid hsl(var(--ring));
1055
+ outline-offset: 1px;
1050
1056
  }
1051
1057
  .classic-layer-error {
1052
1058
  color: hsl(var(--destructive));
package/dist/index.d.cts CHANGED
@@ -371,7 +371,7 @@ interface CustomControlProps {
371
371
  * ```tsx
372
372
  * <Map>
373
373
  * <CustomControl position="top-right">
374
- * <div className="bg-white p-2 rounded shadow">
374
+ * <div className="bg-card p-2 rounded shadow">
375
375
  * Custom widget content
376
376
  * </div>
377
377
  * </CustomControl>
@@ -416,7 +416,11 @@ interface DeckOverlayProps {
416
416
  isHovering: boolean;
417
417
  isDragging: boolean;
418
418
  }) => string;
419
- /** Whether to enable interleaved rendering (default: true) */
419
+ /**
420
+ * Whether to enable interleaved rendering (default: true). Ignored on
421
+ * MapLibre 6, which deck.gl cannot interleave into yet: the overlay is
422
+ * drawn on its own canvas above the map instead.
423
+ */
420
424
  interleaved?: boolean;
421
425
  /** Deck.gl effects */
422
426
  effects?: unknown[];
package/dist/index.d.ts CHANGED
@@ -371,7 +371,7 @@ interface CustomControlProps {
371
371
  * ```tsx
372
372
  * <Map>
373
373
  * <CustomControl position="top-right">
374
- * <div className="bg-white p-2 rounded shadow">
374
+ * <div className="bg-card p-2 rounded shadow">
375
375
  * Custom widget content
376
376
  * </div>
377
377
  * </CustomControl>
@@ -416,7 +416,11 @@ interface DeckOverlayProps {
416
416
  isHovering: boolean;
417
417
  isDragging: boolean;
418
418
  }) => string;
419
- /** Whether to enable interleaved rendering (default: true) */
419
+ /**
420
+ * Whether to enable interleaved rendering (default: true). Ignored on
421
+ * MapLibre 6, which deck.gl cannot interleave into yet: the overlay is
422
+ * drawn on its own canvas above the map instead.
423
+ */
420
424
  interleaved?: boolean;
421
425
  /** Deck.gl effects */
422
426
  effects?: unknown[];
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import * as maplibregl from 'maplibre-gl';
7
7
  import 'maplibre-gl/dist/maplibre-gl.css';
8
8
  import '@classic-homes/maps-core/styles/controls.css';
9
9
  import '@classic-homes/maps-core/styles/marker.css';
10
- import { createPositioningCoordinator, generateMapDescription, warnIfWorkerUrlMissing, applyMarkerProtection, applyMarkerChildProtection, removeMarkerProtection, DEFAULT_BASEMAP, darkTheme, lightTheme, THEME_DARK, THEME_LIGHT, calculateBounds, getChangedPaintProps, EDGE_MARGIN, formatCoordinates, getAvailableBasemaps, FREE_BASEMAPS, resolveBasemapThumbnail, createInitialLayerStates, getLayerCategories, searchLayers, groupLayersByCategory, toggleLayerVisibility, setLayerOpacity, getLayerStatesArray, reorderLayers, CATEGORY_META, resolveBasemapStyle, getGridNavigationIndex, STACK_GAP, getLayerStyleForTheme, resolveLayerSourceUrl } from '@classic-homes/maps-core';
10
+ import { createPositioningCoordinator, generateMapDescription, warnIfWorkerUrlMissing, markerColor, applyMarkerProtection, applyMarkerChildProtection, removeMarkerProtection, DEFAULT_BASEMAP, darkTheme, lightTheme, THEME_DARK, THEME_LIGHT, calculateBounds, getChangedPaintProps, EDGE_MARGIN, formatCoordinates, getAvailableBasemaps, FREE_BASEMAPS, resolveBasemapThumbnail, createInitialLayerStates, getLayerCategories, searchLayers, groupLayersByCategory, toggleLayerVisibility, setLayerOpacity, getLayerStatesArray, reorderLayers, CATEGORY_META, resolveBasemapStyle, getGridNavigationIndex, STACK_GAP, resolveDeckInterleaved, getLayerStyleForTheme, resolveLayerSourceUrl, getOutlineStyleForTheme, OUTLINE_LAYER_SUFFIX } from '@classic-homes/maps-core';
11
11
  export { BIKE_LANES, BUILTIN_BASEMAPS, BUILTIN_OVERLAY_LAYERS, CATEGORY_META, CITY_LIMITS, DEFAULT_BASEMAP, FLOOD_ZONES, FREE_BASEMAPS, OSM_STANDARD, PARKS, PRIMARY_BASEMAPS, SATELLITE_BASEMAP, SCHOOL_DISTRICTS, SPORTS_FACILITIES, THEME_DARK, THEME_LIGHT, TOPO_BASEMAP, TRAILS, TRANSIT_ROUTES, WATERSHEDS, ZONING_DISTRICTS, calculateBounds, calculateCentroid, combineBounds, countFeaturesByType, createClusterCirclePaint, createClusterStyles, createClusterTextLayout, createHoverExpression, createInitialLayerStates, createSelectionExpression, darkBasicStyle, darkTheme, expandCluster, expandClusterToBounds, extendBounds, filterByGeometryType, formatArea, formatCoordinates, formatDistance, generateMapDescription, getAvailableBasemaps, getClusterBounds, getClusterChildren, getClusterExpansionZoom, getClusterLeaves, getHighlightStyle, getLayerCategories, getLayerStyleForTheme, getLayersByCategory, getSelectionStyle, groupLayersByCategory, isClusterFeature, isValidBounds, lightBasicStyle, lightTheme, loadGeoJSON, resolveBasemapStyle, resolveLayerSourceUrl, searchLayers, setLayerOpacity, toggleLayerVisibility, validateGeoJSON } from '@classic-homes/maps-core';
12
12
  import * as ReactDOM from 'react-dom';
13
13
  import { panToFitPopup, normalizePadding } from '@classic-homes/maps-core/utils';
@@ -82,7 +82,7 @@ var MapError = React6.forwardRef(
82
82
  {
83
83
  ref,
84
84
  className: cn(
85
- "flex flex-col items-center justify-center rounded-lg border border-destructive/50 bg-destructive/5",
85
+ "flex flex-col items-center justify-center rounded-lg border border-destructive bg-background",
86
86
  className
87
87
  ),
88
88
  style: { height: heightStyle },
@@ -120,7 +120,7 @@ var MapError = React6.forwardRef(
120
120
  "button",
121
121
  {
122
122
  onClick: onRetry,
123
- className: "mt-2 rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
123
+ className: "mt-2 rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
124
124
  children: "Retry"
125
125
  }
126
126
  )
@@ -138,7 +138,7 @@ var MapEmpty = React6.forwardRef(
138
138
  {
139
139
  ref,
140
140
  className: cn(
141
- "flex flex-col items-center justify-center rounded-lg border border-border bg-muted/50",
141
+ "flex flex-col items-center justify-center rounded-lg border border-border bg-muted",
142
142
  className
143
143
  ),
144
144
  style: { height: heightStyle },
@@ -1057,7 +1057,8 @@ var Marker2 = React6.forwardRef(
1057
1057
  ({
1058
1058
  id,
1059
1059
  coordinates,
1060
- color,
1060
+ // Heritage Teal, as in Svelte (MapLibre's own default is a light blue)
1061
+ color = markerColor,
1061
1062
  anchor = "bottom",
1062
1063
  offset,
1063
1064
  rotation,
@@ -1424,7 +1425,7 @@ var PopupHeader = React6.forwardRef(
1424
1425
  {
1425
1426
  ref,
1426
1427
  className: cn(
1427
- "flex items-start justify-between gap-2 border-b border-black dark:border-gray-400 bg-muted/30 px-4 py-3 pr-12",
1428
+ "flex items-start justify-between gap-2 border-b border-border bg-muted px-4 py-3 pr-12",
1428
1429
  className
1429
1430
  ),
1430
1431
  ...props,
@@ -1450,7 +1451,7 @@ var PopupFooter = React6.forwardRef(
1450
1451
  {
1451
1452
  ref,
1452
1453
  className: cn(
1453
- "flex justify-end gap-2 border-t border-black dark:border-gray-400 bg-muted/30 px-4 py-3",
1454
+ "flex justify-end gap-2 border-t border-border bg-muted px-4 py-3",
1454
1455
  className
1455
1456
  ),
1456
1457
  ...props,
@@ -2379,7 +2380,7 @@ var Legend = ({
2379
2380
  {
2380
2381
  ref: legendRef,
2381
2382
  className: cn(
2382
- "absolute bg-card rounded-lg shadow-lg border border-black dark:border-gray-400",
2383
+ "absolute bg-card rounded-lg shadow-lg border border-border",
2383
2384
  "text-sm min-w-[140px]",
2384
2385
  !visible && "invisible",
2385
2386
  className
@@ -2429,8 +2430,7 @@ var Legend = ({
2429
2430
  className: cn(
2430
2431
  "flex items-center gap-2 w-full text-left rounded px-1 -mx-1",
2431
2432
  onItemClick && "hover:bg-muted cursor-pointer",
2432
- !onItemClick && "cursor-default",
2433
- item.active === false && "opacity-50"
2433
+ !onItemClick && "cursor-default"
2434
2434
  ),
2435
2435
  onClick: () => handleItemClick(item, index),
2436
2436
  disabled: !onItemClick,
@@ -2438,11 +2438,21 @@ var Legend = ({
2438
2438
  /* @__PURE__ */ jsx(
2439
2439
  "span",
2440
2440
  {
2441
- className: "w-4 h-4 rounded flex-shrink-0",
2442
- style: { backgroundColor: item.color }
2441
+ className: "w-4 h-4 rounded flex-shrink-0 border border-foreground",
2442
+ style: {
2443
+ backgroundColor: item.active === false ? "transparent" : item.color
2444
+ }
2445
+ }
2446
+ ),
2447
+ /* @__PURE__ */ jsx(
2448
+ "span",
2449
+ {
2450
+ className: cn(
2451
+ item.active === false ? "text-muted-foreground line-through" : "text-foreground"
2452
+ ),
2453
+ children: item.label
2443
2454
  }
2444
2455
  ),
2445
- /* @__PURE__ */ jsx("span", { className: "text-foreground", children: item.label }),
2446
2456
  item.value !== void 0 && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: item.value })
2447
2457
  ]
2448
2458
  }
@@ -2508,7 +2518,7 @@ var LegendGroup = ({
2508
2518
  {
2509
2519
  ref: containerRef,
2510
2520
  className: cn(
2511
- "absolute bg-card rounded-lg shadow-lg border border-black dark:border-gray-400",
2521
+ "absolute bg-card rounded-lg shadow-lg border border-border",
2512
2522
  "text-sm min-w-[160px] max-w-[280px]",
2513
2523
  !visible && "invisible",
2514
2524
  className
@@ -2573,8 +2583,7 @@ var LegendGroup = ({
2573
2583
  className: cn(
2574
2584
  "flex items-center gap-2 w-full text-left rounded px-1 -mx-1",
2575
2585
  legend.onItemClick && "hover:bg-muted cursor-pointer",
2576
- !legend.onItemClick && "cursor-default",
2577
- item.active === false && "opacity-50"
2586
+ !legend.onItemClick && "cursor-default"
2578
2587
  ),
2579
2588
  onClick: () => handleItemClick(legend, item, index),
2580
2589
  disabled: !legend.onItemClick,
@@ -2582,11 +2591,22 @@ var LegendGroup = ({
2582
2591
  /* @__PURE__ */ jsx(
2583
2592
  "span",
2584
2593
  {
2585
- className: "w-4 h-4 rounded flex-shrink-0",
2586
- style: { backgroundColor: item.color }
2594
+ className: "w-4 h-4 rounded flex-shrink-0 border border-foreground",
2595
+ style: {
2596
+ backgroundColor: item.active === false ? "transparent" : item.color
2597
+ }
2598
+ }
2599
+ ),
2600
+ /* @__PURE__ */ jsx(
2601
+ "span",
2602
+ {
2603
+ className: cn(
2604
+ "truncate flex-1",
2605
+ item.active === false ? "text-muted-foreground line-through" : "text-foreground"
2606
+ ),
2607
+ children: item.label
2587
2608
  }
2588
2609
  ),
2589
- /* @__PURE__ */ jsx("span", { className: "text-foreground truncate flex-1", children: item.label }),
2590
2610
  item.value !== void 0 && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: item.value })
2591
2611
  ]
2592
2612
  }
@@ -2698,14 +2718,14 @@ var CoordinateDisplay = ({
2698
2718
  className: cn(
2699
2719
  "absolute bg-card rounded px-2 py-1",
2700
2720
  "text-xs font-mono text-muted-foreground",
2701
- "border border-black dark:border-gray-400 shadow-sm",
2721
+ "border border-border shadow-sm",
2702
2722
  "flex items-center gap-3",
2703
2723
  !visible && "invisible",
2704
2724
  className
2705
2725
  ),
2706
2726
  style: adjustedStyle,
2707
2727
  children: [
2708
- cursorLngLat ? /* @__PURE__ */ jsx("span", { title: "Cursor coordinates", children: formatCoord(cursorLngLat) }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/60", children: "Move cursor over map" }),
2728
+ cursorLngLat ? /* @__PURE__ */ jsx("span", { title: "Cursor coordinates", children: formatCoord(cursorLngLat) }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Move cursor over map" }),
2709
2729
  showZoom && /* @__PURE__ */ jsxs(Fragment, { children: [
2710
2730
  /* @__PURE__ */ jsx("span", { className: "text-border", children: "|" }),
2711
2731
  /* @__PURE__ */ jsxs("span", { title: "Zoom level", children: [
@@ -2839,7 +2859,7 @@ var BasemapSwitcher = ({
2839
2859
  ref: panelRef,
2840
2860
  className: cn(
2841
2861
  "absolute classic-basemap-panel-enter",
2842
- "bg-card rounded-lg shadow-lg border border-black dark:border-gray-400",
2862
+ "bg-card rounded-lg shadow-lg border border-border",
2843
2863
  "p-2",
2844
2864
  isTop ? "top-full mt-1" : "bottom-full mb-1",
2845
2865
  position.includes("right") ? "right-0" : "left-0"
@@ -2872,8 +2892,9 @@ var BasemapSwitcher = ({
2872
2892
  tabIndex: index === tabStopIndex ? 0 : -1,
2873
2893
  className: cn(
2874
2894
  "flex flex-col items-center gap-1 p-1 rounded cursor-pointer",
2875
- "hover:bg-muted",
2876
- isActive && "ring-2 ring-primary"
2895
+ // Selected: Linen, a check and a bold label. The ring is the focus
2896
+ // indicator only, so arrowing onto an option never looks selected
2897
+ isActive ? "bg-accent" : "hover:bg-muted"
2877
2898
  ),
2878
2899
  onFocus: () => setTabStopIndex(index),
2879
2900
  onClick: () => handleSelect(basemap),
@@ -2892,7 +2913,34 @@ var BasemapSwitcher = ({
2892
2913
  }
2893
2914
  }
2894
2915
  ),
2895
- /* @__PURE__ */ jsx("span", { className: "text-[10px] text-foreground truncate w-full text-center leading-tight", children: basemap.label ?? basemap.name })
2916
+ /* @__PURE__ */ jsxs(
2917
+ "span",
2918
+ {
2919
+ className: cn(
2920
+ "text-[10px] text-foreground truncate w-full text-center leading-tight",
2921
+ isActive && "font-semibold"
2922
+ ),
2923
+ children: [
2924
+ isActive && /* @__PURE__ */ jsx(
2925
+ "svg",
2926
+ {
2927
+ "aria-hidden": "true",
2928
+ width: "10",
2929
+ height: "10",
2930
+ viewBox: "0 0 24 24",
2931
+ fill: "none",
2932
+ stroke: "currentColor",
2933
+ strokeWidth: "3",
2934
+ strokeLinecap: "round",
2935
+ strokeLinejoin: "round",
2936
+ style: { display: "inline", verticalAlign: "-1px", marginRight: 2 },
2937
+ children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" })
2938
+ }
2939
+ ),
2940
+ basemap.label ?? basemap.name
2941
+ ]
2942
+ }
2943
+ )
2896
2944
  ]
2897
2945
  },
2898
2946
  basemap.id
@@ -2909,7 +2957,7 @@ var BasemapSwitcher = ({
2909
2957
  type: "button",
2910
2958
  className: cn(
2911
2959
  "w-[40px] h-[40px] flex items-center justify-center",
2912
- "bg-card rounded shadow-lg border border-black dark:border-gray-400",
2960
+ "bg-card rounded shadow-lg border border-border",
2913
2961
  "hover:bg-muted cursor-pointer",
2914
2962
  "text-foreground"
2915
2963
  ),
@@ -3174,17 +3222,32 @@ var LayerManager = ({
3174
3222
  icon: paint["icon-opacity"] ?? 1
3175
3223
  };
3176
3224
  switch (layer.style.renderType) {
3177
- case "fill":
3178
- layerComponent = /* @__PURE__ */ jsx(
3179
- FillLayer,
3180
- {
3181
- ...layerProps,
3182
- fillColor: paint["fill-color"],
3183
- fillOpacity: baseOpacity.fill * state.opacity,
3184
- fillOutlineColor: paint["fill-outline-color"]
3185
- }
3186
- );
3225
+ case "fill": {
3226
+ const outline = getOutlineStyleForTheme(layer, theme);
3227
+ layerComponent = /* @__PURE__ */ jsxs(Fragment, { children: [
3228
+ /* @__PURE__ */ jsx(
3229
+ FillLayer,
3230
+ {
3231
+ ...layerProps,
3232
+ fillColor: paint["fill-color"],
3233
+ fillOpacity: baseOpacity.fill * state.opacity,
3234
+ fillOutlineColor: paint["fill-outline-color"]
3235
+ }
3236
+ ),
3237
+ outline && /* @__PURE__ */ jsx(
3238
+ LineLayer,
3239
+ {
3240
+ ...layerProps,
3241
+ id: `${layerProps.id}${OUTLINE_LAYER_SUFFIX}`,
3242
+ lineColor: outline["line-color"],
3243
+ lineWidth: outline["line-width"],
3244
+ lineOpacity: (outline["line-opacity"] ?? 1) * state.opacity,
3245
+ lineDasharray: outline["line-dasharray"]
3246
+ }
3247
+ )
3248
+ ] });
3187
3249
  break;
3250
+ }
3188
3251
  case "line":
3189
3252
  layerComponent = /* @__PURE__ */ jsx(
3190
3253
  LineLayer,
@@ -3381,7 +3444,7 @@ var LayerManager = ({
3381
3444
  {
3382
3445
  className: cn(
3383
3446
  "absolute classic-layer-panel-enter",
3384
- "bg-card rounded-lg shadow-lg border border-black dark:border-gray-400",
3447
+ "bg-card rounded-lg shadow-lg border border-border",
3385
3448
  "w-64",
3386
3449
  isTop ? "top-full mt-1" : "bottom-full mb-1",
3387
3450
  position.includes("right") ? "right-0" : "left-0"
@@ -3428,6 +3491,7 @@ var LayerManager = ({
3428
3491
  type: "button",
3429
3492
  className: "classic-layer-tab",
3430
3493
  "data-active": activeCategory === "all",
3494
+ "aria-pressed": activeCategory === "all",
3431
3495
  onClick: () => setActiveCategory("all"),
3432
3496
  children: "All"
3433
3497
  }
@@ -3438,6 +3502,7 @@ var LayerManager = ({
3438
3502
  type: "button",
3439
3503
  className: "classic-layer-tab",
3440
3504
  "data-active": activeCategory === cat,
3505
+ "aria-pressed": activeCategory === cat,
3441
3506
  onClick: () => setActiveCategory(cat),
3442
3507
  children: CATEGORY_META[cat].label
3443
3508
  },
@@ -3476,7 +3541,7 @@ var LayerManager = ({
3476
3541
  type: "button",
3477
3542
  className: cn(
3478
3543
  "w-[40px] h-[40px] flex items-center justify-center",
3479
- "bg-card rounded shadow-lg border border-black dark:border-gray-400",
3544
+ "bg-card rounded shadow-lg border border-border",
3480
3545
  "hover:bg-muted cursor-pointer",
3481
3546
  "text-foreground"
3482
3547
  ),
@@ -3570,7 +3635,9 @@ var DeckOverlay = ({
3570
3635
  const MapboxOverlay = deckMapbox.MapboxOverlay;
3571
3636
  MapboxOverlayRef.current = MapboxOverlay;
3572
3637
  const overlay = new MapboxOverlay({
3573
- interleaved,
3638
+ // deck.gl reads map.transform, which MapLibre 6 no longer has: every
3639
+ // interleaved frame would throw, so fall back to overlaid rendering
3640
+ interleaved: resolveDeckInterleaved(map, interleaved),
3574
3641
  layers: layersRef.current,
3575
3642
  onHover,
3576
3643
  onClick,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classic-homes/maps-react",
3
- "version": "0.7.0",
3
+ "version": "0.7.4",
4
4
  "description": "React MapLibre components for Classic Theme",
5
5
  "keywords": [
6
6
  "maps",
@@ -46,7 +46,7 @@
46
46
  "test": "vitest run"
47
47
  },
48
48
  "dependencies": {
49
- "@classic-homes/maps-core": "*",
49
+ "@classic-homes/maps-core": "^0.7.4",
50
50
  "@classic-homes/theme-react": "*",
51
51
  "class-variance-authority": "^0.7.0",
52
52
  "clsx": "^2.1.0",