Skip to content

Commit

Permalink
use named export in styled components
Browse files Browse the repository at this point in the history
  • Loading branch information
shlokamin committed Dec 2, 2024
1 parent 5009d3c commit fdaad6e
Show file tree
Hide file tree
Showing 64 changed files with 81 additions and 72 deletions.
2 changes: 1 addition & 1 deletion components/src/atoms/Checkbox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as React from 'react'
import { css } from 'styled-components'
import { css } from '../../patches'
import { COLORS, BORDERS } from '../../helix-design-system'
import { Flex } from '../../primitives'
import { Icon } from '../../icons'
Expand Down
2 changes: 1 addition & 1 deletion components/src/atoms/CheckboxField/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as React from 'react'
import { css } from 'styled-components'
import { css } from '../../patches'
import { SPACING, TYPOGRAPHY } from '../../ui-style-constants'
import { COLORS, BORDERS } from '../../helix-design-system'
import { Flex, Box } from '../../primitives'
Expand Down
2 changes: 1 addition & 1 deletion components/src/atoms/Chip/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from 'styled-components'
import { css } from '../../patches'
import { BORDERS, COLORS } from '../../helix-design-system'
import { Flex } from '../../primitives'
import { LegacyStyledText } from '../StyledText'
Expand Down
2 changes: 1 addition & 1 deletion components/src/atoms/InputField/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { forwardRef } from 'react'
import styled, { css } from 'styled-components'
import styled, { css } from '../../patches'

import { Flex } from '../../primitives'
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled, { css } from 'styled-components'
import styled, { css } from '../../../patches'
import { SPACING } from '../../../ui-style-constants'
import { BORDERS, COLORS } from '../../../helix-design-system'
import { Flex } from '../../../primitives'
Expand Down
2 changes: 1 addition & 1 deletion components/src/atoms/ListButton/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as React from 'react'
import { css } from 'styled-components'
import { css } from '../../patches'
import { Flex } from '../../primitives'
import { SPACING } from '../../ui-style-constants'
import { BORDERS, COLORS } from '../../helix-design-system'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from 'styled-components'
import { css } from '../../../patches'
import { ALIGN_CENTER, JUSTIFY_CENTER } from '../../../styles'
import { COLORS } from '../../../helix-design-system'
import { Flex, Link } from '../../../primitives'
Expand Down
2 changes: 1 addition & 1 deletion components/src/atoms/ListItem/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as React from 'react'
import { css } from 'styled-components'
import { css } from '../../patches'
import { Flex } from '../../primitives'
import { RESPONSIVENESS, SPACING } from '../../ui-style-constants'
import { BORDERS, COLORS } from '../../helix-design-system'
Expand Down
2 changes: 1 addition & 1 deletion components/src/atoms/MenuList/MenuItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components'
import styled from '../../patches'
import { COLORS } from '../../helix-design-system'
import { RESPONSIVENESS, SPACING, TYPOGRAPHY } from '../../ui-style-constants'
import { ALIGN_CENTER } from '../../styles'
Expand Down
2 changes: 1 addition & 1 deletion components/src/atoms/MenuList/OverflowBtn.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { css } from 'styled-components'
import { css } from '../../patches'

import { Btn } from '../../primitives'
import { BORDERS, COLORS } from '../../helix-design-system'
Expand Down
2 changes: 1 addition & 1 deletion components/src/atoms/Snackbar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from 'react'
import { css } from 'styled-components'
import { css } from '../../patches'
import { ALIGN_CENTER } from '../../styles'
import { Flex } from '../../primitives'
import { BORDERS, COLORS } from '../../helix-design-system'
Expand Down
2 changes: 1 addition & 1 deletion components/src/atoms/StepMeter/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from 'styled-components'
import { css } from '../../patches'
import { Box } from '../../primitives'
import { RESPONSIVENESS, SPACING } from '../../ui-style-constants'
import { COLORS } from '../../helix-design-system'
Expand Down
4 changes: 2 additions & 2 deletions components/src/atoms/StyledText/LegacyStyledText.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import styled, { css } from 'styled-components'
import styled, { css } from '../../patches'
import { Text } from '../../primitives'
import { TYPOGRAPHY, RESPONSIVENESS } from '../../ui-style-constants'

import type * as React from 'react'
import type { FlattenSimpleInterpolation } from 'styled-components'
import type { FlattenSimpleInterpolation } from '../../patches'

export interface LegacyProps extends React.ComponentProps<typeof Text> {
children?: React.ReactNode
Expand Down
4 changes: 2 additions & 2 deletions components/src/atoms/StyledText/StyledText.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import styled, { css } from 'styled-components'
import styled, { css } from '../../patches'
import { Text } from '../../primitives'
import { TYPOGRAPHY, RESPONSIVENESS } from '../../ui-style-constants'
import { TYPOGRAPHY as HELIX_TYPOGRAPHY } from '../../helix-design-system/product'

import type * as React from 'react'
import type { FlattenSimpleInterpolation } from 'styled-components'
import type { FlattenSimpleInterpolation } from '../../patches'

const helixProductStyleMap = {
displayBold: {
Expand Down
2 changes: 1 addition & 1 deletion components/src/atoms/Tag/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from 'styled-components'
import { css } from '../../patches'
import { BORDERS, COLORS } from '../../helix-design-system'
import { Flex } from '../../primitives'
import { ALIGN_CENTER, DIRECTION_ROW, FLEX_MAX_CONTENT } from '../../styles'
Expand Down
4 changes: 2 additions & 2 deletions components/src/atoms/Toast/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from 'react'
import { css } from 'styled-components'
import { css } from '../../patches'

import { Btn, Flex, Link } from '../../primitives'
import { Icon } from '../../icons'
Expand All @@ -18,7 +18,7 @@ import type {
DefaultTheme,
FlattenSimpleInterpolation,
ThemedCssFunction,
} from 'styled-components'
} from '../../patches'
import type { StyleProps } from '../../primitives'
import type { IconName, IconProps } from '../../icons'

Expand Down
2 changes: 1 addition & 1 deletion components/src/atoms/ToggleGroup/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from 'styled-components'
import { css } from '../../patches'
import { BORDERS, COLORS } from '../../helix-design-system'
import { Flex } from '../../primitives'
import { PrimaryButton } from '../../atoms/buttons/PrimaryButton'
Expand Down
2 changes: 1 addition & 1 deletion components/src/atoms/buttons/AlertPrimaryButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components'
import styled from '../../patches'
import { TYPOGRAPHY, SPACING } from '../../ui-style-constants'
import { BORDERS, COLORS } from '../../helix-design-system'
import { NewAlertPrimaryBtn, styleProps } from '../../primitives'
Expand Down
2 changes: 1 addition & 1 deletion components/src/atoms/buttons/AltPrimaryButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components'
import styled from '../../patches'

import { COLORS } from '../../helix-design-system'
import { styleProps } from '../../primitives'
Expand Down
2 changes: 1 addition & 1 deletion components/src/atoms/buttons/EmptySelectorButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components'
import styled from '../../patches'
import { Flex } from '../../primitives'
import {
ALIGN_CENTER,
Expand Down
2 changes: 1 addition & 1 deletion components/src/atoms/buttons/LargeButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as React from 'react'
import { css } from 'styled-components'
import { css } from '../../patches'

import { Btn } from '../../primitives'
import { BORDERS, COLORS } from '../../helix-design-system'
Expand Down
2 changes: 1 addition & 1 deletion components/src/atoms/buttons/PrimaryButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components'
import styled from '../../patches'
import { TYPOGRAPHY, SPACING } from '../../ui-style-constants'
import { BORDERS, COLORS } from '../../helix-design-system'
import { NewPrimaryBtn, styleProps } from '../../primitives'
Expand Down
4 changes: 2 additions & 2 deletions components/src/atoms/buttons/RadioButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as React from 'react'
import styled, { css } from 'styled-components'
import styled, { css } from '../../patches'
import { Flex } from '../../primitives'
import { COLORS, BORDERS } from '../../helix-design-system'
import { RESPONSIVENESS, SPACING } from '../../ui-style-constants'
Expand All @@ -14,7 +14,7 @@ import {
} from '../../index'
import type { IconName } from '../../icons'
import type { StyleProps } from '../../primitives'
import type { FlattenSimpleInterpolation } from 'styled-components'
import type { FlattenSimpleInterpolation } from '../../patches'

interface RadioButtonProps extends StyleProps {
buttonLabel: string | React.ReactNode
Expand Down
2 changes: 1 addition & 1 deletion components/src/atoms/buttons/SecondaryButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components'
import styled from '../../patches'

import { TYPOGRAPHY, SPACING } from '../../ui-style-constants'
import { isntStyleProp, styleProps } from '../../primitives'
Expand Down
2 changes: 1 addition & 1 deletion components/src/hardware-sim/Deck/MoveLabwareOnDeck.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import styled from 'styled-components'
import styled from '../../patches'
import { animated, useSpring, easings } from '@react-spring/web'
import {
getDeckDefFromRobotType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as React from 'react'
import { css } from 'styled-components'
import { css } from '../../patches'
import { Flex, ForeignObject } from '../../primitives'

export interface RobotCoordsForeignObjectProps {
Expand Down
2 changes: 1 addition & 1 deletion components/src/hardware-sim/Deck/RobotCoordsText.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as React from 'react'
import { css } from 'styled-components'
import { css } from '../../patches'

export interface RobotCoordsTextProps extends React.ComponentProps<'text'> {
x: number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from 'styled-components'
import { css } from '../../patches'

import { Icon } from '../../icons'
import { Btn } from '../../primitives'
Expand Down
2 changes: 1 addition & 1 deletion components/src/hardware-sim/DeckConfigurator/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from 'styled-components'
import { css } from '../../patches'

import { BORDERS, COLORS } from '../../helix-design-system'
import { ALIGN_CENTER, DISPLAY_FLEX, JUSTIFY_CENTER } from '../../styles'
Expand Down
2 changes: 1 addition & 1 deletion components/src/hardware-sim/Labware/Labware.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import styled from 'styled-components'
import styled from '../../patches'
import map from 'lodash/map'

import { COLORS } from '../../helix-design-system'
Expand Down
2 changes: 1 addition & 1 deletion components/src/hardware-sim/Labware/LabwareRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from './labwareInternals'
import { LabwareAdapter, labwareAdapterLoadNames } from './LabwareAdapter'

import type { CSSProperties } from 'styled-components'
import type { CSSProperties } from '../../patches'
import type { LabwareDefinition2 } from '@opentrons/shared-data'
import type {
HighlightedWellLabels,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import map from 'lodash/map'
import { COLORS } from '../../../helix-design-system'
import { Well } from './Well'
import type { LabwareDefinition2 } from '@opentrons/shared-data'
import type { CSSProperties } from 'styled-components'
import type { CSSProperties } from '../../../patches'

export interface FilledWellsProps {
definition: LabwareDefinition2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type * as React from 'react'
import { SLOT_RENDER_WIDTH, SLOT_RENDER_HEIGHT } from '@opentrons/shared-data'
import { COLORS } from '../../../helix-design-system'

import type { CSSProperties } from 'styled-components'
import type { CSSProperties } from '../../../patches'
import type { LabwareDefinition2 } from '@opentrons/shared-data'

export interface LabwareOutlineProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Render labware definition to SVG. XY is in robot coordinates.
import * as React from 'react'
import styled from 'styled-components'
import styled from '../../../patches'
import flatMap from 'lodash/flatMap'

import { LabwareOutline } from './LabwareOutline'
Expand All @@ -10,7 +10,7 @@ import { COLORS } from '../../../helix-design-system'

import type { LabwareDefinition2, LabwareWell } from '@opentrons/shared-data'
import type { WellMouseEvent, WellStroke } from './types'
import type { CSSProperties } from 'styled-components'
import type { CSSProperties } from '../../../patches'

export interface StaticLabwareProps {
/** Labware definition to render */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react'
import map from 'lodash/map'
import { Well } from './Well'
import type { LabwareDefinition2 } from '@opentrons/shared-data'
import type { CSSProperties } from 'styled-components'
import type { CSSProperties } from '../../../patches'
import { COLORS } from '../../../helix-design-system'

export interface StrokedWellProps {
Expand Down
2 changes: 1 addition & 1 deletion components/src/hardware-sim/ProtocolDeck/LabwareInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as React from 'react'
import { css } from 'styled-components'
import { css } from '../../patches'

import { RobotCoordsForeignDiv } from '../Deck'
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components'
import styled from '../../patches'
import { animated } from '@react-spring/web'
import type * as React from 'react'
import { Svg } from '../../primitives'
Expand Down
2 changes: 1 addition & 1 deletion components/src/icons/Icon.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as React from 'react'
import { css, keyframes } from 'styled-components'
import { css, keyframes } from '../patches'
import cx from 'classnames'

import { Svg } from '../primitives'
Expand Down
2 changes: 1 addition & 1 deletion components/src/instrument/InstrumentDiagram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import singleFlexSrc from './single-channel-flex.png'
import eightChannelFlexSrc from './eight-channel-flex.png'
import ninetySixSrc from './ninety-six-channel-gen1.png'

import type { FlattenSimpleInterpolation } from 'styled-components'
import type { FlattenSimpleInterpolation } from '../patches'
import type { PipetteV2Specs } from '@opentrons/shared-data'
import type { Mount } from '../robot-types'
import type { StyleProps } from '..'
Expand Down
2 changes: 1 addition & 1 deletion components/src/modals/ModalHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as React from 'react'
import { css } from 'styled-components'
import { css } from '../patches'

import { Icon } from '../icons'
import { Box, Btn, Flex } from '../primitives'
Expand Down
2 changes: 1 addition & 1 deletion components/src/modals/ModalShell.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as React from 'react'
import styled from 'styled-components'
import styled from '../patches'
import {
ALIGN_CENTER,
ALIGN_END,
Expand Down
2 changes: 1 addition & 1 deletion components/src/molecules/Banner/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as React from 'react'
import { css } from 'styled-components'
import { css } from '../../patches'
import { Btn, Flex } from '../../primitives'
import { Icon } from '../../icons'
import { BORDERS, COLORS } from '../../helix-design-system'
Expand Down
2 changes: 1 addition & 1 deletion components/src/molecules/DeckInfoLabel/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components'
import styled from '../../patches'

import { StyledText } from '../../atoms'
import { BORDERS, COLORS } from '../../helix-design-system'
Expand Down
4 changes: 2 additions & 2 deletions components/src/molecules/DeckLabel/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from 'styled-components'
import { css } from '../../patches'
import { getModuleType } from '@opentrons/shared-data'
import { Flex } from '../../primitives'
import { ALIGN_CENTER, FLEX_MAX_CONTENT } from '../../styles'
Expand All @@ -7,7 +7,7 @@ import { SPACING } from '../../ui-style-constants'
import { StyledText } from '../../atoms'
import { ModuleIcon } from '../../icons'

import type { FlattenSimpleInterpolation } from 'styled-components'
import type { FlattenSimpleInterpolation } from '../../patches'
import type { ModuleModel } from '@opentrons/shared-data'

export interface DeckLabelProps {
Expand Down
2 changes: 1 addition & 1 deletion components/src/molecules/DropdownMenu/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { css } from 'styled-components'
import { css } from '../../patches'

import { BORDERS, COLORS } from '../../helix-design-system'
import {
Expand Down
2 changes: 1 addition & 1 deletion components/src/molecules/LiquidIcon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from 'styled-components'
import { css } from '../../patches'
import { Btn, Flex } from '../../primitives'
import { SPACING } from '../../ui-style-constants'
import { BORDERS, COLORS } from '../../helix-design-system'
Expand Down
2 changes: 1 addition & 1 deletion components/src/molecules/ParametersTable/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled, { css } from 'styled-components'
import styled, { css } from '../../patches'
import {
formatRunTimeParameterDefaultValue,
formatRunTimeParameterMinMax,
Expand Down
2 changes: 1 addition & 1 deletion components/src/molecules/Tabs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from 'styled-components'
import { css } from '../../patches'
import { TYPOGRAPHY, SPACING, RESPONSIVENESS } from '../../ui-style-constants'
import { COLORS, BORDERS } from '../../helix-design-system'
import { POSITION_RELATIVE, DIRECTION_ROW } from '../../styles'
Expand Down
2 changes: 1 addition & 1 deletion components/src/organisms/DeckLabelSet/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import styled from 'styled-components'
import styled from '../../patches'
import { Box } from '../../primitives'
import { BORDERS, COLORS } from '../../helix-design-system'
import { RobotCoordsForeignDiv } from '../../hardware-sim'
Expand Down
9 changes: 9 additions & 0 deletions components/src/patches.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import styled from 'styled-components'

export * from 'styled-components'

// @ts-expect-error
const defaultStyled: typeof styled = typeof styled === 'function' ? styled : styled.default

// eslint-disable-next-line import/no-default-export
export { defaultStyled as default }
2 changes: 1 addition & 1 deletion components/src/primitives/Box.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components'
import styled from '../patches'

import { styleProps, isntStyleProp } from './style-props'

Expand Down
Loading

0 comments on commit fdaad6e

Please sign in to comment.