@ohif/ui-next 3.14.0-beta.97 → 3.14.0-beta.99
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/dist/ohif-ui-next.umd.js +4 -1925
- package/package.json +18 -7
- package/src/__mocks__/fileMock.js +7 -0
- package/src/assets/fonts.css +50 -0
- package/src/assets/styles.css +55 -0
- package/src/assets/woff2/latin.woff2 +0 -0
- package/src/components/Accordion/Accordion.tsx +70 -0
- package/src/components/Accordion/index.ts +3 -0
- package/src/components/AllInOneMenu/BackItem.tsx +32 -0
- package/src/components/AllInOneMenu/DividerItem.tsx +11 -0
- package/src/components/AllInOneMenu/HeaderItem.tsx +15 -0
- package/src/components/AllInOneMenu/IconMenu.tsx +83 -0
- package/src/components/AllInOneMenu/Item.tsx +51 -0
- package/src/components/AllInOneMenu/ItemPanel.tsx +38 -0
- package/src/components/AllInOneMenu/Menu.tsx +231 -0
- package/src/components/AllInOneMenu/PanelSelector.tsx +32 -0
- package/src/components/AllInOneMenu/SubMenu.tsx +36 -0
- package/src/components/AllInOneMenu/index.ts +42 -0
- package/src/components/BackgroundColorSelect/BackgroundColorSelect.tsx +38 -0
- package/src/components/BackgroundColorSelect/index.tsx +1 -0
- package/src/components/Badge/Badge.tsx +38 -0
- package/src/components/Badge/index.ts +1 -0
- package/src/components/Button/Button.tsx +65 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Calendar/Calendar.tsx +258 -0
- package/src/components/Calendar/index.tsx +3 -0
- package/src/components/Card/Card.tsx +83 -0
- package/src/components/Card/index.ts +2 -0
- package/src/components/Checkbox/Checkbox.tsx +27 -0
- package/src/components/Checkbox/index.tsx +3 -0
- package/src/components/CinePlayer/CinePlayer.tsx +187 -0
- package/src/components/CinePlayer/index.ts +5 -0
- package/src/components/Clipboard/Clipboard.tsx +58 -0
- package/src/components/Clipboard/index.tsx +3 -0
- package/src/components/ColorCircle.tsx +12 -0
- package/src/components/Combobox/Combobox.tsx +66 -0
- package/src/components/Combobox/index.ts +3 -0
- package/src/components/Command/Command.tsx +149 -0
- package/src/components/Command/index.ts +23 -0
- package/src/components/ContextMenu/ContextMenu.tsx +202 -0
- package/src/components/ContextMenu/index.ts +35 -0
- package/src/components/ContextMenuViewport/ContextMenuViewport.tsx +47 -0
- package/src/components/ContextMenuViewport/index.ts +1 -0
- package/src/components/DataRow/DataRow.tsx +532 -0
- package/src/components/DataRow/index.ts +1 -0
- package/src/components/DataRow/types.ts +31 -0
- package/src/components/DataTable/ActionOverlayCell.tsx +153 -0
- package/src/components/DataTable/ColumnHeader.tsx +70 -0
- package/src/components/DataTable/DataTable.tsx +532 -0
- package/src/components/DataTable/FilterRow.tsx +52 -0
- package/src/components/DataTable/Pagination.tsx +78 -0
- package/src/components/DataTable/Title.tsx +5 -0
- package/src/components/DataTable/Toolbar.tsx +5 -0
- package/src/components/DataTable/ViewOptions.tsx +86 -0
- package/src/components/DataTable/context.tsx +21 -0
- package/src/components/DataTable/index.ts +5 -0
- package/src/components/DataTable/types.ts +27 -0
- package/src/components/DataTable/useResponsiveColumns.tsx +346 -0
- package/src/components/DateRange/DateRange.tsx +163 -0
- package/src/components/DateRange/index.ts +3 -0
- package/src/components/Dialog/Dialog.tsx +201 -0
- package/src/components/Dialog/index.ts +25 -0
- package/src/components/Dialog/useDraggable.ts +108 -0
- package/src/components/DisplaySetMessageListTooltip/DisplaySetMessageListTooltip.tsx +64 -0
- package/src/components/DisplaySetMessageListTooltip/index.ts +3 -0
- package/src/components/DoubleSlider/DoubleSlider.test.ts +232 -0
- package/src/components/DoubleSlider/DoubleSlider.tsx +211 -0
- package/src/components/DoubleSlider/index.tsx +3 -0
- package/src/components/DropdownMenu/DropdownMenu.tsx +213 -0
- package/src/components/DropdownMenu/index.ts +35 -0
- package/src/components/Errorboundary/ErrorBoundary.tsx +345 -0
- package/src/components/Errorboundary/index.tsx +3 -0
- package/src/components/FooterAction/FooterAction.tsx +115 -0
- package/src/components/FooterAction/index.tsx +3 -0
- package/src/components/Header/Header.tsx +140 -0
- package/src/components/Header/index.js +2 -0
- package/src/components/HoverCard/HoverCard.tsx +30 -0
- package/src/components/HoverCard/index.ts +1 -0
- package/src/components/Icons/Icons.tsx +852 -0
- package/src/components/Icons/Sources/ActionNewDialog.tsx +64 -0
- package/src/components/Icons/Sources/Actions.tsx +47 -0
- package/src/components/Icons/Sources/Add.tsx +51 -0
- package/src/components/Icons/Sources/Alert.tsx +32 -0
- package/src/components/Icons/Sources/AlertOutline.tsx +30 -0
- package/src/components/Icons/Sources/ArrowLeftBold.tsx +49 -0
- package/src/components/Icons/Sources/ArrowRight.tsx +25 -0
- package/src/components/Icons/Sources/Cancel.tsx +37 -0
- package/src/components/Icons/Sources/CheckBoxChecked.tsx +39 -0
- package/src/components/Icons/Sources/CheckBoxUnChecked.tsx +25 -0
- package/src/components/Icons/Sources/Checked.tsx +23 -0
- package/src/components/Icons/Sources/ChevronClosed.tsx +40 -0
- package/src/components/Icons/Sources/ChevronLeft.tsx +28 -0
- package/src/components/Icons/Sources/ChevronOpen.tsx +38 -0
- package/src/components/Icons/Sources/Clear.tsx +34 -0
- package/src/components/Icons/Sources/Clipboard.tsx +15 -0
- package/src/components/Icons/Sources/Close.tsx +28 -0
- package/src/components/Icons/Sources/CloudSettings.tsx +34 -0
- package/src/components/Icons/Sources/Code.tsx +7 -0
- package/src/components/Icons/Sources/ColorChange.tsx +100 -0
- package/src/components/Icons/Sources/ContentNext.tsx +35 -0
- package/src/components/Icons/Sources/ContentPrev.tsx +35 -0
- package/src/components/Icons/Sources/Controls.tsx +99 -0
- package/src/components/Icons/Sources/Copy.tsx +44 -0
- package/src/components/Icons/Sources/Database.tsx +33 -0
- package/src/components/Icons/Sources/Delete.tsx +58 -0
- package/src/components/Icons/Sources/DicomTagBrowser.tsx +79 -0
- package/src/components/Icons/Sources/DisplayFillAndOutline.tsx +49 -0
- package/src/components/Icons/Sources/DisplayFillOnly.tsx +40 -0
- package/src/components/Icons/Sources/DisplayOutlineOnly.tsx +40 -0
- package/src/components/Icons/Sources/Download.tsx +75 -0
- package/src/components/Icons/Sources/Export.tsx +53 -0
- package/src/components/Icons/Sources/ExternalLink.tsx +26 -0
- package/src/components/Icons/Sources/EyeHidden.tsx +32 -0
- package/src/components/Icons/Sources/EyeVisible.tsx +28 -0
- package/src/components/Icons/Sources/FeedbackComplete.tsx +35 -0
- package/src/components/Icons/Sources/GearSettings.tsx +59 -0
- package/src/components/Icons/Sources/GroupLayers.tsx +33 -0
- package/src/components/Icons/Sources/Helpers.tsx +398 -0
- package/src/components/Icons/Sources/Hide.tsx +45 -0
- package/src/components/Icons/Sources/IconColorLUT.tsx +103 -0
- package/src/components/Icons/Sources/IconMPR.tsx +55 -0
- package/src/components/Icons/Sources/IconTransferring.tsx +25 -0
- package/src/components/Icons/Sources/IllustrationNotFound.tsx +102 -0
- package/src/components/Icons/Sources/Info.tsx +55 -0
- package/src/components/Icons/Sources/InfoLink.tsx +23 -0
- package/src/components/Icons/Sources/InfoSeries.tsx +52 -0
- package/src/components/Icons/Sources/InvestigationalUse.tsx +82 -0
- package/src/components/Icons/Sources/JumpToSlice.tsx +69 -0
- package/src/components/Icons/Sources/LaunchArrow.tsx +34 -0
- package/src/components/Icons/Sources/LaunchInfo.tsx +38 -0
- package/src/components/Icons/Sources/LayerBackground.tsx +28 -0
- package/src/components/Icons/Sources/LayerForeground.tsx +34 -0
- package/src/components/Icons/Sources/LayerSegmentation.tsx +20 -0
- package/src/components/Icons/Sources/Layout.tsx +433 -0
- package/src/components/Icons/Sources/Link.tsx +58 -0
- package/src/components/Icons/Sources/ListView.tsx +79 -0
- package/src/components/Icons/Sources/LoadingOHIFMark.tsx +21 -0
- package/src/components/Icons/Sources/LoadingSpinner.tsx +49 -0
- package/src/components/Icons/Sources/Lock.tsx +35 -0
- package/src/components/Icons/Sources/Magnifier.tsx +37 -0
- package/src/components/Icons/Sources/Minus.tsx +40 -0
- package/src/components/Icons/Sources/MissingIcon.tsx +6 -0
- package/src/components/Icons/Sources/More.tsx +53 -0
- package/src/components/Icons/Sources/MultiplePatients.tsx +76 -0
- package/src/components/Icons/Sources/NavigationPanelReveal.tsx +25 -0
- package/src/components/Icons/Sources/NotificationInfo.tsx +33 -0
- package/src/components/Icons/Sources/NotificationWarning.tsx +44 -0
- package/src/components/Icons/Sources/OHIFLogo.tsx +72 -0
- package/src/components/Icons/Sources/OHIFLogoColorDarkBackground.tsx +78 -0
- package/src/components/Icons/Sources/OHIFLogoHorizontal.tsx +139 -0
- package/src/components/Icons/Sources/Opacity.tsx +106 -0
- package/src/components/Icons/Sources/OrientationSwitch.tsx +41 -0
- package/src/components/Icons/Sources/OrientationSwitchA.tsx +41 -0
- package/src/components/Icons/Sources/OrientationSwitchC.tsx +41 -0
- package/src/components/Icons/Sources/OrientationSwitchR.tsx +41 -0
- package/src/components/Icons/Sources/OrientationSwitchS.tsx +41 -0
- package/src/components/Icons/Sources/PanelRight.tsx +29 -0
- package/src/components/Icons/Sources/Patient.tsx +58 -0
- package/src/components/Icons/Sources/PatientStudyList.tsx +62 -0
- package/src/components/Icons/Sources/Pause.tsx +26 -0
- package/src/components/Icons/Sources/Pencil.tsx +16 -0
- package/src/components/Icons/Sources/Pin.tsx +50 -0
- package/src/components/Icons/Sources/PinFill.tsx +51 -0
- package/src/components/Icons/Sources/Play.tsx +25 -0
- package/src/components/Icons/Sources/Plus.tsx +29 -0
- package/src/components/Icons/Sources/PowerOff.tsx +19 -0
- package/src/components/Icons/Sources/Redo.tsx +51 -0
- package/src/components/Icons/Sources/Refresh.tsx +42 -0
- package/src/components/Icons/Sources/Rename.tsx +50 -0
- package/src/components/Icons/Sources/Search.tsx +35 -0
- package/src/components/Icons/Sources/SegActions.tsx +594 -0
- package/src/components/Icons/Sources/Series.tsx +47 -0
- package/src/components/Icons/Sources/SeriesPlaceholder.tsx +40 -0
- package/src/components/Icons/Sources/Settings.tsx +105 -0
- package/src/components/Icons/Sources/SettingsStudyList.tsx +28 -0
- package/src/components/Icons/Sources/Show.tsx +67 -0
- package/src/components/Icons/Sources/SidePanelCloseLeft.tsx +75 -0
- package/src/components/Icons/Sources/SidePanelCloseRight.tsx +74 -0
- package/src/components/Icons/Sources/SocialGithub.tsx +39 -0
- package/src/components/Icons/Sources/Sorting.tsx +39 -0
- package/src/components/Icons/Sources/SortingAscending.tsx +28 -0
- package/src/components/Icons/Sources/SortingDescending.tsx +26 -0
- package/src/components/Icons/Sources/SortingNew.tsx +20 -0
- package/src/components/Icons/Sources/SortingNewAscending.tsx +35 -0
- package/src/components/Icons/Sources/SortingNewDescending.tsx +35 -0
- package/src/components/Icons/Sources/StatusAlert.tsx +36 -0
- package/src/components/Icons/Sources/StatusError.tsx +57 -0
- package/src/components/Icons/Sources/StatusLocked.tsx +35 -0
- package/src/components/Icons/Sources/StatusSuccess.tsx +45 -0
- package/src/components/Icons/Sources/StatusTracking.tsx +37 -0
- package/src/components/Icons/Sources/StatusUntracked.tsx +30 -0
- package/src/components/Icons/Sources/StatusWarning.tsx +58 -0
- package/src/components/Icons/Sources/Tab4D.tsx +54 -0
- package/src/components/Icons/Sources/TabContours.tsx +63 -0
- package/src/components/Icons/Sources/TabLinear.tsx +47 -0
- package/src/components/Icons/Sources/TabPatientInfo.tsx +33 -0
- package/src/components/Icons/Sources/TabRoiThreshold.tsx +38 -0
- package/src/components/Icons/Sources/TabSegmentation.tsx +38 -0
- package/src/components/Icons/Sources/TabStudies.tsx +62 -0
- package/src/components/Icons/Sources/Threshold.tsx +38 -0
- package/src/components/Icons/Sources/ThumbnailView.tsx +67 -0
- package/src/components/Icons/Sources/Tools.tsx +3659 -0
- package/src/components/Icons/Sources/Trash.tsx +17 -0
- package/src/components/Icons/Sources/Undo.tsx +51 -0
- package/src/components/Icons/Sources/Upload.tsx +29 -0
- package/src/components/Icons/Sources/ViewportViews.tsx +45 -0
- package/src/components/Icons/Sources/ViewportWindowLevel.tsx +58 -0
- package/src/components/Icons/Sources/WindowLevelAdvanced.tsx +30 -0
- package/src/components/Icons/index.ts +4 -0
- package/src/components/Icons/types.ts +3 -0
- package/src/components/Input/Input.tsx +25 -0
- package/src/components/Input/index.tsx +3 -0
- package/src/components/InputFilter/InputFilter.tsx +200 -0
- package/src/components/InputFilter/index.ts +2 -0
- package/src/components/InputMultiSelect/InputMultiSelect.tsx +370 -0
- package/src/components/InputMultiSelect/index.ts +1 -0
- package/src/components/InputNumber/InputNumber.tsx +439 -0
- package/src/components/InputNumber/index.ts +3 -0
- package/src/components/InvestigationalUseDialog/InvestigationalUseDialog.tsx +98 -0
- package/src/components/InvestigationalUseDialog/index.ts +3 -0
- package/src/components/Label/Label.tsx +24 -0
- package/src/components/Label/index.tsx +3 -0
- package/src/components/Labelling/LabellingFlow.tsx +92 -0
- package/src/components/Labelling/index.ts +2 -0
- package/src/components/LayoutSelector/LayoutSelector.tsx +345 -0
- package/src/components/LayoutSelector/index.ts +4 -0
- package/src/components/LineChart/LineChart.css +40 -0
- package/src/components/LineChart/LineChart.tsx +101 -0
- package/src/components/LineChart/d3LineChart/chart.ts +365 -0
- package/src/components/LineChart/d3LineChart/events.ts +149 -0
- package/src/components/LineChart/d3LineChart/index.ts +3 -0
- package/src/components/LineChart/d3LineChart/lineChart.ts +272 -0
- package/src/components/LineChart/index.ts +1 -0
- package/src/components/LoadingIndicatorProgress/LoadingIndicatorProgress.tsx +29 -0
- package/src/components/LoadingIndicatorProgress/index.ts +2 -0
- package/src/components/LoadingIndicatorTotalPercent/LoadingIndicatorTotalPercent.tsx +49 -0
- package/src/components/LoadingIndicatorTotalPercent/index.ts +2 -0
- package/src/components/MeasurementTable/MeasurementTable.tsx +144 -0
- package/src/components/MeasurementTable/index.js +3 -0
- package/src/components/Modal/Modal.tsx +44 -0
- package/src/components/NavBar/NavBar.tsx +32 -0
- package/src/components/NavBar/index.js +2 -0
- package/src/components/Numeric/Numeric.test.ts +124 -0
- package/src/components/Numeric/Numeric.tsx +576 -0
- package/src/components/Numeric/index.ts +3 -0
- package/src/components/OHIFDialogs/InputDialog.tsx +287 -0
- package/src/components/OHIFDialogs/PresetDialog.tsx +106 -0
- package/src/components/OHIFDialogs/index.ts +2 -0
- package/src/components/OHIFModals/AboutModal.tsx +114 -0
- package/src/components/OHIFModals/AppearanceModal.tsx +38 -0
- package/src/components/OHIFModals/ImageModal.tsx +251 -0
- package/src/components/OHIFModals/UserPreferencesModal.tsx +229 -0
- package/src/components/OHIFModals/index.ts +4 -0
- package/src/components/OHIFPanels/WindowLevel.tsx +162 -0
- package/src/components/OHIFPanels/WindowLevelHistogram.tsx +237 -0
- package/src/components/OHIFPanels/index.ts +3 -0
- package/src/components/OHIFPanels/types.ts +41 -0
- package/src/components/OHIFToolSettings/RowDoubleRange.tsx +67 -0
- package/src/components/OHIFToolSettings/RowInputRange.tsx +65 -0
- package/src/components/OHIFToolSettings/RowSegmentedControl.tsx +77 -0
- package/src/components/OHIFToolSettings/ToolSettings.tsx +253 -0
- package/src/components/OHIFToolSettings/index.ts +1 -0
- package/src/components/OHIFToolbox/ToolboxUI.tsx +104 -0
- package/src/components/OHIFToolbox/index.ts +1 -0
- package/src/components/Onboarding/Onboarding.css +48 -0
- package/src/components/Onboarding/Onboarding.tsx +58 -0
- package/src/components/Onboarding/index.ts +3 -0
- package/src/components/Onboarding/utilities.ts +91 -0
- package/src/components/PanelSection/PanelSection.tsx +70 -0
- package/src/components/PanelSection/index.ts +2 -0
- package/src/components/Popover/Popover.tsx +35 -0
- package/src/components/Popover/index.ts +3 -0
- package/src/components/ProgressDropdown/ProgressDiscreteBar.tsx +24 -0
- package/src/components/ProgressDropdown/ProgressDropdown.tsx +158 -0
- package/src/components/ProgressDropdown/ProgressItem.tsx +27 -0
- package/src/components/ProgressDropdown/ProgressItemDetail.tsx +89 -0
- package/src/components/ProgressDropdown/index.ts +1 -0
- package/src/components/ProgressDropdown/types.ts +9 -0
- package/src/components/ProgressLoadingBar/ProgressLoadingBar.css +26 -0
- package/src/components/ProgressLoadingBar/ProgressLoadingBar.tsx +32 -0
- package/src/components/ProgressLoadingBar/index.ts +2 -0
- package/src/components/Resizable/Resizable.tsx +43 -0
- package/src/components/Resizable/index.ts +3 -0
- package/src/components/ScrollArea/ScrollArea.tsx +127 -0
- package/src/components/ScrollArea/index.tsx +3 -0
- package/src/components/SegmentationTable/AddSegmentRow.tsx +78 -0
- package/src/components/SegmentationTable/AddSegmentationRow.tsx +56 -0
- package/src/components/SegmentationTable/SegmentStatistics.tsx +104 -0
- package/src/components/SegmentationTable/SegmentationCollapsed.tsx +211 -0
- package/src/components/SegmentationTable/SegmentationExpanded.tsx +173 -0
- package/src/components/SegmentationTable/SegmentationHeader.tsx +58 -0
- package/src/components/SegmentationTable/SegmentationLabel.tsx +27 -0
- package/src/components/SegmentationTable/SegmentationSegments.tsx +206 -0
- package/src/components/SegmentationTable/SegmentationTable.tsx +169 -0
- package/src/components/SegmentationTable/SegmentationTableConfig.tsx +194 -0
- package/src/components/SegmentationTable/contexts/SegmentStatisticsContext.tsx +45 -0
- package/src/components/SegmentationTable/contexts/SegmentationExpandedContext.tsx +45 -0
- package/src/components/SegmentationTable/contexts/SegmentationTableContext.tsx +148 -0
- package/src/components/SegmentationTable/contexts/index.ts +15 -0
- package/src/components/SegmentationTable/index.ts +24 -0
- package/src/components/Select/Select.tsx +167 -0
- package/src/components/Select/index.tsx +40 -0
- package/src/components/Separator/Separator.tsx +32 -0
- package/src/components/Separator/index.ts +3 -0
- package/src/components/Separator/index.tsx +3 -0
- package/src/components/SidePanel/SidePanel.tsx +479 -0
- package/src/components/SidePanel/index.ts +2 -0
- package/src/components/Slider/Slider.tsx +24 -0
- package/src/components/Slider/index.tsx +3 -0
- package/src/components/SmartScrollbar/SmartScrollbar.tsx +349 -0
- package/src/components/SmartScrollbar/SmartScrollbarEndpoints.tsx +82 -0
- package/src/components/SmartScrollbar/SmartScrollbarFill.tsx +54 -0
- package/src/components/SmartScrollbar/SmartScrollbarIndicator.tsx +59 -0
- package/src/components/SmartScrollbar/SmartScrollbarTrack.tsx +104 -0
- package/src/components/SmartScrollbar/defaultSmartScrollbarIndicatorConfig.tsx +48 -0
- package/src/components/SmartScrollbar/index.ts +11 -0
- package/src/components/SmartScrollbar/useByteArray.ts +146 -0
- package/src/components/SmartScrollbar/utils.test.ts +124 -0
- package/src/components/SmartScrollbar/utils.ts +168 -0
- package/src/components/Sonner/Sonner.tsx +31 -0
- package/src/components/Sonner/index.ts +4 -0
- package/src/components/StudyBrowser/StudyBrowser.tsx +89 -0
- package/src/components/StudyBrowser/index.ts +2 -0
- package/src/components/StudyBrowserSort/StudyBrowserSort.tsx +87 -0
- package/src/components/StudyBrowserSort/index.ts +3 -0
- package/src/components/StudyBrowserViewOptions/StudyBrowserViewOptions.tsx +50 -0
- package/src/components/StudyBrowserViewOptions/index.ts +3 -0
- package/src/components/StudyItem/StudyItem.tsx +100 -0
- package/src/components/StudyItem/index.ts +2 -0
- package/src/components/StudyList/columns/defaultColumns.tsx +258 -0
- package/src/components/StudyList/components/ActionCell.tsx +19 -0
- package/src/components/StudyList/components/Layout.tsx +206 -0
- package/src/components/StudyList/components/PreviewContainer.tsx +45 -0
- package/src/components/StudyList/components/PreviewContent.tsx +186 -0
- package/src/components/StudyList/components/PreviewHeader.tsx +5 -0
- package/src/components/StudyList/components/PreviewPatientSummary.tsx +224 -0
- package/src/components/StudyList/components/PreviewSeriesList.tsx +64 -0
- package/src/components/StudyList/components/PreviewToggleButton.tsx +69 -0
- package/src/components/StudyList/components/SettingsPopover.tsx +214 -0
- package/src/components/StudyList/components/Table.tsx +247 -0
- package/src/components/StudyList/components/WorkflowMenu.tsx +72 -0
- package/src/components/StudyList/components/WorkflowsProvider.tsx +169 -0
- package/src/components/StudyList/hooks/useDefaultWorkflow.ts +60 -0
- package/src/components/StudyList/index.ts +52 -0
- package/src/components/StudyList/types/types.ts +42 -0
- package/src/components/StudyList/utils/tokenizeModalities.ts +6 -0
- package/src/components/StudySummary/StudySummary.tsx +27 -0
- package/src/components/StudySummary/index.tsx +3 -0
- package/src/components/Switch/Switch.tsx +28 -0
- package/src/components/Switch/index.tsx +3 -0
- package/src/components/Table/Table.tsx +134 -0
- package/src/components/Table/index.ts +11 -0
- package/src/components/Tabs/Tabs.tsx +56 -0
- package/src/components/Tabs/index.ts +3 -0
- package/src/components/Tabs/index.tsx +3 -0
- package/src/components/ThemeWrapper/ThemeWrapper.tsx +5 -0
- package/src/components/ThemeWrapper/index.ts +1 -0
- package/src/components/Thumbnail/Thumbnail.test.ts +71 -0
- package/src/components/Thumbnail/Thumbnail.tsx +351 -0
- package/src/components/Thumbnail/index.ts +2 -0
- package/src/components/ThumbnailList/ThumbnailList.tsx +94 -0
- package/src/components/ThumbnailList/index.ts +2 -0
- package/src/components/Toggle/Toggle.tsx +45 -0
- package/src/components/Toggle/index.ts +3 -0
- package/src/components/Toggle/index.tsx +3 -0
- package/src/components/ToggleGroup/ToggleGroup.tsx +63 -0
- package/src/components/ToggleGroup/index.ts +3 -0
- package/src/components/ToolButton/ToolButton.tsx +134 -0
- package/src/components/ToolButton/ToolButtonList.tsx +243 -0
- package/src/components/ToolButton/index.ts +8 -0
- package/src/components/Tooltip/Tooltip.tsx +34 -0
- package/src/components/Tooltip/index.ts +3 -0
- package/src/components/Viewport/ImageScrollbar.module.css +89 -0
- package/src/components/Viewport/ImageScrollbar.tsx +71 -0
- package/src/components/Viewport/PatientInfo.tsx +126 -0
- package/src/components/Viewport/ViewportActionArrows.tsx +36 -0
- package/src/components/Viewport/ViewportActionBar.tsx +107 -0
- package/src/components/Viewport/ViewportActionButton.tsx +25 -0
- package/src/components/Viewport/ViewportActionCorners.tsx +171 -0
- package/src/components/Viewport/ViewportGrid.tsx +24 -0
- package/src/components/Viewport/ViewportOverlay.css +32 -0
- package/src/components/Viewport/ViewportOverlay.tsx +54 -0
- package/src/components/Viewport/ViewportPane.tsx +82 -0
- package/src/components/Viewport/index.ts +9 -0
- package/src/components/ViewportDialog/ViewportDialog.tsx +128 -0
- package/src/components/ViewportDialog/index.ts +2 -0
- package/src/components/index.ts +323 -0
- package/src/contextProviders/ActiveThemeProvider.tsx +204 -0
- package/src/contextProviders/CineProvider.tsx +98 -0
- package/src/contextProviders/DialogProvider.tsx +103 -0
- package/src/contextProviders/DragAndDropProvider.tsx +37 -0
- package/src/contextProviders/IconPresentationProvider.tsx +88 -0
- package/src/contextProviders/ImageViewerProvider.tsx +15 -0
- package/src/contextProviders/ManagedDialog.tsx +176 -0
- package/src/contextProviders/ModalProvider.tsx +102 -0
- package/src/contextProviders/NotificationProvider.tsx +246 -0
- package/src/contextProviders/UserAuthenticationProvider.tsx +118 -0
- package/src/contextProviders/ViewportDialogProvider.tsx +42 -0
- package/src/contextProviders/ViewportGridProvider.tsx +556 -0
- package/src/contextProviders/index.ts +26 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useDynamicMaxHeight.ts +105 -0
- package/src/hooks/useSessionStorage.test.js +103 -0
- package/src/hooks/useSessionStorage.tsx +71 -0
- package/src/index.ts +7 -0
- package/src/lib/utils.ts +6 -0
- package/src/tailwind.css +266 -0
- package/src/themes/arctic.json +31 -0
- package/src/themes/deep.json +31 -0
- package/src/themes/index.ts +16 -0
- package/src/themes/midnight.json +31 -0
- package/src/themes/orchid.json +31 -0
- package/src/themes/slate.json +31 -0
- package/src/themes/themes.css +206 -0
- package/src/themes/verdant.json +31 -0
- package/src/types/ActionCorners.ts +18 -0
- package/src/types/AppTypes.ts +24 -0
- package/src/types/ContextMenuItem.ts +9 -0
- package/src/types/Predicate.ts +1 -0
- package/src/types/ThumbnailType.ts +3 -0
- package/src/types/ViewportActionCornersTypes.ts +13 -0
- package/src/types/global.d.ts +4 -0
- package/src/types/index.ts +21 -0
- package/src/utils/formatDICOMDate.test.ts +61 -0
- package/src/utils/formatDICOMDate.ts +65 -0
- package/src/utils/formatDICOMTime.test.ts +62 -0
- package/src/utils/formatDICOMTime.ts +49 -0
- package/src/utils/getToggledClassName.tsx +5 -0
- package/src/utils/index.ts +15 -0
- package/src/utils/parseStudyDateTimestamp.test.ts +47 -0
- package/src/utils/parseStudyDateTimestamp.ts +27 -0
- package/src/utils/roundNumber.ts +43 -0
- package/tailwind.config.js +120 -0
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { useDrag } from 'react-dnd';
|
|
4
|
+
import { Icons } from '../Icons';
|
|
5
|
+
import { DisplaySetMessageListTooltip } from '../DisplaySetMessageListTooltip';
|
|
6
|
+
import { TooltipTrigger, TooltipContent, Tooltip } from '../Tooltip';
|
|
7
|
+
|
|
8
|
+
const DraggableThumbnailContent = ({ dragData, children }: any) => {
|
|
9
|
+
const [, drag] = useDrag({
|
|
10
|
+
type: 'displayset',
|
|
11
|
+
item: { ...dragData },
|
|
12
|
+
canDrag: function () {
|
|
13
|
+
return Object.keys(dragData).length !== 0;
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<div
|
|
19
|
+
ref={drag}
|
|
20
|
+
className="h-full w-full"
|
|
21
|
+
>
|
|
22
|
+
{children}
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const StaticThumbnailContent = ({ children }: any) => {
|
|
28
|
+
return <div className="h-full w-full">{children}</div>;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Display a thumbnail for a display set.
|
|
33
|
+
*/
|
|
34
|
+
const Thumbnail = ({
|
|
35
|
+
displaySetInstanceUID,
|
|
36
|
+
className,
|
|
37
|
+
children,
|
|
38
|
+
imageSrc,
|
|
39
|
+
imageAltText,
|
|
40
|
+
description,
|
|
41
|
+
seriesNumber,
|
|
42
|
+
numInstances,
|
|
43
|
+
details,
|
|
44
|
+
loadingProgress,
|
|
45
|
+
countIcon,
|
|
46
|
+
messages,
|
|
47
|
+
isActive,
|
|
48
|
+
onClick,
|
|
49
|
+
onDoubleClick,
|
|
50
|
+
thumbnailType,
|
|
51
|
+
modality,
|
|
52
|
+
viewPreset = 'thumbnails',
|
|
53
|
+
isHydratedForDerivedDisplaySet = false,
|
|
54
|
+
isTracked = false,
|
|
55
|
+
canReject = false,
|
|
56
|
+
dragData = {},
|
|
57
|
+
isDraggable = true,
|
|
58
|
+
onReject = () => {},
|
|
59
|
+
onClickUntrack = () => {},
|
|
60
|
+
ThumbnailMenuItems = () => {},
|
|
61
|
+
onImageLoadError = () => {},
|
|
62
|
+
}: withAppTypes): React.ReactNode => {
|
|
63
|
+
const [lastTap, setLastTap] = useState(0);
|
|
64
|
+
const [imageLoadFailed, setImageLoadFailed] = useState(false);
|
|
65
|
+
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
setImageLoadFailed(false);
|
|
68
|
+
}, [imageSrc]);
|
|
69
|
+
|
|
70
|
+
const shouldRenderThumbnailImage = Boolean(imageSrc && !imageLoadFailed);
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The detail line under the description. `details` comes from the
|
|
74
|
+
* `studyBrowser.thumbnailDetails` customization, resolved by the panel; the
|
|
75
|
+
* series number and instance count below are the same two items the default
|
|
76
|
+
* customization declares, kept here so the component still stands alone.
|
|
77
|
+
*/
|
|
78
|
+
const renderDetails = (textClass: string, firstItemClass?: string) => {
|
|
79
|
+
// `??`, not `|| `: an unset `details` means no customization was resolved
|
|
80
|
+
// for this thumbnail and the defaults below stand in, whereas an empty
|
|
81
|
+
// `details` is a customization that resolved to no items at all and is
|
|
82
|
+
// honoured as the empty line it asks for.
|
|
83
|
+
const items = details ?? [
|
|
84
|
+
{ id: 'SeriesNumber', label: 'S:', value: seriesNumber },
|
|
85
|
+
{ id: 'InstanceCount', iconName: countIcon || 'InfoSeries', value: numInstances },
|
|
86
|
+
];
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<div className="flex h-[12px] items-center gap-[7px] overflow-hidden">
|
|
90
|
+
{items.map(({ id, label, title, value, iconName }, index) => (
|
|
91
|
+
<div
|
|
92
|
+
key={id ?? index}
|
|
93
|
+
className={classnames(
|
|
94
|
+
'text-muted-foreground',
|
|
95
|
+
textClass,
|
|
96
|
+
index === 0 && firstItemClass
|
|
97
|
+
)}
|
|
98
|
+
title={title || undefined}
|
|
99
|
+
data-cy={`thumbnail-detail-${id}`}
|
|
100
|
+
>
|
|
101
|
+
<div className="flex items-center gap-[4px]">
|
|
102
|
+
{iconName &&
|
|
103
|
+
React.createElement(Icons[iconName] || Icons.MissingIcon, { className: 'w-3' })}
|
|
104
|
+
<div>
|
|
105
|
+
{label}
|
|
106
|
+
{value}
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
))}
|
|
111
|
+
</div>
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const handleTouchEnd = e => {
|
|
116
|
+
const currentTime = new Date().getTime();
|
|
117
|
+
const tapLength = currentTime - lastTap;
|
|
118
|
+
if (tapLength < 300 && tapLength > 0) {
|
|
119
|
+
onDoubleClick(e);
|
|
120
|
+
} else {
|
|
121
|
+
onClick(e);
|
|
122
|
+
}
|
|
123
|
+
setLastTap(currentTime);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const renderThumbnailPreset = () => {
|
|
127
|
+
return (
|
|
128
|
+
<div
|
|
129
|
+
className={classnames(
|
|
130
|
+
'flex h-full w-full flex-col items-center justify-center gap-[2px] p-[4px]',
|
|
131
|
+
isActive && 'bg-popover rounded'
|
|
132
|
+
)}
|
|
133
|
+
>
|
|
134
|
+
<div className="h-[114px] w-[128px]">
|
|
135
|
+
<div className="relative bg-background">
|
|
136
|
+
{shouldRenderThumbnailImage ? (
|
|
137
|
+
<img
|
|
138
|
+
src={imageSrc}
|
|
139
|
+
alt={imageAltText}
|
|
140
|
+
className="h-[114px] w-[128px] rounded object-contain"
|
|
141
|
+
crossOrigin="anonymous"
|
|
142
|
+
onError={() => {
|
|
143
|
+
setImageLoadFailed(true);
|
|
144
|
+
onImageLoadError();
|
|
145
|
+
}}
|
|
146
|
+
/>
|
|
147
|
+
) : (
|
|
148
|
+
<div className="bg-background h-[114px] w-[128px] rounded">{children}</div>
|
|
149
|
+
)}
|
|
150
|
+
|
|
151
|
+
{/* bottom left */}
|
|
152
|
+
<div className="absolute bottom-0 left-0 flex h-[14px] items-center gap-[4px] rounded-tr pt-[10px] pb-[10px] pr-[6px] pl-[5px]">
|
|
153
|
+
<div
|
|
154
|
+
className={classnames(
|
|
155
|
+
'h-[10px] w-[10px] rounded-[2px]',
|
|
156
|
+
isActive || isHydratedForDerivedDisplaySet ? 'bg-highlight' : 'bg-primary/65',
|
|
157
|
+
loadingProgress && loadingProgress < 1 && 'bg-primary/25'
|
|
158
|
+
)}
|
|
159
|
+
></div>
|
|
160
|
+
<div
|
|
161
|
+
className="text-foreground text-[11px] font-semibold"
|
|
162
|
+
data-cy="series-modality-label"
|
|
163
|
+
>
|
|
164
|
+
{modality}
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
{/* top right */}
|
|
169
|
+
<div className="absolute top-0 right-0 flex items-center gap-[4px]">
|
|
170
|
+
<DisplaySetMessageListTooltip
|
|
171
|
+
messages={messages}
|
|
172
|
+
id={`display-set-tooltip-${displaySetInstanceUID}`}
|
|
173
|
+
/>
|
|
174
|
+
{isTracked && (
|
|
175
|
+
<Tooltip>
|
|
176
|
+
<TooltipTrigger>
|
|
177
|
+
<div className="group">
|
|
178
|
+
<Icons.StatusTracking className="text-highlight h-[15px] w-[15px] group-hover:hidden" />
|
|
179
|
+
<Icons.Cancel
|
|
180
|
+
className="text-highlight hidden h-[15px] w-[15px] group-hover:block"
|
|
181
|
+
onClick={onClickUntrack}
|
|
182
|
+
/>
|
|
183
|
+
</div>
|
|
184
|
+
</TooltipTrigger>
|
|
185
|
+
<TooltipContent side="right">
|
|
186
|
+
<div className="flex flex-1 flex-row">
|
|
187
|
+
<div className="flex-2 flex items-center justify-center pr-4">
|
|
188
|
+
<Icons.InfoLink className="text-primary" />
|
|
189
|
+
</div>
|
|
190
|
+
<div className="flex flex-1 flex-col">
|
|
191
|
+
<span>
|
|
192
|
+
<span className="text-foreground">
|
|
193
|
+
{isTracked ? 'Series is tracked' : 'Series is untracked'}
|
|
194
|
+
</span>
|
|
195
|
+
</span>
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
</TooltipContent>
|
|
199
|
+
</Tooltip>
|
|
200
|
+
)}
|
|
201
|
+
</div>
|
|
202
|
+
{/* bottom right */}
|
|
203
|
+
<div className="absolute bottom-0 right-0 flex items-center gap-[4px] p-[4px]">
|
|
204
|
+
<ThumbnailMenuItems
|
|
205
|
+
displaySetInstanceUID={displaySetInstanceUID}
|
|
206
|
+
canReject={canReject}
|
|
207
|
+
onReject={onReject}
|
|
208
|
+
/>
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
<div className="flex h-[52px] w-[128px] flex-col justify-start pt-px">
|
|
213
|
+
<Tooltip>
|
|
214
|
+
<TooltipContent>{description}</TooltipContent>
|
|
215
|
+
<TooltipTrigger>
|
|
216
|
+
<div
|
|
217
|
+
className="text-foreground min-h-[18px] w-[128px] overflow-hidden text-ellipsis whitespace-nowrap pb-0.5 pl-1 text-left text-[12px] font-normal leading-4"
|
|
218
|
+
data-cy="series-description-label"
|
|
219
|
+
>
|
|
220
|
+
{description}
|
|
221
|
+
</div>
|
|
222
|
+
</TooltipTrigger>
|
|
223
|
+
</Tooltip>
|
|
224
|
+
{renderDetails('text-[11px]', 'pl-1')}
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
);
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
const renderListPreset = () => {
|
|
231
|
+
return (
|
|
232
|
+
<div
|
|
233
|
+
className={classnames(
|
|
234
|
+
'flex h-full w-full items-center justify-between pr-[8px] pl-[8px] pt-[4px] pb-[4px]',
|
|
235
|
+
isActive && 'bg-popover rounded'
|
|
236
|
+
)}
|
|
237
|
+
>
|
|
238
|
+
<div className="relative flex h-[32px] w-full items-center gap-[8px] overflow-hidden">
|
|
239
|
+
<div
|
|
240
|
+
className={classnames(
|
|
241
|
+
'h-[32px] w-[4px] min-w-[4px] rounded',
|
|
242
|
+
isActive || isHydratedForDerivedDisplaySet ? 'bg-highlight' : 'bg-primary/65',
|
|
243
|
+
loadingProgress && loadingProgress < 1 && 'bg-primary/25'
|
|
244
|
+
)}
|
|
245
|
+
></div>
|
|
246
|
+
<div className="flex h-full w-[calc(100%-12px)] flex-col justify-start">
|
|
247
|
+
<div className="flex items-center gap-[7px]">
|
|
248
|
+
<div
|
|
249
|
+
className="text-foreground text-[13px] font-semibold"
|
|
250
|
+
data-cy="series-modality-label"
|
|
251
|
+
>
|
|
252
|
+
{modality}
|
|
253
|
+
</div>
|
|
254
|
+
<Tooltip>
|
|
255
|
+
<TooltipContent>{description}</TooltipContent>
|
|
256
|
+
<TooltipTrigger className="w-full overflow-hidden">
|
|
257
|
+
<div
|
|
258
|
+
className="text-foreground max-w-[160px] overflow-hidden overflow-ellipsis whitespace-nowrap text-left text-[13px] font-normal"
|
|
259
|
+
data-cy="series-description-label"
|
|
260
|
+
>
|
|
261
|
+
{description}
|
|
262
|
+
</div>
|
|
263
|
+
</TooltipTrigger>
|
|
264
|
+
</Tooltip>
|
|
265
|
+
</div>
|
|
266
|
+
|
|
267
|
+
{renderDetails('text-[12px]')}
|
|
268
|
+
</div>
|
|
269
|
+
</div>
|
|
270
|
+
<div className="flex h-full items-center gap-[4px]">
|
|
271
|
+
<DisplaySetMessageListTooltip
|
|
272
|
+
messages={messages}
|
|
273
|
+
id={`display-set-tooltip-${displaySetInstanceUID}`}
|
|
274
|
+
/>
|
|
275
|
+
{isTracked && (
|
|
276
|
+
<Tooltip>
|
|
277
|
+
<TooltipTrigger>
|
|
278
|
+
<div className="group">
|
|
279
|
+
<Icons.StatusTracking className="text-highlight h-[20px] w-[15px] group-hover:hidden" />
|
|
280
|
+
<Icons.Cancel
|
|
281
|
+
className="text-highlight hidden h-[15px] w-[15px] group-hover:block"
|
|
282
|
+
onClick={onClickUntrack}
|
|
283
|
+
/>
|
|
284
|
+
</div>
|
|
285
|
+
</TooltipTrigger>
|
|
286
|
+
<TooltipContent side="right">
|
|
287
|
+
<div className="flex flex-1 flex-row">
|
|
288
|
+
<div className="flex-2 flex items-center justify-center pr-4">
|
|
289
|
+
<Icons.InfoLink className="text-primary" />
|
|
290
|
+
</div>
|
|
291
|
+
<div className="flex flex-1 flex-col">
|
|
292
|
+
<span>
|
|
293
|
+
<span className="text-foreground">
|
|
294
|
+
{isTracked ? 'Series is tracked' : 'Series is untracked'}
|
|
295
|
+
</span>
|
|
296
|
+
</span>
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
</TooltipContent>
|
|
300
|
+
</Tooltip>
|
|
301
|
+
)}
|
|
302
|
+
<ThumbnailMenuItems
|
|
303
|
+
displaySetInstanceUID={displaySetInstanceUID}
|
|
304
|
+
canReject={canReject}
|
|
305
|
+
onReject={onReject}
|
|
306
|
+
/>
|
|
307
|
+
</div>
|
|
308
|
+
</div>
|
|
309
|
+
);
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
return (
|
|
313
|
+
<div
|
|
314
|
+
className={classnames(
|
|
315
|
+
className,
|
|
316
|
+
'bg-muted group flex select-none flex-col rounded outline-none',
|
|
317
|
+
isDraggable && 'hover:bg-primary/30 cursor-pointer',
|
|
318
|
+
!isDraggable && 'cursor-default',
|
|
319
|
+
viewPreset === 'thumbnails' && 'h-[170px] w-[135px]',
|
|
320
|
+
viewPreset === 'list' && 'h-[40px] w-full'
|
|
321
|
+
)}
|
|
322
|
+
id={`thumbnail-${displaySetInstanceUID}`}
|
|
323
|
+
data-cy={
|
|
324
|
+
thumbnailType === 'thumbnailNoImage'
|
|
325
|
+
? 'study-browser-thumbnail-no-image'
|
|
326
|
+
: 'study-browser-thumbnail'
|
|
327
|
+
}
|
|
328
|
+
data-series={seriesNumber}
|
|
329
|
+
onClick={onClick}
|
|
330
|
+
onDoubleClick={onDoubleClick}
|
|
331
|
+
onTouchEnd={handleTouchEnd}
|
|
332
|
+
role={isDraggable ? 'button' : undefined}
|
|
333
|
+
>
|
|
334
|
+
{isDraggable ? (
|
|
335
|
+
<DraggableThumbnailContent dragData={dragData}>
|
|
336
|
+
{viewPreset === 'thumbnails' && renderThumbnailPreset()}
|
|
337
|
+
{viewPreset === 'list' && renderListPreset()}
|
|
338
|
+
</DraggableThumbnailContent>
|
|
339
|
+
) : (
|
|
340
|
+
<StaticThumbnailContent>
|
|
341
|
+
{viewPreset === 'thumbnails' && renderThumbnailPreset()}
|
|
342
|
+
{viewPreset === 'list' && renderListPreset()}
|
|
343
|
+
</StaticThumbnailContent>
|
|
344
|
+
)}
|
|
345
|
+
</div>
|
|
346
|
+
);
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
export { Thumbnail };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Thumbnail } from '../Thumbnail';
|
|
4
|
+
import { useDynamicMaxHeight } from '../../hooks/useDynamicMaxHeight';
|
|
5
|
+
|
|
6
|
+
const ThumbnailList = ({
|
|
7
|
+
thumbnails,
|
|
8
|
+
onThumbnailClick,
|
|
9
|
+
onThumbnailDoubleClick,
|
|
10
|
+
onClickUntrack,
|
|
11
|
+
activeDisplaySetInstanceUIDs = [],
|
|
12
|
+
viewPreset,
|
|
13
|
+
ThumbnailMenuItems,
|
|
14
|
+
}) => {
|
|
15
|
+
// Use the dynamic height hook on the parent container
|
|
16
|
+
const { ref, maxHeight } = useDynamicMaxHeight(thumbnails);
|
|
17
|
+
|
|
18
|
+
// Filter thumbnails into list items and thumbnail items
|
|
19
|
+
const listItems = thumbnails?.filter(
|
|
20
|
+
({ componentType }) => componentType === 'thumbnailNoImage' || viewPreset === 'list'
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const thumbnailItems = thumbnails?.filter(
|
|
24
|
+
({ componentType }) => componentType !== 'thumbnailNoImage' && viewPreset === 'thumbnails'
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<div className="flex flex-col">
|
|
29
|
+
<div
|
|
30
|
+
ref={ref}
|
|
31
|
+
className="flex flex-col gap-[2px] pt-[4px] pr-[2.5px] pl-[5px] pb-[4px]"
|
|
32
|
+
>
|
|
33
|
+
{thumbnailItems.length > 0 && (
|
|
34
|
+
<div
|
|
35
|
+
id="ohif-thumbnail-list"
|
|
36
|
+
className="bg-background grid grid-cols-[repeat(auto-fit,_minmax(0,135px))] place-items-start gap-[4px]"
|
|
37
|
+
>
|
|
38
|
+
{thumbnailItems.map(item => {
|
|
39
|
+
const { displaySetInstanceUID, componentType, numInstances, ...rest } = item;
|
|
40
|
+
|
|
41
|
+
const isActive = activeDisplaySetInstanceUIDs.includes(displaySetInstanceUID);
|
|
42
|
+
return (
|
|
43
|
+
<Thumbnail
|
|
44
|
+
key={displaySetInstanceUID}
|
|
45
|
+
{...rest}
|
|
46
|
+
displaySetInstanceUID={displaySetInstanceUID}
|
|
47
|
+
numInstances={numInstances || 1}
|
|
48
|
+
isActive={isActive}
|
|
49
|
+
thumbnailType={componentType}
|
|
50
|
+
viewPreset="thumbnails"
|
|
51
|
+
onClick={onThumbnailClick.bind(null, displaySetInstanceUID)}
|
|
52
|
+
onDoubleClick={onThumbnailDoubleClick.bind(null, displaySetInstanceUID)}
|
|
53
|
+
onClickUntrack={onClickUntrack.bind(null, displaySetInstanceUID)}
|
|
54
|
+
ThumbnailMenuItems={ThumbnailMenuItems}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
})}
|
|
58
|
+
</div>
|
|
59
|
+
)}
|
|
60
|
+
{/* List Items */}
|
|
61
|
+
{listItems.length > 0 && (
|
|
62
|
+
<div
|
|
63
|
+
id="ohif-thumbnail-list"
|
|
64
|
+
className="bg-background grid grid-cols-[repeat(auto-fit,_minmax(0,275px))] place-items-start gap-[2px]"
|
|
65
|
+
>
|
|
66
|
+
{listItems.map(item => {
|
|
67
|
+
const { displaySetInstanceUID, componentType, numInstances, ...rest } = item;
|
|
68
|
+
const isActive = activeDisplaySetInstanceUIDs.includes(displaySetInstanceUID);
|
|
69
|
+
return (
|
|
70
|
+
<Thumbnail
|
|
71
|
+
key={displaySetInstanceUID}
|
|
72
|
+
{...rest}
|
|
73
|
+
displaySetInstanceUID={displaySetInstanceUID}
|
|
74
|
+
numInstances={numInstances || 1}
|
|
75
|
+
isActive={isActive}
|
|
76
|
+
thumbnailType={componentType}
|
|
77
|
+
viewPreset="list"
|
|
78
|
+
onClick={onThumbnailClick.bind(null, displaySetInstanceUID)}
|
|
79
|
+
onDoubleClick={onThumbnailDoubleClick.bind(null, displaySetInstanceUID)}
|
|
80
|
+
onClickUntrack={onClickUntrack.bind(null, displaySetInstanceUID)}
|
|
81
|
+
ThumbnailMenuItems={ThumbnailMenuItems}
|
|
82
|
+
/>
|
|
83
|
+
);
|
|
84
|
+
})}
|
|
85
|
+
</div>
|
|
86
|
+
)}
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
export { ThumbnailList };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
|
|
7
|
+
const toggleVariants = cva(
|
|
8
|
+
'inline-flex items-center justify-center rounded-md text-primary-foreground/80 font-medium transition-colors hover:bg-primary/20 hover:text-primary-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-primary/20 data-[state=on]:text-highlight',
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: 'bg-transparent hover:text-primary',
|
|
13
|
+
outline:
|
|
14
|
+
'border border-input bg-transparent shadow-sm hover:bg-primary/20 hover:text-primary-foreground',
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
default: 'h-[24px] w-[28px]',
|
|
18
|
+
sm: 'h-8 px-2',
|
|
19
|
+
lg: 'h-10 px-3',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
variant: 'default',
|
|
24
|
+
size: 'default',
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const Toggle = ({
|
|
30
|
+
className,
|
|
31
|
+
variant,
|
|
32
|
+
size,
|
|
33
|
+
ref,
|
|
34
|
+
...props
|
|
35
|
+
}: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>) => (
|
|
36
|
+
<TogglePrimitive.Root
|
|
37
|
+
ref={ref}
|
|
38
|
+
className={cn(toggleVariants({ variant, size, className }))}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
44
|
+
|
|
45
|
+
export { Toggle, toggleVariants };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
import { toggleVariants } from '../Toggle';
|
|
7
|
+
|
|
8
|
+
const ToggleGroupContext = React.createContext<VariantProps<typeof toggleVariants>>({
|
|
9
|
+
size: 'default',
|
|
10
|
+
variant: 'default',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const ToggleGroup = ({
|
|
14
|
+
className,
|
|
15
|
+
variant,
|
|
16
|
+
size,
|
|
17
|
+
children,
|
|
18
|
+
ref,
|
|
19
|
+
...props
|
|
20
|
+
}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &
|
|
21
|
+
VariantProps<typeof toggleVariants>) => (
|
|
22
|
+
<ToggleGroupPrimitive.Root
|
|
23
|
+
ref={ref}
|
|
24
|
+
className={cn('bg-primary/10 flex items-center justify-center rounded-md', className)}
|
|
25
|
+
{...props}
|
|
26
|
+
>
|
|
27
|
+
<ToggleGroupContext.Provider value={{ variant, size }}>{children}</ToggleGroupContext.Provider>
|
|
28
|
+
</ToggleGroupPrimitive.Root>
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
32
|
+
|
|
33
|
+
const ToggleGroupItem = ({
|
|
34
|
+
className,
|
|
35
|
+
children,
|
|
36
|
+
variant,
|
|
37
|
+
size,
|
|
38
|
+
ref,
|
|
39
|
+
...props
|
|
40
|
+
}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> &
|
|
41
|
+
VariantProps<typeof toggleVariants>) => {
|
|
42
|
+
const context = React.useContext(ToggleGroupContext);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<ToggleGroupPrimitive.Item
|
|
46
|
+
ref={ref}
|
|
47
|
+
className={cn(
|
|
48
|
+
toggleVariants({
|
|
49
|
+
variant: context.variant || variant,
|
|
50
|
+
size: context.size || size,
|
|
51
|
+
}),
|
|
52
|
+
className
|
|
53
|
+
)}
|
|
54
|
+
{...props}
|
|
55
|
+
>
|
|
56
|
+
{children}
|
|
57
|
+
</ToggleGroupPrimitive.Item>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
62
|
+
|
|
63
|
+
export { ToggleGroup, ToggleGroupItem };
|