-
Notifications
You must be signed in to change notification settings - Fork 16
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
refactor: move all core components to widgets #5
Conversation
This introduces the new separation of what is a core component (style + structure) and what is a widget (behavior). The idea is to keep core components very stable and generic over time, and instead using the concept of "widges" to mean things that are fully formed and usable directly in an application. This stability means that it becomes easier and safer to build new components by composing core components. It also provides a clear distinction between what is a core component and what is a widget. BREAKING CHANGE: All @dhis2/ui-core exports have been migrated to @dhis2/ui-widgets.
BREAKING CHANGE: base components can hold a ref.
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'm probably a bit early for a proper review, but left some comments anyway.
export default css` | ||
.icon { | ||
padding-left: ${spacers.dp12}; | ||
} | ||
|
||
.icon-only.icon { | ||
padding-left: 6px; | ||
} | ||
|
||
.icon-only { | ||
padding: 0; | ||
} | ||
|
||
.icon-only i { | ||
margin-right: 0; | ||
margin-left: 0; | ||
} | ||
|
||
.button-icon { | ||
margin-right: 6px; | ||
color: inherit; | ||
fill: inherit; | ||
font-size: 26px; | ||
vertical-align: middle; | ||
pointer-events: none; | ||
} | ||
` |
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's the reasoning behind this split? I'd expect that the icon-related styles are also just part of the ButtonBase
. I'm sure you've got a good reason for it, but I don't immediately see it....
@HendrikThePendric If you would like to review this, go ahead. Keep this in mind:
The main thing to think about:
|
@varl thanks for explaining, luckily that's how interpreted the changes I was seeing already 😄
Is the comment above related to my #5 (comment)? I still don't really see why the |
The icon is a component itself, so it has its own "style and structure" that is not part of the ButtonBase atom. Having an "icon button" is a DHIS2 specific behavior that composes a |
Aha. Yes, the penny has dropped. Thanks for that. |
🎉 This PR is included in version 5.0.0-alpha.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 5.0.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This introduces the new separation of what is a core component (style +
structure) and what is a widget (behavior). The idea is to keep core
components very stable and generic over time, and instead using the
concept of "widges" to mean things that are fully formed and usable
directly in an application.
This stability means that it becomes easier and safer to build new
components by composing core components. It also provides a clear
distinction between what is a core component and what is a widget.
BREAKING CHANGE: All @dhis2/ui-core exports have been migrated to
@dhis2/ui-widgets.