├── .babelrc ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── package.json ├── rollup.config.js ├── src ├── RovingTabindex.js ├── RovingTabindexContainer.js ├── constants.js └── index.js └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [["@babel/env", { "modules": false }]] 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 | 8 | ## [Unreleased] 9 | 10 | [2.0.0]: Update to Vue 3. 11 | 12 | ## [1.2.1] - 2021-03-24 13 | 14 | ### Changed 15 | 16 | - Updated Rollup and babel 17 | 18 | ## [1.2.0] - 2019-12-13 19 | 20 | ### Changed 21 | 22 | - Use rollup to create a transpiled bundle 23 | 24 | ## 1.1.0 - 2019-11-05 25 | 26 | ### Added 27 | 28 | - Initial release! 29 | 30 | [unreleased]: https://github.com/fork/vue-roving-tabindex/compare/v1.2.0...HEAD 31 | [1.2.0]: https://github.com/fork/vue-roving-tabindex/compare/v1.1.0...v1.2.0 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Fork Unstable Media GmbH 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. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # `@4rk/vue-roving-tabindex` 2 | 3 | Add a roving tabindex to a Vue component. This is useful to implement keyboard navigation inside components according to [WAI-ARIA](https://www.w3.org/TR/wai-aria-practices/#kbd_general_within). 4 | 5 | ## Installation 6 | 7 | ```javascript 8 | import VueRovingTabindex from "@4rk/vue-roving-tabindex"; 9 | 10 | app.use(VueRovingTabindex); 11 | ``` 12 | 13 | ## Usage 14 | 15 | ```vue 16 | 23 | ``` 24 | 25 | ## Directive API 26 | 27 | The package provides two Vue directives: 28 | 29 | ### v-roving-tabindex-container 30 | 31 | This directive denotes the boundary of a roving tabindex sequence. Add it to a parent element of the `v-roving-tabindex` elements. 32 | 33 | It has a single boolean modifier to change the direction from vertical to horizontal: 34 | 35 | ```vue 36 |
37 | ``` 38 | 39 | ### v-roving-tabindex 40 | 41 | This directive should be used on every focussable element inside a `v-roving-tabindex-container` that is part of the roving tabindex. 42 | 43 | Its value can be set to `false` to remove the element from the roving tabindex: 44 | 45 | ```vue 46 |