diff --git a/src/Flash.tsx b/src/Flash.tsx index 5095ed7ad11..e30f7f27044 100644 --- a/src/Flash.tsx +++ b/src/Flash.tsx @@ -4,14 +4,6 @@ import {COMMON, get, SystemCommonProps} from './constants' import sx, {SxProp} from './sx' import theme from './theme' -const variantAliases = { - default: 'info', - info: 'info', - warning: 'warn', - danger: 'error', - success: 'success' -} - const variants = variant({ variants: { default: { @@ -69,7 +61,6 @@ const Flash = styled.div< } svg { - color: ${props => get(`colors.alert.${variantAliases[props.variant || 'default']}.icon`)(props.theme)}; margin-right: ${get('space.2')}; } diff --git a/src/__tests__/Flash.tsx b/src/__tests__/Flash.tsx index 78046a43367..5afe49112ee 100644 --- a/src/__tests__/Flash.tsx +++ b/src/__tests__/Flash.tsx @@ -1,8 +1,7 @@ import React from 'react' import {Flash} from '..' import {COMMON} from '../constants' -import theme, {colors} from '../theme' -import {default as primitives} from '@primer/primitives' +import theme from '../theme' import {render, behavesAsComponent, checkExports} from '../utils/testing' import {render as HTMLRender, cleanup} from '@testing-library/react' import {axe, toHaveNoViolations} from 'jest-axe' @@ -32,16 +31,16 @@ describe('Flash', () => { it('respects the "variant" prop', () => { expect(render()).toHaveStyleRule( 'background-color', - primitives.colors.light.alert.warn.bg + theme.colors.alert.warn.bg ) expect(render()).toHaveStyleRule( 'background-color', - primitives.colors.light.alert.error.bg + theme.colors.alert.error.bg ) expect(render()).toHaveStyleRule( 'background-color', - primitives.colors.light.alert.success.bg + theme.colors.alert.success.bg ) - expect(render()).toHaveStyleRule('background-color', primitives.colors.light.alert.info.bg) + expect(render()).toHaveStyleRule('background-color', theme.colors.alert.info.bg) }) }) diff --git a/src/__tests__/__snapshots__/Flash.tsx.snap b/src/__tests__/__snapshots__/Flash.tsx.snap index f4c1e7e0012..7c5558d8211 100644 --- a/src/__tests__/__snapshots__/Flash.tsx.snap +++ b/src/__tests__/__snapshots__/Flash.tsx.snap @@ -19,10 +19,13 @@ exports[`Flash renders consistently 1`] = ` } .c0 svg { - color: rgba(4,66,137,0.6); margin-right: 8px; } +.c0 svg { + color: rgba(4,66,137,0.6); +} +