@classic-homes/maps-core 0.1.3 → 0.1.5

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.
@@ -754,5 +754,35 @@ interface LegendGroupProps {
754
754
  /** Custom CSS class */
755
755
  class?: string;
756
756
  }
757
+ type BasemapProvider = 'osm' | 'maptiler' | 'stadia' | 'classic-theme' | 'custom';
758
+ type BasemapCategory = 'streets' | 'satellite' | 'outdoor' | 'artistic' | 'minimal' | 'dark';
759
+ interface BasemapDefinition {
760
+ id: string;
761
+ name: string;
762
+ provider: BasemapProvider;
763
+ category: BasemapCategory;
764
+ thumbnail: string;
765
+ /** Style URL string, inline MapStyleSpec, or function(apiKey) => URL/spec */
766
+ style: string | MapStyleSpec | ((apiKey: string) => string | MapStyleSpec);
767
+ requiresApiKey: boolean;
768
+ attribution?: string;
769
+ label?: string;
770
+ }
771
+ interface BasemapApiKeys {
772
+ maptiler?: string;
773
+ stadia?: string;
774
+ [provider: string]: string | undefined;
775
+ }
776
+ interface BasemapSwitcherProps extends BaseControlProps {
777
+ basemaps?: BasemapDefinition[];
778
+ extraBasemaps?: BasemapDefinition[];
779
+ apiKeys?: BasemapApiKeys;
780
+ defaultBasemapId?: string;
781
+ activeBasemapId?: string;
782
+ onBasemapChange?: (basemap: BasemapDefinition) => void;
783
+ columns?: number;
784
+ thumbnailSize?: number;
785
+ class?: string;
786
+ }
757
787
 
758
- export { type BaseControlProps, type BaseLayerProps, type BaseMapEventParams, type BaseMapProps, BoundsArray, type CircleLayerProps, ClusterConfig, type ControlPosition, type CoordinateDisplayProps, type FeatureClickEventParams, type FeatureHoverEventParams, type FillExtrusionLayerProps, type FillLayerProps, GeoJSONFeature, GeoJSONFeatureCollection, type GeolocateControlProps, type GradientStop, type HeatmapLayerProps, type LegendConfig, type LegendGroupProps, type LegendItem, type LegendProps, type LineLayerProps, LngLat, MapBounds, type MapClickEventParams, type MapErrorEventParams, type MapHoverEventParams, type MapLoadEventParams, type MapMoveEventParams, type MapProps, MapSourceData, type MapStyleSpec, type MarkerClickEventParams, type MarkerDragEventParams, type MarkerProps, type NavigationControlProps, type PopupEventParams, type PopupProps, type RasterLayerProps, type ScaleControlProps, type SourceProps, type SymbolLayerProps };
788
+ export { type BaseControlProps, type BaseLayerProps, type BaseMapEventParams, type BaseMapProps, type BasemapApiKeys, type BasemapCategory, type BasemapDefinition, type BasemapProvider, type BasemapSwitcherProps, BoundsArray, type CircleLayerProps, ClusterConfig, type ControlPosition, type CoordinateDisplayProps, type FeatureClickEventParams, type FeatureHoverEventParams, type FillExtrusionLayerProps, type FillLayerProps, GeoJSONFeature, GeoJSONFeatureCollection, type GeolocateControlProps, type GradientStop, type HeatmapLayerProps, type LegendConfig, type LegendGroupProps, type LegendItem, type LegendProps, type LineLayerProps, LngLat, MapBounds, type MapClickEventParams, type MapErrorEventParams, type MapHoverEventParams, type MapLoadEventParams, type MapMoveEventParams, type MapProps, MapSourceData, type MapStyleSpec, type MarkerClickEventParams, type MarkerDragEventParams, type MarkerProps, type NavigationControlProps, type PopupEventParams, type PopupProps, type RasterLayerProps, type ScaleControlProps, type SourceProps, type SymbolLayerProps };
@@ -754,5 +754,35 @@ interface LegendGroupProps {
754
754
  /** Custom CSS class */
755
755
  class?: string;
756
756
  }
757
+ type BasemapProvider = 'osm' | 'maptiler' | 'stadia' | 'classic-theme' | 'custom';
758
+ type BasemapCategory = 'streets' | 'satellite' | 'outdoor' | 'artistic' | 'minimal' | 'dark';
759
+ interface BasemapDefinition {
760
+ id: string;
761
+ name: string;
762
+ provider: BasemapProvider;
763
+ category: BasemapCategory;
764
+ thumbnail: string;
765
+ /** Style URL string, inline MapStyleSpec, or function(apiKey) => URL/spec */
766
+ style: string | MapStyleSpec | ((apiKey: string) => string | MapStyleSpec);
767
+ requiresApiKey: boolean;
768
+ attribution?: string;
769
+ label?: string;
770
+ }
771
+ interface BasemapApiKeys {
772
+ maptiler?: string;
773
+ stadia?: string;
774
+ [provider: string]: string | undefined;
775
+ }
776
+ interface BasemapSwitcherProps extends BaseControlProps {
777
+ basemaps?: BasemapDefinition[];
778
+ extraBasemaps?: BasemapDefinition[];
779
+ apiKeys?: BasemapApiKeys;
780
+ defaultBasemapId?: string;
781
+ activeBasemapId?: string;
782
+ onBasemapChange?: (basemap: BasemapDefinition) => void;
783
+ columns?: number;
784
+ thumbnailSize?: number;
785
+ class?: string;
786
+ }
757
787
 
758
- export { type BaseControlProps, type BaseLayerProps, type BaseMapEventParams, type BaseMapProps, BoundsArray, type CircleLayerProps, ClusterConfig, type ControlPosition, type CoordinateDisplayProps, type FeatureClickEventParams, type FeatureHoverEventParams, type FillExtrusionLayerProps, type FillLayerProps, GeoJSONFeature, GeoJSONFeatureCollection, type GeolocateControlProps, type GradientStop, type HeatmapLayerProps, type LegendConfig, type LegendGroupProps, type LegendItem, type LegendProps, type LineLayerProps, LngLat, MapBounds, type MapClickEventParams, type MapErrorEventParams, type MapHoverEventParams, type MapLoadEventParams, type MapMoveEventParams, type MapProps, MapSourceData, type MapStyleSpec, type MarkerClickEventParams, type MarkerDragEventParams, type MarkerProps, type NavigationControlProps, type PopupEventParams, type PopupProps, type RasterLayerProps, type ScaleControlProps, type SourceProps, type SymbolLayerProps };
788
+ export { type BaseControlProps, type BaseLayerProps, type BaseMapEventParams, type BaseMapProps, type BasemapApiKeys, type BasemapCategory, type BasemapDefinition, type BasemapProvider, type BasemapSwitcherProps, BoundsArray, type CircleLayerProps, ClusterConfig, type ControlPosition, type CoordinateDisplayProps, type FeatureClickEventParams, type FeatureHoverEventParams, type FillExtrusionLayerProps, type FillLayerProps, GeoJSONFeature, GeoJSONFeatureCollection, type GeolocateControlProps, type GradientStop, type HeatmapLayerProps, type LegendConfig, type LegendGroupProps, type LegendItem, type LegendProps, type LineLayerProps, LngLat, MapBounds, type MapClickEventParams, type MapErrorEventParams, type MapHoverEventParams, type MapLoadEventParams, type MapMoveEventParams, type MapProps, MapSourceData, type MapStyleSpec, type MarkerClickEventParams, type MarkerDragEventParams, type MarkerProps, type NavigationControlProps, type PopupEventParams, type PopupProps, type RasterLayerProps, type ScaleControlProps, type SourceProps, type SymbolLayerProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classic-homes/maps-core",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Core utilities and theme for Classic Theme maps",
5
5
  "keywords": [
6
6
  "maps",
@@ -44,7 +44,9 @@
44
44
  },
45
45
  "./styles/controls.css": "./src/styles/controls.css",
46
46
  "./styles/popup.css": "./src/styles/popup.css",
47
- "./styles/marker.css": "./src/styles/marker.css"
47
+ "./styles/marker.css": "./src/styles/marker.css",
48
+ "./styles/basemap-switcher.css": "./src/styles/basemap-switcher.css",
49
+ "./styles/layer-manager.css": "./src/styles/layer-manager.css"
48
50
  },
49
51
  "files": [
50
52
  "dist",
@@ -0,0 +1,20 @@
1
+ @keyframes classic-basemap-panel-enter {
2
+ from {
3
+ opacity: 0;
4
+ transform: scale(0.95) translateY(4px);
5
+ }
6
+ to {
7
+ opacity: 1;
8
+ transform: scale(1) translateY(0);
9
+ }
10
+ }
11
+
12
+ .classic-basemap-panel-enter {
13
+ animation: classic-basemap-panel-enter 150ms ease-out;
14
+ }
15
+
16
+ @media (prefers-reduced-motion: reduce) {
17
+ .classic-basemap-panel-enter {
18
+ animation: none;
19
+ }
20
+ }
@@ -0,0 +1,228 @@
1
+ /* Layer Manager panel animations */
2
+
3
+ @keyframes classic-layer-panel-enter {
4
+ from {
5
+ opacity: 0;
6
+ transform: scale(0.95) translateY(4px);
7
+ }
8
+ to {
9
+ opacity: 1;
10
+ transform: scale(1) translateY(0);
11
+ }
12
+ }
13
+
14
+ .classic-layer-panel-enter {
15
+ animation: classic-layer-panel-enter 150ms ease-out;
16
+ }
17
+
18
+ @media (prefers-reduced-motion: reduce) {
19
+ .classic-layer-panel-enter {
20
+ animation: none;
21
+ }
22
+ }
23
+
24
+ /* Category accordion styles */
25
+ .classic-layer-category-header {
26
+ display: flex;
27
+ align-items: center;
28
+ justify-content: space-between;
29
+ padding: 0.5rem 0.75rem;
30
+ cursor: pointer;
31
+ border-radius: 0.375rem;
32
+ transition: background-color 150ms ease;
33
+ }
34
+
35
+ .classic-layer-category-header:hover {
36
+ background-color: hsl(var(--muted));
37
+ }
38
+
39
+ .classic-layer-category-icon {
40
+ transition: transform 150ms ease;
41
+ }
42
+
43
+ .classic-layer-category-icon[data-expanded='true'] {
44
+ transform: rotate(180deg);
45
+ }
46
+
47
+ /* Layer item styles */
48
+ .classic-layer-item {
49
+ position: relative;
50
+ display: flex;
51
+ align-items: center;
52
+ gap: 0.5rem;
53
+ padding: 0.5rem 0.75rem;
54
+ border-radius: 0.375rem;
55
+ transition: background-color 150ms ease;
56
+ }
57
+
58
+ .classic-layer-item:hover {
59
+ background-color: hsl(var(--muted) / 0.5);
60
+ }
61
+
62
+ .classic-layer-item[data-dragging='true'] {
63
+ opacity: 0.5;
64
+ background-color: hsl(var(--muted));
65
+ }
66
+
67
+ /* Drop indicator lines using pseudo-elements to avoid layout shift */
68
+ .classic-layer-item[data-drag-over='above']::before,
69
+ .classic-layer-item[data-drag-over='below']::after {
70
+ content: '';
71
+ position: absolute;
72
+ left: 0;
73
+ right: 0;
74
+ height: 2px;
75
+ background-color: hsl(var(--primary));
76
+ pointer-events: none;
77
+ }
78
+
79
+ .classic-layer-item[data-drag-over='above']::before {
80
+ top: -1px;
81
+ }
82
+
83
+ .classic-layer-item[data-drag-over='below']::after {
84
+ bottom: -1px;
85
+ }
86
+
87
+ /* Opacity slider */
88
+ .classic-layer-opacity-slider {
89
+ -webkit-appearance: none;
90
+ appearance: none;
91
+ width: 100%;
92
+ height: 4px;
93
+ border-radius: 2px;
94
+ background: hsl(var(--muted));
95
+ outline: none;
96
+ cursor: pointer;
97
+ }
98
+
99
+ .classic-layer-opacity-slider::-webkit-slider-thumb {
100
+ -webkit-appearance: none;
101
+ appearance: none;
102
+ width: 12px;
103
+ height: 12px;
104
+ border-radius: 50%;
105
+ background: hsl(var(--primary));
106
+ cursor: pointer;
107
+ transition: transform 150ms ease;
108
+ }
109
+
110
+ .classic-layer-opacity-slider::-webkit-slider-thumb:hover {
111
+ transform: scale(1.2);
112
+ }
113
+
114
+ .classic-layer-opacity-slider::-moz-range-thumb {
115
+ width: 12px;
116
+ height: 12px;
117
+ border: none;
118
+ border-radius: 50%;
119
+ background: hsl(var(--primary));
120
+ cursor: pointer;
121
+ transition: transform 150ms ease;
122
+ }
123
+
124
+ .classic-layer-opacity-slider::-moz-range-thumb:hover {
125
+ transform: scale(1.2);
126
+ }
127
+
128
+ /* Drag handle */
129
+ .classic-layer-drag-handle {
130
+ cursor: grab;
131
+ opacity: 0.4;
132
+ transition: opacity 150ms ease;
133
+ }
134
+
135
+ .classic-layer-drag-handle:hover {
136
+ opacity: 1;
137
+ }
138
+
139
+ .classic-layer-drag-handle:active {
140
+ cursor: grabbing;
141
+ }
142
+
143
+ /* Loading spinner */
144
+ @keyframes classic-layer-spin {
145
+ from {
146
+ transform: rotate(0deg);
147
+ }
148
+ to {
149
+ transform: rotate(360deg);
150
+ }
151
+ }
152
+
153
+ .classic-layer-loading {
154
+ animation: classic-layer-spin 1s linear infinite;
155
+ }
156
+
157
+ @media (prefers-reduced-motion: reduce) {
158
+ .classic-layer-loading {
159
+ animation: none;
160
+ opacity: 0.5;
161
+ }
162
+ }
163
+
164
+ /* Search input */
165
+ .classic-layer-search {
166
+ width: 100%;
167
+ padding: 0.5rem 0.75rem;
168
+ border: 1px solid hsl(var(--border));
169
+ border-radius: 0.375rem;
170
+ background-color: hsl(var(--background));
171
+ color: hsl(var(--foreground));
172
+ font-size: 0.875rem;
173
+ outline: none;
174
+ transition:
175
+ border-color 150ms ease,
176
+ box-shadow 150ms ease;
177
+ }
178
+
179
+ .classic-layer-search:focus {
180
+ border-color: hsl(var(--primary));
181
+ box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
182
+ }
183
+
184
+ .classic-layer-search::placeholder {
185
+ color: hsl(var(--muted-foreground));
186
+ }
187
+
188
+ /* Category tabs */
189
+ .classic-layer-tabs {
190
+ display: flex;
191
+ gap: 0.25rem;
192
+ padding: 0.25rem;
193
+ background-color: hsl(var(--muted) / 0.5);
194
+ border-radius: 0.375rem;
195
+ }
196
+
197
+ .classic-layer-tab {
198
+ flex: 1;
199
+ padding: 0.375rem 0.5rem;
200
+ font-size: 0.75rem;
201
+ border-radius: 0.25rem;
202
+ border: none;
203
+ background: transparent;
204
+ color: hsl(var(--muted-foreground));
205
+ cursor: pointer;
206
+ transition:
207
+ background-color 150ms ease,
208
+ color 150ms ease;
209
+ }
210
+
211
+ .classic-layer-tab:hover {
212
+ color: hsl(var(--foreground));
213
+ }
214
+
215
+ .classic-layer-tab[data-active='true'] {
216
+ background-color: hsl(var(--background));
217
+ color: hsl(var(--foreground));
218
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
219
+ }
220
+
221
+ /* Error state */
222
+ .classic-layer-error {
223
+ color: hsl(var(--destructive));
224
+ font-size: 0.75rem;
225
+ display: flex;
226
+ align-items: center;
227
+ gap: 0.25rem;
228
+ }