Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update Storybook example with a small target to better demonstrate po…
…sitioning issues
  • Loading branch information
andrewserong committed Jul 13, 2022
commit 4f67e5bc1a96e7aa46d33bc5cb55d3f3c3ae9850
44 changes: 32 additions & 12 deletions packages/components/src/tooltip/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,42 @@ export const _default = () => {
'bottom right': 'bottom right',
};
const tooltipText = text( 'Text', 'More information' );
const longTooltipText = text( 'Text', 'Long explanatory information' );
const position = select( 'Position', positionOptions, 'top center' );
const delay = number( 'Delay', 700 );
return (
<Tooltip text={ tooltipText } position={ position } delay={ delay }>
<div
style={ {
margin: '50px auto',
width: '200px',
padding: '20px',
textAlign: 'center',
border: '1px solid #ccc',
} }
<>
<Tooltip text={ tooltipText } position={ position } delay={ delay }>
<div
style={ {
margin: '50px auto',
width: '200px',
padding: '20px',
textAlign: 'center',
border: '1px solid #ccc',
} }
>
Hover for more information
</div>
</Tooltip>
<Tooltip
text={ longTooltipText }
position={ position }
delay={ delay }
>
Hover for more information
</div>
</Tooltip>
<div
style={ {
margin: '50px auto',
width: 'min-content',
padding: '4px',
textAlign: 'center',
border: '1px solid #ccc',
} }
>
Small target
</div>
</Tooltip>
</>
);
};

Expand Down