-
Notifications
You must be signed in to change notification settings - Fork 638
chore(Octicon): remove sx #6945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9d5b1b0
chore(Octicon): remove sx
francinelucca bd6797b
Update @primer/react version to major
francinelucca 92ea951
Update packages/react/src/StateLabel/StateLabel.module.css
francinelucca fb03098
test(vrt): update snapshots
francinelucca 51180e1
Merge branch 'main' into chore/remove-sx-from-octicon
francinelucca 392e9f9
test(vrt): update snapshots
francinelucca 4ac195e
Merge branch 'main' of github.com:primer/react into chore/remove-sx-f…
francinelucca File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@primer/react": major | ||
"@primer/styled-react": patch | ||
--- | ||
|
||
chore(Octicon): remove sx |
Binary file modified
BIN
-114 Bytes
(98%)
...ponents/IconButton.test.ts-snapshots/IconButton-Keybinding-Hint-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.1 KB
(84%)
...ponents/StateLabel.test.ts-snapshots/StateLabel-Small-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.08 KB
(84%)
.../components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.24 KB
(83%)
...ents/StateLabel.test.ts-snapshots/StateLabel-Small-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.11 KB
(84%)
...apshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.1 KB
(84%)
...ponents/StateLabel.test.ts-snapshots/StateLabel-Small-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.03 KB
(85%)
...onents/StateLabel.test.ts-snapshots/StateLabel-Small-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.02 KB
(85%)
...nts/StateLabel.test.ts-snapshots/StateLabel-Small-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-963 Bytes
(86%)
...pshots/components/StateLabel.test.ts-snapshots/StateLabel-Small-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-899 Bytes
(87%)
...onents/StateLabel.test.ts-snapshots/StateLabel-Small-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,3 +58,7 @@ | |
color: var(--fgColor-muted); | ||
margin-left: var(--base-size-4); | ||
} | ||
|
||
.Icon { | ||
color: var(--fgColor-muted); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,7 @@ | |
color: var(--fgColor-muted); | ||
margin-left: var(--base-size-4); | ||
} | ||
|
||
.Icon { | ||
color: var(--fgColor-muted); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<SVGSVGElement>) => { | ||
const {icon: IconComponent, ...rest} = props | ||
return <IconComponent {...rest} ref={ref} /> | ||
}) | ||
|
||
/** | ||
* @deprecated Use the icon component directly from `@primer/octicons-react` instead | ||
*/ | ||
const Octicon = styled(Icon).withConfig({ | ||
shouldForwardProp(prop) { | ||
return prop !== 'sx' | ||
}, | ||
})<SxProp>` | ||
${({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<typeof Octicon> | ||
const Octicon = React.forwardRef((props: OcticonProps, ref: React.Ref<SVGSVGElement>) => { | ||
const {icon: IconComponent, ...rest} = props | ||
return <IconComponent {...rest} ref={ref} /> | ||
}) | ||
|
||
export default Octicon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,3 +100,7 @@ | |
.Icon { | ||
margin-right: var(--base-size-4); | ||
} | ||
|
||
.Icon:where([data-variant-small]) { | ||
width: 1em; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,7 @@ | |
.LinkWithBoldStyle:hover { | ||
color: var(--fgColor-accent); | ||
} | ||
|
||
.GitMergeIcon { | ||
color: var(--fgColor-onEmphasis); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoop, this diff looks suspicious
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approved it with @langermank! We had some styles that weren't being correctly applied in styles components, so when I migrated I inadvertently "fixed" them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah perfect