SEV-392: reusable fuzzy combobox component (+fuzzysort) v0.4.0

comboboxData(config) Alpine factory: typeable input + fuzzysort-ranked
dropdown (prefix/substring/abbreviation subsequence matching), keyboard
nav (Arrow/Enter/Escape/Tab), a11y roles, x-modelable value binding.
allowFree (default) accepts off-list typed values so classics/kit cars are
never blocked; allowFree:false for closed lists (US states) snaps back to a
valid option on blur. Foundation for replacing native <select> chrome with
inputs that match our text fields. 17/17 tests pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Bastian de Byl
2026-06-10 19:06:38 -04:00
parent b7abf51087
commit a676a3e99a
6 changed files with 301 additions and 4 deletions
+7 -3
View File
@@ -1,13 +1,14 @@
{
"name": "@switchev/web-shared",
"version": "0.3.0",
"description": "Shared browser helpers (formatters, markdown, image polling) for the SwitchEV frontends",
"version": "0.4.0",
"description": "Shared browser helpers (formatters, markdown, image polling, combobox) for the SwitchEV frontends",
"type": "module",
"exports": {
".": "./src/index.js",
"./format": "./src/format.js",
"./markdown": "./src/markdown.js",
"./wait-image": "./src/wait-image.js"
"./wait-image": "./src/wait-image.js",
"./combobox": "./src/combobox.js"
},
"files": [
"src"
@@ -15,6 +16,9 @@
"sideEffects": [
"./src/markdown.js"
],
"dependencies": {
"fuzzysort": "^3.1.0"
},
"peerDependencies": {
"dompurify": ">=3",
"marked": ">=12"