-
Notifications
You must be signed in to change notification settings - Fork 0
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
feature: v2 #7
feature: v2 #7
Conversation
I am thinking of changing |
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.
Great work @marlonmarcello , I dig the new setup. A few ideas and tweaks from me, below. One other thing which I cannot properly comment on — we should enforce stylelint/order
on these CSS modules
Thanks, lmk if you want to chat about any of this!
🦋 Changeset detectedLatest commit: f533c1e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
All done now @andrewrubin |
All changes looking good! We should release a beta version to make sure that adding |
Converting it to a Draft while we wait for hooks v2 |
Description
I was about to start work on the Modal component for the component library and noticed that this could use some love so one thing led to another and I ended up rewriting it and modernizing the setup as well.
If this works well, our other libraries can follow suit and start shipping types and CSS modules.
V2
Changes
The old design of the modal was honestly great but it had an achilles heel, it used an internal context to handle the transition and syncing that with state which caused:
To solve these I decoupled things and inverted the control from the component to the hook
This change also makes issue #2 irrelevant. Customizing the component is just a matter os styling with css and the only trick is the
transitionDuration
which is I explained in the README updates.New things
Modernized the library with:
Screenshots
Screen.Recording.2023-11-21.at.7.36.22.PM.mov
Usage
Simple
No custom transition, no focus management
Complete
With custom transition, focus management and hash trigger