feat : Add XS size variant to IconButton component #1822
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does it do?
This PR introduces an XS variant for the
IconButton
component, adding a smaller button size option with 4px padding (0.25rem) around the icon. The changes include:XS
size in theIconButton
component to apply the appropriate padding (padding-block: 0.25rem; - padding-inline: 0.25rem
).BUTTON_SIZES
constant to includeXS
as a valid option:export const BUTTON_SIZES = ['XS', 'S', 'M', 'L']
.Adjusted documentation to reflect the addition of the new
XS
size.Why is it needed?
The addition of the
XS
variant for theIconButton
component addresses the need for smaller buttons in certain parts of the CMS. This will allow for a more elegant UI and simplify the code by eliminating the need to manually define hover states and click areas for each instance. The XS size will provide a more compact and consistent option for icon-only buttons in small UI elements.How to test it?
To test the new XS size, follow these steps:
IconButton
component in Storybook.XS
size variant.Additionally, a video demonstrating the changes has been attached for visual reference, showing the component's behavior with the new XS size.
XS.size.variant.to.IconButton.component.mp4
Related issue(s)/PR(s)
#1820