{"id":24133236,"url":"https://github.com/polymerelements/iron-a11y-keys-behavior","last_synced_at":"2025-04-06T01:08:31.767Z","repository":{"id":31553374,"uuid":"35118041","full_name":"PolymerElements/iron-a11y-keys-behavior","owner":"PolymerElements","description":"A behavior that enables keybindings for greater a11y","archived":false,"fork":false,"pushed_at":"2023-10-16T14:02:49.000Z","size":1860,"stargazers_count":24,"open_issues_count":17,"forks_count":41,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-05-09T10:09:32.790Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PolymerElements.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-05T18:53:47.000Z","updated_at":"2024-06-18T13:42:21.982Z","dependencies_parsed_at":"2024-06-18T13:42:11.054Z","dependency_job_id":"d0f53a18-91fd-4fd4-b2e4-8776834667d3","html_url":"https://github.com/PolymerElements/iron-a11y-keys-behavior","commit_stats":{"total_commits":152,"total_committers":32,"mean_commits":4.75,"dds":0.7960526315789473,"last_synced_commit":"ebfffaf7bd630ba43b7cff143d5c25d5e55e14bd"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-a11y-keys-behavior","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-a11y-keys-behavior/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-a11y-keys-behavior/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-a11y-keys-behavior/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PolymerElements","download_url":"https://codeload.github.com/PolymerElements/iron-a11y-keys-behavior/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247419860,"owners_count":20936012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-11T23:22:09.587Z","updated_at":"2025-04-06T01:08:31.750Z","avatar_url":"https://github.com/PolymerElements.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Published on NPM](https://img.shields.io/npm/v/@polymer/iron-a11y-keys-behavior.svg)](https://www.npmjs.com/package/@polymer/iron-a11y-keys-behavior)\n[![Build status](https://travis-ci.org/PolymerElements/iron-a11y-keys-behavior.svg?branch=master)](https://travis-ci.org/PolymerElements/iron-a11y-keys-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://webcomponents.org/element/@polymer/iron-a11y-keys-behavior)\n\n## \u0026lt;iron-a11y-keys-behavior\u0026gt;\n`Polymer.IronA11yKeysBehavior` provides a normalized interface for processing\nkeyboard commands that pertain to [WAI-ARIA best practices](http://www.w3.org/TR/wai-aria-practices/#kbd_general_binding).\nThe element takes care of browser differences with respect to Keyboard events\nand uses an expressive syntax to filter key presses.\n\nSee: [Documentation](https://www.webcomponents.org/element/@polymer/iron-a11y-keys-behavior),\n  [Demo](https://www.webcomponents.org/element/@polymer/iron-a11y-keys-behavior/demo/demo/index.html).\n\n## Usage\n\n### Installation\n```\nnpm install --save @polymer/iron-a11y-keys-behavior\n```\n\n### In a Polymer 3 element\n```js\nimport {PolymerElement, html} from '@polymer/polymer';\nimport {mixinBehaviors} from '@polymer/polymer/lib/legacy/class.js';\nimport {IronA11yKeysBehavior} from '@polymer/iron-a11y-keys-behavior/iron-a11y-keys-behavior.js';\n\nclass SampleElement extends  extends mixinBehaviors([IronA11yKeysBehavior], PolymerElement) {\n  static get template() {\n    return html`\n      \u003cpre\u003e[[pressed]]\u003c/pre\u003e\n    `;\n  }\n\n  static get properties() {\n    return {\n      pressed: {type: String, readOnly: true, value: ''},\n      keyBindings: {\n        'space': '_onKeydown', // same as 'space:keydown'\n        'shift+tab': '_onKeydown',\n        'enter:keypress': '_onKeypress',\n        'esc:keyup': '_onKeyup'\n      }\n    }\n  }\n\n  function _onKeydown: function(event) {\n    console.log(event.detail.combo); // KEY+MODIFIER, e.g. \"shift+tab\"\n    console.log(event.detail.key); // KEY only, e.g. \"tab\"\n    console.log(event.detail.event); // EVENT, e.g. \"keydown\"\n    console.log(event.detail.keyboardEvent); // the original KeyboardEvent\n  }\n}\ncustomElements.define('sample-element', SampleElement);\n```\n\n## Contributing\nIf you want to send a PR to this element, here are\nthe instructions for running the tests and demo locally:\n\n### Installation\n```sh\ngit clone https://github.com/PolymerElements/iron-a11y-keys-behavior\ncd iron-a11y-keys-behavior\nnpm install\nnpm install -g polymer-cli\n```\n\n### Running the demo locally\n```sh\npolymer serve --npm\nopen http://127.0.0.1:\u003cport\u003e/demo/\n```\n\n### Running the tests\n```sh\npolymer test --npm\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymerelements%2Firon-a11y-keys-behavior","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolymerelements%2Firon-a11y-keys-behavior","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymerelements%2Firon-a11y-keys-behavior/lists"}