Skip to content

feat(layout-components): add Grid component and rethink other#2509

Draft
ValeraS wants to merge 5 commits intomainfrom
feat/layout-components
Draft

feat(layout-components): add Grid component and rethink other#2509
ValeraS wants to merge 5 commits intomainfrom
feat/layout-components

Conversation

@ValeraS
Copy link
Collaborator

@ValeraS ValeraS commented Nov 18, 2025

No description provided.

@gravity-ui
Copy link
Contributor

gravity-ui bot commented Nov 18, 2025

🎭 Component Tests Report is ready.

@ValeraS ValeraS force-pushed the feat/layout-components branch from fc09da5 to ab32c0a Compare December 9, 2025 14:46
@gravity-ui
Copy link
Contributor

gravity-ui bot commented Dec 9, 2025

Preview is ready.

@gravity-ui
Copy link
Contributor

gravity-ui bot commented Dec 9, 2025

🎭 Component Tests Report is ready.

}

export interface FlexStyleProps
extends Omit<BoxAlignmentStyleProps, 'gap' | 'justifyItems' | 'placeItems'> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we omiting these two, justifyItems and placeItems?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they don't make sense for flex.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's comment for future us)

for (const [key, value] of Object.entries(borderStyleProps)) {
if (style[key as keyof typeof borderStyleProps]) {
style[value] = 'solid';
style.boxSizing = 'border-box';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we doing this? Setting boxSizing might be surprising for user

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, in most cases it makes sense to measure elements within visible boundaries. The user can set the desired box-sizing.

}

const spacingRe = /^spacing-(\d+|half)$/;
export function getSpacingValue(value: unknown) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we also add support for multiple values like in native property: gap: <'row-gap'> <'col-gap'>?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it complicates things. The User can use explicit values e.g. 8px 16px or explicit props columnGap, rowGap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants