From 83899ff26bf5b2a55593455d3edcf2c1ad3ac8cb Mon Sep 17 00:00:00 2001 From: Antoine Moreaux Date: Mon, 3 Mar 2025 14:59:55 +0100 Subject: [PATCH] feat(button): add accent prop and disable pointer events (#10618) Added an accent prop to the StyledButtonWrapper for additional styling capabilities. Also disabled pointer events on ButtonIcon to prevent interference during loading states. --- .../twenty-ui/src/input/button/components/Button/Button.tsx | 2 +- .../src/input/button/components/Button/internal/ButtonIcon.tsx | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/twenty-ui/src/input/button/components/Button/Button.tsx b/packages/twenty-ui/src/input/button/components/Button/Button.tsx index f107f0cd5..bdad2a48b 100644 --- a/packages/twenty-ui/src/input/button/components/Button/Button.tsx +++ b/packages/twenty-ui/src/input/button/components/Button/Button.tsx @@ -404,7 +404,6 @@ const StyledButtonWrapper = styled.div< })()}; `} - height: 100%; max-width: ${({ loading, theme }) => loading ? `calc(100% - ${theme.spacing(8)})` : 'none'}; position: relative; @@ -441,6 +440,7 @@ export const Button = ({ diff --git a/packages/twenty-ui/src/input/button/components/Button/internal/ButtonIcon.tsx b/packages/twenty-ui/src/input/button/components/Button/internal/ButtonIcon.tsx index 41ae8fe4e..18b0f7ed4 100644 --- a/packages/twenty-ui/src/input/button/components/Button/internal/ButtonIcon.tsx +++ b/packages/twenty-ui/src/input/button/components/Button/internal/ButtonIcon.tsx @@ -31,6 +31,8 @@ const StyledIconWrapper = styled.div<{ loading?: boolean }>` transform: translateY(-50%); width: ${({ loading }) => (loading ? 0 : '100%')}; + + pointer-events: none; `; const StyledLoader = styled.div<{ loading?: boolean }>`