@classic-homes/maps-core 0.1.1

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.
@@ -0,0 +1,188 @@
1
+ /**
2
+ * Map theme generator
3
+ *
4
+ * Generates MapLibre-compatible themes from Classic Theme design tokens
5
+ */
6
+ /**
7
+ * Theme identifiers
8
+ */
9
+ declare const THEME_LIGHT = "classic-light";
10
+ declare const THEME_DARK = "classic-dark";
11
+ /**
12
+ * Map theme colors configuration
13
+ */
14
+ interface MapThemeColors {
15
+ /** Background color for the map */
16
+ background: string;
17
+ /** Water bodies (lakes, rivers, ocean) */
18
+ water: string;
19
+ /** Land/terrain base color */
20
+ land: string;
21
+ /** Park/green areas */
22
+ park: string;
23
+ /** Building fill color */
24
+ building: string;
25
+ /** Building outline color */
26
+ buildingOutline: string;
27
+ /** Road primary color */
28
+ roadPrimary: string;
29
+ /** Road secondary color */
30
+ roadSecondary: string;
31
+ /** Road outline/casing color */
32
+ roadCasing: string;
33
+ /** Rail/transit lines */
34
+ rail: string;
35
+ /** Boundary lines */
36
+ boundary: string;
37
+ /** Administrative boundary */
38
+ adminBoundary: string;
39
+ /** Land use residential */
40
+ residential: string;
41
+ /** Land use commercial */
42
+ commercial: string;
43
+ /** Land use industrial */
44
+ industrial: string;
45
+ /** Highlight/selection color */
46
+ highlight: string;
47
+ /** Secondary highlight color */
48
+ highlightSecondary: string;
49
+ /** Selection/active color */
50
+ selection: string;
51
+ /** Text primary color */
52
+ textPrimary: string;
53
+ /** Text secondary color */
54
+ textSecondary: string;
55
+ /** Text halo color */
56
+ textHalo: string;
57
+ /** Point of interest color */
58
+ poi: string;
59
+ /** Label background */
60
+ labelBackground: string;
61
+ }
62
+ /**
63
+ * Map chart/data visualization colors
64
+ */
65
+ interface MapDataColors {
66
+ /** Color sequence for data visualization (5 colors) */
67
+ sequence: string[];
68
+ /** Positive/success color */
69
+ positive: string;
70
+ /** Negative/error color */
71
+ negative: string;
72
+ /** Neutral color */
73
+ neutral: string;
74
+ /** Heatmap color ramp (low to high) */
75
+ heatmapRamp: string[];
76
+ }
77
+ /**
78
+ * Complete map theme configuration
79
+ */
80
+ interface MapTheme {
81
+ /** Theme identifier */
82
+ name: string;
83
+ /** Base map colors */
84
+ colors: MapThemeColors;
85
+ /** Data visualization colors */
86
+ dataColors: MapDataColors;
87
+ /** Typography settings */
88
+ typography: {
89
+ fontFamily: string;
90
+ fontFamilySerif: string;
91
+ fontFamilyMono: string;
92
+ };
93
+ }
94
+ /**
95
+ * Generate light theme colors from design tokens
96
+ */
97
+ declare function generateLightColors(): MapThemeColors;
98
+ /**
99
+ * Generate dark theme colors from design tokens
100
+ */
101
+ declare function generateDarkColors(): MapThemeColors;
102
+ /**
103
+ * Generate data visualization colors for light theme
104
+ */
105
+ declare function generateLightDataColors(): MapDataColors;
106
+ /**
107
+ * Generate data visualization colors for dark theme
108
+ */
109
+ declare function generateDarkDataColors(): MapDataColors;
110
+ /**
111
+ * Get typography settings from design tokens
112
+ */
113
+ declare function getTypography(): {
114
+ fontFamily: string;
115
+ fontFamilySerif: string;
116
+ fontFamilyMono: string;
117
+ };
118
+ /**
119
+ * Generate complete light theme
120
+ */
121
+ declare function generateLightTheme(): MapTheme;
122
+ /**
123
+ * Generate complete dark theme
124
+ */
125
+ declare function generateDarkTheme(): MapTheme;
126
+ /**
127
+ * Pre-generated light theme
128
+ */
129
+ declare const lightTheme: MapTheme;
130
+ /**
131
+ * Pre-generated dark theme
132
+ */
133
+ declare const darkTheme: MapTheme;
134
+ /**
135
+ * Get theme by name
136
+ */
137
+ declare function getTheme(name: 'light' | 'dark' | typeof THEME_LIGHT | typeof THEME_DARK): MapTheme;
138
+
139
+ /**
140
+ * Map style generator
141
+ *
142
+ * Generates MapLibre style specifications from theme colors
143
+ * Uses OpenStreetMap tiles as the default tile source
144
+ */
145
+
146
+ /**
147
+ * MapLibre style specification (simplified type)
148
+ */
149
+ interface MapStyleSpec {
150
+ version: 8;
151
+ name: string;
152
+ sources: Record<string, unknown>;
153
+ layers: unknown[];
154
+ glyphs?: string;
155
+ sprite?: string;
156
+ metadata?: Record<string, unknown>;
157
+ }
158
+ /**
159
+ * Generate a basic MapLibre style from theme colors
160
+ * This creates a minimal style using OSM raster tiles
161
+ */
162
+ declare function generateBasicStyle(theme?: MapTheme): MapStyleSpec;
163
+ /**
164
+ * Generate a complete MapLibre vector style from theme
165
+ *
166
+ * Note: This requires a MapTiler API key or compatible vector tile source.
167
+ * For free usage, use generateBasicStyle() with OSM raster tiles.
168
+ *
169
+ * @param theme - Map theme to use
170
+ * @param tileSource - Custom tile source configuration (optional)
171
+ * @param glyphsUrl - URL for font glyphs (optional)
172
+ * @param spriteUrl - URL for icon sprites (optional)
173
+ */
174
+ declare function generateVectorStyle(theme?: MapTheme, tileSource?: Record<string, unknown>, glyphsUrl?: string, spriteUrl?: string): MapStyleSpec;
175
+ /**
176
+ * Get pre-built basic style for light theme
177
+ */
178
+ declare const lightBasicStyle: MapStyleSpec;
179
+ /**
180
+ * Get pre-built basic style for dark theme
181
+ */
182
+ declare const darkBasicStyle: MapStyleSpec;
183
+ /**
184
+ * Get basic style by theme name
185
+ */
186
+ declare function getBasicStyle(themeName: 'light' | 'dark' | typeof THEME_LIGHT | typeof THEME_DARK): MapStyleSpec;
187
+
188
+ export { type MapDataColors, type MapStyleSpec, type MapTheme, type MapThemeColors, THEME_DARK, THEME_LIGHT, darkBasicStyle, darkTheme, generateBasicStyle, generateDarkColors, generateDarkDataColors, generateDarkTheme, generateLightColors, generateLightDataColors, generateLightTheme, generateVectorStyle, getBasicStyle, getTheme, getTypography, lightBasicStyle, lightTheme };
@@ -0,0 +1,188 @@
1
+ /**
2
+ * Map theme generator
3
+ *
4
+ * Generates MapLibre-compatible themes from Classic Theme design tokens
5
+ */
6
+ /**
7
+ * Theme identifiers
8
+ */
9
+ declare const THEME_LIGHT = "classic-light";
10
+ declare const THEME_DARK = "classic-dark";
11
+ /**
12
+ * Map theme colors configuration
13
+ */
14
+ interface MapThemeColors {
15
+ /** Background color for the map */
16
+ background: string;
17
+ /** Water bodies (lakes, rivers, ocean) */
18
+ water: string;
19
+ /** Land/terrain base color */
20
+ land: string;
21
+ /** Park/green areas */
22
+ park: string;
23
+ /** Building fill color */
24
+ building: string;
25
+ /** Building outline color */
26
+ buildingOutline: string;
27
+ /** Road primary color */
28
+ roadPrimary: string;
29
+ /** Road secondary color */
30
+ roadSecondary: string;
31
+ /** Road outline/casing color */
32
+ roadCasing: string;
33
+ /** Rail/transit lines */
34
+ rail: string;
35
+ /** Boundary lines */
36
+ boundary: string;
37
+ /** Administrative boundary */
38
+ adminBoundary: string;
39
+ /** Land use residential */
40
+ residential: string;
41
+ /** Land use commercial */
42
+ commercial: string;
43
+ /** Land use industrial */
44
+ industrial: string;
45
+ /** Highlight/selection color */
46
+ highlight: string;
47
+ /** Secondary highlight color */
48
+ highlightSecondary: string;
49
+ /** Selection/active color */
50
+ selection: string;
51
+ /** Text primary color */
52
+ textPrimary: string;
53
+ /** Text secondary color */
54
+ textSecondary: string;
55
+ /** Text halo color */
56
+ textHalo: string;
57
+ /** Point of interest color */
58
+ poi: string;
59
+ /** Label background */
60
+ labelBackground: string;
61
+ }
62
+ /**
63
+ * Map chart/data visualization colors
64
+ */
65
+ interface MapDataColors {
66
+ /** Color sequence for data visualization (5 colors) */
67
+ sequence: string[];
68
+ /** Positive/success color */
69
+ positive: string;
70
+ /** Negative/error color */
71
+ negative: string;
72
+ /** Neutral color */
73
+ neutral: string;
74
+ /** Heatmap color ramp (low to high) */
75
+ heatmapRamp: string[];
76
+ }
77
+ /**
78
+ * Complete map theme configuration
79
+ */
80
+ interface MapTheme {
81
+ /** Theme identifier */
82
+ name: string;
83
+ /** Base map colors */
84
+ colors: MapThemeColors;
85
+ /** Data visualization colors */
86
+ dataColors: MapDataColors;
87
+ /** Typography settings */
88
+ typography: {
89
+ fontFamily: string;
90
+ fontFamilySerif: string;
91
+ fontFamilyMono: string;
92
+ };
93
+ }
94
+ /**
95
+ * Generate light theme colors from design tokens
96
+ */
97
+ declare function generateLightColors(): MapThemeColors;
98
+ /**
99
+ * Generate dark theme colors from design tokens
100
+ */
101
+ declare function generateDarkColors(): MapThemeColors;
102
+ /**
103
+ * Generate data visualization colors for light theme
104
+ */
105
+ declare function generateLightDataColors(): MapDataColors;
106
+ /**
107
+ * Generate data visualization colors for dark theme
108
+ */
109
+ declare function generateDarkDataColors(): MapDataColors;
110
+ /**
111
+ * Get typography settings from design tokens
112
+ */
113
+ declare function getTypography(): {
114
+ fontFamily: string;
115
+ fontFamilySerif: string;
116
+ fontFamilyMono: string;
117
+ };
118
+ /**
119
+ * Generate complete light theme
120
+ */
121
+ declare function generateLightTheme(): MapTheme;
122
+ /**
123
+ * Generate complete dark theme
124
+ */
125
+ declare function generateDarkTheme(): MapTheme;
126
+ /**
127
+ * Pre-generated light theme
128
+ */
129
+ declare const lightTheme: MapTheme;
130
+ /**
131
+ * Pre-generated dark theme
132
+ */
133
+ declare const darkTheme: MapTheme;
134
+ /**
135
+ * Get theme by name
136
+ */
137
+ declare function getTheme(name: 'light' | 'dark' | typeof THEME_LIGHT | typeof THEME_DARK): MapTheme;
138
+
139
+ /**
140
+ * Map style generator
141
+ *
142
+ * Generates MapLibre style specifications from theme colors
143
+ * Uses OpenStreetMap tiles as the default tile source
144
+ */
145
+
146
+ /**
147
+ * MapLibre style specification (simplified type)
148
+ */
149
+ interface MapStyleSpec {
150
+ version: 8;
151
+ name: string;
152
+ sources: Record<string, unknown>;
153
+ layers: unknown[];
154
+ glyphs?: string;
155
+ sprite?: string;
156
+ metadata?: Record<string, unknown>;
157
+ }
158
+ /**
159
+ * Generate a basic MapLibre style from theme colors
160
+ * This creates a minimal style using OSM raster tiles
161
+ */
162
+ declare function generateBasicStyle(theme?: MapTheme): MapStyleSpec;
163
+ /**
164
+ * Generate a complete MapLibre vector style from theme
165
+ *
166
+ * Note: This requires a MapTiler API key or compatible vector tile source.
167
+ * For free usage, use generateBasicStyle() with OSM raster tiles.
168
+ *
169
+ * @param theme - Map theme to use
170
+ * @param tileSource - Custom tile source configuration (optional)
171
+ * @param glyphsUrl - URL for font glyphs (optional)
172
+ * @param spriteUrl - URL for icon sprites (optional)
173
+ */
174
+ declare function generateVectorStyle(theme?: MapTheme, tileSource?: Record<string, unknown>, glyphsUrl?: string, spriteUrl?: string): MapStyleSpec;
175
+ /**
176
+ * Get pre-built basic style for light theme
177
+ */
178
+ declare const lightBasicStyle: MapStyleSpec;
179
+ /**
180
+ * Get pre-built basic style for dark theme
181
+ */
182
+ declare const darkBasicStyle: MapStyleSpec;
183
+ /**
184
+ * Get basic style by theme name
185
+ */
186
+ declare function getBasicStyle(themeName: 'light' | 'dark' | typeof THEME_LIGHT | typeof THEME_DARK): MapStyleSpec;
187
+
188
+ export { type MapDataColors, type MapStyleSpec, type MapTheme, type MapThemeColors, THEME_DARK, THEME_LIGHT, darkBasicStyle, darkTheme, generateBasicStyle, generateDarkColors, generateDarkDataColors, generateDarkTheme, generateLightColors, generateLightDataColors, generateLightTheme, generateVectorStyle, getBasicStyle, getTheme, getTypography, lightBasicStyle, lightTheme };
@@ -0,0 +1 @@
1
+ export { THEME_DARK, THEME_LIGHT, darkBasicStyle, darkTheme, generateBasicStyle, generateDarkColors, generateDarkDataColors, generateDarkTheme, generateLightColors, generateLightDataColors, generateLightTheme, generateVectorStyle, getBasicStyle, getTheme, getTypography, lightBasicStyle, lightTheme } from '../chunk-2NISJ7WE.js';
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+