chore: move Filters and Controls to GetFont feature
This commit is contained in:
25
src/features/GetFonts/ui/Filters/Filters.svelte
Normal file
25
src/features/GetFonts/ui/Filters/Filters.svelte
Normal file
@@ -0,0 +1,25 @@
|
||||
<script lang="ts">
|
||||
/**
|
||||
* Filters Component
|
||||
*
|
||||
* Orchestrates all filter properties for the sidebar. Connects filter stores
|
||||
* to CheckboxFilter components, organizing them by filter type:
|
||||
*
|
||||
* - Font provider: Google Fonts vs Fontshare
|
||||
* - Font subset: Character subsets available (Latin, Latin Extended, etc.)
|
||||
* - Font category: Serif, Sans-serif, Display, etc.
|
||||
*
|
||||
* This component handles reactive sync between filterManager selections
|
||||
* and the unifiedFontStore using an $effect block to ensure filters are
|
||||
* automatically synchronized whenever selections change.
|
||||
*/
|
||||
import { CheckboxFilter } from '$shared/ui';
|
||||
import { filterManager } from '../../model';
|
||||
</script>
|
||||
|
||||
{#each filterManager.groups as group (group.id)}
|
||||
<CheckboxFilter
|
||||
displayedLabel={group.label}
|
||||
filter={group.instance}
|
||||
/>
|
||||
{/each}
|
||||
@@ -0,0 +1,22 @@
|
||||
<script lang="ts">
|
||||
import { Button } from '$shared/shadcn/ui/button';
|
||||
import { filterManager } from '../../model';
|
||||
|
||||
/**
|
||||
* Controls Component
|
||||
*
|
||||
* Action button group for filter operations. Provides two buttons:
|
||||
*
|
||||
* - Reset: Clears all active filters (outline variant for secondary action)
|
||||
*/
|
||||
</script>
|
||||
|
||||
<div class="flex flex-row gap-2">
|
||||
<Button
|
||||
variant="outline"
|
||||
class="flex-1 cursor-pointer"
|
||||
onclick={filterManager.deselectAllGlobal}
|
||||
>
|
||||
Reset
|
||||
</Button>
|
||||
</div>
|
||||
Reference in New Issue
Block a user