Skip to content

Commit

Permalink
Bug fix: default Button disabled bg-color (#4379)
Browse files Browse the repository at this point in the history
* btn bg + stories

* Create young-cooks-shave.md

* test(vrt): update snapshots

* snippy snappers

* move bg color

---------

Co-authored-by: langermank <langermank@users.noreply.github.com>
  • Loading branch information
langermank and langermank authored Mar 12, 2024
1 parent 2f65ea5 commit cb54f42
Show file tree
Hide file tree
Showing 23 changed files with 58 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/young-cooks-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Bug fix: default Button disabled bg-color
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 26 additions & 4 deletions packages/react/src/Button/Button.features.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,34 @@ export const TrailingAction = () => <Button trailingAction={TriangleDownIcon}>Tr

export const Block = () => <Button block>Default</Button>

export const Disabled = () => <Button disabled>Default</Button>
export const Disabled = () => (
<div style={{display: 'flex', flexDirection: 'row', gap: '1rem'}}>
<Button disabled>Default</Button>
<Button variant="primary" disabled>
Primary
</Button>
<Button variant="danger" disabled>
Danger
</Button>
<Button variant="invisible" disabled>
Invisible
</Button>
</div>
)

export const Inactive = () => (
<Button variant="primary" inactive>
Default
</Button>
<div style={{display: 'flex', flexDirection: 'row', gap: '1rem'}}>
<Button inactive>Default</Button>
<Button variant="primary" inactive>
Primary
</Button>
<Button variant="danger" inactive>
Danger
</Button>
<Button variant="invisible" inactive>
Invisible
</Button>
</div>
)

export const Small = () => <Button size="small">Default</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ exports[`Button respects block prop 1`] = `
box-shadow: none;
color: primer.fg.disabled;
border-color: var(--button-default-borderColor-disabled,undefined);
background-color: var(--button-default-bgColor-disabled,undefined);
}
.c0:disabled [data-component=ButtonCounter] {
Expand Down Expand Up @@ -360,6 +361,7 @@ exports[`Button respects the alignContent prop 1`] = `
box-shadow: none;
color: primer.fg.disabled;
border-color: var(--button-default-borderColor-disabled,undefined);
background-color: var(--button-default-bgColor-disabled,undefined);
}
.c0:disabled [data-component=ButtonCounter] {
Expand Down Expand Up @@ -619,6 +621,7 @@ exports[`Button respects the large size prop 1`] = `
box-shadow: none;
color: primer.fg.disabled;
border-color: var(--button-default-borderColor-disabled,undefined);
background-color: var(--button-default-bgColor-disabled,undefined);
}
.c0:disabled [data-component=ButtonCounter] {
Expand Down Expand Up @@ -879,6 +882,7 @@ exports[`Button respects the small size prop 1`] = `
box-shadow: none;
color: primer.fg.disabled;
border-color: var(--button-default-borderColor-disabled,undefined);
background-color: var(--button-default-bgColor-disabled,undefined);
}
.c0:disabled [data-component=ButtonCounter] {
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/Button/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const getVariantStyles = (variant: VariantType = 'default', theme?: Theme
'&:disabled': {
color: 'primer.fg.disabled',
borderColor: `var(--button-default-borderColor-disabled, ${theme?.colors.btn.border})`,
backgroundColor: `var(--button-default-bgColor-disabled, ${theme?.colors.input.disabledBg})`,
'[data-component=ButtonCounter]': {
color: 'inherit',
},
Expand Down
22 changes: 22 additions & 0 deletions packages/react/src/FormControl/FormControl.features.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,3 +284,25 @@ export const WithLeadingVisual = () => (
</FormControl>
</Box>
)

export const DisabledInputs = () => (
<Box sx={{display: 'flex', flexDirection: 'column', gap: '1rem'}}>
<FormControl disabled>
<FormControl.Label>Disabled checkbox</FormControl.Label>
<Checkbox />
</FormControl>
<FormControl disabled>
<FormControl.Label>Disabled input</FormControl.Label>
<TextInput />
</FormControl>
<FormControl disabled>
<FormControl.Label>Disabled select</FormControl.Label>
<Select>
<Select.Option value="figma">Figma</Select.Option>
<Select.Option value="css">Primer CSS</Select.Option>
<Select.Option value="prc">Primer React components</Select.Option>
<Select.Option value="pvc">Primer ViewComponents</Select.Option>
</Select>
</FormControl>
</Box>
)

0 comments on commit cb54f42

Please sign in to comment.