@swr-data-lab/components 2.3.2 → 2.4.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.
@@ -1,5 +1,4 @@
1
1
  <script lang="ts">import { dev } from '$app/environment';
2
- import { resolve } from '$app/paths';
3
2
  let { project, charts, baseUrl } = $props();
4
3
  </script>
5
4
 
@@ -16,14 +15,15 @@ let { project, charts, baseUrl } = $props();
16
15
  </thead>
17
16
  <tbody>
18
17
  {#each charts as chart}
19
- {@const route = `/${chart.slug}/` as RouteId}
20
- {@const fullUrl = baseUrl ? `${baseUrl}/${chart.slug}.html` : resolve(route)}
18
+ {@const route = `/${chart.slug}`}
21
19
  <tr>
22
20
  <td>
23
- <a href={dev ? resolve(route) : fullUrl}>{chart.title}</a>
21
+ <a rel="external" href={dev ? route : `./${chart.slug}.html`}>
22
+ {chart.title}
23
+ </a>
24
24
  </td>
25
25
  <td>
26
- <input type="text" value={fullUrl} />
26
+ <input type="text" value={`${baseUrl ?? ''}${route}.html`} />
27
27
  </td>
28
28
  </tr>
29
29
  {/each}
@@ -109,16 +109,48 @@ const street_secondary = {
109
109
  }
110
110
  };
111
111
  const street_secondary_case = {
112
- line_width: {
113
- stops: [
114
- [12, 0],
115
- [14, 3],
116
- [16, 10],
117
- [18, 30],
118
- [19, 66],
119
- [20, 40]
120
- ]
121
- }
112
+ paint: {
113
+ 'line-color': tokens.street_secondary_case,
114
+ 'line-width': {
115
+ stops: [
116
+ [12, 0],
117
+ [14, 3],
118
+ [16, 11],
119
+ [18, 30],
120
+ [19, 66],
121
+ [20, 40]
122
+ ]
123
+ },
124
+ 'line-opacity': {
125
+ stops: [
126
+ [11, 0],
127
+ [12, 1]
128
+ ]
129
+ }
130
+ },
131
+ layout: case_layout
132
+ };
133
+ const street_tertiary_case = {
134
+ paint: {
135
+ 'line-color': tokens.street_tertiary_case,
136
+ 'line-width': {
137
+ stops: [
138
+ [12, 2],
139
+ [14, 3],
140
+ [16, 6],
141
+ [18, 26],
142
+ [19, 64],
143
+ [20, 128]
144
+ ]
145
+ },
146
+ 'line-opacity': {
147
+ stops: [
148
+ [12, 0],
149
+ [13, 1]
150
+ ]
151
+ }
152
+ },
153
+ layout: case_layout
122
154
  };
123
155
  const street_residential = {
124
156
  line_color: tokens.street_tertiary,
@@ -340,36 +372,13 @@ export default function makeRoads() {
340
372
  {
341
373
  id: 'bridge-street-tertiary-link:case',
342
374
  filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'tertiary'], ['==', 'link', true]],
343
- 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
- }
361
- },
362
- layout: case_layout
375
+ ...street_tertiary_case
363
376
  },
364
377
  {
365
378
  id: 'bridge-street-secondary-link:case',
366
379
  filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'secondary'], ['==', 'link', true]],
367
- paint: {
368
- 'line-color': tokens.street_secondary_case,
369
- 'line-width': street_secondary_case.line_width
370
- },
371
- layout: case_layout,
372
- minzoom: 13
380
+ minzoom: 13,
381
+ ...street_secondary_case
373
382
  },
374
383
  {
375
384
  id: 'bridge-street-primary-link:case',
@@ -404,41 +413,12 @@ export default function makeRoads() {
404
413
  {
405
414
  id: 'bridge-street-tertiary:case',
406
415
  filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'tertiary'], ['!=', 'link', true]],
407
- paint: {
408
- 'line-color': 'rgb(217,217,217)',
409
- 'line-width': {
410
- stops: [
411
- [12, 2],
412
- [14, 3],
413
- [16, 6],
414
- [18, 26],
415
- [19, 64],
416
- [20, 128]
417
- ]
418
- },
419
- 'line-opacity': {
420
- stops: [
421
- [12, 0],
422
- [13, 1]
423
- ]
424
- }
425
- },
426
- layout: case_layout
416
+ ...street_tertiary_case
427
417
  },
428
418
  {
429
419
  id: 'bridge-street-secondary:case',
430
420
  filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'secondary'], ['!=', 'link', true]],
431
- paint: {
432
- 'line-color': tokens.street_secondary_case,
433
- 'line-width': street_secondary_case.line_width,
434
- 'line-opacity': {
435
- stops: [
436
- [11, 0],
437
- [12, 1]
438
- ]
439
- }
440
- },
441
- layout: case_layout
421
+ ...street_secondary_case
442
422
  },
443
423
  {
444
424
  id: 'bridge-street-primary:case',
@@ -785,37 +765,17 @@ export default function makeRoads() {
785
765
  {
786
766
  id: 'tunnel-street-tertiary-link:case',
787
767
  filter: ['all', ['==', 'tunnel', true], ['in', 'kind', 'tertiary'], ['==', 'link', true]],
788
- paint: {
789
- 'line-color': 'rgb(222,222,222)',
790
- 'line-width': {
791
- stops: [
792
- [12, 2],
793
- [14, 3],
794
- [16, 6],
795
- [18, 26],
796
- [19, 64],
797
- [20, 128]
798
- ]
799
- },
800
- 'line-opacity': {
801
- stops: [
802
- [12, 0],
803
- [13, 1]
804
- ]
805
- }
806
- },
807
- layout: case_layout
768
+ ...street_tertiary_case
808
769
  },
809
770
  {
810
771
  id: 'tunnel-street-secondary-link:case',
811
772
  type: 'line',
812
773
  filter: ['all', ['==', 'tunnel', true], ['in', 'kind', 'secondary'], ['==', 'link', true]],
813
774
  paint: {
814
- 'line-color': tokens.street_secondary_case,
775
+ ...street_secondary_case.paint,
815
776
  'line-dasharray': [1, 0.3],
816
- 'line-width': street_secondary.line_width
817
777
  },
818
- layout: case_layout,
778
+ layout: street_secondary_case.layout,
819
779
  minzoom: 13
820
780
  },
821
781
  {
@@ -853,42 +813,12 @@ export default function makeRoads() {
853
813
  {
854
814
  id: 'tunnel-street-tertiary:case',
855
815
  filter: ['all', ['==', 'tunnel', true], ['in', 'kind', 'tertiary'], ['!=', 'link', true]],
856
- paint: {
857
- 'line-color': 'rgb(222,222,222)',
858
- 'line-width': {
859
- stops: [
860
- [12, 2],
861
- [14, 3],
862
- [16, 6],
863
- [18, 26],
864
- [19, 64],
865
- [20, 128]
866
- ]
867
- },
868
- 'line-opacity': {
869
- stops: [
870
- [12, 0],
871
- [13, 1]
872
- ]
873
- }
874
- },
875
- layout: case_layout
816
+ ...street_tertiary_case
876
817
  },
877
818
  {
878
819
  id: 'tunnel-street-secondary:case',
879
820
  filter: ['all', ['==', 'tunnel', true], ['in', 'kind', 'secondary'], ['!=', 'link', true]],
880
- paint: {
881
- 'line-color': tokens.street_secondary_case,
882
- 'line-dasharray': [1, 0.3],
883
- 'line-width': street_secondary_case.line_width,
884
- 'line-opacity': {
885
- stops: [
886
- [11, 0],
887
- [12, 1]
888
- ]
889
- }
890
- },
891
- layout: case_layout
821
+ ...street_secondary_case
892
822
  },
893
823
  {
894
824
  id: 'tunnel-street-primary:case',
@@ -1270,26 +1200,7 @@ export default function makeRoads() {
1270
1200
  ['in', 'kind', 'tertiary'],
1271
1201
  ['==', 'link', true]
1272
1202
  ],
1273
- paint: {
1274
- 'line-color': 'hsl(36,0%,80%)',
1275
- 'line-width': {
1276
- stops: [
1277
- [12, 2],
1278
- [14, 3],
1279
- [16, 6],
1280
- [18, 26],
1281
- [19, 64],
1282
- [20, 128]
1283
- ]
1284
- },
1285
- 'line-opacity': {
1286
- stops: [
1287
- [12, 0],
1288
- [13, 1]
1289
- ]
1290
- }
1291
- },
1292
- layout: case_layout
1203
+ ...street_tertiary_case
1293
1204
  },
1294
1205
  {
1295
1206
  id: 'street-secondary-link:case',
@@ -1300,12 +1211,7 @@ export default function makeRoads() {
1300
1211
  ['in', 'kind', 'secondary'],
1301
1212
  ['==', 'link', true]
1302
1213
  ],
1303
- paint: {
1304
- 'line-color': tokens.street_secondary_case,
1305
- 'line-width': street_secondary_case.line_width
1306
- },
1307
- layout: case_layout,
1308
- minzoom: 13
1214
+ ...street_secondary_case
1309
1215
  },
1310
1216
  {
1311
1217
  id: 'street-primary-link:case',
@@ -1364,26 +1270,7 @@ export default function makeRoads() {
1364
1270
  ['in', 'kind', 'tertiary'],
1365
1271
  ['!=', 'link', true]
1366
1272
  ],
1367
- paint: {
1368
- 'line-color': 'hsl(36,0%,80%)',
1369
- 'line-width': {
1370
- stops: [
1371
- [12, 2],
1372
- [14, 3],
1373
- [16, 6],
1374
- [18, 26],
1375
- [19, 64],
1376
- [20, 128]
1377
- ]
1378
- },
1379
- 'line-opacity': {
1380
- stops: [
1381
- [12, 0],
1382
- [13, 1]
1383
- ]
1384
- }
1385
- },
1386
- layout: case_layout
1273
+ ...street_tertiary_case
1387
1274
  },
1388
1275
  {
1389
1276
  id: 'street-secondary:case',
@@ -1394,17 +1281,7 @@ export default function makeRoads() {
1394
1281
  ['in', 'kind', 'secondary'],
1395
1282
  ['!=', 'link', true]
1396
1283
  ],
1397
- paint: {
1398
- 'line-color': tokens.street_secondary_case,
1399
- 'line-width': street_secondary_case.line_width,
1400
- 'line-opacity': {
1401
- stops: [
1402
- [11, 0],
1403
- [12, 1]
1404
- ]
1405
- }
1406
- },
1407
- layout: case_layout
1284
+ ...street_secondary_case
1408
1285
  },
1409
1286
  {
1410
1287
  id: 'street-primary:case',
@@ -12,7 +12,7 @@ const tokens = {
12
12
  street_primary: 'hsl(0, 0%, 96%)',
13
13
  street_primary_case: 'hsl(0, 0%, 75%)',
14
14
  street_secondary: 'hsl(0, 0%, 95%)',
15
- street_secondary_case: 'hsl(0, 0%, 50%)',
15
+ street_secondary_case: 'hsl(0, 0%, 75%)',
16
16
  street_tertiary: 'hsl(0, 0%, 95%)',
17
17
  street_tertiary_case: 'hsl(0, 0%, 70%)',
18
18
  label_primary: 'hsl(240, 5%, 10%)',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@swr-data-lab/components",
3
3
  "description": "SWR Data Lab component library",
4
- "version": "2.3.2",
4
+ "version": "2.4.1",
5
5
  "author": "SWR Data Lab",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -39,16 +39,16 @@
39
39
  "@semantic-release/changelog": "^6.0.3",
40
40
  "@semantic-release/git": "^10.0.1",
41
41
  "@semantic-release/npm": "^12.0.2",
42
- "@storybook/addon-docs": "^9.0.15",
43
- "@storybook/addon-links": "^9.0.15",
44
- "@storybook/addon-svelte-csf": "^5.0.4",
45
- "@storybook/addon-vitest": "^9.0.15",
46
- "@storybook/sveltekit": "^9.0.15",
42
+ "@storybook/addon-docs": "^9.1.0",
43
+ "@storybook/addon-links": "^9.1.0",
44
+ "@storybook/addon-svelte-csf": "^5.0.7",
45
+ "@storybook/addon-vitest": "^9.1.0",
46
+ "@storybook/sveltekit": "^9.1.0",
47
47
  "@storybook/test-runner": "^0.23.0",
48
48
  "@sveltejs/adapter-auto": "^6.0.1",
49
- "@sveltejs/kit": "^2.26.1",
50
- "@sveltejs/package": "^2.3.12",
51
- "@sveltejs/vite-plugin-svelte": "^5.1.0",
49
+ "@sveltejs/kit": "^2.27.0",
50
+ "@sveltejs/package": "^2.4.0",
51
+ "@sveltejs/vite-plugin-svelte": "^6.1.0",
52
52
  "@types/geojson": "^7946.0.16",
53
53
  "@versatiles/style": "^5.6.0",
54
54
  "@vitest/browser": "^3.2.4",
@@ -56,12 +56,12 @@
56
56
  "concurrently": "^9.2.0",
57
57
  "http-server": "^14.1.1",
58
58
  "mdx-mermaid": "^2.0.3",
59
- "playwright": "^1.51.1",
59
+ "playwright": "^1.54.2",
60
60
  "publint": "^0.3.12",
61
61
  "sass": "^1.89.1",
62
62
  "sass-embedded": "^1.89.2",
63
- "semantic-release": "^24.2.6",
64
- "storybook": "^9.0.15",
63
+ "semantic-release": "^24.2.7",
64
+ "storybook": "^9.1.0",
65
65
  "svelte": "^5.23.0",
66
66
  "svelte-check": "^4.0.0",
67
67
  "svelte-preprocess": "^6.0.3",