@opentrons/components 0.1.7-alpha.1 → 0.2.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cssModuleSideEffect.ts +22 -0
- package/lib/assets/localization/en/index.d.ts +12 -0
- package/lib/assets/localization/index.d.ts +12 -0
- package/lib/atoms/AnimationVideo/index.d.ts +13 -0
- package/lib/atoms/InlineNotification/index.d.ts +1 -1
- package/lib/atoms/ListButton/ListButtonChildren/index.d.ts +0 -1
- package/lib/atoms/StyledText/PlaceholderStyledText.d.ts +14 -0
- package/lib/atoms/StyledText/index.d.ts +1 -0
- package/lib/atoms/buttons/BasicButton.d.ts +12 -0
- package/lib/atoms/buttons/index.d.ts +1 -0
- package/lib/atoms/index.d.ts +1 -0
- package/lib/hardware-sim/BaseDeck/BaseDeck.d.ts +10 -8
- package/lib/hardware-sim/Deck/FlexTrash.d.ts +4 -1
- package/lib/hardware-sim/Deck/MoveLabwareOnDeck.d.ts +3 -2
- package/lib/hardware-sim/Deck/RobotCoordsForeignDiv.d.ts +6 -5
- package/lib/hardware-sim/Deck/RobotCoordsForeignObject.d.ts +8 -5
- package/lib/hardware-sim/Deck/RobotCoordsText.d.ts +11 -1
- package/lib/hardware-sim/Deck/RobotWorkSpace.d.ts +30 -14
- package/lib/hardware-sim/Deck/__tests__/resolveLabwareLocation.test.d.ts +1 -0
- package/lib/hardware-sim/Deck/resolveLabwareLocation.d.ts +20 -0
- package/lib/hardware-sim/DeckConfigurator/AbsorbanceReaderItem.d.ts +11 -0
- package/lib/hardware-sim/DeckConfigurator/EmptyConfigItem.d.ts +11 -0
- package/lib/hardware-sim/DeckConfigurator/FlexStackerItem.d.ts +12 -0
- package/lib/hardware-sim/DeckConfigurator/HeaterShakerItem.d.ts +11 -0
- package/lib/hardware-sim/DeckConfigurator/MagneticBlockItem.d.ts +12 -0
- package/lib/hardware-sim/DeckConfigurator/StagingAreaConfigItem.d.ts +11 -0
- package/lib/hardware-sim/DeckConfigurator/{StaticFixture.d.ts → StaticItem.d.ts} +1 -1
- package/lib/hardware-sim/DeckConfigurator/TemperatureModuleItem.d.ts +11 -0
- package/lib/hardware-sim/DeckConfigurator/ThermocyclerItem.d.ts +11 -0
- package/lib/hardware-sim/DeckConfigurator/TrashBinConfigItem.d.ts +11 -0
- package/lib/hardware-sim/DeckConfigurator/WasteChuteConfigItem.d.ts +11 -0
- package/lib/hardware-sim/DeckConfigurator/constants.d.ts +5 -8
- package/lib/hardware-sim/DeckConfigurator/index.d.ts +4 -3
- package/lib/hardware-sim/Labware/CalibrationBlockRender.d.ts +15 -0
- package/lib/hardware-sim/Labware/Labware.d.ts +7 -8
- package/lib/hardware-sim/Labware/LabwareAdapter/index.d.ts +2 -2
- package/lib/hardware-sim/Labware/LabwareRender.d.ts +46 -5
- package/lib/hardware-sim/Labware/index.d.ts +1 -0
- package/lib/hardware-sim/Labware/labwareInternals/FilledWells.d.ts +3 -4
- package/lib/hardware-sim/Labware/labwareInternals/LabwareOutline.d.ts +20 -9
- package/lib/hardware-sim/Labware/labwareInternals/LabwareWellLabels.d.ts +2 -2
- package/lib/hardware-sim/Labware/labwareInternals/StaticLabware.d.ts +2 -2
- package/lib/hardware-sim/Labware/labwareInternals/StrokedWells.d.ts +2 -2
- package/lib/hardware-sim/Labware/labwareInternals/StyledWells.d.ts +2 -2
- package/lib/hardware-sim/Labware/labwareInternals/Well.d.ts +1 -2
- package/lib/hardware-sim/Labware/labwareInternals/WellLabels.d.ts +2 -2
- package/lib/hardware-sim/Module/index.d.ts +24 -2
- package/lib/hardware-sim/Pipette/PipetteRender.d.ts +2 -2
- package/lib/hardware-sim/RobotCoordinateSpace/RobotCoordinateSpace.d.ts +5 -3
- package/lib/hocs/withStyleProps.d.ts +26 -0
- package/lib/hooks/useConditionalConfirm.d.ts +4 -0
- package/lib/icons/Icon.d.ts +7 -7
- package/lib/icons/ModuleIcon.d.ts +4 -3
- package/lib/instrument/index.d.ts +0 -2
- package/lib/legacy-hardware-sim/index.d.ts +0 -1
- package/lib/lists/index.d.ts +0 -1
- package/lib/molecules/CustomizeExpandButton/__tests__/CustomizeExpandButton.test.d.ts +1 -0
- package/lib/molecules/CustomizeExpandButton/index.d.ts +29 -0
- package/lib/molecules/DeckInfoLabel/index.d.ts +8 -16
- package/lib/molecules/index.d.ts +2 -1
- package/lib/organisms/CommandText/index.d.ts +2 -2
- package/lib/organisms/CommandText/useCommandTextString/index.d.ts +2 -2
- package/lib/organisms/CommandText/useCommandTextString/utils/getLabwareDefinitionsFromCommands.d.ts +2 -2
- package/lib/organisms/CommandText/useCommandTextString/utils/getLabwareLocation.d.ts +3 -3
- package/lib/organisms/CommandText/useCommandTextString/utils/getLabwareName.d.ts +2 -2
- package/lib/organisms/FixtureOption/index.d.ts +2 -2
- package/lib/organisms/ProtocolDeck/index.d.ts +10 -0
- package/lib/organisms/ProtocolTimelineScrubber/CommandItem.d.ts +2 -2
- package/lib/organisms/ProtocolTimelineScrubber/utils.d.ts +2 -2
- package/lib/organisms/index.d.ts +1 -0
- package/lib/primitives/ForeignObject.d.ts +8 -18
- package/lib/primitives/style-props.d.ts +1 -1
- package/lib/structure/index.d.ts +2 -3
- package/package.json +6 -3
- package/src/alerts/alerts.module.css +2 -2
- package/src/assets/localization/en/deck_configuration.json +12 -0
- package/src/assets/localization/en/index.ts +2 -0
- package/src/assets/localization/en/protocol_command_text.json +1 -1
- package/src/atoms/AnimationVideo/__tests__/AnimationVideo.test.tsx +40 -0
- package/src/atoms/AnimationVideo/index.tsx +44 -0
- package/src/atoms/CheckboxField/__tests__/CheckboxField.test.tsx +0 -3
- package/src/atoms/CheckboxField/index.tsx +1 -1
- package/src/atoms/InlineNotification/index.tsx +86 -70
- package/src/atoms/ListButton/ListButton.stories.tsx +21 -7
- package/src/atoms/ListButton/ListButtonChildren/index.ts +0 -1
- package/src/atoms/ListItem/ListItemChildren/ListItemDescriptor.tsx +2 -2
- package/src/atoms/MenuList/OverflowBtn.tsx +39 -41
- package/src/atoms/Snackbar/Snackbar.stories.tsx +59 -23
- package/src/atoms/Snackbar/index.tsx +48 -38
- package/src/atoms/StyledText/PlaceholderStyledText.tsx +46 -0
- package/src/atoms/StyledText/index.ts +1 -0
- package/src/atoms/StyledText/placeholderstyledtext.module.css +25 -0
- package/src/atoms/buttons/BasicButton.tsx +100 -0
- package/src/atoms/buttons/SecondaryButton.tsx +5 -2
- package/src/atoms/buttons/__tests__/BasicButton.test.tsx +87 -0
- package/src/atoms/buttons/buttons.stories.tsx +91 -55
- package/src/atoms/buttons/index.ts +1 -0
- package/src/atoms/index.ts +1 -0
- package/src/buttons/buttons.module.css +92 -92
- package/src/controls/styles.module.css +15 -15
- package/src/forms/Select.module.css +23 -23
- package/src/forms/forms.module.css +38 -37
- package/src/hardware-sim/BaseDeck/BaseDeck.stories.tsx +7 -7
- package/src/hardware-sim/BaseDeck/BaseDeck.tsx +98 -61
- package/src/hardware-sim/BaseDeck/WasteChuteFixture.tsx +22 -28
- package/src/hardware-sim/BaseDeck/basedeck.module.css +20 -0
- package/src/hardware-sim/Deck/FlexTrash.tsx +50 -30
- package/src/hardware-sim/Deck/MoveLabwareOnDeck.stories.tsx +2 -2
- package/src/hardware-sim/Deck/MoveLabwareOnDeck.tsx +122 -156
- package/src/hardware-sim/Deck/RobotCoordsForeignDiv.tsx +35 -27
- package/src/hardware-sim/Deck/RobotCoordsForeignObject.tsx +32 -29
- package/src/hardware-sim/Deck/RobotCoordsText.tsx +12 -11
- package/src/hardware-sim/Deck/RobotWorkSpace.tsx +74 -54
- package/src/hardware-sim/Deck/SlotLabels.tsx +51 -51
- package/src/hardware-sim/Deck/__tests__/resolveLabwareLocation.test.ts +138 -0
- package/src/hardware-sim/Deck/deck.module.css +54 -0
- package/src/hardware-sim/Deck/resolveLabwareLocation.ts +154 -0
- package/src/hardware-sim/DeckConfigurator/{FlexStackerFixture.tsx → AbsorbanceReaderItem.tsx} +34 -31
- package/src/hardware-sim/DeckConfigurator/{EmptyConfigFixture.tsx → EmptyConfigItem.tsx} +72 -44
- package/src/hardware-sim/DeckConfigurator/{AbsorbanceReaderFixture.tsx → FlexStackerItem.tsx} +46 -27
- package/src/hardware-sim/DeckConfigurator/{HeaterShakerFixture.tsx → HeaterShakerItem.tsx} +40 -28
- package/src/hardware-sim/DeckConfigurator/{MagneticBlockFixture.tsx → MagneticBlockItem.tsx} +41 -58
- package/src/hardware-sim/DeckConfigurator/{StagingAreaConfigFixture.tsx → StagingAreaConfigItem.tsx} +41 -23
- package/src/hardware-sim/DeckConfigurator/{StaticFixture.tsx → StaticItem.tsx} +16 -9
- package/src/hardware-sim/DeckConfigurator/{TemperatureModuleFixture.tsx → TemperatureModuleItem.tsx} +42 -26
- package/src/hardware-sim/DeckConfigurator/{ThermocyclerFixture.tsx → ThermocyclerItem.tsx} +31 -21
- package/src/hardware-sim/DeckConfigurator/{TrashBinConfigFixture.tsx → TrashBinConfigItem.tsx} +42 -27
- package/src/hardware-sim/DeckConfigurator/{WasteChuteConfigFixture.tsx → WasteChuteConfigItem.tsx} +38 -27
- package/src/hardware-sim/DeckConfigurator/constants.ts +5 -9
- package/src/hardware-sim/DeckConfigurator/index.tsx +236 -206
- package/src/hardware-sim/Labware/CalibrationBlockRender.stories.tsx +49 -0
- package/src/hardware-sim/Labware/CalibrationBlockRender.tsx +172 -0
- package/src/hardware-sim/Labware/Labware.tsx +30 -15
- package/src/hardware-sim/Labware/LabwareAdapter/index.tsx +2 -2
- package/src/hardware-sim/Labware/LabwareRender.stories.tsx +36 -21
- package/src/hardware-sim/Labware/LabwareRender.tsx +70 -15
- package/src/hardware-sim/Labware/__tests__/Labware.test.tsx +9 -4
- package/src/hardware-sim/Labware/__tests__/LabwareRender.test.tsx +14 -5
- package/src/hardware-sim/Labware/index.ts +1 -0
- package/src/hardware-sim/Labware/labware.module.css +8 -0
- package/src/hardware-sim/Labware/labwareInternals/FilledWells.tsx +3 -4
- package/src/hardware-sim/Labware/labwareInternals/LabwareOutline.tsx +48 -23
- package/src/hardware-sim/Labware/labwareInternals/LabwareWellLabels.tsx +3 -3
- package/src/hardware-sim/Labware/labwareInternals/StaticLabware.tsx +2 -2
- package/src/hardware-sim/Labware/labwareInternals/StrokedWells.tsx +2 -2
- package/src/hardware-sim/Labware/labwareInternals/StyledWells.tsx +2 -2
- package/src/hardware-sim/Labware/labwareInternals/Well.tsx +1 -2
- package/src/hardware-sim/Labware/labwareInternals/WellLabels.tsx +10 -11
- package/src/hardware-sim/Labware/labwareInternals/__tests__/LabwareWellLabels.test.tsx +2 -2
- package/src/hardware-sim/Labware/labwareInternals/__tests__/StrokedWells.test.tsx +2 -2
- package/src/hardware-sim/Labware/labwareInternals/__tests__/WellLabels.test.tsx +2 -2
- package/src/hardware-sim/Module/Module.stories.tsx +45 -15
- package/src/hardware-sim/Module/Thermocycler/index.tsx +2 -2
- package/src/hardware-sim/Module/index.tsx +41 -18
- package/src/hardware-sim/Pipette/PipetteRender.stories.tsx +2 -2
- package/src/hardware-sim/Pipette/PipetteRender.tsx +5 -7
- package/src/hardware-sim/Pipette/__tests__/PipetteRender.test.tsx +2 -2
- package/src/hardware-sim/RobotCoordinateSpace/RobotCoordinateSpace.tsx +15 -14
- package/src/hardware-sim/RobotCoordinateSpace/robotcoordinatespace.module.css +3 -0
- package/src/hocs/withStyleProps.ts +53 -0
- package/src/hooks/useConditionalConfirm.ts +15 -5
- package/src/icons/Icon.tsx +38 -29
- package/src/icons/ModuleIcon.tsx +5 -3
- package/src/icons/icon-data.ts +26 -2
- package/src/icons/icon.module.css +10 -0
- package/src/index.module.css +1 -0
- package/src/instrument/InstrumentDiagram.tsx +0 -2
- package/src/instrument/PipetteSelect.module.css +3 -3
- package/src/instrument/index.ts +0 -2
- package/src/legacy-hardware-sim/LabwareNameOverlay.module.css +5 -5
- package/src/legacy-hardware-sim/ModuleItem.module.css +19 -19
- package/src/legacy-hardware-sim/index.ts +0 -1
- package/src/lists/index.ts +0 -1
- package/src/lists/lists.module.css +23 -23
- package/src/modals/modals.module.css +55 -55
- package/src/molecules/CustomizeExpandButton/__tests__/CustomizeExpandButton.test.tsx +88 -0
- package/src/molecules/CustomizeExpandButton/index.tsx +189 -0
- package/src/molecules/DeckInfoLabel/DeckInfoLabel.stories.tsx +10 -6
- package/src/molecules/DeckInfoLabel/__tests__/DeckInfoLabel.test.tsx +15 -11
- package/src/molecules/DeckInfoLabel/deckinfolabel.module.css +42 -0
- package/src/molecules/DeckInfoLabel/index.tsx +36 -62
- package/src/molecules/DropdownMenu/index.tsx +17 -13
- package/src/molecules/InfoScreen/index.tsx +6 -2
- package/src/molecules/ReleaseNotes/styles.module.css +15 -15
- package/src/molecules/index.ts +2 -1
- package/src/nav/SidePanel.module.css +6 -6
- package/src/organisms/CommandText/__tests__/CommandText.test.tsx +12 -12
- package/src/organisms/CommandText/index.tsx +2 -2
- package/src/organisms/CommandText/useCommandTextString/index.ts +2 -2
- package/src/organisms/CommandText/useCommandTextString/utils/__tests__/getFinalLabwareLocation.test.ts +4 -4
- package/src/organisms/CommandText/useCommandTextString/utils/commandText/__tests__/getPipettingCommandText.test.tsx +3 -3
- package/src/organisms/CommandText/useCommandTextString/utils/commandText/getFlexStackerCommandText.ts +2 -4
- package/src/organisms/CommandText/useCommandTextString/utils/commandText/getMoveToWellCommandText.ts +19 -3
- package/src/organisms/CommandText/useCommandTextString/utils/commandText/getPipettingCommandText.ts +19 -10
- package/src/organisms/CommandText/useCommandTextString/utils/getLabwareDefinitionsFromCommands.ts +9 -9
- package/src/organisms/CommandText/useCommandTextString/utils/getLabwareLocation.tsx +3 -3
- package/src/organisms/CommandText/useCommandTextString/utils/getLabwareName.ts +2 -2
- package/src/organisms/DeckLabelSet/index.tsx +1 -3
- package/src/organisms/FixtureOption/__tests__/FixtureOption.test.tsx +0 -2
- package/src/organisms/FixtureOption/index.tsx +42 -71
- package/src/organisms/ProtocolDeck/index.tsx +118 -0
- package/src/organisms/ProtocolTimelineScrubber/CommandItem.tsx +2 -2
- package/src/organisms/ProtocolTimelineScrubber/PipetteVisuals.tsx +1 -1
- package/src/organisms/ProtocolTimelineScrubber/utils.ts +3 -3
- package/src/organisms/index.ts +1 -0
- package/src/primitives/ForeignObject.tsx +20 -61
- package/src/primitives/style-props.ts +1 -0
- package/src/slotmap/styles.module.css +1 -1
- package/src/structure/Pill.module.css +1 -1
- package/src/structure/Splash.module.css +1 -1
- package/src/structure/index.ts +2 -4
- package/src/structure/structure.module.css +11 -11
- package/src/styles/colors.module.css +1 -0
- package/src/styles/global.css +179 -0
- package/src/styles/index.module.css +1 -1
- package/src/styles/typography.module.css +1 -0
- package/src/testing/utils/renderWithProviders.tsx +3 -6
- package/src/tooltips/tooltips.module.css +14 -14
- package/vite.config.mts +6 -3
- package/lib/atoms/ListButton/ListButtonChildren/ListButtonRadioButton.d.ts +0 -14
- package/lib/hardware-sim/DeckConfigurator/AbsorbanceReaderFixture.d.ts +0 -10
- package/lib/hardware-sim/DeckConfigurator/EmptyConfigFixture.d.ts +0 -8
- package/lib/hardware-sim/DeckConfigurator/FlexStackerFixture.d.ts +0 -11
- package/lib/hardware-sim/DeckConfigurator/HeaterShakerFixture.d.ts +0 -10
- package/lib/hardware-sim/DeckConfigurator/MagneticBlockFixture.d.ts +0 -11
- package/lib/hardware-sim/DeckConfigurator/StagingAreaConfigFixture.d.ts +0 -10
- package/lib/hardware-sim/DeckConfigurator/TemperatureModuleFixture.d.ts +0 -10
- package/lib/hardware-sim/DeckConfigurator/ThermocyclerFixture.d.ts +0 -10
- package/lib/hardware-sim/DeckConfigurator/TrashBinConfigFixture.d.ts +0 -10
- package/lib/hardware-sim/DeckConfigurator/WasteChuteConfigFixture.d.ts +0 -11
- package/lib/hardware-sim/utils.d.ts +0 -3
- package/lib/instrument/InstrumentGroup.d.ts +0 -11
- package/lib/instrument/InstrumentInfo.d.ts +0 -18
- package/lib/legacy-hardware-sim/ModuleItem.d.ts +0 -17
- package/lib/lists/TitledList.d.ts +0 -44
- package/lib/structure/Card.d.ts +0 -18
- package/src/atoms/ListButton/ListButtonChildren/ListButtonRadioButton.tsx +0 -109
- package/src/atoms/ListButton/__tests__/ListButtonRadioButton.test.tsx +0 -28
- package/src/hardware-sim/utils.ts +0 -18
- package/src/instrument/InstrumentDiagram.stories.tsx +0 -43
- package/src/instrument/InstrumentGroup.stories.tsx +0 -89
- package/src/instrument/InstrumentGroup.tsx +0 -35
- package/src/instrument/InstrumentInfo.tsx +0 -106
- package/src/instrument/__tests__/InstrumentInfo.test.tsx +0 -58
- package/src/instrument/instrument.module.css +0 -45
- package/src/legacy-hardware-sim/ModuleItem.tsx +0 -145
- package/src/lists/TitledList.tsx +0 -154
- package/src/structure/Card.stories.tsx +0 -29
- package/src/structure/Card.tsx +0 -65
- /package/lib/atoms/{ListButton/__tests__/ListButtonRadioButton.test.d.ts → AnimationVideo/__tests__/AnimationVideo.test.d.ts} +0 -0
- /package/lib/{instrument/__tests__/InstrumentInfo.test.d.ts → atoms/buttons/__tests__/BasicButton.test.d.ts} +0 -0
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getLabwareViewBox } from '@opentrons/shared-data'
|
|
2
2
|
|
|
3
3
|
import { COLORS } from '../../../helix-design-system'
|
|
4
4
|
import { getTiprackBackgroundColor } from './getTiprackBackgroundColor'
|
|
5
5
|
|
|
6
|
-
import type { CSSProperties } from '
|
|
7
|
-
import type {
|
|
8
|
-
import type { LabwareDefinition2 } from '@opentrons/shared-data'
|
|
6
|
+
import type { CSSProperties, SVGProps } from 'react'
|
|
7
|
+
import type { LabwareDefinition } from '@opentrons/shared-data'
|
|
9
8
|
|
|
10
|
-
export
|
|
11
|
-
/** Labware definition to outline */
|
|
12
|
-
definition?: LabwareDefinition2
|
|
13
|
-
/** x dimension in mm of this labware, used if definition doesn't supply dimensions, defaults to 127.76 */
|
|
14
|
-
width?: number
|
|
15
|
-
/** y dimension in mm of this labware, used if definition doesn't supply dimensions, defaults to 85.48 */
|
|
16
|
-
height?: number
|
|
9
|
+
export type LabwareOutlineProps = {
|
|
17
10
|
/** if this labware is a tip rack, darken background and lighten borderx dimension in mm of this labware, used if definition doesn't supply dimensions, defaults to false */
|
|
18
11
|
isTiprack?: boolean
|
|
19
12
|
/** adds thicker blue border with blur to labware, defaults to false */
|
|
@@ -24,6 +17,24 @@ export interface LabwareOutlineProps {
|
|
|
24
17
|
stroke?: CSSProperties['stroke']
|
|
25
18
|
fill?: CSSProperties['fill']
|
|
26
19
|
showRadius?: boolean
|
|
20
|
+
} & (DefinitionProps | DefinitionReplacementProps)
|
|
21
|
+
|
|
22
|
+
interface DefinitionProps {
|
|
23
|
+
/** Labware definition to outline */
|
|
24
|
+
definition: LabwareDefinition
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Used for rendering an outline without needing a full labware definition. */
|
|
28
|
+
interface DefinitionReplacementProps {
|
|
29
|
+
definition?: undefined
|
|
30
|
+
/** x dimension in mm of the outline. */
|
|
31
|
+
width: number
|
|
32
|
+
/** y dimension in mm of the outline. */
|
|
33
|
+
height: number
|
|
34
|
+
/** minimum x-coordinate (i.e. the left side) of the outline. */
|
|
35
|
+
minX: number
|
|
36
|
+
/** minimum y-coordinate (i.e. the bottom) of the outline. */
|
|
37
|
+
minY: number
|
|
27
38
|
}
|
|
28
39
|
|
|
29
40
|
const OUTLINE_THICKNESS_MM = 1
|
|
@@ -31,8 +42,6 @@ const OUTLINE_THICKNESS_MM = 1
|
|
|
31
42
|
export function LabwareOutline(props: LabwareOutlineProps): JSX.Element {
|
|
32
43
|
const {
|
|
33
44
|
definition,
|
|
34
|
-
width = SLOT_RENDER_WIDTH,
|
|
35
|
-
height = SLOT_RENDER_HEIGHT,
|
|
36
45
|
isTiprack = false,
|
|
37
46
|
highlight = false,
|
|
38
47
|
highlightShadow = false,
|
|
@@ -40,10 +49,18 @@ export function LabwareOutline(props: LabwareOutlineProps): JSX.Element {
|
|
|
40
49
|
fill,
|
|
41
50
|
showRadius = true,
|
|
42
51
|
} = props
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
52
|
+
|
|
53
|
+
const { minX, minY, xDimension, yDimension } =
|
|
54
|
+
definition != null
|
|
55
|
+
? getLabwareViewBox(definition)
|
|
56
|
+
: {
|
|
57
|
+
minX: props.minX,
|
|
58
|
+
minY: props.minY,
|
|
59
|
+
xDimension: props.width,
|
|
60
|
+
yDimension: props.height,
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const { parameters = { isTiprack, loadName: '' } } = definition ?? {}
|
|
47
64
|
|
|
48
65
|
let backgroundFill
|
|
49
66
|
if (fill != null) {
|
|
@@ -86,8 +103,10 @@ export function LabwareOutline(props: LabwareOutlineProps): JSX.Element {
|
|
|
86
103
|
</defs>
|
|
87
104
|
<LabwareBorder
|
|
88
105
|
borderThickness={2.2 * OUTLINE_THICKNESS_MM}
|
|
89
|
-
|
|
90
|
-
|
|
106
|
+
minX={minX}
|
|
107
|
+
minY={minY}
|
|
108
|
+
xDimension={xDimension}
|
|
109
|
+
yDimension={yDimension}
|
|
91
110
|
filter={highlightShadow ? 'url(#feOffset)' : ''}
|
|
92
111
|
stroke={COLORS.blue50}
|
|
93
112
|
rx="8"
|
|
@@ -99,8 +118,10 @@ export function LabwareOutline(props: LabwareOutlineProps): JSX.Element {
|
|
|
99
118
|
) : (
|
|
100
119
|
<LabwareBorder
|
|
101
120
|
borderThickness={OUTLINE_THICKNESS_MM}
|
|
102
|
-
|
|
103
|
-
|
|
121
|
+
minX={minX}
|
|
122
|
+
minY={minY}
|
|
123
|
+
xDimension={xDimension}
|
|
124
|
+
yDimension={yDimension}
|
|
104
125
|
stroke={stroke ?? (parameters.isTiprack ? '#979797' : COLORS.black90)}
|
|
105
126
|
fill={backgroundFill}
|
|
106
127
|
showRadius={showRadius}
|
|
@@ -112,6 +133,8 @@ export function LabwareOutline(props: LabwareOutlineProps): JSX.Element {
|
|
|
112
133
|
|
|
113
134
|
interface LabwareBorderProps extends SVGProps<SVGRectElement> {
|
|
114
135
|
borderThickness: number
|
|
136
|
+
minX: number
|
|
137
|
+
minY: number
|
|
115
138
|
xDimension: number
|
|
116
139
|
yDimension: number
|
|
117
140
|
showRadius?: boolean
|
|
@@ -119,6 +142,8 @@ interface LabwareBorderProps extends SVGProps<SVGRectElement> {
|
|
|
119
142
|
function LabwareBorder(props: LabwareBorderProps): JSX.Element {
|
|
120
143
|
const {
|
|
121
144
|
borderThickness,
|
|
145
|
+
minX,
|
|
146
|
+
minY,
|
|
122
147
|
xDimension,
|
|
123
148
|
yDimension,
|
|
124
149
|
showRadius = true,
|
|
@@ -126,8 +151,8 @@ function LabwareBorder(props: LabwareBorderProps): JSX.Element {
|
|
|
126
151
|
} = props
|
|
127
152
|
return (
|
|
128
153
|
<rect
|
|
129
|
-
x={borderThickness}
|
|
130
|
-
y={borderThickness}
|
|
154
|
+
x={minX + borderThickness}
|
|
155
|
+
y={minY + borderThickness}
|
|
131
156
|
strokeWidth={2 * borderThickness}
|
|
132
157
|
width={xDimension - 2 * borderThickness}
|
|
133
158
|
height={yDimension - 2 * borderThickness}
|
|
@@ -5,7 +5,7 @@ import { TYPOGRAPHY } from '../../../ui-style-constants'
|
|
|
5
5
|
import { RobotCoordsText } from '../../Deck'
|
|
6
6
|
|
|
7
7
|
import type { MemoExoticComponent } from 'react'
|
|
8
|
-
import type {
|
|
8
|
+
import type { LabwareDefinition } from '@opentrons/shared-data'
|
|
9
9
|
import type { HighlightedWellLabels } from './types'
|
|
10
10
|
|
|
11
11
|
// magic layout numbers to make the letters close to the edges of the labware
|
|
@@ -14,13 +14,13 @@ const LETTER_COLUMN_X_ADJUSTMENT = -4
|
|
|
14
14
|
const NUMBER_COLUMN_Y_ADJUSTMENT = 2
|
|
15
15
|
|
|
16
16
|
interface LabwareWellLabelsProps {
|
|
17
|
-
definition:
|
|
17
|
+
definition: LabwareDefinition
|
|
18
18
|
highlightedWellLabels?: HighlightedWellLabels
|
|
19
19
|
wellLabelColor?: string
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const Labels = (props: {
|
|
23
|
-
definition:
|
|
23
|
+
definition: LabwareDefinition
|
|
24
24
|
wells: string[]
|
|
25
25
|
isLetterColumn?: boolean
|
|
26
26
|
highlightedWellLabels?: HighlightedWellLabels
|
|
@@ -10,12 +10,12 @@ import { Well } from './Well'
|
|
|
10
10
|
|
|
11
11
|
import type { CSSProperties } from 'styled-components'
|
|
12
12
|
import type { MemoExoticComponent } from 'react'
|
|
13
|
-
import type {
|
|
13
|
+
import type { LabwareDefinition, LabwareWell } from '@opentrons/shared-data'
|
|
14
14
|
import type { WellMouseEvent, WellStroke } from './types'
|
|
15
15
|
|
|
16
16
|
export interface StaticLabwareProps {
|
|
17
17
|
/** Labware definition to render */
|
|
18
|
-
definition:
|
|
18
|
+
definition: LabwareDefinition
|
|
19
19
|
/** Add thicker blurred blue border to labware, defaults to false */
|
|
20
20
|
highlight?: boolean
|
|
21
21
|
/** adds a drop shadow to the highlight border */
|
|
@@ -6,10 +6,10 @@ import { Well } from './Well'
|
|
|
6
6
|
|
|
7
7
|
import type { CSSProperties } from 'styled-components'
|
|
8
8
|
import type { MemoExoticComponent, ReactNode } from 'react'
|
|
9
|
-
import type {
|
|
9
|
+
import type { LabwareDefinition } from '@opentrons/shared-data'
|
|
10
10
|
|
|
11
11
|
export interface StrokedWellProps {
|
|
12
|
-
definition:
|
|
12
|
+
definition: LabwareDefinition
|
|
13
13
|
strokeByWell: Record<string, CSSProperties['stroke']>
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -4,7 +4,7 @@ import { COLORS } from '../../../helix-design-system'
|
|
|
4
4
|
import { Well } from './Well'
|
|
5
5
|
|
|
6
6
|
import type { CSSProperties, MemoExoticComponent } from 'react'
|
|
7
|
-
import type {
|
|
7
|
+
import type { LabwareDefinition } from '@opentrons/shared-data'
|
|
8
8
|
import type { WellGroup } from './types'
|
|
9
9
|
|
|
10
10
|
type WellContents =
|
|
@@ -16,7 +16,7 @@ type WellContents =
|
|
|
16
16
|
| 'selectedWell'
|
|
17
17
|
export interface StyledWellProps {
|
|
18
18
|
wellContents: WellContents
|
|
19
|
-
definition:
|
|
19
|
+
definition: LabwareDefinition
|
|
20
20
|
wells: WellGroup
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -6,10 +6,9 @@ import { COLORS } from '../../../helix-design-system'
|
|
|
6
6
|
|
|
7
7
|
import type { CSSProperties, MemoExoticComponent, MouseEvent } from 'react'
|
|
8
8
|
import type { LabwareWell } from '@opentrons/shared-data'
|
|
9
|
-
import type { StyleProps } from '../../../primitives'
|
|
10
9
|
import type { WellMouseEvent } from './types'
|
|
11
10
|
|
|
12
|
-
export interface WellProps extends
|
|
11
|
+
export interface WellProps extends CSSProperties {
|
|
13
12
|
/** Well Name (eg 'A1') */
|
|
14
13
|
wellName: string
|
|
15
14
|
/** well object from labware definition */
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { memo } from 'react'
|
|
2
2
|
|
|
3
|
+
import { getSchema2Dimensions } from '@opentrons/shared-data'
|
|
4
|
+
|
|
3
5
|
import { COLORS } from '../../../helix-design-system'
|
|
4
6
|
import { C_BLACK, C_BLUE } from '../../../styles/colors'
|
|
5
7
|
import { RobotCoordsText } from '../../Deck'
|
|
6
8
|
import { WELL_LABEL_OPTIONS } from '../LabwareRender'
|
|
7
9
|
|
|
8
10
|
import type { MemoExoticComponent } from 'react'
|
|
9
|
-
import type {
|
|
11
|
+
import type { LabwareDefinition } from '@opentrons/shared-data'
|
|
10
12
|
import type { WellLabelOption } from '../LabwareRender'
|
|
11
13
|
import type { HighlightedWellLabels } from './types'
|
|
12
14
|
|
|
@@ -18,14 +20,14 @@ const LETTER_COLUMN_X_OUTSIDE = -4
|
|
|
18
20
|
const NUMBER_COLUMN_Y_FROM_TOP_OUTSIDE = -5
|
|
19
21
|
|
|
20
22
|
export interface WellLabelsProps {
|
|
21
|
-
definition:
|
|
23
|
+
definition: LabwareDefinition
|
|
22
24
|
wellLabelOption: WellLabelOption
|
|
23
25
|
highlightedWellLabels?: HighlightedWellLabels
|
|
24
26
|
wellLabelColor?: string
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
const Labels = (props: {
|
|
28
|
-
definition:
|
|
30
|
+
definition: LabwareDefinition
|
|
29
31
|
wells: string[]
|
|
30
32
|
wellLabelOption: WellLabelOption
|
|
31
33
|
isLetterColumn?: boolean
|
|
@@ -61,16 +63,13 @@ const Labels = (props: {
|
|
|
61
63
|
y={
|
|
62
64
|
props.isLetterColumn === true
|
|
63
65
|
? well.y
|
|
64
|
-
: props.definition.
|
|
66
|
+
: getSchema2Dimensions(props.definition).yDimension -
|
|
65
67
|
NUMBER_COLUMN_Y_FROM_TOP
|
|
66
68
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
dominantBaseline:
|
|
72
|
-
props.isLetterColumn === true ? 'middle' : 'auto',
|
|
73
|
-
}}
|
|
69
|
+
color={COLORS.grey50} // LEGACY --c-font-dark
|
|
70
|
+
fontSize="0.2rem" // LEGACY --fs-micro
|
|
71
|
+
textAnchor="middle"
|
|
72
|
+
dominantBaseline={props.isLetterColumn === true ? 'middle' : 'auto'}
|
|
74
73
|
fill={
|
|
75
74
|
highlightedWellLabels?.wells.includes(wellName) ?? false
|
|
76
75
|
? highlightColor
|
|
@@ -7,9 +7,9 @@ import { fixture12Trough as _fixture12Trough } from '@opentrons/shared-data'
|
|
|
7
7
|
|
|
8
8
|
import { LabwareWellLabels } from '../LabwareWellLabels'
|
|
9
9
|
|
|
10
|
-
import type {
|
|
10
|
+
import type { LabwareDefinition } from '@opentrons/shared-data'
|
|
11
11
|
|
|
12
|
-
const troughFixture12 = _fixture12Trough as
|
|
12
|
+
const troughFixture12 = _fixture12Trough as LabwareDefinition
|
|
13
13
|
|
|
14
14
|
describe('LabwareWellLabels', () => {
|
|
15
15
|
it('should render well labels', () => {
|
|
@@ -8,11 +8,11 @@ import { fixture12Trough } from '@opentrons/shared-data'
|
|
|
8
8
|
import { StrokedWells } from '../StrokedWells'
|
|
9
9
|
import { WellComponent as Well } from '../Well'
|
|
10
10
|
|
|
11
|
-
import type {
|
|
11
|
+
import type { LabwareDefinition } from '@opentrons/shared-data'
|
|
12
12
|
|
|
13
13
|
vi.mock('../Well')
|
|
14
14
|
|
|
15
|
-
const troughFixture12 = fixture12Trough as
|
|
15
|
+
const troughFixture12 = fixture12Trough as LabwareDefinition
|
|
16
16
|
|
|
17
17
|
describe('StrokedWells', () => {
|
|
18
18
|
it('should render a series of wells with the given stroke', () => {
|
|
@@ -8,9 +8,9 @@ import { fixture12Trough as _fixture12Trough } from '@opentrons/shared-data'
|
|
|
8
8
|
import { WELL_LABEL_OPTIONS } from '../../LabwareRender'
|
|
9
9
|
import { WellLabels } from '../WellLabels'
|
|
10
10
|
|
|
11
|
-
import type {
|
|
11
|
+
import type { LabwareDefinition } from '@opentrons/shared-data'
|
|
12
12
|
|
|
13
|
-
const troughFixture12 = _fixture12Trough as
|
|
13
|
+
const troughFixture12 = _fixture12Trough as LabwareDefinition
|
|
14
14
|
|
|
15
15
|
describe('WellLabels', () => {
|
|
16
16
|
it('should render well labels outside of the labware', () => {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
+
ABSORBANCE_READER_V1,
|
|
2
3
|
fixture96Plate,
|
|
3
|
-
|
|
4
|
+
FLEX_STACKER_MODULE_V1,
|
|
5
|
+
getModuleDef,
|
|
4
6
|
HEATERSHAKER_MODULE_V1,
|
|
5
7
|
MAGNETIC_BLOCK_V1,
|
|
6
8
|
MAGNETIC_MODULE_V1,
|
|
@@ -16,7 +18,7 @@ import { RobotCoordinateSpace } from '../RobotCoordinateSpace'
|
|
|
16
18
|
import { Module as ModuleComponent } from './'
|
|
17
19
|
|
|
18
20
|
import type { Meta, Story } from '@storybook/react'
|
|
19
|
-
import type {
|
|
21
|
+
import type { LabwareDefinition, ModuleModel } from '@opentrons/shared-data'
|
|
20
22
|
|
|
21
23
|
const moduleModels: ModuleModel[] = [
|
|
22
24
|
TEMPERATURE_MODULE_V2,
|
|
@@ -27,8 +29,23 @@ const moduleModels: ModuleModel[] = [
|
|
|
27
29
|
MAGNETIC_MODULE_V2,
|
|
28
30
|
HEATERSHAKER_MODULE_V1,
|
|
29
31
|
MAGNETIC_BLOCK_V1,
|
|
32
|
+
ABSORBANCE_READER_V1,
|
|
33
|
+
FLEX_STACKER_MODULE_V1,
|
|
30
34
|
]
|
|
31
35
|
|
|
36
|
+
const moduleModelOptions = {
|
|
37
|
+
'Temperature Module V2': TEMPERATURE_MODULE_V2,
|
|
38
|
+
'Temperature Module V1': TEMPERATURE_MODULE_V1,
|
|
39
|
+
'Thermocycler Module V1': THERMOCYCLER_MODULE_V1,
|
|
40
|
+
'Thermocycler Module V2': THERMOCYCLER_MODULE_V2,
|
|
41
|
+
'Magnetic Module V1': MAGNETIC_MODULE_V1,
|
|
42
|
+
'Magnetic Module V2': MAGNETIC_MODULE_V2,
|
|
43
|
+
'Heater-Shaker Module V1': HEATERSHAKER_MODULE_V1,
|
|
44
|
+
'Magnetic Block V1': MAGNETIC_BLOCK_V1,
|
|
45
|
+
'Absorbance Reader V1': ABSORBANCE_READER_V1,
|
|
46
|
+
'Flex Stacker Module V1': FLEX_STACKER_MODULE_V1,
|
|
47
|
+
}
|
|
48
|
+
|
|
32
49
|
export default {
|
|
33
50
|
title: 'Library/Molecules/Simulation/Module',
|
|
34
51
|
} as Meta
|
|
@@ -39,53 +56,66 @@ const Template: Story<{
|
|
|
39
56
|
hasLabware: boolean
|
|
40
57
|
innerProps: {}
|
|
41
58
|
}> = args => {
|
|
59
|
+
// Add null check and default to first module model if undefined
|
|
60
|
+
const moduleModel = args.model || moduleModels[0]
|
|
61
|
+
|
|
42
62
|
return (
|
|
43
63
|
<RobotCoordinateSpace height="100vh" width="100vw" viewBox="0 -50 200 320">
|
|
44
64
|
<ModuleComponent
|
|
45
|
-
def={
|
|
65
|
+
def={getModuleDef(moduleModel)}
|
|
46
66
|
x={0}
|
|
47
67
|
y={0}
|
|
48
68
|
innerProps={args.innerProps}
|
|
49
69
|
orientation={args.orientation}
|
|
70
|
+
targetSlotId={null}
|
|
71
|
+
targetDeckId={null}
|
|
72
|
+
childrenPositioningMode="offsetToSlot"
|
|
50
73
|
>
|
|
51
74
|
{args.hasLabware ? (
|
|
52
|
-
<LabwareRender
|
|
75
|
+
<LabwareRender
|
|
76
|
+
definition={fixture96Plate as LabwareDefinition}
|
|
77
|
+
positioningMode="passThrough"
|
|
78
|
+
/>
|
|
53
79
|
) : null}
|
|
54
80
|
</ModuleComponent>
|
|
55
81
|
</RobotCoordinateSpace>
|
|
56
82
|
)
|
|
57
83
|
}
|
|
84
|
+
|
|
58
85
|
export const Module = Template.bind({})
|
|
86
|
+
Module.args = {
|
|
87
|
+
model: TEMPERATURE_MODULE_V2,
|
|
88
|
+
orientation: 'left',
|
|
89
|
+
hasLabware: false,
|
|
90
|
+
innerProps: {
|
|
91
|
+
lidMotorState: 'open',
|
|
92
|
+
blockTargetTemp: 90,
|
|
93
|
+
targetTemperature: 4,
|
|
94
|
+
targetTemp: 40,
|
|
95
|
+
},
|
|
96
|
+
}
|
|
97
|
+
|
|
59
98
|
Module.argTypes = {
|
|
60
99
|
model: {
|
|
61
100
|
control: {
|
|
62
101
|
type: 'select',
|
|
63
|
-
options: moduleModels,
|
|
64
102
|
},
|
|
65
|
-
|
|
103
|
+
options: moduleModelOptions,
|
|
66
104
|
},
|
|
67
105
|
orientation: {
|
|
68
106
|
control: {
|
|
69
107
|
type: 'select',
|
|
70
|
-
options: ['left', 'right'],
|
|
71
108
|
},
|
|
72
|
-
|
|
109
|
+
options: ['left', 'right'],
|
|
73
110
|
},
|
|
74
111
|
hasLabware: {
|
|
75
112
|
control: {
|
|
76
113
|
type: 'boolean',
|
|
77
114
|
},
|
|
78
|
-
defaultValue: false,
|
|
79
115
|
},
|
|
80
116
|
innerProps: {
|
|
81
117
|
control: {
|
|
82
118
|
type: 'object',
|
|
83
119
|
},
|
|
84
|
-
defaultValue: {
|
|
85
|
-
lidMotorState: 'open',
|
|
86
|
-
blockTargetTemp: 90,
|
|
87
|
-
targetTemperature: 4,
|
|
88
|
-
targetTemp: 40,
|
|
89
|
-
},
|
|
90
120
|
},
|
|
91
121
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getModuleDef, THERMOCYCLER_MODULE_V1 } from '@opentrons/shared-data'
|
|
2
2
|
|
|
3
3
|
import { BORDERS, COLORS } from '../../../helix-design-system'
|
|
4
4
|
import { C_MED_LIGHT_GRAY } from '../../../styles'
|
|
@@ -17,7 +17,7 @@ export interface ThermocyclerVizProps {
|
|
|
17
17
|
|
|
18
18
|
export function Thermocycler(props: ThermocyclerVizProps): JSX.Element {
|
|
19
19
|
const { lidMotorState, blockTargetTemp, model } = props
|
|
20
|
-
const def =
|
|
20
|
+
const def = getModuleDef(model)
|
|
21
21
|
if (lidMotorState === 'unknown') {
|
|
22
22
|
// just a rectangle if we don't know the state of the lid
|
|
23
23
|
return (
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
HEATERSHAKER_MODULE_TYPE,
|
|
6
6
|
MAGNETIC_BLOCK_TYPE,
|
|
7
7
|
MAGNETIC_MODULE_TYPE,
|
|
8
|
-
|
|
8
|
+
multiplyMatrices,
|
|
9
9
|
TEMPERATURE_MODULE_TYPE,
|
|
10
10
|
THERMOCYCLER_MODULE_TYPE,
|
|
11
11
|
} from '@opentrons/shared-data'
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
SPACING_1,
|
|
22
22
|
} from '../../styles'
|
|
23
23
|
import { RobotCoordsForeignObject } from '../Deck'
|
|
24
|
-
import { multiplyMatrices } from '../utils'
|
|
25
24
|
import { FlexStacker } from './FlexStacker'
|
|
26
25
|
import { HeaterShaker } from './HeaterShaker'
|
|
27
26
|
import { MagneticBlock } from './MagneticBlock'
|
|
@@ -35,6 +34,7 @@ import type {
|
|
|
35
34
|
ModuleDefinition,
|
|
36
35
|
ThermocyclerModuleModel,
|
|
37
36
|
} from '@opentrons/shared-data'
|
|
37
|
+
import type { FlexDirection } from '../Deck'
|
|
38
38
|
|
|
39
39
|
export * from './Thermocycler'
|
|
40
40
|
|
|
@@ -51,9 +51,34 @@ interface Props {
|
|
|
51
51
|
| ComponentProps<typeof Temperature>
|
|
52
52
|
| {}
|
|
53
53
|
statusInfo?: ReactNode // contents of small status rectangle, not displayed if absent
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
|
|
55
|
+
children?: ReactNode
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* How child components should be positioned.
|
|
59
|
+
*
|
|
60
|
+
* "offsetToSlot" - The SVG origin of a child will be at the labware mating interface of the
|
|
61
|
+
* module, which is the front-left (-x, -y) corner of the slot on top of the module.
|
|
62
|
+
*
|
|
63
|
+
* todo(mm, 2025-07-21):
|
|
64
|
+
* 1. Add a "passThrough" mode that disables the "offsetToSlot" behavior,
|
|
65
|
+
* to allow child components to replace it with their own SVG transform,
|
|
66
|
+
* to support labware schema 3.
|
|
67
|
+
* 2. Migrate all existing call sites to use "passThrough".
|
|
68
|
+
* 3. Remove "offsetToSlot".
|
|
69
|
+
*/
|
|
70
|
+
childrenPositioningMode: 'offsetToSlot'
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Used for applying slot-specific positioning adjustments.
|
|
74
|
+
* If you're rendering the module on a deck, supply this for correct positioning.
|
|
75
|
+
*/
|
|
76
|
+
targetSlotId: string | null
|
|
77
|
+
/**
|
|
78
|
+
* Used for applying slot-specific positioning adjustments.
|
|
79
|
+
* If you're rendering the module on a deck, supply this for correct positioning.
|
|
80
|
+
*/
|
|
81
|
+
targetDeckId: string | null
|
|
57
82
|
}
|
|
58
83
|
|
|
59
84
|
const statusInfoWrapperProps = {
|
|
@@ -61,7 +86,7 @@ const statusInfoWrapperProps = {
|
|
|
61
86
|
alignItems: ALIGN_CENTER,
|
|
62
87
|
}
|
|
63
88
|
const statusInfoFlexProps = {
|
|
64
|
-
flexDirection: DIRECTION_COLUMN,
|
|
89
|
+
flexDirection: DIRECTION_COLUMN as FlexDirection,
|
|
65
90
|
justifyContent: JUSTIFY_CENTER,
|
|
66
91
|
backgroundColor: C_MED_LIGHT_GRAY,
|
|
67
92
|
padding: SPACING_1,
|
|
@@ -80,8 +105,9 @@ export const Module = (props: Props): JSX.Element => {
|
|
|
80
105
|
statusInfo,
|
|
81
106
|
children,
|
|
82
107
|
targetSlotId,
|
|
83
|
-
targetDeckId
|
|
108
|
+
targetDeckId,
|
|
84
109
|
} = props
|
|
110
|
+
|
|
85
111
|
const moduleType = getModuleType(def.model)
|
|
86
112
|
|
|
87
113
|
const { x: labwareOffsetX, y: labwareOffsetY } = def.labwareOffset
|
|
@@ -110,19 +136,16 @@ export const Module = (props: Props): JSX.Element => {
|
|
|
110
136
|
let nestedLabwareOffsetY = labwareOffsetY
|
|
111
137
|
|
|
112
138
|
// additional transforms to apply to vectors in certain deck/slot combinations
|
|
113
|
-
const transformsForDeckBySlot =
|
|
139
|
+
const transformsForDeckBySlot =
|
|
140
|
+
(targetDeckId != null ? def?.slotTransforms?.[targetDeckId] : null) ?? {}
|
|
114
141
|
const slotTransformsForDeckSlot =
|
|
115
|
-
targetSlotId != null
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
? transformsForDeckBySlot[targetSlotId]
|
|
119
|
-
: null
|
|
120
|
-
const deckSpecificTransforms = slotTransformsForDeckSlot ?? {}
|
|
121
|
-
if (deckSpecificTransforms?.cornerOffsetFromSlot != null) {
|
|
142
|
+
(targetSlotId != null ? transformsForDeckBySlot[targetSlotId] : null) ?? {}
|
|
143
|
+
|
|
144
|
+
if (slotTransformsForDeckSlot.cornerOffsetFromSlot != null) {
|
|
122
145
|
const [
|
|
123
146
|
[slotTranslateX],
|
|
124
147
|
[slotTranslateY],
|
|
125
|
-
] = multiplyMatrices(
|
|
148
|
+
] = multiplyMatrices(slotTransformsForDeckSlot.cornerOffsetFromSlot, [
|
|
126
149
|
[translateX],
|
|
127
150
|
[translateY],
|
|
128
151
|
[translateZ],
|
|
@@ -130,11 +153,11 @@ export const Module = (props: Props): JSX.Element => {
|
|
|
130
153
|
])
|
|
131
154
|
offsetTransform = `translate(${slotTranslateX}, ${slotTranslateY})`
|
|
132
155
|
}
|
|
133
|
-
if (
|
|
156
|
+
if (slotTransformsForDeckSlot.labwareOffset != null) {
|
|
134
157
|
const [
|
|
135
158
|
[slotLabwareOffsetX],
|
|
136
159
|
[slotLabwareOffsetY],
|
|
137
|
-
] = multiplyMatrices(
|
|
160
|
+
] = multiplyMatrices(slotTransformsForDeckSlot.labwareOffset, [
|
|
138
161
|
[labwareOffsetX],
|
|
139
162
|
[labwareOffsetY],
|
|
140
163
|
[1],
|
|
@@ -7,7 +7,7 @@ import { LabwareRender } from '../Labware'
|
|
|
7
7
|
import { PipetteRender } from './'
|
|
8
8
|
|
|
9
9
|
import type { Meta, Story } from '@storybook/react'
|
|
10
|
-
import type {
|
|
10
|
+
import type { LabwareDefinition, PipetteName } from '@opentrons/shared-data'
|
|
11
11
|
|
|
12
12
|
const DECK_MAP_VIEWBOX = '0 -140 230 230'
|
|
13
13
|
|
|
@@ -18,7 +18,7 @@ const axygenReservoir90ml = getAllLabwareDefs().axygen1Reservoir90MlV1
|
|
|
18
18
|
const opentrons6TuberackNest50mlConical = getAllLabwareDefs()
|
|
19
19
|
.opentrons6TuberackNest50MlConicalV1
|
|
20
20
|
|
|
21
|
-
const labwareDefMap: Record<string,
|
|
21
|
+
const labwareDefMap: Record<string, LabwareDefinition> = {
|
|
22
22
|
[opentrons300UlTiprack.metadata.displayName]: opentrons300UlTiprack,
|
|
23
23
|
[opentrons10UlTiprack.metadata.displayName]: opentrons10UlTiprack,
|
|
24
24
|
[nest12Reservoir15ml.metadata.displayName]: nest12Reservoir15ml,
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
import { EightEmanatingNozzles } from './EightEmanatingNozzles'
|
|
14
14
|
import { EmanatingNozzle } from './EmanatingNozzle'
|
|
15
15
|
|
|
16
|
-
import type {
|
|
16
|
+
import type { LabwareDefinition, PipetteName } from '@opentrons/shared-data'
|
|
17
17
|
|
|
18
18
|
interface PipetteRenderProps {
|
|
19
|
-
labwareDef:
|
|
19
|
+
labwareDef: LabwareDefinition
|
|
20
20
|
pipetteName: PipetteName
|
|
21
21
|
usingMetalProbe?: boolean
|
|
22
22
|
}
|
|
@@ -63,11 +63,9 @@ export const PipetteRender = (props: PipetteRenderProps): JSX.Element => {
|
|
|
63
63
|
y={y}
|
|
64
64
|
outerProps={{ style: { overflow: 'visible' } }}
|
|
65
65
|
innerDivProps={{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
overflow: 'visible',
|
|
70
|
-
},
|
|
66
|
+
width: '100%',
|
|
67
|
+
height: '100%',
|
|
68
|
+
overflow: 'visible',
|
|
71
69
|
}}
|
|
72
70
|
>
|
|
73
71
|
<svg overflow="visible">
|
|
@@ -16,13 +16,13 @@ import { EmanatingNozzle } from '../EmanatingNozzle'
|
|
|
16
16
|
import { PipetteRender } from '../PipetteRender'
|
|
17
17
|
|
|
18
18
|
import type { ComponentProps } from 'react'
|
|
19
|
-
import type {
|
|
19
|
+
import type { LabwareDefinition } from '@opentrons/shared-data'
|
|
20
20
|
|
|
21
21
|
vi.mock('../../Deck/RobotCoordsForeignDiv')
|
|
22
22
|
vi.mock('../EmanatingNozzle')
|
|
23
23
|
vi.mock('../EightEmanatingNozzles')
|
|
24
24
|
|
|
25
|
-
const fixtureTiprack300Ul = _fixtureTiprack300ul as
|
|
25
|
+
const fixtureTiprack300Ul = _fixtureTiprack300ul as LabwareDefinition
|
|
26
26
|
|
|
27
27
|
const render = (props: ComponentProps<typeof PipetteRender>) => {
|
|
28
28
|
return renderWithProviders(<PipetteRender {...props} />)[0]
|