From 880515b85504d0b4e670c2731f54710beb3bd75a Mon Sep 17 00:00:00 2001 From: Filip Hlavac <50696716+fhlavac@users.noreply.github.com> Date: Tue, 6 Aug 2024 05:51:51 -0400 Subject: [PATCH] fix(v6): Fix TagCount styling (#237) * fix(v6): Fix TagCount styling * Update tokens --- packages/module/src/TagCount/TagCount.tsx | 16 ++++++++++------ .../__snapshots__/TagCount.test.tsx.snap | 16 ++++++++-------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/packages/module/src/TagCount/TagCount.tsx b/packages/module/src/TagCount/TagCount.tsx index 08ab1c8d..a9b6381f 100644 --- a/packages/module/src/TagCount/TagCount.tsx +++ b/packages/module/src/TagCount/TagCount.tsx @@ -6,14 +6,18 @@ import { createUseStyles } from 'react-jss' const useStyles = createUseStyles({ buttonTagCount: { - color: 'var(--pf-v5-global--icon--Color--light)', display: 'flex', - alignItems: 'center' + alignItems: 'center', + padding: 'var(--pf-t--global--spacer--sm) var(--pf-t--global--spacer--md)' }, + tagIcon: (isDisabled: boolean) => ({ + color: `var(--pf-t--global--icon--color--${isDisabled ? '200' : '100'})`, + }), + tagText: { - marginLeft: 'var(--pf-v5-global--spacer--sm)', - fontSize: 'var(--pf-v5-global--FontSize--sm)' + marginLeft: 'var(--pf-t--global--spacer--sm)', + fontSize: 'var(--pf-t--global--font--size--sm)' } }); @@ -35,12 +39,12 @@ const TagCount: React.FunctionComponent = ({ ouiaId = 'TagCount', ...props }: TagCountProps) => { - const classes = useStyles(); + const classes = useStyles(!count); const tagClasses = clsx(classes.buttonTagCount, className); return ( diff --git a/packages/module/src/TagCount/__snapshots__/TagCount.test.tsx.snap b/packages/module/src/TagCount/__snapshots__/TagCount.test.tsx.snap index fe57b8f0..36e2bd5f 100644 --- a/packages/module/src/TagCount/__snapshots__/TagCount.test.tsx.snap +++ b/packages/module/src/TagCount/__snapshots__/TagCount.test.tsx.snap @@ -27,7 +27,7 @@ exports[`TagCount component should render a disabled tag count with no value 1`] > @@ -71,7 +71,7 @@ exports[`TagCount component should render a disabled tag count with no value 1`] > @@ -171,7 +171,7 @@ exports[`TagCount component should render a tag count of 11 1`] = ` > 11 @@ -216,7 +216,7 @@ exports[`TagCount component should render a tag count of 11 1`] = ` > 11