-- Search Widget — standalone, streams its signals
--
-- Run with:
--   dreamstack stream examples/widget-search.ds

let query = ""
let results = ["San Francisco", "San Jose", "San Diego", "Santa Cruz", "Sacramento"]
let filtered = filter(results, (r -> contains(lower(r), lower(query))))

stream search on "ws://localhost:9100" { mode: signal }

view search =
  column [
    text "🔍 Search"
    input "" { bind: query, placeholder: "Type to filter..." }
    for item in filtered ->
      text item
  ]
