Force theming on tooltips for calling
This commit is contained in:
parent
6a6f8e28ce
commit
8ff0ca9593
6 changed files with 60 additions and 21 deletions
|
@ -5,12 +5,13 @@ import * as React from 'react';
|
|||
import { storiesOf } from '@storybook/react';
|
||||
import { select } from '@storybook/addon-knobs';
|
||||
|
||||
import { Tooltip, TooltipPlacement, PropsType } from './Tooltip';
|
||||
import { Tooltip, TooltipPlacement, TooltipTheme, PropsType } from './Tooltip';
|
||||
|
||||
const createProps = (overrideProps: Partial<PropsType> = {}): PropsType => ({
|
||||
content: overrideProps.content || 'Hello World',
|
||||
direction: select('direction', TooltipPlacement, overrideProps.direction),
|
||||
sticky: overrideProps.sticky,
|
||||
theme: overrideProps.theme,
|
||||
});
|
||||
|
||||
const story = storiesOf('Components/Tooltip', module);
|
||||
|
@ -78,3 +79,14 @@ story.add('Sticky', () => (
|
|||
{Trigger}
|
||||
</Tooltip>
|
||||
));
|
||||
|
||||
story.add('Dark Theme', () => (
|
||||
<Tooltip
|
||||
{...createProps({
|
||||
sticky: true,
|
||||
theme: TooltipTheme.Dark,
|
||||
})}
|
||||
>
|
||||
{Trigger}
|
||||
</Tooltip>
|
||||
));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue