Skip to content

Commit

Permalink
refactor(components, app): move StyledText from app to components (#1…
Browse files Browse the repository at this point in the history
…4715)

* refactor(components, app): move StyledText from app to components
  • Loading branch information
koji authored and Carlos-fernandez committed May 20, 2024
1 parent 2aa081a commit 27231c5
Show file tree
Hide file tree
Showing 390 changed files with 1,579 additions and 1,510 deletions.
2 changes: 1 addition & 1 deletion app/src/App/DesktopAppFallback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import {
DIRECTION_COLUMN,
Flex,
SPACING,
StyledText,
TYPOGRAPHY,
} from '@opentrons/components'

import { StyledText } from '../atoms/text'
import { LegacyModal } from '../molecules/LegacyModal'
import { reloadUi } from '../redux/shell'

Expand Down
2 changes: 1 addition & 1 deletion app/src/App/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import {
Link,
SIZE_2,
SPACING,
StyledText,
TYPOGRAPHY,
} from '@opentrons/components'

import logoSvg from '../assets/images/logo_nav.svg'
import logoSvgThree from '../assets/images/logo_nav_three.svg'

import { NAV_BAR_WIDTH } from './constants'
import { StyledText } from '../atoms/text'

import type { RouteProps } from './types'

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 @@ -9,14 +9,14 @@ import type { FallbackProps } from 'react-error-boundary'

import {
ALIGN_CENTER,
COLORS,
DIRECTION_COLUMN,
Flex,
JUSTIFY_CENTER,
SPACING,
COLORS,
StyledText,
} from '@opentrons/components'

import { StyledText } from '../atoms/text'
import { MediumButton } from '../atoms/buttons'
import { Modal } from '../molecules/Modal'
import { appRestart, sendLog } from '../redux/shell'
Expand Down
3 changes: 1 addition & 2 deletions app/src/DesignTokens/BorderRadius/BorderRadius.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import {
DIRECTION_COLUMN,
Flex,
SPACING,
StyledText,
TYPOGRAPHY,
} from '@opentrons/components'

import type { Story, Meta } from '@storybook/react'

import { StyledText } from '../../atoms/text'

export default {
title: 'Design Tokens/BorderRadius',
} as Meta
Expand Down
3 changes: 1 addition & 2 deletions app/src/DesignTokens/Colors/Colors.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ import {
Flex,
JUSTIFY_CENTER,
SPACING,
StyledText,
TYPOGRAPHY,
} from '@opentrons/components'

import { StyledText } from '../../atoms/text'

import type { Story, Meta } from '@storybook/react'

export default {
Expand Down
9 changes: 4 additions & 5 deletions app/src/DesignTokens/Spacing/Spacing.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import * as React from 'react'
import {
Flex,
ALIGN_FLEX_START,
Box,
COLORS,
DIRECTION_COLUMN,
Flex,
SPACING,
StyledText,
TYPOGRAPHY,
Box,
ALIGN_FLEX_START,
} from '@opentrons/components'

import type { Story, Meta } from '@storybook/react'

import { StyledText } from '../../atoms/text'

export default {
title: 'Design Tokens/Spacing',
} as Meta
Expand Down
3 changes: 1 addition & 2 deletions app/src/atoms/Banner/Banner.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from 'react'
import { TYPOGRAPHY } from '@opentrons/components'
import { StyledText } from '../text'
import { StyledText, TYPOGRAPHY } from '@opentrons/components'
import { Banner } from './index'
import type { Story, Meta } from '@storybook/react'

Expand Down
3 changes: 1 addition & 2 deletions app/src/atoms/Chip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ import {
Flex,
Icon,
SPACING,
StyledText,
TYPOGRAPHY,
} from '@opentrons/components'

import { StyledText } from '../text'

import type { IconName, StyleProps } from '@opentrons/components'

export type ChipType =
Expand Down
5 changes: 2 additions & 3 deletions app/src/atoms/InlineNotification/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ import {
DIRECTION_ROW,
Flex,
Icon,
IconProps,
JUSTIFY_SPACE_BETWEEN,
SPACING,
StyledText,
TYPOGRAPHY,
} from '@opentrons/components'
import { StyledText } from '../text'

import type { StyleProps } from '@opentrons/components'
import type { IconProps, StyleProps } from '@opentrons/components'

type InlineNotificationType = 'alert' | 'error' | 'neutral' | 'success'

Expand Down
4 changes: 2 additions & 2 deletions app/src/atoms/InputField/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import {
Flex,
RESPONSIVENESS,
SPACING,
TYPOGRAPHY,
StyledText,
TEXT_ALIGN_RIGHT,
TYPOGRAPHY,
} from '@opentrons/components'
import { StyledText } from '../text'

export const INPUT_TYPE_NUMBER = 'number' as const
export const INPUT_TYPE_TEXT = 'text' as const
Expand Down
10 changes: 7 additions & 3 deletions app/src/atoms/InstrumentContainer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import * as React from 'react'

import { Flex, BORDERS, COLORS, SPACING } from '@opentrons/components'

import { StyledText } from '../text'
import {
BORDERS,
COLORS,
Flex,
SPACING,
StyledText,
} from '@opentrons/components'

interface InstrumentContainerProps {
displayName: string
Expand Down
13 changes: 7 additions & 6 deletions app/src/atoms/Interstitial/InterstitiallTitleBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ import * as React from 'react'
import { css } from 'styled-components'
import {
Btn,
ButtonProps,
COLORS,
DIRECTION_ROW,
Flex,
Icon,
JUSTIFY_SPACE_BETWEEN,
POSITION_ABSOLUTE,
SPACING,
StyledText,
TYPOGRAPHY,
Flex,
COLORS,
DIRECTION_ROW,
JUSTIFY_SPACE_BETWEEN,
} from '@opentrons/components'
import { StyledText } from '../text'

import type { ButtonProps } from '@opentrons/components'

export interface InterstitialTitleBarProps {
title: React.ReactNode
Expand Down
8 changes: 6 additions & 2 deletions app/src/atoms/ListItem/ListItem.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import * as React from 'react'
import { DIRECTION_COLUMN, Flex, SPACING } from '@opentrons/components'
import {
DIRECTION_COLUMN,
Flex,
SPACING,
StyledText,
} from '@opentrons/components'
import { touchScreenViewport } from '../../DesignTokens/constants'
import { StyledText } from '../text'
import { ListItem } from '.'
import type { Story, Meta } from '@storybook/react'

Expand Down
16 changes: 8 additions & 8 deletions app/src/atoms/MenuList/DropdownMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import * as React from 'react'
import { css } from 'styled-components'
import {
Flex,
SPACING,
ALIGN_CENTER,
BORDERS,
COLORS,
TYPOGRAPHY,
POSITION_ABSOLUTE,
DIRECTION_COLUMN,
DIRECTION_ROW,
JUSTIFY_SPACE_BETWEEN,
ALIGN_CENTER,
BORDERS,
Flex,
Icon,
JUSTIFY_SPACE_BETWEEN,
POSITION_ABSOLUTE,
SPACING,
StyledText,
TYPOGRAPHY,
useOnClickOutside,
POSITION_RELATIVE,
} from '@opentrons/components'
import { StyledText } from '../text'
import { MenuItem } from './MenuItem'

export interface DropdownOption {
Expand Down
8 changes: 4 additions & 4 deletions app/src/atoms/ProgressBar/ProgressBar.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as React from 'react'

import {
Flex,
DIRECTION_COLUMN,
SPACING,
COLORS,
DIRECTION_COLUMN,
Flex,
SecondaryButton,
SPACING,
StyledText,
} from '@opentrons/components'

import { StyledText } from '../text'
import { ProgressBar } from './index'

import type { Story, Meta } from '@storybook/react'
Expand Down
4 changes: 2 additions & 2 deletions app/src/atoms/SelectField/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import {
COLORS,
DIRECTION_COLUMN,
Flex,
TYPOGRAPHY,
SPACING,
StyledText,
TYPOGRAPHY,
} from '@opentrons/components'
import { css } from 'styled-components'
import { StyledText } from '../text'

import type { SelectProps, SelectOption } from './Select'
import type { ActionMeta, MultiValue, SingleValue } from 'react-select'
Expand Down
8 changes: 6 additions & 2 deletions app/src/atoms/Slideout/MultiSlideout.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import * as React from 'react'
import { TYPOGRAPHY, PrimaryBtn, COLORS } from '@opentrons/components'
import {
COLORS,
PrimaryBtn,
StyledText,
TYPOGRAPHY,
} from '@opentrons/components'
import { MultiSlideout } from './MultiSlideout'
import { StyledText } from '../text'

import type { Story, Meta } from '@storybook/react'

Expand Down
9 changes: 7 additions & 2 deletions app/src/atoms/Slideout/Slideout.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import * as React from 'react'
import { TYPOGRAPHY, PrimaryBtn, COLORS, SPACING } from '@opentrons/components'
import {
COLORS,
PrimaryBtn,
SPACING,
StyledText,
TYPOGRAPHY,
} from '@opentrons/components'
import { Slideout } from './index'
import { StyledText } from '../text'

import type { Story, Meta } from '@storybook/react'

Expand Down
5 changes: 3 additions & 2 deletions app/src/atoms/Slideout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import * as React from 'react'
import { css } from 'styled-components'
import { useTranslation } from 'react-i18next'

import {
ALIGN_CENTER,
Box,
Expand All @@ -14,12 +16,11 @@ import {
Overlay,
POSITION_FIXED,
SPACING,
StyledText,
TYPOGRAPHY,
} from '@opentrons/components'

import { Divider } from '../structure'
import { StyledText } from '../text'
import { useTranslation } from 'react-i18next'

export interface MultiSlideoutSpecs {
currentStep: number
Expand Down
2 changes: 1 addition & 1 deletion app/src/atoms/Snackbar/Snackbar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
JUSTIFY_CENTER,
PrimaryButton,
SPACING,
StyledText,
} from '@opentrons/components'
import { StyledText } from '../text'
import { touchScreenViewport } from '../../DesignTokens/constants'

import { Snackbar } from './index'
Expand Down
5 changes: 2 additions & 3 deletions app/src/atoms/Snackbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ import * as React from 'react'
import { css } from 'styled-components'

import {
Flex,
ALIGN_CENTER,
BORDERS,
COLORS,
Flex,
SPACING,
StyledText,
TYPOGRAPHY,
} from '@opentrons/components'

import { StyledText } from '../text'

import type { StyleProps } from '@opentrons/components'

export interface SnackbarProps extends StyleProps {
Expand Down
6 changes: 3 additions & 3 deletions app/src/atoms/StatusLabel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import * as React from 'react'
import capitalize from 'lodash/capitalize'

import {
Flex,
Icon,
ALIGN_CENTER,
BORDERS,
COLORS,
Flex,
Icon,
SPACING,
StyledText,
TYPOGRAPHY,
} from '@opentrons/components'

import { StyledText } from '../text'
interface StatusLabelProps {
status: string
backgroundColor: string
Expand Down
4 changes: 2 additions & 2 deletions app/src/atoms/Toast/ODDToast.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import * as React from 'react'
import {
Flex,
DIRECTION_COLUMN,
DIRECTION_ROW,
Flex,
JUSTIFY_CENTER,
POSITION_FIXED,
PrimaryButton,
SPACING,
StyledText,
} from '@opentrons/components'
import { touchScreenViewport } from '../../DesignTokens/constants'
import { StyledText } from '../text'
import { Toast } from '.'
import type { Story, Meta } from '@storybook/react'

Expand Down
6 changes: 3 additions & 3 deletions app/src/atoms/Toast/Toast.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as React from 'react'
import {
Flex,
DIRECTION_COLUMN,
DIRECTION_ROW,
SPACING,
Flex,
PrimaryButton,
SPACING,
StyledText,
} from '@opentrons/components'
import { StyledText } from '../text'
import { Toast } from './index'
import type { Story, Meta } from '@storybook/react'

Expand Down
Loading

0 comments on commit 27231c5

Please sign in to comment.