-
Notifications
You must be signed in to change notification settings - Fork 639
Remove sx
props and BoxWithFallback
from TooltipV2
and Tooltip
#6667
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
+48
−33
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
635b765
remove sx props and BoxWithFallback from tooltip
liuliu-dev 3a9dfe6
changeset
liuliu-dev 80df4ba
Merge branch 'main' into liuliu/migrate-tooltip
liuliu-dev 925c38e
Merge branch 'main' into liuliu/migrate-tooltip
liuliu-dev a3639d6
Merge remote-tracking branch 'origin/main' into liuliu/migrate-tooltip
liuliu-dev 60480e0
wip
liuliu-dev 1875bfc
Merge branch 'main' into liuliu/migrate-tooltip
liuliu-dev a82cc87
resolve conflicts
liuliu-dev d2d95ad
revert package json changes
liuliu-dev 1d73e09
match main branch
liuliu-dev 97174be
fix lint issues
liuliu-dev 0319544
update deprecated and experimental tooltip
liuliu-dev 1b1f660
wip
liuliu-dev 3f9a834
tooltipv2
liuliu-dev 11e3967
deprecated tooltip export
liuliu-dev c1fb7a6
fix lint
liuliu-dev 9bcf039
conflicts
liuliu-dev e7d506a
ci fix
liuliu-dev 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,5 @@ | ||
--- | ||
'@primer/react': major | ||
--- | ||
|
||
Update Tooltip component to no longer support 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
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,25 @@ | ||
import {Tooltip as PrimerTooltip, type TooltipProps as PrimerTooltipProps, type SxProp} from '@primer/react' | ||
import { | ||
Tooltip as PrimerDeprecatedTooltip, | ||
type TooltipProps as PrimerDeprecatedTooltipProps, | ||
} from '@primer/react/deprecated' | ||
import {Box} from './Box' | ||
import {forwardRef, type ForwardRefExoticComponent, type RefAttributes} from 'react' | ||
|
||
type TooltipProps = PrimerTooltipProps & SxProp | ||
|
||
const Tooltip: ForwardRefExoticComponent<TooltipProps & RefAttributes<HTMLDivElement>> = forwardRef< | ||
HTMLDivElement, | ||
TooltipProps | ||
>(function Tooltip(props, ref) { | ||
return <Box as={PrimerTooltip} ref={ref} {...props} /> | ||
}) | ||
|
||
export {Tooltip, type TooltipProps} | ||
|
||
type DeprecatedTooltipProps = PrimerDeprecatedTooltipProps & SxProp | ||
|
||
function DeprecatedTooltip(props: DeprecatedTooltipProps) { | ||
return <Box as={PrimerDeprecatedTooltip} {...props} /> | ||
} | ||
export {DeprecatedTooltip, type DeprecatedTooltipProps} |
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,3 +1,4 @@ | ||
export {TabNav, type TabNavProps, type TabNavLinkProps} from './components/TabNav' | ||
export {Dialog, type DialogProps, type DialogHeaderProps} from './components/DialogV1' | ||
export {Octicon, Tooltip, type TooltipProps} from '@primer/react/deprecated' | ||
export {Octicon} from '@primer/react/deprecated' | ||
export {DeprecatedTooltip as Tooltip, type DeprecatedTooltipProps as TooltipProps} from './components/Tooltip' |
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.
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.
should we do the new
as
hack just in case? I think in theory it affects every componentThere 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 think this only affects
polymorphic
components that take anas
prop,Tooltip
isn’t one of them, so it should be fine.I tested it in
primer-react.browser.test.tsx
and confirmed that the props and children are passed correctly forTooltip
.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 got it, thanks! ❤️