diff --git a/components/src/atoms/ListItem/ListItem.stories.tsx b/components/src/atoms/ListItem/ListItem.stories.tsx index 0738b583cde..dbe4739249d 100644 --- a/components/src/atoms/ListItem/ListItem.stories.tsx +++ b/components/src/atoms/ListItem/ListItem.stories.tsx @@ -50,7 +50,7 @@ export const ListItemDescriptorDefault: Story = { type: 'noActive', children: ( mock content} description={
mock description
} /> @@ -63,7 +63,7 @@ export const ListItemDescriptorMini: Story = { type: 'noActive', children: ( mock content} description={
mock description
} /> diff --git a/components/src/atoms/ListItem/ListItemChildren/ListItemDescriptor.tsx b/components/src/atoms/ListItem/ListItemChildren/ListItemDescriptor.tsx index 51d9ca9e181..12b494ea894 100644 --- a/components/src/atoms/ListItem/ListItemChildren/ListItemDescriptor.tsx +++ b/components/src/atoms/ListItem/ListItemChildren/ListItemDescriptor.tsx @@ -2,43 +2,34 @@ import { Flex } from '../../../primitives' import { ALIGN_FLEX_START, DIRECTION_ROW, - FLEX_AUTO, JUSTIFY_SPACE_BETWEEN, } from '../../../styles' import { SPACING } from '../../../ui-style-constants' interface ListItemDescriptorProps { - type: 'default' | 'mini' + type: 'default' | 'large' description: JSX.Element | string content: JSX.Element | string + isInSlideout?: boolean } export const ListItemDescriptor = ( props: ListItemDescriptorProps ): JSX.Element => { - const { description, content, type } = props + const { description, content, type, isInSlideout = false } = props return ( - + {description} - - {content} - + {content} ) } diff --git a/protocol-designer/src/atoms/constants.ts b/protocol-designer/src/atoms/constants.ts index e5c73333cd8..e1acf21fddc 100644 --- a/protocol-designer/src/atoms/constants.ts +++ b/protocol-designer/src/atoms/constants.ts @@ -1,5 +1,6 @@ import { css } from 'styled-components' -import { COLORS } from '@opentrons/components' +import { COLORS, OVERFLOW_HIDDEN } from '@opentrons/components' +import type { FlattenSimpleInterpolation } from 'styled-components' export const BUTTON_LINK_STYLE = css` color: ${COLORS.grey60}; @@ -7,3 +8,14 @@ export const BUTTON_LINK_STYLE = css` color: ${COLORS.grey40}; } ` + +export const LINE_CLAMP_TEXT_STYLE = ( + lineClamp: number +): FlattenSimpleInterpolation => css` + display: -webkit-box; + -webkit-box-orient: vertical; + overflow: ${OVERFLOW_HIDDEN}; + text-overflow: ellipsis; + word-wrap: break-word; + -webkit-line-clamp: ${lineClamp}; +` diff --git a/protocol-designer/src/organisms/MaterialsListModal/index.tsx b/protocol-designer/src/organisms/MaterialsListModal/index.tsx index 0d5c90c1f4b..6fa69307eef 100644 --- a/protocol-designer/src/organisms/MaterialsListModal/index.tsx +++ b/protocol-designer/src/organisms/MaterialsListModal/index.tsx @@ -93,7 +93,7 @@ export function MaterialsListModal({ ? fixtures.map(fixture => ( } @@ -187,7 +187,7 @@ export function MaterialsListModal({ return ( } diff --git a/protocol-designer/src/organisms/SlotInformation/index.tsx b/protocol-designer/src/organisms/SlotInformation/index.tsx index 19c4e25f2e5..cd3550ed7d5 100644 --- a/protocol-designer/src/organisms/SlotInformation/index.tsx +++ b/protocol-designer/src/organisms/SlotInformation/index.tsx @@ -52,7 +52,7 @@ export const SlotInformation: React.FC = ({ {liquids.length > 1 ? ( @@ -113,7 +113,7 @@ function StackInfo({ title, stackInformation }: StackInfoProps): JSX.Element { return ( - - - - - - - {slotInfo[0]} - - - {slotInfo[1]} - - - + + + {slotInfo[0]} + + + {slotInfo[1]} + + + } + description={ + + + + } + /> diff --git a/protocol-designer/src/pages/ProtocolOverview/InstrumentsInfo.tsx b/protocol-designer/src/pages/ProtocolOverview/InstrumentsInfo.tsx index e87b6550904..cd1b5215ab1 100644 --- a/protocol-designer/src/pages/ProtocolOverview/InstrumentsInfo.tsx +++ b/protocol-designer/src/pages/ProtocolOverview/InstrumentsInfo.tsx @@ -92,7 +92,7 @@ export function InstrumentsInfo({ @@ -118,7 +118,7 @@ export function InstrumentsInfo({ {robotType === FLEX_ROBOT_TYPE ? ( diff --git a/protocol-designer/src/pages/ProtocolOverview/LiquidDefinitions.tsx b/protocol-designer/src/pages/ProtocolOverview/LiquidDefinitions.tsx index 03c274ce104..fc767242929 100644 --- a/protocol-designer/src/pages/ProtocolOverview/LiquidDefinitions.tsx +++ b/protocol-designer/src/pages/ProtocolOverview/LiquidDefinitions.tsx @@ -1,5 +1,4 @@ import { useTranslation } from 'react-i18next' -import { css } from 'styled-components' import { ALIGN_CENTER, DIRECTION_COLUMN, @@ -8,10 +7,10 @@ import { LiquidIcon, ListItem, ListItemDescriptor, - OVERFLOW_HIDDEN, SPACING, StyledText, } from '@opentrons/components' +import { LINE_CLAMP_TEXT_STYLE } from '../../atoms' import type { AllIngredGroupFields } from '../../labware-ingred/types' @@ -36,7 +35,7 @@ export function LiquidDefinitions({ key={`${liquid.name}_${liquid.displayColor}_${index}`} > @@ -44,7 +43,7 @@ export function LiquidDefinitions({ desktopStyle="bodyDefaultRegular" overflowWrap="anywhere" id="liquid-name" - css={LIQUID_DEFINITION_TEXT} + css={LINE_CLAMP_TEXT_STYLE(3)} > {liquid.name} @@ -61,11 +60,3 @@ export function LiquidDefinitions({ ) } - -const LIQUID_DEFINITION_TEXT = css` - display: -webkit-box; - -webkit-box-orient: vertical; - -webkit-line-clamp: 3; - overflow: ${OVERFLOW_HIDDEN}; - text-overflow: ellipsis; -` diff --git a/protocol-designer/src/pages/ProtocolOverview/ProtocolMetadata.tsx b/protocol-designer/src/pages/ProtocolOverview/ProtocolMetadata.tsx index 7bb26264b8f..69d8697765b 100644 --- a/protocol-designer/src/pages/ProtocolOverview/ProtocolMetadata.tsx +++ b/protocol-designer/src/pages/ProtocolOverview/ProtocolMetadata.tsx @@ -61,7 +61,7 @@ export function ProtocolMetadata({ return ( @@ -70,7 +70,7 @@ export function ProtocolMetadata({ })} {protocolName != null && protocolName !== '' ? protocolName @@ -418,15 +418,6 @@ export function ProtocolOverview(): JSX.Element { ) } -const PROTOCOL_NAME_TEXT_STYLE = css` - display: -webkit-box; - -webkit-box-orient: vertical; - overflow: hidden; - text-overflow: ellipsis; - word-wrap: break-word; - -webkit-line-clamp: 3; -` - const MIN_OVERVIEW_WIDTH = '64rem' const COLUMN_GRID_GAP = '5rem' const COLUMN_STYLE = css`