Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/src/DesignTokens/Tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ const semantics: ColourMap = {
light: '#ffffff'
},
surfaceHover: {
dark: '#0d0d0e',
light: '#ebebeb'
dark: '#121212',
light: '#eee'
},
raisedSurfaceFill: {
dark: '#393a3b',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@
<DesignTokens theme="light">
<div class="container">
<Map style={SWRDataLabLight()} initialLocation={{ lat: 51, lng: 10, zoom: 20 }}>
<GeocoderControl languages="de" service="maptiler" key="V32kPHZjMa0Mkn6YvSzA" />
<GeocoderControl
size="large"
languages="de"
service="maptiler"
key="V32kPHZjMa0Mkn6YvSzA"
/>
</Map>
</div>
</DesignTokens>
Expand Down
41 changes: 21 additions & 20 deletions components/src/maplibre/GeocoderControl/GeocoderControl.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,13 @@
<style lang="scss">
:global {
.maplibregl-ctrl-geocoder {
background-color: var(--color-surfaceFill);
background-color: var(--color-pageFill);
position: relative;
width: 100%;
z-index: 1;
font-family: var(--swr-sans);
font-size: var(--fs-small-1);
border-radius: var(--br-small);
font-size: var(--fs-base);
border: 1px solid var(--color-textSecondary);
box-shadow: 2px 2px 1px rgba(0, 0, 0, 0.075);

button {
cursor: pointer;
Expand All @@ -83,19 +81,21 @@
}

.maplibregl-ctrl-geocoder--input {
width: calc(100% - 3.7em);
height: 100%;
font-family: inherit;
font-size: inherit;
background-color: transparent;
color: var(--color-textPrimary);
border: 0;
height: 1.95em;
padding: 0 1.95em;
padding-top: 0.1em;
height: 2em;
padding: 0 1.85em;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
&::-webkit-search-cancel-button,
&::-webkit-search-decoration {
appearance: none;
}
}

.maplibregl-ctrl-geocoder--input::placeholder {
Expand All @@ -119,15 +119,13 @@

/* Suggestions */
.maplibregl-ctrl-geocoder .suggestions {
background: var(--color-surfaceFill);
border: 1px solid rgba(0, 0, 0, 0.75);
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
border-radius: var(--br-small);
left: 0;
background: var(--color-pageFill);
border: 1px solid var(--color-textSecondary);
left: -1px;
list-style: none;
position: absolute;
width: 100%;
top: calc(100% + 0.5em);
top: 100%;
z-index: 1000;
overflow: hidden;
}
Expand All @@ -141,9 +139,9 @@
.maplibregl-ctrl-geocoder .suggestions > li > a {
cursor: default;
display: block;
padding: 0.5em 0.75em;
color: var(--gray-dark-5);
padding-bottom: 0.5em;
font-size: var(--fs-small-1);
padding: 0.7em 0.75em;
padding-bottom: 0.65em;
border-bottom: 1px solid var(--color-surfaceBorder);
}
.maplibregl-ctrl-geocoder .suggestions > li:last-child > a {
Expand Down Expand Up @@ -199,18 +197,21 @@
position: absolute;
top: 50%;
transform: translateY(-50%);
height: 1em;
path {
fill: var(--color-textPrimary);
}
}

.maplibregl-ctrl-geocoder--icon-close {
right: 0;
height: 1.15em;
opacity: 0.5;
}
.maplibregl-ctrl-geocoder--icon-search {
left: 0.5em;
height: 1.5em;
left: 0.4em;
height: 1.25em;
top: 51%; // optical correction
width: auto;
}
}
</style>
10 changes: 5 additions & 5 deletions components/src/maplibre/Map/Map.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import AttributionControl from '../AttributionControl/AttributionControl.svelte';
import GeocoderControl from '../GeocoderControl/GeocoderControl.svelte';

import { SWRDataLabLight } from '../MapStyle';
import { SWRDataLabLight, SWRDataLabDark } from '../MapStyle';

import { eclipse } from '@versatiles/style';
import { MapContext } from '../context.svelte';
Expand Down Expand Up @@ -74,7 +74,7 @@
<Map style={SWRDataLabLight()}>
<ScaleControl />
<AttributionControl />
<NavigationControl showCompass visualizePitch />
<NavigationControl showCompass visualizePitch position="bottom-left" />
<GeocoderControl languages="de" service="maptiler" key="V32kPHZjMa0Mkn6YvSzA" />
</Map>
</DesignTokens>
Expand Down Expand Up @@ -134,17 +134,17 @@

<Story asChild name="Globe Projection">
<div class="container">
<DesignTokens theme="light">
<DesignTokens theme="dark">
<Map
style={SWRDataLabLight()}
style={SWRDataLabDark()}
showDebug
projection={{ type: 'globe' }}
pitch={52}
initialLocation={{ lat: 51.3, lng: 10.2, zoom: 3.5 }}
>
<ScaleControl />
<AttributionControl />
<NavigationControl showCompass visualizePitch />
<NavigationControl showCompass visualizePitch position="top-right" />
<GeocoderControl languages="de" service="maptiler" key="V32kPHZjMa0Mkn6YvSzA" />
</Map>
</DesignTokens>
Expand Down
11 changes: 7 additions & 4 deletions components/src/maplibre/Map/Map.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@
}

.maplibregl-ctrl-top-right {
right: 0;
top: 0;
right: 0.5em;
top: 0.5em;
}

.maplibregl-ctrl-bottom-left {
Expand All @@ -311,6 +311,7 @@
.maplibregl-ctrl-bottom-right {
bottom: 0.5em;
right: 0.5em;
align-items: flex-end;
}

.maplibregl-ctrl {
Expand All @@ -319,10 +320,9 @@
}

.maplibregl-ctrl-group {
background: var(--color-surfaceFill);
background: var(--color-pageFill);
border: 1px solid var(--color-textSecondary);
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.075);
border-radius: var(--br-small);
overflow: hidden;
}

Expand Down Expand Up @@ -391,6 +391,9 @@
.maplibregl-marker path {
fill: var(--color-textPrimary);
}
.maplibregl-marker circle {
fill: var(--color-pageFill);
}
.maplibregl-cooperative-gesture-screen {
align-items: center;
font-family: var(--swr-sans);
Expand Down
4 changes: 1 addition & 3 deletions components/src/maplibre/MapControl/MapControl.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,5 @@
</script>

<div bind:this={el} class={`maplibregl-ctrl ${className}`}>
{#if children}
{@render children()}
{/if}
{@render children?.()}
</div>
4 changes: 2 additions & 2 deletions components/src/maplibre/MapStyle/SWRDataLabDark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ const tokens = {
sans_bold: ['SWR Sans Bold'],
background: {
stops: [
[8, 'hsl(210, 9%, 13%)'],
[8, 'hsl(210, 3%, 10%)'],
[10, '#1e1f22']
]
},
water: 'hsl(210, 12%, 7%)',
water_light: 'hsl(210, 12%, 8%)',
water_ocean: 'hsl(214, 25%, 7%)',
water_ocean: 'hsl(214, 5%, 5%)',
marsh: 'hsl(180, 3%, 35%)',
grass: 'hsl(170, 20%, 14%)',
grass_dark: 'hsl(170, 16%, 12%)',
Expand Down
1 change: 1 addition & 0 deletions components/src/maplibre/ScaleControl/ScaleControl.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
font-weight: 400;
font-size: var(--fs-small-3);
font-family: var(--swr-text);
margin-bottom: 0.2em;
}
}
</style>