-
Notifications
You must be signed in to change notification settings - Fork 536
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dropdown no longer accepts styled system props
- Loading branch information
Showing
4 changed files
with
39 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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,5 @@ | ||
--- | ||
'@primer/components': major | ||
--- | ||
|
||
Dropdown no longer accepts styled-system props. Please use the `sx` prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information about `sx` and https://primer.style/react/system-props for context on the removal. |
This file contains 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 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 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,20 @@ | ||
import React from 'react' | ||
import Dropdown from '../Dropdown' | ||
|
||
export function shouldAcceptCallWithNoProps() { | ||
return <Dropdown /> | ||
} | ||
|
||
export function shouldNotAcceptSystemProps() { | ||
return ( | ||
<> | ||
{/* @ts-expect-error system props should not be accepted */} | ||
<Dropdown.Caret backgroundColor="thistle" />,{/* @ts-expect-error system props should not be accepted */} | ||
<Dropdown.Menu backgroundColor="thistle" />,{/* @ts-expect-error system props should not be accepted */} | ||
<Dropdown.Item backgroundColor="thistle" />, | ||
{/* this will not error for now, but once Button removes styled system props, this line should | ||
be updated with a @ts-expect-error */} | ||
<Dropdown.Button backgroundColor="thistle" /> | ||
</> | ||
) | ||
} |