Skip to content

Commit ef77ff4

Browse files
committed
refactor: use radio button
1 parent 750294a commit ef77ff4

1 file changed

Lines changed: 9 additions & 15 deletions

File tree

app/components/Filter/Panel.vue

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -217,26 +217,20 @@ const hasActiveFilters = computed(() => !!filterSummary.value)
217217
</label>
218218
<!-- Search scope toggle -->
219219
<div
220-
class="inline-flex rounded-md border border-border p-0.5 bg-bg"
221-
role="group"
222-
:aria-label="$t('filters.search_scope')"
220+
class="flex flex-wrap gap-2"
221+
role="radiogroup"
222+
:aria-label="$t('filters.weekly_downloads')"
223223
>
224-
<button
224+
<TagRadioButton
225225
v-for="scope in SEARCH_SCOPE_VALUES"
226226
:key="scope"
227-
type="button"
228-
class="px-2 py-0.5 text-xs font-mono rounded-sm transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-fg focus-visible:ring-offset-1"
229-
:class="
230-
filters.searchScope === scope
231-
? 'bg-bg-muted text-fg'
232-
: 'text-fg-muted hover:text-fg'
233-
"
234-
:aria-pressed="filters.searchScope === scope"
235-
:title="getScopeDescriptionKey(scope)"
236-
@click="emit('update:searchScope', scope)"
227+
:model-value="filters.searchScope"
228+
:value="scope"
229+
name="searchScope"
230+
@update:modelValue="emit('update:searchScope', scope)"
237231
>
238232
{{ getScopeLabelKey(scope) }}
239-
</button>
233+
</TagRadioButton>
240234
</div>
241235
</div>
242236
<InputBase

0 commit comments

Comments
 (0)