Skip to content
Merged
5 changes: 5 additions & 0 deletions .changeset/breezy-fireants-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Button counter contrast fixes
30 changes: 7 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"@lit-labs/react": "1.1.1",
"@primer/behaviors": "1.3.3",
"@primer/octicons-react": "^18.0.0",
"@primer/primitives": "7.11.7",
"@primer/primitives": "7.11.8",
"@react-aria/ssr": "^3.1.0",
"@styled-system/css": "^5.1.5",
"@styled-system/props": "^5.1.5",
Expand Down
48 changes: 48 additions & 0 deletions src/Button/Button.features.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,54 @@ export const TrailingCounter = () => {
)
}

export const TrailingCounterAllVariants = () => {
const [count, setCount] = useState(0)
return (
<div style={{display: 'flex', flexDirection: 'row', gap: '1rem'}}>
<Button onClick={() => setCount(count + 1)}>
Watch
<Button.Counter>{count}</Button.Counter>
</Button>
<Button disabled onClick={() => setCount(count + 1)}>
Watch
<Button.Counter>{count}</Button.Counter>
</Button>
<Button variant="primary" onClick={() => setCount(count + 1)}>
Watch
<Button.Counter>{count}</Button.Counter>
</Button>
<Button variant="primary" disabled onClick={() => setCount(count + 1)}>
Watch
<Button.Counter>{count}</Button.Counter>
</Button>
<Button variant="outline" onClick={() => setCount(count + 1)}>
Watch
<Button.Counter>{count}</Button.Counter>
</Button>
<Button variant="outline" disabled onClick={() => setCount(count + 1)}>
Watch
<Button.Counter>{count}</Button.Counter>
</Button>
<Button variant="danger" onClick={() => setCount(count + 1)}>
Watch
<Button.Counter>{count}</Button.Counter>
</Button>
<Button variant="danger" disabled onClick={() => setCount(count + 1)}>
Watch
<Button.Counter>{count}</Button.Counter>
</Button>
<Button variant="invisible" onClick={() => setCount(count + 1)}>
Watch
<Button.Counter>{count}</Button.Counter>
</Button>
<Button variant="invisible" disabled onClick={() => setCount(count + 1)}>
Watch
<Button.Counter>{count}</Button.Counter>
</Button>
</div>
)
}

export const TrailingAction = () => <Button trailingAction={TriangleDownIcon}>Trailing action</Button>

export const Block = () => <Button block>Default</Button>
Expand Down
10 changes: 5 additions & 5 deletions src/Button/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const getVariantStyles = (variant: VariantType = 'default', theme?: Theme
boxShadow: `${theme?.shadows.btn.danger.hoverShadow}`,
'[data-component=ButtonCounter]': {
backgroundColor: 'btn.danger.hoverCounterBg',
color: 'btn.danger.hoverText',
color: 'btn.danger.hoverCounterFg',
},
},
'&:active:not([disabled])': {
Expand All @@ -86,7 +86,7 @@ export const getVariantStyles = (variant: VariantType = 'default', theme?: Theme
backgroundColor: 'btn.danger.disabledBg',
borderColor: 'btn.danger.disabledBorder',
'[data-component=ButtonCounter]': {
color: 'inherit',
color: 'btn.danger.disabledCounterFg',
backgroundColor: 'btn.danger.disabledCounterBg',
},
},
Expand Down Expand Up @@ -156,7 +156,7 @@ export const getVariantStyles = (variant: VariantType = 'default', theme?: Theme
boxShadow: `${theme?.shadows.btn.outline.hoverShadow}`,
'[data-component=ButtonCounter]': {
backgroundColor: 'btn.outline.hoverCounterBg',
color: 'inherit',
color: 'btn.outline.hoverCounterFg',
},
},
'&:active:not([disabled])': {
Expand All @@ -172,12 +172,12 @@ export const getVariantStyles = (variant: VariantType = 'default', theme?: Theme
borderColor: 'btn.border',
'[data-component=ButtonCounter]': {
backgroundColor: 'btn.outline.disabledCounterBg',
color: 'inherit',
color: 'btn.outline.disabledCounterFg',
},
},
'[data-component=ButtonCounter]': {
backgroundColor: 'btn.outline.counterBg',
color: 'btn.outline.text',
color: 'btn.outline.counterFg',
},
'&[aria-expanded=true]': {
color: 'btn.outline.selectedText',
Expand Down