Force theming on tooltips for calling

This commit is contained in:
Josh Perez 2020-11-19 18:38:59 -05:00 committed by Josh Perez
parent 6a6f8e28ce
commit 8ff0ca9593
6 changed files with 60 additions and 21 deletions

View file

@ -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>
));