chore(ui-toolkit): rework intent colours (#3202)

This commit is contained in:
Ciaran McGhie 2023-03-21 16:40:39 +00:00 committed by GitHub
parent a0b758334a
commit 18633efec3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -32,7 +32,7 @@ it(`Applies class for danger intent`, () => {
it(`Applies class for primary intent`, () => { it(`Applies class for primary intent`, () => {
render(<Callout intent={Intent.Primary} />); render(<Callout intent={Intent.Primary} />);
expect(screen.getByTestId('callout')).toHaveClass('border-neutral-500'); expect(screen.getByTestId('callout')).toHaveClass('border-vega-blue-300');
}); });
it(`Applies class for none intent`, () => { it(`Applies class for none intent`, () => {

View File

@ -11,7 +11,8 @@ export const getIntentBorder = (intent = Intent.None) => {
border: true, border: true,
'border-danger': intent === Intent.Danger, 'border-danger': intent === Intent.Danger,
'border-warning': intent === Intent.Warning, '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, 'border-success': intent === Intent.Success,
}; };
}; };
@ -20,7 +21,7 @@ export const getIntentBackground = (intent?: Intent) => {
return { return {
'bg-neutral-200 dark:bg-neutral-800': intent === undefined, 'bg-neutral-200 dark:bg-neutral-800': intent === undefined,
'bg-black dark:bg-white': intent === Intent.None, '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-danger': intent === Intent.Danger,
'bg-warning': intent === Intent.Warning, 'bg-warning': intent === Intent.Warning,
// contrast issues with light mode // contrast issues with light mode
@ -31,8 +32,7 @@ export const getIntentBackground = (intent?: Intent) => {
export const getIntentText = (intent?: Intent) => { export const getIntentText = (intent?: Intent) => {
return { return {
'text-white dark:text-black': intent === Intent.None, 'text-white dark:text-black': intent === Intent.None,
'text-black dark:text-black-normal': intent === Intent.Primary, 'text-white': intent === Intent.Danger || intent === Intent.Primary,
'text-white': intent === Intent.Danger,
'text-black': intent === Intent.Warning || intent === Intent.Success, 'text-black': intent === Intent.Warning || intent === Intent.Success,
}; };
}; };

View File

@ -27,7 +27,7 @@ export const Web3ConnectDialog = ({
<Dialog <Dialog
open={dialogOpen} open={dialogOpen}
onChange={setDialogOpen} onChange={setDialogOpen}
intent={Intent.Primary} intent={Intent.None}
title={t('Connect to your Ethereum wallet')} title={t('Connect to your Ethereum wallet')}
> >
<ul data-testid="web3-connector-list"> <ul data-testid="web3-connector-list">