Skip to content
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

Addition of floating UI helpers #344

Merged
merged 26 commits into from
Jan 5, 2023

Conversation

brenner-company
Copy link
Collaborator

@brenner-company brenner-company commented Nov 18, 2022

The addition of a floating UI modifier & component for further use within other components that use popovers, dropdowns, etc.

The modifier & component are created with the use of https://floating-ui.com/.

This component (& modifier in a more limited way) can:

  • automatically position a floater according to a placement value
  • flip the floater if there is insufficient space on the default placement side
  • negate clipping by a (parent) container with a defined overflow property (auto, scroll, etc.) by utilising a fixed position
  • automatically position and flip a predefined arrow element according to the placement value
  • automatically hide the floater when the reference element is out of view/bounds

What still must be done is:

  • create a Storybook add-on that provides the scrolling/overflow preview I included within the story (reference element needs to be centered within container when the story is loaded)
  • move example styling of reference, floater & arrow to a better location?
  • provide correct tests for the modifier & component

See #333 for additional information.

@brenner-company brenner-company self-assigned this Nov 18, 2022
@brenner-company brenner-company marked this pull request as ready for review December 5, 2022 15:00
@brenner-company
Copy link
Collaborator Author

brenner-company commented Dec 5, 2022

@Dietr @Windvis I think this one is good to go 👍 Even did a small test within the auDropdown component and it seems to work well.

I'll just wait for a final OK from one of you to merge this.

Copy link
Contributor

@Windvis Windvis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work 👍!

For now I think it would be better to keep this functionality "private", so only available for internal use in Appuniversum. If we want to use the functionality in apps as well I think a dedicated generic floating-ui addon would be better suited.

If we go for the private variant I think it makes sense to create an addon/private folder where we can store things. Since we now support only 3.28+ we can remove the app reexports and simply import the private component / modifier where needed without it being available in the "global" template scope.

@Windvis
Copy link
Contributor

Windvis commented Dec 8, 2022

(Also, FYI, I don't think Dieter is working on Appuniversum anymore)

@brenner-company
Copy link
Collaborator Author

Nice work 👍!

Thanks!

For now I think it would be better to keep this functionality "private", so only available for internal use in Appuniversum. If we want to use the functionality in apps as well I think a dedicated generic floating-ui addon would be better suited.

If we go for the private variant I think it makes sense to create an addon/private folder where we can store things. Since we now support only 3.28+ we can remove the app reexports and simply import the private component / modifier where needed without it being available in the "global" template scope.

Sure thing!

Regarding Storybook, I would rather like to keep that story so that Chromatic can run visual tests on it. What would be the best way to go (knowing the component is for internal usage only): keep the story visible in the sidebar but under something like 'internal usage only' or hide the story using a CSS solution mentioned here: storybookjs/storybook#9209 (an internal solution to hide stories in the sidebar is not implemented yet sadly). What do you think?

@brenner-company
Copy link
Collaborator Author

(Also, FYI, I don't think Dieter is working on Appuniversum anymore)

Oh, did not know that 😕 Thanks for giving me a heads-up .

@brenner-company brenner-company removed the request for review from Dietr December 13, 2022 10:27
@Windvis
Copy link
Contributor

Windvis commented Jan 4, 2023

Also, since the component version has a bug, it probably makes sense to not include it for now? I would push a new branch with the current state and remove the component version + docs from this one. That way we can pick it back up when the issue is resolved?

@brenner-company
Copy link
Collaborator Author

I would push a new branch with the current state and remove the component version + docs from this one. That way we can pick it back up when the issue is resolved?

Done! Those changes will be available inside the floating-ui-helpers-with-component-variant branch.

@brenner-company
Copy link
Collaborator Author

@Windvis I think this one is good to go 🤞 Feel free to give the final ok. (I'll finalise the integration of the floating-ui helper within the dropdown component when this is done)

@Windvis Windvis added the internal Used for internal changes that still require a mention in the changelog/release notes. label Jan 5, 2023
@Windvis Windvis merged commit 3636162 into development Jan 5, 2023
@Windvis Windvis deleted the feature/addition-of-floating-ui-helpers branch January 5, 2023 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Used for internal changes that still require a mention in the changelog/release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants