2018-01-01 19:46:28 +00:00
|
|
|
import React from 'react';
|
2018-01-26 20:08:39 +00:00
|
|
|
import classnames from 'classnames';
|
2018-01-01 19:46:28 +00:00
|
|
|
import './Tooltip.scss';
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
children: React.ReactElement<string> | string;
|
2018-01-26 20:08:39 +00:00
|
|
|
size?: 'sm' | 'md' | 'lg';
|
2018-05-11 15:15:32 +00:00
|
|
|
direction?: 'top' | 'bottom' | 'left' | 'right';
|
2018-01-01 19:46:28 +00:00
|
|
|
}
|
|
|
|
|
2018-05-11 15:15:32 +00:00
|
|
|
const Tooltip: React.SFC<Props> = ({ size, direction, children }) => (
|
2018-01-26 20:08:39 +00:00
|
|
|
<div
|
|
|
|
className={classnames({
|
|
|
|
Tooltip: true,
|
2018-05-11 15:15:32 +00:00
|
|
|
[`is-size-${size}`]: !!size,
|
|
|
|
[`is-direction-${direction}`]: !!direction
|
2018-01-26 20:08:39 +00:00
|
|
|
})}
|
|
|
|
>
|
2018-01-01 19:46:28 +00:00
|
|
|
<span className="Tooltip-text">{children}</span>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default Tooltip;
|