Skip to content
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

feat(IconButton): Adjust IconButton size. Deprecate size="large" and children #2576

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

maxcheremisin
Copy link
Member

@maxcheremisin maxcheremisin commented Sep 11, 2023

Purpose of PR

  • adjust IconButton size (Small: 32 x 32 px, Medium: 40 x 40 px)
  • deprecate implicit inherited props from base Button component (children and size="large")

Before:
image

After:
image

@changeset-bot
Copy link

changeset-bot bot commented Sep 11, 2023

🦋 Changeset detected

Latest commit: 78e7607

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 32 packages
Name Type
@contentful/f36-button Patch
@contentful/f36-accordion Patch
@contentful/f36-asset Patch
@contentful/f36-autocomplete Patch
@contentful/f36-badge Patch
@contentful/f36-card Patch
@contentful/f36-collapse Patch
@contentful/f36-copybutton Patch
@contentful/f36-core Patch
@contentful/f36-datetime Patch
@contentful/f36-datepicker Patch
@contentful/f36-drag-handle Patch
@contentful/f36-entity-list Patch
@contentful/f36-empty-state Patch
@contentful/f36-forms Patch
@contentful/f36-icon Patch
@contentful/f36-list Patch
@contentful/f36-menu Patch
@contentful/f36-modal Patch
@contentful/f36-note Patch
@contentful/f36-notification Patch
@contentful/f36-pagination Patch
@contentful/f36-pill Patch
@contentful/f36-popover Patch
@contentful/f36-skeleton Patch
@contentful/f36-spinner Patch
@contentful/f36-table Patch
@contentful/f36-tabs Patch
@contentful/f36-text-link Patch
@contentful/f36-tooltip Patch
@contentful/f36-typography Patch
@contentful/f36-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Sep 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
forma-36 ✅ Ready (Inspect) Visit Preview Oct 11, 2023 6:58am

@damann
Copy link

damann commented Sep 11, 2023

Screenshot 2023-09-11 at 13 56 57

@maxcheremisin In the preview the two sizes are the same. Otherwise this is good to go from my point of view.

@github-actions
Copy link

github-actions bot commented Sep 11, 2023

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
CommonJS 129.58 KB (+0.06% 🔺) 2.6 s (+0.06% 🔺) 66 ms (+27.29% 🔺) 2.7 s
Module 126.04 KB (+0.06% 🔺) 2.6 s (+0.06% 🔺) 62 ms (-35.43% 🔽) 2.6 s

@maxcheremisin
Copy link
Member Author

maxcheremisin commented Sep 11, 2023

Screenshot 2023-09-11 at 13 56 57 @maxcheremisin In the preview the two sizes are the same. Otherwise this is good to go from my point of view.

I didn't touch this part. The Icon is smaller on the second row. But now I changed this example to preview the small IconButton (not only the Icon itself)

image

@Lelith
Copy link
Collaborator

Lelith commented Sep 18, 2023

Can i still produce large buttons with icons? or is this considered a breaking change?

@massao
Copy link
Contributor

massao commented Sep 18, 2023

Can i still produce large buttons with icons? or is this considered a breaking change?

Since it only picks the size from the Base Button type, I thing it is possible to pass large as size, and the style returns an empty {}, so it won't override anything from the button, and it pass the size down to the button too, so it should get the large size.

Yeah, just tried it on the storybook of this branch: https://5fd1dda724cc620021ace8c5-jktwsdgcgl.chromatic.com/?path=/story/components-button-iconbutton--basic&args=variant:secondary;size:large

@maxcheremisin
Copy link
Member Author

Can i still produce large buttons with icons? or is this considered a breaking change?

Gonna be a breaking change in the next major release. For now it works the same way as @massao mentioned.

Copy link
Collaborator

@cf-remylenoir cf-remylenoir left a comment

Choose a reason for hiding this comment

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

Looking good 👍

@maxcheremisin maxcheremisin merged commit 891308e into main Oct 11, 2023
12 checks passed
@maxcheremisin maxcheremisin deleted the feat/IconButton_adjust_size branch October 11, 2023 13:22
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.

None yet

5 participants