-
Notifications
You must be signed in to change notification settings - Fork 146
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(blade): Changes in components for X migration #2448
base: master
Are you sure you want to change the base?
Conversation
✅ PR title follows Conventional Commits specification. |
|
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 47f20db:
|
Bundle Size ReportUpdated Components
|
@@ -108,6 +110,7 @@ const _IconButton: React.ForwardRefRenderFunction<BladeElementRef, IconButtonPro | |||
onTouchEnd={onTouchEnd} | |||
onTouchStart={onTouchStart} | |||
{...makeAnalyticsAttribute(rest)} |
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.
{...makeAnalyticsAttribute(rest)} |
I think we can remove this {...makeAnalyticsAttribute(rest)}, since we are now using ...rest, which handles the analytics attributes.
@@ -121,6 +123,7 @@ const StyledIconButton = React.forwardRef<HTMLButtonElement, StyledIconButtonPro | |||
{...makeAccessible({ label: accessibilityLabel })} | |||
{...metaAttribute({ name: MetaConstants.IconButton, testID })} | |||
{...makeAnalyticsAttribute(rest)} |
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.
{...makeAnalyticsAttribute(rest)} |
componentName: 'ButtonGroup', | ||
children, | ||
}); | ||
|
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.
nice 🤝
); | ||
}); | ||
|
||
it('should throw error with invalid dropdown children', () => { |
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.
why remove this test?
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.
Removed this test since useVerifyAllowedChildren
already handles the logic.
Additionally, the previous check felt overly defensive. It validated nested components like ButtonGroup -> Dropdown -> DropdownButton
, which isn’t necessary because anything other than a button inside ButtonGroup is already visually broken. Plus, it complicates composition unnecessarily—for instance, you wouldn’t be able to use <Tooltip><DropdownButton /></Tooltip>
@@ -264,6 +265,8 @@ const SideNavLink = ({ | |||
isFirstRender: false, | |||
}); | |||
} | |||
|
|||
onClick?.(e); |
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.
You might have to pass this in isL3Trigger block as well so that onClick is also supported on that collapsible sidenavlink of l3 trigger
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.
Yup, done.
* Extra data to be passed to `onChange` callback | ||
* Example use case: passing event object to `onChange` callback | ||
*/ | ||
extraData?: any, |
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.
can we not call this "event" itself?
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.
We could, wanted to keep this param a bit generic, imagine in some component maybe not event but we could pass around any data object.
Description
Drawer:
RadioGroup:
ButtonGroup:
IconButton:
SideNavLink:
Component Checklist