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

Commit

Permalink
Merge pull request #7 from drac94/feature/classnames
Browse files Browse the repository at this point in the history
classnames
  • Loading branch information
drac94 authored May 6, 2021
2 parents 83fbf75 + b4760a8 commit e1b0f8b
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 62 deletions.
40 changes: 19 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,37 +35,35 @@ const App = () => {
return (
<AuthCode
characters={5}
containerStyle={{
padding: '16px'
}}
inputStyle={{
width: '2ch',
padding: '8px',
borderRadius: '8px',
fontSize: '40px',
textAlign: 'center',
marginRight: '12px',
border: '1px solid black',
textTransform: 'uppercase'
}}
onChange={() => null}
containerClassName='container'
inputClassName='input'
/>
);
};
```

### 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 | Observations |
| :------------------- | :---------------------- | :------------------------------------------------------------------------------ | :------------- | :----------------------------- |
| `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 | | deprecated since version 1.2.0 |
| `containerStyle` | Object | The styles to be applied to the container | | deprecated since version 1.2.0 |
| `inputClassName` | String | The styles to be applied to each input | | |
| `containerClassName` | String | The styles to be applied to the container | | |
| `onChange` | Function(value: String) | Callback function called every time an input value changes | | |

## Changelog

### 1.2.0

- Add `inputClassName` and `containerClassName` props.
- Deprecate `inputStyle` and `containerStyle`.
- Make `onChange` prop mandatory.

### 1.1.0

- Typescript support.
Expand Down
8 changes: 6 additions & 2 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.

8 changes: 6 additions & 2 deletions dist/index.modern.js

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

Loading

0 comments on commit e1b0f8b

Please sign in to comment.