Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 677
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
1a2a69280c4b1b35585da5220aa3469a9a16fb241fb4a97d293071cb4e341447066200b5957bbe32bb5a939930f8b95e0fFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| 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 |
| 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, | ||
| }) |
| 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} | ||
| 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
CopilotAI | ||||||||||||||||
| import{OverlayasPrimerOverlay,typeOverlayPropsasPrimerOverlayProps,sx,typeSxProp}from'@primer/react' | |
| importstyledfrom'styled-components' | |
| import{typeForwardRefComponent}from'../polymorphic' | |
| import{OverlayasPrimerOverlay,typeOverlayPropsasPrimerOverlayProps}from'@primer/react' | |
| importstyledfrom'styled-components' | |
| import{typeForwardRefComponent}from'../polymorphic' | |
| import{sx,typeSxProp}from'../sx' |
Uh oh!
There was an error while loading. Please reload this page.
CopilotAISep 24, 2025
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.