@nick-skriabin/glyph 0.1.42 → 0.1.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +40 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -40,8 +40,8 @@ Build real terminal applications with React. Glyph provides a full component mod
40
40
  | | |
41
41
  |---|---|
42
42
  | **Flexbox Layout** | Full CSS-like flexbox via Yoga — rows, columns, wrapping, alignment, gaps, padding |
43
- | **Rich Components** | Box, Text, Input, Button, Checkbox, Radio, Select, ScrollView, List, Menu, Progress, Spinner, Toasts, Dialogs, Portal |
44
- | **Focus System** | Tab navigation, focus scopes, focus trapping for modals |
43
+ | **Rich Components** | Box, Text, Input, Button, Checkbox, Radio, Select, ScrollView, List, Menu, Progress, Spinner, Toasts, Dialogs, Portal, JumpNav |
44
+ | **Focus System** | Tab navigation, focus scopes, focus trapping for modals, JumpNav quick-jump hints |
45
45
  | **Keyboard Input** | `useInput` hook, declarative `<Keybind>` component, vim-style bindings |
46
46
  | **Smart Rendering** | Double-buffered framebuffer with character-level diffing &mdash; only changed cells are written |
47
47
  | **True Colors** | Named colors, hex, RGB, 256-palette. Auto-contrast text on colored backgrounds |
@@ -337,6 +337,44 @@ Renders children in a fullscreen absolute overlay. Useful for modals and dialogs
337
337
  </Portal>
338
338
  ```
339
339
 
340
+ ### `<JumpNav>`
341
+
342
+ Quick keyboard navigation to any focusable element. Press an activation key to show hint labels on all focusable elements, then type the hint to jump directly to that element. Similar to Vim's EasyMotion or browser extensions like Vimium.
343
+
344
+ ```tsx
345
+ function App() {
346
+ return (
347
+ <JumpNav activationKey="ctrl+o">
348
+ <Box style={{ flexDirection: "column", gap: 1 }}>
349
+ <Input placeholder="Name" />
350
+ <Input placeholder="Email" />
351
+ <Select items={countries} />
352
+ <Button onPress={submit}>Submit</Button>
353
+ </Box>
354
+ </JumpNav>
355
+ );
356
+ }
357
+ ```
358
+
359
+ **How it works:**
360
+ 1. Press `Ctrl+O` (or custom `activationKey`) to activate
361
+ 2. Hint labels (a, s, d, f...) appear next to each focusable element
362
+ 3. Type a hint to instantly focus that element
363
+ 4. Press `Escape` to cancel
364
+
365
+ **Props:**
366
+
367
+ | Prop | Type | Default | Description |
368
+ |------|------|---------|-------------|
369
+ | `activationKey` | `string` | `"ctrl+o"` | Key to activate jump mode |
370
+ | `hintChars` | `string` | `"asdfghjkl..."` | Characters used for hints |
371
+ | `hintBg` | `Color` | `"yellow"` | Hint label background |
372
+ | `hintFg` | `Color` | `"black"` | Hint label text color |
373
+ | `hintStyle` | `Style` | `{}` | Additional hint label styling |
374
+ | `enabled` | `boolean` | `true` | Enable/disable JumpNav |
375
+
376
+ **Focus scope aware:** JumpNav automatically respects `<FocusScope trap>`. When a modal with a focus trap is open, only elements inside that trap will show hints.
377
+
340
378
  ### `<Keybind>`
341
379
 
342
380
  Declarative keyboard shortcut. Renders nothing.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nick-skriabin/glyph",
3
- "version": "0.1.42",
3
+ "version": "0.1.43",
4
4
  "description": "A React renderer for terminal UIs with flexbox layout",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",