Skip to content

Commit 60c8e9c

Browse files
committed
feat(searchfilters): Added TooltipInfo component to display tooltips for facets
1 parent 82b4fe1 commit 60c8e9c

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

frontend/src/lib/components/search/SearchFilters.svelte

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { Button } from 'bits-ui';
33
import { slide } from 'svelte/transition';
44
import RangeSlider from './RangeSlider.svelte';
5+
import TooltipInfo from '$lib/components/TooltipInfo.svelte';
56
import * as config from '$lib/config';
67
78
let {
@@ -117,6 +118,7 @@
117118
>
118119
<section class="filters-header">
119120
<h2>Filters</h2>
121+
120122
<Button.Root class="close-button" onclick={handleClose} aria-label="Close filters"
121123
>×</Button.Root
122124
>
@@ -187,6 +189,7 @@
187189
endLabel={selectedDateRange[1] <= 0
188190
? `${-1 * selectedDateRange[1]} BCE`
189191
: `${selectedDateRange[1]} CE`}
192+
tooltip={config.tooltips.date}
190193
bind:selectedRange={selectedDateRange}
191194
rangeChange={() => searchFiltersChange()}
192195
/>
@@ -197,7 +200,12 @@
197200
<section class="filters-group">
198201
<details>
199202
<summary>
200-
<h3>{aggregations[key].title}</h3>
203+
<hgroup>
204+
<h3>{aggregations[key].title}</h3>
205+
{#if key in config.tooltips}
206+
<TooltipInfo>{config.tooltips[key]}</TooltipInfo>
207+
{/if}
208+
</hgroup>
201209
</summary>
202210
<div>
203211
<small
@@ -271,6 +279,7 @@
271279
step={1}
272280
startLabel="Minimum"
273281
endLabel="Maximum"
282+
tooltip={config.tooltips.letterHeight}
274283
bind:selectedRange={selectedLetterHeightRange}
275284
rangeChange={() => searchFiltersChange()}
276285
/>
@@ -431,6 +440,11 @@
431440
padding-inline: var(--size-3);
432441
}
433442
443+
.filters-group summary hgroup {
444+
align-items: flex-start;
445+
display: flex;
446+
}
447+
434448
.filters-group details[open] summary {
435449
margin-bottom: var(--size-00);
436450
}

0 commit comments

Comments
 (0)