Skip to content

Commit 1e1d8cd

Browse files
committed
docs: add <DropArea> reference
1 parent 8aad3d7 commit 1e1d8cd

File tree

6 files changed

+33
-2
lines changed

6 files changed

+33
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ const MyComponent = mock();
7777
- [`<Portal>`](./docs/en/Portal.md), [`<Overlay>`](./docs/en/Overlay.md), and [`<Modal>`](./docs/en/Modal.md)
7878
- [`<FullScreen>`](./docs/en/FullScreen.md)
7979
- [`<Slider>`](./docs/en/Slider.md)
80+
- [`<DropArea>`](./docs/en/DropArea.md)
8081
- [`<Ripple>`](./docs/en/Ripple.md) and [`withRipple()`](./docs/en/Ripple.md#withripple) &mdash; [**example**](https://codesandbox.io/s/983q7jr80o)
8182
- [`<Audio>`](./docs/en/Audio.md) and [`<Video>`](./docs/en/Video.md)
8283
- [`<Speak>`](./docs/en/Speak.md), [`<Vibrate>`](./docs/en/Vibrate.md), [`<Alert>`](./docs/en/Alert.md), `<Prompt>`, `<Confirm>`

docs/en/DropArea.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# `<DropArea>`
2+
3+
Catches file and text drop and paste events.
4+
5+
6+
## Usage
7+
8+
```jsx
9+
import {DropArea} from 'libreact/lib/DropArea';
10+
11+
<DropArea
12+
onFiles={(files, event) => console.log(files)}
13+
onUri={(uri, event) => console.log(uri)}
14+
onText={(text, event) => console.log(text)}
15+
>
16+
<div style={{border: '1px solid tomato'}}>
17+
Drop it like a bomb!
18+
</div>
19+
</DropArea>
20+
```
21+
22+
23+
## Props
24+
25+
- `onFiles` &mdash; called when files are dropped or pasted into the area.
26+
- `onUri` &mdash; called an URI from another tab is dropped in the area.
27+
- `onText` &mdash; called when text is paste in the area.

docs/en/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
- [`<Portal>`](./Portal.md), [`<Overlay>`](./Overlay.md), and [`<Modal>`](./Modal.md)
4747
- [`<FullScreen>`](./FullScreen.md)
4848
- [`<Slider>`](./Slider.md)
49+
- [`<DropArea>`](./DropArea.md)
4950
- [`<Ripple>`](./Ripple.md) and [`withRipple()`](./Ripple.md#withripple) &mdash; [**example**](https://codesandbox.io/s/983q7jr80o)
5051
- [`<Audio>`](./Audio.md) and [`<Video>`](./Video.md)
5152
- [`<Speak>`](./Speak.md), [`<Vibrate>`](./Vibrate.md), [`<Alert>`](./Alert.md), `<Prompt>`, `<Confirm>`

docs/en/SUMMARY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@
5454
* [Overlay](Overlay.md)
5555
* [Modal](Modal.md)
5656
* [FullScreen](FullScreen.md)
57-
* [Slider](Slider.md)
57+
* [Slider](Slider.m
58+
* [`<DropArea>`](DropArea.md)
5859
* [Ripple](Ripple.md)
5960
* [Audio](Audio.md)
6061
* [Video](Video.md)

src/DropArea/__story__/story.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {DropArea} from '..';
66
import ShowDocs from '../../../.storybook/ShowDocs'
77

88
storiesOf('UI/DropArea', module)
9-
// .add('Documentation', () => h(ShowDocs, {md: require('../../../docs/en/Toggle.md')}))
9+
.add('Documentation', () => h(ShowDocs, {md: require('../../../docs/en/DropArea.md')}))
1010
.add('Example', () =>
1111
<DropArea
1212
onUri={action('onUri')}

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export * from './Modal';
3838
export * from './FullScreen';
3939
export * from './Ripple';
4040
export * from './Slider';
41+
export * from './DropArea';
4142

4243
// Other
4344
export * from './Resolve';

0 commit comments

Comments
 (0)