@ohif/ui-next 3.14.0-beta.11 → 3.14.0-beta.110
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.css +6 -6
- package/dist/ohif-ui-next.umd.js +4 -1838
- package/package.json +31 -14
- 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 +16 -0
- package/src/components/SegmentationTable/index.ts +27 -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 +330 -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,24 @@
|
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { ProgressDropdownOption } from './types';
|
|
4
|
+
|
|
5
|
+
const ProgressDiscreteBar = ({ options }: { options: ProgressDropdownOption[] }): ReactElement<any> => {
|
|
6
|
+
return (
|
|
7
|
+
<div className="flex">
|
|
8
|
+
{options.map((option, i) => (
|
|
9
|
+
<div
|
|
10
|
+
key={i}
|
|
11
|
+
className={classnames('mr-1 h-1 grow first:rounded-l-sm last:mr-0 last:rounded-r-sm', {
|
|
12
|
+
'bg-background': !option.activated && !option.completed,
|
|
13
|
+
'bg-primary/40': option.activated && !option.completed,
|
|
14
|
+
'bg-highlight': option.completed,
|
|
15
|
+
})}
|
|
16
|
+
/>
|
|
17
|
+
))}
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
export default ProgressDiscreteBar;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import React, { ReactNode, useEffect, useCallback, useState, useMemo, useRef, type JSX } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import ProgressDiscreteBar from './ProgressDiscreteBar';
|
|
4
|
+
import ProgressItemDetail from './ProgressItemDetail';
|
|
5
|
+
import ProgressItem from './ProgressItem';
|
|
6
|
+
import { Icons } from '../Icons';
|
|
7
|
+
import { ProgressDropdownOption } from './types';
|
|
8
|
+
|
|
9
|
+
const ProgressDropdown = ({
|
|
10
|
+
options: optionsProps,
|
|
11
|
+
value,
|
|
12
|
+
children,
|
|
13
|
+
dropDownWidth = '170',
|
|
14
|
+
onChange,
|
|
15
|
+
}: {
|
|
16
|
+
options: ProgressDropdownOption[];
|
|
17
|
+
value?: string;
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
onChange?: ({ selectedOption }) => void;
|
|
20
|
+
}): JSX.Element => {
|
|
21
|
+
const element = useRef(null);
|
|
22
|
+
const [open, setOpen] = useState(false);
|
|
23
|
+
const toggleOpen = () => setOpen(s => !s);
|
|
24
|
+
const [options, setOptions] = useState(optionsProps);
|
|
25
|
+
const [selectedOption, setSelectedOption] = useState(undefined);
|
|
26
|
+
|
|
27
|
+
const selectedOptionIndex = useMemo(
|
|
28
|
+
() => options.findIndex(option => option.value === selectedOption?.value),
|
|
29
|
+
[options, selectedOption]
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const canMoveNext = useMemo(
|
|
33
|
+
() => selectedOptionIndex < options.length - 1,
|
|
34
|
+
[selectedOptionIndex, options]
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const handleOptionSelected = useCallback(
|
|
38
|
+
(newSelectedOption?: ProgressDropdownOption): void => {
|
|
39
|
+
if (newSelectedOption?.value === selectedOption?.value) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
setOpen(false);
|
|
44
|
+
setSelectedOption(newSelectedOption);
|
|
45
|
+
|
|
46
|
+
if (newSelectedOption) {
|
|
47
|
+
newSelectedOption.activated = true;
|
|
48
|
+
newSelectedOption.onSelect?.();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (onChange) {
|
|
52
|
+
onChange({ selectedOption: newSelectedOption });
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
[selectedOption, onChange]
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const handleNextButtonClick = useCallback(() => {
|
|
59
|
+
if (canMoveNext) {
|
|
60
|
+
handleOptionSelected(options[selectedOptionIndex + 1]);
|
|
61
|
+
}
|
|
62
|
+
}, [options, selectedOptionIndex, canMoveNext, handleOptionSelected]);
|
|
63
|
+
|
|
64
|
+
// Update the options in case the options from props has changed
|
|
65
|
+
useEffect(() => setOptions(optionsProps), [optionsProps]);
|
|
66
|
+
|
|
67
|
+
// Updates the selected item based on the value from props
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (!value) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const newOption = value ? options.find(option => option.value === value) : undefined;
|
|
74
|
+
|
|
75
|
+
handleOptionSelected(newOption);
|
|
76
|
+
}, [value, options, handleOptionSelected]);
|
|
77
|
+
|
|
78
|
+
// Listen to any click event outside of the dropdown context to hide the options
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
const handleDocumentClick = e => {
|
|
81
|
+
if (element.current && !element.current.contains(e.target)) {
|
|
82
|
+
setOpen(false);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
document.addEventListener('click', handleDocumentClick);
|
|
87
|
+
|
|
88
|
+
if (!open) {
|
|
89
|
+
document.removeEventListener('click', handleDocumentClick);
|
|
90
|
+
}
|
|
91
|
+
}, [open]);
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<div
|
|
95
|
+
ref={element}
|
|
96
|
+
className="text-foreground relative grow select-none text-[0px]"
|
|
97
|
+
>
|
|
98
|
+
<div>
|
|
99
|
+
<div className="mb-1.5 flex h-[26px]">
|
|
100
|
+
<div
|
|
101
|
+
className="bg-popover border-primary/40 flex grow cursor-pointer rounded border"
|
|
102
|
+
style={{ width: `${dropDownWidth}px` }}
|
|
103
|
+
onClick={toggleOpen}
|
|
104
|
+
>
|
|
105
|
+
<div className="flex grow">
|
|
106
|
+
{selectedOption && <ProgressItemDetail option={selectedOption} />}
|
|
107
|
+
|
|
108
|
+
{!selectedOption && <div className="ml-1 grow text-base leading-6">{children}</div>}
|
|
109
|
+
</div>
|
|
110
|
+
<Icons.ChevronDown className="text-primary mt-1.5 ml-1 mr-2" />
|
|
111
|
+
</div>
|
|
112
|
+
<button
|
|
113
|
+
className={classnames('ml-1.5 w-[26px] rounded text-base', {
|
|
114
|
+
'bg-primary/60 hover:bg-primary/80': canMoveNext,
|
|
115
|
+
'bg-popover pointer-events-none': !canMoveNext,
|
|
116
|
+
})}
|
|
117
|
+
>
|
|
118
|
+
<Icons.ArrowRight
|
|
119
|
+
className={classnames('text-foreground relative left-0.5 h-6 w-6', {
|
|
120
|
+
'text-foreground': canMoveNext,
|
|
121
|
+
'text-': !canMoveNext,
|
|
122
|
+
})}
|
|
123
|
+
onClick={handleNextButtonClick}
|
|
124
|
+
/>
|
|
125
|
+
</button>
|
|
126
|
+
</div>
|
|
127
|
+
<div
|
|
128
|
+
className={classnames(
|
|
129
|
+
'absolute top-7 left-0 right-8 z-10 mt-0.5 origin-top',
|
|
130
|
+
'bg-popover overflow-hidden transition-[max-height] duration-300',
|
|
131
|
+
'border-input/50 rounded border shadow',
|
|
132
|
+
'py-1',
|
|
133
|
+
{
|
|
134
|
+
hidden: !open,
|
|
135
|
+
'max-h-[500px]': open,
|
|
136
|
+
}
|
|
137
|
+
)}
|
|
138
|
+
>
|
|
139
|
+
{options.map((option, index) => (
|
|
140
|
+
<ProgressItem
|
|
141
|
+
key={index}
|
|
142
|
+
option={option}
|
|
143
|
+
onSelect={() => handleOptionSelected(option)}
|
|
144
|
+
/>
|
|
145
|
+
))}
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<div>
|
|
149
|
+
<ProgressDiscreteBar options={options} />
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
);
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
export default ProgressDropdown;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
|
+
import ProgressItemDetail from './ProgressItemDetail';
|
|
3
|
+
import { ProgressDropdownOption } from './types';
|
|
4
|
+
|
|
5
|
+
const ProgressItem = ({
|
|
6
|
+
option,
|
|
7
|
+
onSelect,
|
|
8
|
+
}: {
|
|
9
|
+
option: ProgressDropdownOption;
|
|
10
|
+
onSelect: (option: ProgressDropdownOption) => void;
|
|
11
|
+
}): ReactElement<any> => {
|
|
12
|
+
const { value } = option;
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div
|
|
16
|
+
key={value}
|
|
17
|
+
className={'hover:bg-accent mx-1 flex cursor-pointer rounded-sm py-1'}
|
|
18
|
+
onClick={() => onSelect(option)}
|
|
19
|
+
>
|
|
20
|
+
<ProgressItemDetail option={option} />
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
export default ProgressItem;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React, { useState, ReactElement } from 'react';
|
|
2
|
+
import { Icons } from '../Icons';
|
|
3
|
+
import { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from '../Tooltip';
|
|
4
|
+
import { ProgressDropdownOption } from './types';
|
|
5
|
+
|
|
6
|
+
const MAX_TOOLTIP_LENGTH = 150;
|
|
7
|
+
const iconClassNames = 'grow-0 text-highlight h-4 w-4 mt-1 mr-2 mb-0 ml-1';
|
|
8
|
+
|
|
9
|
+
const ProgressItemDetail = ({ option }: { option: ProgressDropdownOption }): ReactElement<any> => {
|
|
10
|
+
const { label, info, completed } = option;
|
|
11
|
+
const [truncate, setTruncate] = useState(true);
|
|
12
|
+
const handleOnHideTooltip = () => setTruncate(true);
|
|
13
|
+
let icon;
|
|
14
|
+
|
|
15
|
+
if (completed) {
|
|
16
|
+
icon = 'status-tracked';
|
|
17
|
+
} else if (info) {
|
|
18
|
+
icon = 'launch-info';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const handleReadMoreClick = e => {
|
|
22
|
+
setTruncate(false);
|
|
23
|
+
e.stopPropagation();
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const tooltipText =
|
|
28
|
+
!truncate || !info || info.length <= MAX_TOOLTIP_LENGTH ? (
|
|
29
|
+
info
|
|
30
|
+
) : (
|
|
31
|
+
<>
|
|
32
|
+
{info.slice(0, MAX_TOOLTIP_LENGTH)}
|
|
33
|
+
<button
|
|
34
|
+
className="text-primary font-bold"
|
|
35
|
+
onClick={handleReadMoreClick}
|
|
36
|
+
>
|
|
37
|
+
Read more...
|
|
38
|
+
</button>
|
|
39
|
+
</>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const handleOpenChange = (open: boolean) => {
|
|
43
|
+
if (!open) {
|
|
44
|
+
handleOnHideTooltip();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const iconContent = (
|
|
49
|
+
<>
|
|
50
|
+
{icon && (
|
|
51
|
+
<div>
|
|
52
|
+
<Icons.ByName
|
|
53
|
+
name={icon}
|
|
54
|
+
className={iconClassNames}
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
57
|
+
)}
|
|
58
|
+
{!icon && <div className={iconClassNames} />}
|
|
59
|
+
</>
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<>
|
|
64
|
+
{info && (
|
|
65
|
+
<TooltipProvider delayDuration={200}>
|
|
66
|
+
<Tooltip onOpenChange={handleOpenChange}>
|
|
67
|
+
<TooltipTrigger asChild>{iconContent}</TooltipTrigger>
|
|
68
|
+
<TooltipContent
|
|
69
|
+
side="bottom"
|
|
70
|
+
align="start"
|
|
71
|
+
className={'max-w-xs'}
|
|
72
|
+
>
|
|
73
|
+
{tooltipText}
|
|
74
|
+
</TooltipContent>
|
|
75
|
+
</Tooltip>
|
|
76
|
+
</TooltipProvider>
|
|
77
|
+
)}
|
|
78
|
+
{!info && iconContent}
|
|
79
|
+
|
|
80
|
+
<div className="grow overflow-hidden text-ellipsis whitespace-nowrap text-base leading-6">
|
|
81
|
+
{label}
|
|
82
|
+
</div>
|
|
83
|
+
</>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
export default ProgressItemDetail;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ProgressDropdown';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.loading {
|
|
2
|
+
background-color: hsl(var(--muted));
|
|
3
|
+
height: 8px;
|
|
4
|
+
border-radius: 4px;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
position: relative;
|
|
7
|
+
width: 100%;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.infinite-loading-bar {
|
|
11
|
+
animation: side2side 2s ease-in-out infinite;
|
|
12
|
+
height: 100%;
|
|
13
|
+
position: absolute;
|
|
14
|
+
border-radius: 4px;
|
|
15
|
+
width: 50%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@keyframes side2side {
|
|
19
|
+
0%,
|
|
20
|
+
100% {
|
|
21
|
+
transform: translateX(-50%);
|
|
22
|
+
}
|
|
23
|
+
50% {
|
|
24
|
+
transform: translateX(150%);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
|
+
|
|
3
|
+
import './ProgressLoadingBar.css';
|
|
4
|
+
|
|
5
|
+
export type ProgressLoadingBarProps = {
|
|
6
|
+
progress?: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A React component that renders a loading progress bar.
|
|
10
|
+
* If progress is not provided, it will render an infinite loading bar
|
|
11
|
+
* If progress is provided, it will render a progress bar
|
|
12
|
+
* The progress text can be optionally displayed to the left of the bar.
|
|
13
|
+
*/
|
|
14
|
+
function ProgressLoadingBar({ progress }: ProgressLoadingBarProps): ReactElement<any> {
|
|
15
|
+
return (
|
|
16
|
+
<div className="loading">
|
|
17
|
+
{progress === undefined || progress === null ? (
|
|
18
|
+
<div className="infinite-loading-bar bg-highlight"></div>
|
|
19
|
+
) : (
|
|
20
|
+
<div
|
|
21
|
+
className="bg-highlight"
|
|
22
|
+
style={{
|
|
23
|
+
width: `${progress}%`,
|
|
24
|
+
height: '8px',
|
|
25
|
+
}}
|
|
26
|
+
></div>
|
|
27
|
+
)}
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default ProgressLoadingBar;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { GripVertical } from 'lucide-react';
|
|
5
|
+
import * as ResizablePrimitive from 'react-resizable-panels';
|
|
6
|
+
|
|
7
|
+
import cn from 'classnames';
|
|
8
|
+
|
|
9
|
+
const ResizablePanelGroup = ({
|
|
10
|
+
className,
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => (
|
|
13
|
+
<ResizablePrimitive.PanelGroup
|
|
14
|
+
className={cn('flex h-full w-full data-[panel-group-direction=vertical]:flex-col', className)}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const ResizablePanel = ResizablePrimitive.Panel;
|
|
20
|
+
|
|
21
|
+
const ResizableHandle = ({
|
|
22
|
+
withHandle,
|
|
23
|
+
className,
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
|
|
26
|
+
withHandle?: boolean;
|
|
27
|
+
}) => (
|
|
28
|
+
<ResizablePrimitive.PanelResizeHandle
|
|
29
|
+
className={cn(
|
|
30
|
+
"[&[data-resize-handle-state='hover']]:bg-primary/40 [&[data-resize-handle-state='drag']]:bg-primary/40 focus-visible:ring-ring relative flex w-1 items-center justify-center rounded-full after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",
|
|
31
|
+
className
|
|
32
|
+
)}
|
|
33
|
+
{...props}
|
|
34
|
+
>
|
|
35
|
+
{withHandle && (
|
|
36
|
+
<div className="bg-border z-10 flex h-4 w-3 items-center justify-center rounded-sm border">
|
|
37
|
+
<GripVertical className="h-2.5 w-2.5" />
|
|
38
|
+
</div>
|
|
39
|
+
)}
|
|
40
|
+
</ResizablePrimitive.PanelResizeHandle>
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
3
|
+
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
import { Icons } from '../Icons';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Props interface for the ScrollArea component.
|
|
9
|
+
* Extends Radix UI ScrollArea root props.
|
|
10
|
+
*/
|
|
11
|
+
interface ScrollAreaProps extends React.ComponentProps<typeof ScrollAreaPrimitive.Root> {
|
|
12
|
+
/** Flag to show/hide scroll indicator arrows at top and bottom */
|
|
13
|
+
showArrows?: boolean;
|
|
14
|
+
type?: 'auto' | 'always' | 'scroll';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A custom scroll area component built on top of Radix UI's ScrollArea.
|
|
19
|
+
* Provides a scrollable container with custom styling and optional scroll indicators.
|
|
20
|
+
*
|
|
21
|
+
* @param props - The component props
|
|
22
|
+
* @param props.className - Additional CSS classes to apply
|
|
23
|
+
* @param props.children - The content to be scrolled
|
|
24
|
+
* @param props.showArrows - Whether to show scroll indicator arrows
|
|
25
|
+
* @param ref - Forward ref for the root element
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <ScrollArea showArrows>
|
|
30
|
+
* <div>Scrollable content</div>
|
|
31
|
+
* </ScrollArea>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
const ScrollArea = ({
|
|
35
|
+
className,
|
|
36
|
+
children,
|
|
37
|
+
showArrows = false,
|
|
38
|
+
ref,
|
|
39
|
+
...props
|
|
40
|
+
}: ScrollAreaProps) => {
|
|
41
|
+
const [showBottomArrow, setShowBottomArrow] = React.useState(false);
|
|
42
|
+
const [showTopArrow, setShowTopArrow] = React.useState(false);
|
|
43
|
+
const viewportRef = React.useRef<HTMLDivElement>(null);
|
|
44
|
+
|
|
45
|
+
const checkScroll = () => {
|
|
46
|
+
if (viewportRef.current) {
|
|
47
|
+
const { scrollHeight, clientHeight, scrollTop } = viewportRef.current;
|
|
48
|
+
setShowBottomArrow(scrollHeight > clientHeight && scrollTop < scrollHeight - clientHeight);
|
|
49
|
+
setShowTopArrow(scrollTop > 0);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
React.useEffect(() => {
|
|
54
|
+
checkScroll();
|
|
55
|
+
window.addEventListener('resize', checkScroll);
|
|
56
|
+
return () => window.removeEventListener('resize', checkScroll);
|
|
57
|
+
}, [checkScroll]);
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<ScrollAreaPrimitive.Root
|
|
61
|
+
ref={ref}
|
|
62
|
+
className={cn('relative h-full overflow-hidden', className, '[&>div>div]:!block')}
|
|
63
|
+
type={props.type}
|
|
64
|
+
{...props}
|
|
65
|
+
>
|
|
66
|
+
<ScrollAreaPrimitive.Viewport
|
|
67
|
+
ref={viewportRef}
|
|
68
|
+
className="h-full w-full rounded-[inherit]"
|
|
69
|
+
onScroll={checkScroll}
|
|
70
|
+
>
|
|
71
|
+
{children}
|
|
72
|
+
</ScrollAreaPrimitive.Viewport>
|
|
73
|
+
<ScrollBar />
|
|
74
|
+
<ScrollAreaPrimitive.Corner />
|
|
75
|
+
{showArrows && showTopArrow && (
|
|
76
|
+
<div className="from-background via-background/80 pointer-events-none absolute -top-1 left-0 right-0 flex h-8 items-center justify-center bg-gradient-to-b to-transparent">
|
|
77
|
+
<Icons.ChevronOpen className="text-foreground/50 h-8 w-8 rotate-180" />
|
|
78
|
+
</div>
|
|
79
|
+
)}
|
|
80
|
+
{showArrows && showBottomArrow && (
|
|
81
|
+
<div className="from-background via-background/80 pointer-events-none absolute -bottom-1 left-0 right-0 flex h-8 items-center justify-center bg-gradient-to-t to-transparent">
|
|
82
|
+
<Icons.ChevronOpen className="text-foreground/50 h-8 w-8" />
|
|
83
|
+
</div>
|
|
84
|
+
)}
|
|
85
|
+
</ScrollAreaPrimitive.Root>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Custom scrollbar component for the ScrollArea.
|
|
93
|
+
* Provides styled scrollbars that can be either vertical or horizontal.
|
|
94
|
+
*
|
|
95
|
+
* @param props - The component props
|
|
96
|
+
* @param props.className - Additional CSS classes to apply
|
|
97
|
+
* @param props.orientation - The scrollbar orientation ('vertical' | 'horizontal')
|
|
98
|
+
* @param ref - Forward ref for the scrollbar element
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```tsx
|
|
102
|
+
* <ScrollBar orientation="vertical" />
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
const ScrollBar = ({
|
|
106
|
+
className,
|
|
107
|
+
orientation = 'vertical',
|
|
108
|
+
ref,
|
|
109
|
+
...props
|
|
110
|
+
}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) => (
|
|
111
|
+
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
112
|
+
ref={ref}
|
|
113
|
+
orientation={orientation}
|
|
114
|
+
className={cn(
|
|
115
|
+
'flex touch-none select-none transition-colors',
|
|
116
|
+
orientation === 'vertical' && 'h-full w-2.5 border-l border-l-transparent p-[2px]',
|
|
117
|
+
orientation === 'horizontal' && 'h-2 flex-col border-t border-t-transparent p-[1px]',
|
|
118
|
+
className
|
|
119
|
+
)}
|
|
120
|
+
{...props}
|
|
121
|
+
>
|
|
122
|
+
<ScrollAreaPrimitive.ScrollAreaThumb className="bg-neutral/50 relative flex-1 rounded-full" />
|
|
123
|
+
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
124
|
+
);
|
|
125
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
126
|
+
|
|
127
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button, Icons } from '@ohif/ui-next';
|
|
3
|
+
import { useSegmentationTableContext, useSegmentationExpanded } from './contexts';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
|
|
6
|
+
export const AddSegmentRow: React.FC<{ children?: React.ReactNode }> = ({ children = null }) => {
|
|
7
|
+
const { t } = useTranslation('SegmentationPanel');
|
|
8
|
+
const {
|
|
9
|
+
activeRepresentation,
|
|
10
|
+
disableEditing,
|
|
11
|
+
activeSegmentationId,
|
|
12
|
+
onSegmentAdd,
|
|
13
|
+
onToggleSegmentationRepresentationVisibility,
|
|
14
|
+
data,
|
|
15
|
+
showAddSegment,
|
|
16
|
+
segmentationRepresentationTypes
|
|
17
|
+
} = useSegmentationTableContext('AddSegmentRow');
|
|
18
|
+
|
|
19
|
+
// Prefer the expanded context when this row is rendered inside one and it is
|
|
20
|
+
// active; otherwise fall back to the active segmentation from the table context.
|
|
21
|
+
const expandedContext = useSegmentationExpanded();
|
|
22
|
+
const useExpanded = expandedContext?.isActive === true;
|
|
23
|
+
const segmentationId = useExpanded
|
|
24
|
+
? expandedContext.segmentation.segmentationId
|
|
25
|
+
: activeSegmentationId;
|
|
26
|
+
const representation = useExpanded ? expandedContext.representation : activeRepresentation;
|
|
27
|
+
|
|
28
|
+
// If no segmentations, don't render
|
|
29
|
+
if (!data?.length) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Check if all segments are visible
|
|
34
|
+
const allSegmentsVisible = Object.values(representation?.segments || {}).every(
|
|
35
|
+
segment => segment?.visible !== false
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const Icon = allSegmentsVisible ? (
|
|
39
|
+
<Icons.Hide className="h-6 w-6" />
|
|
40
|
+
) : (
|
|
41
|
+
<Icons.Show className="h-6 w-6" />
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const allowAddSegment = showAddSegment && !disableEditing;
|
|
45
|
+
|
|
46
|
+
const dataCyTypeSuffix = segmentationRepresentationTypes
|
|
47
|
+
? `-${segmentationRepresentationTypes[0]}`
|
|
48
|
+
: '';
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div className="my-px flex h-7 w-full items-center justify-between rounded pl-0.5 pr-7">
|
|
52
|
+
<div className="mt-1 flex-1">
|
|
53
|
+
{allowAddSegment ? (
|
|
54
|
+
<Button
|
|
55
|
+
size="sm"
|
|
56
|
+
variant="ghost"
|
|
57
|
+
className="pr pl-0.5"
|
|
58
|
+
onClick={() => onSegmentAdd(segmentationId)}
|
|
59
|
+
>
|
|
60
|
+
<Icons.Add />
|
|
61
|
+
{t('Add Segment')}
|
|
62
|
+
</Button>
|
|
63
|
+
) : null}
|
|
64
|
+
</div>
|
|
65
|
+
<Button
|
|
66
|
+
size="icon"
|
|
67
|
+
variant="ghost"
|
|
68
|
+
data-cy={`all-segments-visibility-toggle${dataCyTypeSuffix}`}
|
|
69
|
+
onClick={() =>
|
|
70
|
+
onToggleSegmentationRepresentationVisibility(segmentationId, representation?.type)
|
|
71
|
+
}
|
|
72
|
+
>
|
|
73
|
+
{Icon}
|
|
74
|
+
</Button>
|
|
75
|
+
{children}
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
};
|