@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.
- package/README.md +326 -0
- package/dist/__stories__/experiment-helpers.d.ts +25 -0
- package/dist/__tests__/components/AppLayout.test.d.ts +1 -0
- package/dist/__tests__/components/AppSidebar.test.d.ts +1 -0
- package/dist/__tests__/components/AppTopBar.test.d.ts +1 -0
- package/dist/__tests__/components/BaseInput.test.d.ts +1 -0
- package/dist/__tests__/components/BasePill.test.d.ts +1 -0
- package/dist/__tests__/components/Calendar.test.d.ts +1 -0
- package/dist/__tests__/components/CollapsibleCard.test.d.ts +1 -0
- package/dist/__tests__/components/DataFrame.test.d.ts +1 -0
- package/dist/__tests__/components/DropdownButton.test.d.ts +1 -0
- package/dist/__tests__/composables/formBuilderRegistry.test.d.ts +1 -0
- package/dist/__tests__/composables/useAppExperiment.test.d.ts +1 -0
- package/dist/__tests__/composables/useAuth.test.d.ts +1 -0
- package/dist/__tests__/composables/useAutoGroup.test.d.ts +1 -0
- package/dist/__tests__/composables/useExperimentData.test.d.ts +13 -0
- package/dist/__tests__/composables/useExperimentSave.test.d.ts +1 -0
- package/dist/__tests__/composables/useForm.test.d.ts +1 -0
- package/dist/__tests__/composables/useFormBuilder.test.d.ts +1 -0
- package/dist/__tests__/composables/usePlatformContext.test.d.ts +1 -0
- package/dist/__tests__/composables/usePluginApi.test.d.ts +13 -0
- package/dist/__tests__/composables/usePluginConfig.test.d.ts +14 -0
- package/dist/__tests__/utils/color.test.d.ts +1 -0
- package/dist/auth-BYmxZdJl.js +297 -0
- package/dist/auth-BYmxZdJl.js.map +1 -0
- package/dist/components/AlertBox.vue.d.ts +34 -0
- package/dist/components/AppAvatarMenu.vue.d.ts +58 -0
- package/dist/components/AppContainer.vue.d.ts +28 -0
- package/dist/components/AppLayout.vue.d.ts +31 -0
- package/dist/components/AppPageSelector.vue.d.ts +43 -0
- package/dist/components/AppPillNav.vue.d.ts +11 -0
- package/dist/components/AppPluginSwitcher.vue.d.ts +38 -0
- package/dist/components/AppSidebar.vue.d.ts +47 -0
- package/dist/components/AppTopBar.vue.d.ts +111 -0
- package/dist/components/AuditTrail.vue.d.ts +38 -0
- package/dist/components/AutoGroupModal.vue.d.ts +124 -0
- package/dist/components/Avatar.vue.d.ts +14 -0
- package/dist/components/BaseButton.vue.d.ts +37 -0
- package/dist/components/BaseCheckbox.vue.d.ts +17 -0
- package/dist/components/BaseInput.vue.d.ts +34 -0
- package/dist/components/BaseModal.vue.d.ts +46 -0
- package/dist/components/BasePill.vue.d.ts +57 -0
- package/dist/components/BaseRadioGroup.vue.d.ts +21 -0
- package/dist/components/BaseSelect.vue.d.ts +20 -0
- package/dist/components/BaseSlider.vue.d.ts +22 -0
- package/dist/components/BaseTabs.vue.d.ts +14 -0
- package/dist/components/BaseTextarea.vue.d.ts +30 -0
- package/dist/components/BaseToggle.vue.d.ts +19 -0
- package/dist/components/BatchProgressList.vue.d.ts +43 -0
- package/dist/components/Breadcrumb.vue.d.ts +33 -0
- package/dist/components/Calendar.vue.d.ts +107 -0
- package/dist/components/ChartContainer.vue.d.ts +31 -0
- package/dist/components/ChemicalFormula.vue.d.ts +8 -0
- package/dist/components/CollapsibleCard.vue.d.ts +41 -0
- package/dist/components/ColorSlider.vue.d.ts +34 -0
- package/dist/components/ConcentrationInput.vue.d.ts +25 -0
- package/dist/components/ConfirmDialog.vue.d.ts +42 -0
- package/dist/components/DataFrame.vue.d.ts +107 -0
- package/dist/components/DatePicker.vue.d.ts +25 -0
- package/dist/components/DateTimePicker.vue.d.ts +30 -0
- package/dist/components/Divider.vue.d.ts +14 -0
- package/dist/components/DoseCalculator.vue.d.ts +19 -0
- package/dist/components/DropdownButton.vue.d.ts +47 -0
- package/dist/components/EmptyState.vue.d.ts +36 -0
- package/dist/components/ExperimentCodeBadge.vue.d.ts +14 -0
- package/dist/components/ExperimentDataViewer.vue.d.ts +29 -0
- package/dist/components/ExperimentPopover.vue.d.ts +32 -0
- package/dist/components/ExperimentSelectorModal.vue.d.ts +28 -0
- package/dist/components/ExperimentTimeline.vue.d.ts +44 -0
- package/dist/components/FileUploader.vue.d.ts +40 -0
- package/dist/components/FitPanel.vue.d.ts +46 -0
- package/dist/components/FormActions.vue.d.ts +33 -0
- package/dist/components/FormBuilder.vue.d.ts +287 -0
- package/dist/components/FormField.vue.d.ts +28 -0
- package/dist/components/FormFieldRenderer.vue.d.ts +31 -0
- package/dist/components/FormSection.vue.d.ts +43 -0
- package/dist/components/FormulaInput.vue.d.ts +25 -0
- package/dist/components/GroupAssigner.vue.d.ts +25 -0
- package/dist/components/GroupingModal.vue.d.ts +12 -0
- package/dist/components/IconButton.vue.d.ts +34 -0
- package/dist/components/LoadingSpinner.vue.d.ts +12 -0
- package/dist/components/MoleculeInput.vue.d.ts +27 -0
- package/dist/components/MultiSelect.vue.d.ts +19 -0
- package/dist/components/NumberInput.vue.d.ts +22 -0
- package/dist/components/PlateMapEditor.vue.d.ts +50 -0
- package/dist/components/ProgressBar.vue.d.ts +23 -0
- package/dist/components/ProtocolStepEditor.vue.d.ts +24 -0
- package/dist/components/RackEditor.vue.d.ts +40 -0
- package/dist/components/ReagentEditor.vue.d.ts +30 -0
- package/dist/components/ReagentList.vue.d.ts +32 -0
- package/dist/components/ResourceCard.vue.d.ts +50 -0
- package/dist/components/SampleHierarchyTree.vue.d.ts +26 -0
- package/dist/components/SampleLegend.vue.d.ts +32 -0
- package/dist/components/SampleSelector.vue.d.ts +29 -0
- package/dist/components/ScheduleCalendar.vue.d.ts +110 -0
- package/dist/components/ScientificNumber.vue.d.ts +14 -0
- package/dist/components/SegmentedControl.vue.d.ts +20 -0
- package/dist/components/SequenceInput.vue.d.ts +54 -0
- package/dist/components/SettingsButton.vue.d.ts +30 -0
- package/dist/components/SettingsModal.vue.d.ts +36 -0
- package/dist/components/Skeleton.vue.d.ts +11 -0
- package/dist/components/StatusIndicator.vue.d.ts +13 -0
- package/dist/components/StepWizard.vue.d.ts +65 -0
- package/dist/components/TagsInput.vue.d.ts +39 -0
- package/dist/components/ThemeToggle.vue.d.ts +7 -0
- package/dist/components/TimePicker.vue.d.ts +29 -0
- package/dist/components/TimeRangeInput.vue.d.ts +27 -0
- package/dist/components/ToastNotification.vue.d.ts +2 -0
- package/dist/components/Tooltip.vue.d.ts +35 -0
- package/dist/components/UnitInput.vue.d.ts +39 -0
- package/dist/components/WellEditPopup.vue.d.ts +25 -0
- package/dist/components/WellPlate.vue.d.ts +73 -0
- package/dist/components/index.d.ts +87 -0
- package/dist/components/index.js +3 -0
- package/dist/components-CKf-UpGi.js +15089 -0
- package/dist/components-CKf-UpGi.js.map +1 -0
- package/dist/composables/experiment-utils.d.ts +8 -0
- package/dist/composables/formBuilderRegistry.d.ts +13 -0
- package/dist/composables/index.d.ts +28 -0
- package/dist/composables/index.js +3 -0
- package/dist/composables/useApi.d.ts +20 -0
- package/dist/composables/useAppExperiment.d.ts +37 -0
- package/dist/composables/useAsync.d.ts +128 -0
- package/dist/composables/useAuth.d.ts +47 -0
- package/dist/composables/useAutoGroup.d.ts +106 -0
- package/dist/composables/useChemicalFormula.d.ts +21 -0
- package/dist/composables/useConcentrationUnits.d.ts +29 -0
- package/dist/composables/useDoseCalculator.d.ts +58 -0
- package/dist/composables/useExperimentData.d.ts +18 -0
- package/dist/composables/useExperimentSave.d.ts +36 -0
- package/dist/composables/useExperimentSelector.d.ts +30 -0
- package/dist/composables/useForm.d.ts +92 -0
- package/dist/composables/useFormBuilder.d.ts +24 -0
- package/dist/composables/usePasskey.d.ts +10 -0
- package/dist/composables/usePlatformContext.d.ts +131 -0
- package/dist/composables/usePluginApi.d.ts +29 -0
- package/dist/composables/usePluginConfig.d.ts +13 -0
- package/dist/composables/useProtocolTemplates.d.ts +44 -0
- package/dist/composables/useRackEditor.d.ts +31 -0
- package/dist/composables/useReagentSeries.d.ts +23 -0
- package/dist/composables/useScheduleDrag.d.ts +78 -0
- package/dist/composables/useSequenceUtils.d.ts +14 -0
- package/dist/composables/useTheme.d.ts +8 -0
- package/dist/composables/useTimeUtils.d.ts +29 -0
- package/dist/composables/useToast.d.ts +22 -0
- package/dist/composables/useWellPlateEditor.d.ts +33 -0
- package/dist/composables-D0QfFzq1.js +805 -0
- package/dist/composables-D0QfFzq1.js.map +1 -0
- package/dist/histoire.setup.d.ts +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +7 -0
- package/dist/install.d.ts +16 -0
- package/dist/install.js +23 -0
- package/dist/install.js.map +1 -0
- package/dist/stores/auth.d.ts +146 -0
- package/dist/stores/index.d.ts +2 -0
- package/dist/stores/index.js +2 -0
- package/dist/stores/settings.d.ts +75 -0
- package/dist/styles.css +29728 -0
- package/dist/tailwind.preset.d.ts +58 -0
- package/dist/tailwind.preset.js +66 -0
- package/dist/tailwind.preset.js.map +1 -0
- package/dist/types/auth.d.ts +42 -0
- package/dist/types/auto-group.d.ts +34 -0
- package/dist/types/components.d.ts +528 -0
- package/dist/types/form-builder.d.ts +167 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.js +0 -0
- package/dist/types/platform.d.ts +75 -0
- package/dist/useScheduleDrag-DAJueTbK.js +7181 -0
- package/dist/useScheduleDrag-DAJueTbK.js.map +1 -0
- package/dist/utils/color.d.ts +24 -0
- package/package.json +114 -0
- package/src/__stories__/experiment-helpers.ts +83 -0
- package/src/__tests__/components/AppLayout.test.ts +163 -0
- package/src/__tests__/components/AppSidebar.test.ts +292 -0
- package/src/__tests__/components/AppTopBar.test.ts +683 -0
- package/src/__tests__/components/BaseInput.test.ts +99 -0
- package/src/__tests__/components/BasePill.test.ts +291 -0
- package/src/__tests__/components/Calendar.test.ts +566 -0
- package/src/__tests__/components/CollapsibleCard.test.ts +524 -0
- package/src/__tests__/components/DataFrame.test.ts +767 -0
- package/src/__tests__/components/DropdownButton.test.ts +471 -0
- package/src/__tests__/composables/formBuilderRegistry.test.ts +187 -0
- package/src/__tests__/composables/useAppExperiment.test.ts +560 -0
- package/src/__tests__/composables/useAuth.test.ts +188 -0
- package/src/__tests__/composables/useAutoGroup.test.ts +860 -0
- package/src/__tests__/composables/useExperimentData.test.ts +127 -0
- package/src/__tests__/composables/useExperimentSave.test.ts +347 -0
- package/src/__tests__/composables/useForm.test.ts +205 -0
- package/src/__tests__/composables/useFormBuilder.test.ts +917 -0
- package/src/__tests__/composables/usePlatformContext.test.ts +116 -0
- package/src/__tests__/composables/usePluginApi.test.ts +81 -0
- package/src/__tests__/composables/usePluginConfig.test.ts +176 -0
- package/src/__tests__/utils/color.test.ts +96 -0
- package/src/components/AlertBox.story.vue +204 -0
- package/src/components/AlertBox.vue +88 -0
- package/src/components/AppAvatarMenu.story.vue +155 -0
- package/src/components/AppAvatarMenu.vue +184 -0
- package/src/components/AppContainer.story.vue +104 -0
- package/src/components/AppContainer.vue +34 -0
- package/src/components/AppLayout.story.vue +292 -0
- package/src/components/AppLayout.vue +75 -0
- package/src/components/AppPageSelector.vue +159 -0
- package/src/components/AppPillNav.vue +66 -0
- package/src/components/AppPluginSwitcher.vue +241 -0
- package/src/components/AppSidebar.story.vue +309 -0
- package/src/components/AppSidebar.vue +119 -0
- package/src/components/AppTopBar.story.vue +304 -0
- package/src/components/AppTopBar.vue +661 -0
- package/src/components/AuditTrail.story.vue +163 -0
- package/src/components/AuditTrail.vue +151 -0
- package/src/components/AutoGroupModal.story.vue +273 -0
- package/src/components/AutoGroupModal.vue +566 -0
- package/src/components/Avatar.story.vue +115 -0
- package/src/components/Avatar.vue +79 -0
- package/src/components/BaseButton.story.vue +96 -0
- package/src/components/BaseButton.vue +73 -0
- package/src/components/BaseCheckbox.story.vue +73 -0
- package/src/components/BaseCheckbox.vue +69 -0
- package/src/components/BaseInput.story.vue +98 -0
- package/src/components/BaseInput.vue +74 -0
- package/src/components/BaseModal.story.vue +237 -0
- package/src/components/BaseModal.vue +182 -0
- package/src/components/BasePill.story.vue +142 -0
- package/src/components/BasePill.vue +89 -0
- package/src/components/BaseRadioGroup.story.vue +145 -0
- package/src/components/BaseRadioGroup.vue +124 -0
- package/src/components/BaseSelect.story.vue +120 -0
- package/src/components/BaseSelect.vue +71 -0
- package/src/components/BaseSlider.story.vue +122 -0
- package/src/components/BaseSlider.vue +126 -0
- package/src/components/BaseTabs.story.vue +127 -0
- package/src/components/BaseTabs.vue +59 -0
- package/src/components/BaseTextarea.story.vue +91 -0
- package/src/components/BaseTextarea.vue +62 -0
- package/src/components/BaseToggle.story.vue +81 -0
- package/src/components/BaseToggle.vue +76 -0
- package/src/components/BatchProgressList.story.vue +92 -0
- package/src/components/BatchProgressList.vue +184 -0
- package/src/components/Breadcrumb.story.vue +106 -0
- package/src/components/Breadcrumb.vue +75 -0
- package/src/components/Calendar.story.vue +106 -0
- package/src/components/Calendar.vue +363 -0
- package/src/components/ChartContainer.story.vue +113 -0
- package/src/components/ChartContainer.vue +64 -0
- package/src/components/ChemicalFormula.story.vue +102 -0
- package/src/components/ChemicalFormula.vue +39 -0
- package/src/components/CollapsibleCard.story.vue +135 -0
- package/src/components/CollapsibleCard.vue +167 -0
- package/src/components/ColorSlider.story.vue +120 -0
- package/src/components/ColorSlider.vue +164 -0
- package/src/components/ConcentrationInput.story.vue +77 -0
- package/src/components/ConcentrationInput.vue +185 -0
- package/src/components/ConfirmDialog.story.vue +248 -0
- package/src/components/ConfirmDialog.vue +93 -0
- package/src/components/DataFrame.story.vue +148 -0
- package/src/components/DataFrame.vue +419 -0
- package/src/components/DatePicker.story.vue +119 -0
- package/src/components/DatePicker.vue +330 -0
- package/src/components/DateTimePicker.story.vue +112 -0
- package/src/components/DateTimePicker.vue +392 -0
- package/src/components/Divider.story.vue +80 -0
- package/src/components/Divider.vue +49 -0
- package/src/components/DoseCalculator.story.vue +68 -0
- package/src/components/DoseCalculator.vue +476 -0
- package/src/components/DropdownButton.story.vue +102 -0
- package/src/components/DropdownButton.vue +181 -0
- package/src/components/EmptyState.story.vue +135 -0
- package/src/components/EmptyState.vue +69 -0
- package/src/components/ExperimentCodeBadge.story.vue +77 -0
- package/src/components/ExperimentCodeBadge.vue +64 -0
- package/src/components/ExperimentDataViewer.story.vue +174 -0
- package/src/components/ExperimentDataViewer.vue +288 -0
- package/src/components/ExperimentPopover.story.vue +384 -0
- package/src/components/ExperimentPopover.vue +241 -0
- package/src/components/ExperimentSelectorModal.story.vue +391 -0
- package/src/components/ExperimentSelectorModal.vue +387 -0
- package/src/components/ExperimentTimeline.story.vue +161 -0
- package/src/components/ExperimentTimeline.vue +382 -0
- package/src/components/FileUploader.story.vue +107 -0
- package/src/components/FileUploader.vue +386 -0
- package/src/components/FitPanel.story.vue +125 -0
- package/src/components/FitPanel.vue +120 -0
- package/src/components/FormActions.vue +92 -0
- package/src/components/FormBuilder.vue +214 -0
- package/src/components/FormField.story.vue +132 -0
- package/src/components/FormField.vue +59 -0
- package/src/components/FormFieldRenderer.vue +58 -0
- package/src/components/FormSection.vue +90 -0
- package/src/components/FormulaInput.story.vue +96 -0
- package/src/components/FormulaInput.vue +125 -0
- package/src/components/GroupAssigner.story.vue +83 -0
- package/src/components/GroupAssigner.vue +284 -0
- package/src/components/GroupingModal.story.vue +52 -0
- package/src/components/GroupingModal.vue +422 -0
- package/src/components/IconButton.story.vue +135 -0
- package/src/components/IconButton.vue +73 -0
- package/src/components/LoadingSpinner.story.vue +70 -0
- package/src/components/LoadingSpinner.vue +50 -0
- package/src/components/MoleculeInput.story.vue +66 -0
- package/src/components/MoleculeInput.vue +426 -0
- package/src/components/MultiSelect.story.vue +132 -0
- package/src/components/MultiSelect.vue +118 -0
- package/src/components/NumberInput.story.vue +122 -0
- package/src/components/NumberInput.vue +160 -0
- package/src/components/PlateMapEditor.story.vue +92 -0
- package/src/components/PlateMapEditor.vue +513 -0
- package/src/components/ProgressBar.story.vue +148 -0
- package/src/components/ProgressBar.vue +114 -0
- package/src/components/ProtocolStepEditor.story.vue +69 -0
- package/src/components/ProtocolStepEditor.vue +522 -0
- package/src/components/RackEditor.story.vue +100 -0
- package/src/components/RackEditor.vue +371 -0
- package/src/components/ReagentEditor.story.vue +153 -0
- package/src/components/ReagentEditor.vue +418 -0
- package/src/components/ReagentList.story.vue +137 -0
- package/src/components/ReagentList.vue +463 -0
- package/src/components/ResourceCard.story.vue +150 -0
- package/src/components/ResourceCard.vue +161 -0
- package/src/components/SampleHierarchyTree.story.vue +161 -0
- package/src/components/SampleHierarchyTree.vue +256 -0
- package/src/components/SampleLegend.story.vue +91 -0
- package/src/components/SampleLegend.vue +119 -0
- package/src/components/SampleSelector.story.vue +111 -0
- package/src/components/SampleSelector.vue +1033 -0
- package/src/components/ScheduleCalendar.story.vue +195 -0
- package/src/components/ScheduleCalendar.vue +569 -0
- package/src/components/ScientificNumber.story.vue +127 -0
- package/src/components/ScientificNumber.vue +197 -0
- package/src/components/SegmentedControl.story.vue +132 -0
- package/src/components/SegmentedControl.vue +79 -0
- package/src/components/SequenceInput.story.vue +119 -0
- package/src/components/SequenceInput.vue +209 -0
- package/src/components/SettingsButton.story.vue +58 -0
- package/src/components/SettingsButton.vue +76 -0
- package/src/components/SettingsModal.story.vue +145 -0
- package/src/components/SettingsModal.vue +146 -0
- package/src/components/Skeleton.story.vue +141 -0
- package/src/components/Skeleton.vue +74 -0
- package/src/components/StatusIndicator.story.vue +99 -0
- package/src/components/StatusIndicator.vue +40 -0
- package/src/components/StepWizard.story.vue +155 -0
- package/src/components/StepWizard.vue +223 -0
- package/src/components/TagsInput.story.vue +155 -0
- package/src/components/TagsInput.vue +265 -0
- package/src/components/ThemeToggle.story.vue +36 -0
- package/src/components/ThemeToggle.vue +54 -0
- package/src/components/TimePicker.story.vue +96 -0
- package/src/components/TimePicker.vue +273 -0
- package/src/components/TimeRangeInput.story.vue +104 -0
- package/src/components/TimeRangeInput.vue +122 -0
- package/src/components/ToastNotification.story.vue +157 -0
- package/src/components/ToastNotification.vue +62 -0
- package/src/components/Tooltip.story.vue +138 -0
- package/src/components/Tooltip.vue +119 -0
- package/src/components/UnitInput.story.vue +194 -0
- package/src/components/UnitInput.vue +213 -0
- package/src/components/WellEditPopup.vue +234 -0
- package/src/components/WellPlate.story.vue +282 -0
- package/src/components/WellPlate.vue +830 -0
- package/src/components/index.ts +118 -0
- package/src/composables/experiment-utils.ts +57 -0
- package/src/composables/formBuilderRegistry.ts +79 -0
- package/src/composables/index.ts +140 -0
- package/src/composables/useApi.ts +167 -0
- package/src/composables/useAppExperiment.ts +159 -0
- package/src/composables/useAsync.ts +323 -0
- package/src/composables/useAuth.ts +445 -0
- package/src/composables/useAutoGroup.ts +641 -0
- package/src/composables/useChemicalFormula.ts +275 -0
- package/src/composables/useConcentrationUnits.ts +246 -0
- package/src/composables/useDoseCalculator.ts +370 -0
- package/src/composables/useExperimentData.ts +86 -0
- package/src/composables/useExperimentSave.ts +192 -0
- package/src/composables/useExperimentSelector.ts +292 -0
- package/src/composables/useForm.ts +416 -0
- package/src/composables/useFormBuilder.ts +383 -0
- package/src/composables/usePasskey.ts +216 -0
- package/src/composables/usePlatformContext.ts +299 -0
- package/src/composables/usePluginApi.ts +39 -0
- package/src/composables/usePluginConfig.ts +93 -0
- package/src/composables/useProtocolTemplates.ts +518 -0
- package/src/composables/useRackEditor.ts +222 -0
- package/src/composables/useReagentSeries.ts +91 -0
- package/src/composables/useScheduleDrag.ts +245 -0
- package/src/composables/useSequenceUtils.ts +105 -0
- package/src/composables/useTheme.ts +58 -0
- package/src/composables/useTimeUtils.ts +131 -0
- package/src/composables/useToast.ts +40 -0
- package/src/composables/useWellPlateEditor.ts +421 -0
- package/src/histoire.setup.ts +17 -0
- package/src/index.ts +367 -0
- package/src/install.ts +32 -0
- package/src/stores/auth.ts +152 -0
- package/src/stores/index.ts +2 -0
- package/src/stores/settings.ts +218 -0
- package/src/styles/components/alert-box.css +150 -0
- package/src/styles/components/app-avatar-menu.css +155 -0
- package/src/styles/components/app-container.css +33 -0
- package/src/styles/components/app-layout.css +98 -0
- package/src/styles/components/app-page-selector.css +191 -0
- package/src/styles/components/app-pill-nav.css +57 -0
- package/src/styles/components/app-plugin-switcher.css +209 -0
- package/src/styles/components/app-sidebar.css +145 -0
- package/src/styles/components/app-top-bar.css +492 -0
- package/src/styles/components/audit-trail.css +143 -0
- package/src/styles/components/auto-group-modal.css +644 -0
- package/src/styles/components/avatar.css +73 -0
- package/src/styles/components/batch-progress-list.css +196 -0
- package/src/styles/components/breadcrumb.css +64 -0
- package/src/styles/components/button.css +188 -0
- package/src/styles/components/calendar.css +192 -0
- package/src/styles/components/chart-container.css +69 -0
- package/src/styles/components/checkbox.css +123 -0
- package/src/styles/components/chemical-formula.css +46 -0
- package/src/styles/components/collapsible-card.css +253 -0
- package/src/styles/components/color-slider.css +110 -0
- package/src/styles/components/concentration-input.css +156 -0
- package/src/styles/components/confirm-dialog.css +183 -0
- package/src/styles/components/dataframe.css +382 -0
- package/src/styles/components/date-picker.css +243 -0
- package/src/styles/components/datetime-picker.css +229 -0
- package/src/styles/components/divider.css +63 -0
- package/src/styles/components/dose-calculator.css +301 -0
- package/src/styles/components/dropdown-button.css +280 -0
- package/src/styles/components/empty-state.css +151 -0
- package/src/styles/components/experiment-code-badge.css +33 -0
- package/src/styles/components/experiment-data-viewer.css +138 -0
- package/src/styles/components/experiment-popover.css +562 -0
- package/src/styles/components/experiment-selector-modal.css +285 -0
- package/src/styles/components/experiment-timeline.css +529 -0
- package/src/styles/components/file-uploader.css +310 -0
- package/src/styles/components/fit-panel.css +67 -0
- package/src/styles/components/form-builder.css +69 -0
- package/src/styles/components/form-field.css +48 -0
- package/src/styles/components/formula-input.css +103 -0
- package/src/styles/components/group-assigner.css +200 -0
- package/src/styles/components/grouping-modal.css +323 -0
- package/src/styles/components/icon-button.css +192 -0
- package/src/styles/components/input.css +66 -0
- package/src/styles/components/loading-spinner.css +67 -0
- package/src/styles/components/modal.css +350 -0
- package/src/styles/components/molecule-input.css +186 -0
- package/src/styles/components/multi-select.css +131 -0
- package/src/styles/components/number-input.css +199 -0
- package/src/styles/components/pill.css +188 -0
- package/src/styles/components/plate-map-editor.css +464 -0
- package/src/styles/components/progress-bar.css +133 -0
- package/src/styles/components/protocol-step-editor.css +449 -0
- package/src/styles/components/rack-editor.css +265 -0
- package/src/styles/components/radio-group.css +240 -0
- package/src/styles/components/reagent-editor.css +510 -0
- package/src/styles/components/reagent-list.css +407 -0
- package/src/styles/components/resource-card.css +360 -0
- package/src/styles/components/sample-hierarchy-tree.css +314 -0
- package/src/styles/components/sample-legend.css +201 -0
- package/src/styles/components/sample-selector.css +751 -0
- package/src/styles/components/schedule-calendar.css +478 -0
- package/src/styles/components/scientific-number.css +63 -0
- package/src/styles/components/segmented-control.css +197 -0
- package/src/styles/components/select.css +77 -0
- package/src/styles/components/sequence-input.css +184 -0
- package/src/styles/components/settings-button.css +94 -0
- package/src/styles/components/settings-modal.css +95 -0
- package/src/styles/components/skeleton.css +49 -0
- package/src/styles/components/slider.css +74 -0
- package/src/styles/components/status-indicator.css +66 -0
- package/src/styles/components/step-wizard.css +192 -0
- package/src/styles/components/tabs.css +95 -0
- package/src/styles/components/tags-input.css +195 -0
- package/src/styles/components/textarea.css +82 -0
- package/src/styles/components/theme-toggle.css +69 -0
- package/src/styles/components/time-picker.css +171 -0
- package/src/styles/components/time-range-input.css +42 -0
- package/src/styles/components/toast.css +91 -0
- package/src/styles/components/toggle.css +146 -0
- package/src/styles/components/tooltip.css +91 -0
- package/src/styles/components/unit-input.css +123 -0
- package/src/styles/components/well-edit-popup.css +252 -0
- package/src/styles/components/well-plate.css +307 -0
- package/src/styles/index.css +87 -0
- package/src/styles/variables.css +1117 -0
- package/src/tailwind.preset.ts +61 -0
- package/src/types/auth.ts +55 -0
- package/src/types/auto-group.ts +40 -0
- package/src/types/components.ts +710 -0
- package/src/types/form-builder.ts +197 -0
- package/src/types/index.ts +207 -0
- package/src/types/platform.ts +116 -0
- package/src/utils/color.ts +96 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import MultiSelect from './MultiSelect.vue'
|
|
4
|
+
import type { MultiSelectOption } from '../types'
|
|
5
|
+
|
|
6
|
+
const sizes = ['sm', 'md', 'lg'] as const
|
|
7
|
+
|
|
8
|
+
const sampleOptions: MultiSelectOption[] = [
|
|
9
|
+
{ value: 'hela', label: 'HeLa' },
|
|
10
|
+
{ value: 'mcf7', label: 'MCF-7' },
|
|
11
|
+
{ value: 'a549', label: 'A549' },
|
|
12
|
+
{ value: 'hek293', label: 'HEK293' },
|
|
13
|
+
{ value: 'jurkat', label: 'Jurkat' },
|
|
14
|
+
{ value: 'k562', label: 'K562' },
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
const withDisabledOptions: MultiSelectOption[] = [
|
|
18
|
+
{ value: 'option1', label: 'Available A' },
|
|
19
|
+
{ value: 'option2', label: 'Available B' },
|
|
20
|
+
{ value: 'option3', label: 'Unavailable', disabled: true },
|
|
21
|
+
{ value: 'option4', label: 'Available C' },
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
const selected = ref<(string | number)[]>(['hela', 'a549'])
|
|
25
|
+
|
|
26
|
+
function initPlayground() {
|
|
27
|
+
return {
|
|
28
|
+
selected: ['hela', 'a549'] as (string | number)[],
|
|
29
|
+
placeholder: 'Select samples',
|
|
30
|
+
size: 'md' as const,
|
|
31
|
+
disabled: false,
|
|
32
|
+
useMaxSelections: false,
|
|
33
|
+
maxSelections: 3,
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<Story title="Base Inputs/MultiSelect">
|
|
40
|
+
<Variant title="Playground" :init-state="initPlayground">
|
|
41
|
+
<template #default="{ state }">
|
|
42
|
+
<div style="padding: 2rem; max-width: 500px; margin: 0 auto;">
|
|
43
|
+
<MultiSelect
|
|
44
|
+
v-model="state.selected"
|
|
45
|
+
:options="sampleOptions"
|
|
46
|
+
:placeholder="state.placeholder"
|
|
47
|
+
:disabled="state.disabled"
|
|
48
|
+
:max-selections="state.useMaxSelections ? state.maxSelections : undefined"
|
|
49
|
+
:size="state.size"
|
|
50
|
+
/>
|
|
51
|
+
<p style="margin-top: 1rem; font-size: 0.875rem; color: var(--text-muted, #94a3b8);">
|
|
52
|
+
Selected: <code>{{ JSON.stringify(state.selected) }}</code>
|
|
53
|
+
</p>
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<template #controls="{ state }">
|
|
58
|
+
<HstText v-model="state.placeholder" title="Placeholder" />
|
|
59
|
+
<HstSelect
|
|
60
|
+
v-model="state.size"
|
|
61
|
+
title="Size"
|
|
62
|
+
:options="sizes.map(s => ({ label: s, value: s }))"
|
|
63
|
+
/>
|
|
64
|
+
<HstCheckbox v-model="state.disabled" title="Disabled" />
|
|
65
|
+
<HstCheckbox v-model="state.useMaxSelections" title="Limit Selections" />
|
|
66
|
+
<HstSlider v-model="state.maxSelections" title="Max Selections" :min="1" :max="10" />
|
|
67
|
+
</template>
|
|
68
|
+
</Variant>
|
|
69
|
+
|
|
70
|
+
<Variant title="Sizes">
|
|
71
|
+
<div style="padding: 2rem; max-width: 500px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.5rem;">
|
|
72
|
+
<div v-for="size in sizes" :key="size">
|
|
73
|
+
<p style="margin: 0 0 0.5rem; font-size: 0.75rem; color: var(--text-muted, #94a3b8); text-transform: uppercase; letter-spacing: 0.05em;">
|
|
74
|
+
{{ size }}
|
|
75
|
+
</p>
|
|
76
|
+
<MultiSelect v-model="selected" :options="sampleOptions" :size="size" />
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</Variant>
|
|
80
|
+
|
|
81
|
+
<Variant title="Empty State">
|
|
82
|
+
<div style="padding: 2rem; max-width: 500px; margin: 0 auto;">
|
|
83
|
+
<MultiSelect
|
|
84
|
+
:model-value="[]"
|
|
85
|
+
:options="sampleOptions"
|
|
86
|
+
placeholder="Select cell lines..."
|
|
87
|
+
/>
|
|
88
|
+
</div>
|
|
89
|
+
</Variant>
|
|
90
|
+
|
|
91
|
+
<Variant title="With Max Selections">
|
|
92
|
+
<div style="padding: 2rem; max-width: 500px; margin: 0 auto;">
|
|
93
|
+
<p style="margin: 0 0 0.5rem; font-size: 0.875rem; color: var(--text-primary, #e2e8f0);">
|
|
94
|
+
Maximum 3 selections allowed
|
|
95
|
+
</p>
|
|
96
|
+
<MultiSelect
|
|
97
|
+
:model-value="['hela', 'mcf7']"
|
|
98
|
+
:options="sampleOptions"
|
|
99
|
+
:max-selections="3"
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
</Variant>
|
|
103
|
+
|
|
104
|
+
<Variant title="With Disabled Options">
|
|
105
|
+
<div style="padding: 2rem; max-width: 500px; margin: 0 auto;">
|
|
106
|
+
<MultiSelect
|
|
107
|
+
:model-value="['option1']"
|
|
108
|
+
:options="withDisabledOptions"
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
</Variant>
|
|
112
|
+
|
|
113
|
+
<Variant title="All Selected">
|
|
114
|
+
<div style="padding: 2rem; max-width: 500px; margin: 0 auto;">
|
|
115
|
+
<MultiSelect
|
|
116
|
+
:model-value="sampleOptions.map(o => o.value)"
|
|
117
|
+
:options="sampleOptions"
|
|
118
|
+
/>
|
|
119
|
+
</div>
|
|
120
|
+
</Variant>
|
|
121
|
+
|
|
122
|
+
<Variant title="Disabled">
|
|
123
|
+
<div style="padding: 2rem; max-width: 500px; margin: 0 auto;">
|
|
124
|
+
<MultiSelect
|
|
125
|
+
:model-value="['hela', 'a549']"
|
|
126
|
+
:options="sampleOptions"
|
|
127
|
+
disabled
|
|
128
|
+
/>
|
|
129
|
+
</div>
|
|
130
|
+
</Variant>
|
|
131
|
+
</Story>
|
|
132
|
+
</template>
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/** Lets users select multiple options from a checkbox list with optional selection cap. */
|
|
3
|
+
import { computed } from 'vue'
|
|
4
|
+
import type { MultiSelectOption, MultiSelectSize } from '../types'
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
modelValue: (string | number)[]
|
|
8
|
+
options: MultiSelectOption[]
|
|
9
|
+
placeholder?: string
|
|
10
|
+
disabled?: boolean
|
|
11
|
+
maxSelections?: number
|
|
12
|
+
size?: MultiSelectSize
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
16
|
+
placeholder: 'Select options...',
|
|
17
|
+
disabled: false,
|
|
18
|
+
size: 'md',
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const emit = defineEmits<{
|
|
22
|
+
'update:modelValue': [value: (string | number)[]]
|
|
23
|
+
}>()
|
|
24
|
+
|
|
25
|
+
const canSelectMore = computed(() => {
|
|
26
|
+
if (props.maxSelections === undefined) return true
|
|
27
|
+
return props.modelValue.length < props.maxSelections
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
function isSelected(value: string | number): boolean {
|
|
31
|
+
return props.modelValue.includes(value)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function toggleOption(option: MultiSelectOption) {
|
|
35
|
+
if (props.disabled || option.disabled) return
|
|
36
|
+
|
|
37
|
+
if (isSelected(option.value)) {
|
|
38
|
+
emit('update:modelValue', props.modelValue.filter(v => v !== option.value))
|
|
39
|
+
} else if (canSelectMore.value) {
|
|
40
|
+
emit('update:modelValue', [...props.modelValue, option.value])
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function handleKeydown(event: KeyboardEvent, option: MultiSelectOption) {
|
|
45
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
46
|
+
event.preventDefault()
|
|
47
|
+
toggleOption(option)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const selectedLabels = computed(() => {
|
|
52
|
+
return props.modelValue
|
|
53
|
+
.map(v => props.options.find(o => o.value === v)?.label)
|
|
54
|
+
.filter(Boolean)
|
|
55
|
+
})
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<template>
|
|
59
|
+
<div
|
|
60
|
+
:class="[
|
|
61
|
+
'mld-multi-select',
|
|
62
|
+
`mld-multi-select--${size}`,
|
|
63
|
+
disabled ? 'mld-multi-select--disabled' : '',
|
|
64
|
+
]"
|
|
65
|
+
>
|
|
66
|
+
<div
|
|
67
|
+
v-if="modelValue.length === 0"
|
|
68
|
+
class="mld-multi-select__placeholder"
|
|
69
|
+
>
|
|
70
|
+
{{ placeholder }}
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<div class="mld-multi-select__options" role="group">
|
|
74
|
+
<button
|
|
75
|
+
v-for="option in options"
|
|
76
|
+
:key="String(option.value)"
|
|
77
|
+
type="button"
|
|
78
|
+
role="checkbox"
|
|
79
|
+
:aria-checked="isSelected(option.value)"
|
|
80
|
+
:disabled="disabled || option.disabled || (!isSelected(option.value) && !canSelectMore)"
|
|
81
|
+
:class="[
|
|
82
|
+
'mld-multi-select__chip',
|
|
83
|
+
`mld-multi-select__chip--${size}`,
|
|
84
|
+
isSelected(option.value) ? 'mld-multi-select__chip--active' : '',
|
|
85
|
+
option.disabled ? 'mld-multi-select__chip--disabled' : '',
|
|
86
|
+
!isSelected(option.value) && !canSelectMore ? 'mld-multi-select__chip--disabled' : '',
|
|
87
|
+
]"
|
|
88
|
+
@click="toggleOption(option)"
|
|
89
|
+
@keydown="handleKeydown($event, option)"
|
|
90
|
+
>
|
|
91
|
+
<span class="mld-multi-select__chip-label">{{ option.label }}</span>
|
|
92
|
+
<svg
|
|
93
|
+
v-if="isSelected(option.value)"
|
|
94
|
+
class="mld-multi-select__chip-check"
|
|
95
|
+
viewBox="0 0 24 24"
|
|
96
|
+
fill="none"
|
|
97
|
+
stroke="currentColor"
|
|
98
|
+
stroke-width="2"
|
|
99
|
+
stroke-linecap="round"
|
|
100
|
+
stroke-linejoin="round"
|
|
101
|
+
>
|
|
102
|
+
<path d="M20 6 9 17l-5-5" />
|
|
103
|
+
</svg>
|
|
104
|
+
</button>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<div
|
|
108
|
+
v-if="modelValue.length > 0"
|
|
109
|
+
class="mld-multi-select__summary"
|
|
110
|
+
>
|
|
111
|
+
{{ selectedLabels.join(', ') }}
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</template>
|
|
115
|
+
|
|
116
|
+
<style>
|
|
117
|
+
@import '../styles/components/multi-select.css';
|
|
118
|
+
</style>
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import NumberInput from './NumberInput.vue'
|
|
3
|
+
|
|
4
|
+
const sizes = ['sm', 'md', 'lg'] as const
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<Story title="Base Inputs/NumberInput">
|
|
9
|
+
<Variant title="Playground">
|
|
10
|
+
<template #default="{ state }">
|
|
11
|
+
<div style="padding: 2rem; max-width: 300px; margin: 0 auto;">
|
|
12
|
+
<NumberInput
|
|
13
|
+
v-model="state.value"
|
|
14
|
+
:min="state.min"
|
|
15
|
+
:max="state.max"
|
|
16
|
+
:step="state.step"
|
|
17
|
+
:disabled="state.disabled"
|
|
18
|
+
:error="state.error"
|
|
19
|
+
:size="state.size"
|
|
20
|
+
:placeholder="state.placeholder"
|
|
21
|
+
/>
|
|
22
|
+
<p style="margin-top: 1rem; font-size: 0.875rem; color: var(--text-muted, #94a3b8);">
|
|
23
|
+
Value: <code>{{ JSON.stringify(state.value) }}</code>
|
|
24
|
+
</p>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<template #controls="{ state }">
|
|
29
|
+
<HstSlider v-model="state.value" title="Value" :min="0" :max="100" />
|
|
30
|
+
<HstSlider v-model="state.min" title="Min" :min="-100" :max="0" />
|
|
31
|
+
<HstSlider v-model="state.max" title="Max" :min="1" :max="1000" />
|
|
32
|
+
<HstSlider v-model="state.step" title="Step" :min="1" :max="50" />
|
|
33
|
+
<HstText v-model="state.placeholder" title="Placeholder" />
|
|
34
|
+
<HstSelect
|
|
35
|
+
v-model="state.size"
|
|
36
|
+
title="Size"
|
|
37
|
+
:options="sizes.map(s => ({ label: s, value: s }))"
|
|
38
|
+
/>
|
|
39
|
+
<HstCheckbox v-model="state.disabled" title="Disabled" />
|
|
40
|
+
<HstCheckbox v-model="state.error" title="Error" />
|
|
41
|
+
</template>
|
|
42
|
+
</Variant>
|
|
43
|
+
|
|
44
|
+
<Variant title="Sizes">
|
|
45
|
+
<div style="padding: 2rem; max-width: 300px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem;">
|
|
46
|
+
<div v-for="size in sizes" :key="size">
|
|
47
|
+
<p style="margin: 0 0 0.5rem; font-size: 0.75rem; color: var(--text-muted, #94a3b8); text-transform: uppercase; letter-spacing: 0.05em;">
|
|
48
|
+
{{ size }}
|
|
49
|
+
</p>
|
|
50
|
+
<NumberInput :model-value="42" :size="size" />
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</Variant>
|
|
54
|
+
|
|
55
|
+
<Variant title="With Constraints">
|
|
56
|
+
<div style="padding: 2rem; max-width: 300px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.5rem;">
|
|
57
|
+
<div>
|
|
58
|
+
<p style="margin: 0 0 0.5rem; font-size: 0.875rem; color: var(--text-primary, #e2e8f0);">Sample count (0-384)</p>
|
|
59
|
+
<NumberInput :model-value="96" :min="0" :max="384" :step="1" placeholder="Samples" />
|
|
60
|
+
</div>
|
|
61
|
+
<div>
|
|
62
|
+
<p style="margin: 0 0 0.5rem; font-size: 0.875rem; color: var(--text-primary, #e2e8f0);">Temperature (step 0.5)</p>
|
|
63
|
+
<NumberInput :model-value="37" :min="0" :max="100" :step="0.5" />
|
|
64
|
+
</div>
|
|
65
|
+
<div>
|
|
66
|
+
<p style="margin: 0 0 0.5rem; font-size: 0.875rem; color: var(--text-primary, #e2e8f0);">Volume in uL (step 10)</p>
|
|
67
|
+
<NumberInput :model-value="100" :min="0" :max="1000" :step="10" />
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
</Variant>
|
|
71
|
+
|
|
72
|
+
<Variant title="Error State">
|
|
73
|
+
<div style="padding: 2rem; max-width: 300px; margin: 0 auto;">
|
|
74
|
+
<NumberInput :model-value="999" :max="100" error />
|
|
75
|
+
</div>
|
|
76
|
+
</Variant>
|
|
77
|
+
|
|
78
|
+
<Variant title="Disabled">
|
|
79
|
+
<div style="padding: 2rem; max-width: 300px; margin: 0 auto;">
|
|
80
|
+
<NumberInput :model-value="50" disabled />
|
|
81
|
+
</div>
|
|
82
|
+
</Variant>
|
|
83
|
+
|
|
84
|
+
<Variant title="Empty with Placeholder">
|
|
85
|
+
<div style="padding: 2rem; max-width: 300px; margin: 0 auto;">
|
|
86
|
+
<NumberInput placeholder="Enter value..." />
|
|
87
|
+
</div>
|
|
88
|
+
</Variant>
|
|
89
|
+
|
|
90
|
+
<Variant title="Hover-Reveal Steppers (default)">
|
|
91
|
+
<template #default="{ state }">
|
|
92
|
+
<div style="padding: 2rem; max-width: 320px; display: flex; flex-direction: column; gap: 1rem;">
|
|
93
|
+
<NumberInput v-model="state.value" :step="0.5" />
|
|
94
|
+
<p style="margin: 0; font-size: 0.8125rem; color: var(--text-muted);">
|
|
95
|
+
Hover or focus to reveal the ↑/↓ steppers. Rest = clean.
|
|
96
|
+
</p>
|
|
97
|
+
</div>
|
|
98
|
+
</template>
|
|
99
|
+
<template #controls="{ state }">
|
|
100
|
+
<HstNumber v-model="state.value" title="Value" />
|
|
101
|
+
</template>
|
|
102
|
+
<template #initState>
|
|
103
|
+
{{ { value: 0 } }}
|
|
104
|
+
</template>
|
|
105
|
+
</Variant>
|
|
106
|
+
|
|
107
|
+
<Variant title="With unit suffix">
|
|
108
|
+
<div style="padding: 2rem; max-width: 320px; display: flex; flex-direction: column; gap: 0.75rem;">
|
|
109
|
+
<NumberInput :model-value="12.5" unit="mg" :step="0.1" />
|
|
110
|
+
<NumberInput :model-value="7.4" unit="pH" :step="0.1" :min="0" :max="14" />
|
|
111
|
+
<NumberInput :model-value="96" unit="wells" :step="1" />
|
|
112
|
+
</div>
|
|
113
|
+
</Variant>
|
|
114
|
+
|
|
115
|
+
<Variant title="Slider mode (min + max provided)">
|
|
116
|
+
<div style="padding: 2rem; max-width: 320px; display: flex; flex-direction: column; gap: 1rem;">
|
|
117
|
+
<NumberInput :model-value="7.4" :min="0" :max="14" :step="0.1" unit="pH" />
|
|
118
|
+
<NumberInput :model-value="45" :min="0" :max="100" :step="1" unit="%" />
|
|
119
|
+
</div>
|
|
120
|
+
</Variant>
|
|
121
|
+
</Story>
|
|
122
|
+
</template>
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/** Numeric input with increment/decrement buttons, optional unit label, and slider progress track. */
|
|
3
|
+
import { computed } from 'vue'
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
modelValue?: number
|
|
7
|
+
min?: number
|
|
8
|
+
max?: number
|
|
9
|
+
step?: number
|
|
10
|
+
disabled?: boolean
|
|
11
|
+
error?: boolean
|
|
12
|
+
size?: 'sm' | 'md' | 'lg'
|
|
13
|
+
placeholder?: string
|
|
14
|
+
unit?: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
18
|
+
step: 1,
|
|
19
|
+
disabled: false,
|
|
20
|
+
error: false,
|
|
21
|
+
size: 'md',
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const emit = defineEmits<{
|
|
25
|
+
'update:modelValue': [value: number | undefined]
|
|
26
|
+
}>()
|
|
27
|
+
|
|
28
|
+
const isSliderMode = computed(() => props.min !== undefined && props.max !== undefined)
|
|
29
|
+
|
|
30
|
+
const sliderPercent = computed(() => {
|
|
31
|
+
if (!isSliderMode.value || props.modelValue === undefined) return 0
|
|
32
|
+
const range = (props.max! - props.min!)
|
|
33
|
+
if (range === 0) return 0
|
|
34
|
+
return ((props.modelValue - props.min!) / range) * 100
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
const canDecrement = computed(() => {
|
|
38
|
+
if (props.modelValue === undefined) return true
|
|
39
|
+
if (props.min === undefined) return true
|
|
40
|
+
return props.modelValue > props.min
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const canIncrement = computed(() => {
|
|
44
|
+
if (props.modelValue === undefined) return true
|
|
45
|
+
if (props.max === undefined) return true
|
|
46
|
+
return props.modelValue < props.max
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
function clamp(value: number): number {
|
|
50
|
+
let result = value
|
|
51
|
+
if (props.min !== undefined && result < props.min) result = props.min
|
|
52
|
+
if (props.max !== undefined && result > props.max) result = props.max
|
|
53
|
+
return result
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function handleInput(event: Event) {
|
|
57
|
+
const target = event.target as HTMLInputElement
|
|
58
|
+
const value = target.value === '' ? undefined : Number(target.value)
|
|
59
|
+
if (value !== undefined && !isNaN(value)) {
|
|
60
|
+
emit('update:modelValue', clamp(value))
|
|
61
|
+
} else {
|
|
62
|
+
emit('update:modelValue', undefined)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function handleSliderInput(event: Event) {
|
|
67
|
+
const target = event.target as HTMLInputElement
|
|
68
|
+
const value = Number(target.value)
|
|
69
|
+
if (!isNaN(value)) {
|
|
70
|
+
emit('update:modelValue', clamp(value))
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function decrement() {
|
|
75
|
+
if (props.disabled || !canDecrement.value) return
|
|
76
|
+
const current = props.modelValue ?? (props.max ?? 0)
|
|
77
|
+
emit('update:modelValue', clamp(current - props.step))
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function increment() {
|
|
81
|
+
if (props.disabled || !canIncrement.value) return
|
|
82
|
+
const current = props.modelValue ?? (props.min ?? 0)
|
|
83
|
+
emit('update:modelValue', clamp(current + props.step))
|
|
84
|
+
}
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<template>
|
|
88
|
+
<div
|
|
89
|
+
:class="[
|
|
90
|
+
'mld-number-input',
|
|
91
|
+
`mld-number-input--${size}`,
|
|
92
|
+
isSliderMode ? 'mld-number-input--slider' : 'mld-number-input--stepper',
|
|
93
|
+
error ? 'mld-number-input--error' : '',
|
|
94
|
+
disabled ? 'mld-number-input--disabled' : '',
|
|
95
|
+
]"
|
|
96
|
+
>
|
|
97
|
+
<div class="mld-number-input__field">
|
|
98
|
+
<input
|
|
99
|
+
type="number"
|
|
100
|
+
:value="modelValue"
|
|
101
|
+
:min="min"
|
|
102
|
+
:max="max"
|
|
103
|
+
:step="step"
|
|
104
|
+
:disabled="disabled"
|
|
105
|
+
:placeholder="placeholder"
|
|
106
|
+
:class="[
|
|
107
|
+
'mld-number-input__input',
|
|
108
|
+
`mld-number-input__input--${size}`,
|
|
109
|
+
]"
|
|
110
|
+
@input="handleInput"
|
|
111
|
+
/>
|
|
112
|
+
|
|
113
|
+
<span v-if="unit" class="mld-number-input__unit">{{ unit }}</span>
|
|
114
|
+
|
|
115
|
+
<div class="mld-number-input__steppers" aria-hidden="true">
|
|
116
|
+
<button
|
|
117
|
+
type="button"
|
|
118
|
+
tabindex="-1"
|
|
119
|
+
aria-label="Increase value"
|
|
120
|
+
:disabled="disabled || !canIncrement"
|
|
121
|
+
class="mld-number-input__stepper mld-number-input__stepper--up"
|
|
122
|
+
@click="increment"
|
|
123
|
+
>
|
|
124
|
+
<svg viewBox="0 0 10 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
125
|
+
<path d="M1 5l4-4 4 4" />
|
|
126
|
+
</svg>
|
|
127
|
+
</button>
|
|
128
|
+
<button
|
|
129
|
+
type="button"
|
|
130
|
+
tabindex="-1"
|
|
131
|
+
aria-label="Decrease value"
|
|
132
|
+
:disabled="disabled || !canDecrement"
|
|
133
|
+
class="mld-number-input__stepper mld-number-input__stepper--down"
|
|
134
|
+
@click="decrement"
|
|
135
|
+
>
|
|
136
|
+
<svg viewBox="0 0 10 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
137
|
+
<path d="M1 1l4 4 4-4" />
|
|
138
|
+
</svg>
|
|
139
|
+
</button>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
|
|
143
|
+
<input
|
|
144
|
+
v-if="isSliderMode"
|
|
145
|
+
type="range"
|
|
146
|
+
:value="modelValue ?? min"
|
|
147
|
+
:min="min"
|
|
148
|
+
:max="max"
|
|
149
|
+
:step="step"
|
|
150
|
+
:disabled="disabled"
|
|
151
|
+
:style="{ '--mint-slider-fill': `${sliderPercent}%` }"
|
|
152
|
+
class="mld-number-input__slider"
|
|
153
|
+
@input="handleSliderInput"
|
|
154
|
+
/>
|
|
155
|
+
</div>
|
|
156
|
+
</template>
|
|
157
|
+
|
|
158
|
+
<style>
|
|
159
|
+
@import '../styles/components/number-input.css';
|
|
160
|
+
</style>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import PlateMapEditor from './PlateMapEditor.vue'
|
|
3
|
+
import type { SampleType } from '../types'
|
|
4
|
+
|
|
5
|
+
const mockSamples: SampleType[] = [
|
|
6
|
+
{ id: 's1', name: 'HeLa Cells', color: '#3B82F6', count: 0 },
|
|
7
|
+
{ id: 's2', name: 'MCF-7 Cells', color: '#10B981', count: 0 },
|
|
8
|
+
{ id: 's3', name: 'Vehicle Control', color: '#F59E0B', count: 0 },
|
|
9
|
+
{ id: 's4', name: 'Blank', color: '#EF4444', count: 0 },
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
function initState() {
|
|
13
|
+
return {
|
|
14
|
+
format: 96 as const,
|
|
15
|
+
maxPlates: 10,
|
|
16
|
+
samples: mockSamples,
|
|
17
|
+
showToolbar: true,
|
|
18
|
+
showSidebar: true,
|
|
19
|
+
allowAddPlates: true,
|
|
20
|
+
allowAddSamples: true,
|
|
21
|
+
size: 'md' as const,
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<Story title="Lab/PlateMapEditor">
|
|
28
|
+
<Variant title="Playground" :init-state="initState">
|
|
29
|
+
<template #default="{ state }">
|
|
30
|
+
<div style="padding: 2rem;">
|
|
31
|
+
<PlateMapEditor
|
|
32
|
+
:format="state.format"
|
|
33
|
+
:max-plates="state.maxPlates"
|
|
34
|
+
:samples="state.samples"
|
|
35
|
+
:show-toolbar="state.showToolbar"
|
|
36
|
+
:show-sidebar="state.showSidebar"
|
|
37
|
+
:allow-add-plates="state.allowAddPlates"
|
|
38
|
+
:allow-add-samples="state.allowAddSamples"
|
|
39
|
+
:size="state.size"
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
43
|
+
<template #controls="{ state }">
|
|
44
|
+
<HstSelect
|
|
45
|
+
v-model="state.format"
|
|
46
|
+
title="Format"
|
|
47
|
+
:options="[
|
|
48
|
+
{ value: 54, label: '54-well' },
|
|
49
|
+
{ value: 96, label: '96-well' },
|
|
50
|
+
]"
|
|
51
|
+
/>
|
|
52
|
+
<HstSlider v-model="state.maxPlates" title="Max Plates" :min="1" :max="10" />
|
|
53
|
+
<HstCheckbox v-model="state.showToolbar" title="Show Toolbar" />
|
|
54
|
+
<HstCheckbox v-model="state.showSidebar" title="Show Sidebar" />
|
|
55
|
+
<HstCheckbox v-model="state.allowAddPlates" title="Allow Add Plates" />
|
|
56
|
+
<HstCheckbox v-model="state.allowAddSamples" title="Allow Add Samples" />
|
|
57
|
+
<HstSelect
|
|
58
|
+
v-model="state.size"
|
|
59
|
+
title="Size"
|
|
60
|
+
:options="[
|
|
61
|
+
{ value: 'sm', label: 'Small' },
|
|
62
|
+
{ value: 'md', label: 'Medium' },
|
|
63
|
+
{ value: 'lg', label: 'Large' },
|
|
64
|
+
{ value: 'xl', label: 'Extra Large' },
|
|
65
|
+
{ value: 'fill', label: 'Fill' },
|
|
66
|
+
]"
|
|
67
|
+
/>
|
|
68
|
+
</template>
|
|
69
|
+
</Variant>
|
|
70
|
+
|
|
71
|
+
<Variant title="No Sidebar">
|
|
72
|
+
<div style="padding: 2rem;">
|
|
73
|
+
<PlateMapEditor
|
|
74
|
+
:format="96"
|
|
75
|
+
:samples="mockSamples"
|
|
76
|
+
:show-sidebar="false"
|
|
77
|
+
/>
|
|
78
|
+
</div>
|
|
79
|
+
</Variant>
|
|
80
|
+
|
|
81
|
+
<Variant title="Minimal (No Toolbar)">
|
|
82
|
+
<div style="padding: 2rem;">
|
|
83
|
+
<PlateMapEditor
|
|
84
|
+
:format="96"
|
|
85
|
+
:samples="mockSamples"
|
|
86
|
+
:show-toolbar="false"
|
|
87
|
+
:show-sidebar="false"
|
|
88
|
+
/>
|
|
89
|
+
</div>
|
|
90
|
+
</Variant>
|
|
91
|
+
</Story>
|
|
92
|
+
</template>
|