Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Button): render disabled button as span
- Loading branch information
Showing
12 changed files
with
218 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+15.4 KB
...es/picasso/src/Button/__image_snapshots__/button-disabled-with-tooltip-snap.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
40 changes: 40 additions & 0 deletions
40
packages/picasso/src/Button/story/DisabledWithTooltip.example.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from 'react' | ||
import { Container, Button, Tooltip, Typography } from '@toptal/picasso' | ||
import { useNotifications } from '@toptal/picasso/utils' | ||
|
||
const Example = () => { | ||
const { showSuccess } = useNotifications() | ||
const handleClick = () => showSuccess('I was clicked') | ||
|
||
return ( | ||
<div> | ||
<Typography variant='heading' size='small'> | ||
Disabled button with the tooltip: | ||
</Typography> | ||
<Container top='small' bottom='large'> | ||
<Button onClick={handleClick}>Enabled</Button> | ||
<Tooltip content='Action is disabled'> | ||
<Button disabled onClick={handleClick}> | ||
Disabled With Tooltip | ||
</Button> | ||
</Tooltip> | ||
</Container> | ||
|
||
<Typography variant='heading' size='small'> | ||
Disabled button with the tooltip inside the button group: | ||
</Typography> | ||
<Container top='small'> | ||
<Button.Group> | ||
<Button onClick={handleClick}>Enabled</Button> | ||
<Tooltip content='Action is disabled'> | ||
<Button disabled onClick={handleClick}> | ||
Disabled With Tooltip | ||
</Button> | ||
</Tooltip> | ||
</Button.Group> | ||
</Container> | ||
</div> | ||
) | ||
} | ||
|
||
export default Example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.