987ff560f5
Import initial monorepo structure for Nebula Core: add packages (@nebula/core, core-glyphs, core-input, core-navigation, core-theme, core-ui, core-utils) with source, dist, tests and assets. Expand README with overview, quick start and API snippets, and add package-level documentation files. Add jsconfig.json for path mapping, package.json and lockfiles to bootstrap the repo. This commit sets up the project layout, docs, and local package links for further development.
21 lines
668 B
Markdown
21 lines
668 B
Markdown
# @nebula/core-navigation
|
|
|
|
Focus management and spatial navigation primitives for controller-first UIs.
|
|
|
|
## What it does
|
|
|
|
- Calculates spatial relationships between focusable rectangles.
|
|
- Filters candidates by direction (up/down/left/right).
|
|
- Picks the best next focus target using a weighted distance heuristic.
|
|
|
|
## Key concepts
|
|
|
|
- **Rect**: A focusable element described by `x`, `y`, `width`, `height`, and `id`.
|
|
- **Direction**: The requested movement direction (up/down/left/right).
|
|
|
|
## Typical use cases
|
|
|
|
- D-pad or stick navigation across grids and lists.
|
|
- Consistent focus movement in TV or handheld UIs.
|
|
- Simple focus logic without a framework dependency.
|