{"_id":"r-aspect-ratio","_rev":"2-c54a776416ab1e573927a0f2576c2d42","name":"r-aspect-ratio","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"r-aspect-ratio","version":"1.0.0","description":"A react component for fixed aspect ratio layout in responsive design","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"https://github.com/shadowwalker/react-aspect-ratio"},"author":{"name":"Wei Wang"},"license":"MIT","private":false,"scripts":{"build":"tsc"},"devDependencies":{"@types/react":"^16.8.3","react":"^16.8.2","typescript":"^3.3.3"},"licenseText":"MIT License\n\nCopyright (c) 2019 Wei Wang weiwio@outlook.com https://weiw.io\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"r-aspect-ratio@1.0.0","dist":{"shasum":"49c5fd73b9dda5d0ec84d2322052cb881522ecf8","integrity":"sha512-P4ahm0g3YUPq8R9JBxZMPBzZxyXpsjKkUYxBVo8MWASFtD8C5U7jeqHaAdPPYjzPy6smIDsDOQNZS3YmjUZrRw==","tarball":"https://registry.npmjs.org/r-aspect-ratio/-/r-aspect-ratio-1.0.0.tgz","fileCount":8,"unpackedSize":3512,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfhPrCRA9TVsSAnZWagAA0YwP/17kvjBYKGzSFcI83tR1\n29KY8BmCQGonWohAewEp5k1oLipAAa/HQz2PTRbqJQUMxkcX1gAu/p8XeiWW\nDts6dhlefGGB7tLAtAI7ZLcxTzxq8hfD5WTLmUF53/IKVqyDxgal0Qj53mKE\nOJKhOqmRYwiQl1e2XayRDIu33LAODEvz7ytwWm6V+49F/uhYj2J7yVET2Kzh\nlyIm9UBWsCP8Hntig212MAgddMX4hyNDn9L0CS0VdJtR5GEGIEY7Z0PT0/sa\nfjmO+hJnxUK75UOEGtUJYJifDmZgBqiSuF1vnaIdIvepdTZVGFQXOMXq81FN\nvu3Cx34D6RxHM6GdiEqPkzQPAthyZYtCwZwPAYR68i1wOO5HxDkROHuGGc78\nCOQs5u5kIN38isYHaqHIWuHLLfvzD8W1OjtD8eECuCo6OvdmDBr+YIGF8Skw\nldFNYuEqnmfqPKG7aQSaXJ0xIC+TcnS12EFOe0sq/HsTek6+N2BaziiuKFfL\nUJ/OI1HUHyqz4MRLFLOll/8cyRmBh73PyaIwZLsgcn+QKzcfEMZf1ug1ZVdH\nKICmudzF3cg9I3d24RLK3zQz9jOSZj1uWKy68uBRMgsOHM02rUu8N+gNjSuY\nyyWJqNUi1uMLCZSMWWs1PTbZ8lMmuMIL0vSBh7b7swyv1dFKTfumOwfPQfdF\n5sEl\r\n=Jnqf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAciHWDRWYxyOtPOqgMQk5rjuBUJ6U5/+GzkMkUDXwHzAiEAn/G9hVGxRNOGPzbCRdFRlYHrQMPXk/sx0lXtSi9Qc7s="}]},"maintainers":[{"name":"shadowwalker1117","email":"weiwio@outlook.com"}],"_npmUser":{"name":"shadowwalker1117","email":"weiwio@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/r-aspect-ratio_1.0.0_1551766506756_0.2941846295466817"},"_hasShrinkwrap":false},"1.0.1":{"name":"r-aspect-ratio","version":"1.0.1","description":"A react component for fixed aspect ratio layout in responsive design","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"https://github.com/shadowwalker/react-aspect-ratio"},"author":{"name":"Wei Wang"},"license":"MIT","private":false,"scripts":{"build":"tsc"},"devDependencies":{"@types/react":"^16.8.3","react":"^16.8.2","typescript":"^3.3.3"},"licenseText":"MIT License\n\nCopyright (c) 2019 Wei Wang weiwio@outlook.com https://weiw.io\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"r-aspect-ratio@1.0.1","dist":{"shasum":"d53ccf243599ed824c7ec141208d4a4cc7050144","integrity":"sha512-kH2irzvo1tuHYzxvGu+Uw5awtPosd1JWHgy+E2K+h327wm+XRyWVbYX7uONZL76i4rtDkiqGJAvvBTrbmda2Yw==","tarball":"https://registry.npmjs.org/r-aspect-ratio/-/r-aspect-ratio-1.0.1.tgz","fileCount":8,"unpackedSize":4331,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfhmpCRA9TVsSAnZWagAAeq8P/1mOr2miq2z1GoSeO1iZ\nWDVCV06CUG3pVsK7y16sEstUwREk6Asu9xKdc86LFvnczDqY/7XeUeD8HtH+\nQezrEhkoPhXIq0VS8+4G11d/hi70E23UpEtd0zp+N9/F+B42fhcsC/CM88sL\nYiZ5G3xkzCx2XoS2B0UmzDRa24gbF5Ci2C3lYXJ08IaVxlejnC96vfz9Wh4U\nYoTXDzjoq+I09AKa/7PFabDyyfxZTxG+ziv+de914WQuZ6YOY9tWeit/B57B\nnOcv5JxN9isaIkaG6zVBzWaWPaxioqeLpWSuKb2NOlUbFkSfBIqHNLA+63Br\nanTBY+v2jRom3/ZWo9odmgZc+VWxGoKVGtMgmGsCDUtbVpUAtyrd68ylnGeI\nnBBptWMUUbepWKzMWMvMjeXXNq1R9YC0z8Yr+kOwFe7Ko5j/9ks3lw/ohqUA\nE8X01N+ZrMrVm4NbVi0kFFt4RRxwQz1bJ1nsjUXGofP6qi8fFMWmkPKUjZYO\nOXiP+iReAfvNQb1PvhB7RKPAHi1lAMR++xBXDDy+OWjK6NYPVC7mTETtDIu0\neTp66tjfsR5QYFkQIYu2OhVivb1Y9/MliQL1xaEP9Dv3mgrtbbnqH4LLip0e\ngVGrsA4WuuIpgxWCyLHOa0e9mtkM6V26G6b+P5dpqjNcHuwdVihYyickZZVo\nLmRY\r\n=7CQN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCyUD5pA1+f2wliSPMA+IVQLe3hFd0yWlQGKzUD/o5WgIgRlKRsyOyCYYm7JWwgYZJnyWyjMVkwsrrnyh0796Iip8="}]},"maintainers":[{"name":"shadowwalker1117","email":"weiwio@outlook.com"}],"_npmUser":{"name":"shadowwalker1117","email":"weiwio@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/r-aspect-ratio_1.0.1_1551767976361_0.13374346185945463"},"_hasShrinkwrap":false}},"time":{"created":"2019-03-05T06:15:06.581Z","1.0.0":"2019-03-05T06:15:06.910Z","modified":"2022-05-14T00:04:39.276Z","1.0.1":"2019-03-05T06:39:36.579Z"},"maintainers":[{"name":"shadowwalker1117","email":"weiwio@outlook.com"}],"description":"A react component for fixed aspect ratio layout in responsive design","repository":{"type":"git","url":"https://github.com/shadowwalker/react-aspect-ratio"},"author":{"name":"Wei Wang"},"license":"MIT","readme":"# React Aspect Ratio\n\nA react component for fixed aspect ratio layout in responsive design.\n\n## Usage\n\n### Add to your react app\n\n``` bash\nyarn add r-aspect-ratio\n```\n\n## Example\n\n[![Edit react-aspect-ratio demo](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/74384m5w9j?fontsize=14)\n\n``` typescript\nclass App extends React.Component {\n  render() {\n    return (\n      <div className=\"App\">\n        <AspectRatio width=\"16%\" ratio={1.6} className=\"Box\" />\n        <br />\n        <AspectRatio\n          width=\"32%\"\n          ratio={1}\n          className=\"Box\"\n          minWidth={100}\n          maxWidth={160}\n        />\n      </div>\n    )\n  }\n}\n```\n\n## API\n\n**AspectRatio** Props:\n\n``` typescript\ninterface IProps {\n  ratio: number            // height to width ratio in float\n  width?: number | string  // px or %\n  minWidth?: number        // px\n  maxWidth?: number        // px\n  className?: string       // className pass to root div\n  children?: React.ReactNode\n}\n```\n\n","readmeFilename":"README.md"}