@ohif/ui-next 3.14.0-beta.98 → 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,60 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
const storageKey = 'studyList.defaultWorkflow';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Read the stored workflow, or null when storage is unavailable or empty.
|
|
7
|
+
* Module scope on purpose: a conditional inside a try/catch is a React Compiler
|
|
8
|
+
* limitation that bails the whole hook, and plain functions are never compiled.
|
|
9
|
+
*/
|
|
10
|
+
function readStoredWorkflow(): string | null {
|
|
11
|
+
try {
|
|
12
|
+
return typeof window !== 'undefined' ? window.localStorage.getItem(storageKey) : null;
|
|
13
|
+
} catch {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Write or clear the stored workflow. Module scope for the same reason. */
|
|
19
|
+
function writeStoredWorkflow(next: string | null): void {
|
|
20
|
+
try {
|
|
21
|
+
if (typeof window === 'undefined') {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (next == null) {
|
|
25
|
+
window.localStorage.removeItem(storageKey);
|
|
26
|
+
} else {
|
|
27
|
+
window.localStorage.setItem(storageKey, next);
|
|
28
|
+
}
|
|
29
|
+
} catch {
|
|
30
|
+
// no-op
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Persist and retrieve a default workflow string from localStorage.
|
|
36
|
+
* If `allowed` is provided, the returned value is guaranteed to be from the allowed list (or null).
|
|
37
|
+
*/
|
|
38
|
+
export function useDefaultWorkflow(
|
|
39
|
+
allowed?: readonly string[]
|
|
40
|
+
): [string | null, (next: string | null) => void] {
|
|
41
|
+
// State holds the raw stored string; the validated value is derived during
|
|
42
|
+
// render. Deriving rather than storing keeps the result correct when `allowed`
|
|
43
|
+
// arrives late - the study list passes `appConfig?.loadedModes ?? []`, so it is
|
|
44
|
+
// briefly empty - and removes an effect whose only job was to re-validate.
|
|
45
|
+
const [stored, setStored] = React.useState<string | null>(readStoredWorkflow);
|
|
46
|
+
|
|
47
|
+
const value = stored != null && (!allowed || allowed.includes(stored)) ? stored : null;
|
|
48
|
+
|
|
49
|
+
const setAndPersist = React.useCallback(
|
|
50
|
+
(next: string | null) => {
|
|
51
|
+
setStored(next);
|
|
52
|
+
if (next == null || !allowed || allowed.includes(next)) {
|
|
53
|
+
writeStoredWorkflow(next);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
[allowed]
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
return [value, setAndPersist] as const;
|
|
60
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Import components for StudyList namespace
|
|
2
|
+
import {
|
|
3
|
+
defaultColumns,
|
|
4
|
+
textColumn,
|
|
5
|
+
COLUMN_IDS,
|
|
6
|
+
FILTERABLE_COLUMN_IDS,
|
|
7
|
+
TEXT_FILTER_COLUMN_IDS,
|
|
8
|
+
} from './columns/defaultColumns';
|
|
9
|
+
import { SettingsPopover } from './components/SettingsPopover';
|
|
10
|
+
import { PreviewContainer } from './components/PreviewContainer';
|
|
11
|
+
import { PreviewHeader } from './components/PreviewHeader';
|
|
12
|
+
import { Layout } from './components/Layout';
|
|
13
|
+
import { OpenPreviewButton, ClosePreviewButton } from './components/PreviewToggleButton';
|
|
14
|
+
import { PreviewContent } from './components/PreviewContent';
|
|
15
|
+
import { WorkflowsProvider } from './components/WorkflowsProvider';
|
|
16
|
+
|
|
17
|
+
// Types
|
|
18
|
+
export * from './types/types';
|
|
19
|
+
export type { Workflow } from './components/WorkflowsProvider';
|
|
20
|
+
export type { OnStudyDoubleClick } from './components/Table';
|
|
21
|
+
|
|
22
|
+
// Column ID constants
|
|
23
|
+
export { COLUMN_IDS, FILTERABLE_COLUMN_IDS, TEXT_FILTER_COLUMN_IDS };
|
|
24
|
+
|
|
25
|
+
// StudyList compound component namespace
|
|
26
|
+
type StudyListNamespace = typeof Layout & {
|
|
27
|
+
Table: typeof Layout.Table;
|
|
28
|
+
Preview: typeof Layout.Preview;
|
|
29
|
+
SettingsPopover: typeof SettingsPopover;
|
|
30
|
+
PreviewContainer: typeof PreviewContainer;
|
|
31
|
+
PreviewHeader: typeof PreviewHeader;
|
|
32
|
+
PreviewContent: typeof PreviewContent;
|
|
33
|
+
WorkflowsProvider: typeof WorkflowsProvider;
|
|
34
|
+
OpenPreviewButton: typeof OpenPreviewButton;
|
|
35
|
+
ClosePreviewButton: typeof ClosePreviewButton;
|
|
36
|
+
defaultColumns: typeof defaultColumns;
|
|
37
|
+
textColumn: typeof textColumn;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const StudyList: StudyListNamespace = Object.assign(Layout, {
|
|
41
|
+
Table: Layout.Table,
|
|
42
|
+
Preview: Layout.Preview,
|
|
43
|
+
SettingsPopover,
|
|
44
|
+
PreviewContainer,
|
|
45
|
+
PreviewHeader,
|
|
46
|
+
PreviewContent,
|
|
47
|
+
WorkflowsProvider,
|
|
48
|
+
OpenPreviewButton,
|
|
49
|
+
ClosePreviewButton,
|
|
50
|
+
defaultColumns,
|
|
51
|
+
textColumn,
|
|
52
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export type StudyRow = {
|
|
2
|
+
studyInstanceUid: string;
|
|
3
|
+
patientName: string;
|
|
4
|
+
mrn: string;
|
|
5
|
+
/** Raw date string (YYYYMMDD or YYYY.MM.DD format) */
|
|
6
|
+
date: string;
|
|
7
|
+
/** Raw time string (HH, HHmm, HHmmss, or HHmmss.SSS format) */
|
|
8
|
+
time: string;
|
|
9
|
+
modalities: string;
|
|
10
|
+
description: string;
|
|
11
|
+
accession: string;
|
|
12
|
+
instances: number;
|
|
13
|
+
// A data source may map additional fields (e.g. extra DICOM attributes pulled
|
|
14
|
+
// in via `includefield`). Allowing arbitrary keys means a custom column can
|
|
15
|
+
// read one without StudyRow needing an edit per field. The declared fields
|
|
16
|
+
// above keep their precise types.
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type StudyDateRangeFilter = {
|
|
21
|
+
startDate?: string;
|
|
22
|
+
endDate?: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const PreviewThumbnailStatusState = {
|
|
26
|
+
Loading: 'loading',
|
|
27
|
+
Ready: 'ready',
|
|
28
|
+
NotAvailable: 'notAvailable',
|
|
29
|
+
NotApplicable: 'notApplicable',
|
|
30
|
+
} as const;
|
|
31
|
+
|
|
32
|
+
export type PreviewThumbnailStatusState =
|
|
33
|
+
(typeof PreviewThumbnailStatusState)[keyof typeof PreviewThumbnailStatusState];
|
|
34
|
+
|
|
35
|
+
type NonReadyPreviewThumbnailStatusState = Exclude<
|
|
36
|
+
PreviewThumbnailStatusState,
|
|
37
|
+
typeof PreviewThumbnailStatusState.Ready
|
|
38
|
+
>;
|
|
39
|
+
|
|
40
|
+
export type PreviewThumbnailStatus =
|
|
41
|
+
| { status: NonReadyPreviewThumbnailStatusState }
|
|
42
|
+
| { status: typeof PreviewThumbnailStatusState.Ready; src: string };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface StudySummaryProps {
|
|
4
|
+
date: string;
|
|
5
|
+
description: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* StudySummary component displays a summary of a study with its date and description.
|
|
10
|
+
*
|
|
11
|
+
* @param props - The properties for the StudySummary component
|
|
12
|
+
* @param props.date - The date of the study
|
|
13
|
+
* @param props.description - The description of the study
|
|
14
|
+
*/
|
|
15
|
+
const StudySummary: React.FC<StudySummaryProps> = ({ date, description }) => {
|
|
16
|
+
return (
|
|
17
|
+
<div
|
|
18
|
+
className="mx-2 my-0"
|
|
19
|
+
style={{ textAlign: 'left' }}
|
|
20
|
+
>
|
|
21
|
+
<div className="text-foreground text-sm">{date}</div>
|
|
22
|
+
<div className="text-muted-foreground pb-1 text-sm">{description}</div>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { StudySummary };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
3
|
+
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
|
|
6
|
+
const Switch = ({
|
|
7
|
+
className,
|
|
8
|
+
ref,
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof SwitchPrimitives.Root>) => (
|
|
11
|
+
<SwitchPrimitives.Root
|
|
12
|
+
className={cn(
|
|
13
|
+
'focus-visible:ring-ring focus-visible:ring-offset-background data-[state=checked]:bg-primary data-[state=unchecked]:bg-primary/30 hover:data-[state=unchecked]:bg-primary/40 peer inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
|
|
14
|
+
className
|
|
15
|
+
)}
|
|
16
|
+
{...props}
|
|
17
|
+
ref={ref}
|
|
18
|
+
>
|
|
19
|
+
<SwitchPrimitives.Thumb
|
|
20
|
+
className={cn(
|
|
21
|
+
'bg-background pointer-events-none block h-3 w-3 rounded-full shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0'
|
|
22
|
+
)}
|
|
23
|
+
/>
|
|
24
|
+
</SwitchPrimitives.Root>
|
|
25
|
+
);
|
|
26
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
27
|
+
|
|
28
|
+
export { Switch };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
|
|
5
|
+
type TableProps = React.HTMLAttributes<HTMLTableElement> & {
|
|
6
|
+
containerClassName?: string;
|
|
7
|
+
noScroll?: boolean;
|
|
8
|
+
ref?: React.Ref<HTMLTableElement>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const Table = ({ className, containerClassName, noScroll = false, ref, ...props }: TableProps) => (
|
|
12
|
+
<div className={cn('relative w-full', !noScroll && 'overflow-auto', containerClassName)}>
|
|
13
|
+
<table
|
|
14
|
+
ref={ref}
|
|
15
|
+
className={cn('caption-bottom text-muted-foreground w-full text-base', className)}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
Table.displayName = 'Table';
|
|
21
|
+
|
|
22
|
+
const TableHeader = ({
|
|
23
|
+
className,
|
|
24
|
+
ref,
|
|
25
|
+
...props
|
|
26
|
+
}: React.HTMLAttributes<HTMLTableSectionElement> & {
|
|
27
|
+
ref?: React.Ref<HTMLTableSectionElement>;
|
|
28
|
+
}) => (
|
|
29
|
+
<thead
|
|
30
|
+
ref={ref}
|
|
31
|
+
className={cn('border-input/50 [&_tr]:border-b', className)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
TableHeader.displayName = 'TableHeader';
|
|
36
|
+
|
|
37
|
+
const TableBody = ({
|
|
38
|
+
className,
|
|
39
|
+
ref,
|
|
40
|
+
...props
|
|
41
|
+
}: React.HTMLAttributes<HTMLTableSectionElement> & {
|
|
42
|
+
ref?: React.Ref<HTMLTableSectionElement>;
|
|
43
|
+
}) => (
|
|
44
|
+
<tbody
|
|
45
|
+
ref={ref}
|
|
46
|
+
className={cn('[&_tr:last-child]:border-0', className)}
|
|
47
|
+
{...props}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
TableBody.displayName = 'TableBody';
|
|
51
|
+
|
|
52
|
+
const TableFooter = ({
|
|
53
|
+
className,
|
|
54
|
+
ref,
|
|
55
|
+
...props
|
|
56
|
+
}: React.HTMLAttributes<HTMLTableSectionElement> & {
|
|
57
|
+
ref?: React.Ref<HTMLTableSectionElement>;
|
|
58
|
+
}) => (
|
|
59
|
+
<tfoot
|
|
60
|
+
ref={ref}
|
|
61
|
+
className={cn('bg-muted border-input/50 border-t [&>tr]:last:border-b-0', className)}
|
|
62
|
+
{...props}
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
TableFooter.displayName = 'TableFooter';
|
|
66
|
+
|
|
67
|
+
const TableRow = ({
|
|
68
|
+
className,
|
|
69
|
+
ref,
|
|
70
|
+
...props
|
|
71
|
+
}: React.HTMLAttributes<HTMLTableRowElement> & { ref?: React.Ref<HTMLTableRowElement> }) => (
|
|
72
|
+
<tr
|
|
73
|
+
ref={ref}
|
|
74
|
+
className={cn(
|
|
75
|
+
'hover:bg-muted text-muted-foreground hover:text-highlight hover:[&>td]:text-highlight hover:[&>th]:text-highlight',
|
|
76
|
+
'data-[state=selected]:bg-popover data-[state=selected]:hover:bg-popover',
|
|
77
|
+
'data-[state=selected]:text-foreground data-[state=selected]:[&>td]:text-foreground data-[state=selected]:[&>th]:text-foreground',
|
|
78
|
+
'data-[state=selected]:hover:text-foreground data-[state=selected]:hover:[&>td]:text-foreground data-[state=selected]:hover:[&>th]:text-foreground',
|
|
79
|
+
'border-input/50 border-b transition-colors',
|
|
80
|
+
className
|
|
81
|
+
)}
|
|
82
|
+
{...props}
|
|
83
|
+
/>
|
|
84
|
+
);
|
|
85
|
+
TableRow.displayName = 'TableRow';
|
|
86
|
+
|
|
87
|
+
const TableHead = ({
|
|
88
|
+
className,
|
|
89
|
+
ref,
|
|
90
|
+
...props
|
|
91
|
+
}: React.ThHTMLAttributes<HTMLTableCellElement> & { ref?: React.Ref<HTMLTableCellElement> }) => (
|
|
92
|
+
<th
|
|
93
|
+
ref={ref}
|
|
94
|
+
className={cn(
|
|
95
|
+
'text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
|
|
96
|
+
className
|
|
97
|
+
)}
|
|
98
|
+
{...props}
|
|
99
|
+
/>
|
|
100
|
+
);
|
|
101
|
+
TableHead.displayName = 'TableHead';
|
|
102
|
+
|
|
103
|
+
const TableCell = ({
|
|
104
|
+
className,
|
|
105
|
+
ref,
|
|
106
|
+
...props
|
|
107
|
+
}: React.TdHTMLAttributes<HTMLTableCellElement> & { ref?: React.Ref<HTMLTableCellElement> }) => (
|
|
108
|
+
<td
|
|
109
|
+
ref={ref}
|
|
110
|
+
className={cn(
|
|
111
|
+
'p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
|
|
112
|
+
className
|
|
113
|
+
)}
|
|
114
|
+
{...props}
|
|
115
|
+
/>
|
|
116
|
+
);
|
|
117
|
+
TableCell.displayName = 'TableCell';
|
|
118
|
+
|
|
119
|
+
const TableCaption = ({
|
|
120
|
+
className,
|
|
121
|
+
ref,
|
|
122
|
+
...props
|
|
123
|
+
}: React.HTMLAttributes<HTMLTableCaptionElement> & {
|
|
124
|
+
ref?: React.Ref<HTMLTableCaptionElement>;
|
|
125
|
+
}) => (
|
|
126
|
+
<caption
|
|
127
|
+
ref={ref}
|
|
128
|
+
className={cn('text-muted-foreground mt-4 text-base', className)}
|
|
129
|
+
{...props}
|
|
130
|
+
/>
|
|
131
|
+
);
|
|
132
|
+
TableCaption.displayName = 'TableCaption';
|
|
133
|
+
|
|
134
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
3
|
+
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
|
|
6
|
+
const Tabs = TabsPrimitive.Root;
|
|
7
|
+
|
|
8
|
+
const TabsList = ({
|
|
9
|
+
className,
|
|
10
|
+
ref,
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof TabsPrimitive.List>) => (
|
|
13
|
+
<TabsPrimitive.List
|
|
14
|
+
ref={ref}
|
|
15
|
+
className={cn(
|
|
16
|
+
'bg-primary/20 hover:bg-primary/30 primary-foreground inline-flex h-7 items-center justify-center rounded-md py-1',
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
23
|
+
|
|
24
|
+
const TabsTrigger = ({
|
|
25
|
+
className,
|
|
26
|
+
ref,
|
|
27
|
+
...props
|
|
28
|
+
}: React.ComponentProps<typeof TabsPrimitive.Trigger>) => (
|
|
29
|
+
<TabsPrimitive.Trigger
|
|
30
|
+
ref={ref}
|
|
31
|
+
className={cn(
|
|
32
|
+
'ring-offset-background focus-visible:ring-ring data-[state=active]:bg-primary/30 data-[state=active]:primary text-foreground inline-flex items-center justify-center whitespace-nowrap rounded px-2 py-1 text-base transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow',
|
|
33
|
+
className
|
|
34
|
+
)}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
39
|
+
|
|
40
|
+
const TabsContent = ({
|
|
41
|
+
className,
|
|
42
|
+
ref,
|
|
43
|
+
...props
|
|
44
|
+
}: React.ComponentProps<typeof TabsPrimitive.Content>) => (
|
|
45
|
+
<TabsPrimitive.Content
|
|
46
|
+
ref={ref}
|
|
47
|
+
className={cn(
|
|
48
|
+
'ring-offset-background focus-visible:ring-ring mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2',
|
|
49
|
+
className
|
|
50
|
+
)}
|
|
51
|
+
{...props}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
54
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
55
|
+
|
|
56
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ThemeWrapper } from './ThemeWrapper';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
|
|
4
|
+
import { Thumbnail } from './Thumbnail';
|
|
5
|
+
import { TooltipProvider } from '../Tooltip';
|
|
6
|
+
|
|
7
|
+
// JSX needs a .tsx file, which the jest projects do not pick up, so the element
|
|
8
|
+
// is built directly - as the hook tests in @ohif/core do. The thumbnail puts
|
|
9
|
+
// its description in a tooltip, which radix requires a provider for.
|
|
10
|
+
const renderThumbnail = (overrides = {}) =>
|
|
11
|
+
render(
|
|
12
|
+
createElement(
|
|
13
|
+
TooltipProvider,
|
|
14
|
+
null,
|
|
15
|
+
createElement(Thumbnail, {
|
|
16
|
+
displaySetInstanceUID: 'ds1',
|
|
17
|
+
description: 'Report',
|
|
18
|
+
seriesNumber: 5,
|
|
19
|
+
numInstances: 3,
|
|
20
|
+
modality: 'SR',
|
|
21
|
+
isActive: false,
|
|
22
|
+
isDraggable: false,
|
|
23
|
+
onClick: () => {},
|
|
24
|
+
onDoubleClick: () => {},
|
|
25
|
+
...overrides,
|
|
26
|
+
})
|
|
27
|
+
)
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
// The label and value share the innermost element; an icon sits beside them, and
|
|
31
|
+
// contributes its own text in jsdom, so read past it.
|
|
32
|
+
const valueText = (element: Element | null | undefined) =>
|
|
33
|
+
element?.querySelector(':scope > div > div')?.textContent;
|
|
34
|
+
|
|
35
|
+
const detailText = (container: HTMLElement, id: string) =>
|
|
36
|
+
valueText(container.querySelector(`[data-cy="thumbnail-detail-${id}"]`));
|
|
37
|
+
|
|
38
|
+
const detailTexts = (container: HTMLElement) =>
|
|
39
|
+
Array.from(container.querySelectorAll('[data-cy^="thumbnail-detail-"]')).map(valueText);
|
|
40
|
+
|
|
41
|
+
describe('Thumbnail', () => {
|
|
42
|
+
describe.each(['thumbnails', 'list'])('%s preset', viewPreset => {
|
|
43
|
+
// The detail line has always read `S:<series number>` and the instance
|
|
44
|
+
// count, and it still has to when no `details` are supplied - which is what
|
|
45
|
+
// the `studyBrowser.thumbnailDetails` customization defaults to.
|
|
46
|
+
it('shows the series number and the instance count by default', () => {
|
|
47
|
+
const { container } = renderThumbnail({ viewPreset });
|
|
48
|
+
|
|
49
|
+
expect(detailText(container, 'SeriesNumber')).toBe('S:5');
|
|
50
|
+
expect(detailText(container, 'InstanceCount')).toBe('3');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('shows the supplied details instead, in order', () => {
|
|
54
|
+
const details = [
|
|
55
|
+
{ id: 'SeriesNumber', label: 'S:', value: '5' },
|
|
56
|
+
{ id: 'InstanceCount', value: '3', iconName: 'InfoSeries' },
|
|
57
|
+
{ id: 'InstanceDateTime', value: '19-Aug-2026 14:30', title: 'Created' },
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
const { container } = renderThumbnail({ viewPreset, details });
|
|
61
|
+
|
|
62
|
+
expect(detailTexts(container)).toEqual(['S:5', '3', '19-Aug-2026 14:30']);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('leaves the detail line empty when there are no details', () => {
|
|
66
|
+
const { container } = renderThumbnail({ viewPreset, details: [] });
|
|
67
|
+
|
|
68
|
+
expect(detailTexts(container)).toEqual([]);
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
});
|