-
Notifications
You must be signed in to change notification settings - Fork 0
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(ButtonIcon): adding support for labelLeft #326
Conversation
WalkthroughThe recent updates introduce enhancements to the Changes
TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Bundle Size
Overall bundle size: 90.94 KB (+25 B +0.03%) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: .coderabbit.yaml
Files selected for processing (5)
- packages/documentation/src/Components/ButtonIcon.stories.tsx (2 hunks)
- packages/ui-components/src/components/Button/ButtonIcon.tsx (3 hunks)
- packages/ui-components/src/components/Button/ButtonTypes.d.ts (1 hunks)
- packages/ui-components/src/components/Button/tests/ButtonIcon.test.tsx (13 hunks)
- packages/ui-components/src/components/Button/utilities.ts (5 hunks)
Additional comments: 10
packages/ui-components/src/components/Button/ButtonIcon.tsx (2)
- 22-22: Adding
labelLeft
to the component props is correctly implemented, ensuring the new feature is received by the component.- 40-40: Including
labelLeft
in thegetButtonClasses
call is essential for applying the correct styling based on the presence of a left label. This change is correctly implemented.packages/ui-components/src/components/Button/ButtonTypes.d.ts (1)
- 91-94: The addition of the
labelLeft
property to theButtonIconProps
type is correctly implemented, enhancing the type definition to support the new feature.packages/documentation/src/Components/ButtonIcon.stories.tsx (2)
- 2-8: The imports for
IconNext
andIconPrevious
are correctly added to support the new story examples.- 28-65: The modifications to the
WithLabel
story, including the addition ofButtonIcon
components withlabelLeft
andlabelRight
for navigation buttons, are correctly implemented. These changes effectively demonstrate the new feature in the storybook documentation.packages/ui-components/src/components/Button/utilities.ts (3)
- 22-22: The addition of
labelLeft
to thegetButtonClassesProps
type is correctly implemented, ensuring the utility functions can accommodate the new feature.- 58-73: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [32-70]
The modifications to the
getButtonSizesClasses
function to handlelabelLeft
alongsidelabelRight
are correctly implemented. These changes ensure that the button's size and padding classes adjust based on the presence of labels, maintaining visual consistency.
- 130-136: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [133-143]
Including
labelLeft
in thegetButtonClasses
function's parameters and passing it togetButtonSizesClasses
is correctly implemented. This ensures that the button's overall classes reflect the new label positioning options.packages/ui-components/src/components/Button/__tests__/ButtonIcon.test.tsx (2)
- 105-126: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [13-121]
The updates to the test descriptions and class expectations to reflect the rendering of button icons with the
labelLeft
andlabelRight
properties are correctly implemented. These changes ensure the unit tests accurately cover the new label positioning options.
- 139-160: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [123-188]
Continuing from the previous comment, the tests for medium and large button icons with labels on the left and right are also correctly updated. These tests comprehensively cover the various configurations of the
ButtonIcon
component, ensuring its behavior is as expected.
Summary by CodeRabbit
New Features
Refactor
Tests