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 group loading #2544

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

fix: button group loading #2544

wants to merge 6 commits into from

Conversation

tewarig
Copy link
Contributor

@tewarig tewarig commented Feb 13, 2025

Description

this fixes - https://razorpay.atlassian.net/browse/DSSUP-245

Changes

Additional Information

Component Checklist

  • Update Component Status Page
  • Perform Manual Testing in Other Browsers
  • Add KitchenSink Story
  • Add Interaction Tests (if applicable)
  • Add changeset

Copy link

changeset-bot bot commented Feb 13, 2025

🦋 Changeset detected

Latest commit: bc674f5

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

This PR includes changesets to release 1 package
Name Type
@razorpay/blade 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

Copy link
Contributor

github-actions bot commented Feb 13, 2025

✅ PR title follows Conventional Commits specification.

Copy link

codesandbox-ci bot commented Feb 13, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit bc674f5:

Sandbox Source
razorpay/blade: basic Configuration

@rzpcibot
Copy link
Collaborator

rzpcibot commented Feb 13, 2025

Bundle Size Report

Updated Components
Status Component Base Size (kb) Current Size (kb) Diff
Alert 11.604 11.590 -0.014 KB
ButtonGroup 1.277 1.338 +0.061 KB
Card, CardBody, CardHeader, CardHeaderIcon, CardHeaderIconButton, CardHeaderLeading, CardHeaderTrailing, CardFooter, CardFooterLeading, CardFooterTrailing 9.384 9.392 +0.008 KB
Collapsible, CollapsibleLink, CollapsibleButton, CollapsibleBody 9.754 9.740 -0.014 KB
DatePicker 87.068 87.050 -0.018 KB
Drawer, DrawerBody, DrawerHeader, drawerPadding 17.580 17.581 +0.001 KB
Dropdown, DropdownOverlay, DropdownButton, DropdownLink, DropdownIconButton, DropdownFooter, DropdownHeader 29.167 29.149 -0.018 KB
SpotlightPopoverTour, SpotlightPopoverTourFooter, SpotlightPopoverTourStep 29.849 29.844 -0.005 KB
Table, TableHeader, TableHeaderCell, TableHeaderRow, TableBody, TableCell, TableRow, TableFooter, TableFooterCell, TableFooterRow, TablePagination, TableToolbar, TableToolbarActions, TableEditableCell, TableEditableDropdownCell 70.495 70.475 -0.020 KB
ToastContainer, useToast 12.943 12.937 -0.006 KB
Button 6.118 6.125 +0.007 KB
OTPInput 30.343 30.344 +0.001 KB
PhoneNumberInput 64.314 64.306 -0.008 KB

Generated by 🚫 dangerJS against bc674f5

Comment on lines +21 to +35
...(variant === 'secondary' && {
'button[role="button"]:first-child': {
borderRight: 'none',
borderTopLeftRadius: makeBorderSize(theme.border.radius.medium),
borderBottomLeftRadius: makeBorderSize(theme.border.radius.medium),
},
'button[role="button"]:not(:first-child):not(:last-child)': {
borderLeft: 'none',
borderRight: 'none',
},
'button[role="button"]:last-child': {
borderLeft: 'none',
borderTopRightRadius: makeBorderSize(theme.border.radius.medium),
borderBottomRightRadius: makeBorderSize(theme.border.radius.medium),
},
Copy link
Member

Choose a reason for hiding this comment

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

How is this related to loading? 🤔

Copy link
Contributor Author

@tewarig tewarig Feb 14, 2025

Choose a reason for hiding this comment

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

Earlier, we added a border to the Button Group container and removed the borders from all individual buttons.
However, when we enabled the loading state for a button, it looked like this:

Screenshot 2025-02-14 at 3 58 11 PM

I think the ideal way to handle this was to modify the border-radius of the buttons. So, I refactored the Button Group code a bit and also updated how the border is handled for the secondary variant.

Screenshot 2025-02-14 at 4 08 15 PM

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.

3 participants