@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.
Files changed (251) hide show
  1. package/cssModuleSideEffect.ts +22 -0
  2. package/lib/assets/localization/en/index.d.ts +12 -0
  3. package/lib/assets/localization/index.d.ts +12 -0
  4. package/lib/atoms/AnimationVideo/index.d.ts +13 -0
  5. package/lib/atoms/InlineNotification/index.d.ts +1 -1
  6. package/lib/atoms/ListButton/ListButtonChildren/index.d.ts +0 -1
  7. package/lib/atoms/StyledText/PlaceholderStyledText.d.ts +14 -0
  8. package/lib/atoms/StyledText/index.d.ts +1 -0
  9. package/lib/atoms/buttons/BasicButton.d.ts +12 -0
  10. package/lib/atoms/buttons/index.d.ts +1 -0
  11. package/lib/atoms/index.d.ts +1 -0
  12. package/lib/hardware-sim/BaseDeck/BaseDeck.d.ts +10 -8
  13. package/lib/hardware-sim/Deck/FlexTrash.d.ts +4 -1
  14. package/lib/hardware-sim/Deck/MoveLabwareOnDeck.d.ts +3 -2
  15. package/lib/hardware-sim/Deck/RobotCoordsForeignDiv.d.ts +6 -5
  16. package/lib/hardware-sim/Deck/RobotCoordsForeignObject.d.ts +8 -5
  17. package/lib/hardware-sim/Deck/RobotCoordsText.d.ts +11 -1
  18. package/lib/hardware-sim/Deck/RobotWorkSpace.d.ts +30 -14
  19. package/lib/hardware-sim/Deck/__tests__/resolveLabwareLocation.test.d.ts +1 -0
  20. package/lib/hardware-sim/Deck/resolveLabwareLocation.d.ts +20 -0
  21. package/lib/hardware-sim/DeckConfigurator/AbsorbanceReaderItem.d.ts +11 -0
  22. package/lib/hardware-sim/DeckConfigurator/EmptyConfigItem.d.ts +11 -0
  23. package/lib/hardware-sim/DeckConfigurator/FlexStackerItem.d.ts +12 -0
  24. package/lib/hardware-sim/DeckConfigurator/HeaterShakerItem.d.ts +11 -0
  25. package/lib/hardware-sim/DeckConfigurator/MagneticBlockItem.d.ts +12 -0
  26. package/lib/hardware-sim/DeckConfigurator/StagingAreaConfigItem.d.ts +11 -0
  27. package/lib/hardware-sim/DeckConfigurator/{StaticFixture.d.ts → StaticItem.d.ts} +1 -1
  28. package/lib/hardware-sim/DeckConfigurator/TemperatureModuleItem.d.ts +11 -0
  29. package/lib/hardware-sim/DeckConfigurator/ThermocyclerItem.d.ts +11 -0
  30. package/lib/hardware-sim/DeckConfigurator/TrashBinConfigItem.d.ts +11 -0
  31. package/lib/hardware-sim/DeckConfigurator/WasteChuteConfigItem.d.ts +11 -0
  32. package/lib/hardware-sim/DeckConfigurator/constants.d.ts +5 -8
  33. package/lib/hardware-sim/DeckConfigurator/index.d.ts +4 -3
  34. package/lib/hardware-sim/Labware/CalibrationBlockRender.d.ts +15 -0
  35. package/lib/hardware-sim/Labware/Labware.d.ts +7 -8
  36. package/lib/hardware-sim/Labware/LabwareAdapter/index.d.ts +2 -2
  37. package/lib/hardware-sim/Labware/LabwareRender.d.ts +46 -5
  38. package/lib/hardware-sim/Labware/index.d.ts +1 -0
  39. package/lib/hardware-sim/Labware/labwareInternals/FilledWells.d.ts +3 -4
  40. package/lib/hardware-sim/Labware/labwareInternals/LabwareOutline.d.ts +20 -9
  41. package/lib/hardware-sim/Labware/labwareInternals/LabwareWellLabels.d.ts +2 -2
  42. package/lib/hardware-sim/Labware/labwareInternals/StaticLabware.d.ts +2 -2
  43. package/lib/hardware-sim/Labware/labwareInternals/StrokedWells.d.ts +2 -2
  44. package/lib/hardware-sim/Labware/labwareInternals/StyledWells.d.ts +2 -2
  45. package/lib/hardware-sim/Labware/labwareInternals/Well.d.ts +1 -2
  46. package/lib/hardware-sim/Labware/labwareInternals/WellLabels.d.ts +2 -2
  47. package/lib/hardware-sim/Module/index.d.ts +24 -2
  48. package/lib/hardware-sim/Pipette/PipetteRender.d.ts +2 -2
  49. package/lib/hardware-sim/RobotCoordinateSpace/RobotCoordinateSpace.d.ts +5 -3
  50. package/lib/hocs/withStyleProps.d.ts +26 -0
  51. package/lib/hooks/useConditionalConfirm.d.ts +4 -0
  52. package/lib/icons/Icon.d.ts +7 -7
  53. package/lib/icons/ModuleIcon.d.ts +4 -3
  54. package/lib/instrument/index.d.ts +0 -2
  55. package/lib/legacy-hardware-sim/index.d.ts +0 -1
  56. package/lib/lists/index.d.ts +0 -1
  57. package/lib/molecules/CustomizeExpandButton/__tests__/CustomizeExpandButton.test.d.ts +1 -0
  58. package/lib/molecules/CustomizeExpandButton/index.d.ts +29 -0
  59. package/lib/molecules/DeckInfoLabel/index.d.ts +8 -16
  60. package/lib/molecules/index.d.ts +2 -1
  61. package/lib/organisms/CommandText/index.d.ts +2 -2
  62. package/lib/organisms/CommandText/useCommandTextString/index.d.ts +2 -2
  63. package/lib/organisms/CommandText/useCommandTextString/utils/getLabwareDefinitionsFromCommands.d.ts +2 -2
  64. package/lib/organisms/CommandText/useCommandTextString/utils/getLabwareLocation.d.ts +3 -3
  65. package/lib/organisms/CommandText/useCommandTextString/utils/getLabwareName.d.ts +2 -2
  66. package/lib/organisms/FixtureOption/index.d.ts +2 -2
  67. package/lib/organisms/ProtocolDeck/index.d.ts +10 -0
  68. package/lib/organisms/ProtocolTimelineScrubber/CommandItem.d.ts +2 -2
  69. package/lib/organisms/ProtocolTimelineScrubber/utils.d.ts +2 -2
  70. package/lib/organisms/index.d.ts +1 -0
  71. package/lib/primitives/ForeignObject.d.ts +8 -18
  72. package/lib/primitives/style-props.d.ts +1 -1
  73. package/lib/structure/index.d.ts +2 -3
  74. package/package.json +6 -3
  75. package/src/alerts/alerts.module.css +2 -2
  76. package/src/assets/localization/en/deck_configuration.json +12 -0
  77. package/src/assets/localization/en/index.ts +2 -0
  78. package/src/assets/localization/en/protocol_command_text.json +1 -1
  79. package/src/atoms/AnimationVideo/__tests__/AnimationVideo.test.tsx +40 -0
  80. package/src/atoms/AnimationVideo/index.tsx +44 -0
  81. package/src/atoms/CheckboxField/__tests__/CheckboxField.test.tsx +0 -3
  82. package/src/atoms/CheckboxField/index.tsx +1 -1
  83. package/src/atoms/InlineNotification/index.tsx +86 -70
  84. package/src/atoms/ListButton/ListButton.stories.tsx +21 -7
  85. package/src/atoms/ListButton/ListButtonChildren/index.ts +0 -1
  86. package/src/atoms/ListItem/ListItemChildren/ListItemDescriptor.tsx +2 -2
  87. package/src/atoms/MenuList/OverflowBtn.tsx +39 -41
  88. package/src/atoms/Snackbar/Snackbar.stories.tsx +59 -23
  89. package/src/atoms/Snackbar/index.tsx +48 -38
  90. package/src/atoms/StyledText/PlaceholderStyledText.tsx +46 -0
  91. package/src/atoms/StyledText/index.ts +1 -0
  92. package/src/atoms/StyledText/placeholderstyledtext.module.css +25 -0
  93. package/src/atoms/buttons/BasicButton.tsx +100 -0
  94. package/src/atoms/buttons/SecondaryButton.tsx +5 -2
  95. package/src/atoms/buttons/__tests__/BasicButton.test.tsx +87 -0
  96. package/src/atoms/buttons/buttons.stories.tsx +91 -55
  97. package/src/atoms/buttons/index.ts +1 -0
  98. package/src/atoms/index.ts +1 -0
  99. package/src/buttons/buttons.module.css +92 -92
  100. package/src/controls/styles.module.css +15 -15
  101. package/src/forms/Select.module.css +23 -23
  102. package/src/forms/forms.module.css +38 -37
  103. package/src/hardware-sim/BaseDeck/BaseDeck.stories.tsx +7 -7
  104. package/src/hardware-sim/BaseDeck/BaseDeck.tsx +98 -61
  105. package/src/hardware-sim/BaseDeck/WasteChuteFixture.tsx +22 -28
  106. package/src/hardware-sim/BaseDeck/basedeck.module.css +20 -0
  107. package/src/hardware-sim/Deck/FlexTrash.tsx +50 -30
  108. package/src/hardware-sim/Deck/MoveLabwareOnDeck.stories.tsx +2 -2
  109. package/src/hardware-sim/Deck/MoveLabwareOnDeck.tsx +122 -156
  110. package/src/hardware-sim/Deck/RobotCoordsForeignDiv.tsx +35 -27
  111. package/src/hardware-sim/Deck/RobotCoordsForeignObject.tsx +32 -29
  112. package/src/hardware-sim/Deck/RobotCoordsText.tsx +12 -11
  113. package/src/hardware-sim/Deck/RobotWorkSpace.tsx +74 -54
  114. package/src/hardware-sim/Deck/SlotLabels.tsx +51 -51
  115. package/src/hardware-sim/Deck/__tests__/resolveLabwareLocation.test.ts +138 -0
  116. package/src/hardware-sim/Deck/deck.module.css +54 -0
  117. package/src/hardware-sim/Deck/resolveLabwareLocation.ts +154 -0
  118. package/src/hardware-sim/DeckConfigurator/{FlexStackerFixture.tsx → AbsorbanceReaderItem.tsx} +34 -31
  119. package/src/hardware-sim/DeckConfigurator/{EmptyConfigFixture.tsx → EmptyConfigItem.tsx} +72 -44
  120. package/src/hardware-sim/DeckConfigurator/{AbsorbanceReaderFixture.tsx → FlexStackerItem.tsx} +46 -27
  121. package/src/hardware-sim/DeckConfigurator/{HeaterShakerFixture.tsx → HeaterShakerItem.tsx} +40 -28
  122. package/src/hardware-sim/DeckConfigurator/{MagneticBlockFixture.tsx → MagneticBlockItem.tsx} +41 -58
  123. package/src/hardware-sim/DeckConfigurator/{StagingAreaConfigFixture.tsx → StagingAreaConfigItem.tsx} +41 -23
  124. package/src/hardware-sim/DeckConfigurator/{StaticFixture.tsx → StaticItem.tsx} +16 -9
  125. package/src/hardware-sim/DeckConfigurator/{TemperatureModuleFixture.tsx → TemperatureModuleItem.tsx} +42 -26
  126. package/src/hardware-sim/DeckConfigurator/{ThermocyclerFixture.tsx → ThermocyclerItem.tsx} +31 -21
  127. package/src/hardware-sim/DeckConfigurator/{TrashBinConfigFixture.tsx → TrashBinConfigItem.tsx} +42 -27
  128. package/src/hardware-sim/DeckConfigurator/{WasteChuteConfigFixture.tsx → WasteChuteConfigItem.tsx} +38 -27
  129. package/src/hardware-sim/DeckConfigurator/constants.ts +5 -9
  130. package/src/hardware-sim/DeckConfigurator/index.tsx +236 -206
  131. package/src/hardware-sim/Labware/CalibrationBlockRender.stories.tsx +49 -0
  132. package/src/hardware-sim/Labware/CalibrationBlockRender.tsx +172 -0
  133. package/src/hardware-sim/Labware/Labware.tsx +30 -15
  134. package/src/hardware-sim/Labware/LabwareAdapter/index.tsx +2 -2
  135. package/src/hardware-sim/Labware/LabwareRender.stories.tsx +36 -21
  136. package/src/hardware-sim/Labware/LabwareRender.tsx +70 -15
  137. package/src/hardware-sim/Labware/__tests__/Labware.test.tsx +9 -4
  138. package/src/hardware-sim/Labware/__tests__/LabwareRender.test.tsx +14 -5
  139. package/src/hardware-sim/Labware/index.ts +1 -0
  140. package/src/hardware-sim/Labware/labware.module.css +8 -0
  141. package/src/hardware-sim/Labware/labwareInternals/FilledWells.tsx +3 -4
  142. package/src/hardware-sim/Labware/labwareInternals/LabwareOutline.tsx +48 -23
  143. package/src/hardware-sim/Labware/labwareInternals/LabwareWellLabels.tsx +3 -3
  144. package/src/hardware-sim/Labware/labwareInternals/StaticLabware.tsx +2 -2
  145. package/src/hardware-sim/Labware/labwareInternals/StrokedWells.tsx +2 -2
  146. package/src/hardware-sim/Labware/labwareInternals/StyledWells.tsx +2 -2
  147. package/src/hardware-sim/Labware/labwareInternals/Well.tsx +1 -2
  148. package/src/hardware-sim/Labware/labwareInternals/WellLabels.tsx +10 -11
  149. package/src/hardware-sim/Labware/labwareInternals/__tests__/LabwareWellLabels.test.tsx +2 -2
  150. package/src/hardware-sim/Labware/labwareInternals/__tests__/StrokedWells.test.tsx +2 -2
  151. package/src/hardware-sim/Labware/labwareInternals/__tests__/WellLabels.test.tsx +2 -2
  152. package/src/hardware-sim/Module/Module.stories.tsx +45 -15
  153. package/src/hardware-sim/Module/Thermocycler/index.tsx +2 -2
  154. package/src/hardware-sim/Module/index.tsx +41 -18
  155. package/src/hardware-sim/Pipette/PipetteRender.stories.tsx +2 -2
  156. package/src/hardware-sim/Pipette/PipetteRender.tsx +5 -7
  157. package/src/hardware-sim/Pipette/__tests__/PipetteRender.test.tsx +2 -2
  158. package/src/hardware-sim/RobotCoordinateSpace/RobotCoordinateSpace.tsx +15 -14
  159. package/src/hardware-sim/RobotCoordinateSpace/robotcoordinatespace.module.css +3 -0
  160. package/src/hocs/withStyleProps.ts +53 -0
  161. package/src/hooks/useConditionalConfirm.ts +15 -5
  162. package/src/icons/Icon.tsx +38 -29
  163. package/src/icons/ModuleIcon.tsx +5 -3
  164. package/src/icons/icon-data.ts +26 -2
  165. package/src/icons/icon.module.css +10 -0
  166. package/src/index.module.css +1 -0
  167. package/src/instrument/InstrumentDiagram.tsx +0 -2
  168. package/src/instrument/PipetteSelect.module.css +3 -3
  169. package/src/instrument/index.ts +0 -2
  170. package/src/legacy-hardware-sim/LabwareNameOverlay.module.css +5 -5
  171. package/src/legacy-hardware-sim/ModuleItem.module.css +19 -19
  172. package/src/legacy-hardware-sim/index.ts +0 -1
  173. package/src/lists/index.ts +0 -1
  174. package/src/lists/lists.module.css +23 -23
  175. package/src/modals/modals.module.css +55 -55
  176. package/src/molecules/CustomizeExpandButton/__tests__/CustomizeExpandButton.test.tsx +88 -0
  177. package/src/molecules/CustomizeExpandButton/index.tsx +189 -0
  178. package/src/molecules/DeckInfoLabel/DeckInfoLabel.stories.tsx +10 -6
  179. package/src/molecules/DeckInfoLabel/__tests__/DeckInfoLabel.test.tsx +15 -11
  180. package/src/molecules/DeckInfoLabel/deckinfolabel.module.css +42 -0
  181. package/src/molecules/DeckInfoLabel/index.tsx +36 -62
  182. package/src/molecules/DropdownMenu/index.tsx +17 -13
  183. package/src/molecules/InfoScreen/index.tsx +6 -2
  184. package/src/molecules/ReleaseNotes/styles.module.css +15 -15
  185. package/src/molecules/index.ts +2 -1
  186. package/src/nav/SidePanel.module.css +6 -6
  187. package/src/organisms/CommandText/__tests__/CommandText.test.tsx +12 -12
  188. package/src/organisms/CommandText/index.tsx +2 -2
  189. package/src/organisms/CommandText/useCommandTextString/index.ts +2 -2
  190. package/src/organisms/CommandText/useCommandTextString/utils/__tests__/getFinalLabwareLocation.test.ts +4 -4
  191. package/src/organisms/CommandText/useCommandTextString/utils/commandText/__tests__/getPipettingCommandText.test.tsx +3 -3
  192. package/src/organisms/CommandText/useCommandTextString/utils/commandText/getFlexStackerCommandText.ts +2 -4
  193. package/src/organisms/CommandText/useCommandTextString/utils/commandText/getMoveToWellCommandText.ts +19 -3
  194. package/src/organisms/CommandText/useCommandTextString/utils/commandText/getPipettingCommandText.ts +19 -10
  195. package/src/organisms/CommandText/useCommandTextString/utils/getLabwareDefinitionsFromCommands.ts +9 -9
  196. package/src/organisms/CommandText/useCommandTextString/utils/getLabwareLocation.tsx +3 -3
  197. package/src/organisms/CommandText/useCommandTextString/utils/getLabwareName.ts +2 -2
  198. package/src/organisms/DeckLabelSet/index.tsx +1 -3
  199. package/src/organisms/FixtureOption/__tests__/FixtureOption.test.tsx +0 -2
  200. package/src/organisms/FixtureOption/index.tsx +42 -71
  201. package/src/organisms/ProtocolDeck/index.tsx +118 -0
  202. package/src/organisms/ProtocolTimelineScrubber/CommandItem.tsx +2 -2
  203. package/src/organisms/ProtocolTimelineScrubber/PipetteVisuals.tsx +1 -1
  204. package/src/organisms/ProtocolTimelineScrubber/utils.ts +3 -3
  205. package/src/organisms/index.ts +1 -0
  206. package/src/primitives/ForeignObject.tsx +20 -61
  207. package/src/primitives/style-props.ts +1 -0
  208. package/src/slotmap/styles.module.css +1 -1
  209. package/src/structure/Pill.module.css +1 -1
  210. package/src/structure/Splash.module.css +1 -1
  211. package/src/structure/index.ts +2 -4
  212. package/src/structure/structure.module.css +11 -11
  213. package/src/styles/colors.module.css +1 -0
  214. package/src/styles/global.css +179 -0
  215. package/src/styles/index.module.css +1 -1
  216. package/src/styles/typography.module.css +1 -0
  217. package/src/testing/utils/renderWithProviders.tsx +3 -6
  218. package/src/tooltips/tooltips.module.css +14 -14
  219. package/vite.config.mts +6 -3
  220. package/lib/atoms/ListButton/ListButtonChildren/ListButtonRadioButton.d.ts +0 -14
  221. package/lib/hardware-sim/DeckConfigurator/AbsorbanceReaderFixture.d.ts +0 -10
  222. package/lib/hardware-sim/DeckConfigurator/EmptyConfigFixture.d.ts +0 -8
  223. package/lib/hardware-sim/DeckConfigurator/FlexStackerFixture.d.ts +0 -11
  224. package/lib/hardware-sim/DeckConfigurator/HeaterShakerFixture.d.ts +0 -10
  225. package/lib/hardware-sim/DeckConfigurator/MagneticBlockFixture.d.ts +0 -11
  226. package/lib/hardware-sim/DeckConfigurator/StagingAreaConfigFixture.d.ts +0 -10
  227. package/lib/hardware-sim/DeckConfigurator/TemperatureModuleFixture.d.ts +0 -10
  228. package/lib/hardware-sim/DeckConfigurator/ThermocyclerFixture.d.ts +0 -10
  229. package/lib/hardware-sim/DeckConfigurator/TrashBinConfigFixture.d.ts +0 -10
  230. package/lib/hardware-sim/DeckConfigurator/WasteChuteConfigFixture.d.ts +0 -11
  231. package/lib/hardware-sim/utils.d.ts +0 -3
  232. package/lib/instrument/InstrumentGroup.d.ts +0 -11
  233. package/lib/instrument/InstrumentInfo.d.ts +0 -18
  234. package/lib/legacy-hardware-sim/ModuleItem.d.ts +0 -17
  235. package/lib/lists/TitledList.d.ts +0 -44
  236. package/lib/structure/Card.d.ts +0 -18
  237. package/src/atoms/ListButton/ListButtonChildren/ListButtonRadioButton.tsx +0 -109
  238. package/src/atoms/ListButton/__tests__/ListButtonRadioButton.test.tsx +0 -28
  239. package/src/hardware-sim/utils.ts +0 -18
  240. package/src/instrument/InstrumentDiagram.stories.tsx +0 -43
  241. package/src/instrument/InstrumentGroup.stories.tsx +0 -89
  242. package/src/instrument/InstrumentGroup.tsx +0 -35
  243. package/src/instrument/InstrumentInfo.tsx +0 -106
  244. package/src/instrument/__tests__/InstrumentInfo.test.tsx +0 -58
  245. package/src/instrument/instrument.module.css +0 -45
  246. package/src/legacy-hardware-sim/ModuleItem.tsx +0 -145
  247. package/src/lists/TitledList.tsx +0 -154
  248. package/src/structure/Card.stories.tsx +0 -29
  249. package/src/structure/Card.tsx +0 -65
  250. /package/lib/atoms/{ListButton/__tests__/ListButtonRadioButton.test.d.ts → AnimationVideo/__tests__/AnimationVideo.test.d.ts} +0 -0
  251. /package/lib/{instrument/__tests__/InstrumentInfo.test.d.ts → atoms/buttons/__tests__/BasicButton.test.d.ts} +0 -0
@@ -13,10 +13,10 @@
13
13
  background-color: transparent;
14
14
 
15
15
  & * {
16
+ background-color: transparent;
16
17
  color: var(--c-font-disabled);
17
- outline-color: #eee;
18
18
  fill: var(--c-font-disabled);
19
- background-color: transparent;
19
+ outline-color: #eee;
20
20
  }
21
21
  }
22
22
 
@@ -35,10 +35,10 @@
35
35
  }
36
36
 
37
37
  .header_text {
38
- text-transform: uppercase;
38
+ color: var(--c-font-disabled);
39
39
  font-size: var(--fs-caption);
40
40
  font-weight: var(--fw-semibold);
41
- color: var(--c-font-disabled);
41
+ text-transform: uppercase;
42
42
  }
43
43
 
44
44
  /*
@@ -50,19 +50,19 @@
50
50
  .title_bar {
51
51
  position: relative;
52
52
  display: flex;
53
- text-decoration: none;
54
- padding: var(--list-padding-large) var(--list-padding-small);
55
53
  flex-direction: column;
54
+ padding: var(--list-padding-large) var(--list-padding-small);
55
+ text-decoration: none;
56
56
  }
57
57
 
58
58
  /* Specifically for TitledList */
59
59
  .titled_list_title_bar {
60
60
  position: relative;
61
61
  display: flex;
62
- text-decoration: none;
63
- padding: var(--list-padding-large) var(--list-padding-small);
64
62
  flex-direction: row;
65
63
  align-items: center;
64
+ padding: var(--list-padding-large) var(--list-padding-small);
65
+ text-decoration: none;
66
66
  }
67
67
 
68
68
  .titled_list_selected {
@@ -77,9 +77,9 @@
77
77
  }
78
78
 
79
79
  .title {
80
+ margin: 0;
80
81
  font-size: var(--fs-body-2);
81
82
  font-weight: var(--fw-regular);
82
- margin: 0;
83
83
  text-transform: uppercase;
84
84
  }
85
85
 
@@ -92,8 +92,8 @@
92
92
  }
93
93
 
94
94
  .title_bar_icon {
95
- color: var(--c-font-dark);
96
95
  height: 1.5rem;
96
+ color: var(--c-font-dark);
97
97
  }
98
98
 
99
99
  .title_bar_error {
@@ -101,8 +101,8 @@
101
101
  }
102
102
 
103
103
  .icon_left_of_title {
104
- margin-right: 0.5rem;
105
104
  height: 1.2rem;
105
+ margin-right: 0.5rem;
106
106
  }
107
107
 
108
108
  .icon_left_of_title_container {
@@ -113,8 +113,8 @@
113
113
  .title_bar_carat {
114
114
  position: absolute;
115
115
  top: 0;
116
- bottom: 0;
117
116
  right: 0;
117
+ bottom: 0;
118
118
  padding: calc(var(--list-padding-small) - var(--bd-width-default));
119
119
  padding-top: 1rem;
120
120
 
@@ -124,22 +124,22 @@
124
124
  }
125
125
 
126
126
  .list {
127
- list-style-type: none;
128
127
  padding-left: 0;
129
128
  margin: 0;
129
+ list-style-type: none;
130
130
  }
131
131
 
132
132
  .list_item {
133
- font-size: var(--fs-body-1); /* from legacy --font-body-1-dark */
134
- font-weight: var(--fw-regular); /* from legacy --font-body-1-dark */
135
- color: var(--c-font-dark); /* from legacy --font-body-1-dark */
136
133
  display: flex;
134
+ width: 100%;
137
135
  flex-direction: row;
138
136
  align-items: center;
139
- width: 100%;
140
- line-height: 1.25;
141
- margin: 0;
142
137
  padding: var(--list-padding-small);
138
+ margin: 0;
139
+ color: var(--c-font-dark); /* from legacy --font-body-1-dark */
140
+ font-size: var(--fs-body-1); /* from legacy --font-body-1-dark */
141
+ font-weight: var(--fw-regular); /* from legacy --font-body-1-dark */
142
+ line-height: 1.25;
143
143
 
144
144
  &:hover {
145
145
  background-color: var(--c-bg-hover);
@@ -155,17 +155,17 @@ a.list_item {
155
155
  }
156
156
 
157
157
  .list_alert {
158
- font-size: var(--fs-body-1); /* from legacy --font-body-1-dark */
159
- font-weight: var(--fw-regular); /* from legacy --font-body-1-dark */
160
- color: var(--c-font-dark); /* from legacy --font-body-1-dark */
161
158
  width: 100%;
162
159
  padding: var(--list-padding-small);
163
160
  background-color: var(--c-bg-light);
161
+ color: var(--c-font-dark); /* from legacy --font-body-1-dark */
162
+ font-size: var(--fs-body-1); /* from legacy --font-body-1-dark */
164
163
  font-style: italic;
164
+ font-weight: var(--fw-regular); /* from legacy --font-body-1-dark */
165
165
  }
166
166
 
167
167
  .item_icon {
168
- flex: none;
169
168
  height: calc(1.25 * var(--fs-body-1));
169
+ flex: none;
170
170
  margin-right: 0.5rem;
171
171
  }
@@ -2,6 +2,9 @@
2
2
  @import '../index.module.css';
3
3
 
4
4
  .modal {
5
+ position: fixed;
6
+ z-index: 1;
7
+
5
8
  /* from legacy --absolute-fill */
6
9
  top: 0;
7
10
 
@@ -17,17 +20,15 @@
17
20
  /* from legacy --absolute-fill */
18
21
  display: flex;
19
22
 
20
- /* from legacy --center-children */
21
- justify-content: center;
22
-
23
23
  /* from legacy --center-children */
24
24
  align-items: center;
25
25
 
26
26
  /* from legacy --center-children */
27
27
 
28
28
  align-items: flex-start;
29
- position: fixed;
30
- z-index: 1;
29
+
30
+ /* from legacy --center-children */
31
+ justify-content: center;
31
32
  padding: 4rem;
32
33
  }
33
34
 
@@ -51,14 +52,14 @@
51
52
  display: flex;
52
53
 
53
54
  /* from legacy --flex-start */
54
- justify-content: flex-start;
55
+
56
+ flex-direction: column;
55
57
 
56
58
  /* from legacy --flex-start */
57
59
  align-items: center;
58
60
 
59
61
  /* from legacy --flex-start */
60
-
61
- flex-direction: column;
62
+ justify-content: flex-start;
62
63
  padding: 4.5rem 3rem 1rem 3rem;
63
64
  }
64
65
 
@@ -84,11 +85,11 @@
84
85
 
85
86
  .title_bar {
86
87
  position: absolute;
88
+ z-index: 3;
87
89
  top: 0;
88
- left: 0;
89
90
  right: 0;
91
+ left: 0;
90
92
  width: 100%;
91
- z-index: 3;
92
93
  }
93
94
 
94
95
  .modal_contents {
@@ -100,15 +101,15 @@
100
101
  /* from legacy --modal-contents */
101
102
  max-width: 38rem;
102
103
 
103
- /* from legacy --modal-contents */
104
- margin: 0 auto;
105
-
106
104
  /* from legacy --modal-contents */
107
105
  padding: 1rem;
108
106
 
109
107
  /* from legacy --modal-contents */
110
108
  border-radius: 0.5rem;
111
109
 
110
+ /* from legacy --modal-contents */
111
+ margin: 0 auto;
112
+
112
113
  /* from legacy --modal-contents */
113
114
 
114
115
  background-color: white;
@@ -122,37 +123,36 @@
122
123
 
123
124
  /* from legacy --modal-contents */
124
125
  max-width: 38rem;
125
-
126
- /* from legacy --modal-contents */
127
- margin: 0 auto;
126
+ max-height: 100%;
128
127
 
129
128
  /* from legacy --modal-contents */
130
129
  padding: 1rem;
130
+ padding-top: 1rem;
131
131
 
132
132
  /* from legacy --modal-contents */
133
133
  border-radius: 0.5rem;
134
134
 
135
+ /* from legacy --modal-contents */
136
+ margin: 0 auto;
137
+
135
138
  /* from legacy --modal-contents */
136
139
 
137
140
  background-color: white;
138
- max-height: 100%;
139
141
  overflow-y: auto;
140
- padding-top: 1rem;
141
142
  }
142
143
 
143
144
  .modal_heading {
144
- font-size: var(--fs-header);
145
-
146
145
  /* from legacy --font-header-dark */
147
- font-weight: var(--fw-semibold);
146
+
147
+ margin-top: 0;
148
+ margin-bottom: 1rem;
148
149
 
149
150
  /* from legacy --font-header-dark */
150
151
  color: var(--c-font-dark);
152
+ font-size: var(--fs-header);
151
153
 
152
154
  /* from legacy --font-header-dark */
153
-
154
- margin-top: 0;
155
- margin-bottom: 1rem;
155
+ font-weight: var(--fw-semibold);
156
156
  text-transform: capitalize;
157
157
  }
158
158
 
@@ -172,36 +172,37 @@
172
172
  }
173
173
 
174
174
  .spinner_modal_contents {
175
+ z-index: 4;
176
+
175
177
  /* from legacy --modal-contents */
176
178
  width: 100%;
177
179
 
178
- /* from legacy --modal-contents */
179
- margin: 0 auto;
180
+ /* from legacy --font-body-2-light */
181
+
182
+ max-width: 30rem;
183
+ flex-direction: column;
180
184
 
181
185
  /* from legacy --modal-contents */
182
186
  padding: 1rem;
187
+ padding-top: 3rem;
183
188
 
184
189
  /* from legacy --modal-contents */
185
190
  border-radius: 0.5rem;
186
191
 
187
192
  /* from legacy --modal-contents */
188
- font-size: var(--fs-body-2);
189
-
190
- /* from legacy --font-body-2-light */
191
- font-weight: var(--fw-regular);
193
+ margin: 0 auto;
194
+ background-color: transparent;
192
195
 
193
196
  /* from legacy --font-body-2-light */
194
197
  color: var(--c-font-light);
195
198
 
196
- /* from legacy --font-body-2-light */
197
-
198
- max-width: 30rem;
199
- padding-top: 3rem;
200
- background-color: transparent;
201
- flex-direction: column;
199
+ /* from legacy --modal-contents */
200
+ font-size: var(--fs-body-2);
202
201
  font-style: italic;
202
+
203
+ /* from legacy --font-body-2-light */
204
+ font-weight: var(--fw-regular);
203
205
  text-align: center;
204
- z-index: 4;
205
206
  }
206
207
 
207
208
  .spinner_modal_icon {
@@ -222,19 +223,18 @@
222
223
  }
223
224
 
224
225
  .alert_modal_contents {
225
- font-size: var(--fs-body-2);
226
-
227
226
  /* from legacy --font-body-2-dark */
228
- font-weight: var(--fw-regular);
227
+
228
+ width: 100%;
229
+ max-height: 100%;
230
+ padding: 1rem;
229
231
 
230
232
  /* from legacy --font-body-2-dark */
231
233
  color: var(--c-font-dark);
234
+ font-size: var(--fs-body-2);
232
235
 
233
236
  /* from legacy --font-body-2-dark */
234
-
235
- width: 100%;
236
- max-height: 100%;
237
- padding: 1rem;
237
+ font-weight: var(--fw-regular);
238
238
 
239
239
  & > p {
240
240
  padding-bottom: 1rem;
@@ -242,22 +242,22 @@
242
242
  }
243
243
 
244
244
  .alert_modal_heading {
245
- font-size: var(--fs-header);
246
-
247
- /* from legacy --font-header-dark */
248
- color: var(--c-font-dark);
249
-
250
- /* from legacy --font-header-dark */
251
-
252
- font-weight: normal;
253
245
  position: absolute;
254
246
  top: 0;
255
- left: 0;
256
247
  right: 0;
248
+ left: 0;
257
249
  display: flex;
258
250
  align-items: center;
259
251
  padding: 1rem;
260
252
  background-color: #e0e0e0;
253
+
254
+ /* from legacy --font-header-dark */
255
+ color: var(--c-font-dark);
256
+ font-size: var(--fs-header);
257
+
258
+ /* from legacy --font-header-dark */
259
+
260
+ font-weight: normal;
261
261
  }
262
262
 
263
263
  .alert_modal_icon {
@@ -266,10 +266,10 @@
266
266
  }
267
267
 
268
268
  .alert_modal_buttons {
269
- float: right;
270
269
  margin-top: 1rem;
270
+ float: right;
271
271
  }
272
272
 
273
273
  .alert_button {
274
274
  margin-left: 1rem;
275
- }
275
+ }
@@ -0,0 +1,88 @@
1
+ import { fireEvent, screen } from '@testing-library/react'
2
+ import { beforeEach, describe, expect, it, vi } from 'vitest'
3
+
4
+ import { fixture24Tuberack, fixture96Plate } from '@opentrons/shared-data'
5
+
6
+ import { renderWithProviders } from '../../../testing/utils'
7
+ import { CustomizeExpandButton } from '../index'
8
+
9
+ import type { ComponentProps } from 'react'
10
+ import type { LabwareDefinition2 } from '@opentrons/shared-data'
11
+
12
+ const render = (props: ComponentProps<typeof CustomizeExpandButton>) =>
13
+ renderWithProviders(<CustomizeExpandButton {...props} />)
14
+
15
+ const INPUT_FIELD_PROPS = {
16
+ onInputFieldChange: vi.fn(),
17
+ inputFieldValue: 1,
18
+ inputTitle: 'mock inputTitle',
19
+ errorMessage: 'mock errorMessage',
20
+ inputCaption: 'mock inputCaption',
21
+ definition: { ...fixture96Plate, stackLimit: 4 } as LabwareDefinition2,
22
+ }
23
+
24
+ describe('CustomizeExpandButton', () => {
25
+ let props: ComponentProps<typeof CustomizeExpandButton>
26
+
27
+ beforeEach(() => {
28
+ props = {
29
+ enableStackingFF: true,
30
+ buttonText: 'mock text',
31
+ buttonValue: 'mockValue',
32
+ onChange: vi.fn(),
33
+ allowInputField: false,
34
+ loadName: 'mockLoadName',
35
+ }
36
+ })
37
+
38
+ it('should render non nested accordion', () => {
39
+ render(props)
40
+ fireEvent.click(screen.getByText('mock text'))
41
+ expect(props.onChange).toHaveBeenCalled()
42
+ })
43
+ it('should render the input field', () => {
44
+ props = {
45
+ ...props,
46
+ allowInputField: true,
47
+ isSelected: true,
48
+ stackingProps: INPUT_FIELD_PROPS,
49
+ }
50
+ render(props)
51
+ screen.getByText('mock inputTitle')
52
+ screen.getByText('mock inputCaption')
53
+ const input = screen.getByTestId('CustomizeExpandButton_inputField')
54
+ fireEvent.change(input, { target: { value: 4 } })
55
+ expect(props.stackingProps?.onInputFieldChange).toHaveBeenCalled()
56
+ })
57
+ it('should show input field error', () => {
58
+ props = {
59
+ ...props,
60
+ allowInputField: true,
61
+ isSelected: true,
62
+ stackingProps: {
63
+ ...INPUT_FIELD_PROPS,
64
+ inputFieldValue: 5,
65
+ },
66
+ }
67
+ render(props)
68
+ screen.getByText('mock errorMessage')
69
+ })
70
+ it('should render the checkbox', () => {
71
+ props = {
72
+ ...props,
73
+ isSelected: true,
74
+ stackingProps: {
75
+ ...INPUT_FIELD_PROPS,
76
+ definition: {
77
+ ...fixture24Tuberack,
78
+ allowedRoles: ['lid'],
79
+ } as LabwareDefinition2,
80
+ onCheckboxChange: vi.fn(),
81
+ checked: false,
82
+ checkboxCaption: 'mock checkboxCaption',
83
+ },
84
+ }
85
+ render(props)
86
+ screen.getByText('mock checkboxCaption')
87
+ })
88
+ })
@@ -0,0 +1,189 @@
1
+ import { memo } from 'react'
2
+ import styled, { css } from 'styled-components'
3
+
4
+ import { CheckboxField } from '../../atoms/CheckboxField'
5
+ import { InputField } from '../../atoms/InputField'
6
+ import { StyledText } from '../../atoms/StyledText'
7
+ import { BORDERS, COLORS } from '../../helix-design-system'
8
+ import { Flex } from '../../primitives'
9
+ import { CURSOR_POINTER, DIRECTION_COLUMN } from '../../styles'
10
+ import { SPACING } from '../../ui-style-constants'
11
+
12
+ import type {
13
+ ChangeEvent,
14
+ ChangeEventHandler,
15
+ MemoExoticComponent,
16
+ MouseEvent,
17
+ } from 'react'
18
+ import type { LabwareDefinition2 } from '@opentrons/shared-data'
19
+ import type { StyleProps } from '../../primitives'
20
+
21
+ export interface StackingProps {
22
+ onInputFieldChange: (e: ChangeEvent<HTMLInputElement>) => void
23
+ inputFieldValue: number
24
+ inputTitle: string
25
+ errorMessage: string
26
+ inputCaption: string
27
+ definition: LabwareDefinition2
28
+ onCheckboxChange?: () => void
29
+ checked?: boolean
30
+ checkboxCaption?: string
31
+ }
32
+
33
+ interface CustomizeExpandButtonProps extends StyleProps {
34
+ enableStackingFF: boolean
35
+ allowInputField: boolean
36
+ loadName: string
37
+ buttonText: string
38
+ buttonValue: string | number
39
+ onChange: ChangeEventHandler<HTMLInputElement>
40
+ stackingProps?: StackingProps
41
+ disabled?: boolean
42
+ isSelected?: boolean
43
+ id?: string
44
+ }
45
+
46
+ // used for helix and as a child button to ListButtonAccordion
47
+ export function CustomizeExpandButtonComponent(
48
+ props: CustomizeExpandButtonProps
49
+ ): JSX.Element {
50
+ const {
51
+ buttonText,
52
+ buttonValue,
53
+ isSelected = false,
54
+ onChange,
55
+ disabled = false,
56
+ id = buttonText,
57
+ stackingProps,
58
+ allowInputField,
59
+ loadName,
60
+ enableStackingFF,
61
+ } = props
62
+ const isLid =
63
+ stackingProps != null &&
64
+ stackingProps.definition.allowedRoles?.includes('lid')
65
+ const tcLidDef = loadName === 'opentrons_tough_pcr_auto_sealing_lid'
66
+
67
+ return (
68
+ <Flex
69
+ width="100%"
70
+ margin={SPACING.spacing4}
71
+ onClick={(e: MouseEvent) => {
72
+ e.stopPropagation()
73
+ }}
74
+ >
75
+ <SettingButton
76
+ checked={isSelected}
77
+ id={id}
78
+ disabled={disabled}
79
+ onChange={e => {
80
+ onChange(e)
81
+ e.stopPropagation()
82
+ }}
83
+ type="radio"
84
+ value={buttonValue}
85
+ />
86
+ <SettingButtonLabel
87
+ role="label"
88
+ isSelected={isSelected}
89
+ disabled={disabled}
90
+ htmlFor={id}
91
+ >
92
+ <Flex flexDirection={DIRECTION_COLUMN} gridGap={SPACING.spacing4}>
93
+ <StyledText desktopStyle="bodyDefaultRegular">
94
+ {buttonText}
95
+ </StyledText>
96
+ {stackingProps != null && enableStackingFF && isSelected ? (
97
+ <Flex
98
+ flexDirection={DIRECTION_COLUMN}
99
+ backgroundColor={COLORS.blue10}
100
+ padding={`${SPACING.spacing16} ${SPACING.spacing20}`}
101
+ borderRadius={BORDERS.borderRadius4}
102
+ >
103
+ {isLid && !tcLidDef ? (
104
+ <CheckboxField
105
+ onChange={e => {
106
+ e.stopPropagation()
107
+ e.preventDefault()
108
+ stackingProps.onCheckboxChange?.()
109
+ }}
110
+ value={stackingProps.checked}
111
+ label={stackingProps.checkboxCaption}
112
+ />
113
+ ) : null}
114
+ {stackingProps.definition.stackLimit != null &&
115
+ stackingProps.definition.stackLimit > 1 &&
116
+ allowInputField ? (
117
+ <InputField
118
+ id="CustomizeExpandButton_inputField"
119
+ title={stackingProps.inputTitle}
120
+ onChange={e => {
121
+ e.stopPropagation()
122
+ stackingProps.onInputFieldChange(e)
123
+ }}
124
+ type="number"
125
+ error={
126
+ !stackingProps.inputFieldValue ||
127
+ stackingProps.inputFieldValue >
128
+ stackingProps.definition.stackLimit
129
+ ? stackingProps.errorMessage
130
+ : null
131
+ }
132
+ value={stackingProps.inputFieldValue}
133
+ caption={stackingProps.inputCaption}
134
+ />
135
+ ) : null}
136
+ </Flex>
137
+ ) : null}
138
+ </Flex>
139
+ </SettingButtonLabel>
140
+ </Flex>
141
+ )
142
+ }
143
+
144
+ export const CustomizeExpandButton: MemoExoticComponent<
145
+ typeof CustomizeExpandButtonComponent
146
+ > = memo(CustomizeExpandButtonComponent)
147
+
148
+ const SettingButton = styled.input`
149
+ display: none;
150
+ `
151
+
152
+ const AVAILABLE_BUTTON_STYLE = css`
153
+ background: ${COLORS.white};
154
+ color: ${COLORS.black90};
155
+
156
+ &:hover {
157
+ background-color: ${COLORS.grey10};
158
+ }
159
+ `
160
+
161
+ const SELECTED_BUTTON_STYLE = css`
162
+ background: ${COLORS.blue50};
163
+ color: ${COLORS.white};
164
+
165
+ &:active {
166
+ background-color: ${COLORS.blue60};
167
+ }
168
+ `
169
+
170
+ const DISABLED_STYLE = css`
171
+ color: ${COLORS.grey40};
172
+ background-color: ${COLORS.grey10};
173
+ `
174
+
175
+ interface ButtonLabelProps {
176
+ isSelected: boolean
177
+ disabled: boolean
178
+ }
179
+
180
+ const SettingButtonLabel = styled.label<ButtonLabelProps>`
181
+ border-radius: ${BORDERS.borderRadius8};
182
+ cursor: ${CURSOR_POINTER};
183
+ padding: ${SPACING.spacing12};
184
+ width: 100%;
185
+
186
+ ${({ isSelected }) =>
187
+ isSelected ? SELECTED_BUTTON_STYLE : AVAILABLE_BUTTON_STYLE}
188
+ ${({ disabled }) => disabled && DISABLED_STYLE}
189
+ `
@@ -1,7 +1,5 @@
1
- import { DeckInfoLabel } from '.'
2
1
  import { customViewports } from '../../../../.storybook/preview'
3
- import { Flex } from '../../primitives'
4
- import { SPACING } from '../../ui-style-constants'
2
+ import { DeckInfoLabel } from './index'
5
3
 
6
4
  import type { Meta, StoryObj } from '@storybook/react'
7
5
 
@@ -22,6 +20,12 @@ const meta: Meta<typeof DeckInfoLabel> = {
22
20
  'stacked',
23
21
  ],
24
22
  },
23
+ size: {
24
+ control: {
25
+ type: 'select',
26
+ },
27
+ options: ['default', 'large'],
28
+ },
25
29
  deckLabel: {
26
30
  control: {
27
31
  type: 'text',
@@ -31,7 +35,7 @@ const meta: Meta<typeof DeckInfoLabel> = {
31
35
  },
32
36
  component: DeckInfoLabel,
33
37
  parameters: {
34
- controls: { include: ['highlight', 'iconName', 'deckLabel'] },
38
+ controls: { include: ['highlight', 'iconName', 'deckLabel', 'size'] },
35
39
  viewport: {
36
40
  viewports: customViewports,
37
41
  defaultViewport: 'onDeviceDisplay',
@@ -39,9 +43,9 @@ const meta: Meta<typeof DeckInfoLabel> = {
39
43
  },
40
44
  decorators: [
41
45
  Story => (
42
- <Flex padding={SPACING.spacing16} width="15rem" height="5rem">
46
+ <div style={{ padding: '16px', width: '15rem', height: '5rem' }}>
43
47
  <Story />
44
- </Flex>
48
+ </div>
45
49
  ),
46
50
  ],
47
51
  }