@opentrons/components 0.1.0-beta.7 → 0.1.2-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 (266) hide show
  1. package/lib/__tests__/utils.test.d.ts +1 -0
  2. package/lib/alerts/AlertItem.d.ts +21 -0
  3. package/lib/alerts/index.d.ts +1 -0
  4. package/lib/atoms/CheckboxField/__tests__/CheckboxField.test.d.ts +1 -0
  5. package/lib/atoms/CheckboxField/index.d.ts +20 -0
  6. package/lib/atoms/StepMeter/index.d.ts +6 -0
  7. package/lib/atoms/buttons/AlertPrimaryButton.d.ts +1 -0
  8. package/lib/atoms/buttons/PrimaryButton.d.ts +1 -0
  9. package/lib/atoms/buttons/SecondaryButton.d.ts +7 -0
  10. package/lib/atoms/buttons/__tests__/AlertPrimaryButton.test.d.ts +1 -0
  11. package/lib/atoms/buttons/__tests__/PrimaryButton.test.d.ts +1 -0
  12. package/lib/atoms/buttons/__tests__/SecondaryButton.test.d.ts +1 -0
  13. package/lib/atoms/buttons/index.d.ts +3 -0
  14. package/lib/atoms/index.d.ts +3 -0
  15. package/lib/barrel.d.ts +3 -0
  16. package/lib/buttons/Button.d.ts +49 -0
  17. package/lib/buttons/DeprecatedPrimaryButton.d.ts +9 -0
  18. package/lib/buttons/FlatButton.d.ts +6 -0
  19. package/lib/buttons/IconButton.d.ts +15 -0
  20. package/lib/buttons/OutlineButton.d.ts +9 -0
  21. package/lib/buttons/index.d.ts +5 -0
  22. package/lib/controls/ControlInfo.d.ts +6 -0
  23. package/lib/controls/LabeledButton.d.ts +8 -0
  24. package/lib/controls/LabeledCheckbox.d.ts +10 -0
  25. package/lib/controls/LabeledControl.d.ts +7 -0
  26. package/lib/controls/LabeledRadioGroup.d.ts +8 -0
  27. package/lib/controls/LabeledSelect.d.ts +9 -0
  28. package/lib/controls/LabeledToggle.d.ts +11 -0
  29. package/lib/controls/StackedLabeledControl.d.ts +7 -0
  30. package/lib/controls/ToggleButton.d.ts +6 -0
  31. package/lib/controls/index.d.ts +6 -0
  32. package/lib/forms/DeprecatedCheckboxField.d.ts +33 -0
  33. package/lib/forms/DropdownField.d.ts +38 -0
  34. package/lib/forms/FormGroup.d.ts +19 -0
  35. package/lib/forms/InputField.d.ts +51 -0
  36. package/lib/forms/RadioGroup.d.ts +29 -0
  37. package/lib/forms/Select.d.ts +27 -0
  38. package/lib/forms/SelectField.d.ts +33 -0
  39. package/lib/forms/ToggleField.d.ts +22 -0
  40. package/lib/forms/__tests__/DeprecatedCheckboxField.test.d.ts +0 -0
  41. package/lib/forms/__tests__/DropdownField.test.d.ts +0 -0
  42. package/lib/forms/__tests__/InputField.test.d.ts +0 -0
  43. package/lib/forms/__tests__/Select.test.d.ts +0 -0
  44. package/lib/forms/__tests__/SelectField.test.d.ts +0 -0
  45. package/lib/forms/__tests__/ToggleField.test.d.ts +0 -0
  46. package/lib/forms/index.d.ts +8 -0
  47. package/lib/hardware-sim/BaseDeck/BaseDeck.d.ts +42 -0
  48. package/lib/hardware-sim/BaseDeck/SingleSlotFixture.d.ts +12 -0
  49. package/lib/hardware-sim/BaseDeck/SlotBase.d.ts +2 -0
  50. package/lib/hardware-sim/BaseDeck/SlotClip.d.ts +2 -0
  51. package/lib/hardware-sim/BaseDeck/StagingAreaFixture.d.ts +13 -0
  52. package/lib/hardware-sim/BaseDeck/WasteChuteFixture.d.ts +21 -0
  53. package/lib/hardware-sim/BaseDeck/WasteChuteStagingAreaFixture.d.ts +14 -0
  54. package/lib/hardware-sim/BaseDeck/__fixtures__/index.d.ts +4 -0
  55. package/lib/hardware-sim/BaseDeck/index.d.ts +5 -0
  56. package/lib/hardware-sim/Deck/DeckFromLayers.d.ts +11 -0
  57. package/lib/hardware-sim/Deck/FlexTrash.d.ts +14 -0
  58. package/lib/hardware-sim/Deck/MoveLabwareOnDeck.d.ts +17 -0
  59. package/lib/hardware-sim/Deck/OT2Layers.d.ts +11 -0
  60. package/lib/hardware-sim/Deck/RobotCoordsForeignDiv.d.ts +14 -0
  61. package/lib/hardware-sim/Deck/RobotCoordsForeignObject.d.ts +12 -0
  62. package/lib/hardware-sim/Deck/RobotCoordsText.d.ts +8 -0
  63. package/lib/hardware-sim/Deck/RobotWorkSpace.d.ts +21 -0
  64. package/lib/hardware-sim/Deck/SlotLabels.d.ts +12 -0
  65. package/lib/hardware-sim/Deck/__mocks__/getDeckDefinitions.d.ts +2 -0
  66. package/lib/hardware-sim/Deck/constants.d.ts +1 -0
  67. package/lib/hardware-sim/Deck/getDeckDefinitions.d.ts +2 -0
  68. package/lib/hardware-sim/Deck/index.d.ts +9 -0
  69. package/lib/hardware-sim/DeckConfigurator/EmptyConfigFixture.d.ts +9 -0
  70. package/lib/hardware-sim/DeckConfigurator/StagingAreaConfigFixture.d.ts +9 -0
  71. package/lib/hardware-sim/DeckConfigurator/TrashBinConfigFixture.d.ts +9 -0
  72. package/lib/hardware-sim/DeckConfigurator/WasteChuteConfigFixture.d.ts +10 -0
  73. package/lib/hardware-sim/DeckConfigurator/constants.d.ts +15 -0
  74. package/lib/hardware-sim/DeckConfigurator/index.d.ts +14 -0
  75. package/lib/hardware-sim/DeckSlotLocation/index.d.ts +15 -0
  76. package/lib/hardware-sim/Labware/LabwareRender.d.ts +40 -0
  77. package/lib/hardware-sim/Labware/__tests__/LabwareRender.test.d.ts +1 -0
  78. package/lib/hardware-sim/Labware/index.d.ts +3 -0
  79. package/lib/hardware-sim/Labware/labwareInternals/FilledWells.d.ts +10 -0
  80. package/lib/hardware-sim/Labware/labwareInternals/LabwareOutline.d.ts +18 -0
  81. package/lib/hardware-sim/Labware/labwareInternals/StaticLabware.d.ts +17 -0
  82. package/lib/hardware-sim/Labware/labwareInternals/StrokedWells.d.ts +9 -0
  83. package/lib/hardware-sim/Labware/labwareInternals/StyledWells.d.ts +19 -0
  84. package/lib/hardware-sim/Labware/labwareInternals/Well.d.ts +19 -0
  85. package/lib/hardware-sim/Labware/labwareInternals/WellLabels.d.ts +12 -0
  86. package/lib/hardware-sim/Labware/labwareInternals/__tests__/StrokedWells.test.d.ts +1 -0
  87. package/lib/hardware-sim/Labware/labwareInternals/__tests__/WellLabels.test.d.ts +1 -0
  88. package/lib/hardware-sim/Labware/labwareInternals/index.d.ts +6 -0
  89. package/lib/hardware-sim/Labware/labwareInternals/types.d.ts +12 -0
  90. package/lib/hardware-sim/Module/HeaterShaker.d.ts +5 -0
  91. package/lib/hardware-sim/Module/MagneticBlock.d.ts +2 -0
  92. package/lib/hardware-sim/Module/MagneticModule.d.ts +2 -0
  93. package/lib/hardware-sim/Module/ModuleTag.d.ts +9 -0
  94. package/lib/hardware-sim/Module/Temperature.d.ts +5 -0
  95. package/lib/hardware-sim/Module/Thermocycler/ThermocyclerGEN1.d.ts +7 -0
  96. package/lib/hardware-sim/Module/Thermocycler/ThermocyclerGEN2.d.ts +7 -0
  97. package/lib/hardware-sim/Module/Thermocycler/index.d.ts +8 -0
  98. package/lib/hardware-sim/Module/index.d.ts +18 -0
  99. package/lib/hardware-sim/Pipette/EightEmanatingNozzles.d.ts +4 -0
  100. package/lib/hardware-sim/Pipette/EmanatingNozzle.d.ts +4 -0
  101. package/lib/hardware-sim/Pipette/PipetteRender.d.ts +8 -0
  102. package/lib/hardware-sim/Pipette/__tests__/EightEmanatingNozzles.test.d.ts +1 -0
  103. package/lib/hardware-sim/Pipette/__tests__/EmanatingNozzle.test.d.ts +1 -0
  104. package/lib/hardware-sim/Pipette/__tests__/PipetteRender.test.d.ts +1 -0
  105. package/lib/hardware-sim/Pipette/constants.d.ts +7 -0
  106. package/lib/hardware-sim/Pipette/index.d.ts +1 -0
  107. package/lib/hardware-sim/ProtocolDeck/LabwareInfo.d.ts +6 -0
  108. package/lib/hardware-sim/ProtocolDeck/index.d.ts +12 -0
  109. package/lib/hardware-sim/ProtocolDeck/types.d.ts +8 -0
  110. package/lib/hardware-sim/ProtocolDeck/utils/__tests__/getLabwareInforByLiquidId.test.d.ts +1 -0
  111. package/lib/hardware-sim/ProtocolDeck/utils/getInitiallyLoadedLabwareByAdapter.d.ts +5 -0
  112. package/lib/hardware-sim/ProtocolDeck/utils/getLabwareInSlots.d.ts +11 -0
  113. package/lib/hardware-sim/ProtocolDeck/utils/getLabwareInfoByLiquidId.d.ts +3 -0
  114. package/lib/hardware-sim/ProtocolDeck/utils/getModulesInSlots.d.ts +10 -0
  115. package/lib/hardware-sim/ProtocolDeck/utils/getStandardDeckViewLayerBlockList.d.ts +2 -0
  116. package/lib/hardware-sim/ProtocolDeck/utils/getWellFillFromLabwareId.d.ts +4 -0
  117. package/lib/hardware-sim/ProtocolDeck/utils/index.d.ts +2 -0
  118. package/lib/hardware-sim/RobotCoordinateSpace/RobotCoordinateSpace.d.ts +7 -0
  119. package/lib/hardware-sim/RobotCoordinateSpace/RobotCoordinateSpaceWithDOMCoords.d.ts +19 -0
  120. package/lib/hardware-sim/RobotCoordinateSpace/index.d.ts +2 -0
  121. package/lib/hardware-sim/index.d.ts +11 -0
  122. package/lib/hardware-sim/utils.d.ts +3 -0
  123. package/lib/helix-design-system/colors.d.ts +75 -0
  124. package/lib/helix-design-system/index.d.ts +1 -0
  125. package/lib/hooks/__tests__/useConditionalConfirm.test.d.ts +0 -0
  126. package/lib/hooks/__tests__/useDrag.test.d.ts +1 -0
  127. package/lib/hooks/__tests__/useIdle.test.d.ts +1 -0
  128. package/lib/hooks/__tests__/useInterval.test.d.ts +0 -0
  129. package/lib/hooks/__tests__/useLongPress.test.d.ts +1 -0
  130. package/lib/hooks/__tests__/useMountEffect.test.d.ts +0 -0
  131. package/lib/hooks/__tests__/usePrevious.test.d.ts +0 -0
  132. package/lib/hooks/__tests__/useScrolling.test.d.ts +1 -0
  133. package/lib/hooks/__tests__/useSwipe.test.d.ts +1 -0
  134. package/lib/hooks/__tests__/useTimeout.test.d.ts +0 -0
  135. package/lib/hooks/__tests__/useToggle.test.d.ts +0 -0
  136. package/lib/hooks/index.d.ts +12 -0
  137. package/lib/hooks/useConditionalConfirm.d.ts +40 -0
  138. package/lib/hooks/useDrag.d.ts +22 -0
  139. package/lib/hooks/useIdle.d.ts +11 -0
  140. package/lib/hooks/useInterval.d.ts +11 -0
  141. package/lib/hooks/useLongPress.d.ts +19 -0
  142. package/lib/hooks/useMountEffect.d.ts +8 -0
  143. package/lib/hooks/usePrevious.d.ts +9 -0
  144. package/lib/hooks/useScrolling.d.ts +8 -0
  145. package/lib/hooks/useSelectDeckLocation/index.d.ts +17 -0
  146. package/lib/hooks/useSwipe.d.ts +12 -0
  147. package/lib/hooks/useTimeout.d.ts +9 -0
  148. package/lib/hooks/useToggle.d.ts +22 -0
  149. package/lib/icons/Icon.d.ts +34 -0
  150. package/lib/icons/ModuleIcon.d.ts +12 -0
  151. package/lib/icons/NotificationIcon.d.ts +13 -0
  152. package/lib/icons/icon-data.d.ts +582 -0
  153. package/lib/icons/index.d.ts +3 -0
  154. package/lib/images/index.d.ts +1 -0
  155. package/lib/images/labware/index.d.ts +1 -0
  156. package/lib/images/labware/measurement-guide/index.d.ts +13 -0
  157. package/lib/index.d.ts +28 -0
  158. package/lib/instrument/InfoItem.d.ts +11 -0
  159. package/lib/instrument/InstrumentDiagram.d.ts +12 -0
  160. package/lib/instrument/InstrumentGroup.d.ts +12 -0
  161. package/lib/instrument/InstrumentInfo.d.ts +24 -0
  162. package/lib/instrument/PipetteSelect.d.ts +20 -0
  163. package/lib/instrument/__tests__/PipetteSelect.test.d.ts +0 -0
  164. package/lib/instrument/index.d.ts +5 -0
  165. package/lib/interaction-enhancers/ClickOutside.d.ts +18 -0
  166. package/lib/interaction-enhancers/HandleKeypress.d.ts +27 -0
  167. package/lib/interaction-enhancers/__tests__/useHover.test.d.ts +0 -0
  168. package/lib/interaction-enhancers/index.d.ts +4 -0
  169. package/lib/interaction-enhancers/useHover.d.ts +33 -0
  170. package/lib/interaction-enhancers/useOnClickOutside.d.ts +5 -0
  171. package/lib/legacy-hardware-sim/LabwareNameOverlay.d.ts +8 -0
  172. package/lib/legacy-hardware-sim/ModuleItem.d.ts +18 -0
  173. package/lib/legacy-hardware-sim/index.d.ts +2 -0
  174. package/lib/lists/ListItem.d.ts +37 -0
  175. package/lib/lists/SidePanelGroup.d.ts +18 -0
  176. package/lib/lists/TitledList.d.ts +44 -0
  177. package/lib/lists/index.d.ts +3 -0
  178. package/lib/modals/AlertModal.d.ts +27 -0
  179. package/lib/modals/BaseModal.d.ts +26 -0
  180. package/lib/modals/ContinueModal.d.ts +10 -0
  181. package/lib/modals/Modal.d.ts +23 -0
  182. package/lib/modals/ModalPage.d.ts +16 -0
  183. package/lib/modals/ModalShell.d.ts +25 -0
  184. package/lib/modals/Overlay.d.ts +9 -0
  185. package/lib/modals/SpinnerModal.d.ts +13 -0
  186. package/lib/modals/SpinnerModalPage.d.ts +11 -0
  187. package/lib/modals/__tests__/BaseModal.test.d.ts +0 -0
  188. package/lib/modals/index.d.ts +9 -0
  189. package/lib/molecules/LocationIcon/__tests__/LocationIcon.test.d.ts +1 -0
  190. package/lib/molecules/LocationIcon/index.d.ts +16 -0
  191. package/lib/molecules/RoundTab.d.ts +7 -0
  192. package/lib/molecules/index.d.ts +2 -0
  193. package/lib/nav/SidePanel.d.ts +6 -0
  194. package/lib/nav/index.d.ts +1 -0
  195. package/lib/opentrons-components.js +16 -3
  196. package/lib/primitives/Box.d.ts +7 -0
  197. package/lib/primitives/Btn.d.ts +60 -0
  198. package/lib/primitives/Flex.d.ts +7 -0
  199. package/lib/primitives/ForeignObject.d.ts +23 -0
  200. package/lib/primitives/Link.d.ts +11 -0
  201. package/lib/primitives/Svg.d.ts +23 -0
  202. package/lib/primitives/Text.d.ts +7 -0
  203. package/lib/primitives/__tests__/Box.test.d.ts +0 -0
  204. package/lib/primitives/__tests__/Btn.test.d.ts +0 -0
  205. package/lib/primitives/__tests__/Flex.test.d.ts +0 -0
  206. package/lib/primitives/__tests__/Link.test.d.ts +0 -0
  207. package/lib/primitives/__tests__/Svg.test.d.ts +0 -0
  208. package/lib/primitives/__tests__/Text.test.d.ts +0 -0
  209. package/lib/primitives/__tests__/primitives.test.d.ts +0 -0
  210. package/lib/primitives/__tests__/style-props.test.d.ts +0 -0
  211. package/lib/primitives/index.d.ts +9 -0
  212. package/lib/primitives/style-props.d.ts +4 -0
  213. package/lib/primitives/types.d.ts +96 -0
  214. package/lib/robot-types.d.ts +1 -0
  215. package/lib/slotmap/SlotMap.d.ts +12 -0
  216. package/lib/slotmap/__tests__/SlotMap.test.d.ts +0 -0
  217. package/lib/slotmap/index.d.ts +1 -0
  218. package/lib/structure/Card.d.ts +18 -0
  219. package/lib/structure/LabeledValue.d.ts +12 -0
  220. package/lib/structure/PageTabs.d.ts +12 -0
  221. package/lib/structure/Pill.d.ts +18 -0
  222. package/lib/structure/Splash.d.ts +9 -0
  223. package/lib/structure/TitleBar.d.ts +17 -0
  224. package/lib/structure/index.d.ts +6 -0
  225. package/lib/styles/borders.d.ts +8 -0
  226. package/lib/styles/colors.d.ts +37 -0
  227. package/lib/styles/flexbox.d.ts +28 -0
  228. package/lib/styles/index.d.ts +7 -0
  229. package/lib/styles/layout.d.ts +20 -0
  230. package/lib/styles/position.d.ts +5 -0
  231. package/lib/styles/spacing.d.ts +9 -0
  232. package/lib/styles/typography.d.ts +36 -0
  233. package/lib/tabbedNav/NavTab.d.ts +25 -0
  234. package/lib/tabbedNav/OutsideLinkTab.d.ts +24 -0
  235. package/lib/tabbedNav/TabbedNavBar.d.ts +7 -0
  236. package/lib/tabbedNav/index.d.ts +3 -0
  237. package/lib/testing/utils/index.d.ts +2 -0
  238. package/lib/testing/utils/matchers.d.ts +6 -0
  239. package/lib/testing/utils/renderWithProviders.d.ts +10 -0
  240. package/lib/tooltips/DeprecatedTooltip.d.ts +37 -0
  241. package/lib/tooltips/HoverTooltip.d.ts +36 -0
  242. package/lib/tooltips/Tooltip.d.ts +35 -0
  243. package/lib/tooltips/__tests__/Tooltip.test.d.ts +0 -0
  244. package/lib/tooltips/__tests__/useHoverTooltip.test.d.ts +0 -0
  245. package/lib/tooltips/__tests__/usePopper.test.d.ts +0 -0
  246. package/lib/tooltips/__tests__/useTooltip.test.d.ts +0 -0
  247. package/lib/tooltips/constants.d.ts +17 -0
  248. package/lib/tooltips/index.d.ts +8 -0
  249. package/lib/tooltips/styles.d.ts +12 -0
  250. package/lib/tooltips/types.d.ts +52 -0
  251. package/lib/tooltips/useHoverTooltip.d.ts +24 -0
  252. package/lib/tooltips/usePopper.d.ts +2 -0
  253. package/lib/tooltips/useTooltip.d.ts +31 -0
  254. package/lib/ui-style-constants/borders.d.ts +18 -0
  255. package/lib/ui-style-constants/index.d.ts +4 -0
  256. package/lib/ui-style-constants/responsiveness.d.ts +1 -0
  257. package/lib/ui-style-constants/spacing.d.ts +17 -0
  258. package/lib/ui-style-constants/typography.d.ts +70 -0
  259. package/lib/utils.d.ts +15 -0
  260. package/package.json +3 -2
  261. package/webpack.config.js +31 -15
  262. package/lib/1.3876f6a4be6aeefb34ed.css +0 -1
  263. package/lib/1.opentrons-components.js +0 -2
  264. package/lib/1.opentrons-components.js.map +0 -1
  265. package/lib/opentrons-components.js.LICENSE.txt +0 -53
  266. package/lib/opentrons-components.js.map +0 -1
@@ -0,0 +1,7 @@
1
+ export declare const SINGLE_CHANNEL_PIPETTE_WIDTH = 18.7;
2
+ export declare const SINGLE_CHANNEL_PIPETTE_HEIGHT = 30.5;
3
+ export declare const MULTI_CHANNEL_PIPETTE_WIDTH = 18.7;
4
+ export declare const MULTI_CHANNEL_PIPETTE_HEIGHT = 90.3;
5
+ export declare const NINETY_SIX_CHANNEL_PIPETTE_WIDTH = 117.7;
6
+ export declare const MULTI_CHANNEL_CENTER_Y_NOZZLE = 13.3;
7
+ export declare const MULTI_CHANNEL_Y_OFFSET = -2.5;
@@ -0,0 +1 @@
1
+ export * from './PipetteRender';
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ import { LabwareDefinition2 } from '@opentrons/shared-data';
3
+ export declare function LabwareInfo(props: {
4
+ def: LabwareDefinition2;
5
+ children: React.ReactNode;
6
+ }): JSX.Element;
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import { BaseDeck } from '../BaseDeck';
3
+ import type { CompletedProtocolAnalysis, ProtocolAnalysisOutput } from '@opentrons/shared-data';
4
+ export * from './utils/getStandardDeckViewLayerBlockList';
5
+ interface ProtocolDeckProps {
6
+ protocolAnalysis: CompletedProtocolAnalysis | ProtocolAnalysisOutput | null;
7
+ /** defaults to false, when set labware nicknames will appear on top level labware. If no nickname specified in protocol, falls back to labware definition display name */
8
+ showLabwareInfo?: boolean;
9
+ /** extra props to pass through to BaseDeck component */
10
+ baseDeckProps?: Partial<React.ComponentProps<typeof BaseDeck>>;
11
+ }
12
+ export declare function ProtocolDeck(props: ProtocolDeckProps): JSX.Element | null;
@@ -0,0 +1,8 @@
1
+ export interface LabwareByLiquidId {
2
+ [liquidId: string]: Array<{
3
+ labwareId: string;
4
+ volumeByWell: {
5
+ [well: string]: number;
6
+ };
7
+ }>;
8
+ }
@@ -0,0 +1,5 @@
1
+ import type { LoadLabwareRunTimeCommand, RunTimeCommand } from '@opentrons/shared-data';
2
+ export interface LoadedLabwareByAdapter {
3
+ [labwareId: string]: LoadLabwareRunTimeCommand;
4
+ }
5
+ export declare function getInitialLoadedLabwareByAdapter(commands: RunTimeCommand[]): LoadedLabwareByAdapter;
@@ -0,0 +1,11 @@
1
+ import type { CompletedProtocolAnalysis, ProtocolAnalysisOutput, LabwareDefinition2 } from '@opentrons/shared-data';
2
+ interface LabwareInSlot {
3
+ labwareId: string;
4
+ labwareDef: LabwareDefinition2;
5
+ labwareNickName: string | null;
6
+ location: {
7
+ slotName: string;
8
+ };
9
+ }
10
+ export declare const getTopMostLabwareInSlots: (protocolAnalysis: CompletedProtocolAnalysis | ProtocolAnalysisOutput) => LabwareInSlot[];
11
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { RunTimeCommand } from '@opentrons/shared-data';
2
+ import type { LabwareByLiquidId } from '../types';
3
+ export declare function getLabwareInfoByLiquidId(commands: RunTimeCommand[]): LabwareByLiquidId;
@@ -0,0 +1,10 @@
1
+ import type { CompletedProtocolAnalysis, ProtocolAnalysisOutput, ModuleLocation, ModuleModel, LabwareDefinition2 } from '@opentrons/shared-data';
2
+ interface ModuleInSlot {
3
+ moduleModel: ModuleModel;
4
+ moduleLocation: ModuleLocation;
5
+ nestedLabwareId: string | null;
6
+ nestedLabwareDef: LabwareDefinition2 | null;
7
+ nestedLabwareNickName: string | null;
8
+ }
9
+ export declare const getModulesInSlots: (protocolAnalysis: ProtocolAnalysisOutput | CompletedProtocolAnalysis) => ModuleInSlot[];
10
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { RobotType } from '@opentrons/shared-data';
2
+ export declare const getStandardDeckViewLayerBlockList: (robotType: RobotType) => string[];
@@ -0,0 +1,4 @@
1
+ import type { Liquid } from '@opentrons/shared-data';
2
+ import type { WellFill } from '../../Labware';
3
+ import type { LabwareByLiquidId } from '../types';
4
+ export declare function getWellFillFromLabwareId(labwareId: string, liquidsInLoadOrder: Liquid[], labwareByLiquidId: LabwareByLiquidId): WellFill;
@@ -0,0 +1,2 @@
1
+ export * from './getLabwareInSlots';
2
+ export * from './getStandardDeckViewLayerBlockList';
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { Svg } from '../../primitives';
3
+ interface RobotCoordinateSpaceProps extends React.ComponentProps<typeof Svg> {
4
+ animated?: boolean;
5
+ }
6
+ export declare function RobotCoordinateSpace(props: RobotCoordinateSpaceProps): JSX.Element;
7
+ export {};
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ import { Svg } from '../../primitives';
3
+ import type { DeckDefinition, DeckSlot } from '@opentrons/shared-data';
4
+ export interface RobotCoordinateSpaceWithDOMCoordsRenderProps {
5
+ deckSlotsById: {
6
+ [slotId: string]: DeckSlot;
7
+ };
8
+ getRobotCoordsFromDOMCoords: (domX: number, domY: number) => {
9
+ x: number;
10
+ y: number;
11
+ };
12
+ }
13
+ interface RobotCoordinateSpaceWithDOMCoordsProps extends React.ComponentProps<typeof Svg> {
14
+ viewBox?: string | null;
15
+ deckDef?: DeckDefinition;
16
+ children?: (props: RobotCoordinateSpaceWithDOMCoordsRenderProps) => React.ReactNode;
17
+ }
18
+ export declare function RobotCoordinateSpaceWithDOMCoords(props: RobotCoordinateSpaceWithDOMCoordsProps): JSX.Element | null;
19
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './RobotCoordinateSpaceWithDOMCoords';
2
+ export * from './RobotCoordinateSpace';
@@ -0,0 +1,11 @@
1
+ export * from './BaseDeck';
2
+ export * from './BaseDeck/__fixtures__';
3
+ export * from './ProtocolDeck';
4
+ export * from './ProtocolDeck/utils';
5
+ export * from './Deck';
6
+ export * from './DeckConfigurator';
7
+ export * from './DeckSlotLocation';
8
+ export * from './Labware';
9
+ export * from './Module';
10
+ export * from './Pipette';
11
+ export * from './RobotCoordinateSpace';
@@ -0,0 +1,3 @@
1
+ import { AffineTransformMatrix } from '@opentrons/shared-data';
2
+ export declare const IDENTITY_AFFINE_TRANSFORM: AffineTransformMatrix;
3
+ export declare function multiplyMatrices(a: number[][], b: number[][]): number[][];
@@ -0,0 +1,75 @@
1
+ /**
2
+ * green
3
+ */
4
+ export declare const green60 = "#03683E";
5
+ export declare const green50 = "#04AA65";
6
+ export declare const green40 = "#91E2C0";
7
+ export declare const green35 = "#AFEDD3";
8
+ export declare const green30 = "#C4F6E0";
9
+ export declare const green20 = "#E8F7ED";
10
+ /**
11
+ * red
12
+ */
13
+ export declare const red60 = "#941313";
14
+ export declare const red55 = "#C71A1B";
15
+ export declare const red50 = "#DE1B1B";
16
+ export declare const red40 = "#F5B2B3";
17
+ export declare const red35 = "#F8C8C9";
18
+ export declare const red30 = "#FAD6D6";
19
+ export declare const red20 = "#FCE9E9";
20
+ /**
21
+ * yellow
22
+ */
23
+ export declare const yellow60 = "#825512";
24
+ export declare const yellow50 = "#F09D20";
25
+ export declare const yellow40 = "#FCD48B";
26
+ export declare const yellow35 = "#FFE1A4";
27
+ export declare const yellow30 = "#FFE9BE";
28
+ export declare const yellow20 = "#FDF3E2";
29
+ /**
30
+ * purple
31
+ */
32
+ export declare const purple60 = "#562566";
33
+ export declare const purple55 = "#713187";
34
+ export declare const purple50 = "#893BA4";
35
+ export declare const purple40 = "#CEA4DF";
36
+ export declare const purple35 = "#DBBCE7";
37
+ export declare const purple30 = "#E6D5EC";
38
+ export declare const purple20 = "#F1E8F5";
39
+ /**
40
+ * blue
41
+ */
42
+ export declare const blue60 = "#004196";
43
+ export declare const blue55 = "#0056C8";
44
+ export declare const blue40 = "#A9CEFD";
45
+ export declare const blue35 = "#BFDCFD";
46
+ export declare const blue30 = "#D0E6FE";
47
+ export declare const blue20 = "#E1EFFF";
48
+ export declare const blue10 = "#F1F8FF";
49
+ /**
50
+ * grey
51
+ */
52
+ export declare const grey60 = "#4A4C4E";
53
+ export declare const grey55 = "#737578";
54
+ export declare const grey50 = "#9C9C9C";
55
+ export declare const grey40 = "#D0D0D0";
56
+ export declare const grey35 = "#CBCCCC";
57
+ export declare const grey30 = "#DEDEDE";
58
+ export declare const grey20 = "#ECECEC";
59
+ export declare const grey10 = "#F8F8F8";
60
+ /**
61
+ * core
62
+ */
63
+ export declare const black90 = "#16212D";
64
+ export declare const black80 = "#24313F";
65
+ export declare const black70 = "#39495B";
66
+ export declare const white = "#FFFFFF";
67
+ export declare const blue50 = "#006CFA";
68
+ /**
69
+ * extras
70
+ */
71
+ export declare const transparent = "transparent";
72
+ export declare const opacity20HexCode = "33";
73
+ export declare const opacity40HexCode = "66";
74
+ export declare const opacity60HexCode = "99";
75
+ export declare const opacity90HexCode = "E6";
@@ -0,0 +1 @@
1
+ export * as COLORS from './colors';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
File without changes
@@ -0,0 +1 @@
1
+ export {};
File without changes
File without changes
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
File without changes
File without changes
@@ -0,0 +1,12 @@
1
+ export * from './useConditionalConfirm';
2
+ export * from './useDrag';
3
+ export * from './useIdle';
4
+ export * from './useInterval';
5
+ export * from './useLongPress';
6
+ export * from './useMountEffect';
7
+ export * from './usePrevious';
8
+ export * from './useScrolling';
9
+ export * from './useSelectDeckLocation';
10
+ export * from './useSwipe';
11
+ export * from './useTimeout';
12
+ export * from './useToggle';
@@ -0,0 +1,40 @@
1
+ /**
2
+ * useConditionalConfirm is intended for cases where we want to block and defer
3
+ * a particular user action until the user clicks "ok" in any kind of "are you sure?"
4
+ * confirmation UI. The arguments passed to the confirm function will be preserved and
5
+ * used to call handleContinue. Ex. a click event is being deferred by a modal. When the
6
+ * user confirms, the initial click event passed as an argument will be used as the argument in
7
+ * the callback.
8
+ * @param {() => unknown)} handleContinue (the action we may want to require confirmation for)
9
+ * @param {boolean} shouldBlock (if no confirmation is needed, we will avoid the modal and immediately call handleContinue)
10
+ * @example
11
+ * ```js
12
+ * import { useConditionalConfirm } from '@opentrons/components'
13
+ *
14
+ * const ExampleDangerForm = props => {
15
+ * const {
16
+ * confirm,
17
+ * showConfirmation,
18
+ * cancel,
19
+ * } = useConditionalConfirm(props.goAhead, props.dangerIsPresent)
20
+ *
21
+ * return (
22
+ * <>
23
+ * {showConfirmation && (
24
+ * <AreYouSureModal
25
+ * handleCancel={cancel}
26
+ * handleContinue={confirm}
27
+ * />
28
+ * )}
29
+ * <DangerFormFields />
30
+ * <DangerousSubmit onClick={confirm} />
31
+ * </>
32
+ * )
33
+ * }
34
+ * ```
35
+ */
36
+ export declare const useConditionalConfirm: <T extends any[]>(handleContinue: (...args: T) => any, shouldBlock: boolean) => {
37
+ confirm: (...args: T) => void;
38
+ showConfirmation: boolean;
39
+ cancel: () => unknown;
40
+ };
@@ -0,0 +1,22 @@
1
+ import { CSSProperties, MutableRefObject } from 'react';
2
+ export interface ElementPosition {
3
+ width: number;
4
+ height: number;
5
+ x: number;
6
+ y: number;
7
+ }
8
+ export interface UseDragResult {
9
+ ref: MutableRefObject<null>;
10
+ style: CSSProperties;
11
+ position: ElementPosition;
12
+ isEnabled: boolean;
13
+ enable: () => void;
14
+ disable: () => void;
15
+ }
16
+ /**
17
+ * useDrag makes HTMLElement draggable for on-device app
18
+ * This hook should be used when isOnDevice is true
19
+ * @param {ElementPosition} (width, height, x, and y, they are HTMLElement's size and the initial position)
20
+ * @returns {UseDragResult}
21
+ */
22
+ export declare const useDrag: (position: ElementPosition) => UseDragResult;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * React hook to check user events
3
+ *
4
+ * @param {number} idleTime (idle time)
5
+ * @param {object} options (events that the app need to check, initialState: initial state true => idle)
6
+ * @returns {boolean}
7
+ */
8
+ export declare function useIdle(idleTime: number, options?: Partial<{
9
+ events: Array<keyof DocumentEventMap>;
10
+ initialState: boolean;
11
+ }>): boolean;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * React hook to call a function on an interval; copied from:
3
+ * https://overreacted.io/making-setinterval-declarative-with-react-hooks/
4
+ *
5
+ * @template T (type of the input value)
6
+ * @param {() => unknown} callback (function to call on an interval)
7
+ * @param {number | null} delay (interval delay, or null to stop interval)
8
+ * @param {boolean} [immediate=false] (trigger the callback immediately before starting the interval)
9
+ * @returns {void}
10
+ */
11
+ export declare function useInterval(callback: () => unknown, delay: number | null, immediate?: boolean): void;
@@ -0,0 +1,19 @@
1
+ import { CSSProperties, MutableRefObject } from 'react';
2
+ export interface UseLongPressResult {
3
+ ref: MutableRefObject<null>;
4
+ style: CSSProperties;
5
+ isEnabled: boolean;
6
+ isLongPressed: boolean;
7
+ isTapped: boolean;
8
+ setIsLongPressed: (value: boolean) => void;
9
+ setIsTapped: (value: boolean) => void;
10
+ enable: () => void;
11
+ disable: () => void;
12
+ }
13
+ /**
14
+ * useLongPress provide two actions (tap and long press)
15
+ * useLongPress recognize 1 sec hold as long press: hold Duration
16
+ * interactjs recognize "hold" when an element is held down around 600ms(default)
17
+ * @returns {UseLongPressResult}
18
+ */
19
+ export declare const useLongPress: () => UseLongPressResult;
@@ -0,0 +1,8 @@
1
+ import type { EffectCallback } from 'react';
2
+ /**
3
+ * React hook to call a function on component mount and unmount
4
+ *
5
+ * @param {EffectCallback} callback (function to call on mount that optionally returns a cleanup function to call on unmount)
6
+ * @returns {void}
7
+ */
8
+ export declare function useMountEffect(callback: EffectCallback): void;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * React hook to keep track of the previous value of a parameter
3
+ * https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
4
+ *
5
+ * @template T (type of the input value)
6
+ * @param {T} value (value to keep track of)
7
+ * @returns {(T | void)} (previous value or undefined if first render)
8
+ */
9
+ export declare function usePrevious<T>(value: T): T | undefined;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * A custom hook that detects whether an HTMLElement is being scrolled.
3
+ *
4
+ * @param {RefObject<HTMLElement>} ref - A ref object containing the HTMLElement to monitor for scrolling.
5
+ * @returns {boolean} - A boolean indicating whether the HTMLElement is being scrolled.
6
+ */
7
+ import { RefObject } from 'react';
8
+ export declare function useScrolling(ref: RefObject<HTMLElement>): boolean;
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import type { DeckDefinition, ModuleLocation, RobotType } from '@opentrons/shared-data';
3
+ export declare type DeckLocationSelectThemes = 'default' | 'grey';
4
+ export declare function useDeckLocationSelect(robotType: RobotType, theme?: DeckLocationSelectThemes): {
5
+ DeckLocationSelect: JSX.Element;
6
+ selectedLocation: ModuleLocation;
7
+ };
8
+ interface DeckLocationSelectProps {
9
+ deckDef: DeckDefinition;
10
+ selectedLocation: ModuleLocation;
11
+ theme?: DeckLocationSelectThemes;
12
+ setSelectedLocation?: (loc: ModuleLocation) => void;
13
+ disabledLocations?: ModuleLocation[];
14
+ isThermocycler?: boolean;
15
+ }
16
+ export declare function DeckLocationSelect({ deckDef, selectedLocation, setSelectedLocation, disabledLocations, theme, isThermocycler, }: DeckLocationSelectProps): JSX.Element;
17
+ export {};
@@ -0,0 +1,12 @@
1
+ import { MutableRefObject, CSSProperties } from 'react';
2
+ interface UseSwipeResult {
3
+ ref: MutableRefObject<null>;
4
+ style: CSSProperties;
5
+ isEnabled: boolean;
6
+ setSwipeType: (value: string) => void;
7
+ swipeType: string;
8
+ enable: () => void;
9
+ disable: () => void;
10
+ }
11
+ export declare const useSwipe: () => UseSwipeResult;
12
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * React hook to call a function after a delay; adapted from: useInterval
3
+ *
4
+ * @template T (type of the input value)
5
+ * @param {() => unknown} callback (function to call after timeout)
6
+ * @param {number | null} delay (timeout delay, or null to disable the timeout)
7
+ * @returns {void}
8
+ */
9
+ export declare function useTimeout(callback: () => unknown, delay: number | null): void;
@@ -0,0 +1,22 @@
1
+ export declare type UseToggleResult = [boolean, () => void];
2
+ /**
3
+ * React hook to toggle a boolean value
4
+ *
5
+ * @param {boolean} [intialValue=false] (initial toggle value)
6
+ * @returns {[boolean, () => void]} (value and setValue tuple)
7
+ *
8
+ * @example
9
+ * import * as React from 'react'
10
+ * import { useToggle } from '@opentrons/components'
11
+ *
12
+ * export function ToggleButton() {
13
+ * const [enabled, toggleEnabled] = useToggle(true)
14
+ *
15
+ * return (
16
+ * <button onClick={toggleEnabled}>
17
+ * Setting is {enabled ? 'enabled' : 'disabled'}
18
+ * </button>
19
+ * )
20
+ * }
21
+ */
22
+ export declare function useToggle(initialValue?: boolean): UseToggleResult;
@@ -0,0 +1,34 @@
1
+ import * as React from 'react';
2
+ import { ICON_DATA_BY_NAME } from './icon-data';
3
+ import type { SvgProps } from '../primitives';
4
+ export declare type IconName = keyof typeof ICON_DATA_BY_NAME;
5
+ export interface IconProps extends SvgProps {
6
+ /** name constant of the icon to display */
7
+ name: IconName;
8
+ /** classes to apply */
9
+ className?: string;
10
+ /** spin the icon with a CSS animation */
11
+ spin?: boolean;
12
+ /** x attribute as a number or string (for nesting inside another SVG) */
13
+ x?: number | string;
14
+ /** y attribute as a number or string (for nesting inside another SVG) */
15
+ y?: number | string;
16
+ /** width as a number or string (for nesting inside another SVG) */
17
+ svgHeight?: number | string;
18
+ /** height as a number or string (for nesting inside another SVG) */
19
+ svgWidth?: number | string;
20
+ /** inline style passed into the icon svg */
21
+ style?: Record<string, string | number>;
22
+ /** optional children */
23
+ children?: React.ReactNode;
24
+ id?: string;
25
+ }
26
+ /**
27
+ * Inline SVG icon component
28
+ *
29
+ * If you need access to the IconName type, you can:
30
+ * ```js
31
+ * import type { IconName } from '@opentrons/components'
32
+ * ```
33
+ */
34
+ export declare function Icon(props: IconProps): JSX.Element | null;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { IconName } from './Icon';
3
+ import type { ModuleType } from '@opentrons/shared-data';
4
+ import type { StyleProps } from '../primitives/types';
5
+ export declare const MODULE_ICON_NAME_BY_TYPE: {
6
+ [type in ModuleType]: IconName;
7
+ };
8
+ interface ModuleIconProps extends StyleProps {
9
+ moduleType: ModuleType;
10
+ }
11
+ export declare function ModuleIcon(props: ModuleIconProps): JSX.Element;
12
+ export {};
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import type { IconProps, IconName } from './Icon';
3
+ export interface NotificationIconProps extends IconProps {
4
+ /** name constant of the optional notifcation icon to display */
5
+ childName: IconName | null;
6
+ /** color to apply to notification icon (defaults to COLOR_WARNING) */
7
+ childColor?: string;
8
+ }
9
+ /**
10
+ * Inline SVG icon component with additional nested notification icon. Takes
11
+ * all the same props as Icon in addition to the ones listed above.
12
+ */
13
+ export declare function NotificationIcon(props: NotificationIconProps): JSX.Element;