{"_id":"elt-react-credit-cards","_rev":"6-3a93f6ceeceb0d84fa2163fe92c3efe2","name":"elt-react-credit-cards","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"elt-react-credit-cards","version":"0.0.1","description":"Beautiful credit cards for your payment forms","author":{"name":"AMARO Fashion","email":"tech@amaro.com"},"contributors":[{"name":"Cassio Cardoso","email":"cassio.cardoso@amaro.com"},{"name":"Gil Barbara","email":"gil.barbara@amaro.com"}],"repository":{"type":"git","url":"git+https://github.com/amarofashion/react-credit-cards.git"},"bugs":{"url":"https://github.com/amarofashion/react-credit-cards/issues"},"homepage":"https://github.com/amarofashion/react-credit-cards#readme","license":"MIT","main":"lib/index.js","module":"es/index.js","keywords":["react","react-component","credit card","payment"],"peerDependencies":{"react":"^15.0.0 || ^16.0.0 || ^17.0.2","prop-types":"^15.7.2"},"dependencies":{"payment":"^2.3.0"},"devDependencies":{"@babel/cli":"^7.10.1","@babel/core":"^7.10.2","@babel/plugin-proposal-class-properties":"^7.10.1","@babel/plugin-proposal-decorators":"^7.10.1","@babel/plugin-proposal-do-expressions":"^7.10.1","@babel/plugin-proposal-export-default-from":"^7.10.1","@babel/plugin-proposal-export-namespace-from":"^7.10.1","@babel/plugin-proposal-function-sent":"^7.10.1","@babel/plugin-proposal-json-strings":"^7.10.1","@babel/plugin-proposal-logical-assignment-operators":"^7.10.1","@babel/plugin-proposal-nullish-coalescing-operator":"^7.10.1","@babel/plugin-proposal-numeric-separator":"^7.10.1","@babel/plugin-proposal-optional-chaining":"^7.10.1","@babel/plugin-proposal-pipeline-operator":"^7.10.1","@babel/plugin-proposal-throw-expressions":"^7.10.1","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-syntax-import-meta":"^7.10.1","@babel/plugin-transform-flow-strip-types":"^7.10.1","@babel/plugin-transform-object-assign":"^7.10.1","@babel/preset-env":"^7.10.2","@babel/preset-flow":"^7.10.1","@babel/preset-react":"^7.10.1","@size-limit/preset-small-lib":"^4.5.0","autoprefixer":"^9.8.0","babel-core":"^7.0.0-bridge.0","babel-eslint":"^10.1.0","babel-jest":"^26.0.1","babel-plugin-array-includes":"^2.0.3","cross-env":"^7.0.2","date-fns":"^2.14.0","del-cli":"^3.0.1","enzyme":"^3.11.0","enzyme-adapter-react-16":"^1.15.2","eslint":"^6.8.0","eslint-config-airbnb":"^18.1.0","eslint-plugin-babel":"^5.3.0","eslint-plugin-flowtype":"^4.7.0","eslint-plugin-import":"^2.20.2","eslint-plugin-jsx-a11y":"^6.2.3","eslint-plugin-react":"^7.20.0","flow-bin":"^0.126.1","husky":"^4.2.5","jest":"^26.0.1","jsdom":"^16.2.2","node-sass":"^4.14.1","postcss":"^7.0.32","postcss-cli":"^7.1.1","prop-types":"^15.7.2","react":"^16.13.1","react-dom":"^16.13.1","repo-tools":"^0.2.0","size-limit":"^4.5.0","stylelint":"^13.6.0","stylelint-config-standard":"^20.0.0","stylelint-declaration-strict-value":"^1.5.0","stylelint-order":"^4.1.0","stylelint-scss":"^3.17.2","watch-run":"^1.2.5"},"scripts":{"build":"npm run clean && npm run build:commonjs && npm run build:es && npm run build:styles","build:commonjs":"cross-env BABEL_ENV=commonjs babel src -d lib","build:es":"cross-env NODE_ENV=production babel src -d es","build:styles":" node tools/build-styles","watch":"npm run build && watch-run -p 'src/**/*.js' npm run build:es","clean":"del-cli es/* && del-cli lib/*","lint":"eslint  --ext .js --ext .jsx src test tools","lint:styles":"stylelint 'src/**/*.scss'","test":"jest","test:coverage":"jest --bail --coverage","test:watch":"jest --watch","size":"npm run build && size-limit","validate":"npm run lint && npm run lint:styles && npm run test:coverage && npm run size","prepublishOnly":"npm run validate"},"browserslist":["> 0.2%","not dead"],"size-limit":[{"path":"./es/index.js","limit":"6 kB"},{"path":"./lib/index.js","limit":"6 kB"}],"husky":{"hooks":{"post-merge":"repo-tools install-packages","pre-commit":"repo-tools check-remote && npm run validate"}},"gitHead":"cff6ce217926ec2073dadc6e16ffa16a9aaa2e24","_id":"elt-react-credit-cards@0.0.1","_nodeVersion":"14.17.4","_npmVersion":"7.24.0","dist":{"integrity":"sha512-/piqxKPQS41WDqITSVwgF+lU48ktk2G/P7Yo5xjnEWsCnzPXWUI3LS628OvFxX0Jk6XVsx6lbjScj8QWPrBACA==","shasum":"5704d442b64c44cf734cded9ba90d980c05c295e","tarball":"https://registry.npmjs.org/elt-react-credit-cards/-/elt-react-credit-cards-0.0.1.tgz","fileCount":11,"unpackedSize":474017,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2pfsCRA9TVsSAnZWagAA2zUP/2a1TYhVLcJEDpUua0rr\najDNeX3VZUU2zn3TDQqAA1qlDeGW3K+3Fhg/NR4yLxqW3AhEjQa2Aq3SSYvc\nf9UZquGE4sFDl8c6cJjt9w5PhwOsPho9pSYqEYCnRgH93GHU4XDrsvHyoZB8\nzznpbakyGY9+kcpx95HOy+qKSgcR3tum6WkDgCmkjeFCl1yO6AcdNWVbT3tV\nN5g+UAsbLQVv3rz0HRCDGsIMO+AWqYgobH4WA6Jk5d0c+o5RndYf0c9pBLKb\nenrtItKeqsAUjYLiDPyKquuZQmc4OejAnzA5IkIjaw6IO0b68IZm2NU5Ouui\nw3VEryydijnBHtNkZNYE+yhYXBCwJOoXyODySCQ6jh+/vyfCCrVYqHWlXnvZ\noM1eiIiS64DpKw1NUmHrW6zLIFtxOnnZfHMbGcDDWK4cOoFG6XrFpcnp+9fc\nk7cVARz9BwMURiUD34jXIXLt7HiUal4QUQ9X1PjjU+Sg1NqrjFgWRZ+/Xjlh\np/5Nhlmv9+HhKJYMW1/yqWMWqgRVMoTW0RjxyTdWxaaGguvfBWbLCDt0DPow\neXs7EDltsGdef3rWsm/gqd/TkI14/EME0LAp6mqqihjJrh+vcvEX2c+/So/R\nTbKNVHpOBWLBb4odssCthfdneBbrmJ4Oyn5yOKezWns4/23pL9JnV5a0vedw\nmb0a\r\n=lbsm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlrNkSBvS05sW/z8CzA/tfN80zR53NDQTaTdv95+vcdgIgY7eu22hheE35LSeaT1jDdliEQ4aSIlDRvO+4kFNu4Yo="}]},"_npmUser":{"name":"eleadertech","email":"rdelgado@eleadertech.com"},"directories":{},"maintainers":[{"name":"eleadertech","email":"rdelgado@eleadertech.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/elt-react-credit-cards_0.0.1_1636141923180_0.09485771624205608"},"_hasShrinkwrap":false}},"time":{"created":"2021-11-05T19:52:03.141Z","0.0.1":"2021-11-05T19:52:03.473Z","modified":"2023-02-03T14:42:56.715Z"},"maintainers":[{"email":"djimenez@eleadertech.com","name":"david.jimenez"},{"email":"ogarza@eleadertech.com","name":"ogarza"},{"email":"ljimenez@eleadertech.com","name":"luis.ajj"},{"email":"rdelgado@eleadertech.com","name":"eleadertechinc"}],"description":"Beautiful credit cards for your payment forms","homepage":"https://github.com/amarofashion/react-credit-cards#readme","keywords":["react","react-component","credit card","payment"],"repository":{"type":"git","url":"git+https://github.com/amarofashion/react-credit-cards.git"},"contributors":[{"name":"Cassio Cardoso","email":"cassio.cardoso@amaro.com"},{"name":"Gil Barbara","email":"gil.barbara@amaro.com"}],"author":{"name":"AMARO Fashion","email":"tech@amaro.com"},"bugs":{"url":"https://github.com/amarofashion/react-credit-cards/issues"},"license":"MIT","readme":"# React Credit Cards\n\n[![NPM](https://badge.fury.io/js/react-credit-cards.svg)](https://www.npmjs.com/package/react-credit-cards) [![Travis](https://travis-ci.org/amarofashion/react-credit-cards.svg?branch=master)](https://travis-ci.org/amarofashion/react-credit-cards) [![Maintainability](https://api.codeclimate.com/v1/badges/bb0aa1a6b782c3845f6a/maintainability)](https://codeclimate.com/github/amarofashion/react-credit-cards/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/bb0aa1a6b782c3845f6a/test_coverage)](https://codeclimate.com/github/amarofashion/react-credit-cards/test_coverage)\n\nA slick credit card component for React.\n\n![demo](https://raw.githubusercontent.com/amarofashion/react-credit-cards/master/docs/media/rccs.gif)\n\n[Demo](https://amarofashion.github.io/react-credit-cards/)\n\n### Install\n\n```\nnpm install --save react-credit-cards\n```\n\n### Usage\n\n```jsx\nimport React from 'react';\nimport Cards from 'react-credit-cards';\n\nexport default class PaymentForm extends React.Component {\n  state = {\n    cvc: '',\n    expiry: '',\n    focus: '',\n    name: '',\n    number: '',\n  };\n\n  handleInputFocus = (e) => {\n    this.setState({ focus: e.target.name });\n  }\n  \n  handleInputChange = (e) => {\n    const { name, value } = e.target;\n    \n    this.setState({ [name]: value });\n  }\n  \n  render() {\n    return (\n      <div id=\"PaymentForm\">\n        <Cards\n          cvc={this.state.cvc}\n          expiry={this.state.expiry}\n          focused={this.state.focus}\n          name={this.state.name}\n          number={this.state.number}\n        />\n        <form>\n        \t<input\n            type=\"tel\"\n            name=\"number\"\n            placeholder=\"Card Number\"\n            onChange={this.handleInputChange}\n            onFocus={this.handleInputFocus}\n          />\n          ...\n        </form>\n      </div>\n    );\n  }\n}\n```\n\nDon't forget to import the `react-credit-cards/lib/styles.scss` if you are using SASS in your project.  \nOr you can import the CSS:  \n`import 'react-credit-cards/es/styles-compiled.css';`\n\n### Features\n\n- We support all credit card issuers available in [Payment](https://github.com/jessepollak/payment) plus Hipercard (a brazilian credit card).\n\n## Props\n\n- `name` {string}: Name on card. \\*\n- `number` {string|number}: Card number. \\*\n- `expiry` {string|number}: Card expiry date. `10/20` or `012017` \\*\n- `cvc` {string|number}: Card CVC/CVV. \\*\n- `focused` {string}: Focused card field. `name|number|expiry|cvc`\n- `locale` {object}: Localization text (e.g. `{ valid: 'valid thru' }`).\n- `placeholders` {object}: Placeholder text (e.g. `{ name: 'YOUR NAME HERE' }`).\n- `preview` {bool}: To use the card to show scrambled data (e.g. `**** 4567`).\n- `issuer` {string}: Set the issuer for the `preview` mode (e.g. `visa|mastercard|...`)\n- `acceptedCards` {array}: If you want to limit the accepted cards. (e.g. `['visa', 'mastercard']`\n- `callback` {func}: A callback function that will be called when the card number has changed with 2 paramaters: `type ({ issuer: 'visa', maxLength: 19 }), isValid ({boolean})`\n\n\\* _Required fields_\n\n## SCSS options\n\n**Credit Card sizing**\n\n- `$rccs-card-ratio`: Card ratio. Defaults to `1.5858`\n- `$rccs-size`: Card width. Defaults to `290px`\n\n**Credit Card fonts**\n\n- `$rccs-name-font-size`: Defaults to `17px`\n- `$rccs-name-font-family`: Defaults to `Consolas, Courier, monospace`\n- `$rccs-number-font-size`: Defaults to `17px`\n- `$rccs-number-font-family`: Defaults to `Consolas, Courier, monospace`\n- `$rccs-valid-font-size`: Defaults to `10px`\n- `$rccs-expiry-font-size`: Defaults to `16px`\n- `$rccs-expiry-font-family`: Defaults to `Consolas, Courier, monospace`\n- `$rccs-cvc-font-size`: Defaults to `14px`\n- `$rccs-cvc-font-family`: Defaults to `Consolas, Courier, monospace`\n- `$rccs-cvc-color`: Defaults to `#222`\n\n**Credit Card styling**\n\n- `$rccs-shadow`: Defaults to `0 0 20px rgba(#000, 0.2)`\n- `$rccs-light-text-color`: Card text color for dark cards. Defaults to `#fff`\n- `$rccs-dark-text-color`: Card text color for light cards. Defaults to `#555`\n- `$rccs-stripe-bg-color`: Stripe background color in the back. Defaults to `#2a1d16`\n- `$rccs-signature-background`: Signature background in the back. Defaults to `repeating-linear-gradient(0.1deg, #fff 20%, #fff 40%, #fea 40%, #fea 44%, #fff 44%)`\n- `$rccs-default-background`: Default card background. Defaults to `linear-gradient(25deg, #939393, #717171)`\n- `$rccs-unknown-background`: Unknown card background. Defaults to `linear-gradient(25deg, #999, #999)`\n- `$rccs-background-transition`: Card background transition. Defaults to `all 0.5s ease-out`\n- `$rccs-animate-background`: Card background animation. Defaults to `true`\n\n**Credit Card brands**\n\n- `$rccs-amex-background`: Defaults to `linear-gradient(25deg, #308c67, #a3f2cf)`\n- `$rccs-dankort-background`: Defaults to `linear-gradient(25deg, #ccc, #999)`\n- `$rccs-dinersclub-background`: Defaults to `linear-gradient(25deg, #fff, #eee)`\n- `$rccs-discover-background`: Defaults to `linear-gradient(25deg, #fff, #eee)`\n- `$rccs-mastercard-background`: Defaults to `linear-gradient(25deg, #e8e9e5, #fbfbfb)`\n- `$rccs-visa-background`: Defaults to `linear-gradient(25deg, #0f509e, #1399cd)`\n- `$rccs-elo-background`: Defaults to `linear-gradient(25deg, #211c18, #aaa7a2)`\n- `$rccs-hipercard-background`: Defaults to `linear-gradient(25deg, #8b181b, #de1f27)`\n\n## Development\n\nHere's how you can get started developing locally:\n\n    $ git clone https://github.com/amarofashion/react-credit-cards.git\n    $ cd react-credit-cards\n    $ npm install\n    $ npm start\n\nNow, if you go to `http://localhost:3000` in your browser, you should see the demo page.\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process of contributing to the project.\n\n## Useful links\n\n[EBANK's test numbers](https://www.ebanx.com/business/en/developers/integrations/testing/credit-card-test-numbers)  \n[Adyen's test numbers](https://gist.github.com/j3j5/8b3e48ccad746b90a54a)  \n[Worldpay's test card numbers](https://support.worldpay.com/support/kb/bg/testandgolive/tgl5103.html)  \n[Brazilian cards patterns](https://github.com/erikhenrique/bin-cc/blob/master/README.md)\n\n## LICENSE\n\nThis project is licensed under the [MIT License](LICENSE.md).\n\n###### Made with ❤️ at [AMARO](https://amaro.com).\n","readmeFilename":"README.md"}