From e305a0ee15f0130585fa5a0f594f95a371a40772 Mon Sep 17 00:00:00 2001 From: Udi Silvestre Date: Wed, 25 Oct 2023 13:05:15 -0300 Subject: [PATCH] fix: v2/SimpleMenu - IconButton trigger style props --- .../src/IconButton/IconButton.tsx | 4 ++++ .../src/v2/SimpleMenu/Menu.tsx | 14 ++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/strapi-design-system/src/IconButton/IconButton.tsx b/packages/strapi-design-system/src/IconButton/IconButton.tsx index dce7f40f4..2fdec4c2c 100644 --- a/packages/strapi-design-system/src/IconButton/IconButton.tsx +++ b/packages/strapi-design-system/src/IconButton/IconButton.tsx @@ -106,6 +106,8 @@ export const IconButton = React.forwardRef( }, ); +IconButton.displayName = 'IconButton'; + const IconButtonWrapper = styled(BaseButton)>>` background-color: ${({ theme, variant }) => { if (variant === VARIANT_SECONDARY) { @@ -210,3 +212,5 @@ export const IconButtonGroup = styled(Flex)` } } `; + +IconButtonGroup.displayName = 'IconButtonGroup'; diff --git a/packages/strapi-design-system/src/v2/SimpleMenu/Menu.tsx b/packages/strapi-design-system/src/v2/SimpleMenu/Menu.tsx index e76637069..7f11fb806 100644 --- a/packages/strapi-design-system/src/v2/SimpleMenu/Menu.tsx +++ b/packages/strapi-design-system/src/v2/SimpleMenu/Menu.tsx @@ -29,6 +29,11 @@ interface TriggerProps extends ButtonProps {} const MenuTrigger = forwardRef( ({ size, endIcon = , ...props }, ref) => { + const isSizeS = size === 'S'; + const isIconButton = (props.as as any)?.displayName === 'IconButton'; + const paddingY = isSizeS ? 1 : 2; + const paddingX = isSizeS ? 3 : 4; + return (