@ohif/ui-next 3.14.0-beta.11 → 3.14.0-beta.111
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
package/package.json
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ohif/ui-next",
|
|
3
|
-
"version": "3.14.0-beta.
|
|
3
|
+
"version": "3.14.0-beta.111",
|
|
4
4
|
"description": "Next version of OHIF Viewers UI, more customizable using shadcn/ui",
|
|
5
5
|
"author": "OHIF",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/ohif-ui-next.umd.js",
|
|
8
|
-
"module": "
|
|
8
|
+
"module": "dist/ohif-ui-next.umd.js",
|
|
9
9
|
"exports": {
|
|
10
|
+
".": "./dist/ohif-ui-next.umd.js",
|
|
10
11
|
"./tailwind.config": "./tailwind.config.js",
|
|
11
12
|
"./lib/*": "./src/lib/*.ts",
|
|
12
|
-
"./components/*": "./src/components/*.tsx"
|
|
13
|
-
".": "./src/index.ts"
|
|
13
|
+
"./components/*": "./src/components/*.tsx"
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
17
|
-
"
|
|
17
|
+
"src",
|
|
18
|
+
"public",
|
|
19
|
+
"README.md",
|
|
20
|
+
"tailwind.config.js"
|
|
18
21
|
],
|
|
19
22
|
"publishConfig": {
|
|
20
23
|
"access": "public"
|
|
@@ -39,18 +42,16 @@
|
|
|
39
42
|
"@radix-ui/react-toggle": "1.1.9",
|
|
40
43
|
"@radix-ui/react-toggle-group": "1.1.10",
|
|
41
44
|
"@radix-ui/react-tooltip": "1.2.7",
|
|
42
|
-
"@tanstack/react-table": "
|
|
45
|
+
"@tanstack/react-table": "9.1.2",
|
|
43
46
|
"class-variance-authority": "0.7.1",
|
|
44
47
|
"clsx": "2.1.1",
|
|
45
48
|
"cmdk": "1.1.1",
|
|
46
49
|
"date-fns": "4.1.0",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"next-themes": "0.3.0",
|
|
50
|
-
"react": "18.3.1",
|
|
50
|
+
"lucide-react": "0.577.0",
|
|
51
|
+
"next-themes": "0.4.6",
|
|
51
52
|
"react-day-picker": "9.12.0",
|
|
52
53
|
"react-resizable-panels": "2.1.9",
|
|
53
|
-
"shepherd.js": "15.
|
|
54
|
+
"shepherd.js": "15.3.0",
|
|
54
55
|
"sonner": "1.7.4",
|
|
55
56
|
"tailwind-merge": "2.6.0",
|
|
56
57
|
"tailwindcss": "3.2.4",
|
|
@@ -58,16 +59,32 @@
|
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
61
|
"@babel/plugin-transform-private-property-in-object": "7.29.7",
|
|
61
|
-
"
|
|
62
|
+
"@testing-library/dom": "10.4.1",
|
|
63
|
+
"@testing-library/react": "16.3.2",
|
|
64
|
+
"cross-env": "7.0.3",
|
|
65
|
+
"react": "19.2.7",
|
|
66
|
+
"react-dom": "19.2.7"
|
|
62
67
|
},
|
|
63
68
|
"keywords": [],
|
|
69
|
+
"//": [
|
|
70
|
+
"peerDependencies are a contract with the consuming app, not an install pin.",
|
|
71
|
+
"The range lets consumers use any React 19.x.",
|
|
72
|
+
"Nothing is installed from this block. React itself comes from devDependencies,",
|
|
73
|
+
"exactly pinned and held to one copy by the workspace overrides, so the range",
|
|
74
|
+
"specified below adds no packages, versions or transitive dependencies to",
|
|
75
|
+
"pnpm-lock.yaml and the supply chain stays fully pinned."
|
|
76
|
+
],
|
|
77
|
+
"peerDependencies": {
|
|
78
|
+
"react": "^19.2.7",
|
|
79
|
+
"react-dom": "^19.2.7"
|
|
80
|
+
},
|
|
64
81
|
"scripts": {
|
|
65
82
|
"clean": "shx rm -rf dist",
|
|
66
83
|
"clean:deep": "pnpm run clean && shx rm -rf node_modules",
|
|
67
84
|
"start": "pnpm run build --watch",
|
|
68
|
-
"dev": "cross-env NODE_ENV=development rspack build --config .
|
|
85
|
+
"dev": "cross-env NODE_ENV=development rspack build --config .rspack/rspack.dev.js --watch",
|
|
69
86
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
70
|
-
"build": "cross-env NODE_ENV=production rspack build --config .
|
|
87
|
+
"build": "cross-env NODE_ENV=production rspack build --config .rspack/rspack.prod.js",
|
|
71
88
|
"build:package": "pnpm run build"
|
|
72
89
|
}
|
|
73
90
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// https://jestjs.io/docs/en/webpack#handling-static-assets
|
|
2
|
+
//
|
|
3
|
+
// The shared jest config maps every static asset here. This package had no copy
|
|
4
|
+
// of it, so any test that reached a component importing an image - the Icons
|
|
5
|
+
// barrel imports the window level preset thumbnails - failed to resolve.
|
|
6
|
+
|
|
7
|
+
module.exports = 'test-file-stub';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* latin */
|
|
2
|
+
@font-face {
|
|
3
|
+
font-family: 'Inter';
|
|
4
|
+
font-style: normal;
|
|
5
|
+
font-weight: 100;
|
|
6
|
+
font-display: swap;
|
|
7
|
+
src: url('assets/woff2/latin.woff2') format('woff2');
|
|
8
|
+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
|
|
9
|
+
U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
10
|
+
}
|
|
11
|
+
/* latin */
|
|
12
|
+
@font-face {
|
|
13
|
+
font-family: 'Inter';
|
|
14
|
+
font-style: normal;
|
|
15
|
+
font-weight: 300;
|
|
16
|
+
font-display: swap;
|
|
17
|
+
src: url('assets/woff2/latin.woff2') format('woff2');
|
|
18
|
+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
|
|
19
|
+
U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
20
|
+
}
|
|
21
|
+
/* latin */
|
|
22
|
+
@font-face {
|
|
23
|
+
font-family: 'Inter';
|
|
24
|
+
font-style: normal;
|
|
25
|
+
font-weight: 400;
|
|
26
|
+
font-display: swap;
|
|
27
|
+
src: url('assets/woff2/latin.woff2') format('woff2');
|
|
28
|
+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
|
|
29
|
+
U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
30
|
+
}
|
|
31
|
+
/* latin */
|
|
32
|
+
@font-face {
|
|
33
|
+
font-family: 'Inter';
|
|
34
|
+
font-style: normal;
|
|
35
|
+
font-weight: 500;
|
|
36
|
+
font-display: swap;
|
|
37
|
+
src: url('assets/woff2/latin.woff2') format('woff2');
|
|
38
|
+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
|
|
39
|
+
U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
40
|
+
}
|
|
41
|
+
/* latin */
|
|
42
|
+
@font-face {
|
|
43
|
+
font-family: 'Inter';
|
|
44
|
+
font-style: normal;
|
|
45
|
+
font-weight: 700;
|
|
46
|
+
font-display: swap;
|
|
47
|
+
src: url('assets/woff2/latin.woff2') format('woff2');
|
|
48
|
+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
|
|
49
|
+
U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
50
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/* CUSTOM OHIF SCROLLBAR */
|
|
2
|
+
.ohif-scrollbar {
|
|
3
|
+
scrollbar-color: hsl(var(--neutral) / 0.5) transparent;
|
|
4
|
+
overflow-y: auto;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.ohif-scrollbar-stable-gutter {
|
|
8
|
+
scrollbar-gutter: stable;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.study-min-height {
|
|
12
|
+
min-height: 450px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.ohif-scrollbar:hover {
|
|
16
|
+
overflow-y: auto;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.ohif-scrollbar::-webkit-scrollbar {
|
|
20
|
+
scrollbar-width: thin;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ohif-scrollbar::-webkit-scrollbar-track {
|
|
24
|
+
@apply rounded;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.ohif-scrollbar::-webkit-scrollbar-thumb {
|
|
28
|
+
@apply rounded;
|
|
29
|
+
@apply bg-popover;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ohif-scrollbar::-webkit-scrollbar-thumb:window-inactive {
|
|
33
|
+
@apply bg-popover;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* INVISIBLE SCROLLBAR */
|
|
37
|
+
.invisible-scrollbar {
|
|
38
|
+
scrollbar-width: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.invisible-scrollbar::-webkit-scrollbar {
|
|
42
|
+
@apply hidden;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.invisible-scrollbar::-webkit-scrollbar-track {
|
|
46
|
+
@apply hidden;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.invisible-scrollbar::-webkit-scrollbar-thumb {
|
|
50
|
+
@apply hidden;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.invisible-scrollbar::-webkit-scrollbar-thumb:window-inactive {
|
|
54
|
+
@apply hidden;
|
|
55
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
5
|
+
import { ChevronDownIcon } from '@radix-ui/react-icons';
|
|
6
|
+
|
|
7
|
+
import { cn } from '../../lib/utils';
|
|
8
|
+
|
|
9
|
+
const Accordion = AccordionPrimitive.Root;
|
|
10
|
+
|
|
11
|
+
const AccordionItem = ({
|
|
12
|
+
className,
|
|
13
|
+
ref,
|
|
14
|
+
...props
|
|
15
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Item>) => (
|
|
16
|
+
<AccordionPrimitive.Item
|
|
17
|
+
ref={ref}
|
|
18
|
+
className={cn(className)}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
AccordionItem.displayName = 'AccordionItem';
|
|
23
|
+
|
|
24
|
+
const AccordionTrigger = ({
|
|
25
|
+
className,
|
|
26
|
+
children,
|
|
27
|
+
ref,
|
|
28
|
+
...props
|
|
29
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Trigger>) => (
|
|
30
|
+
<AccordionPrimitive.Header className="flex">
|
|
31
|
+
<AccordionPrimitive.Trigger
|
|
32
|
+
ref={ref}
|
|
33
|
+
className={cn(
|
|
34
|
+
'flex flex-1 items-center justify-between py-2 px-2 text-base font-medium transition-transform duration-200',
|
|
35
|
+
className,
|
|
36
|
+
'[&[data-state=open]>svg]:rotate-270',
|
|
37
|
+
'[&[data-state=closed]>svg]:rotate-90'
|
|
38
|
+
)}
|
|
39
|
+
{...props}
|
|
40
|
+
>
|
|
41
|
+
{props.asChild ? (
|
|
42
|
+
children
|
|
43
|
+
) : (
|
|
44
|
+
<>
|
|
45
|
+
{children}
|
|
46
|
+
<ChevronDownIcon className="text-primary h-4 w-4 shrink-0 transition-transform duration-200" />
|
|
47
|
+
</>
|
|
48
|
+
)}
|
|
49
|
+
</AccordionPrimitive.Trigger>
|
|
50
|
+
</AccordionPrimitive.Header>
|
|
51
|
+
);
|
|
52
|
+
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
53
|
+
|
|
54
|
+
const AccordionContent = ({
|
|
55
|
+
className,
|
|
56
|
+
children,
|
|
57
|
+
ref,
|
|
58
|
+
...props
|
|
59
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Content>) => (
|
|
60
|
+
<AccordionPrimitive.Content
|
|
61
|
+
ref={ref}
|
|
62
|
+
className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-base"
|
|
63
|
+
{...props}
|
|
64
|
+
>
|
|
65
|
+
<div className={cn(className)}>{children}</div>
|
|
66
|
+
</AccordionPrimitive.Content>
|
|
67
|
+
);
|
|
68
|
+
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
69
|
+
|
|
70
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Icons } from '@ohif/ui-next';
|
|
4
|
+
import DividerItem from './DividerItem';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
|
|
7
|
+
type BackItemProps = {
|
|
8
|
+
backLabel?: string;
|
|
9
|
+
onBackClick: () => void;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const BackItem = ({ backLabel, onBackClick }: BackItemProps) => {
|
|
13
|
+
const { t } = useTranslation('Common');
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<>
|
|
17
|
+
<div
|
|
18
|
+
className="hover:bg-accent flex h-8 w-full flex-shrink-0 cursor-pointer items-center pl-1 pr-2 text-base hover:rounded"
|
|
19
|
+
onClick={onBackClick}
|
|
20
|
+
>
|
|
21
|
+
<Icons.ByName
|
|
22
|
+
name="content-prev"
|
|
23
|
+
className="ml-2 mr-2"
|
|
24
|
+
/>
|
|
25
|
+
<span>{backLabel || t('Back')}</span>
|
|
26
|
+
</div>
|
|
27
|
+
<DividerItem></DividerItem>
|
|
28
|
+
</>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default BackItem;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type HeaderItemProps = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
const HeaderItem = ({ children }: HeaderItemProps) => {
|
|
8
|
+
return (
|
|
9
|
+
<div className="text-muted-foreground mx-2 flex h-6 shrink-0 items-center text-sm">
|
|
10
|
+
{children}
|
|
11
|
+
</div>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default HeaderItem;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import OutsideClickHandler from 'react-outside-click-handler';
|
|
3
|
+
import { MenuProps } from './Menu';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { AllInOneMenu } from '..';
|
|
6
|
+
import { Icons } from '@ohif/ui-next';
|
|
7
|
+
|
|
8
|
+
export interface IconMenuProps extends MenuProps {
|
|
9
|
+
icon: string;
|
|
10
|
+
iconClassName?: string;
|
|
11
|
+
horizontalDirection?: AllInOneMenu.HorizontalDirection;
|
|
12
|
+
verticalDirection?: AllInOneMenu.VerticalDirection;
|
|
13
|
+
menuKey?: number | string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* An IconMenu allows for a div wrapped icon to be clicked to show and hide
|
|
18
|
+
* an AllInOneMenu.Menu. Based on the direction(s) specified, the menu is
|
|
19
|
+
* positioned relative to the icon.
|
|
20
|
+
*
|
|
21
|
+
* HorizontalDirection.LeftToRight - the left edges of the icon and menu are aligned
|
|
22
|
+
* HorizontalDirection.RightRoLeft - the right edges of the icon and menu are aligned
|
|
23
|
+
* VerticalDirection.TopToBottom - the top edge of the menu appears directly below the bottom edge of the icon
|
|
24
|
+
* VerticalDirection.BottomToTop - the bottom edge of the menu appears directly above the top edge of the icon
|
|
25
|
+
*
|
|
26
|
+
* For example, if an IconMenu were situated in the bottom-left corner of a container,
|
|
27
|
+
* it would be best to use BottomToTop and LeftToRight directions for it.
|
|
28
|
+
*/
|
|
29
|
+
export default function IconMenu({
|
|
30
|
+
icon,
|
|
31
|
+
iconClassName,
|
|
32
|
+
horizontalDirection,
|
|
33
|
+
verticalDirection,
|
|
34
|
+
children,
|
|
35
|
+
backLabel,
|
|
36
|
+
menuClassName,
|
|
37
|
+
menuStyle,
|
|
38
|
+
onVisibilityChange,
|
|
39
|
+
menuKey,
|
|
40
|
+
}: IconMenuProps) {
|
|
41
|
+
const [isMenuVisible, setIsMenuVisible] = useState(false);
|
|
42
|
+
|
|
43
|
+
const toggleMenuVisibility = () => setIsMenuVisible(isVisible => !isVisible);
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<OutsideClickHandler
|
|
47
|
+
onOutsideClick={toggleMenuVisibility}
|
|
48
|
+
disabled={!isMenuVisible}
|
|
49
|
+
>
|
|
50
|
+
<div className="relative">
|
|
51
|
+
<div
|
|
52
|
+
className={iconClassName}
|
|
53
|
+
onClick={toggleMenuVisibility}
|
|
54
|
+
>
|
|
55
|
+
<Icons.ByName name={icon} />
|
|
56
|
+
</div>
|
|
57
|
+
<AllInOneMenu.Menu
|
|
58
|
+
key={menuKey}
|
|
59
|
+
isVisible={isMenuVisible}
|
|
60
|
+
backLabel={backLabel}
|
|
61
|
+
menuClassName={classNames(
|
|
62
|
+
menuClassName,
|
|
63
|
+
'absolute',
|
|
64
|
+
verticalDirection === AllInOneMenu.VerticalDirection.TopToBottom
|
|
65
|
+
? 'top-[100%]'
|
|
66
|
+
: 'bottom-[100%]',
|
|
67
|
+
horizontalDirection === AllInOneMenu.HorizontalDirection.LeftToRight
|
|
68
|
+
? 'left-0'
|
|
69
|
+
: 'right-0'
|
|
70
|
+
)}
|
|
71
|
+
menuStyle={menuStyle}
|
|
72
|
+
onVisibilityChange={isVis => {
|
|
73
|
+
setIsMenuVisible(isVis);
|
|
74
|
+
onVisibilityChange?.(isVis);
|
|
75
|
+
}}
|
|
76
|
+
horizontalDirection={horizontalDirection}
|
|
77
|
+
>
|
|
78
|
+
{children}
|
|
79
|
+
</AllInOneMenu.Menu>
|
|
80
|
+
</div>
|
|
81
|
+
</OutsideClickHandler>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { ReactNode, useContext } from 'react';
|
|
2
|
+
import { MenuContext } from './Menu';
|
|
3
|
+
|
|
4
|
+
type ItemProps = {
|
|
5
|
+
label: string;
|
|
6
|
+
secondaryLabel?: string;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
rightIcon?: ReactNode;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
onMouseEnter?: () => void;
|
|
11
|
+
onMouseLeave?: () => void;
|
|
12
|
+
useIconSpace?: boolean;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const Item = ({
|
|
16
|
+
label,
|
|
17
|
+
secondaryLabel,
|
|
18
|
+
icon,
|
|
19
|
+
rightIcon,
|
|
20
|
+
onClick,
|
|
21
|
+
onMouseEnter,
|
|
22
|
+
onMouseLeave,
|
|
23
|
+
useIconSpace = false,
|
|
24
|
+
}: ItemProps) => {
|
|
25
|
+
const { hideMenu } = useContext(MenuContext);
|
|
26
|
+
|
|
27
|
+
const onClickHandler = () => {
|
|
28
|
+
hideMenu();
|
|
29
|
+
onClick?.();
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div
|
|
34
|
+
className="hover:bg-accent flex h-8 w-full flex-shrink-0 cursor-pointer items-center px-2 text-base leading-[18px] hover:rounded"
|
|
35
|
+
onClick={onClickHandler}
|
|
36
|
+
onMouseEnter={onMouseEnter}
|
|
37
|
+
onMouseLeave={onMouseLeave}
|
|
38
|
+
>
|
|
39
|
+
{(icon || useIconSpace) && (
|
|
40
|
+
<div className="flex w-7 flex-shrink-0 items-center justify-center">{icon}</div>
|
|
41
|
+
)}
|
|
42
|
+
<span className="flex-grow">{label}</span>
|
|
43
|
+
{secondaryLabel && (
|
|
44
|
+
<span className="text-muted-foreground ml-2 flex-shrink-0">{secondaryLabel}</span>
|
|
45
|
+
)}
|
|
46
|
+
{rightIcon && <div className="ml-2 flex-shrink-0">{rightIcon}</div>}
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default Item;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { ReactNode, useContext, useEffect } from 'react';
|
|
2
|
+
import { MenuContext } from './Menu';
|
|
3
|
+
import { ScrollArea } from '@ohif/ui-next';
|
|
4
|
+
|
|
5
|
+
type ItemPanelProps = {
|
|
6
|
+
label?: string;
|
|
7
|
+
index?: number;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
maxHeight?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const ItemPanel = ({
|
|
14
|
+
label,
|
|
15
|
+
index = 0,
|
|
16
|
+
children,
|
|
17
|
+
maxHeight = '250px',
|
|
18
|
+
className,
|
|
19
|
+
}: ItemPanelProps) => {
|
|
20
|
+
const { addItemPanel, activePanelIndex } = useContext(MenuContext);
|
|
21
|
+
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
addItemPanel(index, label);
|
|
24
|
+
}, [addItemPanel, index, label]);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
activePanelIndex === index && (
|
|
28
|
+
<ScrollArea
|
|
29
|
+
style={{ scrollbarGutter: 'auto', maxHeight, height: '100%' }}
|
|
30
|
+
className={`flex flex-col ${className || ''}`}
|
|
31
|
+
>
|
|
32
|
+
{children}
|
|
33
|
+
</ScrollArea>
|
|
34
|
+
)
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default ItemPanel;
|