From fdaba97b2883662cc4e6207d049051c21a81a3f5 Mon Sep 17 00:00:00 2001 From: Andrey Yamanov Date: Thu, 6 Nov 2025 11:37:50 +0100 Subject: [PATCH] fix(ItemButton): default type neutral --- .changeset/clean-coats-kneel.md | 5 +++++ .../actions/ItemButton/ItemButton.tsx | 18 ++---------------- 2 files changed, 7 insertions(+), 16 deletions(-) create mode 100644 .changeset/clean-coats-kneel.md diff --git a/.changeset/clean-coats-kneel.md b/.changeset/clean-coats-kneel.md new file mode 100644 index 000000000..14338ba1d --- /dev/null +++ b/.changeset/clean-coats-kneel.md @@ -0,0 +1,5 @@ +--- +"@cube-dev/ui-kit": patch +--- + +Set `neutral` as the default type for ItemButton. diff --git a/src/components/actions/ItemButton/ItemButton.tsx b/src/components/actions/ItemButton/ItemButton.tsx index 8ab8eac10..f2215bba0 100644 --- a/src/components/actions/ItemButton/ItemButton.tsx +++ b/src/components/actions/ItemButton/ItemButton.tsx @@ -98,7 +98,7 @@ const ItemButton = forwardRef(function ItemButton( to, htmlType, as, - type, + type = 'neutral', theme, onPress, actions, @@ -126,20 +126,6 @@ const ItemButton = forwardRef(function ItemButton( const { hoverProps, isHovered } = useHover({}); - const finalWrapperStyles = useMemo(() => { - return wrapperStyles - ? { - ...wrapperStyles, - ...(wrapperStyles?.Actions - ? { - '& > [data-element="Actions"]': wrapperStyles.Actions, - Actions: undefined, - } - : undefined), - } - : undefined; - }, [wrapperStyles]); - const { actionProps } = useAction( { ...(allProps as any), htmlType, to, as, mods }, ref, @@ -162,7 +148,7 @@ const ItemButton = forwardRef(function ItemButton( {...hoverProps} data-size={size} mods={{ 'actions-hidden': !areActionsShown && showActionsOnHover }} - styles={finalWrapperStyles} + styles={wrapperStyles} style={ { '--actions-width':