@@ -122,6 +122,9 @@ async function toggleGroup(groupKey: string) {
122122const versionFilterInput = ref (' ' )
123123const versionFilter = refDebounced (versionFilterInput , 100 )
124124const isFilterActive = computed (() => versionFilter .value .trim () !== ' ' )
125+ const isInvalidRange = computed (
126+ () => isFilterActive .value && validRange (versionFilter .value .trim ()) === null ,
127+ )
125128
126129const filteredVersionSet = computed (() => {
127130 const trimmed = versionFilter .value .trim ()
@@ -198,14 +201,40 @@ const flatItems = computed<FlatItem[]>(() => {
198201 <span class =" text-fg-subtle shrink-0" >/</span >
199202 <h1 class =" text-sm text-fg-muted shrink-0" >{{ $t('package.versions.page_title') }}</h1 >
200203 </div >
201- <InputBase
202- v-model =" versionFilterInput"
203- type =" text"
204- :placeholder =" $t('package.versions.version_filter_placeholder')"
205- :aria-label =" $t('package.versions.version_filter_label')"
206- size =" sm"
207- class =" w-36 sm:w-44"
208- />
204+ <div class =" relative" >
205+ <InputBase
206+ v-model =" versionFilterInput"
207+ type =" text"
208+ :placeholder =" $t('package.versions.version_filter_placeholder')"
209+ :aria-label =" $t('package.versions.version_filter_label')"
210+ :aria-invalid =" isInvalidRange ? 'true' : undefined"
211+ :aria-describedby =" isInvalidRange ? 'version-filter-error' : undefined"
212+ autocomplete =" off"
213+ size =" small"
214+ class =" w-36 sm:w-44"
215+ :class =" isInvalidRange ? 'pe-7 !border-red-500' : ''"
216+ />
217+ <Transition
218+ enter-active-class =" transition-all duration-150"
219+ enter-from-class =" opacity-0 scale-60"
220+ leave-active-class =" transition-all duration-150"
221+ leave-to-class =" opacity-0 scale-60"
222+ >
223+ <TooltipApp
224+ v-if =" isInvalidRange"
225+ :text =" $t('package.versions.filter_invalid')"
226+ position =" bottom"
227+ class =" absolute end-0 inset-y-0 flex items-center pe-2"
228+ >
229+ <span
230+ id =" version-filter-error"
231+ class =" i-lucide:circle-alert w-3.5 h-3.5 text-red-500 block"
232+ role =" img"
233+ :aria-label =" $t('package.versions.filter_invalid')"
234+ />
235+ </TooltipApp >
236+ </Transition >
237+ </div >
209238 </div >
210239 </header >
211240
0 commit comments