keystra 0.0.0-stage → 0.1.1

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 (52) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/LICENSE +21 -0
  3. package/README.md +78 -2
  4. package/dist/chunk-2BLQUBG7.js +816 -0
  5. package/dist/chunk-77GGU3AX.js +135 -0
  6. package/dist/chunk-KDOJARJD.js +29 -0
  7. package/dist/chunk-LYYUOTBP.js +125 -0
  8. package/dist/chunk-S5YVXIMA.js +61 -0
  9. package/dist/chunk-SSIKGDD4.js +255 -0
  10. package/dist/chunk-U7YK6PPT.js +1729 -0
  11. package/dist/chunk-XFNYIPOW.js +253 -0
  12. package/dist/chunk-ZOJRXXQN.js +308 -0
  13. package/dist/core.cjs +2861 -0
  14. package/dist/core.d.cts +41 -0
  15. package/dist/core.d.ts +41 -0
  16. package/dist/core.js +7 -0
  17. package/dist/engine-COPfXXTp.d.ts +229 -0
  18. package/dist/engine-DcbkGRgz.d.cts +229 -0
  19. package/dist/focus.cjs +374 -0
  20. package/dist/focus.d.cts +74 -0
  21. package/dist/focus.d.ts +74 -0
  22. package/dist/focus.js +2 -0
  23. package/dist/index-IZkcWAXP.d.cts +395 -0
  24. package/dist/index-IZkcWAXP.d.ts +395 -0
  25. package/dist/index.cjs +3745 -0
  26. package/dist/index.d.cts +9 -0
  27. package/dist/index.d.ts +9 -0
  28. package/dist/index.global.js +1 -0
  29. package/dist/index.js +9 -0
  30. package/dist/layout-C2-n8aUI.d.ts +17 -0
  31. package/dist/layout-CBzD-87D.d.cts +17 -0
  32. package/dist/navigation.cjs +293 -0
  33. package/dist/navigation.d.cts +33 -0
  34. package/dist/navigation.d.ts +33 -0
  35. package/dist/navigation.js +2 -0
  36. package/dist/patterns.cjs +3505 -0
  37. package/dist/patterns.d.cts +12 -0
  38. package/dist/patterns.d.ts +12 -0
  39. package/dist/patterns.js +7 -0
  40. package/dist/roving-focus-CT7Dm6di.d.ts +63 -0
  41. package/dist/roving-focus-ZQ0v7hLe.d.cts +63 -0
  42. package/dist/selection.cjs +266 -0
  43. package/dist/selection.d.cts +43 -0
  44. package/dist/selection.d.ts +43 -0
  45. package/dist/selection.js +2 -0
  46. package/dist/utils-CkveVeIJ.d.cts +18 -0
  47. package/dist/utils-JmPZTlys.d.ts +18 -0
  48. package/dist/utils.cjs +195 -0
  49. package/dist/utils.d.cts +3 -0
  50. package/dist/utils.d.ts +3 -0
  51. package/dist/utils.js +2 -0
  52. package/package.json +147 -4
package/CHANGELOG.md ADDED
@@ -0,0 +1,27 @@
1
+ # Changelog
2
+
3
+ This project follows [Semantic Versioning](https://semver.org/).
4
+
5
+ ## [0.1.1] — 2026-11-02
6
+
7
+ - Shorter README, with a demo GIF and full guides in `docs/`.
8
+
9
+ ## [0.1.0] — 2026-11-02
10
+
11
+ First release.
12
+
13
+ - `createKeystra()` engine: key normalization and matching, modifier chords,
14
+ multi-key sequences, custom key maps and event delegation.
15
+ - Navigation modes: sequential, vertical, horizontal, grid, directional and
16
+ custom strategies, with looping and disabled and hidden item skipping.
17
+ - Focus management: roving tabindex, `aria-activedescendant`, focus restoration
18
+ and nested groups.
19
+ - Selection: single, multiple and range modes, independent of styling.
20
+ - Patterns: `createTabs`, `createMenu`, `createDropdown`, `createList`,
21
+ `createGrid`, `createTree`, `createCommandPalette` and `createRovingFocus`.
22
+ - `createKeyBinding()` for document-level shortcuts, and `useKeystra()` for
23
+ elements that do not exist yet.
24
+ - Dynamic DOM support through `refresh()`, explicit registration and optional
25
+ mutation observation.
26
+ - ESM, CommonJS and script-tag builds, TypeScript declarations and deep imports
27
+ such as `keystra/patterns`. No runtime dependencies.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Zahid Hasan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,79 @@
1
- # Temporary Holding Version
1
+ # Keystra
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Keyboard navigation, focus and selection for any DOM UI.
4
+
5
+ - Works with vanilla JS, TypeScript and any DOM-based framework.
6
+ - Arrow keys, Home/End, typeahead, shortcuts and key sequences.
7
+ - Roving tabindex, focus restore, and single, multiple or range selection.
8
+ - Ready-made tabs, menus, dropdowns, lists, grids, trees and command palettes.
9
+ - Skips disabled and hidden items, and keeps up with DOM changes.
10
+ - No dependencies, and no UI or styling of its own.
11
+
12
+ ![Keystra demo: tabs, a dropdown, a list, a grid, a tree and a command palette, all driven from the keyboard](https://raw.githubusercontent.com/zahidhasann88/keystra/main/docs/demo.gif)
13
+
14
+ ## Install
15
+
16
+ ```bash
17
+ npm i keystra
18
+ ```
19
+
20
+ ## Quick start
21
+
22
+ ```html
23
+ <div id="actions" aria-label="Actions">
24
+ <button data-keystra-item>Copy</button>
25
+ <button data-keystra-item>Move</button>
26
+ <button data-keystra-item disabled>Delete</button>
27
+ </div>
28
+ ```
29
+
30
+ ```ts
31
+ import { createKeystra } from 'keystra';
32
+
33
+ const nav = createKeystra({
34
+ container: '#actions',
35
+ loop: true,
36
+ onSelect: (element) => console.log('activate', element),
37
+ });
38
+
39
+ nav.focusFirst();
40
+
41
+ // When the UI is removed:
42
+ nav.destroy();
43
+ ```
44
+
45
+ Arrow keys now move through the buttons and skip the disabled one, Tab leaves the group in one stop, and Enter calls `onSelect`.
46
+
47
+ ## Patterns
48
+
49
+ ```ts
50
+ import { createTabs } from 'keystra';
51
+
52
+ const tabs = createTabs({
53
+ container: '#tabs',
54
+ items: '[role="tab"]',
55
+ panels: '[role="tabpanel"]',
56
+ });
57
+ ```
58
+
59
+ Also available: `createMenu`, `createDropdown`, `createList`, `createGrid`, `createTree`, `createCommandPalette` and `createRovingFocus`. See [Patterns](docs/patterns.md).
60
+
61
+ ## Shortcuts
62
+
63
+ ```ts
64
+ import { createKeyBinding } from 'keystra';
65
+
66
+ const palette = createKeyBinding('Ctrl+K', () => openPalette());
67
+ ```
68
+
69
+ ## Docs
70
+
71
+ - [API](docs/api.md): options, methods, keys, selection and lifecycle.
72
+ - [Patterns](docs/patterns.md): each ready-made widget.
73
+ - [Frameworks](docs/frameworks.md): React, Vue, Svelte and Angular.
74
+ - [Accessibility](docs/accessibility.md): what Keystra does and what stays yours, plus browser support.
75
+ - [Performance](docs/performance.md): bundle size and large lists.
76
+
77
+ ## License
78
+
79
+ MIT