Remove reference to data-testid from styling (#10407)

Fixes https://github.com/twentyhq/core-team-issues/issues/204

---------

Co-authored-by: ad-elias <elias@autodiligence.com>
This commit is contained in:
eliasylonen
2025-02-28 16:37:14 +01:00
committed by GitHub
parent 47b7c696d5
commit 2773dde714
9 changed files with 62 additions and 25 deletions

View File

@ -26,6 +26,7 @@ export type ChipProps = {
disabled?: boolean;
clickable?: boolean;
label: string;
isLabelHidden?: boolean;
maxWidth?: number;
variant?: ChipVariant;
accent?: ChipAccent;
@ -124,6 +125,7 @@ const StyledContainer = withTheme(styled.div<
export const Chip = ({
size = ChipSize.Small,
label,
isLabelHidden = false,
disabled = false,
clickable = true,
variant = ChipVariant.Regular,
@ -145,7 +147,9 @@ export const Chip = ({
maxWidth={maxWidth}
>
{leftComponent?.()}
<OverflowingTextWithTooltip size={size} text={label} />
{!isLabelHidden && (
<OverflowingTextWithTooltip size={size} text={label} />
)}
{rightComponent?.()}
</StyledContainer>
);

View File

@ -27,6 +27,7 @@ export const LinkChip = ({
to,
size = ChipSize.Small,
label,
isLabelHidden = false,
variant = ChipVariant.Regular,
leftComponent = null,
rightComponent = null,
@ -40,6 +41,7 @@ export const LinkChip = ({
<Chip
size={size}
label={label}
isLabelHidden={isLabelHidden}
clickable={true}
variant={variant}
leftComponent={leftComponent}