-
-
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
Improve state surfacing support #25
Conversation
65422b9
to
814840d
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.
Thanks for all the additions @arkadiuszbachorski, looks great!
Left some smaller comments.
<div | ||
className={cn( | ||
'flex-center', | ||
padding && 'py-8', |
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.
Do we really want to hardcode this to 8?
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.
Most definitely! StateContainer
aims to standarize spacing between elements for any state.
There are two most common way to use it:
- Without
grow
- in that scenario, it just relies on thepadding
- With
grow
- it expands to fulfill the container, but still has thepadding
.
If custom padding is necessary, they can provide custom container or remove it with padding={false}
prop. There is even already case for that in the design system - FormError
component. Nevertheless, by providing defaults we keep it consistent for most usages.
Co-authored-by: Nikolai Madlener <[email protected]>
…into arek/add-error-state-component
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #25 +/- ##
==========================================
- Coverage 81.21% 81.13% -0.08%
==========================================
Files 125 139 +14
Lines 2437 2638 +201
Branches 278 316 +38
==========================================
+ Hits 1979 2140 +161
- Misses 437 477 +40
Partials 21 21
Continue to review full report in Codecov by Sentry.
|
Improve state surfacing support
♻️ Current situation & Problem
Design system needs to establish a consistent and easy way to support operations states: loading, error, empty, success.
⚙️ Release Notes
StanfordBDHG/ENGAGE-HF-Web-Frontend#95 uses all the introduced elements.
📝 Code of Conduct & Contributing Guidelines
By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: