@classic-homes/maps-core 0.2.7 → 0.2.9

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,156 @@
1
+ import { fontFamily, colors, semanticColors } from '@classic-homes/theme-tokens';
2
+
3
+ // src/theme/generator.ts
4
+ var THEME_LIGHT = "classic-light";
5
+ var THEME_DARK = "classic-dark";
6
+ function generateLightColors() {
7
+ return {
8
+ background: colors.white,
9
+ water: colors.sky[200],
10
+ land: colors.sage[50],
11
+ park: colors.forest[100],
12
+ building: colors.gray[200],
13
+ buildingOutline: colors.gray[300],
14
+ roadPrimary: colors.white,
15
+ roadSecondary: colors.gray[100],
16
+ roadCasing: colors.gray[300],
17
+ rail: colors.gray[400],
18
+ boundary: colors.gray[400],
19
+ adminBoundary: colors.plum[300],
20
+ residential: colors.sage[100],
21
+ commercial: colors.stone[100],
22
+ industrial: colors.gray[200],
23
+ highlight: colors.teal[500],
24
+ // Core 1 - brand teal
25
+ highlightSecondary: colors.teal[300],
26
+ selection: colors.red[500],
27
+ // Brand red
28
+ textPrimary: semanticColors.light.foreground,
29
+ textSecondary: semanticColors.light.mutedForeground,
30
+ textHalo: colors.white,
31
+ poi: colors.navy[700],
32
+ // Core 2 - brand navy
33
+ labelBackground: "rgba(255, 255, 255, 0.85)"
34
+ };
35
+ }
36
+ function generateDarkColors() {
37
+ return {
38
+ background: colors.charcoal[900],
39
+ water: colors.navy[800],
40
+ land: colors.charcoal[800],
41
+ park: colors.forest[900],
42
+ building: colors.charcoal[700],
43
+ buildingOutline: colors.charcoal[600],
44
+ roadPrimary: colors.charcoal[600],
45
+ roadSecondary: colors.charcoal[700],
46
+ roadCasing: colors.charcoal[500],
47
+ rail: colors.gray[600],
48
+ boundary: colors.gray[600],
49
+ adminBoundary: colors.plum[400],
50
+ residential: colors.charcoal[700],
51
+ commercial: colors.stone[800],
52
+ industrial: colors.charcoal[700],
53
+ highlight: colors.teal[400],
54
+ // Lighter for dark mode
55
+ highlightSecondary: colors.teal[500],
56
+ selection: colors.red[400],
57
+ // Lighter for dark mode
58
+ textPrimary: semanticColors.dark.foreground,
59
+ textSecondary: semanticColors.dark.mutedForeground,
60
+ textHalo: colors.charcoal[900],
61
+ poi: colors.navy[400],
62
+ // Lighter for dark mode
63
+ labelBackground: "rgba(41, 36, 36, 0.85)"
64
+ };
65
+ }
66
+ function generateLightDataColors() {
67
+ return {
68
+ sequence: [
69
+ colors.teal[500],
70
+ // chart.1
71
+ colors.navy[700],
72
+ // chart.2
73
+ colors.plum[700],
74
+ // chart.3
75
+ colors.forest[500],
76
+ // chart.4
77
+ colors.sky[600]
78
+ // chart.5
79
+ ],
80
+ positive: colors.forest[500],
81
+ negative: colors.red[500],
82
+ neutral: colors.gray[500],
83
+ heatmapRamp: [
84
+ "rgba(59, 164, 167, 0)",
85
+ // teal transparent
86
+ colors.teal[200],
87
+ colors.teal[400],
88
+ colors.teal[500],
89
+ colors.red[400],
90
+ colors.red[500],
91
+ colors.red[600]
92
+ ]
93
+ };
94
+ }
95
+ function generateDarkDataColors() {
96
+ return {
97
+ sequence: [
98
+ colors.teal[400],
99
+ // chart.1
100
+ colors.navy[400],
101
+ // chart.2
102
+ colors.plum[400],
103
+ // chart.3
104
+ colors.forest[400],
105
+ // chart.4
106
+ colors.sky[400]
107
+ // chart.5
108
+ ],
109
+ positive: colors.forest[400],
110
+ negative: colors.red[400],
111
+ neutral: colors.gray[400],
112
+ heatmapRamp: [
113
+ "rgba(103, 204, 207, 0)",
114
+ // teal transparent
115
+ colors.teal[300],
116
+ colors.teal[400],
117
+ colors.teal[500],
118
+ colors.red[400],
119
+ colors.red[500],
120
+ colors.red[600]
121
+ ]
122
+ };
123
+ }
124
+ function getTypography() {
125
+ return {
126
+ fontFamily: fontFamily.sans.join(", "),
127
+ fontFamilySerif: fontFamily.serif.join(", "),
128
+ fontFamilyMono: fontFamily.mono.join(", ")
129
+ };
130
+ }
131
+ function generateLightTheme() {
132
+ return {
133
+ name: THEME_LIGHT,
134
+ colors: generateLightColors(),
135
+ dataColors: generateLightDataColors(),
136
+ typography: getTypography()
137
+ };
138
+ }
139
+ function generateDarkTheme() {
140
+ return {
141
+ name: THEME_DARK,
142
+ colors: generateDarkColors(),
143
+ dataColors: generateDarkDataColors(),
144
+ typography: getTypography()
145
+ };
146
+ }
147
+ var lightTheme = generateLightTheme();
148
+ var darkTheme = generateDarkTheme();
149
+ function getTheme(name) {
150
+ if (name === "dark" || name === THEME_DARK) {
151
+ return darkTheme;
152
+ }
153
+ return lightTheme;
154
+ }
155
+
156
+ export { THEME_DARK, THEME_LIGHT, darkTheme, generateDarkColors, generateDarkDataColors, generateDarkTheme, generateLightColors, generateLightDataColors, generateLightTheme, getTheme, getTypography, lightTheme };
@@ -53,7 +53,7 @@ interface GeoJSONFeatureCollection<G extends GeoJSONGeometry = GeoJSONGeometry,
53
53
  /**
54
54
  * GeoJSON Geometry types
55
55
  */
56
- type GeoJSONGeometry = GeoJSONPoint | GeoJSONMultiPoint | GeoJSONLineString | GeoJSONMultiLineString | GeoJSONPolygon | GeoJSONMultiPolygon;
56
+ type GeoJSONGeometry = GeoJSONPoint | GeoJSONMultiPoint | GeoJSONLineString | GeoJSONMultiLineString | GeoJSONPolygon | GeoJSONMultiPolygon | GeoJSONGeometryCollection;
57
57
  interface GeoJSONPoint {
58
58
  type: 'Point';
59
59
  coordinates: LngLat;
@@ -78,6 +78,10 @@ interface GeoJSONMultiPolygon {
78
78
  type: 'MultiPolygon';
79
79
  coordinates: LngLat[][][];
80
80
  }
81
+ interface GeoJSONGeometryCollection {
82
+ type: 'GeometryCollection';
83
+ geometries: GeoJSONGeometry[];
84
+ }
81
85
  /**
82
86
  * Marker data for displaying points of interest
83
87
  */
@@ -138,4 +142,4 @@ interface ExtrusionData {
138
142
  */
139
143
  type MapSourceData = GeoJSONFeatureCollection | GeoJSONFeature | string | MarkerData[];
140
144
 
141
- export type { BoundsArray as B, ClusterConfig as C, ExtrusionData as E, GeoJSONFeatureCollection as G, HeatmapPoint as H, LngLat as L, MapBounds as M, GeoJSONFeature as a, MarkerData as b, GeoJSONPolygon as c, MapViewport as d, GeoJSONGeometry as e, GeoJSONPoint as f, GeoJSONMultiPoint as g, GeoJSONLineString as h, GeoJSONMultiLineString as i, GeoJSONMultiPolygon as j, MapSourceData as k };
145
+ export type { BoundsArray as B, ClusterConfig as C, ExtrusionData as E, GeoJSONFeatureCollection as G, HeatmapPoint as H, LngLat as L, MapBounds as M, GeoJSONFeature as a, MapViewport as b, GeoJSONGeometry as c, GeoJSONPoint as d, GeoJSONMultiPoint as e, GeoJSONLineString as f, GeoJSONMultiLineString as g, GeoJSONPolygon as h, GeoJSONMultiPolygon as i, MarkerData as j, MapSourceData as k, GeoJSONGeometryCollection as l };
@@ -53,7 +53,7 @@ interface GeoJSONFeatureCollection<G extends GeoJSONGeometry = GeoJSONGeometry,
53
53
  /**
54
54
  * GeoJSON Geometry types
55
55
  */
56
- type GeoJSONGeometry = GeoJSONPoint | GeoJSONMultiPoint | GeoJSONLineString | GeoJSONMultiLineString | GeoJSONPolygon | GeoJSONMultiPolygon;
56
+ type GeoJSONGeometry = GeoJSONPoint | GeoJSONMultiPoint | GeoJSONLineString | GeoJSONMultiLineString | GeoJSONPolygon | GeoJSONMultiPolygon | GeoJSONGeometryCollection;
57
57
  interface GeoJSONPoint {
58
58
  type: 'Point';
59
59
  coordinates: LngLat;
@@ -78,6 +78,10 @@ interface GeoJSONMultiPolygon {
78
78
  type: 'MultiPolygon';
79
79
  coordinates: LngLat[][][];
80
80
  }
81
+ interface GeoJSONGeometryCollection {
82
+ type: 'GeometryCollection';
83
+ geometries: GeoJSONGeometry[];
84
+ }
81
85
  /**
82
86
  * Marker data for displaying points of interest
83
87
  */
@@ -138,4 +142,4 @@ interface ExtrusionData {
138
142
  */
139
143
  type MapSourceData = GeoJSONFeatureCollection | GeoJSONFeature | string | MarkerData[];
140
144
 
141
- export type { BoundsArray as B, ClusterConfig as C, ExtrusionData as E, GeoJSONFeatureCollection as G, HeatmapPoint as H, LngLat as L, MapBounds as M, GeoJSONFeature as a, MarkerData as b, GeoJSONPolygon as c, MapViewport as d, GeoJSONGeometry as e, GeoJSONPoint as f, GeoJSONMultiPoint as g, GeoJSONLineString as h, GeoJSONMultiLineString as i, GeoJSONMultiPolygon as j, MapSourceData as k };
145
+ export type { BoundsArray as B, ClusterConfig as C, ExtrusionData as E, GeoJSONFeatureCollection as G, HeatmapPoint as H, LngLat as L, MapBounds as M, GeoJSONFeature as a, MapViewport as b, GeoJSONGeometry as c, GeoJSONPoint as d, GeoJSONMultiPoint as e, GeoJSONLineString as f, GeoJSONMultiLineString as g, GeoJSONPolygon as h, GeoJSONMultiPolygon as i, MarkerData as j, MapSourceData as k, GeoJSONGeometryCollection as l };
@@ -0,0 +1,139 @@
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
+ export { type MapTheme as M, THEME_LIGHT as T, THEME_DARK as a, generateDarkTheme as b, generateLightColors as c, generateDarkColors as d, generateLightDataColors as e, generateDarkDataColors as f, generateLightTheme as g, getTypography as h, getTheme as i, darkTheme as j, type MapThemeColors as k, lightTheme as l, type MapDataColors as m };
@@ -0,0 +1,139 @@
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
+ export { type MapTheme as M, THEME_LIGHT as T, THEME_DARK as a, generateDarkTheme as b, generateLightColors as c, generateDarkColors as d, generateLightDataColors as e, generateDarkDataColors as f, generateLightTheme as g, getTypography as h, getTheme as i, darkTheme as j, type MapThemeColors as k, lightTheme as l, type MapDataColors as m };