-
Notifications
You must be signed in to change notification settings - Fork 10
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/rui modal #51
base: master
Are you sure you want to change the base?
Conversation
Please see above draft PR for initial Modal core logic and Focus Trap implementation |
--rui-modal__actions-margin: 10px 0; | ||
|
||
/** | ||
* @variable Actions section padding |
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.
Can we add alignment to the action box, and allow the user to configure these buttons to be aligned left/center/right
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'll add styling hook for alignment :)
www/package.json
Outdated
@@ -34,13 +34,21 @@ | |||
"@mdx-js/mdx": "^1.0.0-rc.4", | |||
"@mdx-js/react": "^1.0.0-rc.5", | |||
"@rhythm-ui/button-react": "^1.0.0", | |||
"@rhythm-ui/modal-react": "^1.0.0", |
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.
1 import is sufficient ;) (I think this is a generator issue as I've seen it elsewhere as well)
|
||
.modal__heading > ::slotted([slot="heading"]) { | ||
margin: 0; | ||
font-size: 22px; |
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 do we set fonts here instead of just relying on the users configuration for default text tags? Should we remove this? (or at least make it configurable)
} | ||
|
||
.modal__detail > ::slotted([slot="detail"]) { | ||
font-size: 16px; |
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.
Same comment as the heading, should be set by core css for text tags
* The size of the modal | ||
*/ | ||
@property({type: String}) | ||
public size: 'small' | 'medium' | 'fullscreen' = 'small'; |
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.
would prefer to use large
over fullscreen here.
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.
@ricominten I think fullscreen makes sense here as it is styled to take up the full screen - so I don't agree with renaming it to large. Would adding a 3rd 'large' variant be okay instead?
<div slot="detail"> | ||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis.</p> | ||
</div> | ||
<rui-button slot="confirm">Confirm</rui-button> |
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.
Is there a way to make a more generic action slot and just given them onClick events handlers? We have a current use-case where we have 3 action items in a modal and this solution would not support that.
</rui-modal> | ||
``` | ||
|
||
<rui-button onClick={() => { |
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.
Can we move these buttons inside the preview so that you can see how to open the modals?
@jnelssonsmith @jennasalau It might be worth looking into this for the behaviour of our focus trap: https://github.com/WICG/inert |
# Conflicts: # www/package.json # www/src/templates/Component/Component.tsx
Changes
@rhythm-ui/a11y-utils
package that contains the newFocusTrap
helper classFocusTrap
class, that creates and manages a focus trap@rhythm-ui/utils
package that contains generate UUID function