-
Notifications
You must be signed in to change notification settings - Fork 70
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: Add StudioErrorMessage component #13943
Conversation
6fcee73
to
c7e5b04
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13943 +/- ##
=======================================
Coverage 95.13% 95.13%
=======================================
Files 1676 1678 +2
Lines 22232 22238 +6
Branches 2612 2612
=======================================
+ Hits 21151 21157 +6
Misses 835 835
Partials 246 246 ☔ View full report in Codecov by Sentry. |
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.
Nice ⭐
I just have one question;
I know this is simply a wrapper around the ErrorMessage from DS, but I tested sending a StudioHeading to the children-prop in storybook and then it does not get the error style.
This is probably by design, but can it be a solution that we force string usage when the component is used in Studio in order to get the correct style? 🤔
That might be a good idea, but I think it would be too strict. We may still want to use phrasing content inside the message. This is a typography component, so it is not supposed to contain block-level elements like headings. |
Understand. Is it possible to restrict the children to be of those kind of elements? 🤔 |
Not with types. It could be possible with Javascript on runtime, but that' a quite unusual pattern that just adds unnecessary complexity to the component. For some reason this component renders a Anyways, I think it's best to keep the component API as close as possible to the one in The Design System until we come across a use case where it makes sense to narrow it down. We can always make a more specified component that extends this one. |
Description
Added an
StudioErrorMessage
component based on theErrorMessage
component from The Design System.Related Issue(s)
Verification