{"_id":"@daniel.husar/on-enter-or-space","_rev":"1-935adfd87e1354689287625dbdd70386","name":"@daniel.husar/on-enter-or-space","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@daniel.husar/on-enter-or-space","version":"1.0.0","description":"Execure callback when enter or space is pressed","scripts":{"test":"yarn lint && yarn unit","unit":"jest","lint":"flow --quiet","build":"babel src/index.js --out-file dest/index.js","prepublish":"yarn test && yarn build"},"main":"dest/index.js","author":{"name":"Daniel Husar"},"repository":{"type":"git","url":"git+https://github.com/danielhusar/on-enter-or-space.git"},"keywords":["focus","enter","space","key","pressed"],"license":"MIT","private":false,"devDependencies":{"@babel/cli":"^7.1.5","@babel/core":"^7.1.5","@babel/plugin-proposal-class-properties":"^7.1.0","@babel/plugin-proposal-object-rest-spread":"^7.0.0","@babel/preset-env":"^7.1.5","@babel/preset-flow":"^7.0.0","babel-core":"^7.0.0-bridge","babel-jest":"^23.6.0","flow-bin":"^0.85.0","jest":"^23.6.0","prettier":"1.14.2"},"bugs":{"url":"https://github.com/danielhusar/on-enter-or-space/issues"},"homepage":"https://github.com/danielhusar/on-enter-or-space#readme","gitHead":"b754c5988cfd7d6f4c29ec8d2455b5dc02240fd2","_id":"@daniel.husar/on-enter-or-space@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"efrafa","email":"dano.husar@gmail.com"},"dist":{"integrity":"sha512-QPRhm8NNxSSLN9gNd+QTgCuVJfpdJKn3cYKLW1fqdsMT8nVEGteQ6AO6BRKjss6L1qo6wWlxx4IdAOpmulhXIA==","shasum":"88e37f688edd0f467b30f1f855863905e2022883","tarball":"https://registry.npmjs.org/@daniel.husar/on-enter-or-space/-/on-enter-or-space-1.0.0.tgz","fileCount":3,"unpackedSize":2651,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5f4aCRA9TVsSAnZWagAAhcIQAI2SC411DOhaA+uVvV9v\nq3lHVPf5yB8/Yamnm6h0hE7cDLsGdfERS/eFrCUuLhx2iM0OgudvccPzel8b\nRhoaYbX4A6nJs3Zds2t77Mr34YWSPuLwAaRYqmh9HmBiMIKIxpQ40GTDYnSw\nzwPSwafvSws6FjETbkaH7NePO5kxSaVrgbhpf6tP1bccsnkfYtY1Aezh6D5g\noXb8N9xcmrFJmBzpgS0g4dBuRuEQUF3n2YkkoviTjf64boclLVlUqqqFAvWv\nsO5AzJVqldrPFZBGf6tsVCE46+v4Bfoxveq3BIr3906pmYOrfKf1clQ6Sy6b\nCOTuZ1Db9PNDQBLTXMJu+FqkY9S4hgCie1LpVvfZr7HMAGSSuOQopLnGdytd\n8yeTI4qS5CzhZCmw6zmGkHHJbtUTUcaxg0TgnLg/YTtkGTACcw4tIiIzqmZj\nrsE4jL57AgURxgwZpvQ7D78flCUokmC9YAo5ts4tBXmWrfdY1bdywZ81I7XS\ndnwMWZEEutDq1Opz32e+DrLvOMzfqIcLaW0YVEbwMkhau9/ujjAJtKqe1iT1\npkCHobf8en0CuyI8yfkdxj3aLFIZKoTwAeyK2IA+T0c5AaIbbk0+rM+BsynX\nHcKzEu0ArDpP2Qfc1w8IoxY2BOaSDRC80SP6ZefKyvf2gWa/AD+KKHHJs04/\nBgqS\r\n=L2XG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxHUmF0iWwWlrV4g9wPPPQUACjWryRV7zzvkLuW+/xHgIhAJJiCLKPdlGCnG1vczZMEZMLemG8q5H3iku4s8whxDhy"}]},"maintainers":[{"name":"efrafa","email":"dano.husar@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/on-enter-or-space_1.0.0_1541799450214_0.5511337744584883"},"_hasShrinkwrap":false}},"time":{"created":"2018-11-09T21:37:30.055Z","1.0.0":"2018-11-09T21:37:30.385Z","modified":"2022-04-05T02:40:31.162Z"},"maintainers":[{"name":"efrafa","email":"dano.husar@gmail.com"}],"description":"Execure callback when enter or space is pressed","homepage":"https://github.com/danielhusar/on-enter-or-space#readme","keywords":["focus","enter","space","key","pressed"],"repository":{"type":"git","url":"git+https://github.com/danielhusar/on-enter-or-space.git"},"author":{"name":"Daniel Husar"},"bugs":{"url":"https://github.com/danielhusar/on-enter-or-space/issues"},"license":"MIT","readme":"# on-enter-or-space\n\n > Execute function for enter and space keyboard events. This is usefull if you want to make your app accessible, and you want to add keyboard navigation to the components that have onClick handlers.\n\n## Install\n\nUsing npm\n```sh\nnpm install @daniel.husar/on-enter-or-space\n```\n\nUsing yarn\n```sh\nyarn add @daniel.husar/on-enter-or-space\n```\n\n## Usage with react\n\nFirst time you call `onEnterOrSpace(callback)` it will return another function, that accepts event object. If the event object was enter or space, it will call the `callback` with event object as parameter.\n\n```jsx\nimport onEnterOrSpace from '@daniel.husar/on-enter-or-space';\nconst component = (props) => {\n  return <span onClick={props.handleOnClick} onKeyDown={onEnterOrSpace(props.handleOnClick)} />;\n};\n```\n\n### API\n\n#### callback\n\nType: `Function`\n\nDefault: `undefined`\n\nRequired: `true`\n\nFunction you want to execute when enter or space event was passed in.\n\n## License\n\nMIT © [Daniel Husar](https://github.com/danielhusar)\n","readmeFilename":"readme.md"}