diff --git a/packages/ui/src/components/Button/Button.tsx b/packages/ui/src/components/Button/Button.tsx index 940f5c73ad..8090ab9611 100644 --- a/packages/ui/src/components/Button/Button.tsx +++ b/packages/ui/src/components/Button/Button.tsx @@ -23,6 +23,7 @@ type BaseProps = { loading?: boolean Icon?: ReactNode iconPosition?: 'left' | 'right' + isIconButton?: boolean } export type ButtonProps = PolymorphicComponentPropsWithRef< @@ -51,6 +52,7 @@ export const Button: PolymorphicComponent = forwardRef(function Button< children, Icon, iconPosition = 'left', + isIconButton, ...props }: ButtonProps, ref?: PolymorphicRef, @@ -83,7 +85,7 @@ export const Button: PolymorphicComponent = forwardRef(function Button< > {iconPosition === 'left' && Icon} - {children && {children}} + {children && {children}} {iconPosition === 'right' && Icon} {hiddenText && hiddenText} diff --git a/packages/ui/src/components/Button/IconButton.tsx b/packages/ui/src/components/Button/IconButton.tsx new file mode 100644 index 0000000000..405d76d30e --- /dev/null +++ b/packages/ui/src/components/Button/IconButton.tsx @@ -0,0 +1,17 @@ +import { type ComponentProps, forwardRef } from 'react' +import { Button } from './Button' + +type ButtonProps = Omit>, 'size'> + +export const IconButton = forwardRef((props, forwardedRef) => ( +