-
Notifications
You must be signed in to change notification settings - Fork 152
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
FEPLT-2129: Replace react-popper by floating-ui #4494
Conversation
Storybook staging is available at https://kiwicom-orbit-dsil-replace-popper-by-floating.surge.sh |
Size Change: +194 B (+0.04%) Total Size: 460 kB
ℹ️ View Unchanged
|
Deploying orbit with Cloudflare Pages
|
cd22f0d
to
441e005
Compare
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.
LEFT_START = "left-start", | ||
LEFT_END = "left-end", | ||
} | ||
export const isFixedPlacement = (placement: string): placement is Placement => |
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.
Why didn't you type placement
as Placement | AutoPlacement
but only as string
?
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.
Because I want to accept any string and then make sure it is a Placement
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'm still slightly confused, why string and not Placement | AutoPlacement
? this function is used in TooltipContent
and ContentWrapper
, where the placement
prop is Placement | AutoPlacement
anyway. Is it for possible future purposes?
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.
By having this on a common place, I don't expect the function to be aware of where it is called, that is why I prefer to receive a more generic type as arg
packages/orbit-components/src/Popover/components/ContentWrapper.tsx
Outdated
Show resolved
Hide resolved
packages/orbit-components/src/Popover/components/ContentWrapper.tsx
Outdated
Show resolved
Hide resolved
packages/orbit-components/src/primitives/TooltipPrimitive/components/TooltipContent.tsx
Outdated
Show resolved
Hide resolved
packages/orbit-components/src/ErrorFormTooltip/Tooltip/index.tsx
Outdated
Show resolved
Hide resolved
The Tooltip vs TooltipPrimitive difference was quite tricky to spot but I have found out that it was actually the story that misled me, by having With that, I noticed that I was compensating the arrow size for the main axis, but not the cross axis, that seems to be needed as well. I added this and stories all look good now. But we should have visual tests… I will create a task for it. |
d385012
to
2dbe2f8
Compare
2dbe2f8
to
0151151
Compare
0151151
to
72bb32b
Compare
packages/orbit-components/src/primitives/TooltipPrimitive/TooltipPrimitive.stories.tsx
Show resolved
Hide resolved
This allows for better usage of the types and enums across all components that need it
With the migration from react-popper to floating-ui, some snapshots needed a small adjustment
72bb32b
to
33aa3ad
Compare
Dependency from react-popper removed and replaced by floating-ui