Skip to content

Commit cbb8b5f

Browse files
authored
feat: update GroupButtonProps interface [WPB-20282] (#7373)
* feat: update GroupButtonProps interface * test: update the test snapshot of Tooltip * fix: update type name
1 parent f2335f9 commit cbb8b5f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages/react-ui-kit/src/DataDisplay/Tooltip/__snapshots__/Tooltip.test.tsx.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ exports[`<Tooltip /> renders correctly 1`] = `
1717
<div
1818
data-testid="tooltip-wrapper"
1919
role="presentation"
20+
style="width: max-content;"
2021
>
2122
Hover Me
2223
</div>
@@ -36,6 +37,7 @@ exports[`<Tooltip /> renders correctly 1`] = `
3637
<div
3738
data-testid="tooltip-wrapper"
3839
role="presentation"
40+
style="width: max-content;"
3941
>
4042
Hover Me
4143
</div>

packages/react-ui-kit/src/Inputs/ButtonGroup/ButtonGroup.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
*/
1919

20-
import {forwardRef, ReactNode} from 'react';
20+
import {ButtonHTMLAttributes, forwardRef, ReactNode} from 'react';
2121

2222
import {CSSObject} from '@emotion/react';
2323

@@ -74,10 +74,9 @@ const buttonStyle: <T>(theme: Theme, props: IconButtonProps<T>) => CSSObject = (
7474
}),
7575
});
7676

77-
interface GroupButtonProps {
78-
children?: ReactNode;
77+
type GroupedButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
7978
icon?: ReactNode;
80-
}
79+
};
8180

8281
interface ButtonGroupProps {
8382
children: ReactNode;
@@ -88,7 +87,7 @@ const ButtonGroup = ({children}: ButtonGroupProps) => (
8887
</div>
8988
);
9089

91-
const Button = forwardRef<HTMLButtonElement, GroupButtonProps>(({children, icon, ...props}, ref) => {
90+
const Button = forwardRef<HTMLButtonElement, GroupedButtonProps>(({children, icon, ...props}, ref) => {
9291
return (
9392
<button ref={ref} css={(theme: Theme) => buttonStyle(theme, props)} {...props}>
9493
{icon}

0 commit comments

Comments
 (0)