@swr-data-lab/components 2.14.0 → 2.15.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.
Files changed (40) hide show
  1. package/dist/DesignTokens/DesignTokens.svelte +2 -0
  2. package/dist/DesignTokens/Tokens.js +5 -1
  3. package/dist/index.d.ts +1 -1
  4. package/dist/index.js +1 -1
  5. package/dist/maplibre/AttributionControl/AttributionControl.svelte +1 -0
  6. package/dist/maplibre/GeocoderControl/GeocoderControl.svelte +20 -13
  7. package/dist/maplibre/Map/Map.svelte +19 -11
  8. package/dist/maplibre/MapStyle/SWRDataLabDark.d.ts +9 -0
  9. package/dist/maplibre/MapStyle/SWRDataLabDark.js +118 -0
  10. package/dist/maplibre/MapStyle/SWRDataLabLight.js +39 -7
  11. package/dist/maplibre/MapStyle/components/Admin.d.ts +1 -1
  12. package/dist/maplibre/MapStyle/components/Admin.js +6 -12
  13. package/dist/maplibre/MapStyle/components/Buildings.d.ts +1 -1
  14. package/dist/maplibre/MapStyle/components/Buildings.js +12 -13
  15. package/dist/maplibre/MapStyle/components/Landuse.d.ts +1 -1
  16. package/dist/maplibre/MapStyle/components/Landuse.js +5 -20
  17. package/dist/maplibre/MapStyle/components/PlaceLabels.d.ts +1 -1
  18. package/dist/maplibre/MapStyle/components/PlaceLabels.js +2 -3
  19. package/dist/maplibre/MapStyle/components/Roads.d.ts +1 -1
  20. package/dist/maplibre/MapStyle/components/Roads.js +173 -202
  21. package/dist/maplibre/MapStyle/components/Transit.d.ts +1 -1
  22. package/dist/maplibre/MapStyle/components/Transit.js +43 -44
  23. package/dist/maplibre/MapStyle/components/Walking.d.ts +1 -1
  24. package/dist/maplibre/MapStyle/components/Walking.js +61 -209
  25. package/dist/maplibre/MapStyle/icons/pin-14-dark.svg +10 -0
  26. package/dist/maplibre/MapStyle/index.d.ts +2 -1
  27. package/dist/maplibre/MapStyle/index.js +2 -1
  28. package/dist/maplibre/MapStyle/sprite/sprite.json +1 -1
  29. package/dist/maplibre/MapStyle/sprite/sprite.png +0 -0
  30. package/dist/maplibre/MapStyle/sprite/sprite@2x.json +1 -1
  31. package/dist/maplibre/MapStyle/sprite/sprite@2x.png +0 -0
  32. package/dist/maplibre/MapStyle/storyLocations.d.ts +47 -0
  33. package/dist/maplibre/MapStyle/storyLocations.js +21 -0
  34. package/dist/maplibre/NavigationControl/NavigationControl.svelte +12 -3
  35. package/dist/maplibre/ScaleControl/ScaleControl.svelte +1 -0
  36. package/dist/maplibre/Tooltip/Tooltip.svelte +3 -2
  37. package/package.json +1 -1
  38. package/dist/maplibre/Map/test.css +0 -687
  39. package/dist/maplibre/MapStyle/tokens.d.ts +0 -23
  40. package/dist/maplibre/MapStyle/tokens.js +0 -23
@@ -1,5 +1,4 @@
1
1
  import {} from '../../types';
2
- import tokens from '../tokens';
3
2
  const street_layout = {
4
3
  'line-join': 'round',
5
4
  'line-cap': 'round'
@@ -8,177 +7,177 @@ const case_layout = {
8
7
  'line-join': 'round',
9
8
  'line-cap': 'butt'
10
9
  };
11
- const motorway = {
12
- line_color: tokens.street_primary,
13
- line_width: {
14
- stops: [
15
- [6, 1],
16
- [7, 1.5],
17
- [11, 2],
18
- [12, 3],
19
- [13, 5],
20
- [14, 9]
21
- ]
22
- },
23
- line_opacity: {
24
- stops: [
25
- [4, 0],
26
- [5, 0.8],
27
- [11, 0.8],
28
- [12, 1]
29
- ]
30
- }
31
- };
32
- const motorway_case = {
33
- line_color: tokens.street_primary_case,
34
- line_width: {
35
- stops: [
36
- [10, 0],
37
- [11, 2],
38
- [12, 5],
39
- [13, 7],
40
- [14, 11]
41
- ]
42
- }
43
- };
44
- const motorway_link = {
45
- paint: {
46
- 'line-color': tokens.street_primary,
47
- 'line-width': motorway.line_width,
48
- 'line-opacity': {
10
+ export default function makeRoads(tokens) {
11
+ const motorway = {
12
+ line_color: tokens.street_primary,
13
+ line_width: {
49
14
  stops: [
50
- [6, 0],
51
- [7, 1]
15
+ [6, 1],
16
+ [7, 1.5],
17
+ [11, 2],
18
+ [12, 3],
19
+ [13, 5],
20
+ [14, 9]
21
+ ]
22
+ },
23
+ line_opacity: {
24
+ stops: [
25
+ [4, 0],
26
+ [5, 0.8],
27
+ [11, 0.8],
28
+ [12, 1]
52
29
  ]
53
30
  }
54
- },
55
- layout: street_layout
56
- };
57
- const motorway_link_case = {
58
- paint: {
59
- 'line-color': tokens.street_primary_case,
60
- 'line-width': motorway_case.line_width
61
- },
62
- layout: case_layout
63
- };
64
- const street_primary = {
65
- paint: {
66
- 'line-color': tokens.street_primary,
67
- 'line-width': motorway.line_width,
68
- 'line-opacity': {
31
+ };
32
+ const motorway_case = {
33
+ line_color: tokens.street_primary_case,
34
+ line_width: {
69
35
  stops: [
70
- [8, 0],
71
- [9, 1]
36
+ [10, 0],
37
+ [11, 2],
38
+ [12, 5],
39
+ [13, 7],
40
+ [14, 11]
72
41
  ]
73
42
  }
74
- },
75
- layout: street_layout
76
- };
77
- const street_primary_case = {
78
- paint: {
79
- 'line-color': tokens.street_primary_case,
80
- 'line-width': motorway_case.line_width,
81
- 'line-opacity': {
43
+ };
44
+ const motorway_link = {
45
+ paint: {
46
+ 'line-color': tokens.street_primary,
47
+ 'line-width': motorway.line_width,
48
+ 'line-opacity': {
49
+ stops: [
50
+ [6, 0],
51
+ [7, 1]
52
+ ]
53
+ }
54
+ },
55
+ layout: street_layout
56
+ };
57
+ const motorway_link_case = {
58
+ paint: {
59
+ 'line-color': tokens.street_primary_case,
60
+ 'line-width': motorway_case.line_width
61
+ },
62
+ layout: case_layout
63
+ };
64
+ const street_primary = {
65
+ paint: {
66
+ 'line-color': tokens.street_primary,
67
+ 'line-width': motorway.line_width,
68
+ 'line-opacity': {
69
+ stops: [
70
+ [8, 0],
71
+ [9, 1]
72
+ ]
73
+ }
74
+ },
75
+ layout: street_layout
76
+ };
77
+ const street_primary_case = {
78
+ paint: {
79
+ 'line-color': tokens.street_primary_case,
80
+ 'line-width': motorway_case.line_width,
81
+ 'line-opacity': {
82
+ stops: [
83
+ [8, 0],
84
+ [9, 1]
85
+ ]
86
+ }
87
+ },
88
+ layout: case_layout
89
+ };
90
+ const street_secondary = {
91
+ line_color: tokens.street_secondary,
92
+ line_width: {
82
93
  stops: [
83
- [8, 0],
84
- [9, 1]
94
+ [12, 1],
95
+ [14, 2],
96
+ [16, 8],
97
+ [18, 28],
98
+ [19, 64],
99
+ [20, 130]
85
100
  ]
86
101
  }
87
- },
88
- layout: case_layout
89
- };
90
- const street_secondary = {
91
- line_color: tokens.street_secondary,
92
- line_width: {
93
- stops: [
94
- [12, 1],
95
- [14, 2],
96
- [16, 8],
97
- [18, 28],
98
- [19, 64],
99
- [20, 130]
100
- ]
101
- }
102
- };
103
- const street_secondary_case = {
104
- paint: {
105
- 'line-color': tokens.street_secondary_case,
106
- 'line-width': {
102
+ };
103
+ const street_secondary_case = {
104
+ paint: {
105
+ 'line-color': tokens.street_secondary_case,
106
+ 'line-width': {
107
+ stops: [
108
+ [12, 0],
109
+ [14, 3],
110
+ [16, 11],
111
+ [18, 30],
112
+ [19, 66],
113
+ [20, 40]
114
+ ]
115
+ },
116
+ 'line-opacity': {
117
+ stops: [
118
+ [11, 0],
119
+ [12, 1]
120
+ ]
121
+ }
122
+ },
123
+ layout: case_layout
124
+ };
125
+ const street_tertiary_case = {
126
+ paint: {
127
+ 'line-color': tokens.street_tertiary_case,
128
+ 'line-width': {
129
+ stops: [
130
+ [12, 2],
131
+ [14, 3],
132
+ [16, 6],
133
+ [18, 26],
134
+ [19, 64],
135
+ [20, 128]
136
+ ]
137
+ },
138
+ 'line-opacity': {
139
+ stops: [
140
+ [12, 0],
141
+ [13, 1]
142
+ ]
143
+ }
144
+ },
145
+ layout: case_layout
146
+ };
147
+ const street_residential = {
148
+ line_color: tokens.street_tertiary,
149
+ line_width: {
107
150
  stops: [
108
- [12, 0],
109
- [14, 3],
110
- [16, 11],
111
- [18, 30],
112
- [19, 66],
113
- [20, 40]
151
+ [13, 1],
152
+ [14, 2],
153
+ [16, 5],
154
+ [18, 24],
155
+ [19, 60],
156
+ [20, 120]
114
157
  ]
115
158
  },
116
- 'line-opacity': {
159
+ line_opacity: {
117
160
  stops: [
118
- [11, 0],
119
- [12, 1]
161
+ [12, 0],
162
+ [13, 1]
120
163
  ]
121
164
  }
122
- },
123
- layout: case_layout
124
- };
125
- const street_tertiary_case = {
126
- paint: {
127
- 'line-color': tokens.street_tertiary_case,
128
- 'line-width': {
165
+ };
166
+ const street_residential_case = {
167
+ line_color: tokens.street_tertiary_case,
168
+ line_width: {
129
169
  stops: [
130
- [12, 2],
131
- [14, 3],
132
- [16, 6],
133
- [18, 26],
134
- [19, 64],
135
- [20, 128]
170
+ [14, 0],
171
+ [15, 4]
136
172
  ]
137
173
  },
138
- 'line-opacity': {
174
+ line_opacity: {
139
175
  stops: [
140
176
  [12, 0],
141
177
  [13, 1]
142
178
  ]
143
179
  }
144
- },
145
- layout: case_layout
146
- };
147
- const street_residential = {
148
- line_color: tokens.street_tertiary,
149
- line_width: {
150
- stops: [
151
- [13, 1],
152
- [14, 2],
153
- [16, 5],
154
- [18, 24],
155
- [19, 60],
156
- [20, 120]
157
- ]
158
- },
159
- line_opacity: {
160
- stops: [
161
- [12, 0],
162
- [13, 1]
163
- ]
164
- }
165
- };
166
- const street_residential_case = {
167
- line_color: tokens.street_tertiary_case,
168
- line_width: {
169
- stops: [
170
- [14, 0],
171
- [15, 4]
172
- ]
173
- },
174
- line_opacity: {
175
- stops: [
176
- [12, 0],
177
- [13, 1]
178
- ]
179
- }
180
- };
181
- export default function makeRoads() {
180
+ };
182
181
  const roadLabels = [
183
182
  {
184
183
  id: 'label-street-misc',
@@ -284,7 +283,7 @@ export default function makeRoads() {
284
283
  ['!=', 'service', 'driveway']
285
284
  ],
286
285
  paint: {
287
- 'line-color': 'rgb(217,217,217)',
286
+ 'line-color': tokens.street_tertiary_case,
288
287
  'line-width': {
289
288
  stops: [
290
289
  [14, 2],
@@ -307,23 +306,9 @@ export default function makeRoads() {
307
306
  id: 'bridge-street-livingstreet:case',
308
307
  filter: ['all', ['==', 'kind', 'living_street'], ['==', 'bridge', true]],
309
308
  paint: {
310
- 'line-color': 'rgb(217,217,217)',
311
- 'line-width': {
312
- stops: [
313
- [12, 2],
314
- [14, 3],
315
- [16, 6],
316
- [18, 26],
317
- [19, 64],
318
- [20, 128]
319
- ]
320
- },
321
- 'line-opacity': {
322
- stops: [
323
- [12, 0],
324
- [13, 1]
325
- ]
326
- }
309
+ 'line-color': street_residential_case.line_color,
310
+ 'line-width': street_residential_case.line_width,
311
+ 'line-opacity': street_residential_case.line_opacity
327
312
  },
328
313
  layout: street_layout
329
314
  },
@@ -341,23 +326,9 @@ export default function makeRoads() {
341
326
  id: 'bridge-street-unclassified:case',
342
327
  filter: ['all', ['==', 'kind', 'unclassified'], ['==', 'bridge', true]],
343
328
  paint: {
344
- 'line-color': 'rgb(217,217,217)',
345
- 'line-width': {
346
- stops: [
347
- [12, 2],
348
- [14, 3],
349
- [16, 6],
350
- [18, 26],
351
- [19, 64],
352
- [20, 128]
353
- ]
354
- },
355
- 'line-opacity': {
356
- stops: [
357
- [12, 0],
358
- [13, 1]
359
- ]
360
- }
329
+ 'line-color': street_residential_case.line_color,
330
+ 'line-width': street_residential_case.line_width,
331
+ 'line-opacity': street_residential_case.line_opacity
361
332
  },
362
333
  layout: case_layout
363
334
  },
@@ -432,7 +403,7 @@ export default function makeRoads() {
432
403
  ['!=', 'service', 'driveway']
433
404
  ],
434
405
  paint: {
435
- 'line-color': 'hsl(0,0%,100%)',
406
+ 'line-color': tokens.street_tertiary,
436
407
  'line-width': {
437
408
  stops: [
438
409
  [14, 1],
@@ -455,7 +426,7 @@ export default function makeRoads() {
455
426
  id: 'bridge-street-livingstreet',
456
427
  filter: ['all', ['==', 'kind', 'living_street'], ['==', 'bridge', true]],
457
428
  paint: {
458
- 'line-color': 'hsl(0,0%,100%)',
429
+ 'line-color': tokens.street_tertiary,
459
430
  'line-width': {
460
431
  stops: [
461
432
  [12, 1],
@@ -489,7 +460,7 @@ export default function makeRoads() {
489
460
  id: 'bridge-street-unclassified',
490
461
  filter: ['all', ['==', 'kind', 'unclassified'], ['==', 'bridge', true]],
491
462
  paint: {
492
- 'line-color': 'hsl(0,0%,100%)',
463
+ 'line-color': tokens.street_tertiary,
493
464
  'line-width': {
494
465
  stops: [
495
466
  [12, 1],
@@ -513,7 +484,7 @@ export default function makeRoads() {
513
484
  id: 'bridge-street-tertiary-link',
514
485
  filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'tertiary'], ['==', 'link', true]],
515
486
  paint: {
516
- 'line-color': 'hsl(0,0%,100%)',
487
+ 'line-color': tokens.street_tertiary,
517
488
  'line-width': {
518
489
  stops: [
519
490
  [12, 1],
@@ -565,7 +536,7 @@ export default function makeRoads() {
565
536
  id: 'bridge-street-tertiary',
566
537
  filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'tertiary'], ['!=', 'link', true]],
567
538
  paint: {
568
- 'line-color': 'hsl(0,0%,100%)',
539
+ 'line-color': tokens.street_tertiary,
569
540
  'line-width': {
570
541
  stops: [
571
542
  [12, 1],
@@ -633,7 +604,7 @@ export default function makeRoads() {
633
604
  ['!=', 'service', 'driveway']
634
605
  ],
635
606
  paint: {
636
- 'line-color': 'rgb(222,222,222)',
607
+ 'line-color': tokens.street_tertiary_case,
637
608
  'line-width': {
638
609
  stops: [
639
610
  [14, 2],
@@ -656,7 +627,7 @@ export default function makeRoads() {
656
627
  id: 'tunnel-street-livingstreet:case',
657
628
  filter: ['all', ['==', 'kind', 'living_street'], ['==', 'tunnel', true]],
658
629
  paint: {
659
- 'line-color': 'rgb(222,222,222)',
630
+ 'line-color': tokens.street_tertiary_case,
660
631
  'line-width': {
661
632
  stops: [
662
633
  [12, 2],
@@ -690,7 +661,7 @@ export default function makeRoads() {
690
661
  id: 'tunnel-street-unclassified:case',
691
662
  filter: ['all', ['==', 'kind', 'unclassified'], ['==', 'tunnel', true]],
692
663
  paint: {
693
- 'line-color': 'rgb(222,222,222)',
664
+ 'line-color': tokens.street_tertiary_case,
694
665
  'line-width': {
695
666
  stops: [
696
667
  [12, 2],
@@ -804,7 +775,7 @@ export default function makeRoads() {
804
775
  ['!=', 'service', 'driveway']
805
776
  ],
806
777
  paint: {
807
- 'line-color': 'rgb(247,247,247)',
778
+ 'line-color': tokens.street_tertiary,
808
779
  'line-width': {
809
780
  stops: [
810
781
  [14, 1],
@@ -827,7 +798,7 @@ export default function makeRoads() {
827
798
  id: 'tunnel-street-livingstreet',
828
799
  filter: ['all', ['==', 'kind', 'living_street'], ['==', 'tunnel', true]],
829
800
  paint: {
830
- 'line-color': 'rgb(247,247,247)',
801
+ 'line-color': tokens.street_tertiary,
831
802
  'line-width': {
832
803
  stops: [
833
804
  [12, 1],
@@ -866,7 +837,7 @@ export default function makeRoads() {
866
837
  id: 'tunnel-street-unclassified',
867
838
  filter: ['all', ['==', 'kind', 'unclassified'], ['==', 'tunnel', true]],
868
839
  paint: {
869
- 'line-color': 'rgb(247,247,247)',
840
+ 'line-color': tokens.street_tertiary,
870
841
  'line-width': {
871
842
  stops: [
872
843
  [12, 1],
@@ -890,7 +861,7 @@ export default function makeRoads() {
890
861
  id: 'tunnel-street-tertiary-link',
891
862
  filter: ['all', ['==', 'tunnel', true], ['in', 'kind', 'tertiary'], ['==', 'link', true]],
892
863
  paint: {
893
- 'line-color': 'rgb(247,247,247)',
864
+ 'line-color': tokens.street_tertiary,
894
865
  'line-width': {
895
866
  stops: [
896
867
  [12, 1],
@@ -945,7 +916,7 @@ export default function makeRoads() {
945
916
  id: 'tunnel-street-tertiary',
946
917
  filter: ['all', ['==', 'tunnel', true], ['in', 'kind', 'tertiary'], ['!=', 'link', true]],
947
918
  paint: {
948
- 'line-color': 'rgb(247,247,247)',
919
+ 'line-color': tokens.street_tertiary,
949
920
  'line-width': {
950
921
  stops: [
951
922
  [12, 1],
@@ -1024,7 +995,7 @@ export default function makeRoads() {
1024
995
  ['!=', 'service', 'driveway']
1025
996
  ],
1026
997
  paint: {
1027
- 'line-color': 'hsl(36,0%,80%)',
998
+ 'line-color': tokens.street_tertiary_case,
1028
999
  'line-width': {
1029
1000
  stops: [
1030
1001
  [14, 2],
@@ -1052,7 +1023,7 @@ export default function makeRoads() {
1052
1023
  ['!=', 'tunnel', true]
1053
1024
  ],
1054
1025
  paint: {
1055
- 'line-color': 'hsl(36,0%,80%)',
1026
+ 'line-color': tokens.street_tertiary_case,
1056
1027
  'line-width': {
1057
1028
  stops: [
1058
1029
  [12, 2],
@@ -1096,7 +1067,7 @@ export default function makeRoads() {
1096
1067
  ['!=', 'tunnel', true]
1097
1068
  ],
1098
1069
  paint: {
1099
- 'line-color': 'hsl(36,0%,80%)',
1070
+ 'line-color': tokens.street_tertiary_case,
1100
1071
  'line-width': {
1101
1072
  stops: [
1102
1073
  [12, 2],
@@ -1335,7 +1306,7 @@ export default function makeRoads() {
1335
1306
  ['==', 'link', true]
1336
1307
  ],
1337
1308
  paint: {
1338
- 'line-color': 'hsl(0,0%,100%)',
1309
+ 'line-color': tokens.street_tertiary,
1339
1310
  'line-width': {
1340
1311
  stops: [
1341
1312
  [12, 1],
@@ -1417,7 +1388,7 @@ export default function makeRoads() {
1417
1388
  ['!=', 'link', true]
1418
1389
  ],
1419
1390
  paint: {
1420
- 'line-color': 'hsl(0,0%,100%)',
1391
+ 'line-color': tokens.street_tertiary,
1421
1392
  'line-width': {
1422
1393
  stops: [
1423
1394
  [12, 1],
@@ -1,5 +1,5 @@
1
1
  import type { Layer } from '../../types';
2
- export default function makeTransit(): {
2
+ export default function makeTransit(tokens: any): {
3
3
  airports: Layer[];
4
4
  transitBridges: Layer[];
5
5
  transitSurface: Layer[];
@@ -1,47 +1,46 @@
1
- import tokens from '../tokens';
2
- const rail = {
3
- line_color: '#d3d3d3',
4
- line_dasharray: [2, 2],
5
- line_width: {
6
- stops: [
7
- [8, 1],
8
- [13, 1],
9
- [20, 2]
10
- ]
11
- },
12
- line_opacity: {
13
- stops: [
14
- [12, 0],
15
- [13, 1]
16
- ]
17
- }
18
- };
19
- const rail_overlay = {
20
- line_width: {
21
- stops: [
22
- [8, 1],
23
- [13, 6],
24
- [20, 12]
25
- ]
26
- },
27
- line_dasharray: [0.125, 6]
28
- };
29
- const rail_case = {
30
- line_color: tokens.background,
31
- line_width: {
32
- stops: [
33
- [13, 2],
34
- [20, 4]
35
- ]
36
- },
37
- line_opacity: {
38
- stops: [
39
- [12, 0],
40
- [13, 1]
41
- ]
42
- }
43
- };
44
- export default function makeTransit() {
1
+ export default function makeTransit(tokens) {
2
+ const rail = {
3
+ line_color: tokens.rail,
4
+ line_dasharray: [2, 2],
5
+ line_width: {
6
+ stops: [
7
+ [8, 1],
8
+ [13, 1],
9
+ [20, 2]
10
+ ]
11
+ },
12
+ line_opacity: {
13
+ stops: [
14
+ [12, 0],
15
+ [13, 1]
16
+ ]
17
+ }
18
+ };
19
+ const rail_overlay = {
20
+ line_width: {
21
+ stops: [
22
+ [8, 1],
23
+ [13, 6],
24
+ [20, 12]
25
+ ]
26
+ },
27
+ line_dasharray: [0.125, 6]
28
+ };
29
+ const rail_case = {
30
+ line_color: tokens.background,
31
+ line_width: {
32
+ stops: [
33
+ [13, 2],
34
+ [20, 4]
35
+ ]
36
+ },
37
+ line_opacity: {
38
+ stops: [
39
+ [12, 0],
40
+ [13, 1]
41
+ ]
42
+ }
43
+ };
45
44
  const airports = [
46
45
  {
47
46
  id: 'airport-area',
@@ -1 +1 @@
1
- export default function makeWalking(): any;
1
+ export default function makeWalking(tokens: any): any;