@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,479 @@
|
|
|
1
|
+
import classnames from 'classnames';
|
|
2
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
3
|
+
import { Icons } from '../Icons';
|
|
4
|
+
import { TooltipTrigger, TooltipContent, Tooltip } from '../Tooltip';
|
|
5
|
+
import { Separator } from '../Separator';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* SidePanel component properties.
|
|
9
|
+
* Note that the component monitors changes to the various widths and border sizes and will resize dynamically
|
|
10
|
+
* @property {boolean} isExpanded - boolean indicating if the side panel is expanded/open or collapsed
|
|
11
|
+
* @property {number} expandedWidth - the width of this side panel when expanded not including any borders or margins
|
|
12
|
+
* @property {number} collapsedWidth - the width of this side panel when collapsed not including any borders or margins
|
|
13
|
+
* @property {number} expandedInsideBorderSize - the width of the space between the expanded side panel content and viewport grid
|
|
14
|
+
* @property {number} collapsedInsideBorderSize - the width of the space between the collapsed side panel content and the viewport grid
|
|
15
|
+
* @property {number} collapsedOutsideBorderSize - the width of the space between the collapsed side panel content and the edge of the browser window
|
|
16
|
+
*/
|
|
17
|
+
type SidePanelProps = {
|
|
18
|
+
side: 'left' | 'right';
|
|
19
|
+
className: string;
|
|
20
|
+
activeTabIndex: number;
|
|
21
|
+
onOpen: () => void;
|
|
22
|
+
onClose: () => void;
|
|
23
|
+
onActiveTabIndexChange: () => void;
|
|
24
|
+
isExpanded: boolean;
|
|
25
|
+
expandedWidth: number;
|
|
26
|
+
collapsedWidth: number;
|
|
27
|
+
expandedInsideBorderSize: number;
|
|
28
|
+
collapsedInsideBorderSize: number;
|
|
29
|
+
collapsedOutsideBorderSize: number;
|
|
30
|
+
tabs: any;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
type StyleMap = {
|
|
34
|
+
open: {
|
|
35
|
+
left: {
|
|
36
|
+
marginLeft: string; // the space between the expanded/open left side panel and the browser window left edge
|
|
37
|
+
marginRight: string; // the space between the expanded/open left side panel and the viewport grid
|
|
38
|
+
};
|
|
39
|
+
right: {
|
|
40
|
+
marginLeft: string; // the space between the expanded/open right side panel and the viewport grid
|
|
41
|
+
marginRight: string; // the space between the expanded/open right side panel and the browser window right edge
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
closed: {
|
|
45
|
+
left: {
|
|
46
|
+
marginLeft: string; // the space between the collapsed/closed left panel and the browser window left edge
|
|
47
|
+
marginRight: string; // the space between the collapsed/closed left panel and the viewport grid
|
|
48
|
+
alignItems: 'flex-end'; // the flexbox layout align-items property
|
|
49
|
+
};
|
|
50
|
+
right: {
|
|
51
|
+
marginLeft: string; // the space between the collapsed/closed right panel and the viewport grid
|
|
52
|
+
marginRight: string; // the space between the collapsed/closed right panel and the browser window right edge
|
|
53
|
+
alignItems: 'flex-start'; // the flexbox layout align-items property
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
const closeIconWidth = 30;
|
|
58
|
+
const gridHorizontalPadding = 10;
|
|
59
|
+
const tabSpacerWidth = 2;
|
|
60
|
+
|
|
61
|
+
const baseClasses = 'bg-background border-background justify-start box-content flex flex-col';
|
|
62
|
+
|
|
63
|
+
const openStateIconName = {
|
|
64
|
+
left: 'SidePanelCloseLeft',
|
|
65
|
+
right: 'SidePanelCloseRight',
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const getTabWidth = (numTabs: number) => {
|
|
69
|
+
if (numTabs < 3) {
|
|
70
|
+
return 68;
|
|
71
|
+
} else {
|
|
72
|
+
return 40;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const getGridWidth = (numTabs: number, gridAvailableWidth: number) => {
|
|
77
|
+
const spacersWidth = (numTabs - 1) * tabSpacerWidth;
|
|
78
|
+
const tabsWidth = getTabWidth(numTabs) * numTabs;
|
|
79
|
+
|
|
80
|
+
if (gridAvailableWidth > tabsWidth + spacersWidth) {
|
|
81
|
+
return tabsWidth + spacersWidth;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return gridAvailableWidth;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const getNumGridColumns = (numTabs: number, gridWidth: number) => {
|
|
88
|
+
if (numTabs === 1) {
|
|
89
|
+
return 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Start by calculating the number of tabs assuming each tab was accompanied by a spacer.
|
|
93
|
+
const tabWidth = getTabWidth(numTabs);
|
|
94
|
+
const numTabsWithOneSpacerEach = Math.floor(gridWidth / (tabWidth + tabSpacerWidth));
|
|
95
|
+
|
|
96
|
+
// But there is always one less spacer than tabs, so now check if an extra tab with one less spacer fits.
|
|
97
|
+
if (
|
|
98
|
+
(numTabsWithOneSpacerEach + 1) * tabWidth + numTabsWithOneSpacerEach * tabSpacerWidth <=
|
|
99
|
+
gridWidth
|
|
100
|
+
) {
|
|
101
|
+
return numTabsWithOneSpacerEach + 1;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return numTabsWithOneSpacerEach;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const getTabClassNames = (
|
|
108
|
+
numColumns: number,
|
|
109
|
+
numTabs: number,
|
|
110
|
+
tabIndex: number,
|
|
111
|
+
isActiveTab: boolean,
|
|
112
|
+
isTabDisabled: boolean
|
|
113
|
+
) =>
|
|
114
|
+
classnames('h-[28px] mb-[2px] cursor-pointer text-foreground bg-primary/10 hover:bg-primary/20', {
|
|
115
|
+
'hover:text-primary': !isActiveTab && !isTabDisabled,
|
|
116
|
+
'rounded-l': tabIndex % numColumns === 0,
|
|
117
|
+
'rounded-r': (tabIndex + 1) % numColumns === 0 || tabIndex === numTabs - 1,
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
const getTabStyle = (numTabs: number) => {
|
|
121
|
+
return {
|
|
122
|
+
width: `${getTabWidth(numTabs)}px`,
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const getTabIconClassNames = (numTabs: number, isActiveTab: boolean) => {
|
|
127
|
+
return classnames('h-full w-full flex items-center justify-center', {
|
|
128
|
+
'bg-primary/20': isActiveTab,
|
|
129
|
+
rounded: isActiveTab,
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
const createStyleMap = (
|
|
133
|
+
expandedWidth: number,
|
|
134
|
+
expandedInsideBorderSize: number,
|
|
135
|
+
collapsedWidth: number,
|
|
136
|
+
collapsedInsideBorderSize: number,
|
|
137
|
+
collapsedOutsideBorderSize: number
|
|
138
|
+
): StyleMap => {
|
|
139
|
+
const collapsedHideWidth = expandedWidth - collapsedWidth - collapsedOutsideBorderSize;
|
|
140
|
+
|
|
141
|
+
return {
|
|
142
|
+
open: {
|
|
143
|
+
left: { marginLeft: '0px', marginRight: `${expandedInsideBorderSize}px` },
|
|
144
|
+
right: { marginLeft: `${expandedInsideBorderSize}px`, marginRight: '0px' },
|
|
145
|
+
},
|
|
146
|
+
closed: {
|
|
147
|
+
left: {
|
|
148
|
+
marginLeft: `-${collapsedHideWidth}px`,
|
|
149
|
+
marginRight: `${collapsedInsideBorderSize}px`,
|
|
150
|
+
alignItems: `flex-end`,
|
|
151
|
+
},
|
|
152
|
+
right: {
|
|
153
|
+
marginLeft: `${collapsedInsideBorderSize}px`,
|
|
154
|
+
marginRight: `-${collapsedHideWidth}px`,
|
|
155
|
+
alignItems: `flex-start`,
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const getToolTipContent = (label: string, disabled: boolean) => {
|
|
162
|
+
return (
|
|
163
|
+
<>
|
|
164
|
+
<div>{label}</div>
|
|
165
|
+
{disabled && (
|
|
166
|
+
<div className="text-foreground">{'Not available based on current context'}</div>
|
|
167
|
+
)}
|
|
168
|
+
</>
|
|
169
|
+
);
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
const createBaseStyle = (expandedWidth: number) => {
|
|
173
|
+
return {
|
|
174
|
+
maxWidth: `${expandedWidth}px`,
|
|
175
|
+
width: `${expandedWidth}px`,
|
|
176
|
+
// To align the top of the side panel with the top of the viewport grid, use position relative and offset the
|
|
177
|
+
// top by the same top offset as the viewport grid. Also adjust the height so that there is no overflow.
|
|
178
|
+
position: 'relative',
|
|
179
|
+
top: '0.2%',
|
|
180
|
+
height: '99.8%',
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
const SidePanel = ({
|
|
185
|
+
side,
|
|
186
|
+
className,
|
|
187
|
+
activeTabIndex: activeTabIndexProp,
|
|
188
|
+
isExpanded,
|
|
189
|
+
tabs,
|
|
190
|
+
onOpen,
|
|
191
|
+
onClose,
|
|
192
|
+
onActiveTabIndexChange,
|
|
193
|
+
expandedWidth = 280,
|
|
194
|
+
collapsedWidth = 25,
|
|
195
|
+
expandedInsideBorderSize = 4,
|
|
196
|
+
collapsedInsideBorderSize = 8,
|
|
197
|
+
collapsedOutsideBorderSize = 4,
|
|
198
|
+
}: SidePanelProps) => {
|
|
199
|
+
const [panelOpen, setPanelOpen] = useState(isExpanded);
|
|
200
|
+
const [activeTabIndex, setActiveTabIndex] = useState(activeTabIndexProp ?? 0);
|
|
201
|
+
|
|
202
|
+
const [styleMap, setStyleMap] = useState(
|
|
203
|
+
createStyleMap(
|
|
204
|
+
expandedWidth,
|
|
205
|
+
expandedInsideBorderSize,
|
|
206
|
+
collapsedWidth,
|
|
207
|
+
collapsedInsideBorderSize,
|
|
208
|
+
collapsedOutsideBorderSize
|
|
209
|
+
)
|
|
210
|
+
);
|
|
211
|
+
|
|
212
|
+
const [baseStyle, setBaseStyle] = useState(createBaseStyle(expandedWidth));
|
|
213
|
+
|
|
214
|
+
const [gridAvailableWidth, setGridAvailableWidth] = useState(
|
|
215
|
+
expandedWidth - closeIconWidth - gridHorizontalPadding
|
|
216
|
+
);
|
|
217
|
+
|
|
218
|
+
const [gridWidth, setGridWidth] = useState(getGridWidth(tabs.length, gridAvailableWidth));
|
|
219
|
+
const openStatus = panelOpen ? 'open' : 'closed';
|
|
220
|
+
const style = Object.assign({}, styleMap[openStatus][side], baseStyle);
|
|
221
|
+
|
|
222
|
+
const updatePanelOpen = useCallback(
|
|
223
|
+
(isOpen: boolean) => {
|
|
224
|
+
setPanelOpen(isOpen);
|
|
225
|
+
if (isOpen !== panelOpen) {
|
|
226
|
+
// only fire events for changes
|
|
227
|
+
if (isOpen && onOpen) {
|
|
228
|
+
onOpen();
|
|
229
|
+
} else if (onClose && !isOpen) {
|
|
230
|
+
onClose();
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
[panelOpen, onOpen, onClose]
|
|
235
|
+
);
|
|
236
|
+
|
|
237
|
+
const updateActiveTabIndex = useCallback(
|
|
238
|
+
(activeTabIndex: number, forceOpen: boolean = false) => {
|
|
239
|
+
if (forceOpen) {
|
|
240
|
+
updatePanelOpen(true);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
setActiveTabIndex(activeTabIndex);
|
|
244
|
+
|
|
245
|
+
if (onActiveTabIndexChange) {
|
|
246
|
+
onActiveTabIndexChange({ activeTabIndex });
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
[onActiveTabIndexChange, updatePanelOpen]
|
|
250
|
+
);
|
|
251
|
+
|
|
252
|
+
useEffect(() => {
|
|
253
|
+
updatePanelOpen(isExpanded);
|
|
254
|
+
}, [isExpanded, updatePanelOpen]);
|
|
255
|
+
|
|
256
|
+
useEffect(() => {
|
|
257
|
+
setStyleMap(
|
|
258
|
+
createStyleMap(
|
|
259
|
+
expandedWidth,
|
|
260
|
+
expandedInsideBorderSize,
|
|
261
|
+
collapsedWidth,
|
|
262
|
+
collapsedInsideBorderSize,
|
|
263
|
+
collapsedOutsideBorderSize
|
|
264
|
+
)
|
|
265
|
+
);
|
|
266
|
+
setBaseStyle(createBaseStyle(expandedWidth));
|
|
267
|
+
|
|
268
|
+
const gridAvailableWidth = expandedWidth - closeIconWidth - gridHorizontalPadding;
|
|
269
|
+
setGridAvailableWidth(gridAvailableWidth);
|
|
270
|
+
setGridWidth(getGridWidth(tabs.length, gridAvailableWidth));
|
|
271
|
+
}, [
|
|
272
|
+
collapsedInsideBorderSize,
|
|
273
|
+
collapsedWidth,
|
|
274
|
+
expandedWidth,
|
|
275
|
+
expandedInsideBorderSize,
|
|
276
|
+
tabs.length,
|
|
277
|
+
collapsedOutsideBorderSize,
|
|
278
|
+
]);
|
|
279
|
+
|
|
280
|
+
useEffect(() => {
|
|
281
|
+
updateActiveTabIndex(activeTabIndexProp ?? 0);
|
|
282
|
+
}, [activeTabIndexProp, updateActiveTabIndex]);
|
|
283
|
+
|
|
284
|
+
const getCloseStateComponent = () => {
|
|
285
|
+
const _childComponents = Array.isArray(tabs) ? tabs : [tabs];
|
|
286
|
+
return (
|
|
287
|
+
<>
|
|
288
|
+
<div
|
|
289
|
+
className={classnames(
|
|
290
|
+
'bg-popover flex h-[28px] w-full cursor-pointer items-center rounded-md',
|
|
291
|
+
side === 'left' ? 'justify-end pr-2' : 'justify-start pl-2'
|
|
292
|
+
)}
|
|
293
|
+
onClick={() => {
|
|
294
|
+
updatePanelOpen(!panelOpen);
|
|
295
|
+
}}
|
|
296
|
+
data-cy={`side-panel-header-${side}`}
|
|
297
|
+
>
|
|
298
|
+
<Icons.NavigationPanelReveal
|
|
299
|
+
className={classnames('text-primary', side === 'left' && 'rotate-180 transform')}
|
|
300
|
+
/>
|
|
301
|
+
</div>
|
|
302
|
+
<div className={classnames('mt-3 flex flex-col space-y-3')}>
|
|
303
|
+
{_childComponents.map((childComponent, index) => (
|
|
304
|
+
<Tooltip key={index}>
|
|
305
|
+
<TooltipTrigger>
|
|
306
|
+
<div
|
|
307
|
+
id={`${childComponent.name}-btn`}
|
|
308
|
+
data-cy={`${childComponent.name}-btn`}
|
|
309
|
+
className="text-primary hover:cursor-pointer"
|
|
310
|
+
onClick={() => {
|
|
311
|
+
return childComponent.disabled ? null : updateActiveTabIndex(index, true);
|
|
312
|
+
}}
|
|
313
|
+
>
|
|
314
|
+
{React.createElement(Icons[childComponent.iconName] || Icons.MissingIcon, {
|
|
315
|
+
className: classnames({
|
|
316
|
+
'text-primary': true,
|
|
317
|
+
'ohif-disabled': childComponent.disabled,
|
|
318
|
+
}),
|
|
319
|
+
style: {
|
|
320
|
+
width: '22px',
|
|
321
|
+
height: '22px',
|
|
322
|
+
},
|
|
323
|
+
})}
|
|
324
|
+
</div>
|
|
325
|
+
</TooltipTrigger>
|
|
326
|
+
<TooltipContent side={side === 'left' ? 'right' : 'left'}>
|
|
327
|
+
<div
|
|
328
|
+
className={classnames(
|
|
329
|
+
'flex items-center',
|
|
330
|
+
side === 'left' ? 'justify-end' : 'justify-start'
|
|
331
|
+
)}
|
|
332
|
+
>
|
|
333
|
+
{getToolTipContent(childComponent.label, childComponent.disabled)}
|
|
334
|
+
</div>
|
|
335
|
+
</TooltipContent>
|
|
336
|
+
</Tooltip>
|
|
337
|
+
))}
|
|
338
|
+
</div>
|
|
339
|
+
</>
|
|
340
|
+
);
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
const getCloseIcon = () => {
|
|
344
|
+
return (
|
|
345
|
+
<div
|
|
346
|
+
className={classnames(
|
|
347
|
+
'absolute flex cursor-pointer items-center justify-center',
|
|
348
|
+
side === 'left' ? 'right-0' : 'left-0'
|
|
349
|
+
)}
|
|
350
|
+
style={{ width: `${closeIconWidth}px` }}
|
|
351
|
+
onClick={() => {
|
|
352
|
+
updatePanelOpen(!panelOpen);
|
|
353
|
+
}}
|
|
354
|
+
data-cy={`side-panel-header-${side}`}
|
|
355
|
+
>
|
|
356
|
+
{React.createElement(Icons[openStateIconName[side]] || Icons.MissingIcon, {
|
|
357
|
+
className: 'text-primary',
|
|
358
|
+
})}
|
|
359
|
+
</div>
|
|
360
|
+
);
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
const getTabGridComponent = () => {
|
|
364
|
+
const numCols = getNumGridColumns(tabs.length, gridWidth);
|
|
365
|
+
|
|
366
|
+
return (
|
|
367
|
+
<>
|
|
368
|
+
{getCloseIcon()}
|
|
369
|
+
<div className={classnames('flex grow justify-center')}>
|
|
370
|
+
<div className={classnames('bg-muted text-primary flex flex-wrap')}>
|
|
371
|
+
{tabs.map((tab, tabIndex) => {
|
|
372
|
+
const { disabled } = tab;
|
|
373
|
+
return (
|
|
374
|
+
<React.Fragment key={tabIndex}>
|
|
375
|
+
{tabIndex % numCols !== 0 && (
|
|
376
|
+
<div
|
|
377
|
+
className={classnames('flex h-[28px] w-[2px] items-center', tabSpacerWidth)}
|
|
378
|
+
>
|
|
379
|
+
<div className="bg-muted h-[20px] w-full"></div>
|
|
380
|
+
</div>
|
|
381
|
+
)}
|
|
382
|
+
<Tooltip key={tabIndex}>
|
|
383
|
+
<TooltipTrigger>
|
|
384
|
+
<div
|
|
385
|
+
className={getTabClassNames(
|
|
386
|
+
numCols,
|
|
387
|
+
tabs.length,
|
|
388
|
+
tabIndex,
|
|
389
|
+
tabIndex === activeTabIndex,
|
|
390
|
+
disabled
|
|
391
|
+
)}
|
|
392
|
+
style={getTabStyle(tabs.length)}
|
|
393
|
+
onClick={() => {
|
|
394
|
+
return disabled ? null : updateActiveTabIndex(tabIndex);
|
|
395
|
+
}}
|
|
396
|
+
data-cy={`${tab.name}-btn`}
|
|
397
|
+
>
|
|
398
|
+
<div
|
|
399
|
+
className={getTabIconClassNames(tabs.length, tabIndex === activeTabIndex)}
|
|
400
|
+
>
|
|
401
|
+
{React.createElement(Icons[tab.iconName] || Icons.MissingIcon, {
|
|
402
|
+
className: classnames({
|
|
403
|
+
'text-primary': true,
|
|
404
|
+
'ohif-disabled': disabled,
|
|
405
|
+
}),
|
|
406
|
+
style: {
|
|
407
|
+
width: '22px',
|
|
408
|
+
height: '22px',
|
|
409
|
+
},
|
|
410
|
+
})}
|
|
411
|
+
</div>
|
|
412
|
+
</div>
|
|
413
|
+
</TooltipTrigger>
|
|
414
|
+
<TooltipContent side="bottom">
|
|
415
|
+
{getToolTipContent(tab.label, disabled)}
|
|
416
|
+
</TooltipContent>
|
|
417
|
+
</Tooltip>
|
|
418
|
+
</React.Fragment>
|
|
419
|
+
);
|
|
420
|
+
})}
|
|
421
|
+
</div>
|
|
422
|
+
</div>
|
|
423
|
+
</>
|
|
424
|
+
);
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
const getOneTabComponent = () => {
|
|
428
|
+
return (
|
|
429
|
+
<div
|
|
430
|
+
className={classnames(
|
|
431
|
+
'text-primary flex grow cursor-pointer select-none justify-center self-center text-[13px]'
|
|
432
|
+
)}
|
|
433
|
+
data-cy={`${tabs[0].name}-btn`}
|
|
434
|
+
onClick={() => updatePanelOpen(!panelOpen)}
|
|
435
|
+
>
|
|
436
|
+
{getCloseIcon()}
|
|
437
|
+
<span>{tabs[0].label}</span>
|
|
438
|
+
</div>
|
|
439
|
+
);
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
const getOpenStateComponent = () => {
|
|
443
|
+
return (
|
|
444
|
+
<>
|
|
445
|
+
<div className="bg-muted flex h-[40px] flex-shrink-0 select-none rounded-t p-2">
|
|
446
|
+
{tabs.length === 1 ? getOneTabComponent() : getTabGridComponent()}
|
|
447
|
+
</div>
|
|
448
|
+
<Separator
|
|
449
|
+
orientation="horizontal"
|
|
450
|
+
className="bg-background"
|
|
451
|
+
thickness="2px"
|
|
452
|
+
/>
|
|
453
|
+
</>
|
|
454
|
+
);
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
return (
|
|
458
|
+
<div
|
|
459
|
+
className={classnames(className, baseClasses)}
|
|
460
|
+
style={style}
|
|
461
|
+
>
|
|
462
|
+
{panelOpen ? (
|
|
463
|
+
<>
|
|
464
|
+
{getOpenStateComponent()}
|
|
465
|
+
{tabs.map((tab, tabIndex) => {
|
|
466
|
+
if (tabIndex === activeTabIndex) {
|
|
467
|
+
return <tab.content key={tabIndex} />;
|
|
468
|
+
}
|
|
469
|
+
return null;
|
|
470
|
+
})}
|
|
471
|
+
</>
|
|
472
|
+
) : (
|
|
473
|
+
<React.Fragment>{getCloseStateComponent()}</React.Fragment>
|
|
474
|
+
)}
|
|
475
|
+
</div>
|
|
476
|
+
);
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
export { SidePanel };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
3
|
+
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
|
|
6
|
+
const Slider = ({
|
|
7
|
+
className,
|
|
8
|
+
ref,
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof SliderPrimitive.Root>) => (
|
|
11
|
+
<SliderPrimitive.Root
|
|
12
|
+
ref={ref}
|
|
13
|
+
className={cn('relative flex w-full touch-none select-none items-center', className)}
|
|
14
|
+
{...props}
|
|
15
|
+
>
|
|
16
|
+
<SliderPrimitive.Track className="bg-primary/30 relative h-1 w-full grow overflow-hidden rounded-full">
|
|
17
|
+
<SliderPrimitive.Range className="bg-primary absolute h-full" />
|
|
18
|
+
</SliderPrimitive.Track>
|
|
19
|
+
<SliderPrimitive.Thumb className="border-background bg-primary focus-visible:ring-ring block h-4 w-4 rounded-full border-2 shadow transition-colors focus-visible:outline-none focus-visible:ring-1 disabled:pointer-events-none disabled:opacity-50" />
|
|
20
|
+
</SliderPrimitive.Root>
|
|
21
|
+
);
|
|
22
|
+
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
23
|
+
|
|
24
|
+
export { Slider };
|