-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tooltip.stories.tsx
115 lines (113 loc) · 1.95 KB
/
Tooltip.stories.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import React from 'react';
import {
text,
select
} from '@storybook/addon-knobs/react';
import {
storiesOf,
buildInfo
} from '../../helpers/stories';
import {
PlacementValues,
AlignValues
} from '../common/types';
import Tooltip from './';
export const stylableApi = `
Stylable API
---
- ::tooltip
- :active
- :offset
- :topPlacement
- :rightPlacement
- :bottomPlacement
- :leftPlacement
- :startAlign
- :centerAlign
- :endAlign
${buildInfo([
{
values: PlacementValues,
prefix: ':',
postfix: 'placement',
indent: 1
},
{
values: AlignValues,
prefix: ':',
postfix: 'align',
indent: 1
}
])}
`;
export default storiesOf('Tooltip', module)
.addParameters({
info: stylableApi
})
.add(
'with text',
() => (
<Tooltip
id='tooltip'
placement={select('Placement', PlacementValues, 'bottom')}
align={select('Align', AlignValues, 'start')}
content={text('Content', 'Tooltip text')}
>
Point mouse on me
</Tooltip>
)
)
.add(
'with scroll',
() => (
<div
style={{
padding: '100px 0 1200px'
}}
>
<Tooltip
placement={select('Placement', PlacementValues, 'bottom')}
align={select('Align', AlignValues, 'start')}
content={text('Content', 'Tooltip text')}
>
Point mouse on me
</Tooltip>
</div>
)
)
.add(
'with fixed block',
() => (
<div
style={{
padding: '100px 0 1200px'
}}
>
<div
style={{
position: 'fixed',
top: '30px',
left: '100px',
border: '1px solid black',
width: '300px',
height: '200px',
overflow: 'auto'
}}
>
<div
style={{
padding: '100px 0 1200px'
}}
>
<Tooltip
placement={select('Placement', PlacementValues, 'bottom')}
align={select('Align', AlignValues, 'start')}
content={text('Content', 'Tooltip text')}
>
Point mouse on me
</Tooltip>
</div>
</div>
</div>
)
);