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): remove test stories #9002

Merged
merged 1 commit into from
Jun 23, 2021
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
116 changes: 0 additions & 116 deletions packages/react/src/components/Tooltip/Tooltip-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
import Tooltip from '../Tooltip';
import { Tooltip as OGTooltip } from './Tooltip';
import Button from '../Button';
import TextInput from '../TextInput';
import { OverflowMenuVertical16 } from '@carbon/icons-react';
import mdx from './Tooltip.mdx';

Expand Down Expand Up @@ -272,118 +271,3 @@ OnlyCustomIcon.parameters = {
export const UncontrolledTooltip = () => <UncontrolledTooltipExample />;

UncontrolledTooltip.storyName = 'uncontrolled tooltip';

export const App = () => (
<div>
<Tooltip
className="view-example-tooltip"
triggerClassName="view-example-tooltip-trigger"
triggerText={
<div className="view-example-text">
<span>example1</span>
</div>
}
align="start"
direction="bottom"
showIcon={false}>
<div>
<div className="bx--snippet">
<div className="bx--snippet-container">
<code>
<pre>
<span>This is the first message.</span>
</pre>
</code>
</div>
<Button />
</div>
</div>
</Tooltip>
<Tooltip
className="view-example-tooltip2"
triggerClassName="view-example-tooltip-trigger2"
triggerText={
<div className="view-example-text2">
<span>example2</span>
</div>
}
align="start"
direction="bottom"
showIcon={false}>
<div className="bx--snippet">
<div className="bx--snippet-container">
<code>
<pre>
<span>This is the second message.</span>
</pre>
</code>
</div>
<Button />
</div>
</Tooltip>
</div>
);

export const App2 = () => {
const getTooltip = (id, label, includeId, withButton) => (
<Tooltip
tooltipId={(id && `tooltip-${id}`) || undefined}
triggerText={label}>
<p>
This is some tooltip text. This box shows the maximum amount of text
that should appear inside. If more room is needed please use a modal
instead.
</p>
<div className={`${prefix}--tooltip__footer`}>
{withButton && (
<a href="/" className={`${prefix}--link`}>
Learn More
</a>
)}
{withButton && <Button size="small">Create</Button>}
</div>
</Tooltip>
);
const getTextInput = (id, label, includeId, withButton) => (
<TextInput
style={{ marginBottom: 20 }}
id={id}
labelText={getTooltip(`tooltip-${id}`, label, includeId, withButton)}
/>
);

return (
<div className="app">
{getTextInput('bad-text-input-1', 'Text input (tooltip with id) 1', true)}
{getTextInput(
'bad-text-input-2',
'Text input (tooltip with id) 2',
true,
true
)}
{getTextInput(
'bad-text-input-3',
'Text input (tooltip with id) 3',
true,
true
)}
{getTextInput(
'good-text-input-1',
'Text input (tooltip with no id) 1',
false
)}
{getTextInput(
'good-text-input-2',
'Text input (tooltip with no id) 2',
false,
true
)}
{getTextInput(
'good-text-input-3',
'Text input (tooltip with no id) 3',
false,
true
)}
</div>
);
};