-
Notifications
You must be signed in to change notification settings - Fork 2
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
Consolidate *Dialog
props and documentation; export Dialog
#941
Conversation
Keep this prop name consistent with existing `Modal` component for easier migration.
Our conventions suggest that boolean props should typically have a default value of `false`, and be named for their behavior when `true`. The props affected here have different defaults on `Dialog` than `ModalDialog`, and are renamed accordingly.
Codecov Report
@@ Coverage Diff @@
## main #941 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 65 65
Lines 880 880
Branches 313 313
=========================================
Hits 880 880
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Idea: Keep both Then inside the component we can do something in the lines of |
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.
👍🏼
This is a sensible idea, thank you. I've pushed another commit that does exactly this. Docs are updated also. |
Looks good :) |
This PR consolidates props naming, organization and documentation for
Dialog
andModalDialog
, and addsDialog
to the package API1. It:Modal
easierDialog
from the package (next) entrypoint (notModalDialog
, yet, because of some deficiencies in theuseTabKeyNavigation
hook when combined with embedded interactive widgets likeDataTable
andTabList
.Regarding the changing of a few prop names:
size
-> (back to)width
: I got a little zealous early on in the implementation of the newModalDialog
and wanted to start moving towards the standard theme-/customization-related prop names I presented to the team several weeks ago. However, it's distracting right now and will make migration fromModal
more tedious. Change this prop name back towidth
so that it is unchanged fromModal
.ModalDialog
because their defaults differ fromDialog
, and our conventions suggest that booleans should default false and be named for their effect when set (true
):closeOnEscape
=>disableCloseOnEscape
restoreFocus
=>disableRestoreFocus
Footnotes
Holding for now on adding
ModalDialog
to API until some nuances with trapped-focus and embedded interactive widgets (e.g.DataTable
,TabList
) can be perfected. ↩