Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new ButtonGroup component based on the Timeless Figma design. The component provides a simple wrapper for grouping Button components together with shared properties while allowing individual buttons to override group-level settings.
Changes:
- Added a new ButtonGroup component with TypeScript types, implementation, tests, and Storybook stories
- Exported the component through the main components index
- Includes comprehensive examples demonstrating various button configurations and variants
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/frappe-ui-react/src/components/index.ts | Adds export for the new buttonGroup module |
| packages/frappe-ui-react/src/components/buttonGroup/types.ts | Defines TypeScript interface for ButtonGroup props |
| packages/frappe-ui-react/src/components/buttonGroup/buttonGroup.tsx | Implements the ButtonGroup component that renders a flex container with Button children |
| packages/frappe-ui-react/src/components/buttonGroup/index.ts | Exports the component and types following established patterns |
| packages/frappe-ui-react/src/components/buttonGroup/tests/buttonGroup.tsx | Provides test coverage for rendering, props application, className handling, and click events |
| packages/frappe-ui-react/src/components/buttonGroup/buttonGroup.stories.tsx | Includes comprehensive Storybook stories demonstrating various use cases and configurations |
| fireEvent.click(screen.getByText("Action 2")); | ||
| expect(handleClick2).toHaveBeenCalledTimes(1); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
The component allows individual button props to override group-level props (size, variant, theme), as demonstrated in the IconMixedVariant story. However, there's no test verifying this override behavior. Consider adding a test case that verifies individual buttons can override group-level properties.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR add a new ButtonGroup component based on Espresso by Frappe design.
Screenshot/Screencast
Checklist