diff --git a/src/components/Header.svelte b/src/components/Header.svelte index 1c23ffe..d825de1 100644 --- a/src/components/Header.svelte +++ b/src/components/Header.svelte @@ -25,14 +25,15 @@ let tagSearchQuery = ""; // Search query for filtering tags // Filter available tags based on search query - $: filteredAvailableTags = allTags.filter((t) => - !selectedTags.includes(t.text) && - t.text.toLowerCase().includes(tagSearchQuery.toLowerCase()) + $: filteredAvailableTags = allTags.filter( + (t) => + !selectedTags.includes(t.text) && + t.text.toLowerCase().includes(tagSearchQuery.toLowerCase()), ); // Filter all tags based on search query (both selected and unselected) $: filteredAllTags = allTags.filter((t) => - t.text.toLowerCase().includes(tagSearchQuery.toLowerCase()) + t.text.toLowerCase().includes(tagSearchQuery.toLowerCase()), ); onMount(() => { @@ -216,21 +217,35 @@ aria-label="Open filter options" class:active={tagDropdownOpen} > - - + + - {#if (selectedTags.length + (compactMode ? 1 : 0)) > 0} - {selectedTags.length + (compactMode ? 1 : 0)} + {#if selectedTags.length + (compactMode ? 1 : 0) > 0} + {selectedTags.length + (compactMode ? 1 : 0)} {/if} {#if tagDropdownOpen} +
@@ -267,11 +280,22 @@ {#if tagSearchQuery} {/if} @@ -284,29 +308,41 @@ {/each}
{:else}
- {tagSearchQuery ? "No tags match your search" : "No available tags"} + {tagSearchQuery + ? "No tags match your search" + : "No available tags"}
{/if} @@ -332,11 +368,38 @@ on:click={() => setCompactMode(false)} aria-label="Disable group by brand" > - - - - - + + + + + Group by brand × @@ -421,7 +484,8 @@ x="4" y="13" width="12" - height="2" fill="currentColor" + height="2" + fill="currentColor" /> @@ -551,7 +615,9 @@ align-items: center; gap: 0.3em; opacity: 1; - transition: background 0.2s, color 0.2s; + transition: + background 0.2s, + color 0.2s; } .selected-tag .close { @@ -580,7 +646,10 @@ gap: 0.4em; opacity: 0.8; cursor: pointer; - transition: background 0.2s, color 0.2s, opacity 0.2s; + transition: + background 0.2s, + color 0.2s, + opacity 0.2s; } .compact-indicator:hover { @@ -615,7 +684,10 @@ padding: 0.6em 0.8em; font-size: 0.9em; cursor: pointer; - transition: background 0.2s, color 0.2s, border-color 0.2s; + transition: + background 0.2s, + color 0.2s, + border-color 0.2s; display: flex; align-items: center; justify-content: center; @@ -678,43 +750,6 @@ gap: 0.5rem; } - .filter-option { - display: flex; - align-items: center; - } - - .filter-option-label { - display: flex; - align-items: center; - gap: 0.5rem; - cursor: pointer; - color: var(--color-text); - font-size: 0.9em; - position: relative; - padding: 0.4rem 0; - width: 100%; - } - - .filter-option-label input[type="checkbox"] { - opacity: 0; - position: absolute; - pointer-events: none; - } - - .filter-option-label .checkmark { - opacity: 0; - transition: opacity 0.2s; - } - - .filter-option-label input[type="checkbox"]:checked + .checkmark { - opacity: 1; - } - - .option-text { - margin-left: 0.5rem; - color: var(--color-text); - } - .filter-separator { height: 1px; background: var(--color-border); @@ -763,7 +798,9 @@ align-items: center; justify-content: center; border-radius: 2px; - transition: color 0.2s, background 0.2s; + transition: + color 0.2s, + background 0.2s; } .tags-search-clear:hover { @@ -806,11 +843,6 @@ opacity: 1; } - .filter-tag-item.selected .tag-checkbox { - border-color: var(--color-border); - background: var(--color-card); - } - .tag-icon { width: 16px; height: 16px; @@ -857,39 +889,6 @@ font-style: italic; } - .checkbox-container { - position: relative; - display: flex; - align-items: center; - } - - .checkbox-container input[type="checkbox"] { - position: absolute; - opacity: 0; - width: 16px; - height: 16px; - margin: 0; - } - - .checkmark { - width: 16px; - height: 16px; - display: flex; - align-items: center; - justify-content: center; - margin-right: 0.5rem; - font-size: 14px; - } - - .filter-option label { - display: flex; - align-items: center; - cursor: pointer; - color: var(--color-text); - font-size: 0.9em; - gap: 0; - } - .filter-option-item { background: none; border: none;