Deprecation of `Toolbar` in favor of new `Flex` component

Đang mở
#600 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@adamkudrna đang làm issue này rồi.

Từ ngày 10/3/2025.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

feature

Today we discussed that Toolbar and ToolbarGroup have dense prop (and that we would like to get rid of ToolbarItem in future if possible). When we look at Grid component, we can see that there are columnGap and rowGap props available. We decided we want to deprecate dense prop and replace it with gap prop. If we want to match Grid props, I would suggest to have columnGap and rowGap instead of gap as it would be better for end-user and we currently have scenarios in which those two gaps can differs.

I thought I would be able to introduce those props easily, but I found out that it would be better to refactor whole Toolbar component and its subcomponents. Why? If you compare Toolbar and Grid props, you can spot the difference:

Grid:

Image

Toolbar:

Image

Grid is far more advanced than Toolbar is. It would be better to abstract logic from Grid and use it with Toolbar. That would cleanToolbar code, but it would require the change of shape of the props as Grid allows to specify value per breakpoint.

If we touch the props, it would be also good to unify naming to have same props for Grid and for Toolbar as they are same on CSS level.

That being said, this would require far more work than simply deprecating dense prop. At this stage, it would be better (in my opinion) to deprecate whole Toolbar component and to finally introduce Flex component we wanted to introduce anyway.

We wanted Flex component and this is the time we can solve more problems with it. We should leave Toolbar deprecated until 1.0.0 is released for smoother transition.

This is my recommendation after quick attempt to solve dense-related issue. What do you think @adamkudrna @mbohal?

Ngôn ngữ chính
TypeScript
Star
23
Fork
10
Merge trung bình
5 ngày 12 giờ
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của react-ui-org/react-ui

Tất cả issue của react-ui-org/react-ui

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.