@streetscape.gl/monochrome
Version:
A toolkit of React components for streetscape.gl
89 lines (86 loc) • 2.99 kB
JavaScript
// Copyright (c) 2019 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import React from 'react';
import {storiesOf} from '@storybook/react';
import {withReadme} from 'storybook-readme';
import README from './README.md';
import {Popover, Tooltip} from './index';
storiesOf('Building Blocks', module)
.addDecorator(withReadme(README))
.add('Popover', () => (
<Popover
content={() => (
<div style={{padding: '10px'}}>
<div>
<button>One fish</button>
</div>
<div style={{marginTop: '5px'}}>
<button>Two fish</button>
</div>
<div style={{marginTop: '5px'}}>
<button>Red fish</button>
</div>
<div style={{marginTop: '5px'}}>
<button>Blue fish</button>
</div>
</div>
)}
>
<button>Click for popover</button>
</Popover>
))
.add('Tooltip', () => (
<div style={{fontFamily: 'Helvetica, sans-serif', margin: 100, fontSize: 13}}>
<p>
<Tooltip position={Popover.RIGHT} content="Tooltip">
Right
</Tooltip>
</p>
<p>
<Tooltip position={Popover.BOTTOM} content="Tooltip">
Bottom
</Tooltip>
</p>
<p>
<Tooltip position={Popover.LEFT} content="Tooltip">
Left
</Tooltip>
</p>
<p>
<Tooltip position={Popover.TOP} content="Tooltip">
Top
</Tooltip>
</p>
<p>
<Tooltip
position={Popover.RIGHT}
arrowPosition={Popover.BOTTOM}
content={() => (
<span>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras tincidunt et enim vel
pellentesque. Aliquam nisl est, dapibus et leo sit amet, venenatis placerat sem.
</span>
)}
>
<span>Custom positioning</span>
</Tooltip>
</p>
</div>
));