@swr-data-lab/components 2.26.1 → 2.28.0
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.
- package/dist/DesignTokens/DesignTokens.svelte +2 -0
- package/dist/DesignTokens/Tokens.js +6 -2
- package/dist/ScrollerSection/ScrollerSection.svelte +36 -0
- package/dist/ScrollerSection/ScrollerSection.svelte.d.ts +8 -0
- package/dist/ScrollerSection/index.d.ts +2 -0
- package/dist/ScrollerSection/index.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/maplibre/MapStyle/SWRDataLabDark.d.ts +1 -1
- package/dist/maplibre/MapStyle/SWRDataLabDark.js +4 -5
- package/dist/maplibre/MapStyle/SWRDataLabLight.d.ts +1 -1
- package/dist/maplibre/MapStyle/SWRDataLabLight.js +4 -2
- package/dist/maplibre/MapStyle/defaultOptions.d.ts +3 -0
- package/dist/maplibre/MapStyle/defaultOptions.js +10 -0
- package/dist/maplibre/MapStyle/types.d.ts +3 -0
- package/dist/maplibre/Tooltip/Tooltip.svelte +5 -1
- package/package.json +3 -3
|
@@ -47,6 +47,7 @@ const rules = [
|
|
|
47
47
|
--color-pageFill: var(--pageFill-light);
|
|
48
48
|
--color-surfaceFill: var(--surfaceFill-light);
|
|
49
49
|
--color-surfaceBorder: var(--surfaceBorder-light);
|
|
50
|
+
--color-dropShadow: var(--dropShadow-light);
|
|
50
51
|
}
|
|
51
52
|
.container[data-theme=dark] {
|
|
52
53
|
--color-logoFill: var(--logoFill-dark);
|
|
@@ -56,6 +57,7 @@ const rules = [
|
|
|
56
57
|
--color-textPrimary: var(--textPrimary-dark);
|
|
57
58
|
--color-textSecondary: var(--textSecondary-dark);
|
|
58
59
|
--color-textSecondaryHover: var(--textSecondaryHover-dark);
|
|
60
|
+
--color-dropShadow: var(--dropShadow-dark);
|
|
59
61
|
}
|
|
60
62
|
.container {
|
|
61
63
|
--swr-text: "SWR-VAR-Text", sans-serif;
|
|
@@ -169,12 +169,16 @@ const semantics = {
|
|
|
169
169
|
light: '#ffffff'
|
|
170
170
|
},
|
|
171
171
|
surfaceBorder: {
|
|
172
|
-
dark: '
|
|
173
|
-
light: shades.gray.
|
|
172
|
+
dark: 'rgba(255,255,255,.15)',
|
|
173
|
+
light: shades.gray.light3
|
|
174
174
|
},
|
|
175
175
|
pageFill: {
|
|
176
176
|
dark: '#0C0C0C',
|
|
177
177
|
light: '#fff'
|
|
178
|
+
},
|
|
179
|
+
dropShadow: {
|
|
180
|
+
dark: 'rgba(0,0,0, 0.25)',
|
|
181
|
+
light: 'rgba(0,0,0, 0.0375)'
|
|
178
182
|
}
|
|
179
183
|
};
|
|
180
184
|
const scales = {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script lang="ts">import {} from 'svelte';
|
|
2
|
+
let { height = '100vh', children } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<section class="container" style:height>
|
|
6
|
+
<div class="inner">
|
|
7
|
+
{@render children?.()}
|
|
8
|
+
</div>
|
|
9
|
+
</section>
|
|
10
|
+
|
|
11
|
+
<style>.container {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.inner {
|
|
17
|
+
margin: 0 auto;
|
|
18
|
+
padding: 1em 1.5em;
|
|
19
|
+
color: var(--color-textPrimary);
|
|
20
|
+
max-width: 40em;
|
|
21
|
+
font-family: var(--swr-sans);
|
|
22
|
+
font-weight: 400;
|
|
23
|
+
line-height: 1.5;
|
|
24
|
+
letter-spacing: 0.01em;
|
|
25
|
+
font-size: var(--fs-small-1);
|
|
26
|
+
border-radius: 8px;
|
|
27
|
+
background: var(--color-surfaceFill);
|
|
28
|
+
box-shadow: 0 0 8px 1px var(--color-dropShadow);
|
|
29
|
+
border: 1px solid var(--color-surfaceBorder);
|
|
30
|
+
}
|
|
31
|
+
@media (min-width: 500px) {
|
|
32
|
+
.inner {
|
|
33
|
+
padding: 1.25em;
|
|
34
|
+
margin: 1em auto;
|
|
35
|
+
}
|
|
36
|
+
}</style>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Snippet } from 'svelte';
|
|
2
|
+
interface SlideContentProps {
|
|
3
|
+
height?: string;
|
|
4
|
+
children: Snippet;
|
|
5
|
+
}
|
|
6
|
+
declare const ScrollerSection: import("svelte").Component<SlideContentProps, {}, "">;
|
|
7
|
+
type ScrollerSection = ReturnType<typeof ScrollerSection>;
|
|
8
|
+
export default ScrollerSection;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { default as Caption } from "./Caption/Caption.svelte";
|
|
|
7
7
|
export { default as Note } from "./Note/Note.svelte";
|
|
8
8
|
export { default as Card } from "./Card/Card.svelte";
|
|
9
9
|
export { default as Scroller } from "./Scroller/Scroller.svelte";
|
|
10
|
+
export { default as ScrollerSection } from "./ScrollerSection/ScrollerSection.svelte";
|
|
10
11
|
export { default as SwrHeader } from "./SwrHeader/SwrHeader.svelte";
|
|
11
12
|
export { default as ChartHeader } from "./ChartHeader/ChartHeader.svelte";
|
|
12
13
|
export { default as ChartFooter } from "./ChartFooter/ChartFooter.svelte";
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ export { default as Note } from './Note/Note.svelte';
|
|
|
12
12
|
// Display
|
|
13
13
|
export { default as Card } from './Card/Card.svelte';
|
|
14
14
|
export { default as Scroller } from './Scroller/Scroller.svelte';
|
|
15
|
+
export { default as ScrollerSection } from './ScrollerSection/ScrollerSection.svelte';
|
|
15
16
|
export { default as SwrHeader } from './SwrHeader/SwrHeader.svelte';
|
|
16
17
|
|
|
17
18
|
// Chart
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import defaultOptions from './defaultOptions';
|
|
1
2
|
import makeAdmin from './components/Admin';
|
|
2
3
|
import makeBuildings from './components/Buildings';
|
|
3
4
|
import makeLanduse from './components/Landuse';
|
|
@@ -46,10 +47,7 @@ const { roadLabels, roadBridges, roadSurface, roadTunnels } = makeRoads(tokens);
|
|
|
46
47
|
const { buildingFootprints, buildingExtrusions, structureExtrusions } = makeBuildings(tokens);
|
|
47
48
|
const style = (opts) => {
|
|
48
49
|
const options = {
|
|
49
|
-
|
|
50
|
-
roads: {
|
|
51
|
-
showLabels: true
|
|
52
|
-
},
|
|
50
|
+
...defaultOptions,
|
|
53
51
|
...opts
|
|
54
52
|
};
|
|
55
53
|
return {
|
|
@@ -113,7 +111,8 @@ const style = (opts) => {
|
|
|
113
111
|
// 8. Building extrusions
|
|
114
112
|
...(options.enableBuildingExtrusions ? [buildingExtrusions] : []),
|
|
115
113
|
// 8. Point labels
|
|
116
|
-
...placeLabels,
|
|
114
|
+
...(options.places?.showLabels ? placeLabels : []),
|
|
115
|
+
// 9. Admin boundary labels
|
|
117
116
|
...boundaryLabels
|
|
118
117
|
]
|
|
119
118
|
};
|
|
@@ -5,6 +5,7 @@ import makeTransit from './components/Transit';
|
|
|
5
5
|
import makePlaceLabels from './components/PlaceLabels';
|
|
6
6
|
import makeWalking from './components/Walking';
|
|
7
7
|
import makeRoads from './components/Roads';
|
|
8
|
+
import defaultOptions from './defaultOptions';
|
|
8
9
|
const tokens = {
|
|
9
10
|
sans_regular: ['SWR Sans Regular'],
|
|
10
11
|
sans_medium: ['SWR Sans Medium'],
|
|
@@ -46,7 +47,7 @@ const { roadLabels, roadBridges, roadSurface, roadTunnels } = makeRoads(tokens);
|
|
|
46
47
|
const { buildingFootprints, buildingExtrusions, structureExtrusions } = makeBuildings(tokens);
|
|
47
48
|
const style = (opts) => {
|
|
48
49
|
const options = {
|
|
49
|
-
|
|
50
|
+
...defaultOptions,
|
|
50
51
|
...opts
|
|
51
52
|
};
|
|
52
53
|
return {
|
|
@@ -110,7 +111,8 @@ const style = (opts) => {
|
|
|
110
111
|
// 8. Building extrusions
|
|
111
112
|
...(options.enableBuildingExtrusions ? [buildingExtrusions] : []),
|
|
112
113
|
// 8. Point labels
|
|
113
|
-
...placeLabels,
|
|
114
|
+
...(options.places?.showLabels ? placeLabels : []),
|
|
115
|
+
// 9. Admin boundary labels
|
|
114
116
|
...boundaryLabels
|
|
115
117
|
]
|
|
116
118
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script lang="ts">import { onDestroy } from 'svelte';
|
|
1
|
+
<script lang="ts">import { onDestroy, tick } from 'svelte';
|
|
2
2
|
import maplibre, {} from 'maplibre-gl';
|
|
3
3
|
import { getMapContext } from '../context.svelte.js';
|
|
4
4
|
import { resetPopupEventListener } from '../utils';
|
|
@@ -14,6 +14,10 @@ let el = $state();
|
|
|
14
14
|
$effect(() => {
|
|
15
15
|
if (position && el && map) {
|
|
16
16
|
tooltip.setLngLat(position).setDOMContent(el).addTo(map);
|
|
17
|
+
// Ensure tooltip doesn't extend beyond the map canvas, see #223
|
|
18
|
+
tick().then(() => {
|
|
19
|
+
tooltip._update();
|
|
20
|
+
});
|
|
17
21
|
}
|
|
18
22
|
else {
|
|
19
23
|
tooltip.remove();
|
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.
|
|
4
|
+
"version": "2.28.0",
|
|
5
5
|
"author": "SWR Data Lab",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"type": "module",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"concurrently": "^9.2.1",
|
|
60
60
|
"http-server": "^14.1.1",
|
|
61
61
|
"mdx-mermaid": "^2.0.3",
|
|
62
|
-
"playwright": "^1.55.
|
|
62
|
+
"playwright": "^1.55.1",
|
|
63
63
|
"publint": "^0.3.12",
|
|
64
64
|
"sass": "^1.91.0",
|
|
65
65
|
"sass-embedded": "^1.93.2",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"svelte-check": "^4.3.2",
|
|
70
70
|
"svelte-preprocess": "^6.0.3",
|
|
71
71
|
"typescript": "^5.9.2",
|
|
72
|
-
"vite": "^7.1.
|
|
72
|
+
"vite": "^7.1.11",
|
|
73
73
|
"vitest": "^3.1.1",
|
|
74
74
|
"wait-on": "^8.0.1"
|
|
75
75
|
},
|