Skip to content

Commit

Permalink
prepare v2
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Jul 21, 2019
1 parent 2245302 commit 1f8b476
Show file tree
Hide file tree
Showing 30 changed files with 20,955 additions and 3,691 deletions.
7 changes: 4 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"presets": ["env", "stage-0", "react"],
"plugins": [
"transform-decorators-legacy"
"extends": "@trendmicro/babel-config",
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ npm-debug.log
package-lock.json
/.nyc_output
/coverage
/dist
/lib
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ os:

node_js:
- '8'
- '6'
- '10'

before_install:
- npm install -g npm
Expand Down
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ npm install --save react-repeatable

## Usage

```js
```jsx
<Repeatable
style={{ display: 'inline-block' }}
repeatDelay={500}
repeatInterval={32}
onPress{(event) => {
Expand All @@ -35,12 +34,26 @@ npm install --save react-repeatable
// Callback fired when the mouseup, touchcancel, or touchend event is triggered.
}}
>
<button type="button">
Press Me
</button>
Press Me
</Repeatable>
```

### Repeatable Button

```jsx
const RepeatableButton = ({ onClick, ...props }) => (
<Repeatable
tag="button"
type="button"
onHold={onClick}
onRelease={onClick}
{...props}
/>
);

<RepeatableButton onClick={handleClick} />
```

## API

### Sequence of Events
Expand All @@ -55,7 +68,7 @@ onPress -> onRelease

Name | Type | Default | Description
:--- | :--- | :------ | :----------
componentClass | element | 'div' | A custom element for this component.
tag | element | 'div' | A custom element for this component.
disabled | Boolean | false | Set it to true to disable event actions.
repeatDelay | Number | 500 | The time (in milliseconds) to wait before the first hold action is being triggered.
repeatInterval | Number | 32 | The time interval (in milliseconds) on how often to trigger a hold action.
Expand Down
15,967 changes: 15,967 additions & 0 deletions docs/build/bundle.55aecd75.js

Large diffs are not rendered by default.

Loading

0 comments on commit 1f8b476

Please sign in to comment.