Skip to content

Commit 8d17104

Browse files
authored
fix(ItemButton): default type neutral (#878)
1 parent 1604650 commit 8d17104

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

.changeset/clean-coats-kneel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cube-dev/ui-kit": patch
3+
---
4+
5+
Set `neutral` as the default type for ItemButton.

src/components/actions/ItemButton/ItemButton.tsx

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const ItemButton = forwardRef(function ItemButton(
9898
to,
9999
htmlType,
100100
as,
101-
type,
101+
type = 'neutral',
102102
theme,
103103
onPress,
104104
actions,
@@ -126,20 +126,6 @@ const ItemButton = forwardRef(function ItemButton(
126126

127127
const { hoverProps, isHovered } = useHover({});
128128

129-
const finalWrapperStyles = useMemo(() => {
130-
return wrapperStyles
131-
? {
132-
...wrapperStyles,
133-
...(wrapperStyles?.Actions
134-
? {
135-
'& > [data-element="Actions"]': wrapperStyles.Actions,
136-
Actions: undefined,
137-
}
138-
: undefined),
139-
}
140-
: undefined;
141-
}, [wrapperStyles]);
142-
143129
const { actionProps } = useAction(
144130
{ ...(allProps as any), htmlType, to, as, mods },
145131
ref,
@@ -162,7 +148,7 @@ const ItemButton = forwardRef(function ItemButton(
162148
{...hoverProps}
163149
data-size={size}
164150
mods={{ 'actions-hidden': !areActionsShown && showActionsOnHover }}
165-
styles={finalWrapperStyles}
151+
styles={wrapperStyles}
166152
style={
167153
{
168154
'--actions-width':

0 commit comments

Comments
 (0)