From 18633efec3f06093e15ac3fb56e3900640202c66 Mon Sep 17 00:00:00 2001 From: Ciaran McGhie Date: Tue, 21 Mar 2023 16:40:39 +0000 Subject: [PATCH] chore(ui-toolkit): rework intent colours (#3202) --- libs/ui-toolkit/src/components/callout/callout.spec.tsx | 2 +- libs/ui-toolkit/src/utils/intent.ts | 8 ++++---- libs/web3/src/lib/web3-connect-dialog.tsx | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/ui-toolkit/src/components/callout/callout.spec.tsx b/libs/ui-toolkit/src/components/callout/callout.spec.tsx index dc722ed37..f7ca381f9 100644 --- a/libs/ui-toolkit/src/components/callout/callout.spec.tsx +++ b/libs/ui-toolkit/src/components/callout/callout.spec.tsx @@ -32,7 +32,7 @@ it(`Applies class for danger intent`, () => { it(`Applies class for primary intent`, () => { render(); - expect(screen.getByTestId('callout')).toHaveClass('border-neutral-500'); + expect(screen.getByTestId('callout')).toHaveClass('border-vega-blue-300'); }); it(`Applies class for none intent`, () => { diff --git a/libs/ui-toolkit/src/utils/intent.ts b/libs/ui-toolkit/src/utils/intent.ts index 8c40c1d08..cc5f9ede6 100644 --- a/libs/ui-toolkit/src/utils/intent.ts +++ b/libs/ui-toolkit/src/utils/intent.ts @@ -11,7 +11,8 @@ export const getIntentBorder = (intent = Intent.None) => { border: true, 'border-danger': intent === Intent.Danger, 'border-warning': intent === Intent.Warning, - 'border-neutral-500': intent === Intent.None || intent === Intent.Primary, + 'border-neutral-500': intent === Intent.None, + 'border-vega-blue-300': intent === Intent.Primary, 'border-success': intent === Intent.Success, }; }; @@ -20,7 +21,7 @@ export const getIntentBackground = (intent?: Intent) => { return { 'bg-neutral-200 dark:bg-neutral-800': intent === undefined, 'bg-black dark:bg-white': intent === Intent.None, - 'bg-vega-pink dark:bg-vega-yellow': intent === Intent.Primary, + 'bg-vega-blue-300 dark:bg-vega-blue-700': intent === Intent.Primary, 'bg-danger': intent === Intent.Danger, 'bg-warning': intent === Intent.Warning, // contrast issues with light mode @@ -31,8 +32,7 @@ export const getIntentBackground = (intent?: Intent) => { export const getIntentText = (intent?: Intent) => { return { 'text-white dark:text-black': intent === Intent.None, - 'text-black dark:text-black-normal': intent === Intent.Primary, - 'text-white': intent === Intent.Danger, + 'text-white': intent === Intent.Danger || intent === Intent.Primary, 'text-black': intent === Intent.Warning || intent === Intent.Success, }; }; diff --git a/libs/web3/src/lib/web3-connect-dialog.tsx b/libs/web3/src/lib/web3-connect-dialog.tsx index 3ebc85794..3a4ca1528 100644 --- a/libs/web3/src/lib/web3-connect-dialog.tsx +++ b/libs/web3/src/lib/web3-connect-dialog.tsx @@ -27,7 +27,7 @@ export const Web3ConnectDialog = ({