Commit 422f1a40 authored by tom goriunov's avatar tom goriunov Committed by GitHub

Update color shemes for Tag component (#1855)

update color shemes for Tag
parent 10c75e5b
<svg viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 11" fill="none">
<circle cx="5" cy="5" r="5" fill="#D9DBE0"/> <circle cx="5" cy="5.438" r="5" fill="#E2E8F0"/>
<circle cx="5" cy="5" r="2.5" fill="#707886"/> <circle cx="5" cy="5.438" r="2.5" fill="#4A5568"/>
<circle cx="5" cy="5.438" r="2.5" fill="#000" fill-opacity=".2"/>
</svg> </svg>
import { defineStyle, defineStyleConfig } from '@chakra-ui/styled-system'; import { defineStyle, defineStyleConfig } from '@chakra-ui/styled-system';
import { mode, transparentize } from '@chakra-ui/theme-tools'; import { mode } from '@chakra-ui/theme-tools';
const baseStyle = defineStyle({ const baseStyle = defineStyle({
fontSize: 'xs', fontSize: 'xs',
...@@ -8,19 +8,25 @@ const baseStyle = defineStyle({ ...@@ -8,19 +8,25 @@ const baseStyle = defineStyle({
}); });
const variantSubtle = defineStyle((props) => { const variantSubtle = defineStyle((props) => {
const { colorScheme: c, theme } = props; const { colorScheme: c } = props;
const darkBg = transparentize(`${ c }.200`, 0.16)(theme);
if (c === 'gray') { if (c === 'gray') {
return { return {
bg: mode('blackAlpha.100', 'whiteAlpha.400')(props), bg: mode('blackAlpha.50', 'whiteAlpha.100')(props),
color: mode('gray.600', 'gray.50')(props), color: mode('blackAlpha.800', 'whiteAlpha.800')(props),
}; };
} }
if (c === 'gray-blue') {
return { return {
bg: mode(`${ c }.50`, darkBg)(props), bg: mode('gray.100', 'gray.800')(props),
color: mode(`${ c }.500`, `${ c }.200`)(props), color: mode('blackAlpha.800', 'whiteAlpha.800')(props),
};
}
return {
bg: mode(`${ c }.50`, `${ c }.800`)(props),
color: mode(`${ c }.500`, `${ c }.100`)(props),
}; };
}); });
......
...@@ -4,7 +4,7 @@ import React from 'react'; ...@@ -4,7 +4,7 @@ import React from 'react';
import TestApp from 'playwright/TestApp'; import TestApp from 'playwright/TestApp';
[ 'blue', 'gray', 'orange', 'green', 'purple', 'cyan', 'teal' ].forEach((colorScheme) => { [ 'blue', 'gray', 'gray-blue', 'orange', 'green', 'purple', 'cyan', 'teal' ].forEach((colorScheme) => {
test(`${ colorScheme } color scheme +@dark-mode`, async({ mount }) => { test(`${ colorScheme } color scheme +@dark-mode`, async({ mount }) => {
const component = await mount( const component = await mount(
<TestApp> <TestApp>
......
...@@ -18,7 +18,7 @@ const variants = { ...@@ -18,7 +18,7 @@ const variants = {
}; };
const sizes = { const sizes = {
md: definePartsStyle({ sm: definePartsStyle({
container: { container: {
minH: 6, minH: 6,
minW: 6, minW: 6,
...@@ -48,7 +48,7 @@ const Tag = defineMultiStyleConfig({ ...@@ -48,7 +48,7 @@ const Tag = defineMultiStyleConfig({
variants, variants,
sizes, sizes,
defaultProps: { defaultProps: {
size: 'md', size: 'sm',
variant: 'subtle', variant: 'subtle',
colorScheme: 'gray', colorScheme: 'gray',
}, },
......
...@@ -29,8 +29,6 @@ const StatusTag = ({ type, text, errorText, isLoading }: Props) => { ...@@ -29,8 +29,6 @@ const StatusTag = ({ type, text, errorText, isLoading }: Props) => {
break; break;
case 'pending': case 'pending':
icon = 'status/pending'; icon = 'status/pending';
// FIXME: it's not gray on mockups
// need to implement new color scheme or redefine colors here
colorScheme = 'gray'; colorScheme = 'gray';
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment