Skip to content

Commit

Permalink
Quickfix: Add disabled button styles to the button in the design syst…
Browse files Browse the repository at this point in the history
…em (#329)

* Add disabled button styles to the button in the design system

* add changeset

* comment that should have been removed
  • Loading branch information
sirJiggles committed Aug 31, 2022
1 parent 74c1d25 commit 1b6a950
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/happy-moles-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@qualifyze/design-system': patch
---

Add disabled button styles to the ds
6 changes: 6 additions & 0 deletions src/components/Button/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ const Base = styled('button')(
outline: 'none',
boxShadow: props.theme.shadows.focusRing,
},
'&:disabled': {
// these are important to stop variants overriding them
backgroundColor: `${props.theme.colors.grey[200]} !important;`,
color: `${props.theme.colors.grey[500]} !important;`,
cursor: 'not-allowed',
},
}),
variant({
prop: 'variant',
Expand Down
18 changes: 18 additions & 0 deletions src/components/Button/index.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@ Default.story = {
name: 'default',
}

export const Disabled = () => {
const variant = select(
'Variant',
['primary', 'secondary', 'danger'],
'primary'
)
return (
<Inline>
<Button disabled variant={variant} onClick={action('Button clicked')}>
Cant touch this
</Button>
</Inline>
)
}
Disabled.story = {
name: 'disabled',
}

function simulateNetworkRequest() {
return new Promise(resolve => setTimeout(resolve, 3000))
}
Expand Down

1 comment on commit 1b6a950

@vercel
Copy link

@vercel vercel bot commented on 1b6a950 Aug 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.