-
Notifications
You must be signed in to change notification settings - Fork 623
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
New Admin UI - Grid
/ Column
Components
#4252
Conversation
Cypress E2E tests have been initiated (for more information, click here). ✨ |
Couple of comments...
|
Re number 2... I would've already done it... but I'm actually having some trouble with the API design and the underlying implementation. I've seen that some libs have the following approach when it comes to responsive grids: // 12 columns for all screen sizes.
<Grid columns={12}>...</Grid>
// Use 12 columns for all sizes, except small screens, where we use 1.
<Grid columns={{ initial: 12, sm: 1 }}>...</Grid> But now.... the only thing that then becomes a bit complicated here is class generation with
Looks to me we'd need to handle the above Maybe we need a different API here? 🤔 Or maybe we don't even need the Grid component at all, but we use it just for old Admin UI? And we simply use TW classes directly? Not sure all in all. |
Grid
/ Col
Components
BTW some other items I have on the list are...
|
Alright, let's try to review this one again. Note that here is some context on why still using grid/col, instead of flex. |
/storybook |
🚀 Storybook Preview |
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.
Thank you, Adrian. I left some “cosmetics” comments, but overall, the PR is an excellent starting point.
packages/admin-ui/src/Grid/Grid.tsx
Outdated
|
||
ColBase.displayName = "Col"; | ||
|
||
const Col = makeDecoratable("Col", ColBase); |
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 do you think about using <Column />
instead? I understand it's mainly a cosmetic choice.
packages/admin-ui/src/Grid/Grid.tsx
Outdated
variants: { | ||
gap: { | ||
comfortable: "px-xl gap-lg", | ||
spacious: "px-xxl gap-xl" |
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 would not manage the outer <Grid />
spacing with padding; it should extend across the full width of its container.
Therefore, I believe we should create a <Container />
component or something similar that manages the spacing and positioning of its children within the viewport.
Its usage would be the following:
<Container> // it contains, pads and optionally centers the content.
<Grid> // it contains colums.
<Column>Column 1</Column>
<Column>Column 2</Column>
</Grid>
</Container>
I went over your comments, all sounds good. Thanks @leopuleo! |
I was thinking merging this, and working on the Container via a separate PR. Because there are a couple of things I need to check actually. Finally... I think we'll also want this be 1-1 with the DS. In other words, our DS should also have a separate Container page. Started working on the Container right in this branch.. but after a bit, I think separate PR is easier. |
Grid
/ Col
ComponentsGrid
/ Column
Components
This PR introduces the Grid / Cell components.
Extra Changes
1. Elevation Fix
Found an issue with the
Elevation
component (not able to receive custom CSS class). Resolved now.2.
svg
HTML Element Displayed As BlockThis is not a change, but a discovery. I've discovered Tailwind's preflight makes all
svg
HTML tags display as blocks by default. Which previously was not the case, and now, for example, in the dashboard, you can noticed icons in the bottom-right being aligned to the left, and not to center. For now did not do anything, just wrote it down in GH project as a reminder.