Skip to content
Merged
Show file tree
Hide file tree
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
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 @@ -356,6 +357,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 @@ -611,6 +613,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 @@ -867,6 +870,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})`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure theme.colors.input.disabledBg is the right path for the fallback? It's rendering as undefined in the Jest snapshot tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like the border color above is also undefined, so I assumed there's something up with the test

'[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>
)