@opentrons/components 0.1.6-alpha.2 → 0.1.6-alpha.20
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/Makefile +5 -1
- package/package.json +6 -7
- package/src/__mocks__/file.js +10 -0
- package/src/alerts/AlertItem.stories.tsx +49 -0
- package/src/alerts/AlertItem.tsx +85 -0
- package/src/alerts/index.ts +3 -0
- package/src/atoms/Checkbox/Checkbox.stories.tsx +24 -0
- package/src/atoms/Checkbox/index.tsx +127 -0
- package/src/atoms/CheckboxField/CheckboxField.stories.tsx +30 -0
- package/src/atoms/CheckboxField/index.tsx +171 -0
- package/src/atoms/Chip/Chip.stories.tsx +59 -0
- package/src/atoms/Chip/index.tsx +172 -0
- package/src/atoms/Divider/index.tsx +15 -0
- package/src/atoms/InputField/InputField.stories.tsx +77 -0
- package/src/atoms/InputField/index.tsx +383 -0
- package/src/atoms/ListButton/ListButton.stories.tsx +133 -0
- package/src/atoms/ListButton/ListButtonChildren/ListButtonAccordion.tsx +65 -0
- package/src/atoms/ListButton/ListButtonChildren/ListButtonAccordionContainer.tsx +23 -0
- package/src/atoms/ListButton/ListButtonChildren/ListButtonRadioButton.tsx +108 -0
- package/src/atoms/ListButton/ListButtonChildren/index.ts +3 -0
- package/src/atoms/ListButton/index.tsx +72 -0
- package/src/atoms/ListItem/ListItem.stories.tsx +96 -0
- package/src/atoms/ListItem/ListItemChildren/ListItemCustomize.tsx +78 -0
- package/src/atoms/ListItem/ListItemChildren/ListItemDescriptor.tsx +42 -0
- package/src/atoms/ListItem/ListItemChildren/index.ts +2 -0
- package/src/atoms/ListItem/index.tsx +89 -0
- package/src/atoms/MenuList/MenuItem.stories.tsx +20 -0
- package/src/atoms/MenuList/MenuItem.tsx +55 -0
- package/src/atoms/MenuList/MenuList.stories.tsx +31 -0
- package/src/atoms/MenuList/OverflowBtn.stories.tsx +17 -0
- package/src/atoms/MenuList/OverflowBtn.tsx +76 -0
- package/src/atoms/MenuList/index.tsx +50 -0
- package/src/atoms/Snackbar/Snackbar.stories.tsx +67 -0
- package/src/atoms/Snackbar/index.tsx +91 -0
- package/src/atoms/StepMeter/index.tsx +53 -0
- package/src/atoms/StyledText/LegacyStyledText.stories.tsx +106 -0
- package/src/atoms/StyledText/LegacyStyledText.tsx +95 -0
- package/src/atoms/StyledText/StyledText.stories.tsx +46 -0
- package/src/atoms/StyledText/StyledText.tsx +323 -0
- package/src/atoms/StyledText/index.ts +2 -0
- package/src/atoms/Tag/Tag.stories.tsx +48 -0
- package/src/atoms/Tag/index.tsx +116 -0
- package/src/atoms/Toast/ODDToast.stories.tsx +68 -0
- package/src/atoms/Toast/Toast.stories.tsx +55 -0
- package/src/atoms/Toast/index.tsx +439 -0
- package/src/atoms/ToggleGroup/ToggleGroup.stories.tsx +39 -0
- package/src/atoms/ToggleGroup/index.tsx +91 -0
- package/src/atoms/Tooltip/Tooltip.stories.tsx +99 -0
- package/src/atoms/Tooltip/index.tsx +38 -0
- package/src/atoms/buttons/AlertPrimaryButton.tsx +26 -0
- package/src/atoms/buttons/AltPrimaryButton.tsx +31 -0
- package/src/atoms/buttons/EmptySelectorButton.stories.tsx +36 -0
- package/src/atoms/buttons/EmptySelectorButton.tsx +83 -0
- package/src/atoms/buttons/LargeButton.stories.tsx +99 -0
- package/src/atoms/buttons/LargeButton.tsx +320 -0
- package/src/atoms/buttons/PrimaryButton.tsx +36 -0
- package/src/atoms/buttons/RadioButton.stories.tsx +35 -0
- package/src/atoms/buttons/RadioButton.tsx +217 -0
- package/src/atoms/buttons/SecondaryButton.tsx +62 -0
- package/src/atoms/buttons/buttons.stories.tsx +78 -0
- package/src/atoms/buttons/index.ts +6 -0
- package/src/atoms/index.ts +20 -0
- package/src/barrel.ts +10 -0
- package/src/buttons/Button.tsx +96 -0
- package/src/buttons/DeprecatedPrimaryButton.tsx +24 -0
- package/src/buttons/FlatButton.tsx +21 -0
- package/src/buttons/IconButton.tsx +37 -0
- package/src/buttons/OutlineButton.tsx +24 -0
- package/src/buttons/index.ts +7 -0
- package/src/controls/ControlInfo.tsx +13 -0
- package/src/controls/LabeledButton.tsx +28 -0
- package/src/controls/LabeledCheckbox.tsx +35 -0
- package/src/controls/LabeledControl.tsx +24 -0
- package/src/controls/LabeledRadioGroup.tsx +27 -0
- package/src/controls/LabeledSelect.tsx +34 -0
- package/src/controls/LabeledToggle.tsx +35 -0
- package/src/controls/StackedLabeledControl.tsx +28 -0
- package/src/controls/ToggleButton.tsx +25 -0
- package/src/controls/index.ts +10 -0
- package/src/forms/DeprecatedCheckboxField.stories.tsx +31 -0
- package/src/forms/DeprecatedCheckboxField.tsx +94 -0
- package/src/forms/DropdownField.stories.tsx +44 -0
- package/src/forms/DropdownField.tsx +106 -0
- package/src/forms/FormGroup.stories.tsx +31 -0
- package/src/forms/FormGroup.tsx +53 -0
- package/src/forms/InputField.stories.tsx +41 -0
- package/src/forms/LegacyInputField.tsx +123 -0
- package/src/forms/RadioGroup.stories.tsx +44 -0
- package/src/forms/RadioGroup.tsx +87 -0
- package/src/forms/Select.stories.tsx +117 -0
- package/src/forms/Select.tsx +132 -0
- package/src/forms/SelectField.tsx +94 -0
- package/src/forms/ToggleField.stories.tsx +31 -0
- package/src/forms/ToggleField.tsx +59 -0
- package/src/forms/index.ts +8 -0
- package/src/hardware-sim/BaseDeck/BaseDeck.stories.tsx +94 -0
- package/src/hardware-sim/BaseDeck/BaseDeck.tsx +423 -0
- package/src/hardware-sim/BaseDeck/SingleSlotFixture.tsx +199 -0
- package/src/hardware-sim/BaseDeck/SlotBase.tsx +5 -0
- package/src/hardware-sim/BaseDeck/SlotClip.tsx +15 -0
- package/src/hardware-sim/BaseDeck/StagingAreaFixture.tsx +114 -0
- package/src/hardware-sim/BaseDeck/WasteChuteFixture.tsx +114 -0
- package/src/hardware-sim/BaseDeck/WasteChuteStagingAreaFixture.tsx +68 -0
- package/src/hardware-sim/BaseDeck/__fixtures__/index.ts +165 -0
- package/src/hardware-sim/BaseDeck/index.ts +5 -0
- package/src/hardware-sim/BaseDeck/something.test.tsx +7 -0
- package/src/hardware-sim/Deck/DeckFromLayers.tsx +58 -0
- package/src/hardware-sim/Deck/FlexTrash.tsx +128 -0
- package/src/hardware-sim/Deck/MoveLabwareOnDeck.stories.tsx +97 -0
- package/src/hardware-sim/Deck/MoveLabwareOnDeck.tsx +251 -0
- package/src/hardware-sim/Deck/OT2Layers.tsx +153 -0
- package/src/hardware-sim/Deck/RobotCoordsForeignDiv.tsx +46 -0
- package/src/hardware-sim/Deck/RobotCoordsForeignObject.tsx +42 -0
- package/src/hardware-sim/Deck/RobotCoordsText.tsx +32 -0
- package/src/hardware-sim/Deck/RobotWorkSpace.tsx +90 -0
- package/src/hardware-sim/Deck/SlotLabels.tsx +111 -0
- package/src/hardware-sim/Deck/__mocks__/getDeckDefinitions.ts +29 -0
- package/src/hardware-sim/Deck/constants.ts +12 -0
- package/src/hardware-sim/Deck/index.tsx +8 -0
- package/src/hardware-sim/DeckConfigurator/AbsorbanceReaderFixture.tsx +91 -0
- package/src/hardware-sim/DeckConfigurator/DeckConfigurator.stories.tsx +110 -0
- package/src/hardware-sim/DeckConfigurator/EmptyConfigFixture.tsx +131 -0
- package/src/hardware-sim/DeckConfigurator/HeaterShakerFixture.tsx +102 -0
- package/src/hardware-sim/DeckConfigurator/MagneticBlockFixture.tsx +130 -0
- package/src/hardware-sim/DeckConfigurator/StagingAreaConfigFixture.tsx +89 -0
- package/src/hardware-sim/DeckConfigurator/StaticFixture.tsx +54 -0
- package/src/hardware-sim/DeckConfigurator/TemperatureModuleFixture.tsx +103 -0
- package/src/hardware-sim/DeckConfigurator/ThermocyclerFixture.tsx +89 -0
- package/src/hardware-sim/DeckConfigurator/TrashBinConfigFixture.tsx +99 -0
- package/src/hardware-sim/DeckConfigurator/WasteChuteConfigFixture.tsx +96 -0
- package/src/hardware-sim/DeckConfigurator/constants.ts +81 -0
- package/src/hardware-sim/DeckConfigurator/index.tsx +285 -0
- package/src/hardware-sim/DeckSlotLocation/index.tsx +88 -0
- package/src/hardware-sim/Labware/Labware.tsx +173 -0
- package/src/hardware-sim/Labware/LabwareAdapter/Opentrons96DeepWellAdapter.tsx +23 -0
- package/src/hardware-sim/Labware/LabwareAdapter/Opentrons96FlatBottomAdapter.tsx +7 -0
- package/src/hardware-sim/Labware/LabwareAdapter/OpentronsAluminumFlatBottomPlate.tsx +13 -0
- package/src/hardware-sim/Labware/LabwareAdapter/OpentronsAutoclavableDeckRiser.tsx +100 -0
- package/src/hardware-sim/Labware/LabwareAdapter/OpentronsFlex96TiprackAdapter.tsx +13 -0
- package/src/hardware-sim/Labware/LabwareAdapter/OpentronsToughPCRAutoSealingLid.tsx +83 -0
- package/src/hardware-sim/Labware/LabwareAdapter/OpentronsUniversalFlatAdapter.tsx +13 -0
- package/src/hardware-sim/Labware/LabwareAdapter/index.tsx +73 -0
- package/src/hardware-sim/Labware/LabwareRender.stories.tsx +96 -0
- package/src/hardware-sim/Labware/LabwareRender.tsx +173 -0
- package/src/hardware-sim/Labware/LabwareStackRender.tsx +272 -0
- package/src/hardware-sim/Labware/index.ts +6 -0
- package/src/hardware-sim/Labware/labwareInternals/FilledWells.tsx +39 -0
- package/src/hardware-sim/Labware/labwareInternals/LabwareOutline.tsx +133 -0
- package/src/hardware-sim/Labware/labwareInternals/LabwareWellLabels.tsx +118 -0
- package/src/hardware-sim/Labware/labwareInternals/StaticLabware.tsx +121 -0
- package/src/hardware-sim/Labware/labwareInternals/StrokedWells.tsx +38 -0
- package/src/hardware-sim/Labware/labwareInternals/StyledWells.tsx +77 -0
- package/src/hardware-sim/Labware/labwareInternals/Well.tsx +74 -0
- package/src/hardware-sim/Labware/labwareInternals/WellLabels.tsx +121 -0
- package/src/hardware-sim/Labware/labwareInternals/index.ts +8 -0
- package/src/hardware-sim/Labware/labwareInternals/types.ts +18 -0
- package/src/hardware-sim/Module/HeaterShaker.tsx +83 -0
- package/src/hardware-sim/Module/MagneticBlock.tsx +49 -0
- package/src/hardware-sim/Module/MagneticModule.tsx +51 -0
- package/src/hardware-sim/Module/Module.stories.tsx +90 -0
- package/src/hardware-sim/Module/ModuleTag.tsx +38 -0
- package/src/hardware-sim/Module/PlateReader.tsx +208 -0
- package/src/hardware-sim/Module/Temperature.tsx +54 -0
- package/src/hardware-sim/Module/Thermocycler/ThermocyclerGEN1.tsx +248 -0
- package/src/hardware-sim/Module/Thermocycler/ThermocyclerGEN2.tsx +286 -0
- package/src/hardware-sim/Module/Thermocycler/index.tsx +49 -0
- package/src/hardware-sim/Module/index.tsx +227 -0
- package/src/hardware-sim/Pipette/EightEmanatingNozzles.tsx +23 -0
- package/src/hardware-sim/Pipette/EmanatingNozzle.tsx +52 -0
- package/src/hardware-sim/Pipette/PipetteRender.stories.tsx +71 -0
- package/src/hardware-sim/Pipette/PipetteRender.tsx +92 -0
- package/src/hardware-sim/Pipette/constants.ts +10 -0
- package/src/hardware-sim/Pipette/index.ts +1 -0
- package/src/hardware-sim/ProtocolDeck/LabwareInfo.tsx +68 -0
- package/src/hardware-sim/ProtocolDeck/ProtocolDeck.stories.tsx +25 -0
- package/src/hardware-sim/ProtocolDeck/__fixtures__/analysis_QIAseqFX24xv4_8.json +47145 -0
- package/src/hardware-sim/ProtocolDeck/index.tsx +174 -0
- package/src/hardware-sim/ProtocolDeck/types.ts +6 -0
- package/src/hardware-sim/ProtocolDeck/utils/getInitiallyLoadedLabwareByAdapter.ts +33 -0
- package/src/hardware-sim/ProtocolDeck/utils/getLabwareInSlots.ts +155 -0
- package/src/hardware-sim/ProtocolDeck/utils/getLabwareInfoByLiquidId.ts +42 -0
- package/src/hardware-sim/ProtocolDeck/utils/getModulesInSlots.ts +129 -0
- package/src/hardware-sim/ProtocolDeck/utils/getStandardDeckViewLayerBlockList.ts +29 -0
- package/src/hardware-sim/ProtocolDeck/utils/getWellFillFromLabwareId.ts +30 -0
- package/src/hardware-sim/ProtocolDeck/utils/index.ts +3 -0
- package/src/hardware-sim/RobotCoordinateSpace/RobotCoordinateSpace.tsx +28 -0
- package/src/hardware-sim/RobotCoordinateSpace/RobotCoordinateSpaceWithRef.tsx +52 -0
- package/src/hardware-sim/RobotCoordinateSpace/index.ts +2 -0
- package/src/hardware-sim/index.ts +11 -0
- package/src/hardware-sim/utils.ts +18 -0
- package/src/helix-design-system/borders.ts +32 -0
- package/src/helix-design-system/colors.ts +100 -0
- package/src/helix-design-system/index.ts +4 -0
- package/src/helix-design-system/product/index.ts +1 -0
- package/src/helix-design-system/product/typography.ts +151 -0
- package/src/helix-design-system/style.ts +2 -0
- package/src/hooks/index.ts +15 -0
- package/src/hooks/useConditionalConfirm.ts +70 -0
- package/src/hooks/useDrag.ts +90 -0
- package/src/hooks/useIdle.ts +68 -0
- package/src/hooks/useInterval.ts +38 -0
- package/src/hooks/useLongPress.ts +83 -0
- package/src/hooks/useMenuHandleClickOutside.tsx +46 -0
- package/src/hooks/useMountEffect.ts +12 -0
- package/src/hooks/usePrevious.ts +19 -0
- package/src/hooks/useScrolling.ts +33 -0
- package/src/hooks/useSelectDeckLocation/SelectDeckLocation.stories.tsx +55 -0
- package/src/hooks/useSelectDeckLocation/index.tsx +331 -0
- package/src/hooks/useSwipe.ts +86 -0
- package/src/hooks/useTimeout.ts +33 -0
- package/src/hooks/useToggle.ts +27 -0
- package/src/icons/Icon.stories.tsx +37 -0
- package/src/icons/Icon.tsx +79 -0
- package/src/icons/IconList.stories.tsx +108 -0
- package/src/icons/ModuleIcon.tsx +48 -0
- package/src/icons/NotificationIcon.tsx +41 -0
- package/src/icons/icon-data.ts +821 -0
- package/src/icons/index.ts +6 -0
- package/src/images/index.ts +1 -0
- package/src/images/labware/index.ts +1 -0
- package/src/images/labware/measurement-guide/images/depth/depth-plate-flat@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/depth/depth-plate-round@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/depth/depth-plate-v@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/depth/depth-reservoir-and-tubes-flat@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/depth/depth-reservoir-and-tubes-round@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/depth/depth-reservoir-and-tubes-v@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/depth/length-tip-rack@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/dimensions/footprint@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/dimensions/height-alum-block-plate@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/dimensions/height-alum-block-tubes@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/dimensions/height-plate-and-reservoir@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/dimensions/height-tip-rack@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/dimensions/height-tube-rack-irregular@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/dimensions/height-tube-rack@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/offset/offset-reservoir@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/offset/offset-well-circular@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/offset/offset-well-rectangular@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/shape/shape-circular@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/shape/shape-rectangular@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/spacing/spacing-reservoir-multi-row@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/spacing/spacing-reservoir@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/spacing/spacing-well-circular@3x.png +0 -0
- package/src/images/labware/measurement-guide/images/spacing/spacing-well-rectangular@3x.png +0 -0
- package/src/images/labware/measurement-guide/index.ts +272 -0
- package/src/index.ts +2 -0
- package/src/instrument/InstrumentDiagram.stories.tsx +42 -0
- package/src/instrument/InstrumentDiagram.tsx +58 -0
- package/src/instrument/InstrumentGroup.stories.tsx +88 -0
- package/src/instrument/InstrumentGroup.tsx +35 -0
- package/src/instrument/InstrumentInfo.tsx +107 -0
- package/src/instrument/PipetteSelect.stories.tsx +40 -0
- package/src/instrument/PipetteSelect.tsx +170 -0
- package/src/instrument/eight-channel-flex.png +0 -0
- package/src/instrument/index.ts +4 -0
- package/src/instrument/multi-channel_GEN1_800px.png +0 -0
- package/src/instrument/multi-channel_GEN2_800px.png +0 -0
- package/src/instrument/ninety-six-channel-gen1.png +0 -0
- package/src/instrument/pipetteGEN2Multi.png +0 -0
- package/src/instrument/pipetteGEN2Single.png +0 -0
- package/src/instrument/pipetteMulti.png +0 -0
- package/src/instrument/pipetteSingle.png +0 -0
- package/src/instrument/single-channel-flex.png +0 -0
- package/src/instrument/single-channel_GEN2_800px.png +0 -0
- package/src/instrument/single_channel_GEN1_800px.png +0 -0
- package/src/interaction-enhancers/ClickOutside.ts +57 -0
- package/src/interaction-enhancers/HandleKeypress.tsx +69 -0
- package/src/interaction-enhancers/index.ts +4 -0
- package/src/interaction-enhancers/useHover.ts +84 -0
- package/src/interaction-enhancers/useOnClickOutside.ts +42 -0
- package/src/legacy-hardware-sim/LabwareNameOverlay.tsx +22 -0
- package/src/legacy-hardware-sim/ModuleItem.tsx +145 -0
- package/src/legacy-hardware-sim/index.ts +2 -0
- package/src/lists/SidePanelGroup.tsx +48 -0
- package/src/lists/TitledList.tsx +155 -0
- package/src/lists/index.ts +3 -0
- package/src/modals/AlertModal.tsx +89 -0
- package/src/modals/ContinueModal.tsx +32 -0
- package/src/modals/LegacyModal.tsx +59 -0
- package/src/modals/Modal.stories.tsx +52 -0
- package/src/modals/Modal.tsx +96 -0
- package/src/modals/ModalHeader.tsx +100 -0
- package/src/modals/ModalShell.tsx +155 -0
- package/src/modals/Overlay.tsx +38 -0
- package/src/modals/SpinnerModal.tsx +35 -0
- package/src/modals/SpinnerModalPage.tsx +30 -0
- package/src/modals/index.ts +10 -0
- package/src/molecules/Banner/Banner.stories.tsx +41 -0
- package/src/molecules/Banner/index.tsx +147 -0
- package/src/molecules/DeckInfoLabel/DeckInfoLabel.stories.tsx +65 -0
- package/src/molecules/DeckInfoLabel/index.tsx +95 -0
- package/src/molecules/DeckLabel/DeckLabel.stories.tsx +31 -0
- package/src/molecules/DeckLabel/index.tsx +80 -0
- package/src/molecules/DropdownMenu/DropdownMenu.stories.tsx +30 -0
- package/src/molecules/DropdownMenu/index.tsx +343 -0
- package/src/molecules/InfoScreen/InfoScreen.stories.tsx +50 -0
- package/src/molecules/InfoScreen/index.tsx +54 -0
- package/src/molecules/LiquidIcon/LiquidIcon.stories.tsx +53 -0
- package/src/molecules/LiquidIcon/index.tsx +68 -0
- package/src/molecules/ParametersTable/ParametersTable.stories.tsx +172 -0
- package/src/molecules/ParametersTable/index.tsx +198 -0
- package/src/molecules/Tabs/Tabs.stories.tsx +74 -0
- package/src/molecules/Tabs/index.tsx +94 -0
- package/src/molecules/index.ts +8 -0
- package/src/nav/SidePanel.stories.tsx +29 -0
- package/src/nav/SidePanel.tsx +21 -0
- package/src/nav/index.ts +2 -0
- package/src/organisms/DeckLabelSet/DeckLabelSet.stories.tsx +46 -0
- package/src/organisms/DeckLabelSet/index.tsx +69 -0
- package/src/organisms/EndUserAgreementFooter/index.tsx +49 -0
- package/src/organisms/Toolbox/Toolbox.stories.tsx +23 -0
- package/src/organisms/Toolbox/index.tsx +160 -0
- package/src/organisms/index.ts +3 -0
- package/src/primitives/Box.stories.tsx +25 -0
- package/src/primitives/Box.tsx +17 -0
- package/src/primitives/Btn.stories.tsx +105 -0
- package/src/primitives/Btn.tsx +266 -0
- package/src/primitives/Flex.stories.tsx +50 -0
- package/src/primitives/Flex.tsx +17 -0
- package/src/primitives/ForeignObject.tsx +70 -0
- package/src/primitives/Link.stories.tsx +27 -0
- package/src/primitives/Link.tsx +32 -0
- package/src/primitives/README.md +188 -0
- package/src/primitives/Svg.stories.tsx +36 -0
- package/src/primitives/Svg.tsx +68 -0
- package/src/primitives/Text.stories.tsx +17 -0
- package/src/primitives/Text.tsx +18 -0
- package/src/primitives/index.ts +10 -0
- package/src/primitives/style-props.ts +197 -0
- package/src/primitives/types.ts +120 -0
- package/src/robot-types.ts +4 -0
- package/src/slotmap/OT2SlotMap.tsx +73 -0
- package/src/slotmap/index.ts +1 -0
- package/src/structure/Card.stories.tsx +28 -0
- package/src/structure/Card.tsx +64 -0
- package/src/structure/LabeledValue.stories.tsx +17 -0
- package/src/structure/LabeledValue.tsx +31 -0
- package/src/structure/Pill.tsx +43 -0
- package/src/structure/Splash.stories.tsx +24 -0
- package/src/structure/Splash.tsx +22 -0
- package/src/structure/TitleBar.stories.tsx +42 -0
- package/src/structure/TitleBar.tsx +81 -0
- package/src/structure/index.ts +7 -0
- package/src/styles/borders.ts +16 -0
- package/src/styles/colors.ts +58 -0
- package/src/styles/cursor.ts +12 -0
- package/src/styles/flexbox.ts +39 -0
- package/src/styles/index.ts +8 -0
- package/src/styles/layout.ts +31 -0
- package/src/styles/position.ts +5 -0
- package/src/styles/spacing.ts +11 -0
- package/src/styles/typography.ts +90 -0
- package/src/testing/utils/index.ts +2 -0
- package/src/testing/utils/matchers.ts +31 -0
- package/src/testing/utils/renderWithProviders.tsx +53 -0
- package/src/tooltips/DeprecatedTooltip.tsx +105 -0
- package/src/tooltips/HoverTooltip.tsx +83 -0
- package/src/tooltips/LegacyTooltip.stories.tsx +98 -0
- package/src/tooltips/LegacyTooltip.tsx +151 -0
- package/src/tooltips/constants.ts +28 -0
- package/src/tooltips/index.ts +10 -0
- package/src/tooltips/styles.ts +20 -0
- package/src/tooltips/types.ts +73 -0
- package/src/tooltips/useHoverTooltip.ts +47 -0
- package/src/tooltips/usePopper.ts +87 -0
- package/src/tooltips/useTooltip.ts +100 -0
- package/src/ui-style-constants/index.ts +4 -0
- package/src/ui-style-constants/responsiveness.ts +15 -0
- package/src/ui-style-constants/spacing.ts +18 -0
- package/src/ui-style-constants/typography.ts +258 -0
- package/src/ui-style-constants/viewport.ts +18 -0
- package/src/utils.ts +56 -0
- package/{vite.config.ts → vite.config.mts} +2 -0
- package/lib/index.mjs +0 -19869
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
import { Fragment } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
getDeckDefFromRobotType,
|
|
4
|
+
getModuleDef2,
|
|
5
|
+
getPositionFromSlotId,
|
|
6
|
+
inferModuleOrientationFromXCoordinate,
|
|
7
|
+
OT2_ROBOT_TYPE,
|
|
8
|
+
MOVABLE_TRASH_CUTOUTS,
|
|
9
|
+
SINGLE_SLOT_FIXTURES,
|
|
10
|
+
STAGING_AREA_CUTOUTS,
|
|
11
|
+
STAGING_AREA_RIGHT_SLOT_FIXTURE,
|
|
12
|
+
TRASH_BIN_ADAPTER_FIXTURE,
|
|
13
|
+
WASTE_CHUTE_CUTOUT,
|
|
14
|
+
WASTE_CHUTE_ONLY_FIXTURES,
|
|
15
|
+
WASTE_CHUTE_STAGING_AREA_FIXTURES,
|
|
16
|
+
HEATERSHAKER_MODULE_V1,
|
|
17
|
+
MODULE_FIXTURES_BY_MODEL,
|
|
18
|
+
STAGING_AREA_SLOT_WITH_MAGNETIC_BLOCK_V1_FIXTURE,
|
|
19
|
+
} from '@opentrons/shared-data'
|
|
20
|
+
|
|
21
|
+
import { DeckInfoLabel } from '../../molecules/DeckInfoLabel'
|
|
22
|
+
import { RobotCoordinateSpace } from '../RobotCoordinateSpace'
|
|
23
|
+
import { Module } from '../Module'
|
|
24
|
+
import { LabwareRender } from '../Labware'
|
|
25
|
+
import { FlexTrash } from '../Deck/FlexTrash'
|
|
26
|
+
import { DeckFromLayers } from '../Deck/DeckFromLayers'
|
|
27
|
+
import { RobotCoordsForeignObject } from '../Deck/RobotCoordsForeignObject'
|
|
28
|
+
import { SlotLabels } from '../Deck'
|
|
29
|
+
import { COLORS } from '../../helix-design-system'
|
|
30
|
+
|
|
31
|
+
import { SingleSlotFixture } from './SingleSlotFixture'
|
|
32
|
+
import { StagingAreaFixture } from './StagingAreaFixture'
|
|
33
|
+
import { WasteChuteFixture } from './WasteChuteFixture'
|
|
34
|
+
import { WasteChuteStagingAreaFixture } from './WasteChuteStagingAreaFixture'
|
|
35
|
+
|
|
36
|
+
import type { ComponentProps, ReactNode } from 'react'
|
|
37
|
+
import type { Svg } from '../../primitives'
|
|
38
|
+
import type {
|
|
39
|
+
CutoutFixtureId,
|
|
40
|
+
DeckConfiguration,
|
|
41
|
+
LabwareDefinition2,
|
|
42
|
+
LabwareLocation,
|
|
43
|
+
ModuleLocation,
|
|
44
|
+
ModuleModel,
|
|
45
|
+
RobotType,
|
|
46
|
+
} from '@opentrons/shared-data'
|
|
47
|
+
import type { TrashCutoutId } from '../Deck/FlexTrash'
|
|
48
|
+
import type { StagingAreaLocation } from './StagingAreaFixture'
|
|
49
|
+
import type { WellFill, WellGroup } from '../Labware'
|
|
50
|
+
|
|
51
|
+
export interface LabwareOnDeck {
|
|
52
|
+
labwareLocation: LabwareLocation
|
|
53
|
+
definition: LabwareDefinition2
|
|
54
|
+
wellFill?: WellFill
|
|
55
|
+
missingTips?: WellGroup
|
|
56
|
+
/** generic prop to render self-positioned children for each labware */
|
|
57
|
+
labwareChildren?: ReactNode
|
|
58
|
+
onLabwareClick?: () => void
|
|
59
|
+
highlight?: boolean
|
|
60
|
+
highlightShadow?: boolean
|
|
61
|
+
stacked?: boolean
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface ModuleOnDeck {
|
|
65
|
+
moduleModel: ModuleModel
|
|
66
|
+
moduleLocation: ModuleLocation
|
|
67
|
+
nestedLabwareDef?: LabwareDefinition2 | null
|
|
68
|
+
nestedLabwareWellFill?: WellFill
|
|
69
|
+
innerProps?: ComponentProps<typeof Module>['innerProps']
|
|
70
|
+
/** generic prop to render self-positioned children for each module */
|
|
71
|
+
moduleChildren?: ReactNode
|
|
72
|
+
onLabwareClick?: () => void
|
|
73
|
+
highlightLabware?: boolean
|
|
74
|
+
highlightShadowLabware?: boolean
|
|
75
|
+
stacked?: boolean
|
|
76
|
+
}
|
|
77
|
+
interface BaseDeckProps {
|
|
78
|
+
deckConfig: DeckConfiguration
|
|
79
|
+
robotType: RobotType
|
|
80
|
+
labwareOnDeck?: LabwareOnDeck[]
|
|
81
|
+
modulesOnDeck?: ModuleOnDeck[]
|
|
82
|
+
deckLayerBlocklist?: string[]
|
|
83
|
+
showExpansion?: boolean
|
|
84
|
+
lightFill?: string
|
|
85
|
+
mediumFill?: string
|
|
86
|
+
darkFill?: string
|
|
87
|
+
children?: ReactNode
|
|
88
|
+
showSlotLabels?: boolean
|
|
89
|
+
/** whether to make wrapping svg tag animatable via @react-spring/web, defaults to false */
|
|
90
|
+
animatedSVG?: boolean
|
|
91
|
+
/** extra props to pass to svg tag */
|
|
92
|
+
svgProps?: ComponentProps<typeof Svg>
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const LABWARE_OFFSET_DISPLAY_THRESHOLD = 2
|
|
96
|
+
|
|
97
|
+
export function BaseDeck(props: BaseDeckProps): JSX.Element {
|
|
98
|
+
const {
|
|
99
|
+
robotType,
|
|
100
|
+
modulesOnDeck = [],
|
|
101
|
+
labwareOnDeck = [],
|
|
102
|
+
lightFill = COLORS.grey30,
|
|
103
|
+
mediumFill = COLORS.grey50,
|
|
104
|
+
darkFill = COLORS.grey60,
|
|
105
|
+
deckLayerBlocklist = [],
|
|
106
|
+
deckConfig,
|
|
107
|
+
showExpansion = true,
|
|
108
|
+
children,
|
|
109
|
+
showSlotLabels = true,
|
|
110
|
+
animatedSVG = false,
|
|
111
|
+
svgProps = {},
|
|
112
|
+
} = props
|
|
113
|
+
const deckDef = getDeckDefFromRobotType(robotType)
|
|
114
|
+
|
|
115
|
+
const singleSlotFixtures = deckConfig.filter(
|
|
116
|
+
fixture =>
|
|
117
|
+
fixture.cutoutFixtureId != null &&
|
|
118
|
+
(SINGLE_SLOT_FIXTURES.includes(fixture.cutoutFixtureId) ||
|
|
119
|
+
// If module fixture is loaded, still visualize singleSlotFixture underneath for consistency
|
|
120
|
+
Object.entries(MODULE_FIXTURES_BY_MODEL)
|
|
121
|
+
.reduce<CutoutFixtureId[]>(
|
|
122
|
+
(acc, [_model, fixtures]) => [...acc, ...fixtures],
|
|
123
|
+
[]
|
|
124
|
+
)
|
|
125
|
+
.includes(fixture.cutoutFixtureId))
|
|
126
|
+
)
|
|
127
|
+
const stagingAreaFixtures = deckConfig.filter(
|
|
128
|
+
fixture =>
|
|
129
|
+
(fixture.cutoutFixtureId === STAGING_AREA_RIGHT_SLOT_FIXTURE ||
|
|
130
|
+
fixture.cutoutFixtureId ===
|
|
131
|
+
STAGING_AREA_SLOT_WITH_MAGNETIC_BLOCK_V1_FIXTURE) &&
|
|
132
|
+
STAGING_AREA_CUTOUTS.includes(fixture.cutoutId)
|
|
133
|
+
)
|
|
134
|
+
const trashBinFixtures = deckConfig.filter(
|
|
135
|
+
fixture =>
|
|
136
|
+
fixture.cutoutFixtureId === TRASH_BIN_ADAPTER_FIXTURE &&
|
|
137
|
+
MOVABLE_TRASH_CUTOUTS.includes(fixture.cutoutId)
|
|
138
|
+
)
|
|
139
|
+
const wasteChuteOnlyFixtures = deckConfig.filter(
|
|
140
|
+
fixture =>
|
|
141
|
+
fixture.cutoutFixtureId != null &&
|
|
142
|
+
WASTE_CHUTE_ONLY_FIXTURES.includes(fixture.cutoutFixtureId) &&
|
|
143
|
+
fixture.cutoutId === WASTE_CHUTE_CUTOUT
|
|
144
|
+
)
|
|
145
|
+
const wasteChuteStagingAreaFixtures = deckConfig.filter(
|
|
146
|
+
fixture =>
|
|
147
|
+
fixture.cutoutFixtureId != null &&
|
|
148
|
+
WASTE_CHUTE_STAGING_AREA_FIXTURES.includes(fixture.cutoutFixtureId) &&
|
|
149
|
+
fixture.cutoutId === WASTE_CHUTE_CUTOUT
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<RobotCoordinateSpace
|
|
154
|
+
viewBox={`${deckDef.cornerOffsetFromOrigin[0]} ${deckDef.cornerOffsetFromOrigin[1]} ${deckDef.dimensions[0]} ${deckDef.dimensions[1]}`}
|
|
155
|
+
animated={animatedSVG}
|
|
156
|
+
{...svgProps}
|
|
157
|
+
>
|
|
158
|
+
{robotType === OT2_ROBOT_TYPE ? (
|
|
159
|
+
<DeckFromLayers
|
|
160
|
+
robotType={robotType}
|
|
161
|
+
layerBlocklist={deckLayerBlocklist}
|
|
162
|
+
/>
|
|
163
|
+
) : (
|
|
164
|
+
<>
|
|
165
|
+
{showSlotLabels ? (
|
|
166
|
+
<SlotLabels
|
|
167
|
+
robotType={robotType}
|
|
168
|
+
color={COLORS.black90}
|
|
169
|
+
show4thColumn={
|
|
170
|
+
stagingAreaFixtures.length > 0 ||
|
|
171
|
+
wasteChuteStagingAreaFixtures.length > 0 ||
|
|
172
|
+
modulesOnDeck.findIndex(
|
|
173
|
+
module => module.moduleModel === 'absorbanceReaderV1'
|
|
174
|
+
) >= 0
|
|
175
|
+
}
|
|
176
|
+
/>
|
|
177
|
+
) : null}
|
|
178
|
+
{singleSlotFixtures.map(fixture => (
|
|
179
|
+
<SingleSlotFixture
|
|
180
|
+
key={fixture.cutoutId}
|
|
181
|
+
cutoutId={fixture.cutoutId}
|
|
182
|
+
deckDefinition={deckDef}
|
|
183
|
+
slotClipColor={darkFill}
|
|
184
|
+
fixtureBaseColor={lightFill}
|
|
185
|
+
showExpansion={showExpansion}
|
|
186
|
+
/>
|
|
187
|
+
))}
|
|
188
|
+
{stagingAreaFixtures.map(fixture => (
|
|
189
|
+
<StagingAreaFixture
|
|
190
|
+
key={fixture.cutoutId}
|
|
191
|
+
cutoutId={fixture.cutoutId as StagingAreaLocation}
|
|
192
|
+
deckDefinition={deckDef}
|
|
193
|
+
slotClipColor={darkFill}
|
|
194
|
+
fixtureBaseColor={lightFill}
|
|
195
|
+
/>
|
|
196
|
+
))}
|
|
197
|
+
{trashBinFixtures.map(fixture => (
|
|
198
|
+
<Fragment key={fixture.cutoutId}>
|
|
199
|
+
<SingleSlotFixture
|
|
200
|
+
cutoutId={fixture.cutoutId}
|
|
201
|
+
deckDefinition={deckDef}
|
|
202
|
+
slotClipColor={COLORS.transparent}
|
|
203
|
+
fixtureBaseColor={lightFill}
|
|
204
|
+
/>
|
|
205
|
+
<FlexTrash
|
|
206
|
+
robotType={robotType}
|
|
207
|
+
trashIconColor={lightFill}
|
|
208
|
+
trashCutoutId={fixture.cutoutId as TrashCutoutId}
|
|
209
|
+
backgroundColor={mediumFill}
|
|
210
|
+
/>
|
|
211
|
+
</Fragment>
|
|
212
|
+
))}
|
|
213
|
+
{wasteChuteOnlyFixtures.map(fixture => {
|
|
214
|
+
if (fixture.cutoutId === WASTE_CHUTE_CUTOUT) {
|
|
215
|
+
return (
|
|
216
|
+
<WasteChuteFixture
|
|
217
|
+
key={fixture.cutoutId}
|
|
218
|
+
cutoutId={fixture.cutoutId}
|
|
219
|
+
deckDefinition={deckDef}
|
|
220
|
+
fixtureBaseColor={lightFill}
|
|
221
|
+
wasteChuteColor={mediumFill}
|
|
222
|
+
/>
|
|
223
|
+
)
|
|
224
|
+
} else {
|
|
225
|
+
return null
|
|
226
|
+
}
|
|
227
|
+
})}
|
|
228
|
+
{wasteChuteStagingAreaFixtures.map(fixture => {
|
|
229
|
+
if (fixture.cutoutId === WASTE_CHUTE_CUTOUT) {
|
|
230
|
+
return (
|
|
231
|
+
<WasteChuteStagingAreaFixture
|
|
232
|
+
key={fixture.cutoutId}
|
|
233
|
+
cutoutId={fixture.cutoutId}
|
|
234
|
+
deckDefinition={deckDef}
|
|
235
|
+
slotClipColor={darkFill}
|
|
236
|
+
fixtureBaseColor={lightFill}
|
|
237
|
+
wasteChuteColor={mediumFill}
|
|
238
|
+
/>
|
|
239
|
+
)
|
|
240
|
+
} else {
|
|
241
|
+
return null
|
|
242
|
+
}
|
|
243
|
+
})}
|
|
244
|
+
</>
|
|
245
|
+
)}
|
|
246
|
+
<>
|
|
247
|
+
{/* render modules, nested labware, and overlays */}
|
|
248
|
+
{modulesOnDeck.map(
|
|
249
|
+
({
|
|
250
|
+
moduleModel,
|
|
251
|
+
moduleLocation,
|
|
252
|
+
nestedLabwareDef,
|
|
253
|
+
nestedLabwareWellFill,
|
|
254
|
+
innerProps,
|
|
255
|
+
moduleChildren,
|
|
256
|
+
onLabwareClick,
|
|
257
|
+
highlightLabware,
|
|
258
|
+
highlightShadowLabware,
|
|
259
|
+
}) => {
|
|
260
|
+
const slotPosition = getPositionFromSlotId(
|
|
261
|
+
moduleLocation.slotName,
|
|
262
|
+
deckDef
|
|
263
|
+
)
|
|
264
|
+
const moduleDef = getModuleDef2(moduleModel)
|
|
265
|
+
return slotPosition != null ? (
|
|
266
|
+
<Module
|
|
267
|
+
key={`${moduleModel} ${moduleLocation.slotName}`}
|
|
268
|
+
def={moduleDef}
|
|
269
|
+
x={slotPosition[0]}
|
|
270
|
+
y={slotPosition[1]}
|
|
271
|
+
orientation={inferModuleOrientationFromXCoordinate(
|
|
272
|
+
slotPosition[0]
|
|
273
|
+
)}
|
|
274
|
+
innerProps={innerProps}
|
|
275
|
+
>
|
|
276
|
+
{nestedLabwareDef != null ? (
|
|
277
|
+
<LabwareRender
|
|
278
|
+
definition={nestedLabwareDef}
|
|
279
|
+
onLabwareClick={onLabwareClick}
|
|
280
|
+
wellFill={nestedLabwareWellFill}
|
|
281
|
+
shouldRotateAdapterOrientation={
|
|
282
|
+
inferModuleOrientationFromXCoordinate(slotPosition[0]) ===
|
|
283
|
+
'left' && moduleModel === HEATERSHAKER_MODULE_V1
|
|
284
|
+
}
|
|
285
|
+
highlight={highlightLabware}
|
|
286
|
+
highlightShadow={highlightShadowLabware}
|
|
287
|
+
/>
|
|
288
|
+
) : null}
|
|
289
|
+
{moduleChildren}
|
|
290
|
+
</Module>
|
|
291
|
+
) : null
|
|
292
|
+
}
|
|
293
|
+
)}
|
|
294
|
+
{/* render non-module labware and overlays */}
|
|
295
|
+
{labwareOnDeck.map(
|
|
296
|
+
({
|
|
297
|
+
labwareLocation,
|
|
298
|
+
definition,
|
|
299
|
+
labwareChildren,
|
|
300
|
+
wellFill,
|
|
301
|
+
missingTips,
|
|
302
|
+
onLabwareClick,
|
|
303
|
+
highlight,
|
|
304
|
+
highlightShadow,
|
|
305
|
+
}) => {
|
|
306
|
+
if (
|
|
307
|
+
labwareLocation === 'offDeck' ||
|
|
308
|
+
!('slotName' in labwareLocation) ||
|
|
309
|
+
// for legacy protocols that list fixed trash as a labware, do not render
|
|
310
|
+
definition.parameters.loadName ===
|
|
311
|
+
'opentrons_1_trash_3200ml_fixed'
|
|
312
|
+
) {
|
|
313
|
+
return null
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const slotPosition = getPositionFromSlotId(
|
|
317
|
+
labwareLocation.slotName,
|
|
318
|
+
deckDef
|
|
319
|
+
)
|
|
320
|
+
|
|
321
|
+
return slotPosition != null ? (
|
|
322
|
+
<g
|
|
323
|
+
key={labwareLocation.slotName}
|
|
324
|
+
transform={`translate(${slotPosition[0].toString()},${slotPosition[1].toString()})`}
|
|
325
|
+
cursor={onLabwareClick != null ? 'pointer' : ''}
|
|
326
|
+
>
|
|
327
|
+
<LabwareRender
|
|
328
|
+
definition={definition}
|
|
329
|
+
onLabwareClick={onLabwareClick}
|
|
330
|
+
wellFill={wellFill ?? undefined}
|
|
331
|
+
missingTips={missingTips}
|
|
332
|
+
highlight={highlight}
|
|
333
|
+
highlightShadow={highlightShadow}
|
|
334
|
+
/>
|
|
335
|
+
{labwareChildren}
|
|
336
|
+
</g>
|
|
337
|
+
) : null
|
|
338
|
+
}
|
|
339
|
+
)}
|
|
340
|
+
{/* render stacked badge on module labware */}
|
|
341
|
+
{modulesOnDeck.map(
|
|
342
|
+
({ moduleModel, moduleLocation, stacked = false }) => {
|
|
343
|
+
const slotPosition = getPositionFromSlotId(
|
|
344
|
+
moduleLocation.slotName,
|
|
345
|
+
deckDef
|
|
346
|
+
)
|
|
347
|
+
const moduleDef = getModuleDef2(moduleModel)
|
|
348
|
+
|
|
349
|
+
const {
|
|
350
|
+
x: nestedLabwareOffsetX,
|
|
351
|
+
y: nestedLabwareOffsetY,
|
|
352
|
+
} = moduleDef.labwareOffset
|
|
353
|
+
|
|
354
|
+
// labwareOffset values are more accurate than our SVG renderings, so ignore any deviations under a certain threshold
|
|
355
|
+
const clampedLabwareOffsetX =
|
|
356
|
+
Math.abs(nestedLabwareOffsetX) > LABWARE_OFFSET_DISPLAY_THRESHOLD
|
|
357
|
+
? nestedLabwareOffsetX
|
|
358
|
+
: 0
|
|
359
|
+
const clampedLabwareOffsetY =
|
|
360
|
+
Math.abs(nestedLabwareOffsetY) > LABWARE_OFFSET_DISPLAY_THRESHOLD
|
|
361
|
+
? nestedLabwareOffsetY
|
|
362
|
+
: 0
|
|
363
|
+
// transform to be applied to children which render within the labware interfacing surface of the module
|
|
364
|
+
const childrenTransform = `translate(${clampedLabwareOffsetX}, ${clampedLabwareOffsetY})`
|
|
365
|
+
|
|
366
|
+
return slotPosition != null && stacked ? (
|
|
367
|
+
<g
|
|
368
|
+
key={`stacked_${moduleLocation.slotName}`}
|
|
369
|
+
transform={`translate(${slotPosition[0].toString()},${slotPosition[1].toString()})`}
|
|
370
|
+
>
|
|
371
|
+
<g transform={childrenTransform}>
|
|
372
|
+
<StackedBadge />
|
|
373
|
+
</g>
|
|
374
|
+
</g>
|
|
375
|
+
) : null
|
|
376
|
+
}
|
|
377
|
+
)}
|
|
378
|
+
{/* render stacked badge on non-module labware */}
|
|
379
|
+
{labwareOnDeck.map(
|
|
380
|
+
({ labwareLocation, definition, stacked = false }) => {
|
|
381
|
+
if (
|
|
382
|
+
labwareLocation === 'offDeck' ||
|
|
383
|
+
!('slotName' in labwareLocation) ||
|
|
384
|
+
// for legacy protocols that list fixed trash as a labware, do not render
|
|
385
|
+
definition.parameters.loadName ===
|
|
386
|
+
'opentrons_1_trash_3200ml_fixed'
|
|
387
|
+
) {
|
|
388
|
+
return null
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
const slotPosition = getPositionFromSlotId(
|
|
392
|
+
labwareLocation.slotName,
|
|
393
|
+
deckDef
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
return slotPosition != null && stacked ? (
|
|
397
|
+
<g
|
|
398
|
+
key={`stacked_${labwareLocation.slotName}`}
|
|
399
|
+
transform={`translate(${slotPosition[0].toString()},${slotPosition[1].toString()})`}
|
|
400
|
+
>
|
|
401
|
+
<StackedBadge />
|
|
402
|
+
</g>
|
|
403
|
+
) : null
|
|
404
|
+
}
|
|
405
|
+
)}
|
|
406
|
+
</>
|
|
407
|
+
{children}
|
|
408
|
+
</RobotCoordinateSpace>
|
|
409
|
+
)
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
function StackedBadge(): JSX.Element {
|
|
413
|
+
return (
|
|
414
|
+
<RobotCoordsForeignObject height="2.5rem" width="2.5rem" x={113} y={53}>
|
|
415
|
+
<DeckInfoLabel
|
|
416
|
+
height="1.25rem"
|
|
417
|
+
svgSize="0.875rem"
|
|
418
|
+
highlight
|
|
419
|
+
iconName="stacked"
|
|
420
|
+
/>
|
|
421
|
+
</RobotCoordsForeignObject>
|
|
422
|
+
)
|
|
423
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import type * as React from 'react'
|
|
2
|
+
|
|
3
|
+
import { SlotBase } from './SlotBase'
|
|
4
|
+
import { SlotClip } from './SlotClip'
|
|
5
|
+
|
|
6
|
+
import type {
|
|
7
|
+
CutoutId,
|
|
8
|
+
DeckDefinition,
|
|
9
|
+
ModuleType,
|
|
10
|
+
} from '@opentrons/shared-data'
|
|
11
|
+
|
|
12
|
+
interface SingleSlotFixtureProps extends React.SVGProps<SVGGElement> {
|
|
13
|
+
cutoutId: CutoutId
|
|
14
|
+
deckDefinition: DeckDefinition
|
|
15
|
+
moduleType?: ModuleType
|
|
16
|
+
fixtureBaseColor?: React.SVGProps<SVGPathElement>['fill']
|
|
17
|
+
slotClipColor?: React.SVGProps<SVGPathElement>['stroke']
|
|
18
|
+
showExpansion?: boolean
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function SingleSlotFixture(
|
|
22
|
+
props: SingleSlotFixtureProps
|
|
23
|
+
): JSX.Element | null {
|
|
24
|
+
const {
|
|
25
|
+
cutoutId,
|
|
26
|
+
deckDefinition,
|
|
27
|
+
fixtureBaseColor,
|
|
28
|
+
slotClipColor,
|
|
29
|
+
showExpansion = false,
|
|
30
|
+
...restProps
|
|
31
|
+
} = props
|
|
32
|
+
|
|
33
|
+
const cutoutDef = deckDefinition?.locations.cutouts.find(
|
|
34
|
+
s => s.id === cutoutId
|
|
35
|
+
)
|
|
36
|
+
if (cutoutDef == null) {
|
|
37
|
+
console.warn(
|
|
38
|
+
`cannot render SingleSlotFixture, no cutout named: ${cutoutDef} in deck def ${deckDefinition?.otId}`
|
|
39
|
+
)
|
|
40
|
+
return null
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const contentsByCutoutLocation: {
|
|
44
|
+
[cutoutId in CutoutId]: JSX.Element
|
|
45
|
+
} = {
|
|
46
|
+
cutoutA1: (
|
|
47
|
+
<>
|
|
48
|
+
{showExpansion ? (
|
|
49
|
+
<SlotBase
|
|
50
|
+
fill={fixtureBaseColor}
|
|
51
|
+
d="M-97.8,496.6h239c2.3,0,4.2-1.9,4.2-4.2v-70c0-2.3-1.9-4.2-4.2-4.2h-239c-2.3,0-4.2,1.9-4.2,4.2v70 C-102,494.7-100.1,496.6-97.8,496.6z"
|
|
52
|
+
/>
|
|
53
|
+
) : null}
|
|
54
|
+
<SlotBase
|
|
55
|
+
fill={fixtureBaseColor}
|
|
56
|
+
d="M-97.7,417.1h238.8c2.4,0,4.3-1.9,4.3-4.3v-97.4c0-2.4-1.9-4.3-4.3-4.3H-97.7c-2.4,0-4.3,1.9-4.3,4.3v97.4 C-102,415.1-100.1,417.1-97.7,417.1z"
|
|
57
|
+
/>
|
|
58
|
+
<SlotClip d="M-1.9,398.9V409H8.9" stroke={slotClipColor} />
|
|
59
|
+
<SlotClip d="M-1.9,329.8v-10.5H8.7" stroke={slotClipColor} />
|
|
60
|
+
<SlotClip d="M129.9,398.9V409h-10.8" stroke={slotClipColor} />
|
|
61
|
+
<SlotClip d="M129.9,329.8v-10.7h-10.8" stroke={slotClipColor} />
|
|
62
|
+
</>
|
|
63
|
+
),
|
|
64
|
+
cutoutA2: (
|
|
65
|
+
<>
|
|
66
|
+
<SlotBase
|
|
67
|
+
d="M150.8,417.1h154.3c2.4,0,4.3-1.9,4.3-4.3v-97.4c0-2.4-1.9-4.3-4.3-4.3H150.8c-2.4,0-4.3,1.9-4.3,4.3v97.4C146.5,415.1,148.4,417.1,150.8,417.1z"
|
|
68
|
+
fill={fixtureBaseColor}
|
|
69
|
+
/>
|
|
70
|
+
<SlotClip d="M162.1,398.9V409h10.8" stroke={slotClipColor} />,
|
|
71
|
+
<SlotClip d="M162.1,329.8v-10.5h10.6" stroke={slotClipColor} />,
|
|
72
|
+
<SlotClip d="M293.9,398.9V409h-10.8" stroke={slotClipColor} />,
|
|
73
|
+
<SlotClip d="M293.9,329.8v-10.7h-10.8" stroke={slotClipColor} />
|
|
74
|
+
</>
|
|
75
|
+
),
|
|
76
|
+
cutoutA3: (
|
|
77
|
+
<>
|
|
78
|
+
<SlotBase
|
|
79
|
+
d="M314.8,417.1h238.9c2.4,0,4.3-1.9,4.3-4.3v-97.4c0-2.4-1.9-4.3-4.3-4.3H314.8c-2.4,0-4.3,1.9-4.3,4.3v97.4C310.5,415.1,312.4,417.1,314.8,417.1z"
|
|
80
|
+
fill={fixtureBaseColor}
|
|
81
|
+
/>
|
|
82
|
+
<SlotClip d="M326,398.9V409h10.8" stroke={slotClipColor} />,
|
|
83
|
+
<SlotClip d="M326,329.8v-10.5h10.6" stroke={slotClipColor} />,
|
|
84
|
+
<SlotClip d="M457.8,398.9V409H447" stroke={slotClipColor} />,
|
|
85
|
+
<SlotClip d="M457.8,329.8v-10.7H447" stroke={slotClipColor} />
|
|
86
|
+
</>
|
|
87
|
+
),
|
|
88
|
+
cutoutB1: (
|
|
89
|
+
<>
|
|
90
|
+
<SlotBase
|
|
91
|
+
d="M-97.7,310h238.8c2.4,0,4.3-1.9,4.3-4.3v-97.2c0-2.4-1.9-4.3-4.3-4.3H-97.7c-2.4,0-4.3,1.9-4.3,4.3v97.2C-102,308.1-100.1,310-97.7,310z"
|
|
92
|
+
fill={fixtureBaseColor}
|
|
93
|
+
/>
|
|
94
|
+
<SlotClip d="M-1.9,291.9V302H8.9" stroke={slotClipColor} />,
|
|
95
|
+
<SlotClip d="M-1.9,222.8v-10.5H8.7" stroke={slotClipColor} />,
|
|
96
|
+
<SlotClip d="M129.9,291.9V302h-10.8" stroke={slotClipColor} />,
|
|
97
|
+
<SlotClip d="M129.9,222.8v-10.7h-10.8" stroke={slotClipColor} />
|
|
98
|
+
</>
|
|
99
|
+
),
|
|
100
|
+
cutoutB2: (
|
|
101
|
+
<>
|
|
102
|
+
<SlotBase
|
|
103
|
+
d="M150.8,310h154.3c2.4,0,4.3-1.9,4.3-4.3v-97.2c0-2.4-1.9-4.3-4.3-4.3H150.8c-2.4,0-4.3,1.9-4.3,4.3v97.2C146.5,308.1,148.4,310,150.8,310z"
|
|
104
|
+
fill={fixtureBaseColor}
|
|
105
|
+
/>
|
|
106
|
+
<SlotClip d="M162.1,291.9V302h10.8" stroke={slotClipColor} />,
|
|
107
|
+
<SlotClip d="M162.1,222.8v-10.5h10.6" stroke={slotClipColor} />,
|
|
108
|
+
<SlotClip d="M293.9,291.9V302h-10.8" stroke={slotClipColor} />,
|
|
109
|
+
<SlotClip d="M293.9,222.8v-10.7h-10.8" stroke={slotClipColor} />
|
|
110
|
+
</>
|
|
111
|
+
),
|
|
112
|
+
cutoutB3: (
|
|
113
|
+
<>
|
|
114
|
+
<SlotBase
|
|
115
|
+
d="M314.8,310h238.9c2.4,0,4.3-1.9,4.3-4.3v-97.2c0-2.4-1.9-4.3-4.3-4.3H314.8c-2.4,0-4.3,1.9-4.3,4.3v97.2C310.5,308.1,312.4,310,314.8,310z"
|
|
116
|
+
fill={fixtureBaseColor}
|
|
117
|
+
/>
|
|
118
|
+
<SlotClip d="M326,291.9V302h10.8" stroke={slotClipColor} />,
|
|
119
|
+
<SlotClip d="M326,222.8v-10.5h10.6" stroke={slotClipColor} />,
|
|
120
|
+
<SlotClip d="M457.8,291.9V302H447" stroke={slotClipColor} />,
|
|
121
|
+
<SlotClip d="M457.8,222.8v-10.7H447" stroke={slotClipColor} />
|
|
122
|
+
</>
|
|
123
|
+
),
|
|
124
|
+
cutoutC1: (
|
|
125
|
+
<>
|
|
126
|
+
<SlotBase
|
|
127
|
+
d="M-97.7,203.1h238.8c2.4,0,4.3-1.9,4.3-4.3v-97.4c0-2.4-1.9-4.3-4.3-4.3H-97.7c-2.4,0-4.3,1.9-4.3,4.3v97.4C-102,201.2-100.1,203.1-97.7,203.1z"
|
|
128
|
+
fill={fixtureBaseColor}
|
|
129
|
+
/>
|
|
130
|
+
<SlotClip d="M-1.9,185v10.1H8.9" stroke={slotClipColor} />
|
|
131
|
+
<SlotClip d="M-1.9,115.8v-10.5H8.7" stroke={slotClipColor} />
|
|
132
|
+
<SlotClip d="M129.9,185v10.1h-10.8" stroke={slotClipColor} />
|
|
133
|
+
<SlotClip d="M129.9,115.8v-10.7h-10.8" stroke={slotClipColor} />
|
|
134
|
+
</>
|
|
135
|
+
),
|
|
136
|
+
cutoutC2: (
|
|
137
|
+
<>
|
|
138
|
+
<SlotBase
|
|
139
|
+
d="M150.8,203.1h154.3c2.4,0,4.3-1.9,4.3-4.3v-97.4c0-2.4-1.9-4.3-4.3-4.3H150.8c-2.4,0-4.3,1.9-4.3,4.3v97.4C146.5,201.2,148.4,203.1,150.8,203.1z"
|
|
140
|
+
fill={fixtureBaseColor}
|
|
141
|
+
/>
|
|
142
|
+
<SlotClip d="M162.1,185v10.1h10.8" stroke={slotClipColor} />,
|
|
143
|
+
<SlotClip d="M162.1,115.8v-10.5h10.6" stroke={slotClipColor} />,
|
|
144
|
+
<SlotClip d="M293.9,185v10.1h-10.8" stroke={slotClipColor} />,
|
|
145
|
+
<SlotClip d="M293.9,115.8v-10.7h-10.8" stroke={slotClipColor} />
|
|
146
|
+
</>
|
|
147
|
+
),
|
|
148
|
+
cutoutC3: (
|
|
149
|
+
<>
|
|
150
|
+
<SlotBase
|
|
151
|
+
d="M314.8,203.1h238.9c2.4,0,4.3-1.9,4.3-4.3v-97.4c0-2.4-1.9-4.3-4.3-4.3H314.8c-2.4,0-4.3,1.9-4.3,4.3v97.4C310.5,201.2,312.4,203.1,314.8,203.1z"
|
|
152
|
+
fill={fixtureBaseColor}
|
|
153
|
+
/>
|
|
154
|
+
<SlotClip d="M326,185v10.1h10.8" stroke={slotClipColor} />,
|
|
155
|
+
<SlotClip d="M326,115.8v-10.5h10.6" stroke={slotClipColor} />,
|
|
156
|
+
<SlotClip d="M457.8,185v10.1H447" stroke={slotClipColor} />,
|
|
157
|
+
<SlotClip d="M457.8,115.8v-10.7H447" stroke={slotClipColor} />
|
|
158
|
+
</>
|
|
159
|
+
),
|
|
160
|
+
cutoutD1: (
|
|
161
|
+
<>
|
|
162
|
+
<SlotBase
|
|
163
|
+
fill={fixtureBaseColor}
|
|
164
|
+
d="M-97.7,96.1h238.8c2.4,0,4.3-1.9,4.3-4.3V-5.6c0-2.4-1.9-4.3-4.3-4.3H-97.7c-2.4,0-4.3,1.9-4.3,4.3v97.4C-102,94.2-100.1,96.1-97.7,96.1z"
|
|
165
|
+
/>
|
|
166
|
+
<SlotClip d="M-1.9,77.9V88H8.9" stroke={slotClipColor} />
|
|
167
|
+
<SlotClip d="M-1.9,8.8V-1.7H8.7" stroke={slotClipColor} />
|
|
168
|
+
<SlotClip d="M129.9,77.9V88h-10.8" stroke={slotClipColor} />
|
|
169
|
+
<SlotClip d="M129.9,8.8V-1.9h-10.8" stroke={slotClipColor} />
|
|
170
|
+
</>
|
|
171
|
+
),
|
|
172
|
+
cutoutD2: (
|
|
173
|
+
<>
|
|
174
|
+
<SlotBase
|
|
175
|
+
fill={fixtureBaseColor}
|
|
176
|
+
d="M150.8,96.1h154.3c2.4,0,4.3-1.9,4.3-4.3V-5.6c0-2.4-1.9-4.3-4.3-4.3H150.8c-2.4,0-4.3,1.9-4.3,4.3v97.4C146.5,94.2,148.4,96.1,150.8,96.1z"
|
|
177
|
+
/>
|
|
178
|
+
<SlotClip d="M162.1,77.9V88h10.8" stroke={slotClipColor} />
|
|
179
|
+
<SlotClip d="M162.1,8.8V-1.7h10.6" stroke={slotClipColor} />
|
|
180
|
+
<SlotClip d="M293.9,77.9V88h-10.8" stroke={slotClipColor} />
|
|
181
|
+
<SlotClip d="M293.9,8.8V-1.9h-10.8" stroke={slotClipColor} />
|
|
182
|
+
</>
|
|
183
|
+
),
|
|
184
|
+
cutoutD3: (
|
|
185
|
+
<>
|
|
186
|
+
<SlotBase
|
|
187
|
+
d="M314.8,96.1h238.9c2.4,0,4.3-1.9,4.3-4.3V-5.6c0-2.4-1.9-4.3-4.3-4.3H314.8c-2.4,0-4.3,1.9-4.3,4.3v97.4C310.5,94.2,312.4,96.1,314.8,96.1z"
|
|
188
|
+
fill={fixtureBaseColor}
|
|
189
|
+
/>
|
|
190
|
+
<SlotClip d="M326,77.9V88h10.8" stroke={slotClipColor} />
|
|
191
|
+
<SlotClip d="M326,8.8V-1.7h10.6" stroke={slotClipColor} />
|
|
192
|
+
<SlotClip d="M457.8,77.9V88H447" stroke={slotClipColor} />
|
|
193
|
+
<SlotClip d="M457.8,8.8V-1.9H447" stroke={slotClipColor} />
|
|
194
|
+
</>
|
|
195
|
+
),
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return <g {...restProps}>{contentsByCutoutLocation[cutoutId]}</g>
|
|
199
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type * as React from 'react'
|
|
2
|
+
|
|
3
|
+
import { COLORS } from '../../helix-design-system'
|
|
4
|
+
|
|
5
|
+
export function SlotClip(props: React.SVGProps<SVGPathElement>): JSX.Element {
|
|
6
|
+
return (
|
|
7
|
+
<path
|
|
8
|
+
fill="none"
|
|
9
|
+
stroke={COLORS.black90}
|
|
10
|
+
strokeWidth={3}
|
|
11
|
+
strokeOpacity={0.7}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
)
|
|
15
|
+
}
|