PdfSearchBar
Inline search field that morphs into the place of PdfViewerTopBar while the user is searching the document. Mirrors the handoff's "Topbar → search transition" behaviour: same height as the parent topbar, white background, divider underneath, focus-on-mount, with prev / next / close affordances and a live match counter.
Drive it from the host: own a query: String and activeIndex: Int, compute matches via searchPdfText, pass them to PdfViewer's searchHighlights parameter, and update activeIndex on onPrevious / onNext. Closing the bar (back arrow tap or IME Done) should clear the query and dismiss the search state on the host side via onClose.
Parameters
current search string.
called whenever the user edits the input.
total number of matches across the document.
zero-based index of the currently focused match inside the match list. -1 when nothing is active (empty query or no matches).
previous-match tap. Should set activeIndex to (activeIndex - 1 + matchCount) % matchCount.
next-match tap. Should set activeIndex to (activeIndex + 1) % matchCount.
close-the-bar tap. Should reset query to "" and dismiss the search state on the host so PdfViewerTopBar returns.
applied to the outer container.
prompt rendered while the input is empty.