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 ButtonGroup component #2064

Merged
merged 14 commits into from
Mar 19, 2024
Merged

Conversation

snitin315
Copy link
Member

@snitin315 snitin315 commented Mar 4, 2024

Description

Adds new ButtonGroup component to Blade.

Changes

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 Mar 4, 2024

🦋 Changeset detected

Latest commit: eb5283b

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 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
Contributor

github-actions bot commented Mar 5, 2024

✅ PR title follows Conventional Commits specification.

@rzpcibot
Copy link
Collaborator

rzpcibot commented Mar 6, 2024

Bundle Size Report

Updated Components
Status Component Base Size (kb) Current Size (kb) Diff
Accordion, AccordionItemHeader, AccordionItemBody, AccordionItem 7.331 7.351 +0.020 KB
ActionList, ActionListItem, ActionListItemBadge, ActionListItemBadgeGroup, ActionListItemIcon, ActionListItemText, ActionListSection 12.438 12.464 +0.026 KB
Alert 11.134 11.459 +0.325 KB
Amount 1.101 1.107 +0.006 KB
Badge 0.816 0.827 +0.011 KB
BladeProvider 1.649 1.655 +0.006 KB
BottomSheet 9.482 9.494 +0.012 KB
Box 0.751 0.762 +0.011 KB
Breadcrumb, BreadcrumbItem 2.526 2.536 +0.010 KB
Card, CardBody, CardHeader, CardHeaderIcon, CardHeaderIconButton, CardHeaderLeading, CardHeaderTrailing, CardFooter, CardFooterLeading, CardFooterTrailing 8.794 9.116 +0.322 KB
Carousel, CarouselItem 6.815 6.824 +0.009 KB
Checkbox 5.865 5.869 +0.004 KB
Chip, ChipGroup 5.333 5.350 +0.017 KB
Collapsible, CollapsibleLink, CollapsibleButton, CollapsibleBody 9.042 9.354 +0.312 KB
Counter 0.762 0.774 +0.012 KB
Divider 0.541 0.548 +0.007 KB
Drawer, DrawerBody, DrawerHeader 15.931 15.942 +0.011 KB
Dropdown, DropdownOverlay, DropdownButton, DropdownLink, DropdownFooter, DropdownHeader 22.345 22.656 +0.311 KB
FileUpload 13.245 13.261 +0.016 KB
Indicator 0.903 0.915 +0.012 KB
List, ListItem, ListItemLink, ListItemCode, ListItemText 5.055 5.053 -0.002 KB
Modal 12.568 12.569 +0.001 KB
Popover, PopoverInteractiveWrapper 20.315 20.326 +0.011 KB
ProgressBar 1.687 1.697 +0.010 KB
Radio 4.689 4.710 +0.021 KB
Skeleton 0.754 0.764 +0.010 KB
SpotlightPopoverTour, SpotlightPopoverTourFooter, SpotlightPopoverTourStep 27.921 28.237 +0.316 KB
Switch 4.550 4.563 +0.013 KB
Table, TableHeader, TableHeaderCell, TableHeaderRow, TableBody, TableCell, TableRow, TableFooter, TableFooterCell, TableFooterRow, TablePagination, TableToolbar, TableToolbarActions 49.983 50.294 +0.311 KB
Tabs, TabItem, TabList, TabPanel 6.599 6.604 +0.005 KB
Tag 3.409 3.425 +0.016 KB
ToastContainer, useToast 12.340 12.672 +0.332 KB
Tooltip, TooltipInteractiveWrapper 15.195 15.206 +0.011 KB
Button 5.589 5.921 +0.332 KB
IconButton 0.779 0.786 +0.007 KB
CheckboxGroup 3.971 3.981 +0.010 KB
SelectInput, AutoComplete 17.398 17.401 +0.003 KB
OTPInput 11.424 11.437 +0.013 KB
PasswordInput 13.539 13.547 +0.008 KB
TextArea 11.827 11.821 -0.006 KB
TextInput 13.419 13.428 +0.009 KB
Link 2.090 2.105 +0.015 KB
RadioGroup 3.948 3.957 +0.009 KB
Spinner 1.891 1.900 +0.009 KB
Code 0.604 0.610 +0.006 KB
Display 0.504 0.524 +0.020 KB
Heading 0.468 0.490 +0.022 KB
Text -0.001 0.002 +0.003 KB

Generated by 🚫 dangerJS against eb5283b

Copy link

codesandbox-ci bot commented Mar 6, 2024

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 eb5283b:

Sandbox Source
razorpay/blade: basic Configuration

@snitin315 snitin315 marked this pull request as ready for review March 13, 2024 06:15
@snitin315 snitin315 force-pushed the feat/add-button-group-component branch from f6291c1 to 206b1d3 Compare March 13, 2024 06:44
@snitin315 snitin315 added the Review - L1 First level of review label Mar 14, 2024
// throw error if child is not a button or dropdown with button trigger
/* eslint-disable no-restricted-properties */
if (
!isValidAllowedChildren(child, 'Button') &&
Copy link
Member

Choose a reason for hiding this comment

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

Can we use componentIds.Button?

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
!isValidAllowedChildren(child, 'Button') &&
!isValidAllowedChildren(child, componentIds.Button) &&

anuraghazra
anuraghazra previously approved these changes Mar 14, 2024
Copy link
Member

@anuraghazra anuraghazra left a comment

Choose a reason for hiding this comment

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

Build is failing, unable to see storybook preview.

@snitin315
Copy link
Member Author

@anuraghazra Build is successful, for some reason it's not coming in CI checks as usual.

Preview Link - https://61c19ee8d3d282003ac1d81c-mdcfdyzkei.chromatic.com/

theme,
color,
color: buttonGroupProps.color ?? color,
Copy link
Member

Choose a reason for hiding this comment

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

expected to give ButtonGroup a priority over individual Button?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, all buttons should have the same color in a button group.

@snitin315 snitin315 force-pushed the feat/add-button-group-component branch from 60fffb7 to 009523b Compare March 19, 2024 08:48
@@ -0,0 +1 @@
export * from './ButtonGroup';
Copy link
Member

Choose a reason for hiding this comment

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

export the types too.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's already exported.

export { ButtonGroup };
export type { ButtonGroupProps };

@snitin315 snitin315 merged commit fd304e4 into master Mar 19, 2024
15 of 17 checks passed
@snitin315 snitin315 deleted the feat/add-button-group-component branch March 19, 2024 09:46
anuraghazra pushed a commit that referenced this pull request Apr 9, 2024
 test: add ButtonGroup test cases (#2068)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review - L1 First level of review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants