|
|
@@ -43,6 +43,10 @@ export interface ActionButtonProps extends Omit<React.HTMLProps<ActionButtonDeri |
|
|
|
* Should the component's content use minimal space? |
|
|
|
*/ |
|
|
|
compact?: boolean; |
|
|
|
/** |
|
|
|
* Should the children's height be variable? |
|
|
|
*/ |
|
|
|
variableChildrenHeight?: boolean; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@@ -62,6 +66,7 @@ export const ActionButton = React.forwardRef<ActionButtonDerivedElement, ActionB |
|
|
|
compact = false as const, |
|
|
|
className, |
|
|
|
block = false as const, |
|
|
|
variableChildrenHeight = false as const, |
|
|
|
...etcProps |
|
|
|
}, |
|
|
|
forwardedRef, |
|
|
@@ -109,7 +114,12 @@ export const ActionButton = React.forwardRef<ActionButtonDerivedElement, ActionB |
|
|
|
)} |
|
|
|
> |
|
|
|
<span |
|
|
|
className="block uppercase font-bold h-[1.1em] w-full whitespace-nowrap overflow-hidden text-ellipsis font-semi-expanded" |
|
|
|
className={clsx( |
|
|
|
'block uppercase font-bold h-[1.1em] w-full whitespace-nowrap overflow-hidden text-ellipsis font-semi-expanded', |
|
|
|
{ |
|
|
|
'h-[1.1em]': !variableChildrenHeight, |
|
|
|
}, |
|
|
|
)} |
|
|
|
data-testid="children" |
|
|
|
> |
|
|
|
{children} |
|
|
@@ -167,4 +177,5 @@ ActionButton.defaultProps = { |
|
|
|
menuItem: false as const, |
|
|
|
size: 'medium' as const, |
|
|
|
compact: false as const, |
|
|
|
variableChildrenHeight: false as const, |
|
|
|
}; |