diff --git a/.changeset/tame-eggs-taste.md b/.changeset/tame-eggs-taste.md
new file mode 100644
index 00000000000..a88de510a63
--- /dev/null
+++ b/.changeset/tame-eggs-taste.md
@@ -0,0 +1,6 @@
+---
+"@primer/react": major
+"@primer/styled-react": patch
+---
+
+chore(Octicon): remove sx
diff --git a/.playwright/snapshots/components/IconButton.test.ts-snapshots/IconButton-Keybinding-Hint-light-linux.png b/.playwright/snapshots/components/IconButton.test.ts-snapshots/IconButton-Keybinding-Hint-light-linux.png
index d9daf3707d6..43e09aa2cb9 100644
Binary files a/.playwright/snapshots/components/IconButton.test.ts-snapshots/IconButton-Keybinding-Hint-light-linux.png and b/.playwright/snapshots/components/IconButton.test.ts-snapshots/IconButton-Keybinding-Hint-light-linux.png differ
diff --git a/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-colorblind-linux.png b/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-colorblind-linux.png
index b8f8b4d3d69..08f9783397a 100644
Binary files a/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-colorblind-linux.png and b/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-colorblind-linux.png differ
diff --git a/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-dimmed-linux.png b/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-dimmed-linux.png
index 26a45d5aed9..9d435eef02a 100644
Binary files a/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-dimmed-linux.png and b/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-dimmed-linux.png differ
diff --git a/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-high-contrast-linux.png b/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-high-contrast-linux.png
index 9d96119bde4..bbdc1538a83 100644
Binary files a/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-high-contrast-linux.png and b/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-high-contrast-linux.png differ
diff --git a/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-linux.png b/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-linux.png
index 434bace6863..b474579ffc6 100644
Binary files a/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-linux.png and b/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-linux.png differ
diff --git a/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-tritanopia-linux.png b/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-tritanopia-linux.png
index 59ade5e753a..bef6cc2df5e 100644
Binary files a/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-tritanopia-linux.png and b/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-tritanopia-linux.png differ
diff --git a/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-light-colorblind-linux.png b/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-light-colorblind-linux.png
index f5904882203..6a3a36460f5 100644
Binary files a/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-light-colorblind-linux.png and b/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-light-colorblind-linux.png differ
diff --git a/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-light-high-contrast-linux.png b/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-light-high-contrast-linux.png
index ac6d7ff1322..1fa1d1eec30 100644
Binary files a/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-light-high-contrast-linux.png and b/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-light-high-contrast-linux.png differ
diff --git a/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-light-linux.png b/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-light-linux.png
index f4b489b8ab8..3df8252d576 100644
Binary files a/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-light-linux.png and b/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-light-linux.png differ
diff --git a/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-light-tritanopia-linux.png b/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-light-tritanopia-linux.png
index 2b628f5c3c2..c4dd5261047 100644
Binary files a/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-light-tritanopia-linux.png and b/.playwright/snapshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-light-tritanopia-linux.png differ
diff --git a/packages/react/src/AnchoredOverlay/AnchoredOverlay.features.stories.module.css b/packages/react/src/AnchoredOverlay/AnchoredOverlay.features.stories.module.css
index 7b07f7dc17d..8f1eb2584c2 100644
--- a/packages/react/src/AnchoredOverlay/AnchoredOverlay.features.stories.module.css
+++ b/packages/react/src/AnchoredOverlay/AnchoredOverlay.features.stories.module.css
@@ -58,3 +58,7 @@
color: var(--fgColor-muted);
margin-left: var(--base-size-4);
}
+
+.Icon {
+ color: var(--fgColor-muted);
+}
diff --git a/packages/react/src/AnchoredOverlay/AnchoredOverlay.features.stories.tsx b/packages/react/src/AnchoredOverlay/AnchoredOverlay.features.stories.tsx
index e8d710f2975..cfd6f9dc042 100644
--- a/packages/react/src/AnchoredOverlay/AnchoredOverlay.features.stories.tsx
+++ b/packages/react/src/AnchoredOverlay/AnchoredOverlay.features.stories.tsx
@@ -35,11 +35,11 @@ const hoverCard = (
Former beach cat and champion swimmer. Now your friendly octopus with a normal face.
-
+
Interwebs
-
+
Owns this repository
diff --git a/packages/react/src/AnchoredOverlay/AnchoredOverlay.stories.module.css b/packages/react/src/AnchoredOverlay/AnchoredOverlay.stories.module.css
index d2aee9d9598..e227dc685b9 100644
--- a/packages/react/src/AnchoredOverlay/AnchoredOverlay.stories.module.css
+++ b/packages/react/src/AnchoredOverlay/AnchoredOverlay.stories.module.css
@@ -8,3 +8,7 @@
color: var(--fgColor-muted);
margin-left: var(--base-size-4);
}
+
+.Icon {
+ color: var(--fgColor-muted);
+}
diff --git a/packages/react/src/AnchoredOverlay/AnchoredOverlay.stories.tsx b/packages/react/src/AnchoredOverlay/AnchoredOverlay.stories.tsx
index 0c11a0d85ec..78c914c4ab4 100644
--- a/packages/react/src/AnchoredOverlay/AnchoredOverlay.stories.tsx
+++ b/packages/react/src/AnchoredOverlay/AnchoredOverlay.stories.tsx
@@ -31,11 +31,11 @@ const hoverCard = (
Former beach cat and champion swimmer. Now your friendly octapus with a normal face.
-
+
Interwebs
-
+
Owns this repository
diff --git a/packages/react/src/Octicon/Octicon.docs.json b/packages/react/src/Octicon/Octicon.docs.json
index bf36d48e88b..aba5e119e09 100644
--- a/packages/react/src/Octicon/Octicon.docs.json
+++ b/packages/react/src/Octicon/Octicon.docs.json
@@ -35,11 +35,6 @@
"type": "string",
"defaultValue": "text-bottom",
"description": "Sets the `vertical-align` CSS property"
- },
- {
- "name": "sx",
- "type": "SystemStyleObject",
- "deprecated": true
}
],
"subcomponents": []
diff --git a/packages/react/src/Octicon/Octicon.stories.tsx b/packages/react/src/Octicon/Octicon.stories.tsx
index 537c1d935cc..ea024064a9d 100644
--- a/packages/react/src/Octicon/Octicon.stories.tsx
+++ b/packages/react/src/Octicon/Octicon.stories.tsx
@@ -10,9 +10,9 @@ export default meta
export const Default = () =>
-export const Playground: StoryFn = ({'aria-label': ariaLabel, ...args}) => (
-
-)
+export const Playground: StoryFn = ({'aria-label': ariaLabel, icon: _icon, ...args}) => {
+ return
+}
Playground.args = {
'aria-label': 'Heart',
@@ -36,28 +36,10 @@ Playground.argTypes = {
disable: true,
},
},
- sx: {
- controls: false,
- table: {
- disable: true,
- },
- },
as: {
controls: false,
table: {
disable: true,
},
},
- forwardedAs: {
- controls: false,
- table: {
- disable: true,
- },
- },
- theme: {
- controls: false,
- table: {
- disable: true,
- },
- },
}
diff --git a/packages/react/src/Octicon/Octicon.test.tsx b/packages/react/src/Octicon/Octicon.test.tsx
index e3e9c1a3955..950f3adaed4 100644
--- a/packages/react/src/Octicon/Octicon.test.tsx
+++ b/packages/react/src/Octicon/Octicon.test.tsx
@@ -9,11 +9,6 @@ describe('Octicon', () => {
expect(container.firstChild).toHaveClass('test-class')
})
- it('should support `sx`', () => {
- const {container} = render()
- expect(container.firstChild).toHaveStyle('color: rgb(255, 0, 0)')
- })
-
it('should pass along props to the outermost element', () => {
const {container} = render()
expect(container.firstChild).toHaveAttribute('data-testid', 'test-id')
diff --git a/packages/react/src/Octicon/Octicon.tsx b/packages/react/src/Octicon/Octicon.tsx
index a0c52454789..83f3dc61441 100644
--- a/packages/react/src/Octicon/Octicon.tsx
+++ b/packages/react/src/Octicon/Octicon.tsx
@@ -1,30 +1,17 @@
import type {IconProps} from '@primer/octicons-react'
import React from 'react'
-import styled from 'styled-components'
-import type {SxProp} from '../sx'
-import sx from '../sx'
-import type {ComponentProps} from '../utils/types'
-
-type StyledOcticonProps = {icon: React.ElementType; color?: string} & IconProps & SxProp
-
-const Icon = React.forwardRef((props: StyledOcticonProps, ref: React.Ref) => {
- const {icon: IconComponent, ...rest} = props
- return
-})
/**
* @deprecated Use the icon component directly from `@primer/octicons-react` instead
*/
-const Octicon = styled(Icon).withConfig({
- shouldForwardProp(prop) {
- return prop !== 'sx'
- },
-})`
- ${({color, sx: sxProp}) => sx({sx: {color, ...sxProp}})}
-`
+export type OcticonProps = {icon: React.ElementType; as?: React.ElementType} & IconProps
/**
* @deprecated Use the icon component directly from `@primer/octicons-react` instead
*/
-export type OcticonProps = ComponentProps
+const Octicon = React.forwardRef((props: OcticonProps, ref: React.Ref) => {
+ const {icon: IconComponent, ...rest} = props
+ return
+})
+
export default Octicon
diff --git a/packages/react/src/StateLabel/StateLabel.module.css b/packages/react/src/StateLabel/StateLabel.module.css
index 19f3ae958de..df77767a72b 100644
--- a/packages/react/src/StateLabel/StateLabel.module.css
+++ b/packages/react/src/StateLabel/StateLabel.module.css
@@ -100,3 +100,7 @@
.Icon {
margin-right: var(--base-size-4);
}
+
+.Icon:where([data-variant-small]) {
+ width: 1em;
+}
diff --git a/packages/react/src/StateLabel/StateLabel.tsx b/packages/react/src/StateLabel/StateLabel.tsx
index 2e7590f008c..6e9d753f165 100644
--- a/packages/react/src/StateLabel/StateLabel.tsx
+++ b/packages/react/src/StateLabel/StateLabel.tsx
@@ -53,7 +53,6 @@ export type StateLabelProps = React.HTMLAttributes & {
const StateLabel = forwardRef(
({children, status, variant: variantProp = 'normal', className, ...rest}, ref) => {
- const octiconProps = variantProp === 'small' ? {width: '1em'} : {}
// Open and closed statuses, we don't want to show an icon
const noIconStatus = status === 'open' || status === 'closed'
@@ -66,7 +65,12 @@ const StateLabel = forwardRef(
data-status={status}
>
{!noIconStatus && (
-
+
)}
{children}
diff --git a/packages/react/src/StateLabel/__tests__/__snapshots__/StateLabel.test.tsx.snap b/packages/react/src/StateLabel/__tests__/__snapshots__/StateLabel.test.tsx.snap
index 2e1730ccb59..118388c281c 100644
--- a/packages/react/src/StateLabel/__tests__/__snapshots__/StateLabel.test.tsx.snap
+++ b/packages/react/src/StateLabel/__tests__/__snapshots__/StateLabel.test.tsx.snap
@@ -9,7 +9,7 @@ exports[`StateLabel > renders children 1`] = `
>