Skip to content
This repository was archived by the owner on Nov 3, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"parser": "babel-eslint",
"parser": "@typescript-eslint/parser",
"extends": [
"standard",
"standard-react",
"plugin:prettier/recommended",
"prettier/standard",
"prettier/react"
"prettier/react",
"plugin:@typescript-eslint/eslint-recommended"
],
"env": {
"node": true
Expand Down
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
node_modules

# builds
build
dist
.rpt2_cache

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
1 change: 0 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"singleQuote": true,
"jsxSingleQuote": true,
"semi": false,
"tabWidth": 2,
"bracketSpacing": true,
"jsxBracketSameLine": false,
Expand Down
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ yarn add react-auth-code-input
## Usage

```jsx
import React from 'react'
import AuthCode from 'react-auth-code-input'
import React from 'react';
import AuthCode from 'react-auth-code-input';

const App = () => {
return (
Expand All @@ -49,24 +49,27 @@ const App = () => {
textTransform: 'uppercase'
}}
/>
)
}
);
};
```


### Props

| Prop | Type | Description | Default Value |
| :--- | :--- | :--- | :--- |
| `characters` | Number | The number of inputs to display | 6 |
| `allowedCharacters` | String | Regex for allowed characters | `^[A-Za-z0-9]` |
| `password` | Boolean | If present changes the type of the input to password, by default is set to text | False |
| `inputStyle` | Object | The styles to be applied to each input | |
| `containerStyle` | Object | The styles to be applied to each input | |
| `onChange` | Function(value: String) | Callback function called every time an input value changes | |
| Prop | Type | Description | Default Value |
| :------------------ | :---------------------- | :------------------------------------------------------------------------------ | :------------- |
| `characters` | Number | The number of inputs to display | 6 |
| `allowedCharacters` | String | Regex for allowed characters | `^[A-Za-z0-9]` |
| `password` | Boolean | If present changes the type of the input to password, by default is set to text | False |
| `inputStyle` | Object | The styles to be applied to each input | |
| `containerStyle` | Object | The styles to be applied to each input | |
| `onChange` | Function(value: String) | Callback function called every time an input value changes | |

## Changelog

### 1.1.0

- Typescript support.

### 1.0.0

- Initial Version.
Expand Down
132 changes: 60 additions & 72 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading