From f7bcccb206405ab72198ccdd0da19990e74951da Mon Sep 17 00:00:00 2001 From: aditiSoni Date: Mon, 11 Dec 2023 15:49:21 +0530 Subject: [PATCH 1/3] pill background color fixes --- packages/ui-toolkit/package.json | 2 +- packages/ui-toolkit/src/components/atoms/Pill/Pill.tsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/ui-toolkit/package.json b/packages/ui-toolkit/package.json index 8ec09ec1..d5c912f7 100644 --- a/packages/ui-toolkit/package.json +++ b/packages/ui-toolkit/package.json @@ -1,6 +1,6 @@ { "name": "@groww-tech/ui-toolkit", - "version": "0.5.3", + "version": "0.5.4", "description": "A lightning nature UI", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/ui-toolkit/src/components/atoms/Pill/Pill.tsx b/packages/ui-toolkit/src/components/atoms/Pill/Pill.tsx index d76becc5..72102cbb 100644 --- a/packages/ui-toolkit/src/components/atoms/Pill/Pill.tsx +++ b/packages/ui-toolkit/src/components/atoms/Pill/Pill.tsx @@ -30,8 +30,10 @@ const Pill = (props: Props) => { size: 20 }; - const baseClasses = cn('contentPrimary', 'absolute-center', 'cur-po', 'valign-wrapper', `pill12Size${size}`, + const baseClasses = cn('absolute-center', 'cur-po', 'valign-wrapper', `pill12Size${size}`, { + backgroundPrimary: isOutlined && !isAccent && !isSelected, + contentPrimary: !isAccent, borderPrimary: isOutlined && !isAccent && !isSelected, pill12Pill: true, pill12PillHover: !isSelected && !isAccent, @@ -39,6 +41,7 @@ const Pill = (props: Props) => { borderAccent: isAccent, pill12SelectedPill: !isAccent && isSelected, contentAccent: isAccent, + backgroundTertiary: isSelected && !isAccent, backgroundPositiveSubtle: isSelected && isAccent }); From 9d25713b24cbe853da175fadd2cc69632cdafc25 Mon Sep 17 00:00:00 2001 From: aditiSoni Date: Mon, 11 Dec 2023 16:16:08 +0530 Subject: [PATCH 2/3] classes re-arranged --- packages/ui-toolkit/src/components/atoms/Pill/Pill.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/ui-toolkit/src/components/atoms/Pill/Pill.tsx b/packages/ui-toolkit/src/components/atoms/Pill/Pill.tsx index 72102cbb..8bd79680 100644 --- a/packages/ui-toolkit/src/components/atoms/Pill/Pill.tsx +++ b/packages/ui-toolkit/src/components/atoms/Pill/Pill.tsx @@ -37,11 +37,10 @@ const Pill = (props: Props) => { borderPrimary: isOutlined && !isAccent && !isSelected, pill12Pill: true, pill12PillHover: !isSelected && !isAccent, - borderNeutral: isSelected && !isAccent, + 'borderNeutral backgroundTertiary': isSelected && !isAccent, borderAccent: isAccent, pill12SelectedPill: !isAccent && isSelected, contentAccent: isAccent, - backgroundTertiary: isSelected && !isAccent, backgroundPositiveSubtle: isSelected && isAccent }); From 322678e857af1f03f37d2e7e1c675a2b57f00215 Mon Sep 17 00:00:00 2001 From: aditiSoni Date: Mon, 11 Dec 2023 16:29:22 +0530 Subject: [PATCH 3/3] optimised classes --- packages/ui-toolkit/src/components/atoms/Pill/Pill.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/ui-toolkit/src/components/atoms/Pill/Pill.tsx b/packages/ui-toolkit/src/components/atoms/Pill/Pill.tsx index 8bd79680..025be2bc 100644 --- a/packages/ui-toolkit/src/components/atoms/Pill/Pill.tsx +++ b/packages/ui-toolkit/src/components/atoms/Pill/Pill.tsx @@ -30,17 +30,13 @@ const Pill = (props: Props) => { size: 20 }; - const baseClasses = cn('absolute-center', 'cur-po', 'valign-wrapper', `pill12Size${size}`, + const baseClasses = cn('pill12Pill', 'absolute-center', 'cur-po', 'valign-wrapper', `pill12Size${size}`, { - backgroundPrimary: isOutlined && !isAccent && !isSelected, + 'backgroundPrimary borderPrimary': isOutlined && !isAccent && !isSelected, contentPrimary: !isAccent, - borderPrimary: isOutlined && !isAccent && !isSelected, - pill12Pill: true, pill12PillHover: !isSelected && !isAccent, 'borderNeutral backgroundTertiary': isSelected && !isAccent, - borderAccent: isAccent, - pill12SelectedPill: !isAccent && isSelected, - contentAccent: isAccent, + 'borderAccent contentAccent': isAccent, backgroundPositiveSubtle: isSelected && isAccent });