Skip to content
This repository was archived by the owner on Nov 3, 2024. It is now read-only.

Commit 83fbf75

Browse files
authored
Merge pull request #4 from drac94/feature/typescript-support
Add Typescript support
2 parents a2fe3f5 + e5976bc commit 83fbf75

28 files changed

+11917
-339
lines changed

.eslintrc

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
2-
"parser": "babel-eslint",
2+
"parser": "@typescript-eslint/parser",
33
"extends": [
44
"standard",
55
"standard-react",
66
"plugin:prettier/recommended",
77
"prettier/standard",
8-
"prettier/react"
8+
"prettier/react",
9+
"plugin:@typescript-eslint/eslint-recommended"
910
],
1011
"env": {
1112
"node": true

.gitignore

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
# See https://help.github.com/ignore-files/ for more about ignoring files.
3+
4+
# dependencies
5+
node_modules
6+
7+
# builds
8+
build
9+
dist
10+
.rpt2_cache
11+
12+
# misc
13+
.DS_Store
14+
.env
15+
.env.local
16+
.env.development.local
17+
.env.test.local
18+
.env.production.local
19+
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*

.prettierrc

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"singleQuote": true,
33
"jsxSingleQuote": true,
4-
"semi": false,
54
"tabWidth": 2,
65
"bracketSpacing": true,
76
"jsxBracketSameLine": false,

README.md

+16-13
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ yarn add react-auth-code-input
2828
## Usage
2929

3030
```jsx
31-
import React from 'react'
32-
import AuthCode from 'react-auth-code-input'
31+
import React from 'react';
32+
import AuthCode from 'react-auth-code-input';
3333

3434
const App = () => {
3535
return (
@@ -49,24 +49,27 @@ const App = () => {
4949
textTransform: 'uppercase'
5050
}}
5151
/>
52-
)
53-
}
52+
);
53+
};
5454
```
5555

56-
5756
### Props
5857

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

6867
## Changelog
6968

69+
### 1.1.0
70+
71+
- Typescript support.
72+
7073
### 1.0.0
7174

7275
- Initial Version.

dist/index.js

+60-72
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)