Skip to content
Draft
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/cool-apricots-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': major
---

Update CircleBadge component to no longer support sx
5 changes: 0 additions & 5 deletions packages/react/src/CircleBadge/CircleBadge.docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@
"name": "as",
"type": "React.ElementType",
"defaultValue": "\"div\""
},
{
"name": "sx",
"type": "SystemStyleObject",
"deprecated": true
}
],
"subcomponents": [
Expand Down
5 changes: 1 addition & 4 deletions packages/react/src/CircleBadge/CircleBadge.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import styled from 'styled-components'
import {get} from '../constants'
import Octicon from '../Octicon'
import type {SxProp} from '../sx'
import sx from '../sx'
import isNumeric from '../utils/isNumeric'
import type {ComponentProps} from '../utils/types'

Expand All @@ -16,7 +14,7 @@ type StyledCircleBadgeProps = {
inline?: boolean
variant?: keyof typeof variantSizes
size?: number
} & SxProp
}

const sizeStyles = ({size, variant = 'medium'}: StyledCircleBadgeProps) => {
const calc = isNumeric(size) ? size : variantSizes[variant]
Expand All @@ -34,7 +32,6 @@ const CircleBadge = styled.div<StyledCircleBadgeProps>`
border-radius: 50%;
box-shadow: ${get('shadows.shadow.medium')};
${sizeStyles};
${sx};
`

const CircleBadgeIcon = styled(Octicon)`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

exports[`CircleBadge > respects the inline prop 1`] = `
<div
class="sc-gsFSXq sZiDv"
class="sc-gsFSXq feWHvC"
/>
`;

exports[`CircleBadge > respects the variant prop 1`] = `
<div
class="sc-gsFSXq bQLtXz"
class="sc-gsFSXq NBqFO"
/>
`;

exports[`CircleBadge > uses the size prop to override the variant prop 1`] = `
<div
class="sc-gsFSXq fMmXtr"
class="sc-gsFSXq eWWFbq"
size="20"
/>
`;
Loading