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

docs(tooltip): revert to peviously correct stories, use help icon #18245

Merged
Merged
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
23 changes: 15 additions & 8 deletions packages/react/src/components/Tooltip/Tooltip.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@

import './story.scss';

import { Help } from '@carbon/icons-react';
import React, { useRef, useEffect } from 'react';
import { SquareOutline } from '@carbon/icons-react';
import { Tooltip } from './';
import Button from './../Button';
import mdx from './Tooltip.mdx';

export default {
Expand Down Expand Up @@ -56,15 +55,19 @@ export const Default = () => {
'Occasionally, services are updated in a specified time window to ensure no down time for customers.';
return (
<Tooltip align="bottom" label={label}>
<Button>This button has a tooltip</Button>
<button className="sb-tooltip-trigger" type="button">
<Help />
</button>
</Tooltip>
);
};

export const Alignment = () => {
return (
<Tooltip label="Tooltip alignment" align="bottom-left">
<Button>This button has a tooltip</Button>
<button className="sb-tooltip-trigger" type="button">
<Help />
</button>
</Tooltip>
);
};
Expand All @@ -86,7 +89,9 @@ export const ExperimentalAutoAlign = () => {
left: '2500px',
}}>
<Tooltip label={tooltipLabel} align="top" autoAlign>
<Button ref={ref}>This button has a tooltip</Button>
<button className="sb-tooltip-trigger" type="button" ref={ref}>
<Help />
</button>
</Tooltip>
</div>
</div>
Expand All @@ -96,7 +101,9 @@ export const ExperimentalAutoAlign = () => {
export const Duration = () => {
return (
<Tooltip label="Label one" enterDelayMs={0} leaveDelayMs={300}>
<Button>This button has a tooltip</Button>
<button className="sb-tooltip-trigger" type="button">
<Help />
</button>
</Tooltip>
);
};
Expand All @@ -120,8 +127,8 @@ const PlaygroundStory = (props) => {
label={label}
leaveDelayMs={leaveDelayMs}
closeOnActivation={closeOnActivation}>
<button type="button">
<SquareOutline />
<button className="sb-tooltip-trigger" type="button">
<Help />
</button>
</Tooltip>
);
Expand Down
Loading