Skip to content

Commit

Permalink
docs: add <Ripple> docs
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Feb 20, 2018
1 parent ac91e56 commit 9665542
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const MyComponent = mock();
- [`<Portal>`](./docs/en/Portal.md), [`<Overlay>`](./docs/en/Overlay.md), and [`<Modal>`](./docs/en/Modal.md)
- [`<FullScreen>`](./docs/en/FullScreen.md)
- [`<Slider>`](./docs/en/Slider.md)
- [`<Ripple>`](./docs/en/Ripple.md)
- [`<Audio>`](./docs/en/Audio.md) and [`<Video>`](./docs/en/Video.md)
- [`<Speak>`](./docs/en/Speak.md), [`<Vibrate>`](./docs/en/Vibrate.md), [`<Alert>`](./docs/en/Alert.md), `<Prompt>`, `<Confirm>`
- [Side Effects](./docs/en/Side-effects.md)
Expand Down
1 change: 1 addition & 0 deletions docs/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
- [`<Portal>`](./Portal.md), [`<Overlay>`](./Overlay.md), and [`<Modal>`](./Modal.md)
- [`<FullScreen>`](./FullScreen.md)
- [`<Slider>`](./Slider.md)
- [`<Ripple>`](./Ripple.md)
- [`<Audio>`](./Audio.md) and [`<Video>`](./Video.md)
- [`<Speak>`](./Speak.md), [`<Vibrate>`](./Vibrate.md), [`<Alert>`](./Alert.md), `<Prompt>`, `<Confirm>`
- [Side Effects](./Side-effects.md)
Expand Down
25 changes: 25 additions & 0 deletions docs/en/Ripple.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# `<Ripple>`

Creates Material Design ripple effect on click inside your element.


## Usage

```jsx
import {Ripple} from 'libreact/lib/Ripple';

<Ripple>
<div style={{
width: 300,
height: 200,
}}>
foobar
</div>
</Ripple>
```


## Props

- `color` &mdash; optional, string, ripple color.
- `ms` &mdash; optional, number, animation time in milliseconds.
1 change: 1 addition & 0 deletions docs/en/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
* [Modal](Modal.md)
* [FullScreen](FullScreen.md)
* [Slider](Slider.md)
* [Ripple](Ripple.md)
* [Audio](Audio.md)
* [Video](Video.md)
* [Speak](Speak.md)
Expand Down
7 changes: 1 addition & 6 deletions src/Ripple/__story__/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,18 @@ import styled from 'freestyler/lib/react/styled';
import {withRipple} from '..';

export const theme = {
// Main site colors.
color1: ['#29EB7F', '#13CE66', '#0F9F4F'],
color2: ['#85D7FF', '#1FB6FF', '#009EEB'],
color3: ['#A389F4', '#7E5BEF', '#592DEA'],
color4: ['#FF7CE5', '#FF49DB', '#FF16D1'],
color5: ['#FF9E7C', '#FF7849', '#FF5216'],
color6: ['#FFD55F', '#FFC82C', '#F8B700'],

// Shades of grey.
black: '#1F2D3D',
steel: '#273444',
slate: '#3C4858',
silver: '#8492A6',
smoke: ['#E0E6ED', '#D3DCE6', '#C0CCDA'],
snow: ['#F9FAFC', '#EFF2F7', '#E5E9F2'],

// Semantic colors.
blue: '#1FB6FF',
positive: '#13CE66',
negative: '#FF4949',
Expand Down Expand Up @@ -65,7 +60,7 @@ const dynamicTemplate = ({disabled, outline, lite, primary, simple, small}) => {
return style;
};

const ButtonWithRipple = withRipple('button', {ms: 1000});
const ButtonWithRipple = withRipple('button', {ms: 1000, color: 'white'});

const Button: React.SFC<IButtonProps> = styled(ButtonWithRipple)(staticTemplate, dynamicTemplate);

Expand Down
11 changes: 10 additions & 1 deletion src/Ripple/__story__/story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ import Button from './Button';
import ShowDocs from '../../../.storybook/ShowDocs';

storiesOf('UI/Ripple', module)
// .add('Documentation', () => h(ShowDocs, {md: require('../../../docs/en/Slider.md')}))
.add('Documentation', () => h(ShowDocs, {md: require('../../../docs/en/Ripple.md')}))
.add('Plain example', () =>
<div>
<Ripple>
<div>
foobar
</div>
</Ripple>
</div>
)
.add('Example', () =>
<div>
<Ripple>
Expand Down

0 comments on commit 9665542

Please sign in to comment.