@ohif/ui-next 3.14.0-beta.12 → 3.14.0-beta.120
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,134 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tooltip, TooltipTrigger, TooltipContent } from '../Tooltip';
|
|
3
|
+
import { Icons } from '../Icons';
|
|
4
|
+
import { Button } from '../Button';
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
import { useIconPresentation } from '../../contextProviders/IconPresentationProvider';
|
|
7
|
+
|
|
8
|
+
const baseClasses = '!rounded-lg inline-flex items-center justify-center';
|
|
9
|
+
const defaultClasses = 'bg-transparent text-foreground/80 hover:bg-background hover:text-highlight';
|
|
10
|
+
const activeClasses = 'bg-highlight text-background hover:!bg-highlight/80';
|
|
11
|
+
const toggledClasses = 'bg-transparent text-highlight hover:bg-muted';
|
|
12
|
+
const disabledClasses =
|
|
13
|
+
'text-foreground hover:bg-muted hover:text-highlight opacity-40 cursor-not-allowed';
|
|
14
|
+
|
|
15
|
+
const sizeClasses = {
|
|
16
|
+
default: {
|
|
17
|
+
buttonSizeClass: 'w-10 h-10',
|
|
18
|
+
iconSizeClass: 'h-7 w-7',
|
|
19
|
+
},
|
|
20
|
+
small: {
|
|
21
|
+
buttonSizeClass: 'w-8 h-8',
|
|
22
|
+
iconSizeClass: 'h-6 w-6',
|
|
23
|
+
},
|
|
24
|
+
tiny: {
|
|
25
|
+
buttonSizeClass: 'w-6 h-6',
|
|
26
|
+
iconSizeClass: 'h-4 w-4',
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
interface ToolButtonProps {
|
|
31
|
+
id: string;
|
|
32
|
+
icon?: string;
|
|
33
|
+
label?: string;
|
|
34
|
+
tooltip?: string;
|
|
35
|
+
size?: 'default' | 'small';
|
|
36
|
+
isActive?: boolean;
|
|
37
|
+
isToggled?: boolean;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
disabledText?: string;
|
|
40
|
+
commands?: Record<string, unknown>;
|
|
41
|
+
onInteraction?: (details: { itemId: string; commands?: Record<string, unknown> }) => void;
|
|
42
|
+
className?: string;
|
|
43
|
+
children?: React.ReactNode;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function ToolButton(props: ToolButtonProps) {
|
|
47
|
+
const {
|
|
48
|
+
id,
|
|
49
|
+
icon = 'MissingIcon',
|
|
50
|
+
label,
|
|
51
|
+
tooltip,
|
|
52
|
+
size = 'default',
|
|
53
|
+
disabled = false,
|
|
54
|
+
isActive = false,
|
|
55
|
+
isToggled = false,
|
|
56
|
+
disabledText,
|
|
57
|
+
commands,
|
|
58
|
+
onInteraction,
|
|
59
|
+
className,
|
|
60
|
+
children,
|
|
61
|
+
} = props;
|
|
62
|
+
|
|
63
|
+
const { className: iconClassName } = useIconPresentation();
|
|
64
|
+
const { buttonSizeClass, iconSizeClass } = sizeClasses[size] || sizeClasses.default;
|
|
65
|
+
|
|
66
|
+
const buttonClasses = cn(
|
|
67
|
+
baseClasses,
|
|
68
|
+
buttonSizeClass,
|
|
69
|
+
disabled ? disabledClasses : isActive ? activeClasses : isToggled ? toggledClasses : defaultClasses,
|
|
70
|
+
className
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
const defaultTooltip = label;
|
|
74
|
+
const disabledTooltip = disabled && disabledText ? disabledText : null;
|
|
75
|
+
const hasSecondaryTooltip = tooltip || disabledTooltip;
|
|
76
|
+
|
|
77
|
+
const showTooltip = hasSecondaryTooltip || defaultTooltip;
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<Tooltip>
|
|
81
|
+
<TooltipTrigger
|
|
82
|
+
asChild
|
|
83
|
+
className={cn(disabled && 'cursor-not-allowed')}
|
|
84
|
+
>
|
|
85
|
+
{/* TooltipTrigger is a span since a disabled button does not fire events and the tooltip
|
|
86
|
+
will not show. */}
|
|
87
|
+
<span
|
|
88
|
+
data-cy={id}
|
|
89
|
+
data-tool={id}
|
|
90
|
+
data-active={isActive}
|
|
91
|
+
data-toggled={isToggled}
|
|
92
|
+
>
|
|
93
|
+
<Button
|
|
94
|
+
className={buttonClasses}
|
|
95
|
+
onClick={() => {
|
|
96
|
+
if (!disabled) {
|
|
97
|
+
onInteraction?.({ itemId: id, commands });
|
|
98
|
+
}
|
|
99
|
+
}}
|
|
100
|
+
variant="ghost"
|
|
101
|
+
size="icon"
|
|
102
|
+
aria-label={defaultTooltip}
|
|
103
|
+
disabled={disabled}
|
|
104
|
+
name={id}
|
|
105
|
+
>
|
|
106
|
+
{children || (
|
|
107
|
+
<Icons.ByName
|
|
108
|
+
name={icon}
|
|
109
|
+
className={iconClassName || iconSizeClass}
|
|
110
|
+
/>
|
|
111
|
+
)}
|
|
112
|
+
</Button>
|
|
113
|
+
</span>
|
|
114
|
+
</TooltipTrigger>
|
|
115
|
+
<TooltipContent
|
|
116
|
+
side="bottom"
|
|
117
|
+
className="text-wrap w-auto max-w-sm whitespace-normal break-words"
|
|
118
|
+
>
|
|
119
|
+
{showTooltip && (
|
|
120
|
+
<div className="space-y-1">
|
|
121
|
+
{defaultTooltip && <div className="text-sm">{defaultTooltip}</div>}
|
|
122
|
+
{disabledTooltip ? (
|
|
123
|
+
<div className="text-muted-foreground text-xs">{disabledTooltip}</div>
|
|
124
|
+
) : (
|
|
125
|
+
tooltip && <div className="text-muted-foreground text-xs">{tooltip}</div>
|
|
126
|
+
)}
|
|
127
|
+
</div>
|
|
128
|
+
)}
|
|
129
|
+
</TooltipContent>
|
|
130
|
+
</Tooltip>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export default ToolButton;
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button } from '../Button';
|
|
3
|
+
import { Icons } from '../Icons';
|
|
4
|
+
import {
|
|
5
|
+
DropdownMenu,
|
|
6
|
+
DropdownMenuContent,
|
|
7
|
+
DropdownMenuItem,
|
|
8
|
+
DropdownMenuTrigger,
|
|
9
|
+
} from '../DropdownMenu';
|
|
10
|
+
import { cn } from '../../lib/utils';
|
|
11
|
+
import { Tooltip, TooltipTrigger, TooltipContent } from '../Tooltip';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* ToolButtonList Component
|
|
15
|
+
* Root component that wraps the default and dropdown sections
|
|
16
|
+
* -----------------------------------------------
|
|
17
|
+
*/
|
|
18
|
+
interface ToolButtonListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const ToolButtonList = ({ className, children, ref, ...props }: ToolButtonListProps) => {
|
|
24
|
+
return (
|
|
25
|
+
<div
|
|
26
|
+
ref={ref}
|
|
27
|
+
className={cn('flex items-center', className)}
|
|
28
|
+
{...props}
|
|
29
|
+
>
|
|
30
|
+
{children}
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
ToolButtonList.displayName = 'ToolButtonList';
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* ToolButtonListDefault Component
|
|
38
|
+
* Container for the default/primary tool button
|
|
39
|
+
* -----------------------------------------------
|
|
40
|
+
*/
|
|
41
|
+
interface ToolButtonListDefaultProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
42
|
+
children?: React.ReactNode;
|
|
43
|
+
tooltip?: string;
|
|
44
|
+
disabledText?: string;
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const ToolButtonListDefault = ({
|
|
50
|
+
className,
|
|
51
|
+
children,
|
|
52
|
+
tooltip,
|
|
53
|
+
disabledText,
|
|
54
|
+
disabled,
|
|
55
|
+
ref,
|
|
56
|
+
...props
|
|
57
|
+
}: ToolButtonListDefaultProps) => {
|
|
58
|
+
const hasTooltip = tooltip || disabledText;
|
|
59
|
+
|
|
60
|
+
const defaultContent = (
|
|
61
|
+
<div
|
|
62
|
+
ref={ref}
|
|
63
|
+
className={cn('flex items-center', className)}
|
|
64
|
+
{...props}
|
|
65
|
+
>
|
|
66
|
+
{children}
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
if (!hasTooltip) {
|
|
71
|
+
return defaultContent;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<Tooltip>
|
|
76
|
+
<TooltipTrigger asChild>
|
|
77
|
+
<span>{defaultContent}</span>
|
|
78
|
+
</TooltipTrigger>
|
|
79
|
+
<TooltipContent side="bottom">
|
|
80
|
+
{tooltip && <div>{tooltip}</div>}
|
|
81
|
+
{disabledText && disabled && <div className="text-muted-foreground">{disabledText}</div>}
|
|
82
|
+
</TooltipContent>
|
|
83
|
+
</Tooltip>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
ToolButtonListDefault.displayName = 'ToolButtonListDefault';
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* ToolButtonListDropDown Component
|
|
90
|
+
* Container for the dropdown section with trigger and content
|
|
91
|
+
* -----------------------------------------------
|
|
92
|
+
*/
|
|
93
|
+
interface ToolButtonListDropDownProps {
|
|
94
|
+
children: React.ReactNode;
|
|
95
|
+
className?: string;
|
|
96
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const ToolButtonListDropDown = ({
|
|
100
|
+
children,
|
|
101
|
+
className,
|
|
102
|
+
ref,
|
|
103
|
+
...props
|
|
104
|
+
}: ToolButtonListDropDownProps) => (
|
|
105
|
+
<DropdownMenu {...props}>
|
|
106
|
+
<DropdownMenuTrigger asChild>
|
|
107
|
+
<Button
|
|
108
|
+
variant="ghost"
|
|
109
|
+
size="icon"
|
|
110
|
+
className={cn(
|
|
111
|
+
'text-foreground/80 hover:bg-background hover:text-highlight border-primary',
|
|
112
|
+
'inline-flex h-10 w-5 items-center justify-center',
|
|
113
|
+
'!rounded-tr-lg !rounded-br-lg !rounded-tl-none !rounded-bl-none',
|
|
114
|
+
'bg-transparent',
|
|
115
|
+
className
|
|
116
|
+
)}
|
|
117
|
+
>
|
|
118
|
+
<Icons.ByName
|
|
119
|
+
name="chevron-down"
|
|
120
|
+
className="text-primary h-5 w-5"
|
|
121
|
+
/>
|
|
122
|
+
</Button>
|
|
123
|
+
</DropdownMenuTrigger>
|
|
124
|
+
<DropdownMenuContent
|
|
125
|
+
ref={ref}
|
|
126
|
+
side="bottom"
|
|
127
|
+
align="start"
|
|
128
|
+
alignOffset={-40}
|
|
129
|
+
>
|
|
130
|
+
{children}
|
|
131
|
+
</DropdownMenuContent>
|
|
132
|
+
</DropdownMenu>
|
|
133
|
+
);
|
|
134
|
+
ToolButtonListDropDown.displayName = 'ToolButtonListDropDown';
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* ToolButtonListItem Component
|
|
138
|
+
* Individual item in the dropdown menu
|
|
139
|
+
* -----------------------------------------------
|
|
140
|
+
*/
|
|
141
|
+
/**
|
|
142
|
+
* Deliberately does not extend DropdownMenuItem's props, and the component
|
|
143
|
+
* forwards no rest object. Callers spread a whole toolbar button's
|
|
144
|
+
* componentProps onto this component, and Radix hands anything it does not
|
|
145
|
+
* recognise to a DOM element - so a service field such as evaluate or isActive
|
|
146
|
+
* would land as an attribute on a div. Naming what is forwarded keeps that
|
|
147
|
+
* closed against fields added to the toolbar service later.
|
|
148
|
+
*/
|
|
149
|
+
interface ToolButtonListItemProps {
|
|
150
|
+
icon?: string;
|
|
151
|
+
children?: React.ReactNode;
|
|
152
|
+
className?: string;
|
|
153
|
+
disabled?: boolean;
|
|
154
|
+
disabledText?: string;
|
|
155
|
+
tooltip?: string;
|
|
156
|
+
onSelect?: React.ComponentProps<typeof DropdownMenuItem>['onSelect'];
|
|
157
|
+
ref?: React.ComponentProps<typeof DropdownMenuItem>['ref'];
|
|
158
|
+
'data-cy'?: string;
|
|
159
|
+
'data-tool'?: string;
|
|
160
|
+
'data-active'?: boolean;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const ToolButtonListItem = ({
|
|
164
|
+
className,
|
|
165
|
+
children,
|
|
166
|
+
icon,
|
|
167
|
+
disabledText,
|
|
168
|
+
tooltip,
|
|
169
|
+
disabled,
|
|
170
|
+
onSelect,
|
|
171
|
+
ref,
|
|
172
|
+
'data-cy': dataCy,
|
|
173
|
+
'data-tool': dataTool,
|
|
174
|
+
'data-active': dataActive,
|
|
175
|
+
}: ToolButtonListItemProps) => {
|
|
176
|
+
const defaultTooltip = tooltip || (typeof children === 'string' ? children : undefined);
|
|
177
|
+
|
|
178
|
+
const menuItem = (
|
|
179
|
+
<DropdownMenuItem
|
|
180
|
+
ref={ref}
|
|
181
|
+
className={cn('flex items-center space-x-2', className)}
|
|
182
|
+
disabled={disabled}
|
|
183
|
+
onSelect={onSelect}
|
|
184
|
+
data-cy={dataCy}
|
|
185
|
+
data-tool={dataTool}
|
|
186
|
+
data-active={dataActive}
|
|
187
|
+
>
|
|
188
|
+
{icon && (
|
|
189
|
+
<Icons.ByName
|
|
190
|
+
name={icon || 'MissingIcon'}
|
|
191
|
+
className="h-6 w-6"
|
|
192
|
+
/>
|
|
193
|
+
)}
|
|
194
|
+
{children}
|
|
195
|
+
</DropdownMenuItem>
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
// Todo: there is a weird issue where i can't control the duration of the delay
|
|
199
|
+
// for the items in this list, causing the tooltip to show up too early in the
|
|
200
|
+
// dropdown menu. So i'm just removing the tooltip for list items unless the disabledText is set.
|
|
201
|
+
if (!disabled) {
|
|
202
|
+
return menuItem;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return (
|
|
206
|
+
<Tooltip>
|
|
207
|
+
<TooltipTrigger asChild>
|
|
208
|
+
<span>{menuItem}</span>
|
|
209
|
+
</TooltipTrigger>
|
|
210
|
+
<TooltipContent side="bottom">
|
|
211
|
+
{defaultTooltip && <div>{defaultTooltip}</div>}
|
|
212
|
+
{disabledText && disabled && <div className="text-muted-foreground">{disabledText}</div>}
|
|
213
|
+
</TooltipContent>
|
|
214
|
+
</Tooltip>
|
|
215
|
+
);
|
|
216
|
+
};
|
|
217
|
+
ToolButtonListItem.displayName = 'ToolButtonListItem';
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* ToolButtonListDivider Component
|
|
221
|
+
* Divider between items in the dropdown menu
|
|
222
|
+
* -----------------------------------------------
|
|
223
|
+
*/
|
|
224
|
+
const ToolButtonListDivider = ({
|
|
225
|
+
className,
|
|
226
|
+
ref,
|
|
227
|
+
...props
|
|
228
|
+
}: React.HTMLAttributes<HTMLDivElement> & { ref?: React.Ref<HTMLDivElement> }) => (
|
|
229
|
+
<div
|
|
230
|
+
ref={ref}
|
|
231
|
+
className={cn('bg-primary h-5 w-px self-center', className)}
|
|
232
|
+
{...props}
|
|
233
|
+
/>
|
|
234
|
+
);
|
|
235
|
+
ToolButtonListDivider.displayName = 'ToolButtonListDivider';
|
|
236
|
+
|
|
237
|
+
export {
|
|
238
|
+
ToolButtonList,
|
|
239
|
+
ToolButtonListDefault,
|
|
240
|
+
ToolButtonListDropDown,
|
|
241
|
+
ToolButtonListItem,
|
|
242
|
+
ToolButtonListDivider,
|
|
243
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
|
+
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
|
|
6
|
+
const TooltipProvider = TooltipPrimitive.Provider;
|
|
7
|
+
|
|
8
|
+
const Tooltip = TooltipPrimitive.Root;
|
|
9
|
+
|
|
10
|
+
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
11
|
+
|
|
12
|
+
const TooltipPortal = TooltipPrimitive.Portal;
|
|
13
|
+
|
|
14
|
+
const TooltipContent = ({
|
|
15
|
+
className,
|
|
16
|
+
sideOffset = 4,
|
|
17
|
+
ref,
|
|
18
|
+
...props
|
|
19
|
+
}: React.ComponentProps<typeof TooltipPrimitive.Content>) => (
|
|
20
|
+
<TooltipPortal>
|
|
21
|
+
<TooltipPrimitive.Content
|
|
22
|
+
ref={ref}
|
|
23
|
+
sideOffset={sideOffset}
|
|
24
|
+
className={cn(
|
|
25
|
+
'bg-muted border-input text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded border px-2 py-1.5 text-sm',
|
|
26
|
+
className
|
|
27
|
+
)}
|
|
28
|
+
{...props}
|
|
29
|
+
/>
|
|
30
|
+
</TooltipPortal>
|
|
31
|
+
);
|
|
32
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
33
|
+
|
|
34
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/* Scrollbar container */
|
|
2
|
+
.scrollbarContainer {
|
|
3
|
+
position: absolute;
|
|
4
|
+
right: 0;
|
|
5
|
+
top: 0;
|
|
6
|
+
height: 100%;
|
|
7
|
+
padding: 5px 5px 0 5px;
|
|
8
|
+
z-index: 10;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.scrollbarInner {
|
|
12
|
+
position: relative;
|
|
13
|
+
height: 100%;
|
|
14
|
+
width: 11px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* Apply these styles to any range input inside our component */
|
|
18
|
+
.scrollbarInput {
|
|
19
|
+
position: absolute;
|
|
20
|
+
left: 12px;
|
|
21
|
+
top: 0;
|
|
22
|
+
height: 12px;
|
|
23
|
+
transform: rotate(90deg);
|
|
24
|
+
transform-origin: top left;
|
|
25
|
+
-webkit-appearance: none;
|
|
26
|
+
-moz-appearance: none;
|
|
27
|
+
appearance: none;
|
|
28
|
+
background-color: transparent;
|
|
29
|
+
padding: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Thumb styles for WebKit browsers - more specific selector */
|
|
33
|
+
input[type='range'].scrollbarInput::-webkit-slider-thumb {
|
|
34
|
+
-webkit-appearance: none !important;
|
|
35
|
+
background-color: hsl(var(--neutral));
|
|
36
|
+
opacity: 50%;
|
|
37
|
+
border: none;
|
|
38
|
+
border-radius: 57px;
|
|
39
|
+
cursor: -webkit-grab;
|
|
40
|
+
height: 8px;
|
|
41
|
+
margin-top: -4px;
|
|
42
|
+
width: 32px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
input[type='range'].scrollbarInput::-webkit-slider-thumb:active,
|
|
46
|
+
input[type='range'].scrollbarInput::-webkit-slider-thumb:hover {
|
|
47
|
+
background-color: hsl(var(--primary));
|
|
48
|
+
opacity: 60%;
|
|
49
|
+
cursor: -webkit-grabbing;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* Thumb styles for Firefox - more specific selector */
|
|
53
|
+
input[type='range'].scrollbarInput::-moz-range-thumb {
|
|
54
|
+
background-color: hsl(var(--neutral));
|
|
55
|
+
opacity: 50%;
|
|
56
|
+
border: none;
|
|
57
|
+
border-radius: 57px;
|
|
58
|
+
cursor: -moz-grab;
|
|
59
|
+
height: 12px;
|
|
60
|
+
width: 39px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
input[type='range'].scrollbarInput::-moz-range-thumb:active,
|
|
64
|
+
input[type='range'].scrollbarInput::-moz-range-thumb:hover {
|
|
65
|
+
background-color: hsl(var(--primary));
|
|
66
|
+
opacity: 50%;
|
|
67
|
+
cursor: -moz-grabbing;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Track styles for WebKit browsers - more specific selector */
|
|
71
|
+
input[type='range'].scrollbarInput::-webkit-slider-runnable-track {
|
|
72
|
+
background-color: transparent;
|
|
73
|
+
border: none;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
height: 5px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* Track styles for Firefox - more specific selector */
|
|
79
|
+
input[type='range'].scrollbarInput::-moz-range-track {
|
|
80
|
+
background-color: transparent;
|
|
81
|
+
border: none;
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
height: 2px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Ensure focus doesn't show an outline */
|
|
87
|
+
.scrollbarInput:focus {
|
|
88
|
+
outline: none;
|
|
89
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { cn } from '../../lib/utils';
|
|
3
|
+
import styles from './ImageScrollbar.module.css';
|
|
4
|
+
|
|
5
|
+
const preventDefault = (e: React.MouseEvent) => e.preventDefault();
|
|
6
|
+
|
|
7
|
+
export interface ImageScrollbarProps {
|
|
8
|
+
value: number;
|
|
9
|
+
max: number;
|
|
10
|
+
height: string;
|
|
11
|
+
onChange: (value: number) => void;
|
|
12
|
+
onContextMenu?: (e: React.MouseEvent) => void;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const ImageScrollbar: React.FC<ImageScrollbarProps> = ({
|
|
17
|
+
value,
|
|
18
|
+
max,
|
|
19
|
+
height,
|
|
20
|
+
onChange,
|
|
21
|
+
onContextMenu = preventDefault,
|
|
22
|
+
className = '',
|
|
23
|
+
}) => {
|
|
24
|
+
if (max === 0) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const style = {
|
|
29
|
+
width: height, // This is intentional for the rotation
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
33
|
+
const intValue = parseInt(event.target.value, 10);
|
|
34
|
+
onChange(intValue);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const handleKeyDown = (event: React.KeyboardEvent) => {
|
|
38
|
+
// We don't allow direct keyboard navigation (arrow keys)
|
|
39
|
+
const keys = {
|
|
40
|
+
DOWN: 40,
|
|
41
|
+
UP: 38,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
if (event.which === keys.DOWN || event.which === keys.UP) {
|
|
45
|
+
event.preventDefault();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<div
|
|
51
|
+
className={cn(styles.scrollbarContainer, className)}
|
|
52
|
+
onContextMenu={onContextMenu}
|
|
53
|
+
>
|
|
54
|
+
<div className={styles.scrollbarInner}>
|
|
55
|
+
<input
|
|
56
|
+
className={cn(styles.scrollbarInput, 'mousetrap imageSlider')}
|
|
57
|
+
style={style}
|
|
58
|
+
type="range"
|
|
59
|
+
min="0"
|
|
60
|
+
max={max}
|
|
61
|
+
step="1"
|
|
62
|
+
value={value}
|
|
63
|
+
onChange={handleChange}
|
|
64
|
+
onKeyDown={handleKeyDown}
|
|
65
|
+
aria-label="Image navigation scrollbar"
|
|
66
|
+
data-testid="image-scrollbar-input"
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
};
|