-
Notifications
You must be signed in to change notification settings - Fork 3
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
Modal
, ConfirmModal
components and design patterns
#88
Conversation
The newer `Example` layout for pattern-library examples is more conducive to responsive-ness than the older `PatternExamples` and `PatternExample` styling. Make it columnar on narrower screens. `Example` is still a prototype layout, but may supersede/replace the table-based `PatternExample(s)` styling in the future. The `Example` layout is used on the `Dialogs` component pattern library page, and it needs to be responsive so one can view the responsive modal patterns in a responsive setting.
// of viewport. | ||
// - sizing: Set a min-width to make sure the modal isn't too dinky. Set | ||
// a max-width to make sure it isn't too ginormously wide on wide screens. | ||
@media screen and (min-width: 48rem) { |
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.
Bah, I had it in an earlier comment here but then deleted it and neglected to re-add: this 48rem
magic is a rem-translation of the 768px
tablet breakpoint from the client. I will make sure to add commenting.
Some feedback on the pattern library unrelated to the changes in this PR: The different font sizes for the component description and example description looks a bit odd, possibly because they are visually part of the same region (that is to say, there is no border or background separating the two paragraphs): |
Noted! There is work to do here, for sure. |
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.
Overall this looks great. I didn't have a lot of comments to add. What use cases did you have in mind for Dialog
s that are not Modal
s?
|
||
// For wider viewports: | ||
// - positioning: keep horizontal centering but bring top nearer to top | ||
// of viewport. |
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 noted this in another comment, but I think we might want to make the vertical centering behavior dependent on the height rather than the width of the viewport.
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.
It's good feedback. I'm working on splitting the media-query-based differentiation out into two now:
- Screens that are wide enough: set a reasonable min- and max-width so that the modal isn't too dinky but also doesn't stretch way out
- Screens that are tall enough: position the modal nearer to the top of the viewport
e.g. Narrow, but tall screen:
I wanted to evaluate replacing a couple of what are now |
11e77e8
to
7d6bfe7
Compare
Modal
, ConfirmModal
components and design patternsModal
, ConfirmModal
components and design patterns
Codecov Report
@@ Coverage Diff @@
## main #88 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 7 8 +1
Lines 115 123 +8
Branches 38 39 +1
=========================================
+ Hits 115 123 +8
Continue to review full report at Codecov.
|
7d6bfe7
to
fa0841f
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.
I had some minor queries but overall this looks good. Please have a look through and make changes as you see fit.
|
||
// This sizing applies to smaller viewports | ||
width: 90vw; | ||
max-width: 90vw; |
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 noticed a jump as the dialog shrinks in size when going from a width that is less than the min-width
media query below to one that is greater.
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.
What would your preferred behavior be? I'm never sure how best to optimize for the "but it isn't animated/smooth when resizing a screen" issue...
fa0841f
to
6a35284
Compare
This (initially draft) PR contains new
Modal
andConfirmModal
components and their corresponding supporting design patterns and pattern-library content.Modal
wraps aDialog
and adds a background overlay and a close-on-outside-click functionality.Modal
+Dialog
here = theDialog
component in theclient
.ConfirmModal
is analogous toConfirmDialog
in theclient
and doesn't deviate too much from it.I've added some responsiveness to the modal positioning and sizing in this variant. See implementation and comments for details (a test to see if the source is self-documenting and commented enough).
In draft until...
To try it out
Check out this branch, run
make dev
and visit the new Dialogs pattern library page in your browser. The modal examples are last on the page.Screenshots
Note that the pattern-library examples include all supported Dialog bells and whistles, including an icon in the header, which may not be applicable to modals. But it's helpful to see everything in the mix...
Modal
, narrow viewport (with initial-focus input):The same
Modal
, wider viewport:ConfirmModal
, narrow viewport:ConfirmModal
, narrow viewport, with excessively long content (NB, this example is not included in source):ConfirmModal
, wider viewport:Fixes #86