-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
161c9ee
commit 4fc9fee
Showing
1 changed file
with
35 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,43 @@ | ||
<script lang="ts"> | ||
import { RadioGroup, RadioItem } from '@skeletonlabs/skeleton'; | ||
import { Filter } from '../types/filter.enum'; | ||
export let filter: Filter = Filter.ALL; | ||
</script> | ||
|
||
<!-- Filter --> | ||
<div class="filters btn-group stack-exception"> | ||
<button | ||
class="btn toggle-btn" | ||
class:btn__primary={filter === Filter.ALL} | ||
aria-pressed={filter === Filter.ALL} | ||
on:click={() => (filter = Filter.ALL)} | ||
<div class="place-self-center"> | ||
<RadioGroup | ||
active="variant-filled-primary" | ||
hover="hover:variant-soft-primary" | ||
display="flex" | ||
spacing="space-x-6" | ||
> | ||
<span class="visually-hidden">Show</span> | ||
<span>All</span> | ||
<span class="visually-hidden">tasks</span> | ||
</button> | ||
<button | ||
class="btn toggle-btn" | ||
class:btn__primary={filter === Filter.ACTIVE} | ||
aria-pressed={filter === Filter.ACTIVE} | ||
on:click={() => (filter = Filter.ACTIVE)} | ||
> | ||
<span class="visually-hidden">Show</span> | ||
<span>Active</span> | ||
<span class="visually-hidden">tasks</span> | ||
</button> | ||
<button | ||
class="btn toggle-btn" | ||
class:btn__primary={filter === Filter.COMPLETED} | ||
aria-pressed={filter === Filter.COMPLETED} | ||
on:click={() => (filter = Filter.COMPLETED)} | ||
> | ||
<span class="visually-hidden">Show</span> | ||
<span>Completed</span> | ||
<span class="visually-hidden">tasks</span> | ||
</button> | ||
<RadioItem bind:group={filter} name="all" value={Filter.ALL}> | ||
<span class="visually-hidden">Show</span> | ||
<span>All</span> | ||
<span class="visually-hidden">tasks</span> | ||
</RadioItem> | ||
<RadioItem bind:group={filter} name="completed" value={Filter.COMPLETED}> | ||
<span class="visually-hidden">Show</span> | ||
<span>Completed</span> | ||
<span class="visually-hidden">tasks</span> | ||
</RadioItem> | ||
<RadioItem bind:group={filter} name="active" value={Filter.ACTIVE}> | ||
<span class="visually-hidden">Show</span> | ||
<span>Active</span> | ||
<span class="visually-hidden">tasks</span> | ||
</RadioItem> | ||
</RadioGroup> | ||
</div> | ||
|
||
<style> | ||
.visually-hidden { | ||
position: absolute !important; | ||
height: 1px; | ||
width: 1px; | ||
overflow: hidden; | ||
clip: rect(1px 1px 1px 1px); | ||
clip: rect(1px, 1px, 1px, 1px); | ||
white-space: nowrap; | ||
} | ||
</style> |