Skip to content

feat(ui): add extra-small size to Button component#1644

Open
MartinS-git wants to merge 14 commits intomainfrom
ui-button-xs
Open

feat(ui): add extra-small size to Button component#1644
MartinS-git wants to merge 14 commits intomainfrom
ui-button-xs

Conversation

@MartinS-git
Copy link
Copy Markdown
Contributor

@MartinS-git MartinS-git commented Apr 30, 2026

  • Adds xs as a new ButtonSize variant
  • Defines Tailwind classes for xs typography, padding, and icon size
  • Extracts getButtonBase() and iconSize() as helper functions (replacing inline ternaries)
  • Adds XS, XSWithIcon, and XSInProgress stories
  • Adds unit tests for the new size
  • Updates DataGridToolbar story: "Clear Filters" button now uses size="xs"
  • Note: Spinner default margin adjustment will be addressed in a separate PR

Closes #1638

@MartinS-git MartinS-git requested review from a team and franzheidl as code owners April 30, 2026 07:34
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 30, 2026

🦋 Changeset detected

Latest commit: d146f0c

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

This PR includes changesets to release 9 packages
Name Type
@cloudoperators/juno-ui-components Minor
@cloudoperators/juno-app-carbon Patch
@cloudoperators/juno-app-doop Patch
@cloudoperators/juno-app-example Patch
@cloudoperators/juno-app-greenhouse Patch
@cloudoperators/juno-app-heureka Patch
@cloudoperators/juno-app-supernova Patch
@cloudoperators/juno-app-template Patch
@cloudoperators/juno-messages-provider 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

@MartinS-git MartinS-git marked this pull request as draft April 30, 2026 07:36
@MartinS-git MartinS-git marked this pull request as ready for review April 30, 2026 12:19
Copilot AI review requested due to automatic review settings April 30, 2026 12:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an extra-small size variant to the Button component in ui-components, wires it into a real usage example (DataGridToolbar story), and extends stories/tests to cover the new size.

Changes:

  • Extend ButtonSize with "extra-small" and add size-specific typography/padding/icon sizing logic.
  • Adjust in-progress icon rendering (Spinner) to better control spacing/margins.
  • Add Storybook stories + unit tests for the new size and update DataGridToolbar story to use it.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
packages/ui-components/src/components/Button/Button.component.tsx Implements the new extra-small size, refactors sizing helpers, and adjusts Spinner/icon handling.
packages/ui-components/src/components/Button/Button.stories.tsx Adds ExtraSmall stories and updates some story descriptions.
packages/ui-components/src/components/Button/Button.test.tsx Adds unit tests for extra-small rendering and progress state.
packages/ui-components/src/components/DataGridToolbar/DataGridToolbar.stories.tsx Updates toolbar story to showcase an extra-small Button in a constrained layout.

Comment thread packages/ui-components/src/components/Button/Button.component.tsx
Comment thread packages/ui-components/src/components/Button/Button.component.tsx Outdated
Comment thread packages/ui-components/src/components/Button/Button.component.tsx Outdated
Comment thread packages/ui-components/src/components/Button/Button.stories.tsx Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

PR Preview Action v1.8.1

🚀 View preview at
https://cloudoperators.github.io/juno/pr-preview/pr-1644/

Built to branch gh-pages at 2026-05-08 13:43 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

TilmanHaupt
TilmanHaupt previously approved these changes Apr 30, 2026
Comment thread packages/ui-components/src/components/Button/Button.component.tsx Outdated
Comment thread packages/ui-components/src/components/DataGridToolbar/DataGridToolbar.stories.tsx Outdated
Comment thread packages/ui-components/src/components/Button/Button.component.tsx Outdated
MartinS-git and others added 7 commits May 4, 2026 11:21
Signed-off-by: MartinS-git <info@eyepic.de>
Signed-off-by: MartinS-git <info@eyepic.de>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: MartinS-git <info@eyepic.de>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: MartinS-git <info@eyepic.de>
Signed-off-by: MartinS-git <info@eyepic.de>
- Add marginRight prop to Spinner to make built-in margin configurable
- Button uses marginRight prop instead of className hack (jn:!mr-0)
- Update extra-small padding to px-1.5
- Update DataGridToolbar story label to "Clear Filters"
- Add tests for Spinner marginRight prop

Signed-off-by: Martin Schulze <martin.schulze04@sap.com>
Signed-off-by: MartinS-git <info@eyepic.de>
…ange

Signed-off-by: Martin Schulze <martin.schulze04@sap.com>
Signed-off-by: MartinS-git <info@eyepic.de>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

- Rename ButtonSize "extra-small" to "xs" for consistency
- Revert Spinner marginRight prop (to be handled in separate PR)
- Use Spinner className prop instead for icon spacing in Button
- Update Button test to match new "juno-button-xs-size" class name

Signed-off-by: MartinS-git <info@eyepic.de>
Signed-off-by: MartinS-git <info@eyepic.de>
Signed-off-by: MartinS-git <info@eyepic.de>
Signed-off-by: MartinS-git <info@eyepic.de>
Signed-off-by: MartinS-git <info@eyepic.de>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Comment thread packages/ui-components/src/components/Button/Button.component.tsx
Comment thread packages/ui-components/src/components/Button/Button.component.tsx
Comment thread packages/ui-components/src/components/Button/Button.component.tsx
edda
edda previously approved these changes May 7, 2026
Copy link
Copy Markdown
Contributor

@edda edda left a comment

Choose a reason for hiding this comment

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

Other than the valid comment by Copilot regarding line-height for the xs button, looking very good now!

Signed-off-by: MartinS-git <info@eyepic.de>
Signed-off-by: MartinS-git <info@eyepic.de>
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.

[Task](ui): Add extra-small size to Button component

4 participants