Skip to content

Commit 080e1a3

Browse files
committed
CircleBadge no longer accepts styled system props (#1555)
1 parent bf49a9c commit 080e1a3

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

.changeset/gold-countries-kneel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/components': major
3+
---
4+
5+
CircleBadge no longer accepts styled-system props. Please use the `sx` prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information about `sx` and https://primer.style/react/system-props for context on the removal.

docs/content/CircleBadge.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@ Use CircleBadge to visually connect logos of third party services like in market
1212
</CircleBadge>
1313
```
1414

15-
## System props
16-
17-
<Note variant="warning">
18-
19-
System props are deprecated in all components except [Box](/Box). Please use the [`sx` prop](/overriding-styles) instead.
20-
21-
</Note>
22-
23-
CircleBadge and CircleBadge.Icon components get `COMMON` system props. Read our [System Props](/system-props) doc page for a full list of available props.
24-
2515
## Component props
2616

2717
### CircleBadge

src/CircleBadge.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import styled from 'styled-components'
2-
import {COMMON, get, SystemCommonProps} from './constants'
2+
import {get} from './constants'
33
import StyledOcticon from './StyledOcticon'
44
import sx, {SxProp} from './sx'
55
import isNumeric from './utils/isNumeric'
@@ -15,8 +15,7 @@ type StyledCircleBadgeProps = {
1515
inline?: boolean
1616
variant?: keyof typeof variantSizes
1717
size?: number
18-
} & SystemCommonProps &
19-
SxProp
18+
} & SxProp
2019

2120
const sizeStyles = ({size, variant = 'medium'}: StyledCircleBadgeProps) => {
2221
const calc = isNumeric(size) ? size : variantSizes[variant]
@@ -33,7 +32,6 @@ const CircleBadge = styled.div<StyledCircleBadgeProps>`
3332
background-color: ${get('colors.canvas.default')};
3433
border-radius: 50%;
3534
box-shadow: ${get('shadows.shadow.medium')};
36-
${COMMON};
3735
${sizeStyles};
3836
${sx};
3937
`
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from 'react'
2+
import CircleBadge from '../CircleBadge'
3+
4+
export function shouldAcceptCallWithNoProps() {
5+
return <CircleBadge />
6+
}
7+
8+
export function shouldNotAcceptSystemProps() {
9+
// @ts-expect-error system props should not be accepted
10+
return <CircleBadge backgroundColor="thistle" />
11+
}

0 commit comments

Comments
 (0)