@morscherlab/mint-sdk 1.0.0-alpha.2

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 (491) hide show
  1. package/README.md +326 -0
  2. package/dist/__stories__/experiment-helpers.d.ts +25 -0
  3. package/dist/__tests__/components/AppLayout.test.d.ts +1 -0
  4. package/dist/__tests__/components/AppSidebar.test.d.ts +1 -0
  5. package/dist/__tests__/components/AppTopBar.test.d.ts +1 -0
  6. package/dist/__tests__/components/BaseInput.test.d.ts +1 -0
  7. package/dist/__tests__/components/BasePill.test.d.ts +1 -0
  8. package/dist/__tests__/components/Calendar.test.d.ts +1 -0
  9. package/dist/__tests__/components/CollapsibleCard.test.d.ts +1 -0
  10. package/dist/__tests__/components/DataFrame.test.d.ts +1 -0
  11. package/dist/__tests__/components/DropdownButton.test.d.ts +1 -0
  12. package/dist/__tests__/composables/formBuilderRegistry.test.d.ts +1 -0
  13. package/dist/__tests__/composables/useAppExperiment.test.d.ts +1 -0
  14. package/dist/__tests__/composables/useAuth.test.d.ts +1 -0
  15. package/dist/__tests__/composables/useAutoGroup.test.d.ts +1 -0
  16. package/dist/__tests__/composables/useExperimentData.test.d.ts +13 -0
  17. package/dist/__tests__/composables/useExperimentSave.test.d.ts +1 -0
  18. package/dist/__tests__/composables/useForm.test.d.ts +1 -0
  19. package/dist/__tests__/composables/useFormBuilder.test.d.ts +1 -0
  20. package/dist/__tests__/composables/usePlatformContext.test.d.ts +1 -0
  21. package/dist/__tests__/composables/usePluginApi.test.d.ts +13 -0
  22. package/dist/__tests__/composables/usePluginConfig.test.d.ts +14 -0
  23. package/dist/__tests__/utils/color.test.d.ts +1 -0
  24. package/dist/auth-BYmxZdJl.js +297 -0
  25. package/dist/auth-BYmxZdJl.js.map +1 -0
  26. package/dist/components/AlertBox.vue.d.ts +34 -0
  27. package/dist/components/AppAvatarMenu.vue.d.ts +58 -0
  28. package/dist/components/AppContainer.vue.d.ts +28 -0
  29. package/dist/components/AppLayout.vue.d.ts +31 -0
  30. package/dist/components/AppPageSelector.vue.d.ts +43 -0
  31. package/dist/components/AppPillNav.vue.d.ts +11 -0
  32. package/dist/components/AppPluginSwitcher.vue.d.ts +38 -0
  33. package/dist/components/AppSidebar.vue.d.ts +47 -0
  34. package/dist/components/AppTopBar.vue.d.ts +111 -0
  35. package/dist/components/AuditTrail.vue.d.ts +38 -0
  36. package/dist/components/AutoGroupModal.vue.d.ts +124 -0
  37. package/dist/components/Avatar.vue.d.ts +14 -0
  38. package/dist/components/BaseButton.vue.d.ts +37 -0
  39. package/dist/components/BaseCheckbox.vue.d.ts +17 -0
  40. package/dist/components/BaseInput.vue.d.ts +34 -0
  41. package/dist/components/BaseModal.vue.d.ts +46 -0
  42. package/dist/components/BasePill.vue.d.ts +57 -0
  43. package/dist/components/BaseRadioGroup.vue.d.ts +21 -0
  44. package/dist/components/BaseSelect.vue.d.ts +20 -0
  45. package/dist/components/BaseSlider.vue.d.ts +22 -0
  46. package/dist/components/BaseTabs.vue.d.ts +14 -0
  47. package/dist/components/BaseTextarea.vue.d.ts +30 -0
  48. package/dist/components/BaseToggle.vue.d.ts +19 -0
  49. package/dist/components/BatchProgressList.vue.d.ts +43 -0
  50. package/dist/components/Breadcrumb.vue.d.ts +33 -0
  51. package/dist/components/Calendar.vue.d.ts +107 -0
  52. package/dist/components/ChartContainer.vue.d.ts +31 -0
  53. package/dist/components/ChemicalFormula.vue.d.ts +8 -0
  54. package/dist/components/CollapsibleCard.vue.d.ts +41 -0
  55. package/dist/components/ColorSlider.vue.d.ts +34 -0
  56. package/dist/components/ConcentrationInput.vue.d.ts +25 -0
  57. package/dist/components/ConfirmDialog.vue.d.ts +42 -0
  58. package/dist/components/DataFrame.vue.d.ts +107 -0
  59. package/dist/components/DatePicker.vue.d.ts +25 -0
  60. package/dist/components/DateTimePicker.vue.d.ts +30 -0
  61. package/dist/components/Divider.vue.d.ts +14 -0
  62. package/dist/components/DoseCalculator.vue.d.ts +19 -0
  63. package/dist/components/DropdownButton.vue.d.ts +47 -0
  64. package/dist/components/EmptyState.vue.d.ts +36 -0
  65. package/dist/components/ExperimentCodeBadge.vue.d.ts +14 -0
  66. package/dist/components/ExperimentDataViewer.vue.d.ts +29 -0
  67. package/dist/components/ExperimentPopover.vue.d.ts +32 -0
  68. package/dist/components/ExperimentSelectorModal.vue.d.ts +28 -0
  69. package/dist/components/ExperimentTimeline.vue.d.ts +44 -0
  70. package/dist/components/FileUploader.vue.d.ts +40 -0
  71. package/dist/components/FitPanel.vue.d.ts +46 -0
  72. package/dist/components/FormActions.vue.d.ts +33 -0
  73. package/dist/components/FormBuilder.vue.d.ts +287 -0
  74. package/dist/components/FormField.vue.d.ts +28 -0
  75. package/dist/components/FormFieldRenderer.vue.d.ts +31 -0
  76. package/dist/components/FormSection.vue.d.ts +43 -0
  77. package/dist/components/FormulaInput.vue.d.ts +25 -0
  78. package/dist/components/GroupAssigner.vue.d.ts +25 -0
  79. package/dist/components/GroupingModal.vue.d.ts +12 -0
  80. package/dist/components/IconButton.vue.d.ts +34 -0
  81. package/dist/components/LoadingSpinner.vue.d.ts +12 -0
  82. package/dist/components/MoleculeInput.vue.d.ts +27 -0
  83. package/dist/components/MultiSelect.vue.d.ts +19 -0
  84. package/dist/components/NumberInput.vue.d.ts +22 -0
  85. package/dist/components/PlateMapEditor.vue.d.ts +50 -0
  86. package/dist/components/ProgressBar.vue.d.ts +23 -0
  87. package/dist/components/ProtocolStepEditor.vue.d.ts +24 -0
  88. package/dist/components/RackEditor.vue.d.ts +40 -0
  89. package/dist/components/ReagentEditor.vue.d.ts +30 -0
  90. package/dist/components/ReagentList.vue.d.ts +32 -0
  91. package/dist/components/ResourceCard.vue.d.ts +50 -0
  92. package/dist/components/SampleHierarchyTree.vue.d.ts +26 -0
  93. package/dist/components/SampleLegend.vue.d.ts +32 -0
  94. package/dist/components/SampleSelector.vue.d.ts +29 -0
  95. package/dist/components/ScheduleCalendar.vue.d.ts +110 -0
  96. package/dist/components/ScientificNumber.vue.d.ts +14 -0
  97. package/dist/components/SegmentedControl.vue.d.ts +20 -0
  98. package/dist/components/SequenceInput.vue.d.ts +54 -0
  99. package/dist/components/SettingsButton.vue.d.ts +30 -0
  100. package/dist/components/SettingsModal.vue.d.ts +36 -0
  101. package/dist/components/Skeleton.vue.d.ts +11 -0
  102. package/dist/components/StatusIndicator.vue.d.ts +13 -0
  103. package/dist/components/StepWizard.vue.d.ts +65 -0
  104. package/dist/components/TagsInput.vue.d.ts +39 -0
  105. package/dist/components/ThemeToggle.vue.d.ts +7 -0
  106. package/dist/components/TimePicker.vue.d.ts +29 -0
  107. package/dist/components/TimeRangeInput.vue.d.ts +27 -0
  108. package/dist/components/ToastNotification.vue.d.ts +2 -0
  109. package/dist/components/Tooltip.vue.d.ts +35 -0
  110. package/dist/components/UnitInput.vue.d.ts +39 -0
  111. package/dist/components/WellEditPopup.vue.d.ts +25 -0
  112. package/dist/components/WellPlate.vue.d.ts +73 -0
  113. package/dist/components/index.d.ts +87 -0
  114. package/dist/components/index.js +3 -0
  115. package/dist/components-CKf-UpGi.js +15089 -0
  116. package/dist/components-CKf-UpGi.js.map +1 -0
  117. package/dist/composables/experiment-utils.d.ts +8 -0
  118. package/dist/composables/formBuilderRegistry.d.ts +13 -0
  119. package/dist/composables/index.d.ts +28 -0
  120. package/dist/composables/index.js +3 -0
  121. package/dist/composables/useApi.d.ts +20 -0
  122. package/dist/composables/useAppExperiment.d.ts +37 -0
  123. package/dist/composables/useAsync.d.ts +128 -0
  124. package/dist/composables/useAuth.d.ts +47 -0
  125. package/dist/composables/useAutoGroup.d.ts +106 -0
  126. package/dist/composables/useChemicalFormula.d.ts +21 -0
  127. package/dist/composables/useConcentrationUnits.d.ts +29 -0
  128. package/dist/composables/useDoseCalculator.d.ts +58 -0
  129. package/dist/composables/useExperimentData.d.ts +18 -0
  130. package/dist/composables/useExperimentSave.d.ts +36 -0
  131. package/dist/composables/useExperimentSelector.d.ts +30 -0
  132. package/dist/composables/useForm.d.ts +92 -0
  133. package/dist/composables/useFormBuilder.d.ts +24 -0
  134. package/dist/composables/usePasskey.d.ts +10 -0
  135. package/dist/composables/usePlatformContext.d.ts +131 -0
  136. package/dist/composables/usePluginApi.d.ts +29 -0
  137. package/dist/composables/usePluginConfig.d.ts +13 -0
  138. package/dist/composables/useProtocolTemplates.d.ts +44 -0
  139. package/dist/composables/useRackEditor.d.ts +31 -0
  140. package/dist/composables/useReagentSeries.d.ts +23 -0
  141. package/dist/composables/useScheduleDrag.d.ts +78 -0
  142. package/dist/composables/useSequenceUtils.d.ts +14 -0
  143. package/dist/composables/useTheme.d.ts +8 -0
  144. package/dist/composables/useTimeUtils.d.ts +29 -0
  145. package/dist/composables/useToast.d.ts +22 -0
  146. package/dist/composables/useWellPlateEditor.d.ts +33 -0
  147. package/dist/composables-D0QfFzq1.js +805 -0
  148. package/dist/composables-D0QfFzq1.js.map +1 -0
  149. package/dist/histoire.setup.d.ts +1 -0
  150. package/dist/index.d.ts +6 -0
  151. package/dist/index.js +7 -0
  152. package/dist/install.d.ts +16 -0
  153. package/dist/install.js +23 -0
  154. package/dist/install.js.map +1 -0
  155. package/dist/stores/auth.d.ts +146 -0
  156. package/dist/stores/index.d.ts +2 -0
  157. package/dist/stores/index.js +2 -0
  158. package/dist/stores/settings.d.ts +75 -0
  159. package/dist/styles.css +29728 -0
  160. package/dist/tailwind.preset.d.ts +58 -0
  161. package/dist/tailwind.preset.js +66 -0
  162. package/dist/tailwind.preset.js.map +1 -0
  163. package/dist/types/auth.d.ts +42 -0
  164. package/dist/types/auto-group.d.ts +34 -0
  165. package/dist/types/components.d.ts +528 -0
  166. package/dist/types/form-builder.d.ts +167 -0
  167. package/dist/types/index.d.ts +5 -0
  168. package/dist/types/index.js +0 -0
  169. package/dist/types/platform.d.ts +75 -0
  170. package/dist/useScheduleDrag-DAJueTbK.js +7181 -0
  171. package/dist/useScheduleDrag-DAJueTbK.js.map +1 -0
  172. package/dist/utils/color.d.ts +24 -0
  173. package/package.json +114 -0
  174. package/src/__stories__/experiment-helpers.ts +83 -0
  175. package/src/__tests__/components/AppLayout.test.ts +163 -0
  176. package/src/__tests__/components/AppSidebar.test.ts +292 -0
  177. package/src/__tests__/components/AppTopBar.test.ts +683 -0
  178. package/src/__tests__/components/BaseInput.test.ts +99 -0
  179. package/src/__tests__/components/BasePill.test.ts +291 -0
  180. package/src/__tests__/components/Calendar.test.ts +566 -0
  181. package/src/__tests__/components/CollapsibleCard.test.ts +524 -0
  182. package/src/__tests__/components/DataFrame.test.ts +767 -0
  183. package/src/__tests__/components/DropdownButton.test.ts +471 -0
  184. package/src/__tests__/composables/formBuilderRegistry.test.ts +187 -0
  185. package/src/__tests__/composables/useAppExperiment.test.ts +560 -0
  186. package/src/__tests__/composables/useAuth.test.ts +188 -0
  187. package/src/__tests__/composables/useAutoGroup.test.ts +860 -0
  188. package/src/__tests__/composables/useExperimentData.test.ts +127 -0
  189. package/src/__tests__/composables/useExperimentSave.test.ts +347 -0
  190. package/src/__tests__/composables/useForm.test.ts +205 -0
  191. package/src/__tests__/composables/useFormBuilder.test.ts +917 -0
  192. package/src/__tests__/composables/usePlatformContext.test.ts +116 -0
  193. package/src/__tests__/composables/usePluginApi.test.ts +81 -0
  194. package/src/__tests__/composables/usePluginConfig.test.ts +176 -0
  195. package/src/__tests__/utils/color.test.ts +96 -0
  196. package/src/components/AlertBox.story.vue +204 -0
  197. package/src/components/AlertBox.vue +88 -0
  198. package/src/components/AppAvatarMenu.story.vue +155 -0
  199. package/src/components/AppAvatarMenu.vue +184 -0
  200. package/src/components/AppContainer.story.vue +104 -0
  201. package/src/components/AppContainer.vue +34 -0
  202. package/src/components/AppLayout.story.vue +292 -0
  203. package/src/components/AppLayout.vue +75 -0
  204. package/src/components/AppPageSelector.vue +159 -0
  205. package/src/components/AppPillNav.vue +66 -0
  206. package/src/components/AppPluginSwitcher.vue +241 -0
  207. package/src/components/AppSidebar.story.vue +309 -0
  208. package/src/components/AppSidebar.vue +119 -0
  209. package/src/components/AppTopBar.story.vue +304 -0
  210. package/src/components/AppTopBar.vue +661 -0
  211. package/src/components/AuditTrail.story.vue +163 -0
  212. package/src/components/AuditTrail.vue +151 -0
  213. package/src/components/AutoGroupModal.story.vue +273 -0
  214. package/src/components/AutoGroupModal.vue +566 -0
  215. package/src/components/Avatar.story.vue +115 -0
  216. package/src/components/Avatar.vue +79 -0
  217. package/src/components/BaseButton.story.vue +96 -0
  218. package/src/components/BaseButton.vue +73 -0
  219. package/src/components/BaseCheckbox.story.vue +73 -0
  220. package/src/components/BaseCheckbox.vue +69 -0
  221. package/src/components/BaseInput.story.vue +98 -0
  222. package/src/components/BaseInput.vue +74 -0
  223. package/src/components/BaseModal.story.vue +237 -0
  224. package/src/components/BaseModal.vue +182 -0
  225. package/src/components/BasePill.story.vue +142 -0
  226. package/src/components/BasePill.vue +89 -0
  227. package/src/components/BaseRadioGroup.story.vue +145 -0
  228. package/src/components/BaseRadioGroup.vue +124 -0
  229. package/src/components/BaseSelect.story.vue +120 -0
  230. package/src/components/BaseSelect.vue +71 -0
  231. package/src/components/BaseSlider.story.vue +122 -0
  232. package/src/components/BaseSlider.vue +126 -0
  233. package/src/components/BaseTabs.story.vue +127 -0
  234. package/src/components/BaseTabs.vue +59 -0
  235. package/src/components/BaseTextarea.story.vue +91 -0
  236. package/src/components/BaseTextarea.vue +62 -0
  237. package/src/components/BaseToggle.story.vue +81 -0
  238. package/src/components/BaseToggle.vue +76 -0
  239. package/src/components/BatchProgressList.story.vue +92 -0
  240. package/src/components/BatchProgressList.vue +184 -0
  241. package/src/components/Breadcrumb.story.vue +106 -0
  242. package/src/components/Breadcrumb.vue +75 -0
  243. package/src/components/Calendar.story.vue +106 -0
  244. package/src/components/Calendar.vue +363 -0
  245. package/src/components/ChartContainer.story.vue +113 -0
  246. package/src/components/ChartContainer.vue +64 -0
  247. package/src/components/ChemicalFormula.story.vue +102 -0
  248. package/src/components/ChemicalFormula.vue +39 -0
  249. package/src/components/CollapsibleCard.story.vue +135 -0
  250. package/src/components/CollapsibleCard.vue +167 -0
  251. package/src/components/ColorSlider.story.vue +120 -0
  252. package/src/components/ColorSlider.vue +164 -0
  253. package/src/components/ConcentrationInput.story.vue +77 -0
  254. package/src/components/ConcentrationInput.vue +185 -0
  255. package/src/components/ConfirmDialog.story.vue +248 -0
  256. package/src/components/ConfirmDialog.vue +93 -0
  257. package/src/components/DataFrame.story.vue +148 -0
  258. package/src/components/DataFrame.vue +419 -0
  259. package/src/components/DatePicker.story.vue +119 -0
  260. package/src/components/DatePicker.vue +330 -0
  261. package/src/components/DateTimePicker.story.vue +112 -0
  262. package/src/components/DateTimePicker.vue +392 -0
  263. package/src/components/Divider.story.vue +80 -0
  264. package/src/components/Divider.vue +49 -0
  265. package/src/components/DoseCalculator.story.vue +68 -0
  266. package/src/components/DoseCalculator.vue +476 -0
  267. package/src/components/DropdownButton.story.vue +102 -0
  268. package/src/components/DropdownButton.vue +181 -0
  269. package/src/components/EmptyState.story.vue +135 -0
  270. package/src/components/EmptyState.vue +69 -0
  271. package/src/components/ExperimentCodeBadge.story.vue +77 -0
  272. package/src/components/ExperimentCodeBadge.vue +64 -0
  273. package/src/components/ExperimentDataViewer.story.vue +174 -0
  274. package/src/components/ExperimentDataViewer.vue +288 -0
  275. package/src/components/ExperimentPopover.story.vue +384 -0
  276. package/src/components/ExperimentPopover.vue +241 -0
  277. package/src/components/ExperimentSelectorModal.story.vue +391 -0
  278. package/src/components/ExperimentSelectorModal.vue +387 -0
  279. package/src/components/ExperimentTimeline.story.vue +161 -0
  280. package/src/components/ExperimentTimeline.vue +382 -0
  281. package/src/components/FileUploader.story.vue +107 -0
  282. package/src/components/FileUploader.vue +386 -0
  283. package/src/components/FitPanel.story.vue +125 -0
  284. package/src/components/FitPanel.vue +120 -0
  285. package/src/components/FormActions.vue +92 -0
  286. package/src/components/FormBuilder.vue +214 -0
  287. package/src/components/FormField.story.vue +132 -0
  288. package/src/components/FormField.vue +59 -0
  289. package/src/components/FormFieldRenderer.vue +58 -0
  290. package/src/components/FormSection.vue +90 -0
  291. package/src/components/FormulaInput.story.vue +96 -0
  292. package/src/components/FormulaInput.vue +125 -0
  293. package/src/components/GroupAssigner.story.vue +83 -0
  294. package/src/components/GroupAssigner.vue +284 -0
  295. package/src/components/GroupingModal.story.vue +52 -0
  296. package/src/components/GroupingModal.vue +422 -0
  297. package/src/components/IconButton.story.vue +135 -0
  298. package/src/components/IconButton.vue +73 -0
  299. package/src/components/LoadingSpinner.story.vue +70 -0
  300. package/src/components/LoadingSpinner.vue +50 -0
  301. package/src/components/MoleculeInput.story.vue +66 -0
  302. package/src/components/MoleculeInput.vue +426 -0
  303. package/src/components/MultiSelect.story.vue +132 -0
  304. package/src/components/MultiSelect.vue +118 -0
  305. package/src/components/NumberInput.story.vue +122 -0
  306. package/src/components/NumberInput.vue +160 -0
  307. package/src/components/PlateMapEditor.story.vue +92 -0
  308. package/src/components/PlateMapEditor.vue +513 -0
  309. package/src/components/ProgressBar.story.vue +148 -0
  310. package/src/components/ProgressBar.vue +114 -0
  311. package/src/components/ProtocolStepEditor.story.vue +69 -0
  312. package/src/components/ProtocolStepEditor.vue +522 -0
  313. package/src/components/RackEditor.story.vue +100 -0
  314. package/src/components/RackEditor.vue +371 -0
  315. package/src/components/ReagentEditor.story.vue +153 -0
  316. package/src/components/ReagentEditor.vue +418 -0
  317. package/src/components/ReagentList.story.vue +137 -0
  318. package/src/components/ReagentList.vue +463 -0
  319. package/src/components/ResourceCard.story.vue +150 -0
  320. package/src/components/ResourceCard.vue +161 -0
  321. package/src/components/SampleHierarchyTree.story.vue +161 -0
  322. package/src/components/SampleHierarchyTree.vue +256 -0
  323. package/src/components/SampleLegend.story.vue +91 -0
  324. package/src/components/SampleLegend.vue +119 -0
  325. package/src/components/SampleSelector.story.vue +111 -0
  326. package/src/components/SampleSelector.vue +1033 -0
  327. package/src/components/ScheduleCalendar.story.vue +195 -0
  328. package/src/components/ScheduleCalendar.vue +569 -0
  329. package/src/components/ScientificNumber.story.vue +127 -0
  330. package/src/components/ScientificNumber.vue +197 -0
  331. package/src/components/SegmentedControl.story.vue +132 -0
  332. package/src/components/SegmentedControl.vue +79 -0
  333. package/src/components/SequenceInput.story.vue +119 -0
  334. package/src/components/SequenceInput.vue +209 -0
  335. package/src/components/SettingsButton.story.vue +58 -0
  336. package/src/components/SettingsButton.vue +76 -0
  337. package/src/components/SettingsModal.story.vue +145 -0
  338. package/src/components/SettingsModal.vue +146 -0
  339. package/src/components/Skeleton.story.vue +141 -0
  340. package/src/components/Skeleton.vue +74 -0
  341. package/src/components/StatusIndicator.story.vue +99 -0
  342. package/src/components/StatusIndicator.vue +40 -0
  343. package/src/components/StepWizard.story.vue +155 -0
  344. package/src/components/StepWizard.vue +223 -0
  345. package/src/components/TagsInput.story.vue +155 -0
  346. package/src/components/TagsInput.vue +265 -0
  347. package/src/components/ThemeToggle.story.vue +36 -0
  348. package/src/components/ThemeToggle.vue +54 -0
  349. package/src/components/TimePicker.story.vue +96 -0
  350. package/src/components/TimePicker.vue +273 -0
  351. package/src/components/TimeRangeInput.story.vue +104 -0
  352. package/src/components/TimeRangeInput.vue +122 -0
  353. package/src/components/ToastNotification.story.vue +157 -0
  354. package/src/components/ToastNotification.vue +62 -0
  355. package/src/components/Tooltip.story.vue +138 -0
  356. package/src/components/Tooltip.vue +119 -0
  357. package/src/components/UnitInput.story.vue +194 -0
  358. package/src/components/UnitInput.vue +213 -0
  359. package/src/components/WellEditPopup.vue +234 -0
  360. package/src/components/WellPlate.story.vue +282 -0
  361. package/src/components/WellPlate.vue +830 -0
  362. package/src/components/index.ts +118 -0
  363. package/src/composables/experiment-utils.ts +57 -0
  364. package/src/composables/formBuilderRegistry.ts +79 -0
  365. package/src/composables/index.ts +140 -0
  366. package/src/composables/useApi.ts +167 -0
  367. package/src/composables/useAppExperiment.ts +159 -0
  368. package/src/composables/useAsync.ts +323 -0
  369. package/src/composables/useAuth.ts +445 -0
  370. package/src/composables/useAutoGroup.ts +641 -0
  371. package/src/composables/useChemicalFormula.ts +275 -0
  372. package/src/composables/useConcentrationUnits.ts +246 -0
  373. package/src/composables/useDoseCalculator.ts +370 -0
  374. package/src/composables/useExperimentData.ts +86 -0
  375. package/src/composables/useExperimentSave.ts +192 -0
  376. package/src/composables/useExperimentSelector.ts +292 -0
  377. package/src/composables/useForm.ts +416 -0
  378. package/src/composables/useFormBuilder.ts +383 -0
  379. package/src/composables/usePasskey.ts +216 -0
  380. package/src/composables/usePlatformContext.ts +299 -0
  381. package/src/composables/usePluginApi.ts +39 -0
  382. package/src/composables/usePluginConfig.ts +93 -0
  383. package/src/composables/useProtocolTemplates.ts +518 -0
  384. package/src/composables/useRackEditor.ts +222 -0
  385. package/src/composables/useReagentSeries.ts +91 -0
  386. package/src/composables/useScheduleDrag.ts +245 -0
  387. package/src/composables/useSequenceUtils.ts +105 -0
  388. package/src/composables/useTheme.ts +58 -0
  389. package/src/composables/useTimeUtils.ts +131 -0
  390. package/src/composables/useToast.ts +40 -0
  391. package/src/composables/useWellPlateEditor.ts +421 -0
  392. package/src/histoire.setup.ts +17 -0
  393. package/src/index.ts +367 -0
  394. package/src/install.ts +32 -0
  395. package/src/stores/auth.ts +152 -0
  396. package/src/stores/index.ts +2 -0
  397. package/src/stores/settings.ts +218 -0
  398. package/src/styles/components/alert-box.css +150 -0
  399. package/src/styles/components/app-avatar-menu.css +155 -0
  400. package/src/styles/components/app-container.css +33 -0
  401. package/src/styles/components/app-layout.css +98 -0
  402. package/src/styles/components/app-page-selector.css +191 -0
  403. package/src/styles/components/app-pill-nav.css +57 -0
  404. package/src/styles/components/app-plugin-switcher.css +209 -0
  405. package/src/styles/components/app-sidebar.css +145 -0
  406. package/src/styles/components/app-top-bar.css +492 -0
  407. package/src/styles/components/audit-trail.css +143 -0
  408. package/src/styles/components/auto-group-modal.css +644 -0
  409. package/src/styles/components/avatar.css +73 -0
  410. package/src/styles/components/batch-progress-list.css +196 -0
  411. package/src/styles/components/breadcrumb.css +64 -0
  412. package/src/styles/components/button.css +188 -0
  413. package/src/styles/components/calendar.css +192 -0
  414. package/src/styles/components/chart-container.css +69 -0
  415. package/src/styles/components/checkbox.css +123 -0
  416. package/src/styles/components/chemical-formula.css +46 -0
  417. package/src/styles/components/collapsible-card.css +253 -0
  418. package/src/styles/components/color-slider.css +110 -0
  419. package/src/styles/components/concentration-input.css +156 -0
  420. package/src/styles/components/confirm-dialog.css +183 -0
  421. package/src/styles/components/dataframe.css +382 -0
  422. package/src/styles/components/date-picker.css +243 -0
  423. package/src/styles/components/datetime-picker.css +229 -0
  424. package/src/styles/components/divider.css +63 -0
  425. package/src/styles/components/dose-calculator.css +301 -0
  426. package/src/styles/components/dropdown-button.css +280 -0
  427. package/src/styles/components/empty-state.css +151 -0
  428. package/src/styles/components/experiment-code-badge.css +33 -0
  429. package/src/styles/components/experiment-data-viewer.css +138 -0
  430. package/src/styles/components/experiment-popover.css +562 -0
  431. package/src/styles/components/experiment-selector-modal.css +285 -0
  432. package/src/styles/components/experiment-timeline.css +529 -0
  433. package/src/styles/components/file-uploader.css +310 -0
  434. package/src/styles/components/fit-panel.css +67 -0
  435. package/src/styles/components/form-builder.css +69 -0
  436. package/src/styles/components/form-field.css +48 -0
  437. package/src/styles/components/formula-input.css +103 -0
  438. package/src/styles/components/group-assigner.css +200 -0
  439. package/src/styles/components/grouping-modal.css +323 -0
  440. package/src/styles/components/icon-button.css +192 -0
  441. package/src/styles/components/input.css +66 -0
  442. package/src/styles/components/loading-spinner.css +67 -0
  443. package/src/styles/components/modal.css +350 -0
  444. package/src/styles/components/molecule-input.css +186 -0
  445. package/src/styles/components/multi-select.css +131 -0
  446. package/src/styles/components/number-input.css +199 -0
  447. package/src/styles/components/pill.css +188 -0
  448. package/src/styles/components/plate-map-editor.css +464 -0
  449. package/src/styles/components/progress-bar.css +133 -0
  450. package/src/styles/components/protocol-step-editor.css +449 -0
  451. package/src/styles/components/rack-editor.css +265 -0
  452. package/src/styles/components/radio-group.css +240 -0
  453. package/src/styles/components/reagent-editor.css +510 -0
  454. package/src/styles/components/reagent-list.css +407 -0
  455. package/src/styles/components/resource-card.css +360 -0
  456. package/src/styles/components/sample-hierarchy-tree.css +314 -0
  457. package/src/styles/components/sample-legend.css +201 -0
  458. package/src/styles/components/sample-selector.css +751 -0
  459. package/src/styles/components/schedule-calendar.css +478 -0
  460. package/src/styles/components/scientific-number.css +63 -0
  461. package/src/styles/components/segmented-control.css +197 -0
  462. package/src/styles/components/select.css +77 -0
  463. package/src/styles/components/sequence-input.css +184 -0
  464. package/src/styles/components/settings-button.css +94 -0
  465. package/src/styles/components/settings-modal.css +95 -0
  466. package/src/styles/components/skeleton.css +49 -0
  467. package/src/styles/components/slider.css +74 -0
  468. package/src/styles/components/status-indicator.css +66 -0
  469. package/src/styles/components/step-wizard.css +192 -0
  470. package/src/styles/components/tabs.css +95 -0
  471. package/src/styles/components/tags-input.css +195 -0
  472. package/src/styles/components/textarea.css +82 -0
  473. package/src/styles/components/theme-toggle.css +69 -0
  474. package/src/styles/components/time-picker.css +171 -0
  475. package/src/styles/components/time-range-input.css +42 -0
  476. package/src/styles/components/toast.css +91 -0
  477. package/src/styles/components/toggle.css +146 -0
  478. package/src/styles/components/tooltip.css +91 -0
  479. package/src/styles/components/unit-input.css +123 -0
  480. package/src/styles/components/well-edit-popup.css +252 -0
  481. package/src/styles/components/well-plate.css +307 -0
  482. package/src/styles/index.css +87 -0
  483. package/src/styles/variables.css +1117 -0
  484. package/src/tailwind.preset.ts +61 -0
  485. package/src/types/auth.ts +55 -0
  486. package/src/types/auto-group.ts +40 -0
  487. package/src/types/components.ts +710 -0
  488. package/src/types/form-builder.ts +197 -0
  489. package/src/types/index.ts +207 -0
  490. package/src/types/platform.ts +116 -0
  491. package/src/utils/color.ts +96 -0
@@ -0,0 +1,522 @@
1
+ <script setup lang="ts">
2
+ /** Form for creating or editing a single protocol step (incubation, wash, addition, centrifuge, etc.) with template picker, typed parameters, and duration. */
3
+ import { ref, computed, watch, onMounted, onUnmounted } from 'vue'
4
+ import type { ProtocolStep, ProtocolStepType, ProtocolStepStatus } from '../types'
5
+ import {
6
+ useProtocolTemplates,
7
+ type StepTemplate,
8
+ } from '../composables/useProtocolTemplates'
9
+ import ConcentrationInput from './ConcentrationInput.vue'
10
+ import type { ConcentrationValue } from '../composables/useConcentrationUnits'
11
+
12
+ interface Props {
13
+ modelValue?: ProtocolStep
14
+ templates?: StepTemplate[]
15
+ customTemplates?: StepTemplate[]
16
+ mode?: 'create' | 'edit'
17
+ showPreview?: boolean
18
+ }
19
+
20
+ const props = withDefaults(defineProps<Props>(), {
21
+ mode: 'create',
22
+ showPreview: true,
23
+ })
24
+
25
+ const emit = defineEmits<{
26
+ 'update:modelValue': [step: ProtocolStep]
27
+ 'save': [step: ProtocolStep]
28
+ 'save-template': [template: StepTemplate]
29
+ 'cancel': []
30
+ }>()
31
+
32
+ const {
33
+ allTemplates,
34
+ getTemplateByType,
35
+ validateStep,
36
+ formatParameterValue,
37
+ } = useProtocolTemplates()
38
+
39
+ // State
40
+ const selectedTemplateId = ref<string | null>(null)
41
+ const dropdownOpen = ref(false)
42
+ const stepName = ref('')
43
+ const stepDescription = ref('')
44
+ const stepDuration = ref<number | undefined>()
45
+ const parameters = ref<Record<string, unknown>>({})
46
+ const validationErrors = ref<Record<string, string>>({})
47
+
48
+ // Combined templates from props and composable
49
+ const availableTemplates = computed(() => {
50
+ if (props.templates && props.templates.length > 0) {
51
+ return props.templates
52
+ }
53
+ const combined = [...allTemplates.value]
54
+ if (props.customTemplates) {
55
+ combined.push(...props.customTemplates)
56
+ }
57
+ return combined
58
+ })
59
+
60
+ // Selected template
61
+ const selectedTemplate = computed(() => {
62
+ if (!selectedTemplateId.value) return null
63
+ return availableTemplates.value.find((t) => t.id === selectedTemplateId.value) || null
64
+ })
65
+
66
+ // Step type icons (same as ExperimentTimeline)
67
+ const stepTypeIcons: Record<ProtocolStepType, string> = {
68
+ incubation: 'M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z',
69
+ wash: 'M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z',
70
+ addition: 'M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z',
71
+ measurement: 'M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z',
72
+ transfer: 'M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4',
73
+ centrifuge: 'M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15',
74
+ mix: 'M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z',
75
+ custom: 'M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z',
76
+ }
77
+
78
+ // Preview computed
79
+ const previewStep = computed<ProtocolStep | null>(() => {
80
+ if (!selectedTemplate.value) return null
81
+ return {
82
+ id: props.modelValue?.id || 'preview',
83
+ type: selectedTemplate.value.type,
84
+ name: stepName.value || selectedTemplate.value.name,
85
+ description: stepDescription.value,
86
+ duration: stepDuration.value ?? selectedTemplate.value.defaultDuration,
87
+ status: (props.modelValue?.status || 'pending') as ProtocolStepStatus,
88
+ parameters: { ...parameters.value },
89
+ order: props.modelValue?.order || 0,
90
+ }
91
+ })
92
+
93
+ const previewParams = computed(() => {
94
+ if (!selectedTemplate.value || !previewStep.value) return ''
95
+ return selectedTemplate.value.parameters
96
+ .filter((p) => parameters.value[p.key] !== undefined && parameters.value[p.key] !== '')
97
+ .map((p) => formatParameterValue(parameters.value[p.key], p))
98
+ .join(', ')
99
+ })
100
+
101
+ // Initialize from modelValue
102
+ function initFromStep(step: ProtocolStep) {
103
+ const template = getTemplateByType(step.type)
104
+ if (template) {
105
+ selectedTemplateId.value = template.id
106
+ }
107
+ stepName.value = step.name
108
+ stepDescription.value = step.description || ''
109
+ stepDuration.value = step.duration
110
+ parameters.value = { ...(step.parameters || {}) }
111
+ }
112
+
113
+ // Handle template selection
114
+ function selectTemplate(template: StepTemplate) {
115
+ selectedTemplateId.value = template.id
116
+ dropdownOpen.value = false
117
+
118
+ // Reset to template defaults if creating new
119
+ if (props.mode === 'create') {
120
+ stepName.value = template.name
121
+ stepDescription.value = template.description || ''
122
+ stepDuration.value = template.defaultDuration
123
+
124
+ parameters.value = {}
125
+ for (const param of template.parameters) {
126
+ if (param.default !== undefined) {
127
+ parameters.value[param.key] = param.default
128
+ }
129
+ }
130
+ }
131
+ }
132
+
133
+ // Handle parameter change
134
+ function handleParamChange(key: string, value: unknown) {
135
+ parameters.value[key] = value
136
+ // Clear validation error when user changes value
137
+ if (validationErrors.value[key]) {
138
+ delete validationErrors.value[key]
139
+ }
140
+ }
141
+
142
+ // Handle concentration change
143
+ function handleConcentrationChange(key: string, value: ConcentrationValue | undefined) {
144
+ parameters.value[key] = value
145
+ if (validationErrors.value[key]) {
146
+ delete validationErrors.value[key]
147
+ }
148
+ }
149
+
150
+ // Validate and save
151
+ function handleSave() {
152
+ if (!selectedTemplate.value || !previewStep.value) return
153
+
154
+ const result = validateStep(previewStep.value, selectedTemplate.value)
155
+ validationErrors.value = result.errors
156
+
157
+ if (result.valid) {
158
+ emit('save', previewStep.value)
159
+ emit('update:modelValue', previewStep.value)
160
+ }
161
+ }
162
+
163
+ // Save as template
164
+ function handleSaveTemplate() {
165
+ if (!selectedTemplate.value) return
166
+
167
+ const newTemplate: StepTemplate = {
168
+ id: `custom-${Date.now()}`,
169
+ type: selectedTemplate.value.type,
170
+ name: stepName.value || selectedTemplate.value.name,
171
+ description: stepDescription.value,
172
+ defaultDuration: stepDuration.value,
173
+ parameters: selectedTemplate.value.parameters.map((p) => ({
174
+ ...p,
175
+ default: parameters.value[p.key],
176
+ })),
177
+ isBuiltIn: false,
178
+ }
179
+
180
+ emit('save-template', newTemplate)
181
+ }
182
+
183
+ // Handle cancel
184
+ function handleCancel() {
185
+ emit('cancel')
186
+ }
187
+
188
+ // Close dropdown on click outside
189
+ function handleClickOutside(event: MouseEvent) {
190
+ const target = event.target as HTMLElement
191
+ if (!target.closest('.mld-protocol-editor__template-dropdown')) {
192
+ dropdownOpen.value = false
193
+ }
194
+ }
195
+
196
+ // Format duration
197
+ function formatDuration(minutes: number | undefined): string {
198
+ if (minutes === undefined) return ''
199
+ if (minutes < 60) return `${minutes}m`
200
+ const hours = Math.floor(minutes / 60)
201
+ const mins = minutes % 60
202
+ return mins > 0 ? `${hours}h ${mins}m` : `${hours}h`
203
+ }
204
+
205
+ // Lifecycle
206
+ onMounted(() => {
207
+ document.addEventListener('click', handleClickOutside)
208
+
209
+ if (props.modelValue) {
210
+ initFromStep(props.modelValue)
211
+ } else if (availableTemplates.value.length > 0) {
212
+ selectTemplate(availableTemplates.value[0])
213
+ }
214
+ })
215
+
216
+ onUnmounted(() => {
217
+ document.removeEventListener('click', handleClickOutside)
218
+ })
219
+
220
+ // Watch for external changes
221
+ watch(
222
+ () => props.modelValue,
223
+ (step) => {
224
+ if (step) {
225
+ initFromStep(step)
226
+ }
227
+ }
228
+ )
229
+ </script>
230
+
231
+ <template>
232
+ <div class="mld-protocol-editor">
233
+ <!-- Header -->
234
+ <div class="mld-protocol-editor__header">
235
+ <span class="mld-protocol-editor__title">
236
+ {{ mode === 'create' ? 'Create Protocol Step' : 'Edit Protocol Step' }}
237
+ </span>
238
+ <span
239
+ :class="[
240
+ 'mld-protocol-editor__mode-badge',
241
+ `mld-protocol-editor__mode-badge--${mode}`,
242
+ ]"
243
+ >
244
+ {{ mode }}
245
+ </span>
246
+ </div>
247
+
248
+ <!-- Form -->
249
+ <div class="mld-protocol-editor__form">
250
+ <!-- Template selector -->
251
+ <div class="mld-protocol-editor__template-select">
252
+ <label class="mld-protocol-editor__template-label">Template</label>
253
+ <div class="mld-protocol-editor__template-dropdown">
254
+ <button
255
+ type="button"
256
+ class="mld-protocol-editor__template-btn"
257
+ @click.stop="dropdownOpen = !dropdownOpen"
258
+ >
259
+ <svg
260
+ v-if="selectedTemplate"
261
+ class="mld-protocol-editor__template-icon"
262
+ fill="none"
263
+ stroke="currentColor"
264
+ viewBox="0 0 24 24"
265
+ >
266
+ <path
267
+ stroke-linecap="round"
268
+ stroke-linejoin="round"
269
+ stroke-width="2"
270
+ :d="stepTypeIcons[selectedTemplate.type]"
271
+ />
272
+ </svg>
273
+ <span class="mld-protocol-editor__template-text">
274
+ {{ selectedTemplate?.name || 'Select template...' }}
275
+ </span>
276
+ <svg
277
+ :class="[
278
+ 'mld-protocol-editor__template-arrow',
279
+ dropdownOpen ? 'mld-protocol-editor__template-arrow--open' : '',
280
+ ]"
281
+ fill="none"
282
+ stroke="currentColor"
283
+ viewBox="0 0 24 24"
284
+ >
285
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
286
+ </svg>
287
+ </button>
288
+
289
+ <div v-if="dropdownOpen" class="mld-protocol-editor__template-menu">
290
+ <button
291
+ v-for="template in availableTemplates"
292
+ :key="template.id"
293
+ type="button"
294
+ :class="[
295
+ 'mld-protocol-editor__template-option',
296
+ selectedTemplateId === template.id ? 'mld-protocol-editor__template-option--active' : '',
297
+ ]"
298
+ @click="selectTemplate(template)"
299
+ >
300
+ <svg
301
+ class="mld-protocol-editor__template-option-icon"
302
+ fill="none"
303
+ stroke="currentColor"
304
+ viewBox="0 0 24 24"
305
+ >
306
+ <path
307
+ stroke-linecap="round"
308
+ stroke-linejoin="round"
309
+ stroke-width="2"
310
+ :d="stepTypeIcons[template.type]"
311
+ />
312
+ </svg>
313
+ <div class="mld-protocol-editor__template-option-text">
314
+ <div>{{ template.name }}</div>
315
+ <div v-if="template.description" class="mld-protocol-editor__template-option-desc">
316
+ {{ template.description }}
317
+ </div>
318
+ </div>
319
+ </button>
320
+ </div>
321
+ </div>
322
+ </div>
323
+
324
+ <div class="mld-protocol-editor__divider" />
325
+
326
+ <!-- Step name -->
327
+ <div class="mld-protocol-editor__field">
328
+ <label class="mld-protocol-editor__field-label mld-protocol-editor__field-label--required">
329
+ Step Name
330
+ </label>
331
+ <input
332
+ v-model="stepName"
333
+ type="text"
334
+ :class="[
335
+ 'mld-protocol-editor__input',
336
+ validationErrors.name ? 'mld-protocol-editor__input--error' : '',
337
+ ]"
338
+ placeholder="Enter step name"
339
+ />
340
+ <span v-if="validationErrors.name" class="mld-protocol-editor__field-error">
341
+ {{ validationErrors.name }}
342
+ </span>
343
+ </div>
344
+
345
+ <!-- Dynamic parameters -->
346
+ <template v-if="selectedTemplate">
347
+ <div
348
+ v-for="(param, index) in selectedTemplate.parameters"
349
+ :key="param.key"
350
+ :class="[
351
+ 'mld-protocol-editor__field',
352
+ index % 2 === 0 && selectedTemplate.parameters[index + 1]
353
+ ? ''
354
+ : '',
355
+ ]"
356
+ >
357
+ <label
358
+ :class="[
359
+ 'mld-protocol-editor__field-label',
360
+ param.required ? 'mld-protocol-editor__field-label--required' : '',
361
+ ]"
362
+ >
363
+ {{ param.label }}
364
+ </label>
365
+
366
+ <!-- Number input with unit -->
367
+ <div
368
+ v-if="param.type === 'number' || param.type === 'temperature' || param.type === 'duration'"
369
+ class="mld-protocol-editor__input-unit"
370
+ >
371
+ <input
372
+ type="number"
373
+ :value="parameters[param.key]"
374
+ :min="param.min"
375
+ :max="param.max"
376
+ :placeholder="param.placeholder || `Enter ${param.label.toLowerCase()}`"
377
+ :class="[
378
+ 'mld-protocol-editor__input',
379
+ validationErrors[param.key] ? 'mld-protocol-editor__input--error' : '',
380
+ ]"
381
+ @input="handleParamChange(param.key, ($event.target as HTMLInputElement).valueAsNumber)"
382
+ />
383
+ <span v-if="param.unit" class="mld-protocol-editor__unit-suffix">
384
+ {{ param.unit }}
385
+ </span>
386
+ </div>
387
+
388
+ <!-- Text input -->
389
+ <input
390
+ v-else-if="param.type === 'text'"
391
+ type="text"
392
+ :value="parameters[param.key]"
393
+ :placeholder="param.placeholder || `Enter ${param.label.toLowerCase()}`"
394
+ :class="[
395
+ 'mld-protocol-editor__input',
396
+ validationErrors[param.key] ? 'mld-protocol-editor__input--error' : '',
397
+ ]"
398
+ @input="handleParamChange(param.key, ($event.target as HTMLInputElement).value)"
399
+ />
400
+
401
+ <!-- Select -->
402
+ <select
403
+ v-else-if="param.type === 'select'"
404
+ :value="parameters[param.key]"
405
+ :class="[
406
+ 'mld-protocol-editor__select',
407
+ validationErrors[param.key] ? 'mld-protocol-editor__input--error' : '',
408
+ ]"
409
+ @change="handleParamChange(param.key, ($event.target as HTMLSelectElement).value)"
410
+ >
411
+ <option value="" disabled>Select {{ param.label.toLowerCase() }}</option>
412
+ <option
413
+ v-for="option in param.options"
414
+ :key="option.value"
415
+ :value="option.value"
416
+ >
417
+ {{ option.label }}
418
+ </option>
419
+ </select>
420
+
421
+ <!-- Concentration input -->
422
+ <ConcentrationInput
423
+ v-else-if="param.type === 'concentration'"
424
+ :model-value="parameters[param.key] as ConcentrationValue | undefined"
425
+ :error="!!validationErrors[param.key]"
426
+ size="md"
427
+ @update:model-value="handleConcentrationChange(param.key, $event)"
428
+ />
429
+
430
+ <!-- Reagent input (text for now) -->
431
+ <input
432
+ v-else-if="param.type === 'reagent'"
433
+ type="text"
434
+ :value="parameters[param.key]"
435
+ :placeholder="param.placeholder || 'Enter reagent name'"
436
+ :class="[
437
+ 'mld-protocol-editor__input',
438
+ validationErrors[param.key] ? 'mld-protocol-editor__input--error' : '',
439
+ ]"
440
+ @input="handleParamChange(param.key, ($event.target as HTMLInputElement).value)"
441
+ />
442
+
443
+ <span v-if="validationErrors[param.key]" class="mld-protocol-editor__field-error">
444
+ {{ validationErrors[param.key] }}
445
+ </span>
446
+ </div>
447
+ </template>
448
+
449
+ <!-- Description -->
450
+ <div class="mld-protocol-editor__field">
451
+ <label class="mld-protocol-editor__field-label">Description</label>
452
+ <textarea
453
+ v-model="stepDescription"
454
+ class="mld-protocol-editor__textarea"
455
+ placeholder="Optional step description"
456
+ rows="2"
457
+ />
458
+ </div>
459
+ </div>
460
+
461
+ <!-- Preview -->
462
+ <div v-if="showPreview && previewStep" class="mld-protocol-editor__preview">
463
+ <div class="mld-protocol-editor__preview-title">Preview</div>
464
+ <div class="mld-protocol-editor__preview-card">
465
+ <div class="mld-protocol-editor__preview-icon">
466
+ <svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
467
+ <path
468
+ stroke-linecap="round"
469
+ stroke-linejoin="round"
470
+ stroke-width="2"
471
+ :d="stepTypeIcons[previewStep.type]"
472
+ />
473
+ </svg>
474
+ </div>
475
+ <div class="mld-protocol-editor__preview-content">
476
+ <div class="mld-protocol-editor__preview-name">{{ previewStep.name }}</div>
477
+ <div v-if="previewParams" class="mld-protocol-editor__preview-params">
478
+ {{ previewParams }}
479
+ </div>
480
+ </div>
481
+ <div v-if="previewStep.duration" class="mld-protocol-editor__preview-duration">
482
+ {{ formatDuration(previewStep.duration) }}
483
+ </div>
484
+ </div>
485
+ </div>
486
+
487
+ <!-- Actions -->
488
+ <div class="mld-protocol-editor__actions">
489
+ <div class="mld-protocol-editor__actions-left">
490
+ <button
491
+ type="button"
492
+ class="mld-protocol-editor__btn mld-protocol-editor__btn--ghost"
493
+ @click="handleSaveTemplate"
494
+ >
495
+ <svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
496
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4" />
497
+ </svg>
498
+ Save as Template
499
+ </button>
500
+ </div>
501
+ <button
502
+ type="button"
503
+ class="mld-protocol-editor__btn mld-protocol-editor__btn--secondary"
504
+ @click="handleCancel"
505
+ >
506
+ Cancel
507
+ </button>
508
+ <button
509
+ type="button"
510
+ class="mld-protocol-editor__btn mld-protocol-editor__btn--primary"
511
+ :disabled="!selectedTemplate"
512
+ @click="handleSave"
513
+ >
514
+ {{ mode === 'create' ? 'Add Step' : 'Save Changes' }}
515
+ </button>
516
+ </div>
517
+ </div>
518
+ </template>
519
+
520
+ <style>
521
+ @import '../styles/components/protocol-step-editor.css';
522
+ </style>
@@ -0,0 +1,100 @@
1
+ <script setup lang="ts">
2
+ import RackEditor from './RackEditor.vue'
3
+ import type { Rack } from '../types'
4
+
5
+ const defaultRacks: Rack[] = [
6
+ {
7
+ id: 'rack-1',
8
+ name: 'Rack 1',
9
+ format: 96,
10
+ slot: 'R',
11
+ injectionVolume: 10,
12
+ wells: {},
13
+ },
14
+ {
15
+ id: 'rack-2',
16
+ name: 'Rack 2',
17
+ format: 54,
18
+ slot: 'G',
19
+ injectionVolume: 5,
20
+ wells: {},
21
+ },
22
+ ]
23
+
24
+ function initState() {
25
+ return {
26
+ modelValue: defaultRacks.map(r => ({ ...r, wells: { ...r.wells } })),
27
+ activeRackId: 'rack-1',
28
+ maxRacks: 10,
29
+ minRacks: 1,
30
+ allowReorder: true,
31
+ editable: true,
32
+ readonly: false,
33
+ wellPlateSize: 'md' as const,
34
+ showLegend: true,
35
+ showBadges: true,
36
+ }
37
+ }
38
+ </script>
39
+
40
+ <template>
41
+ <Story title="Lab/RackEditor">
42
+ <Variant title="Playground" :init-state="initState">
43
+ <template #default="{ state }">
44
+ <div style="padding: 2rem;">
45
+ <RackEditor
46
+ v-model="state.modelValue"
47
+ v-model:active-rack-id="state.activeRackId"
48
+ :max-racks="state.maxRacks"
49
+ :min-racks="state.minRacks"
50
+ :allow-reorder="state.allowReorder"
51
+ :editable="state.editable"
52
+ :readonly="state.readonly"
53
+ :well-plate-size="state.wellPlateSize"
54
+ :show-legend="state.showLegend"
55
+ :show-badges="state.showBadges"
56
+ />
57
+ </div>
58
+ </template>
59
+ <template #controls="{ state }">
60
+ <HstSlider v-model="state.maxRacks" title="Max Racks" :min="1" :max="20" />
61
+ <HstSlider v-model="state.minRacks" title="Min Racks" :min="0" :max="5" />
62
+ <HstCheckbox v-model="state.allowReorder" title="Allow Reorder" />
63
+ <HstCheckbox v-model="state.editable" title="Editable" />
64
+ <HstCheckbox v-model="state.readonly" title="Readonly" />
65
+ <HstSelect
66
+ v-model="state.wellPlateSize"
67
+ title="Well Plate Size"
68
+ :options="[
69
+ { value: 'sm', label: 'Small' },
70
+ { value: 'md', label: 'Medium' },
71
+ { value: 'lg', label: 'Large' },
72
+ { value: 'xl', label: 'Extra Large' },
73
+ { value: 'fill', label: 'Fill' },
74
+ ]"
75
+ />
76
+ <HstCheckbox v-model="state.showLegend" title="Show Legend" />
77
+ <HstCheckbox v-model="state.showBadges" title="Show Badges" />
78
+ </template>
79
+ </Variant>
80
+
81
+ <Variant title="Single Rack">
82
+ <div style="padding: 2rem;">
83
+ <RackEditor
84
+ :model-value="[{ id: 'rack-1', name: 'Sample Rack', format: 96, slot: 'R', injectionVolume: 10, wells: {} }]"
85
+ :min-racks="1"
86
+ :max-racks="1"
87
+ />
88
+ </div>
89
+ </Variant>
90
+
91
+ <Variant title="Readonly">
92
+ <div style="padding: 2rem;">
93
+ <RackEditor
94
+ :model-value="defaultRacks"
95
+ readonly
96
+ />
97
+ </div>
98
+ </Variant>
99
+ </Story>
100
+ </template>