Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the correct props to start the tooltip open #5610

Merged
merged 2 commits into from
Feb 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/components/src/tooltip/TooltipLinkList.stories.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import WithTooltip from './WithTooltip';
import WithToolTip from './WithTooltip';

import TooltipLinkList from './TooltipLinkList';
import StoryLinkWrapper from '../StoryLinkWrapper';

export const links = [
{ title: 'Link', href: 'http://google.com' },
{ title: 'Link', href: 'http://google.com' },
{ title: 'callback', onClick: action('onClick') },
{ id: '1', title: 'Link', href: 'http://google.com' },
{ id: '2', title: 'Link', href: 'http://google.com' },
{ id: '3', title: 'callback', onClick: action('onClick') },
];

storiesOf('basics/Tooltip/TooltipLinkList', module)
.addDecorator(storyFn => (
<div style={{ height: '300px' }}>
<WithTooltip placement="top" trigger="click" startOpen tooltip={storyFn()}>
<WithToolTip placement="top" trigger="click" tooltipShown tooltip={storyFn()}>
<div>Tooltip</div>
</WithTooltip>
</WithToolTip>
</div>
))
.add('links', () => <TooltipLinkList links={links.slice(0, 2)} LinkWrapper={StoryLinkWrapper} />)
Expand Down
2 changes: 1 addition & 1 deletion lib/components/src/tooltip/TooltipMessage.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import TooltipMessage from './TooltipMessage';
storiesOf('basics/Tooltip/TooltipMessage', module)
.addDecorator(storyFn => (
<div style={{ height: '300px' }}>
<WithTooltip placement="top" trigger="click" startOpen tooltip={storyFn()}>
<WithTooltip placement="top" trigger="click" tooltipShown tooltip={storyFn()}>
<div>Tooltip</div>
</WithTooltip>
</div>
Expand Down
8 changes: 7 additions & 1 deletion lib/components/src/tooltip/TooltipNote.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ import TooltipNote from './TooltipNote';
storiesOf('basics/Tooltip/TooltipNote', module)
.addDecorator(storyFn => (
<div style={{ height: '300px' }}>
<WithTooltip hasChrome={false} placement="top" trigger="click" startOpen tooltip={storyFn()}>
<WithTooltip
hasChrome={false}
placement="top"
trigger="click"
tooltipShown
tooltip={storyFn()}
>
<div>Tooltip</div>
</WithTooltip>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,108 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Storyshots basics/Tooltip/TooltipLinkList links 1`] = `
.emotion-8 {
min-width: 180px;
}

.emotion-4 {
font-size: 12px;
-webkit-transition: all 150ms ease-out;
transition: all 150ms ease-out;
color: #999999;
-webkit-text-decoration: none;
text-decoration: none;
cursor: pointer;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
-ms-flex-pack: justify;
justify-content: space-between;
line-height: 18px;
padding: 7px 15px;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}

.emotion-4 + .emotion-4 {
border-top: 1px solid #EEEEEE;
}

.emotion-4 > * + * {
padding-left: 10px;
}

.emotion-4:hover {
background: rgba(0,0,0,.05);
}

.emotion-4:hover svg {
opacity: 1;
}

.emotion-3 {
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
text-align: left;
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
}

.emotion-3 > * + * {
padding-left: 10px;
}

.emotion-2 {
color: #444444;
}

.emotion-0 {
display: inline-block;
cursor: pointer;
}

.emotion-9 {
display: inline-block;
z-index: 2147483647;
margin-bottom: 10px;
margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
background: linear-gradient( -1deg, rgba(248,248,248,0.97) 0%, rgba(255,255,255,0.97) 100% );
-webkit-filter: drop-shadow(0px 5px 5px rgba(0,0,0,0.05)) drop-shadow(0 1px 3px rgba(0,0,0,0.1));
filter: drop-shadow(0px 5px 5px rgba(0,0,0,0.05)) drop-shadow(0 1px 3px rgba(0,0,0,0.1));
font-size: 12px;
}

.emotion-1 {
position: absolute;
border-style: solid;
margin-bottom: 0px;
margin-top: 8px;
margin-right: 8px;
margin-left: 8px;
bottom: -8px;
top: autopx;
right: autopx;
left: autopx;
border-bottom-width: 0px;
border-top-width: 8px;
border-right-width: 8px;
border-left-width: 8px;
border-top-color: #FFFFFF;
border-bottom-color: transparent;
border-left-color: transparent;
border-right-color: transparent;
}

<div
style="height:300px"
>
Expand All @@ -16,15 +113,152 @@ exports[`Storyshots basics/Tooltip/TooltipLinkList links 1`] = `
Tooltip
</div>
</div>
<div
class="emotion-9"
style="position:absolute;top:0;left:0;opacity:0;pointer-events:none"
>
<div
class="emotion-1"
/>
<div
class="emotion-8"
>
<a
class="emotion-4"
href="http://google.com"
>
<span
class="emotion-3"
>
<span
class="emotion-2"
>
Link
</span>
</span>
</a>
<a
class="emotion-4"
href="http://google.com"
>
<span
class="emotion-3"
>
<span
class="emotion-2"
>
Link
</span>
</span>
</a>
</div>
</div>
</div>
`;

exports[`Storyshots basics/Tooltip/TooltipLinkList links and callback 1`] = `
.emotion-11 {
min-width: 180px;
}

.emotion-4 {
font-size: 12px;
-webkit-transition: all 150ms ease-out;
transition: all 150ms ease-out;
color: #999999;
-webkit-text-decoration: none;
text-decoration: none;
cursor: pointer;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
-ms-flex-pack: justify;
justify-content: space-between;
line-height: 18px;
padding: 7px 15px;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}

.emotion-4 + .emotion-4 {
border-top: 1px solid #EEEEEE;
}

.emotion-4 > * + * {
padding-left: 10px;
}

.emotion-4:hover {
background: rgba(0,0,0,.05);
}

.emotion-4:hover svg {
opacity: 1;
}

.emotion-3 {
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
text-align: left;
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
}

.emotion-3 > * + * {
padding-left: 10px;
}

.emotion-2 {
color: #444444;
}

.emotion-0 {
display: inline-block;
cursor: pointer;
}

.emotion-12 {
display: inline-block;
z-index: 2147483647;
margin-bottom: 10px;
margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
background: linear-gradient( -1deg, rgba(248,248,248,0.97) 0%, rgba(255,255,255,0.97) 100% );
-webkit-filter: drop-shadow(0px 5px 5px rgba(0,0,0,0.05)) drop-shadow(0 1px 3px rgba(0,0,0,0.1));
filter: drop-shadow(0px 5px 5px rgba(0,0,0,0.05)) drop-shadow(0 1px 3px rgba(0,0,0,0.1));
font-size: 12px;
}

.emotion-1 {
position: absolute;
border-style: solid;
margin-bottom: 0px;
margin-top: 8px;
margin-right: 8px;
margin-left: 8px;
bottom: -8px;
top: autopx;
right: autopx;
left: autopx;
border-bottom-width: 0px;
border-top-width: 8px;
border-right-width: 8px;
border-left-width: 8px;
border-top-color: #FFFFFF;
border-bottom-color: transparent;
border-left-color: transparent;
border-right-color: transparent;
}

<div
style="height:300px"
>
Expand All @@ -35,5 +269,58 @@ exports[`Storyshots basics/Tooltip/TooltipLinkList links and callback 1`] = `
Tooltip
</div>
</div>
<div
class="emotion-12"
style="position:absolute;top:0;left:0;opacity:0;pointer-events:none"
>
<div
class="emotion-1"
/>
<div
class="emotion-11"
>
<a
class="emotion-4"
href="http://google.com"
>
<span
class="emotion-3"
>
<span
class="emotion-2"
>
Link
</span>
</span>
</a>
<a
class="emotion-4"
href="http://google.com"
>
<span
class="emotion-3"
>
<span
class="emotion-2"
>
Link
</span>
</span>
</a>
<a
class="emotion-4"
>
<span
class="emotion-3"
>
<span
class="emotion-2"
>
callback
</span>
</span>
</a>
</div>
</div>
</div>
`;
Loading