Skip to content

feat(ui): reusable Dropdown component and generic TextInput#48

Merged
viralcodex merged 1 commit into
mainfrom
reusable-dropdown
Jul 7, 2026
Merged

feat(ui): reusable Dropdown component and generic TextInput#48
viralcodex merged 1 commit into
mainfrom
reusable-dropdown

Conversation

@viralcodex

Copy link
Copy Markdown
Owner

Summary

  • Adds a Dropdown<T> primitive that owns option list rendering, open/close state, hover/focus highlighting, and keyboard nav (up/down/j/k, return to select, esc/tab to close).
  • The dropdown option list applies flexDirection via contentOptions so the internal scrollbox viewport lays out correctly and the vertical scrollbar sits alongside the items (previously misplaced when set on the scrollbox root).
  • Generalizes TextInput to TextInput<T> so callers can bind numeric values without stringifying, adds spacing prop knobs, and tidies label padding.
  • Re-exports Dropdown / DropdownOption from components/ui/index.ts.

Foundation for the upcoming Page Numbers feature.

Test plan

  • bun run typecheck
  • bun test (107/107 pass)
  • Manual: mount a dropdown, verify open list has scrollbar alongside items, arrow/j/k navigation, return selects, esc/tab closes.

Introduces a Dropdown primitive that owns option list rendering,
open/close, hover/focus highlighting, and keyboard navigation
(up/down/j/k, return to select, escape/tab to close). The
scrollable option list uses contentOptions for flexDirection so
the internal viewport lays out correctly and the scrollbar sits
alongside the items.

Generalizes TextInput's value/onInput over T so callers can pass
strings or numeric values without casting, adds spacing knobs the
new page-numbers UI needs, and drops the extra label padding that
made stacked inputs look uneven.
@viralcodex viralcodex mentioned this pull request Jul 7, 2026
4 tasks
@viralcodex viralcodex merged commit a28945d into main Jul 7, 2026
1 check passed
@viralcodex viralcodex deleted the reusable-dropdown branch July 7, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant