-
Notifications
You must be signed in to change notification settings - Fork 645
chore: remove sx from Overlay #6865
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
14 commits
Select commit
Hold shift + click to select a range
1a2a692
chore: remove sx from Overlay
francinelucca 80c4b1b
Merge branch 'main' of github.com:primer/react into chore/remove-sx-f…
francinelucca 35585da
add styled wrapper for Overlay
francinelucca 5220aa3
remove unused import
francinelucca 469a9a1
Update changeset for Overlay component
francinelucca 6fb241f
Update version for @primer/react to major
francinelucca b4a97d2
remove sx usage
francinelucca 93071cb
Merge branch 'chore/remove-sx-from-overlay' of github.com:primer/reac…
francinelucca 4e34144
fix
francinelucca 7066200
fix as type for BaseOverlay
francinelucca b5957bb
Merge branch 'main' into chore/remove-sx-from-overlay
francinelucca e32bb5a
Merge branch 'main' into chore/remove-sx-from-overlay
francinelucca 939930f
Merge branch 'main' into chore/remove-sx-from-overlay
francinelucca 8b95e0f
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: remove sx from Overlay |
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
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,24 @@ | ||
| import {ActionMenu as PrimerActionMenu, type SxProp} from '@primer/react' | ||
| import {sx} from '../sx' | ||
| import styled from 'styled-components' | ||
| import type {ComponentProps} from 'react' | ||
|
|
||
| type ActionMenuOverlayProps = ComponentProps<typeof PrimerActionMenu.Overlay> & SxProp | ||
|
|
||
| const ActionMenuOverlay: React.ComponentType<ActionMenuOverlayProps> = styled(PrimerActionMenu.Overlay).withConfig({ | ||
| shouldForwardProp: prop => (prop as keyof ActionMenuOverlayProps) !== 'sx', | ||
| })` | ||
| ${sx} | ||
| ` | ||
|
|
||
| export const ActionMenu: typeof PrimerActionMenu & { | ||
| Button: typeof PrimerActionMenu.Button | ||
| Anchor: typeof PrimerActionMenu.Anchor | ||
| Overlay: typeof ActionMenuOverlay | ||
| Divider: typeof PrimerActionMenu.Divider | ||
| } = Object.assign(PrimerActionMenu, { | ||
| Button: PrimerActionMenu.Button, | ||
| Anchor: PrimerActionMenu.Anchor, | ||
| Overlay: ActionMenuOverlay, | ||
| Divider: PrimerActionMenu.Divider, | ||
| }) |
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,34 @@ | ||
| import { | ||
| Autocomplete as PrimerAutocomplete, | ||
| type AutocompleteOverlayProps as PrimerAutocompleteOverlayProps, | ||
| } from '@primer/react' | ||
| import {sx, type SxProp} from '../sx' | ||
| import styled from 'styled-components' | ||
| import type {ComponentProps} from 'react' | ||
|
|
||
| export type AutocompleteOverlayProps = PrimerAutocompleteOverlayProps & SxProp | ||
|
|
||
| const AutocompleteOverlay: React.ComponentType<AutocompleteOverlayProps> = styled( | ||
| PrimerAutocomplete.Overlay, | ||
| ).withConfig({ | ||
| shouldForwardProp: prop => (prop as keyof AutocompleteOverlayProps) !== 'sx', | ||
| })<AutocompleteOverlayProps>` | ||
| ${sx} | ||
| ` | ||
|
|
||
| interface AutocompleteExport { | ||
| (props: ComponentProps<typeof PrimerAutocomplete>): React.ReactNode | ||
| Context: typeof PrimerAutocomplete.Context | ||
| Input: typeof PrimerAutocomplete.Input | ||
| Menu: typeof PrimerAutocomplete.Menu | ||
| Overlay: typeof AutocompleteOverlay | ||
| } | ||
|
|
||
| const Autocomplete: AutocompleteExport = Object.assign(PrimerAutocomplete, { | ||
| Context: PrimerAutocomplete.Context, | ||
| Input: PrimerAutocomplete.Input, | ||
| Menu: PrimerAutocomplete.Menu, | ||
| Overlay: AutocompleteOverlay, | ||
| }) | ||
|
|
||
| export {Autocomplete} | ||
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,14 @@ | ||||||||||||||||
| import {Overlay as PrimerOverlay, type OverlayProps as PrimerOverlayProps, sx, type SxProp} from '@primer/react' | ||||||||||||||||
| import styled from 'styled-components' | ||||||||||||||||
| import {type ForwardRefComponent} from '../polymorphic' | ||||||||||||||||
|
|
||||||||||||||||
|
Comment on lines
+1
to
+4
|
||||||||||||||||
| import {Overlay as PrimerOverlay, type OverlayProps as PrimerOverlayProps, sx, type SxProp} from '@primer/react' | |
| import styled from 'styled-components' | |
| import {type ForwardRefComponent} from '../polymorphic' | |
| import {Overlay as PrimerOverlay, type OverlayProps as PrimerOverlayProps} from '@primer/react' | |
| import styled from 'styled-components' | |
| import {type ForwardRefComponent} from '../polymorphic' | |
| import {sx, type SxProp} from '../sx' |
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.
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.
[nitpick] Inconsistent import pattern - this file imports
sxandSxPropfrom../sx, while the Overlay component imports them from@primer/react. All styled components should use the same import source for consistency.