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 : Add XS size variant to IconButton component #1822

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mukulpadwal
Copy link
Contributor

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:

  • Added a new case for the XS size in the IconButton component to apply the appropriate padding (padding-block: 0.25rem; - padding-inline: 0.25rem).
  • Updated the BUTTON_SIZES constant to include XS 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 the IconButton 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:

  1. Navigate to the IconButton component in Storybook.
  2. Select the XS size variant.
  3. Verify that the button renders correctly with 4px padding around the icon and that it behaves as expected during interactions (hover, click).

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

Copy link

changeset-bot bot commented Nov 19, 2024

🦋 Changeset detected

Latest commit: c647d7e

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

This PR includes changesets to release 3 packages
Name Type
@strapi/design-system Minor
@strapi/icons Minor
@strapi/ui-primitives Minor

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

Copy link

vercel bot commented Nov 19, 2024

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

Name Status Preview Comments Updated (UTC)
design-system ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 20, 2024 10:32am

@lucasboilly lucasboilly linked an issue Nov 19, 2024 that may be closed by this pull request
@hanpaine hanpaine added source: design-system relates to design-system package community pr: enhancement This PR adds or updates some part of the codebase or features labels Nov 20, 2024
@hanpaine
Copy link
Contributor

Hey @mukulpadwal nice PR! Thanks for submitting, we'll have someone look at it soon 🚀

@lucasboilly
Copy link

@mukulpadwal @simotae14 that's all good 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community pr: enhancement This PR adds or updates some part of the codebase or features source: design-system relates to design-system package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat]: XS variant for IconButton
3 participants