Skip to content

Commit

Permalink
replace all COLORS with LEGACY_COLORS
Browse files Browse the repository at this point in the history
  • Loading branch information
b-cooper committed Jan 11, 2024
1 parent d360c1f commit 4171724
Show file tree
Hide file tree
Showing 433 changed files with 2,164 additions and 2,164 deletions.
4 changes: 2 additions & 2 deletions api-client/src/protocols/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// set of functions that parse details out of a protocol record and it's internals
import reduce from 'lodash/reduce'

import { COLORS } from '@opentrons/components/src/ui-style-constants'
import { LEGACY_COLORS } from '@opentrons/components/src/ui-style-constants'
import { getLabwareDefURI } from '@opentrons/shared-data'
import type {
Liquid,
Expand Down Expand Up @@ -254,7 +254,7 @@ export function parseLiquidsInLoadOrder(
...liquid,
displayColor:
liquid.displayColor ??
COLORS.liquidColors[index % COLORS.liquidColors.length],
LEGACY_COLORS.liquidColors[index % LEGACY_COLORS.liquidColors.length],
}
})

Expand Down
4 changes: 2 additions & 2 deletions app/src/App/DesktopApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Redirect, Route, Switch, useRouteMatch } from 'react-router-dom'

import {
Box,
COLORS,
LEGACY_COLORS,
OVERFLOW_AUTO,
POSITION_RELATIVE,
} from '@opentrons/components'
Expand Down Expand Up @@ -118,7 +118,7 @@ export const DesktopApp = (): JSX.Element => {
position={POSITION_RELATIVE}
width="100%"
height="100%"
backgroundColor={COLORS.fundamentalsBackground}
backgroundColor={LEGACY_COLORS.fundamentalsBackground}
overflow={OVERFLOW_AUTO}
>
<ModalPortalRoot />
Expand Down
46 changes: 23 additions & 23 deletions app/src/App/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
ALIGN_CENTER,
ALIGN_FLEX_START,
ALIGN_STRETCH,
COLORS,
LEGACY_COLORS,
DIRECTION_COLUMN,
FLEX_NONE,
Flex,
Expand All @@ -30,18 +30,18 @@ import type { RouteProps } from './types'
const SALESFORCE_HELP_LINK = 'https://support.opentrons.com/s/'

const NavbarLink = styled(NavLink)`
color: ${COLORS.white};
color: ${LEGACY_COLORS.white};
align-self: ${ALIGN_STRETCH};
background-color: ${COLORS.darkBlackEnabled};
background-color: ${LEGACY_COLORS.darkBlackEnabled};
&:hover {
background-color: ${COLORS.darkBlackHover};
background-color: ${LEGACY_COLORS.darkBlackHover};
}
&:focus-visible {
box-shadow: inset 0 0 0 3px ${COLORS.fundamentalsFocus};
box-shadow: inset 0 0 0 3px ${LEGACY_COLORS.fundamentalsFocus};
outline: none;
background-color: ${COLORS.darkGreyHover};
background-color: ${LEGACY_COLORS.darkGreyHover};
}
&:focus-visible.active {
Expand All @@ -50,26 +50,26 @@ const NavbarLink = styled(NavLink)`
}
&:active {
background-color: ${COLORS.darkBlackEnabled};
background-color: ${LEGACY_COLORS.darkBlackEnabled};
}
&.active {
background-color: ${COLORS.darkBlackSelected};
background-color: ${LEGACY_COLORS.darkBlackSelected};
}
&.active:has(svg) {
background-color: ${COLORS.darkBlackEnabled};
background-color: ${LEGACY_COLORS.darkBlackEnabled};
}
`
const NavIconLink = styled(NavLink)`
&.active > svg {
color: ${COLORS.medGreyEnabled};
background-color: ${COLORS.darkBlackSelected};
color: ${LEGACY_COLORS.medGreyEnabled};
background-color: ${LEGACY_COLORS.darkBlackSelected};
}
`
const IconLink = styled(Link)`
&.active > svg {
color: ${COLORS.medGreyEnabled};
background-color: ${COLORS.darkBlackSelected};
color: ${LEGACY_COLORS.medGreyEnabled};
background-color: ${LEGACY_COLORS.darkBlackSelected};
}
`

Expand All @@ -78,27 +78,27 @@ const NavbarIcon = styled(Icon)`
height: ${SIZE_2};
padding: ${SPACING.spacing6};
border-radius: 50%;
color: ${COLORS.medGreyEnabled};
background-color: ${COLORS.transparent};
color: ${LEGACY_COLORS.medGreyEnabled};
background-color: ${LEGACY_COLORS.transparent};
&:hover {
background-color: ${COLORS.darkBlackHover};
background-color: ${LEGACY_COLORS.darkBlackHover};
}
&:focus-visible {
box-shadow: inset 0 0 0 3px ${COLORS.fundamentalsFocus};
box-shadow: inset 0 0 0 3px ${LEGACY_COLORS.fundamentalsFocus};
outline: none;
background-color: ${COLORS.darkGreyHover};
background-color: ${LEGACY_COLORS.darkGreyHover};
}
&:active {
color: ${COLORS.medGreyEnabled};
background-color: ${COLORS.darkBlackEnabled};
color: ${LEGACY_COLORS.medGreyEnabled};
background-color: ${LEGACY_COLORS.darkBlackEnabled};
}
&.active {
color: ${COLORS.medGreyEnabled};
background-color: ${COLORS.darkBlackSelected};
color: ${LEGACY_COLORS.medGreyEnabled};
background-color: ${LEGACY_COLORS.darkBlackSelected};
}
`

Expand All @@ -113,7 +113,7 @@ export function Navbar({ routes }: { routes: RouteProps[] }): JSX.Element {
)
return (
<Flex
backgroundColor={COLORS.darkBlackEnabled}
backgroundColor={LEGACY_COLORS.darkBlackEnabled}
css={TYPOGRAPHY.h3Regular}
flexDirection={DIRECTION_COLUMN}
flex={FLEX_NONE}
Expand Down
6 changes: 3 additions & 3 deletions app/src/App/OnDeviceDisplayApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ErrorBoundary } from 'react-error-boundary'
import {
Box,
POSITION_RELATIVE,
COLORS,
LEGACY_COLORS,
OVERFLOW_AUTO,
useIdle,
useScrolling,
Expand Down Expand Up @@ -242,7 +242,7 @@ export const OnDeviceDisplayApp = (): JSX.Element => {
position: ${POSITION_RELATIVE};
width: 100%;
height: 100%;
background-color: ${COLORS.white};
background-color: ${LEGACY_COLORS.white};
overflow-y: ${OVERFLOW_AUTO};
&::-webkit-scrollbar {
Expand All @@ -256,7 +256,7 @@ export const OnDeviceDisplayApp = (): JSX.Element => {
}
&::-webkit-scrollbar-thumb {
background: ${COLORS.darkBlack40};
background: ${LEGACY_COLORS.darkBlack40};
border-radius: 11px;
}
`
Expand Down
4 changes: 2 additions & 2 deletions app/src/App/OnDeviceDisplayAppFallback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
Flex,
JUSTIFY_CENTER,
SPACING,
COLORS,
LEGACY_COLORS,
} from '@opentrons/components'

import { StyledText } from '../atoms/text'
Expand All @@ -39,7 +39,7 @@ export function OnDeviceDisplayAppFallback({
const modalHeader: ModalHeaderBaseProps = {
title: t('error_boundary_title'),
iconName: 'ot-alert',
iconColor: COLORS.red2,
iconColor: LEGACY_COLORS.red2,
}

// immediately report to robot logs that something fatal happened
Expand Down
4 changes: 2 additions & 2 deletions app/src/DesignTokens/BorderRadius/BorderRadius.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import {
Flex,
COLORS,
LEGACY_COLORS,
DIRECTION_COLUMN,
SPACING,
TYPOGRAPHY,
Expand Down Expand Up @@ -48,7 +48,7 @@ const Template: Story<BorderRadiusStorybookProps> = args => {
<Box
width="10rem"
height="4rem"
backgroundColor={COLORS.blueEnabled}
backgroundColor={LEGACY_COLORS.blueEnabled}
borderRadius={br[1]}
/>
</Flex>
Expand Down
8 changes: 4 additions & 4 deletions app/src/DesignTokens/Colors/Colors.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import {
Flex,
COLORS,
LEGACY_COLORS,
DIRECTION_COLUMN,
DIRECTION_ROW,
SPACING,
Expand Down Expand Up @@ -51,7 +51,7 @@ const Template: Story<ColorsStorybookProps> = args => {
}

const handleClick = (colorName: string): void => {
navigator.clipboard.writeText(`COLORS.${colorName}`)
navigator.clipboard.writeText(`LEGACY_COLORS.${colorName}`)
setCopiedColor(colorName)
setTimeout(() => {
setCopiedColor(null)
Expand Down Expand Up @@ -79,7 +79,7 @@ const Template: Story<ColorsStorybookProps> = args => {
borderRadius={BORDERS.borderRadiusSize2}
onClick={() => handleClick(color[0])}
style={{ cursor: 'pointer' }}
border={`2px solid ${COLORS.darkBlackEnabled}`}
border={`2px solid ${LEGACY_COLORS.darkBlackEnabled}`}
>
<StyledText
color={invertColor(color[1])}
Expand Down Expand Up @@ -109,7 +109,7 @@ const Template: Story<ColorsStorybookProps> = args => {
}

export const AllColors = Template.bind({})
const allColors = Object.entries(COLORS)
const allColors = Object.entries(LEGACY_COLORS)
AllColors.args = {
colors: allColors,
}
4 changes: 2 additions & 2 deletions app/src/DesignTokens/Spacing/Spacing.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import {
Flex,
COLORS,
LEGACY_COLORS,
DIRECTION_COLUMN,
SPACING,
TYPOGRAPHY,
Expand Down Expand Up @@ -51,7 +51,7 @@ const Template: Story<SpacingsStorybookProps> = args => {
<Box
width={spacing[1]}
height="2rem"
backgroundColor={COLORS.blueEnabled}
backgroundColor={LEGACY_COLORS.blueEnabled}
/>
</Flex>
))}
Expand Down
24 changes: 12 additions & 12 deletions app/src/atoms/Banner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
ALIGN_CENTER,
BORDERS,
Btn,
COLORS,
LEGACY_COLORS,
DIRECTION_ROW,
Flex,
Icon,
Expand Down Expand Up @@ -49,28 +49,28 @@ const BANNER_PROPS_BY_TYPE: Record<
> = {
success: {
icon: { name: 'check-circle' },
backgroundColor: COLORS.successBackgroundLight,
color: COLORS.successEnabled,
backgroundColor: LEGACY_COLORS.successBackgroundLight,
color: LEGACY_COLORS.successEnabled,
},
error: {
icon: { name: 'alert-circle' },
backgroundColor: COLORS.errorBackgroundLight,
color: COLORS.errorEnabled,
backgroundColor: LEGACY_COLORS.errorBackgroundLight,
color: LEGACY_COLORS.errorEnabled,
},
warning: {
icon: { name: 'alert-circle' },
backgroundColor: COLORS.warningBackgroundLight,
color: COLORS.warningEnabled,
backgroundColor: LEGACY_COLORS.warningBackgroundLight,
color: LEGACY_COLORS.warningEnabled,
},
updating: {
icon: { name: 'ot-spinner' },
backgroundColor: COLORS.darkGreyDisabled,
color: COLORS.darkGreyEnabled,
backgroundColor: LEGACY_COLORS.darkGreyDisabled,
color: LEGACY_COLORS.darkGreyEnabled,
},
informing: {
icon: { name: 'information' },
backgroundColor: COLORS.fundamentalsBackground,
color: COLORS.darkGreyEnabled,
backgroundColor: LEGACY_COLORS.fundamentalsBackground,
color: LEGACY_COLORS.darkGreyEnabled,
},
}

Expand Down Expand Up @@ -106,7 +106,7 @@ export function Banner(props: BannerProps): JSX.Element {
font-size: 1.25rem;
font-weight: ${TYPOGRAPHY.fontWeightSemiBold};
border: none;
background-color: ${COLORS.yellow3};
background-color: ${LEGACY_COLORS.yellow3};
border-radius: ${BORDERS.borderRadiusSize3};
line-height: 1.5rem;
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/atoms/Chip/Chip.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { Flex, COLORS, SPACING } from '@opentrons/components'
import { Flex, LEGACY_COLORS, SPACING } from '@opentrons/components'
import { touchScreenViewport } from '../../DesignTokens/constants'
import { Chip } from '.'
import type { Story, Meta } from '@storybook/react'
Expand All @@ -18,7 +18,7 @@ interface ChipStorybookProps extends React.ComponentProps<typeof Chip> {
const Template: Story<ChipStorybookProps> = ({ ...args }) => (
<Flex
padding={SPACING.spacing16}
backgroundColor={COLORS.darkBlack40}
backgroundColor={LEGACY_COLORS.darkBlack40}
width="59rem"
>
<Chip {...args} />
Expand Down
Loading

0 comments on commit 4171724

Please sign in to comment.