Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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/lovely-planes-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

update icon types and primer octicons
139 changes: 35 additions & 104 deletions package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,13 @@
"@github/relative-time-element": "^4.1.2",
"@lit-labs/react": "1.1.1",
"@primer/behaviors": "1.3.4",
"@primer/octicons-react": "18.3.0",
"@primer/octicons-react": "^19.3.0",
Copy link
Contributor Author

@mattcosta7 mattcosta7 Jun 21, 2023

Choose a reason for hiding this comment

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

I moved from an exact dep, to avoid version conflicts in dotcom, which this would cause eventually otherwise (if dotcom installed, for instance, 19.4.0).

Should octicons-react just be a peer dependency and not a direct dep? This would likely help consumer bundlesize some

"@primer/primitives": "7.11.11",
"@react-aria/ssr": "^3.1.0",
"@styled-system/css": "^5.1.5",
"@styled-system/props": "^5.1.5",
"@styled-system/theme-get": "^5.1.2",
"@types/react-is": "^18.2.1",
"@types/styled-components": "^5.1.11",
"@types/styled-system": "^5.1.12",
"@types/styled-system__css": "^5.0.16",
Expand All @@ -119,6 +120,7 @@
"lodash.isempty": "4.4.0",
"lodash.isobject": "3.0.2",
"react-intersection-observer": "9.4.3",
"react-is": "^18.2.0",
"styled-system": "^5.1.5"
},
"devDependencies": {
Expand Down
7 changes: 4 additions & 3 deletions src/Octicon/Octicon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import {ComponentProps} from '../utils/types'

type StyledOcticonProps = {icon: React.ElementType; color?: string} & IconProps

function Icon({icon: IconComponent, ...rest}: StyledOcticonProps) {
return <IconComponent {...rest} />
}
const Icon = React.forwardRef((props: StyledOcticonProps, ref: React.Ref<SVGSVGElement>) => {
const {icon: IconComponent, ...rest} = props
return <IconComponent {...rest} ref={ref} />
})

const Octicon = styled(Icon)<SxProp>`
${({color, sx: sxProp}) => sx({sx: {color, ...sxProp}})}
Expand Down
Loading