@goldsteinsveta and I discussed a little bit about ui-components, we agree it needs a refactor.
So the idea is: ui-components should work towards being the de-facto design system of Parity.
Here's a quick summary.
Replace constants with tachyon scales.
In our app, or in ui-components, we should only in rare-cases hardcode numerical values like 2px or 3rem. Prefer in general tachyon scales "mr2" or "w100".
Better folder structure
Ideally, we could avoid having one folder with 100 component files. I once proposed to categorize components like SUI does. But we could see how other big design systems categorize them, and/or find something that makes more sense to us.
globalStyle
Only for modifying body, html, #root and app-wide styles (e.g. font).
Shared.styles
Shared.styles.ts has a lot of components inside it.
We could split out these components into like Button.tsx, Text.tsx, Stacked.tsx, and each of these files would hold ~5-10 variants of that component.
Readability
Still tbd: should we keep components like <Margin top />? It's good for readability, but it unnecessarily adds a <div> in the DOM.
<div>
<MarginTop />
<Button />
</div>
// VS
<div>
<Button className="mt2" />
</div>
Happy to discuss other ideas about ui-components here!
cc @yjkimjunior