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
19 changes: 15 additions & 4 deletions components/src/maplibre/Geocoder/Geocoder.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<script module lang="ts">
import { defineMeta } from '@storybook/addon-svelte-csf';
import { within, expect } from 'storybook/test';

import Geocoder from './Geocoder.svelte';
import DesignTokens from '../../DesignTokens/DesignTokens.svelte';
import { SWRDataLabLight } from '../MapStyle';
Expand All @@ -19,8 +17,6 @@
<Story
asChild
name="Default"
play={async ({ canvasElement, step }) => {
}}
>
<DesignTokens theme="light">
<div class="container">
Expand All @@ -36,6 +32,21 @@
</div>
</DesignTokens>
</Story>
<Story
asChild
name="size=small"
>
<DesignTokens theme="light">
<div class="container">
<Geocoder
languages="de"
size="small"
service="maptiler"
key="V32kPHZjMa0Mkn6YvSzA"
/>
</div>
</DesignTokens>
</Story>

<style>
.container {
Expand Down
3 changes: 2 additions & 1 deletion components/src/maplibre/Geocoder/Geocoder.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
types = [],
placeholder,
limit = 3,
size = "default",
map,
}: GeocoderProps = $props();

Expand Down Expand Up @@ -53,7 +54,7 @@
}
</script>

<div class="container" {@attach attachGeocoder}></div>
<div class={["container", size]} {@attach attachGeocoder}></div>

<style lang="scss">
@use "geocoder.scss"
Expand Down
1 change: 1 addition & 0 deletions components/src/maplibre/Geocoder/GeocoderProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ export default interface GeocoderProps {
* Overwrite the default input placeholder
*/
placeholder?: string;
size?: "small" | "default"
}
12 changes: 12 additions & 0 deletions components/src/maplibre/Geocoder/geocoder.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
font-size: var(--fs-base);
border: 1px solid var(--color-textSecondary);

.small & {
font-size: var(--fs-small-1);
}

button {
cursor: pointer;
}
Expand Down Expand Up @@ -86,6 +90,10 @@
padding: 0.7em 0.75em;
padding-bottom: 0.65em;
border-bottom: 1px solid var(--color-surfaceBorder);
.small & {
padding: 0.65em 0.7em;
padding-bottom: 0.6em;
}
}
.maplibregl-ctrl-geocoder .suggestions > li:last-child > a {
border-bottom: 0;
Expand Down Expand Up @@ -128,6 +136,10 @@
color: var(--color-textPrimary);
font-weight: 600;
letter-spacing: 0;
.small & {
font-size: var(--fs-small-2);
letter-spacing: 0.01em;
}
}
.maplibregl-ctrl-geocoder--result-address {
font-size: var(--fs-small-2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
countries = 'de',
languages = 'en',
types = [],
size="default",
placeholder,
position = 'top-left',
limit = 3
Expand Down
Loading