Skip to content

Commit

Permalink
Add story
Browse files Browse the repository at this point in the history
  • Loading branch information
espressoroaster committed Jul 23, 2020
1 parent 1d31d24 commit 004f789
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions packages/core/src/components/Tooltip/story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React from 'react';
import LoremIpsum from ':storybook/components/LoremIpsum';
import { withexpandMultiple } from '../Accordion/story';
import Button from '../Button';
import DataTable from '../DataTable';
import { RendererProps } from '../DataTable/types';
import Text from '../Text';
import Spacing from '../Spacing';
import Link from '../Link';
Expand Down Expand Up @@ -389,3 +391,52 @@ export function popoverExpandsAndShrinksWithContent() {
popoverExpandsAndShrinksWithContent.story = {
name: 'Popover expands and shrinks with content.',
};

export function popoverEscapesDataTableRow() {
return (
<DataTable
showRowDividers
data={[
{ data: { name: 'John' } },
{ data: { name: 'John' } },
{ data: { name: 'John' } },
{ data: { name: 'John' } },
{ data: { name: 'John' } },
{ data: { name: 'John' } },
{ data: { name: 'John' } },
{ data: { name: 'John' } },
{ data: { name: 'John' } },
{ data: { name: 'John' } },
]}
keys={['name']}
renderers={{
name: ({ row }: RendererProps<{ name: string }>) => {
const { name } = row.rowData.data;

return (
<Tooltip
popover
content={
<>
<Text bold>Certified by {name}</Text>
<div>
<LoremIpsum short />
</div>
<Link openInNewWindow href="https://github.com/airbnb/lunar">
Click me!
</Link>
</>
}
>
<Text>{name}</Text>
</Tooltip>
);
},
}}
/>
);
}

popoverEscapesDataTableRow.story = {
name: 'Popover can escape a DataTable row.',
};

0 comments on commit 004f789

Please sign in to comment.