@opentrons/components 0.1.6-alpha.2 → 0.1.6-alpha.5

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.
Files changed (2) hide show
  1. package/lib/index.mjs +155 -96
  2. package/package.json +2 -2
package/lib/index.mjs CHANGED
@@ -11352,7 +11352,7 @@ const orderRuntimeParameterRangeOptions = (choices) => {
11352
11352
  return numA - numB;
11353
11353
  }).join(", ");
11354
11354
  } else {
11355
- return displayNames.sort().join(", ");
11355
+ return displayNames.join(", ");
11356
11356
  }
11357
11357
  };
11358
11358
  const getLabwareDefIsStandard = (def) => (def == null ? void 0 : def.namespace) === OPENTRONS_LABWARE_NAMESPACE;
@@ -11462,8 +11462,7 @@ function getCutoutFixturesForModuleModel(moduleModel, deckDef) {
11462
11462
  return moduleFixture != null ? [...acc, moduleFixture] : acc;
11463
11463
  }, []);
11464
11464
  }
11465
- function getFixtureIdByCutoutIdFromModuleSlotName(slotName, moduleFixtures, deckDef) {
11466
- const anchorCutoutId = getCutoutIdForSlotName(slotName, deckDef);
11465
+ function getFixtureIdByCutoutIdFromModuleAnchorCutoutId(anchorCutoutId, moduleFixtures) {
11467
11466
  const anchorFixture = moduleFixtures.find(
11468
11467
  (fixture) => fixture.mayMountTo.some((cutoutId) => cutoutId === anchorCutoutId)
11469
11468
  );
@@ -11473,6 +11472,13 @@ function getFixtureIdByCutoutIdFromModuleSlotName(slotName, moduleFixtures, deck
11473
11472
  }
11474
11473
  return {};
11475
11474
  }
11475
+ function getFixtureIdByCutoutIdFromModuleSlotName(slotName, moduleFixtures, deckDef) {
11476
+ const anchorCutoutId = getCutoutIdForSlotName(slotName, deckDef);
11477
+ return getFixtureIdByCutoutIdFromModuleAnchorCutoutId(
11478
+ anchorCutoutId,
11479
+ moduleFixtures
11480
+ );
11481
+ }
11476
11482
  function getCutoutIdsFromModuleSlotName(slotName, moduleFixtures, deckDef) {
11477
11483
  const fixtureIdByCutoutId = getFixtureIdByCutoutIdFromModuleSlotName(
11478
11484
  slotName,
@@ -12779,6 +12785,7 @@ const spacing20 = "1.25rem";
12779
12785
  const spacing24 = "1.5rem";
12780
12786
  const spacing32 = "2rem";
12781
12787
  const spacing40 = "2.5rem";
12788
+ const spacing44 = "2.75rem";
12782
12789
  const spacing48 = "3rem";
12783
12790
  const spacing60 = "3.75rem";
12784
12791
  const spacing68 = "4.25rem";
@@ -12797,6 +12804,7 @@ const spacing = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
12797
12804
  spacing32,
12798
12805
  spacing4,
12799
12806
  spacing40,
12807
+ spacing44,
12800
12808
  spacing48,
12801
12809
  spacing6,
12802
12810
  spacing60,
@@ -13775,8 +13783,8 @@ const ICON_DATA_BY_NAME = {
13775
13783
  viewBox: "0 0 24 24"
13776
13784
  },
13777
13785
  "menu-down": {
13778
- path: "M7,10L12,15L17,10H7Z",
13779
- viewBox: "0 0 24 24"
13786
+ path: "M2.0672 4.46744C1.9125 4.28307 2.04206 4 2.28116 4L9.71887 4.00001C9.95795 4.00001 10.0875 4.28307 9.93281 4.46744L6.21412 8.89982C6.10205 9.03339 5.89826 9.0334 5.78619 8.89983L2.0672 4.46744Z",
13787
+ viewBox: "0 0 12 12"
13780
13788
  },
13781
13789
  minus: {
13782
13790
  path: "M19,13H5V11H19V13Z",
@@ -14058,6 +14066,10 @@ const ICON_DATA_BY_NAME = {
14058
14066
  path: "M8.01487 8.84912C8.47511 8.84912 8.84821 8.47603 8.84821 8.01579C8.84821 7.55555 8.47511 7.18245 8.01487 7.18245C7.55464 7.18245 7.18154 7.55555 7.18154 8.01579C7.18154 8.47603 7.55464 8.84912 8.01487 8.84912Z M8.66654 0.928711V2.36089C11.27 2.66533 13.3354 4.73075 13.6398 7.33418H15.072V8.66751H13.6398C13.3354 11.2709 11.27 13.3363 8.66654 13.6408V15.073H7.3332V13.6408C4.72979 13.3363 2.66437 11.2709 2.35992 8.66751H0.927734V7.33418H2.35992C2.66436 4.73075 4.72978 2.66533 7.3332 2.36089V0.928711H8.66654ZM12.2944 7.33418H11.6184C11.2502 7.33418 10.9518 7.63266 10.9518 8.00085C10.9518 8.36904 11.2502 8.66751 11.6184 8.66751H12.2944C12.0071 10.5336 10.5326 12.008 8.66654 12.2953V11.6194C8.66654 11.2512 8.36806 10.9527 7.99987 10.9527C7.63168 10.9527 7.3332 11.2512 7.3332 11.6194V12.2953C5.46716 12.008 3.99268 10.5336 3.70536 8.66751H4.38132C4.74951 8.66751 5.04798 8.36904 5.04798 8.00085C5.04798 7.63266 4.74951 7.33418 4.38132 7.33418H3.70536C3.99267 5.46812 5.46715 3.99364 7.3332 3.70632V4.38229C7.3332 4.75048 7.63168 5.04896 7.99987 5.04896C8.36806 5.04896 8.66654 4.75048 8.66654 4.38229V3.70632C10.5326 3.99364 12.0071 5.46812 12.2944 7.33418Z",
14059
14067
  viewBox: "0 0 16 16"
14060
14068
  },
14069
+ send: {
14070
+ path: "M6.96216 26.6667V5.33337L32.2955 16L6.96216 26.6667ZM9.62882 22.6667L25.4288 16L9.62882 9.33337V14L17.6288 16L9.62882 18V22.6667Z",
14071
+ viewBox: "0 0 32 32"
14072
+ },
14061
14073
  settings: {
14062
14074
  path: "M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",
14063
14075
  viewBox: "0 0 24 24"
@@ -15084,9 +15096,26 @@ var _StyledTooltip = _styled(Tooltip).withConfig({
15084
15096
  componentId: "sc-16k3q66-5"
15085
15097
  })(["", ""], (p) => p.$_css2);
15086
15098
  function InfoScreen({
15087
- contentType
15099
+ contentType,
15100
+ t
15088
15101
  }) {
15089
- const bodyText = contentType === "parameters" ? "No parameters specified in this protocol" : "Connect modules to see controls";
15102
+ let bodyText = "";
15103
+ switch (contentType) {
15104
+ case "parameters":
15105
+ bodyText = t != null ? t("no_parameters_specified_in_protocol") : "No parameters specified in this protocol";
15106
+ break;
15107
+ case "moduleControls":
15108
+ bodyText = t != null ? t("connect_modules_for_controls") : "Connect modules to see controls";
15109
+ break;
15110
+ case "runNotStarted":
15111
+ bodyText = t != null ? t("run_never_started") : "Run was never started";
15112
+ break;
15113
+ case "labware":
15114
+ bodyText = "No labware specified in this protocol";
15115
+ break;
15116
+ default:
15117
+ bodyText = contentType;
15118
+ }
15090
15119
  return /* @__PURE__ */ jsxs(Flex, { alignItems: ALIGN_CENTER, width: "100%", flexDirection: DIRECTION_COLUMN, gridGap: spacing12, backgroundColor: grey30, borderRadius: borderRadius8, padding: `${spacing40} ${spacing16}`, "data-testid": `InfoScreen_${contentType}`, children: [
15091
15120
  /* @__PURE__ */ jsx(Icon, { name: "ot-alert", size: "1.25rem", color: grey60, "aria-label": "alert" }),
15092
15121
  /* @__PURE__ */ jsx(StyledText, { as: "p", fontWeight: fontWeightSemiBold, children: bodyText })
@@ -16333,8 +16362,9 @@ function BaseDeck(props) {
16333
16362
  svgProps = {}
16334
16363
  } = props;
16335
16364
  const deckDef = getDeckDefFromRobotType(robotType);
16336
- const singleSlotFixtures = deckConfig.filter((fixture) => fixture.cutoutFixtureId != null && SINGLE_SLOT_FIXTURES.includes(fixture.cutoutFixtureId));
16337
- const stagingAreaFixtures = deckConfig.filter((fixture) => fixture.cutoutFixtureId === STAGING_AREA_RIGHT_SLOT_FIXTURE && STAGING_AREA_CUTOUTS.includes(fixture.cutoutId));
16365
+ const singleSlotFixtures = deckConfig.filter((fixture) => fixture.cutoutFixtureId != null && (SINGLE_SLOT_FIXTURES.includes(fixture.cutoutFixtureId) || // If module fixture is loaded, still visualize singleSlotFixture underneath for consistency
16366
+ Object.entries(MODULE_FIXTURES_BY_MODEL).reduce((acc, [_model, fixtures]) => [...acc, ...fixtures], []).includes(fixture.cutoutFixtureId)));
16367
+ const stagingAreaFixtures = deckConfig.filter((fixture) => (fixture.cutoutFixtureId === STAGING_AREA_RIGHT_SLOT_FIXTURE || fixture.cutoutFixtureId === STAGING_AREA_SLOT_WITH_MAGNETIC_BLOCK_V1_FIXTURE) && STAGING_AREA_CUTOUTS.includes(fixture.cutoutId));
16338
16368
  const trashBinFixtures = deckConfig.filter((fixture) => fixture.cutoutFixtureId === TRASH_BIN_ADAPTER_FIXTURE && MOVABLE_TRASH_CUTOUTS.includes(fixture.cutoutId));
16339
16369
  const wasteChuteOnlyFixtures = deckConfig.filter((fixture) => fixture.cutoutFixtureId != null && WASTE_CHUTE_ONLY_FIXTURES.includes(fixture.cutoutFixtureId) && fixture.cutoutId === WASTE_CHUTE_CUTOUT);
16340
16370
  const wasteChuteStagingAreaFixtures = deckConfig.filter((fixture) => fixture.cutoutFixtureId != null && WASTE_CHUTE_STAGING_AREA_FIXTURES.includes(fixture.cutoutFixtureId) && fixture.cutoutId === WASTE_CHUTE_CUTOUT);
@@ -16900,6 +16930,26 @@ const CONFIG_STYLE_EDITABLE = css`
16900
16930
  }
16901
16931
  }
16902
16932
  `;
16933
+ const CONFIG_STYLE_SELECTED = css`
16934
+ ${CONFIG_STYLE_EDITABLE}
16935
+ background-color: ${blue50};
16936
+
16937
+ &:active {
16938
+ background-color: ${blue60};
16939
+ }
16940
+
16941
+ &:hover {
16942
+ background-color: ${blue55};
16943
+ }
16944
+
16945
+ &:focus-visible {
16946
+ border: 3px solid ${yellow50};
16947
+ background-color: ${blue55};
16948
+ @media ${touchscreenMediaQuerySpecs} {
16949
+ background-color: ${blue60};
16950
+ }
16951
+ }
16952
+ `;
16903
16953
  function EmptyConfigFixture(props) {
16904
16954
  const {
16905
16955
  deckDefinition,
@@ -16953,18 +17003,20 @@ function StagingAreaConfigFixture(props) {
16953
17003
  deckDefinition,
16954
17004
  handleClickRemove,
16955
17005
  fixtureLocation,
16956
- cutoutFixtureId
17006
+ cutoutFixtureId,
17007
+ selected: selected2 = false
16957
17008
  } = props;
16958
17009
  const stagingAreaCutout = deckDefinition.locations.cutouts.find((cutout) => cutout.id === fixtureLocation);
16959
17010
  const [xSlotPosition = 0, ySlotPosition = 0] = (stagingAreaCutout == null ? void 0 : stagingAreaCutout.position) ?? [];
16960
17011
  const x = xSlotPosition + COLUMN_3_X_ADJUSTMENT;
16961
17012
  const y = ySlotPosition + Y_ADJUSTMENT;
17013
+ const editableStyle = selected2 ? CONFIG_STYLE_SELECTED : CONFIG_STYLE_EDITABLE;
16962
17014
  return /* @__PURE__ */ jsx(RobotCoordsForeignObject, { width: STAGING_AREA_FIXTURE_WIDTH, height: FIXTURE_HEIGHT, x, y, flexProps: {
16963
17015
  flex: "1"
16964
17016
  }, foreignObjectProps: {
16965
17017
  flex: "1"
16966
17018
  }, children: /* @__PURE__ */ jsxs(_StyledBtn$7, { cursor: handleClickRemove != null ? "pointer" : "default", onClick: handleClickRemove != null ? () => handleClickRemove(fixtureLocation, cutoutFixtureId) : () => {
16967
- }, $_css: handleClickRemove != null ? CONFIG_STYLE_EDITABLE : CONFIG_STYLE_READ_ONLY, children: [
17019
+ }, $_css: handleClickRemove != null ? editableStyle : CONFIG_STYLE_READ_ONLY, children: [
16968
17020
  /* @__PURE__ */ jsx(_StyledText$8, { $_css2: smallBodyTextSemiBold, children: STAGING_AREA_DISPLAY_NAME }),
16969
17021
  handleClickRemove != null ? /* @__PURE__ */ jsx(Icon, { name: "remove", color: white, size: "2rem" }) : null
16970
17022
  ] }) });
@@ -16982,7 +17034,8 @@ function TrashBinConfigFixture(props) {
16982
17034
  deckDefinition,
16983
17035
  handleClickRemove,
16984
17036
  fixtureLocation,
16985
- cutoutFixtureId
17037
+ cutoutFixtureId,
17038
+ selected: selected2 = false
16986
17039
  } = props;
16987
17040
  const trashBinCutout = deckDefinition.locations.cutouts.find((cutout) => cutout.id === fixtureLocation);
16988
17041
  const [xSlotPosition = 0, ySlotPosition = 0] = (trashBinCutout == null ? void 0 : trashBinCutout.position) ?? [];
@@ -16990,12 +17043,13 @@ function TrashBinConfigFixture(props) {
16990
17043
  const xAdjustment = isColumnOne ? COLUMN_1_X_ADJUSTMENT : COLUMN_3_X_ADJUSTMENT;
16991
17044
  const x = xSlotPosition + xAdjustment;
16992
17045
  const y = ySlotPosition + Y_ADJUSTMENT;
17046
+ const editableStyle = selected2 ? CONFIG_STYLE_SELECTED : CONFIG_STYLE_EDITABLE;
16993
17047
  return /* @__PURE__ */ jsx(RobotCoordsForeignObject, { width: COLUMN_3_SINGLE_SLOT_FIXTURE_WIDTH, height: FIXTURE_HEIGHT, x, y, flexProps: {
16994
17048
  flex: "1"
16995
17049
  }, foreignObjectProps: {
16996
17050
  flex: "1"
16997
17051
  }, children: /* @__PURE__ */ jsxs(_StyledBtn$6, { cursor: handleClickRemove != null ? "pointer" : "default", onClick: handleClickRemove != null ? () => handleClickRemove(fixtureLocation, cutoutFixtureId) : () => {
16998
- }, $_css: handleClickRemove != null ? CONFIG_STYLE_EDITABLE : CONFIG_STYLE_READ_ONLY, children: [
17052
+ }, $_css: handleClickRemove != null ? editableStyle : CONFIG_STYLE_READ_ONLY, children: [
16999
17053
  /* @__PURE__ */ jsx(_StyledText$7, { $_css2: smallBodyTextSemiBold, children: TRASH_BIN_DISPLAY_NAME }),
17000
17054
  handleClickRemove != null ? /* @__PURE__ */ jsx(Icon, { name: "remove", color: white, size: "2rem" }) : null
17001
17055
  ] }) });
@@ -17014,18 +17068,20 @@ function WasteChuteConfigFixture(props) {
17014
17068
  handleClickRemove,
17015
17069
  fixtureLocation,
17016
17070
  cutoutFixtureId,
17017
- hasStagingAreas = false
17071
+ hasStagingAreas = false,
17072
+ selected: selected2 = false
17018
17073
  } = props;
17019
17074
  const wasteChuteCutout = deckDefinition.locations.cutouts.find((cutout) => cutout.id === fixtureLocation);
17020
17075
  const [xSlotPosition = 0, ySlotPosition = 0] = (wasteChuteCutout == null ? void 0 : wasteChuteCutout.position) ?? [];
17021
17076
  const x = xSlotPosition + COLUMN_3_X_ADJUSTMENT;
17022
17077
  const y = ySlotPosition + Y_ADJUSTMENT;
17078
+ const editableStyle = selected2 ? CONFIG_STYLE_SELECTED : CONFIG_STYLE_EDITABLE;
17023
17079
  return /* @__PURE__ */ jsx(RobotCoordsForeignObject, { width: hasStagingAreas ? STAGING_AREA_FIXTURE_WIDTH : COLUMN_3_SINGLE_SLOT_FIXTURE_WIDTH, height: FIXTURE_HEIGHT, x, y, flexProps: {
17024
17080
  flex: "1"
17025
17081
  }, foreignObjectProps: {
17026
17082
  flex: "1"
17027
17083
  }, children: /* @__PURE__ */ jsxs(_StyledBtn$5, { cursor: handleClickRemove != null ? "pointer" : "default", onClick: handleClickRemove != null ? () => handleClickRemove(fixtureLocation, cutoutFixtureId) : () => {
17028
- }, $_css: handleClickRemove != null ? CONFIG_STYLE_EDITABLE : CONFIG_STYLE_READ_ONLY, children: [
17084
+ }, $_css: handleClickRemove != null ? editableStyle : CONFIG_STYLE_READ_ONLY, children: [
17029
17085
  /* @__PURE__ */ jsx(_StyledText$6, { $_css2: smallBodyTextSemiBold, children: WASTE_CHUTE_DISPLAY_NAME }),
17030
17086
  handleClickRemove != null ? /* @__PURE__ */ jsx(Icon, { name: "remove", color: white, size: "2rem" }) : null
17031
17087
  ] }) });
@@ -17069,7 +17125,8 @@ function TemperatureModuleFixture(props) {
17069
17125
  deckDefinition,
17070
17126
  handleClickRemove,
17071
17127
  fixtureLocation,
17072
- cutoutFixtureId
17128
+ cutoutFixtureId,
17129
+ selected: selected2 = false
17073
17130
  } = props;
17074
17131
  const cutoutDef = deckDefinition.locations.cutouts.find((cutout) => cutout.id === fixtureLocation);
17075
17132
  const [xSlotPosition = 0, ySlotPosition = 0] = (cutoutDef == null ? void 0 : cutoutDef.position) ?? [];
@@ -17077,12 +17134,13 @@ function TemperatureModuleFixture(props) {
17077
17134
  const xAdjustment = isColumnOne ? COLUMN_1_X_ADJUSTMENT : COLUMN_3_X_ADJUSTMENT;
17078
17135
  const x = xSlotPosition + xAdjustment;
17079
17136
  const y = ySlotPosition + Y_ADJUSTMENT;
17137
+ const editableStyle = selected2 ? CONFIG_STYLE_SELECTED : CONFIG_STYLE_EDITABLE;
17080
17138
  return /* @__PURE__ */ jsx(RobotCoordsForeignObject, { width: COLUMN_3_SINGLE_SLOT_FIXTURE_WIDTH, height: FIXTURE_HEIGHT, x, y, flexProps: {
17081
17139
  flex: "1"
17082
17140
  }, foreignObjectProps: {
17083
17141
  flex: "1"
17084
17142
  }, children: /* @__PURE__ */ jsxs(_StyledBtn$3, { cursor: handleClickRemove != null ? "pointer" : "default", onClick: handleClickRemove != null ? () => handleClickRemove(fixtureLocation, cutoutFixtureId) : () => {
17085
- }, $_css: handleClickRemove != null ? CONFIG_STYLE_EDITABLE : CONFIG_STYLE_READ_ONLY, children: [
17143
+ }, $_css: handleClickRemove != null ? editableStyle : CONFIG_STYLE_READ_ONLY, children: [
17086
17144
  /* @__PURE__ */ jsx(_StyledText$4, { $_css2: smallBodyTextSemiBold, children: TEMPERATURE_MODULE_FIXTURE_DISPLAY_NAME }),
17087
17145
  handleClickRemove != null ? /* @__PURE__ */ jsx(Icon, { name: "remove", color: white, size: "2rem" }) : null
17088
17146
  ] }) });
@@ -17095,13 +17153,14 @@ var _StyledText$4 = _styled(Text).withConfig({
17095
17153
  displayName: "TemperatureModuleFixture___StyledText",
17096
17154
  componentId: "sc-j8juq6-1"
17097
17155
  })(["", ""], (p) => p.$_css2);
17098
- const HEATER_SHAKER_MODULE_FIXTURE_DISPLAY_NAME = "Heater Shaker Module";
17156
+ const HEATER_SHAKER_MODULE_FIXTURE_DISPLAY_NAME = "Heater-Shaker";
17099
17157
  function HeaterShakerFixture(props) {
17100
17158
  const {
17101
17159
  deckDefinition,
17102
17160
  handleClickRemove,
17103
17161
  fixtureLocation,
17104
- cutoutFixtureId
17162
+ cutoutFixtureId,
17163
+ selected: selected2 = false
17105
17164
  } = props;
17106
17165
  const cutoutDef = deckDefinition.locations.cutouts.find((cutout) => cutout.id === fixtureLocation);
17107
17166
  const [xSlotPosition = 0, ySlotPosition = 0] = (cutoutDef == null ? void 0 : cutoutDef.position) ?? [];
@@ -17109,12 +17168,13 @@ function HeaterShakerFixture(props) {
17109
17168
  const xAdjustment = isColumnOne ? COLUMN_1_X_ADJUSTMENT : COLUMN_3_X_ADJUSTMENT;
17110
17169
  const x = xSlotPosition + xAdjustment;
17111
17170
  const y = ySlotPosition + Y_ADJUSTMENT;
17171
+ const editableStyle = selected2 ? CONFIG_STYLE_SELECTED : CONFIG_STYLE_EDITABLE;
17112
17172
  return /* @__PURE__ */ jsx(RobotCoordsForeignObject, { width: COLUMN_3_SINGLE_SLOT_FIXTURE_WIDTH, height: FIXTURE_HEIGHT, x, y, flexProps: {
17113
17173
  flex: "1"
17114
17174
  }, foreignObjectProps: {
17115
17175
  flex: "1"
17116
17176
  }, children: /* @__PURE__ */ jsxs(_StyledBtn$2, { cursor: handleClickRemove != null ? "pointer" : "default", onClick: handleClickRemove != null ? () => handleClickRemove(fixtureLocation, cutoutFixtureId) : () => {
17117
- }, $_css: handleClickRemove != null ? CONFIG_STYLE_EDITABLE : CONFIG_STYLE_READ_ONLY, children: [
17177
+ }, $_css: handleClickRemove != null ? editableStyle : CONFIG_STYLE_READ_ONLY, children: [
17118
17178
  /* @__PURE__ */ jsx(_StyledText$3, { $_css2: smallBodyTextSemiBold, children: HEATER_SHAKER_MODULE_FIXTURE_DISPLAY_NAME }),
17119
17179
  handleClickRemove != null ? /* @__PURE__ */ jsx(Icon, { name: "remove", color: white, size: "2rem" }) : null
17120
17180
  ] }) });
@@ -17135,7 +17195,8 @@ function MagneticBlockFixture(props) {
17135
17195
  fixtureLocation,
17136
17196
  handleClickRemove,
17137
17197
  cutoutFixtureId,
17138
- hasStagingArea
17198
+ hasStagingArea,
17199
+ selected: selected2 = false
17139
17200
  } = props;
17140
17201
  const standardSlotCutout = deckDefinition.locations.cutouts.find((cutout) => cutout.id === fixtureLocation);
17141
17202
  const [xSlotPosition = 0, ySlotPosition = 0] = (standardSlotCutout == null ? void 0 : standardSlotCutout.position) ?? [];
@@ -17170,12 +17231,13 @@ function MagneticBlockFixture(props) {
17170
17231
  }
17171
17232
  }
17172
17233
  const y = ySlotPosition + Y_ADJUSTMENT;
17234
+ const editableStyle = selected2 ? CONFIG_STYLE_SELECTED : CONFIG_STYLE_EDITABLE;
17173
17235
  return /* @__PURE__ */ jsx(RobotCoordsForeignObject, { width, height: FIXTURE_HEIGHT, x, y, flexProps: {
17174
17236
  flex: "1"
17175
17237
  }, foreignObjectProps: {
17176
17238
  flex: "1"
17177
17239
  }, children: /* @__PURE__ */ jsxs(_StyledBtn$1, { cursor: handleClickRemove != null ? "pointer" : "default", onClick: handleClickRemove != null ? () => handleClickRemove(fixtureLocation, cutoutFixtureId) : () => {
17178
- }, $_css: handleClickRemove != null ? CONFIG_STYLE_EDITABLE : CONFIG_STYLE_READ_ONLY, children: [
17240
+ }, $_css: handleClickRemove != null ? editableStyle : CONFIG_STYLE_READ_ONLY, children: [
17179
17241
  /* @__PURE__ */ jsx(_StyledText$2, { $_css2: smallBodyTextSemiBold, children: displayName2 }),
17180
17242
  handleClickRemove != null ? /* @__PURE__ */ jsx(Icon, { name: "remove", color: white, size: "2rem" }) : null
17181
17243
  ] }) });
@@ -17194,18 +17256,20 @@ function ThermocyclerFixture(props) {
17194
17256
  deckDefinition,
17195
17257
  handleClickRemove,
17196
17258
  fixtureLocation,
17197
- cutoutFixtureId
17259
+ cutoutFixtureId,
17260
+ selected: selected2 = false
17198
17261
  } = props;
17199
17262
  const cutoutDef = deckDefinition.locations.cutouts.find((cutout) => cutout.id === fixtureLocation);
17200
17263
  const [xSlotPosition = 0, ySlotPosition = 0] = (cutoutDef == null ? void 0 : cutoutDef.position) ?? [];
17201
17264
  const x = xSlotPosition + COLUMN_1_X_ADJUSTMENT;
17202
17265
  const y = ySlotPosition + Y_ADJUSTMENT;
17266
+ const editableStyle = selected2 ? CONFIG_STYLE_SELECTED : CONFIG_STYLE_EDITABLE;
17203
17267
  return /* @__PURE__ */ jsx(RobotCoordsForeignObject, { width: COLUMN_3_SINGLE_SLOT_FIXTURE_WIDTH, height: THERMOCYCLER_FIXTURE_HEIGHT, x, y, flexProps: {
17204
17268
  flex: "1"
17205
17269
  }, foreignObjectProps: {
17206
17270
  flex: "1"
17207
17271
  }, children: /* @__PURE__ */ jsxs(_StyledBtn, { cursor: handleClickRemove != null ? "pointer" : "default", onClick: handleClickRemove != null ? () => handleClickRemove(fixtureLocation, cutoutFixtureId) : () => {
17208
- }, $_css: handleClickRemove != null ? CONFIG_STYLE_EDITABLE : CONFIG_STYLE_READ_ONLY, children: [
17272
+ }, $_css: handleClickRemove != null ? editableStyle : CONFIG_STYLE_READ_ONLY, children: [
17209
17273
  /* @__PURE__ */ jsx(_StyledText$1, { $_css2: smallBodyTextSemiBold, children: THERMOCYCLER_FIXTURE_DISPLAY_NAME }),
17210
17274
  handleClickRemove != null ? /* @__PURE__ */ jsx(Icon, { name: "remove", color: white, size: "2rem" }) : null
17211
17275
  ] }) });
@@ -17223,96 +17287,90 @@ function DeckConfigurator(props) {
17223
17287
  deckConfig,
17224
17288
  handleClickAdd,
17225
17289
  handleClickRemove,
17290
+ additionalStaticFixtures,
17291
+ children,
17292
+ selectedCutoutId,
17226
17293
  lightFill = grey35,
17227
17294
  darkFill = black90,
17228
- readOnly = false,
17295
+ editableCutoutIds = deckConfig.map(({
17296
+ cutoutId
17297
+ }) => cutoutId),
17229
17298
  showExpansion = true,
17230
- additionalStaticFixtures,
17231
- children
17299
+ height = "455px"
17232
17300
  } = props;
17233
17301
  const deckDef = getDeckDefFromRobotType(FLEX_ROBOT_TYPE);
17234
- const configurableFixtureLocations = ["cutoutA1", "cutoutB1", "cutoutC1", "cutoutD1", "cutoutA2", "cutoutB2", "cutoutC2", "cutoutD2", "cutoutA3", "cutoutB3", "cutoutC3", "cutoutD3"];
17235
- const configurableDeckConfig = deckConfig.filter(({
17236
- cutoutId
17237
- }) => configurableFixtureLocations.includes(cutoutId));
17238
- const stagingAreaFixtures = configurableDeckConfig.filter(({
17302
+ const stagingAreaFixtures = deckConfig.filter(({
17239
17303
  cutoutFixtureId
17240
17304
  }) => cutoutFixtureId === STAGING_AREA_RIGHT_SLOT_FIXTURE);
17241
- const wasteChuteFixtures = configurableDeckConfig.filter(({
17305
+ const wasteChuteFixtures = deckConfig.filter(({
17242
17306
  cutoutFixtureId
17243
17307
  }) => cutoutFixtureId != null && WASTE_CHUTE_ONLY_FIXTURES.includes(cutoutFixtureId));
17244
- const wasteChuteStagingAreaFixtures = configurableDeckConfig.filter(({
17308
+ const wasteChuteStagingAreaFixtures = deckConfig.filter(({
17245
17309
  cutoutFixtureId
17246
17310
  }) => cutoutFixtureId != null && WASTE_CHUTE_STAGING_AREA_FIXTURES.includes(cutoutFixtureId));
17247
- const emptyFixtures = readOnly ? [] : configurableDeckConfig.filter(({
17248
- cutoutFixtureId
17249
- }) => cutoutFixtureId != null && SINGLE_SLOT_FIXTURES.includes(cutoutFixtureId));
17250
- const trashBinFixtures = configurableDeckConfig.filter(({
17311
+ const emptyCutouts = deckConfig.filter(({
17312
+ cutoutFixtureId,
17313
+ cutoutId
17314
+ }) => editableCutoutIds.includes(cutoutId) && cutoutFixtureId != null && SINGLE_SLOT_FIXTURES.includes(cutoutFixtureId));
17315
+ const trashBinFixtures = deckConfig.filter(({
17251
17316
  cutoutFixtureId
17252
17317
  }) => cutoutFixtureId === TRASH_BIN_ADAPTER_FIXTURE);
17253
- const thermocyclerFixtures = configurableDeckConfig.filter(({
17318
+ const thermocyclerFixtures = deckConfig.filter(({
17254
17319
  cutoutFixtureId
17255
17320
  }) => cutoutFixtureId === THERMOCYCLER_V2_FRONT_FIXTURE);
17256
- const heaterShakerFixtures = configurableDeckConfig.filter(({
17321
+ const heaterShakerFixtures = deckConfig.filter(({
17257
17322
  cutoutFixtureId
17258
17323
  }) => cutoutFixtureId === HEATERSHAKER_MODULE_V1_FIXTURE);
17259
- const temperatureModuleFixtures = configurableDeckConfig.filter(({
17324
+ const temperatureModuleFixtures = deckConfig.filter(({
17260
17325
  cutoutFixtureId
17261
17326
  }) => cutoutFixtureId === TEMPERATURE_MODULE_V2_FIXTURE);
17262
- const magneticBlockFixtures = configurableDeckConfig.filter(({
17327
+ const magneticBlockFixtures = deckConfig.filter(({
17263
17328
  cutoutFixtureId
17264
17329
  }) => [MAGNETIC_BLOCK_V1_FIXTURE, STAGING_AREA_SLOT_WITH_MAGNETIC_BLOCK_V1_FIXTURE].includes(cutoutFixtureId));
17265
- return /* @__PURE__ */ jsxs(
17266
- RobotCoordinateSpace,
17267
- {
17268
- height: "455px",
17269
- viewBox: `${deckDef.cornerOffsetFromOrigin[0]} ${deckDef.cornerOffsetFromOrigin[1]} ${deckDef.dimensions[0]} ${deckDef.dimensions[1]}`,
17270
- children: [
17271
- deckDef.locations.cutouts.map((cutout) => (
17272
- // give the outside of the base fixture svgs a stroke for extra spacing
17273
- /* @__PURE__ */ jsx("g", { stroke: white, strokeWidth: "4", children: /* @__PURE__ */ jsx(SingleSlotFixture, { cutoutId: cutout.id, deckDefinition: deckDef, slotClipColor: transparent, fixtureBaseColor: lightFill, showExpansion }) }, cutout.id)
17274
- )),
17275
- stagingAreaFixtures.map(({
17276
- cutoutId,
17277
- cutoutFixtureId
17278
- }) => /* @__PURE__ */ jsx(StagingAreaConfigFixture, { deckDefinition: deckDef, handleClickRemove: readOnly ? void 0 : handleClickRemove, fixtureLocation: cutoutId, cutoutFixtureId }, cutoutId)),
17279
- emptyFixtures.map(({
17280
- cutoutId
17281
- }) => /* @__PURE__ */ jsx(EmptyConfigFixture, { deckDefinition: deckDef, handleClickAdd, fixtureLocation: cutoutId }, cutoutId)),
17282
- wasteChuteFixtures.map(({
17283
- cutoutId,
17284
- cutoutFixtureId
17285
- }) => /* @__PURE__ */ jsx(WasteChuteConfigFixture, { deckDefinition: deckDef, handleClickRemove: readOnly ? void 0 : handleClickRemove, fixtureLocation: cutoutId, cutoutFixtureId }, cutoutId)),
17286
- wasteChuteStagingAreaFixtures.map(({
17287
- cutoutId,
17288
- cutoutFixtureId
17289
- }) => /* @__PURE__ */ jsx(WasteChuteConfigFixture, { deckDefinition: deckDef, handleClickRemove: readOnly ? void 0 : handleClickRemove, fixtureLocation: cutoutId, cutoutFixtureId, hasStagingAreas: true }, cutoutId)),
17290
- trashBinFixtures.map(({
17291
- cutoutId,
17292
- cutoutFixtureId
17293
- }) => /* @__PURE__ */ jsx(TrashBinConfigFixture, { deckDefinition: deckDef, handleClickRemove: readOnly ? void 0 : handleClickRemove, fixtureLocation: cutoutId, cutoutFixtureId }, cutoutId)),
17294
- temperatureModuleFixtures.map(({
17295
- cutoutId,
17296
- cutoutFixtureId
17297
- }) => /* @__PURE__ */ jsx(TemperatureModuleFixture, { deckDefinition: deckDef, handleClickRemove: readOnly ? void 0 : handleClickRemove, fixtureLocation: cutoutId, cutoutFixtureId }, cutoutId)),
17298
- heaterShakerFixtures.map(({
17299
- cutoutId,
17300
- cutoutFixtureId
17301
- }) => /* @__PURE__ */ jsx(HeaterShakerFixture, { deckDefinition: deckDef, handleClickRemove: readOnly ? void 0 : handleClickRemove, fixtureLocation: cutoutId, cutoutFixtureId }, cutoutId)),
17302
- magneticBlockFixtures.map(({
17303
- cutoutId,
17304
- cutoutFixtureId
17305
- }) => /* @__PURE__ */ jsx(MagneticBlockFixture, { deckDefinition: deckDef, handleClickRemove: readOnly ? void 0 : handleClickRemove, fixtureLocation: cutoutId, cutoutFixtureId, hasStagingArea: cutoutFixtureId === STAGING_AREA_SLOT_WITH_MAGNETIC_BLOCK_V1_FIXTURE }, cutoutId)),
17306
- thermocyclerFixtures.map(({
17307
- cutoutId,
17308
- cutoutFixtureId
17309
- }) => /* @__PURE__ */ jsx(ThermocyclerFixture, { deckDefinition: deckDef, handleClickRemove: readOnly ? void 0 : handleClickRemove, fixtureLocation: cutoutId, cutoutFixtureId }, cutoutId)),
17310
- additionalStaticFixtures == null ? void 0 : additionalStaticFixtures.map((staticFixture) => /* @__PURE__ */ jsx(StaticFixture, { deckDefinition: deckDef, label: staticFixture.label, fixtureLocation: staticFixture.location }, staticFixture.location)),
17311
- /* @__PURE__ */ jsx(SlotLabels, { robotType: FLEX_ROBOT_TYPE, color: darkFill, show4thColumn: stagingAreaFixtures.length > 0 || wasteChuteStagingAreaFixtures.length > 0 }),
17312
- children
17313
- ]
17314
- }
17315
- );
17330
+ return /* @__PURE__ */ jsxs(RobotCoordinateSpace, { height, viewBox: `${deckDef.cornerOffsetFromOrigin[0]} ${deckDef.cornerOffsetFromOrigin[1]} ${deckDef.dimensions[0]} ${deckDef.dimensions[1]}`, children: [
17331
+ deckDef.locations.cutouts.map((cutout) => (
17332
+ // give the outside of the base fixture svgs a stroke for extra spacing
17333
+ /* @__PURE__ */ jsx("g", { stroke: white, strokeWidth: "4", children: /* @__PURE__ */ jsx(SingleSlotFixture, { cutoutId: cutout.id, deckDefinition: deckDef, slotClipColor: transparent, fixtureBaseColor: lightFill, showExpansion }) }, cutout.id)
17334
+ )),
17335
+ stagingAreaFixtures.map(({
17336
+ cutoutId,
17337
+ cutoutFixtureId
17338
+ }) => /* @__PURE__ */ jsx(StagingAreaConfigFixture, { deckDefinition: deckDef, handleClickRemove: editableCutoutIds.includes(cutoutId) ? handleClickRemove : void 0, fixtureLocation: cutoutId, cutoutFixtureId, selected: cutoutId === selectedCutoutId }, cutoutId)),
17339
+ emptyCutouts.map(({
17340
+ cutoutId
17341
+ }) => /* @__PURE__ */ jsx(EmptyConfigFixture, { deckDefinition: deckDef, handleClickAdd, fixtureLocation: cutoutId }, cutoutId)),
17342
+ wasteChuteFixtures.map(({
17343
+ cutoutId,
17344
+ cutoutFixtureId
17345
+ }) => /* @__PURE__ */ jsx(WasteChuteConfigFixture, { deckDefinition: deckDef, handleClickRemove: editableCutoutIds.includes(cutoutId) ? handleClickRemove : void 0, fixtureLocation: cutoutId, cutoutFixtureId, selected: cutoutId === selectedCutoutId }, cutoutId)),
17346
+ wasteChuteStagingAreaFixtures.map(({
17347
+ cutoutId,
17348
+ cutoutFixtureId
17349
+ }) => /* @__PURE__ */ jsx(WasteChuteConfigFixture, { deckDefinition: deckDef, handleClickRemove: editableCutoutIds.includes(cutoutId) ? handleClickRemove : void 0, fixtureLocation: cutoutId, cutoutFixtureId, selected: cutoutId === selectedCutoutId, hasStagingAreas: true }, cutoutId)),
17350
+ trashBinFixtures.map(({
17351
+ cutoutId,
17352
+ cutoutFixtureId
17353
+ }) => /* @__PURE__ */ jsx(TrashBinConfigFixture, { deckDefinition: deckDef, handleClickRemove: editableCutoutIds.includes(cutoutId) ? handleClickRemove : void 0, fixtureLocation: cutoutId, cutoutFixtureId, selected: cutoutId === selectedCutoutId }, cutoutId)),
17354
+ temperatureModuleFixtures.map(({
17355
+ cutoutId,
17356
+ cutoutFixtureId
17357
+ }) => /* @__PURE__ */ jsx(TemperatureModuleFixture, { deckDefinition: deckDef, handleClickRemove: editableCutoutIds.includes(cutoutId) ? handleClickRemove : void 0, fixtureLocation: cutoutId, cutoutFixtureId, selected: cutoutId === selectedCutoutId }, cutoutId)),
17358
+ heaterShakerFixtures.map(({
17359
+ cutoutId,
17360
+ cutoutFixtureId
17361
+ }) => /* @__PURE__ */ jsx(HeaterShakerFixture, { deckDefinition: deckDef, handleClickRemove: editableCutoutIds.includes(cutoutId) ? handleClickRemove : void 0, fixtureLocation: cutoutId, cutoutFixtureId, selected: cutoutId === selectedCutoutId }, cutoutId)),
17362
+ magneticBlockFixtures.map(({
17363
+ cutoutId,
17364
+ cutoutFixtureId
17365
+ }) => /* @__PURE__ */ jsx(MagneticBlockFixture, { deckDefinition: deckDef, handleClickRemove: editableCutoutIds.includes(cutoutId) ? handleClickRemove : void 0, fixtureLocation: cutoutId, cutoutFixtureId, selected: cutoutId === selectedCutoutId, hasStagingArea: cutoutFixtureId === STAGING_AREA_SLOT_WITH_MAGNETIC_BLOCK_V1_FIXTURE }, cutoutId)),
17366
+ thermocyclerFixtures.map(({
17367
+ cutoutId,
17368
+ cutoutFixtureId
17369
+ }) => /* @__PURE__ */ jsx(ThermocyclerFixture, { deckDefinition: deckDef, handleClickRemove: editableCutoutIds.includes(cutoutId) ? handleClickRemove : void 0, fixtureLocation: cutoutId, cutoutFixtureId, selected: cutoutId === selectedCutoutId }, cutoutId)),
17370
+ additionalStaticFixtures == null ? void 0 : additionalStaticFixtures.map((staticFixture) => /* @__PURE__ */ jsx(StaticFixture, { deckDefinition: deckDef, label: staticFixture.label, fixtureLocation: staticFixture.location }, staticFixture.location)),
17371
+ /* @__PURE__ */ jsx(SlotLabels, { robotType: FLEX_ROBOT_TYPE, color: darkFill, show4thColumn: stagingAreaFixtures.length > 0 || wasteChuteStagingAreaFixtures.length > 0 }),
17372
+ children
17373
+ ] });
17316
17374
  }
17317
17375
  const OT2_FIXED_TRASH_X_DIMENSION = 172.86;
17318
17376
  const OT2_FIXED_TRASH_Y_DIMENSION = 165.86;
@@ -18682,14 +18740,15 @@ var _StyledStyledText = _styled(StyledText).withConfig({
18682
18740
  const StepMeter = (props) => {
18683
18741
  const {
18684
18742
  totalSteps,
18685
- currentStep
18743
+ currentStep,
18744
+ ...styleProps2
18686
18745
  } = props;
18687
18746
  const progress = currentStep != null ? currentStep : 0;
18688
18747
  const percentComplete = `${// this logic puts a cap at 100% percentComplete which we should never run into
18689
18748
  currentStep != null && currentStep > totalSteps ? 100 : progress / totalSteps * 100}%`;
18690
- const StepMeterContainer = css(["position:", ";height:", ";background-color:", ";@media ", "{height:", ";}"], POSITION_RELATIVE, spacing4, grey30, touchscreenMediaQuerySpecs, spacing12);
18749
+ const StepMeterContainer = css(["position:", ";height:", ";background-color:", ";@media ", "{height:", ";}"], styleProps2.position ? styleProps2.position : POSITION_RELATIVE, spacing4, grey30, touchscreenMediaQuerySpecs, spacing12);
18691
18750
  const StepMeterBar = css(["position:", ";top:0;height:100%;background-color:", ";width:", ";webkit-transition:width 0.5s ease-in-out;moz-transition:width 0.5s ease-in-out;o-transition:width 0.5s ease-in-out;transition:width 0.5s ease-in-out;"], POSITION_ABSOLUTE, blue50, percentComplete);
18692
- return /* @__PURE__ */ jsx(_StyledBox, { "data-testid": "StepMeter_StepMeterContainer", $_css: StepMeterContainer, children: /* @__PURE__ */ jsx(_StyledBox2, { "data-testid": "StepMeter_StepMeterBar", $_css2: StepMeterBar }) });
18751
+ return /* @__PURE__ */ jsx(_StyledBox, { "data-testid": "StepMeter_StepMeterContainer", ...styleProps2, $_css: StepMeterContainer, children: /* @__PURE__ */ jsx(_StyledBox2, { "data-testid": "StepMeter_StepMeterBar", $_css2: StepMeterBar }) });
18693
18752
  };
18694
18753
  var _StyledBox = _styled(Box).withConfig({
18695
18754
  displayName: "StepMeter___StyledBox",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentrons/components",
3
- "version": "0.1.6-alpha.2",
3
+ "version": "0.1.6-alpha.5",
4
4
  "description": "React components library for Opentrons' projects",
5
5
  "source": "src/index.ts",
6
6
  "types": "lib/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "@types/react-router-dom": "5.3.3"
25
25
  },
26
26
  "dependencies": {
27
- "@opentrons/shared-data": "0.1.6-alpha.2",
27
+ "@opentrons/shared-data": "0.1.6-alpha.5",
28
28
  "@popperjs/core": "2.1.1",
29
29
  "@react-spring/types": "9.6.1",
30
30
  "@react-spring/web": "9.6.1",