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

[Fix] Button support for icon only implementation #807

Merged
merged 11 commits into from
Dec 15, 2023

Conversation

LJKaski
Copy link
Collaborator

@LJKaski LJKaski commented Dec 1, 2023

Description

This PR improves support for Buttons with only an icon and no text content out of the box. Some changes:

  • Icon wrapper elements are no longer rendered if corresponding icon is not specified
  • Buttons are square with equal proportions when no text content is given
  • Buttons require either children or an aria-label attribute
  • Button component's icon and iconRight prop types changed from ReactNode to ReactElement
  • ActionMenuProps changed from an interface to a type to accommodate changes

Motivation and Context

This was requested by users and the redundant wrappers were noticed by the team.

How Has This Been Tested?

Tested by running locally on styleguidist and by trying out the new typing inside the project. Needs to be tested in another project to check the typing just in case.

Release notes

Button

Breaking change: Adjusted paddings to accommodate use with only icon and no content.
Breaking change: ButtonProps now require either children or aria-label

ActionMenu

Breaking change: Remove redundant custom styling via "icon only" class.

@LJKaski LJKaski requested a review from riitasointi as a code owner December 1, 2023 14:03
@LJKaski LJKaski self-assigned this Dec 4, 2023
Copy link
Collaborator

@riitasointi riitasointi left a comment

Choose a reason for hiding this comment

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

Tested in a separate project and seems to work well!

@LJKaski LJKaski force-pushed the fix/button-icon-margins branch from 6ba89fb to 70257b4 Compare December 15, 2023 06:40
@LJKaski LJKaski merged commit 3a34d04 into develop Dec 15, 2023
1 check passed
@LJKaski LJKaski mentioned this pull request Apr 19, 2024
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