-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat(button): add v5 color support #113
Conversation
6648d55
to
1923944
Compare
7612b25
to
9c54a91
Compare
e1157ba
to
001f8e4
Compare
src/core/Button/style.ts
Outdated
type V5ButtonProps = Props & ExtraProps & Omit<ButtonProps, "color">; | ||
|
||
// Please keep this in sync with the props used in `ExtraProps` | ||
const doNotForwardProps = [ |
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.
perhaps we could rename this to nonMuiProps
or something along those lines? That is a little more expressive around why we don't want to forward these props. (I'm happy to make this change but wanted to run it by you first).
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.
Ooh, great point! Updated 😄 Thank you!
I like this approach and how the styles function more clearly encapsulate different styles and allow us to reuse the function from one place! Thank you for putting this together! One general comment (and I'm happy to make this change), for the "external" interface for a button (provided in |
This is a follow-on to the last comment. I think we don't actually need to pass In conjunction with my last comment, I feel like if we can do this, we would have each layer encapsulated pretty nicely. so the external interface is just a user specifies a So for adding an error button style, the external interface would be to pass in There is one potential gotcha I can see with this (which I think we talked about before in Slack). Currently, we only have a Sorry for another super long writeup on this 😅. I'm definitely open to just getting on a call to talk through any of this if that's easier and happy to tackle the stuff that I've mentioned here! |
Woah yeah 🤯 How did you get the notification? Did we accidentally tag you somehow?? |
Thanks so much for the thoughtful comment 🤩 🙏 ! Yeah, exposing MUI props at the top level is intentional, because our SDS components need to provide the flexibility (and escape hatches) for any product to overwrite the style as needed. The reason is because SDS aims to provide reasonable defaults as recommendations (instead of prescriptions), but ultimately the product team should retain the control of how they want to style their components. This will continue to be needed as external partners start using SDS as well 🙆♂️ |
85eddad
to
6192105
Compare
@jfoo1984 Thanks again for all the great ideas and feedback 🎉 🤩 🙏 I've updated the PR according to our discussion this morning. PTAL thank you! |
@SDS-Design That's amazing! Really nice meeting you too, Sandra 😂 🎉 Hopefully you get to use this component library down the road 🤩 👏 Have an amazing day!
|
a7b747e
to
b3f270a
Compare
isAllCaps?: boolean; | ||
isRounded?: boolean; | ||
/** | ||
* TODO(185930): Remove custom `color` prop when we upgrade to MUIv5. |
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.
@mdjmoore I forgot we haven't merged the button PR 😂
Also created a ticket already!
https://app.shortcut.com/sci-design-system/story/185930/material-ui-mui-v5-todos
Thank you!
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.
┗(^0^)┓
I'll double check this PR addresses specs from https://app.shortcut.com/sci-design-system/story/188176/implement-error-variant-on-button-component ! |
No longer needed, since MUIv5 migration is done! |
title: "type_of_change(scope_of_work): ticket title"
reviewers: "sds-eng, sds-design"
Summary
Structural Element (Base, Gene, DNA, Chromosome or Cell)
Shortcut ticket: sh-XXXX
This ticket adds MUI button v5 color support, which expands v4's options "primary", "secondary", to
color?: "primary" | "secondary" | "success" | "error" | "warning" | "info";
Implementation inspiration from: mui/material-ui#13875 (comment)
Checklist
defaultTheme.ts
used wherever possible