@ohif/ui-next 3.14.0-beta.10 → 3.14.0-beta.101
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 +15 -0
- package/src/components/SegmentationTable/index.ts +24 -0
- package/src/components/Select/Select.tsx +167 -0
- package/src/components/Select/index.tsx +40 -0
- package/src/components/Separator/Separator.tsx +32 -0
- package/src/components/Separator/index.ts +3 -0
- package/src/components/Separator/index.tsx +3 -0
- package/src/components/SidePanel/SidePanel.tsx +479 -0
- package/src/components/SidePanel/index.ts +2 -0
- package/src/components/Slider/Slider.tsx +24 -0
- package/src/components/Slider/index.tsx +3 -0
- package/src/components/SmartScrollbar/SmartScrollbar.tsx +349 -0
- package/src/components/SmartScrollbar/SmartScrollbarEndpoints.tsx +82 -0
- package/src/components/SmartScrollbar/SmartScrollbarFill.tsx +54 -0
- package/src/components/SmartScrollbar/SmartScrollbarIndicator.tsx +59 -0
- package/src/components/SmartScrollbar/SmartScrollbarTrack.tsx +104 -0
- package/src/components/SmartScrollbar/defaultSmartScrollbarIndicatorConfig.tsx +48 -0
- package/src/components/SmartScrollbar/index.ts +11 -0
- package/src/components/SmartScrollbar/useByteArray.ts +146 -0
- package/src/components/SmartScrollbar/utils.test.ts +124 -0
- package/src/components/SmartScrollbar/utils.ts +168 -0
- package/src/components/Sonner/Sonner.tsx +31 -0
- package/src/components/Sonner/index.ts +4 -0
- package/src/components/StudyBrowser/StudyBrowser.tsx +89 -0
- package/src/components/StudyBrowser/index.ts +2 -0
- package/src/components/StudyBrowserSort/StudyBrowserSort.tsx +87 -0
- package/src/components/StudyBrowserSort/index.ts +3 -0
- package/src/components/StudyBrowserViewOptions/StudyBrowserViewOptions.tsx +50 -0
- package/src/components/StudyBrowserViewOptions/index.ts +3 -0
- package/src/components/StudyItem/StudyItem.tsx +100 -0
- package/src/components/StudyItem/index.ts +2 -0
- package/src/components/StudyList/columns/defaultColumns.tsx +258 -0
- package/src/components/StudyList/components/ActionCell.tsx +19 -0
- package/src/components/StudyList/components/Layout.tsx +206 -0
- package/src/components/StudyList/components/PreviewContainer.tsx +45 -0
- package/src/components/StudyList/components/PreviewContent.tsx +186 -0
- package/src/components/StudyList/components/PreviewHeader.tsx +5 -0
- package/src/components/StudyList/components/PreviewPatientSummary.tsx +224 -0
- package/src/components/StudyList/components/PreviewSeriesList.tsx +64 -0
- package/src/components/StudyList/components/PreviewToggleButton.tsx +69 -0
- package/src/components/StudyList/components/SettingsPopover.tsx +214 -0
- package/src/components/StudyList/components/Table.tsx +247 -0
- package/src/components/StudyList/components/WorkflowMenu.tsx +72 -0
- package/src/components/StudyList/components/WorkflowsProvider.tsx +169 -0
- package/src/components/StudyList/hooks/useDefaultWorkflow.ts +60 -0
- package/src/components/StudyList/index.ts +52 -0
- package/src/components/StudyList/types/types.ts +42 -0
- package/src/components/StudyList/utils/tokenizeModalities.ts +6 -0
- package/src/components/StudySummary/StudySummary.tsx +27 -0
- package/src/components/StudySummary/index.tsx +3 -0
- package/src/components/Switch/Switch.tsx +28 -0
- package/src/components/Switch/index.tsx +3 -0
- package/src/components/Table/Table.tsx +134 -0
- package/src/components/Table/index.ts +11 -0
- package/src/components/Tabs/Tabs.tsx +56 -0
- package/src/components/Tabs/index.ts +3 -0
- package/src/components/Tabs/index.tsx +3 -0
- package/src/components/ThemeWrapper/ThemeWrapper.tsx +5 -0
- package/src/components/ThemeWrapper/index.ts +1 -0
- package/src/components/Thumbnail/Thumbnail.test.ts +71 -0
- package/src/components/Thumbnail/Thumbnail.tsx +351 -0
- package/src/components/Thumbnail/index.ts +2 -0
- package/src/components/ThumbnailList/ThumbnailList.tsx +94 -0
- package/src/components/ThumbnailList/index.ts +2 -0
- package/src/components/Toggle/Toggle.tsx +45 -0
- package/src/components/Toggle/index.ts +3 -0
- package/src/components/Toggle/index.tsx +3 -0
- package/src/components/ToggleGroup/ToggleGroup.tsx +63 -0
- package/src/components/ToggleGroup/index.ts +3 -0
- package/src/components/ToolButton/ToolButton.tsx +134 -0
- package/src/components/ToolButton/ToolButtonList.tsx +243 -0
- package/src/components/ToolButton/index.ts +8 -0
- package/src/components/Tooltip/Tooltip.tsx +34 -0
- package/src/components/Tooltip/index.ts +3 -0
- package/src/components/Viewport/ImageScrollbar.module.css +89 -0
- package/src/components/Viewport/ImageScrollbar.tsx +71 -0
- package/src/components/Viewport/PatientInfo.tsx +126 -0
- package/src/components/Viewport/ViewportActionArrows.tsx +36 -0
- package/src/components/Viewport/ViewportActionBar.tsx +107 -0
- package/src/components/Viewport/ViewportActionButton.tsx +25 -0
- package/src/components/Viewport/ViewportActionCorners.tsx +171 -0
- package/src/components/Viewport/ViewportGrid.tsx +24 -0
- package/src/components/Viewport/ViewportOverlay.css +32 -0
- package/src/components/Viewport/ViewportOverlay.tsx +54 -0
- package/src/components/Viewport/ViewportPane.tsx +82 -0
- package/src/components/Viewport/index.ts +9 -0
- package/src/components/ViewportDialog/ViewportDialog.tsx +128 -0
- package/src/components/ViewportDialog/index.ts +2 -0
- package/src/components/index.ts +323 -0
- package/src/contextProviders/ActiveThemeProvider.tsx +204 -0
- package/src/contextProviders/CineProvider.tsx +98 -0
- package/src/contextProviders/DialogProvider.tsx +103 -0
- package/src/contextProviders/DragAndDropProvider.tsx +37 -0
- package/src/contextProviders/IconPresentationProvider.tsx +88 -0
- package/src/contextProviders/ImageViewerProvider.tsx +15 -0
- package/src/contextProviders/ManagedDialog.tsx +176 -0
- package/src/contextProviders/ModalProvider.tsx +102 -0
- package/src/contextProviders/NotificationProvider.tsx +246 -0
- package/src/contextProviders/UserAuthenticationProvider.tsx +118 -0
- package/src/contextProviders/ViewportDialogProvider.tsx +42 -0
- package/src/contextProviders/ViewportGridProvider.tsx +556 -0
- package/src/contextProviders/index.ts +26 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useDynamicMaxHeight.ts +105 -0
- package/src/hooks/useSessionStorage.test.js +103 -0
- package/src/hooks/useSessionStorage.tsx +71 -0
- package/src/index.ts +7 -0
- package/src/lib/utils.ts +6 -0
- package/src/tailwind.css +266 -0
- package/src/themes/arctic.json +31 -0
- package/src/themes/deep.json +31 -0
- package/src/themes/index.ts +16 -0
- package/src/themes/midnight.json +31 -0
- package/src/themes/orchid.json +31 -0
- package/src/themes/slate.json +31 -0
- package/src/themes/themes.css +206 -0
- package/src/themes/verdant.json +31 -0
- package/src/types/ActionCorners.ts +18 -0
- package/src/types/AppTypes.ts +24 -0
- package/src/types/ContextMenuItem.ts +9 -0
- package/src/types/Predicate.ts +1 -0
- package/src/types/ThumbnailType.ts +3 -0
- package/src/types/ViewportActionCornersTypes.ts +13 -0
- package/src/types/global.d.ts +4 -0
- package/src/types/index.ts +21 -0
- package/src/utils/formatDICOMDate.test.ts +61 -0
- package/src/utils/formatDICOMDate.ts +65 -0
- package/src/utils/formatDICOMTime.test.ts +62 -0
- package/src/utils/formatDICOMTime.ts +49 -0
- package/src/utils/getToggledClassName.tsx +5 -0
- package/src/utils/index.ts +15 -0
- package/src/utils/parseStudyDateTimestamp.test.ts +47 -0
- package/src/utils/parseStudyDateTimestamp.ts +27 -0
- package/src/utils/roundNumber.ts +43 -0
- package/tailwind.config.js +120 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';
|
|
3
|
+
import { DayButton, DayPicker, getDefaultClassNames } from 'react-day-picker';
|
|
4
|
+
import type { Locale } from 'react-day-picker';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import {
|
|
7
|
+
ar as arLocale,
|
|
8
|
+
ca as caLocale,
|
|
9
|
+
de as deLocale,
|
|
10
|
+
enUS,
|
|
11
|
+
fr as frLocale,
|
|
12
|
+
ja as jaLocale,
|
|
13
|
+
nl as nlLocale,
|
|
14
|
+
ptBR as ptBRLocale,
|
|
15
|
+
ru as ruLocale,
|
|
16
|
+
tr as trLocale,
|
|
17
|
+
vi as viLocale,
|
|
18
|
+
zhCN as zhLocale,
|
|
19
|
+
} from 'react-day-picker/locale';
|
|
20
|
+
|
|
21
|
+
import { cn } from '../../lib/utils';
|
|
22
|
+
import { Button, buttonVariants } from '../Button';
|
|
23
|
+
|
|
24
|
+
const LOCALE_MAP: Record<string, Locale> = {
|
|
25
|
+
en: enUS,
|
|
26
|
+
'en-US': enUS,
|
|
27
|
+
fr: frLocale,
|
|
28
|
+
'fr-FR': frLocale,
|
|
29
|
+
ar: arLocale,
|
|
30
|
+
ca: caLocale,
|
|
31
|
+
de: deLocale,
|
|
32
|
+
'ja-JP': jaLocale,
|
|
33
|
+
ja: jaLocale,
|
|
34
|
+
nl: nlLocale,
|
|
35
|
+
'pt-BR': ptBRLocale,
|
|
36
|
+
pt: ptBRLocale,
|
|
37
|
+
ru: ruLocale,
|
|
38
|
+
'tr-TR': trLocale,
|
|
39
|
+
tr: trLocale,
|
|
40
|
+
vi: viLocale,
|
|
41
|
+
zh: zhLocale,
|
|
42
|
+
'zh-CN': zhLocale,
|
|
43
|
+
'zh-cn': zhLocale,
|
|
44
|
+
'test-LNG': enUS,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// Tailwind arbitrary variants targeting react-day-picker's internal class names.
|
|
48
|
+
// `String.raw` keeps the backslash that escapes the underscore, and the two live
|
|
49
|
+
// at module scope because the compiler cannot lower a tagged template whose
|
|
50
|
+
// cooked value differs from its raw value.
|
|
51
|
+
const RTL_NEXT_ARROW = String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`;
|
|
52
|
+
const RTL_PREVIOUS_ARROW = String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`;
|
|
53
|
+
|
|
54
|
+
function Calendar({
|
|
55
|
+
className,
|
|
56
|
+
classNames,
|
|
57
|
+
showOutsideDays = true,
|
|
58
|
+
captionLayout = 'label',
|
|
59
|
+
buttonVariant = 'ghost',
|
|
60
|
+
formatters,
|
|
61
|
+
components,
|
|
62
|
+
locale: localeProp,
|
|
63
|
+
...props
|
|
64
|
+
}: React.ComponentProps<typeof DayPicker> & {
|
|
65
|
+
buttonVariant?: React.ComponentProps<typeof Button>['variant'];
|
|
66
|
+
}) {
|
|
67
|
+
const { i18n } = useTranslation('DatePicker');
|
|
68
|
+
const defaultClassNames = getDefaultClassNames();
|
|
69
|
+
|
|
70
|
+
const lang = i18n.language || 'en';
|
|
71
|
+
const locale = localeProp || (LOCALE_MAP[lang] ?? enUS);
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<DayPicker
|
|
75
|
+
showOutsideDays={showOutsideDays}
|
|
76
|
+
locale={locale}
|
|
77
|
+
className={cn(
|
|
78
|
+
'bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent',
|
|
79
|
+
RTL_NEXT_ARROW,
|
|
80
|
+
RTL_PREVIOUS_ARROW,
|
|
81
|
+
className
|
|
82
|
+
)}
|
|
83
|
+
captionLayout={captionLayout}
|
|
84
|
+
formatters={{
|
|
85
|
+
formatMonthDropdown: date => date.toLocaleString('default', { month: 'short' }),
|
|
86
|
+
...formatters,
|
|
87
|
+
}}
|
|
88
|
+
classNames={{
|
|
89
|
+
root: cn('w-fit min-w-[255px]', defaultClassNames.root),
|
|
90
|
+
months: cn('relative flex flex-col gap-4 md:flex-row', defaultClassNames.months),
|
|
91
|
+
month: cn('flex w-full flex-col gap-4', defaultClassNames.month),
|
|
92
|
+
nav: cn(
|
|
93
|
+
'absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1',
|
|
94
|
+
defaultClassNames.nav
|
|
95
|
+
),
|
|
96
|
+
button_previous: cn(
|
|
97
|
+
buttonVariants({ variant: buttonVariant }),
|
|
98
|
+
'size-[--cell-size] select-none p-0 aria-disabled:opacity-50',
|
|
99
|
+
defaultClassNames.button_previous
|
|
100
|
+
),
|
|
101
|
+
button_next: cn(
|
|
102
|
+
buttonVariants({ variant: buttonVariant }),
|
|
103
|
+
'size-[--cell-size] select-none p-0 aria-disabled:opacity-50',
|
|
104
|
+
defaultClassNames.button_next
|
|
105
|
+
),
|
|
106
|
+
month_caption: cn(
|
|
107
|
+
'flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]',
|
|
108
|
+
defaultClassNames.month_caption
|
|
109
|
+
),
|
|
110
|
+
dropdowns: cn(
|
|
111
|
+
'flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium',
|
|
112
|
+
defaultClassNames.dropdowns
|
|
113
|
+
),
|
|
114
|
+
dropdown_root: cn(
|
|
115
|
+
'relative rounded-md border border-input',
|
|
116
|
+
defaultClassNames.dropdown_root
|
|
117
|
+
),
|
|
118
|
+
// The native <select> is invisible, but browsers paint its option popup
|
|
119
|
+
// using this element's own colors — not inherited, and unaffected by
|
|
120
|
+
// opacity-0. Set them explicitly or the popup falls back to a browser
|
|
121
|
+
// default background, leaving the theme's near-white text unreadable.
|
|
122
|
+
dropdown: cn(
|
|
123
|
+
'bg-popover text-popover-foreground absolute inset-0 opacity-0',
|
|
124
|
+
defaultClassNames.dropdown
|
|
125
|
+
),
|
|
126
|
+
caption_label: cn(
|
|
127
|
+
'select-none font-medium',
|
|
128
|
+
captionLayout === 'label'
|
|
129
|
+
? 'text-sm'
|
|
130
|
+
: '[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5',
|
|
131
|
+
defaultClassNames.caption_label
|
|
132
|
+
),
|
|
133
|
+
table: 'w-full border-collapse',
|
|
134
|
+
weekdays: cn('flex', defaultClassNames.weekdays),
|
|
135
|
+
weekday: cn(
|
|
136
|
+
'text-muted-foreground flex-1 rounded-md text-[0.8rem] font-normal',
|
|
137
|
+
defaultClassNames.weekday
|
|
138
|
+
),
|
|
139
|
+
week: cn('mt-2 flex w-full', defaultClassNames.week),
|
|
140
|
+
week_number_header: cn('w-[--cell-size] select-none', defaultClassNames.week_number_header),
|
|
141
|
+
week_number: cn(
|
|
142
|
+
'text-muted-foreground select-none text-[0.8rem]',
|
|
143
|
+
defaultClassNames.week_number
|
|
144
|
+
),
|
|
145
|
+
day: cn(
|
|
146
|
+
'group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md',
|
|
147
|
+
defaultClassNames.day
|
|
148
|
+
),
|
|
149
|
+
range_start: cn('bg-accent rounded-l-md', defaultClassNames.range_start),
|
|
150
|
+
range_middle: cn('rounded-none', defaultClassNames.range_middle),
|
|
151
|
+
range_end: cn('bg-accent rounded-r-md', defaultClassNames.range_end),
|
|
152
|
+
today: cn(
|
|
153
|
+
'bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none',
|
|
154
|
+
defaultClassNames.today
|
|
155
|
+
),
|
|
156
|
+
outside: cn(
|
|
157
|
+
'text-muted-foreground aria-selected:text-muted-foreground',
|
|
158
|
+
defaultClassNames.outside
|
|
159
|
+
),
|
|
160
|
+
disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),
|
|
161
|
+
hidden: cn('invisible', defaultClassNames.hidden),
|
|
162
|
+
...classNames,
|
|
163
|
+
}}
|
|
164
|
+
components={{
|
|
165
|
+
Root: ({ className, rootRef, ...props }) => {
|
|
166
|
+
return (
|
|
167
|
+
<div
|
|
168
|
+
data-slot="calendar"
|
|
169
|
+
ref={rootRef}
|
|
170
|
+
className={cn(className)}
|
|
171
|
+
{...props}
|
|
172
|
+
/>
|
|
173
|
+
);
|
|
174
|
+
},
|
|
175
|
+
Chevron: ({ className, orientation, ...props }) => {
|
|
176
|
+
if (orientation === 'left') {
|
|
177
|
+
return (
|
|
178
|
+
<ChevronLeftIcon
|
|
179
|
+
className={cn('size-4', className)}
|
|
180
|
+
{...props}
|
|
181
|
+
/>
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (orientation === 'right') {
|
|
186
|
+
return (
|
|
187
|
+
<ChevronRightIcon
|
|
188
|
+
className={cn('size-4', className)}
|
|
189
|
+
{...props}
|
|
190
|
+
/>
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return (
|
|
195
|
+
<ChevronDownIcon
|
|
196
|
+
className={cn('size-4', className)}
|
|
197
|
+
{...props}
|
|
198
|
+
/>
|
|
199
|
+
);
|
|
200
|
+
},
|
|
201
|
+
DayButton: CalendarDayButton,
|
|
202
|
+
WeekNumber: ({ children, ...props }) => {
|
|
203
|
+
return (
|
|
204
|
+
<td {...props}>
|
|
205
|
+
<div className="size-[--cell-size] flex items-center justify-center text-center">
|
|
206
|
+
{children}
|
|
207
|
+
</div>
|
|
208
|
+
</td>
|
|
209
|
+
);
|
|
210
|
+
},
|
|
211
|
+
...components,
|
|
212
|
+
}}
|
|
213
|
+
{...props}
|
|
214
|
+
/>
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function CalendarDayButton({
|
|
219
|
+
className,
|
|
220
|
+
day,
|
|
221
|
+
modifiers,
|
|
222
|
+
...props
|
|
223
|
+
}: React.ComponentProps<typeof DayButton>) {
|
|
224
|
+
const defaultClassNames = getDefaultClassNames();
|
|
225
|
+
|
|
226
|
+
const ref = React.useRef<HTMLButtonElement>(null);
|
|
227
|
+
React.useEffect(() => {
|
|
228
|
+
if (modifiers.focused) {
|
|
229
|
+
ref.current?.focus();
|
|
230
|
+
}
|
|
231
|
+
}, [modifiers.focused]);
|
|
232
|
+
|
|
233
|
+
return (
|
|
234
|
+
<Button
|
|
235
|
+
ref={ref}
|
|
236
|
+
variant="ghost"
|
|
237
|
+
size="icon"
|
|
238
|
+
data-day={day.date.toLocaleDateString()}
|
|
239
|
+
data-selected-single={
|
|
240
|
+
modifiers.selected &&
|
|
241
|
+
!modifiers.range_start &&
|
|
242
|
+
!modifiers.range_end &&
|
|
243
|
+
!modifiers.range_middle
|
|
244
|
+
}
|
|
245
|
+
data-range-start={modifiers.range_start}
|
|
246
|
+
data-range-end={modifiers.range_end}
|
|
247
|
+
data-range-middle={modifiers.range_middle}
|
|
248
|
+
className={cn(
|
|
249
|
+
'data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70',
|
|
250
|
+
defaultClassNames.day,
|
|
251
|
+
className
|
|
252
|
+
)}
|
|
253
|
+
{...props}
|
|
254
|
+
/>
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export { Calendar, CalendarDayButton };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
|
|
5
|
+
const Card = ({
|
|
6
|
+
className,
|
|
7
|
+
ref,
|
|
8
|
+
...props
|
|
9
|
+
}: React.HTMLAttributes<HTMLDivElement> & { ref?: React.Ref<HTMLDivElement> }) => (
|
|
10
|
+
<div
|
|
11
|
+
ref={ref}
|
|
12
|
+
className={cn('bg-card text-card-foreground border-input rounded-lg border shadow', className)}
|
|
13
|
+
{...props}
|
|
14
|
+
/>
|
|
15
|
+
);
|
|
16
|
+
Card.displayName = 'Card';
|
|
17
|
+
|
|
18
|
+
const CardHeader = ({
|
|
19
|
+
className,
|
|
20
|
+
ref,
|
|
21
|
+
...props
|
|
22
|
+
}: React.HTMLAttributes<HTMLDivElement> & { ref?: React.Ref<HTMLDivElement> }) => (
|
|
23
|
+
<div
|
|
24
|
+
ref={ref}
|
|
25
|
+
className={cn('flex flex-col space-y-1.5 p-6', className)}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
CardHeader.displayName = 'CardHeader';
|
|
30
|
+
|
|
31
|
+
const CardTitle = ({
|
|
32
|
+
className,
|
|
33
|
+
ref,
|
|
34
|
+
...props
|
|
35
|
+
}: React.HTMLAttributes<HTMLHeadingElement> & { ref?: React.Ref<HTMLHeadingElement> }) => (
|
|
36
|
+
<h3
|
|
37
|
+
ref={ref}
|
|
38
|
+
className={cn('font-semibold leading-none tracking-tight', className)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
);
|
|
42
|
+
CardTitle.displayName = 'CardTitle';
|
|
43
|
+
|
|
44
|
+
const CardDescription = ({
|
|
45
|
+
className,
|
|
46
|
+
ref,
|
|
47
|
+
...props
|
|
48
|
+
}: React.HTMLAttributes<HTMLParagraphElement> & { ref?: React.Ref<HTMLParagraphElement> }) => (
|
|
49
|
+
<p
|
|
50
|
+
ref={ref}
|
|
51
|
+
className={cn('text-muted-foreground text-base', className)}
|
|
52
|
+
{...props}
|
|
53
|
+
/>
|
|
54
|
+
);
|
|
55
|
+
CardDescription.displayName = 'CardDescription';
|
|
56
|
+
|
|
57
|
+
const CardContent = ({
|
|
58
|
+
className,
|
|
59
|
+
ref,
|
|
60
|
+
...props
|
|
61
|
+
}: React.HTMLAttributes<HTMLDivElement> & { ref?: React.Ref<HTMLDivElement> }) => (
|
|
62
|
+
<div
|
|
63
|
+
ref={ref}
|
|
64
|
+
className={cn('p-6 pt-0', className)}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
|
+
CardContent.displayName = 'CardContent';
|
|
69
|
+
|
|
70
|
+
const CardFooter = ({
|
|
71
|
+
className,
|
|
72
|
+
ref,
|
|
73
|
+
...props
|
|
74
|
+
}: React.HTMLAttributes<HTMLDivElement> & { ref?: React.Ref<HTMLDivElement> }) => (
|
|
75
|
+
<div
|
|
76
|
+
ref={ref}
|
|
77
|
+
className={cn('flex items-center p-6 pt-0', className)}
|
|
78
|
+
{...props}
|
|
79
|
+
/>
|
|
80
|
+
);
|
|
81
|
+
CardFooter.displayName = 'CardFooter';
|
|
82
|
+
|
|
83
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
3
|
+
import { CheckIcon } from '@radix-ui/react-icons';
|
|
4
|
+
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
|
|
7
|
+
const Checkbox = ({
|
|
8
|
+
className,
|
|
9
|
+
ref,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof CheckboxPrimitive.Root>) => (
|
|
12
|
+
<CheckboxPrimitive.Root
|
|
13
|
+
ref={ref}
|
|
14
|
+
className={cn(
|
|
15
|
+
'border-primary hover:bg-primary/20 focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground peer h-4 w-4 shrink-0 rounded-sm border shadow focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50',
|
|
16
|
+
className
|
|
17
|
+
)}
|
|
18
|
+
{...props}
|
|
19
|
+
>
|
|
20
|
+
<CheckboxPrimitive.Indicator className={cn('text-background flex items-center justify-center')}>
|
|
21
|
+
<CheckIcon className="h-4 w-4" />
|
|
22
|
+
</CheckboxPrimitive.Indicator>
|
|
23
|
+
</CheckboxPrimitive.Root>
|
|
24
|
+
);
|
|
25
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
26
|
+
|
|
27
|
+
export { Checkbox };
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import React, { useEffect, useState, useCallback } from 'react';
|
|
2
|
+
import debounce from 'lodash.debounce';
|
|
3
|
+
|
|
4
|
+
import { Icons } from '@ohif/ui-next';
|
|
5
|
+
import { Popover, PopoverContent, PopoverTrigger } from '../Popover/Popover';
|
|
6
|
+
import { Button } from '../Button/Button';
|
|
7
|
+
import { Numeric } from '../Numeric/Numeric';
|
|
8
|
+
|
|
9
|
+
export type CinePlayerProps = {
|
|
10
|
+
className: string;
|
|
11
|
+
isPlaying: boolean;
|
|
12
|
+
minFrameRate?: number;
|
|
13
|
+
maxFrameRate?: number;
|
|
14
|
+
stepFrameRate?: number;
|
|
15
|
+
frameRate?: number;
|
|
16
|
+
onFrameRateChange: (value: number) => void;
|
|
17
|
+
onPlayPauseChange: (value: boolean) => void;
|
|
18
|
+
onClose: () => void;
|
|
19
|
+
updateDynamicInfo?: (info: any) => void;
|
|
20
|
+
dynamicInfo?: {
|
|
21
|
+
dimensionGroupNumber: number;
|
|
22
|
+
numDimensionGroups: number;
|
|
23
|
+
label?: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const CinePlayer: React.FC<CinePlayerProps> = ({
|
|
28
|
+
className,
|
|
29
|
+
isPlaying = false,
|
|
30
|
+
minFrameRate = 1,
|
|
31
|
+
maxFrameRate = 90,
|
|
32
|
+
stepFrameRate = 1,
|
|
33
|
+
frameRate: defaultFrameRate = 24,
|
|
34
|
+
onFrameRateChange = () => {},
|
|
35
|
+
onPlayPauseChange = () => {},
|
|
36
|
+
onClose = () => {},
|
|
37
|
+
dynamicInfo = {},
|
|
38
|
+
updateDynamicInfo,
|
|
39
|
+
}) => {
|
|
40
|
+
const isDynamic = !!dynamicInfo?.numDimensionGroups;
|
|
41
|
+
const [frameRate, setFrameRate] = useState(defaultFrameRate);
|
|
42
|
+
const [popoverOpen, setPopoverOpen] = useState(false);
|
|
43
|
+
// Plain call: the React Compiler caches the debounced wrapper keyed on
|
|
44
|
+
// onFrameRateChange — the same invalidation the old useCallback deps gave it.
|
|
45
|
+
const debouncedSetFrameRate = debounce(onFrameRateChange, 100);
|
|
46
|
+
|
|
47
|
+
const getPlayPauseIconName = () => (isPlaying ? 'icon-pause' : 'icon-play');
|
|
48
|
+
|
|
49
|
+
const handleSetFrameRate = (frameRate: number) => {
|
|
50
|
+
if (frameRate < minFrameRate || frameRate > maxFrameRate) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
setFrameRate(frameRate);
|
|
54
|
+
debouncedSetFrameRate(frameRate);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
setFrameRate(defaultFrameRate);
|
|
59
|
+
}, [defaultFrameRate]);
|
|
60
|
+
|
|
61
|
+
const handleDimensionGroupNumberChange = useCallback(
|
|
62
|
+
(newGroupNumber: number) => {
|
|
63
|
+
if (isDynamic && dynamicInfo) {
|
|
64
|
+
updateDynamicInfo?.({
|
|
65
|
+
...dynamicInfo,
|
|
66
|
+
dimensionGroupNumber: newGroupNumber,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
[isDynamic, dynamicInfo, updateDynamicInfo]
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<div
|
|
75
|
+
className={`pointer-events-none absolute top-10 left-1/2 z-50 -translate-x-1/2 ${className}`}
|
|
76
|
+
>
|
|
77
|
+
<div
|
|
78
|
+
className={
|
|
79
|
+
'bg-muted pointer-events-auto inline-flex select-none items-center gap-2 rounded-md px-2 py-2'
|
|
80
|
+
}
|
|
81
|
+
>
|
|
82
|
+
<Button
|
|
83
|
+
variant="ghost"
|
|
84
|
+
size="icon"
|
|
85
|
+
onClick={() => onPlayPauseChange(!isPlaying)}
|
|
86
|
+
data-cy={'cine-player-play-pause'}
|
|
87
|
+
>
|
|
88
|
+
<Icons.ByName name={getPlayPauseIconName()} />
|
|
89
|
+
</Button>
|
|
90
|
+
|
|
91
|
+
{isDynamic && dynamicInfo && (
|
|
92
|
+
<div className="min-w-16 max-w-44 text-foreground flex flex-col">
|
|
93
|
+
<div className="text-xs">
|
|
94
|
+
<span className="text-foreground w-2">{dynamicInfo.dimensionGroupNumber}</span>{' '}
|
|
95
|
+
<span className="text-muted-foreground">{`/${dynamicInfo.numDimensionGroups}`}</span>
|
|
96
|
+
</div>
|
|
97
|
+
<div className="text-muted-foreground text-xs">{dynamicInfo.label}</div>
|
|
98
|
+
</div>
|
|
99
|
+
)}
|
|
100
|
+
|
|
101
|
+
<div>
|
|
102
|
+
<Popover
|
|
103
|
+
open={popoverOpen}
|
|
104
|
+
onOpenChange={setPopoverOpen}
|
|
105
|
+
>
|
|
106
|
+
<PopoverTrigger asChild>
|
|
107
|
+
<div
|
|
108
|
+
role="button"
|
|
109
|
+
tabIndex={0}
|
|
110
|
+
className="h-full cursor-pointer border-none bg-transparent p-0"
|
|
111
|
+
>
|
|
112
|
+
<Numeric.Container
|
|
113
|
+
mode="stepper"
|
|
114
|
+
min={minFrameRate}
|
|
115
|
+
max={maxFrameRate}
|
|
116
|
+
step={stepFrameRate}
|
|
117
|
+
value={frameRate}
|
|
118
|
+
onChange={val => handleSetFrameRate(val as number)}
|
|
119
|
+
className="border-0 bg-transparent"
|
|
120
|
+
>
|
|
121
|
+
<Numeric.NumberStepper
|
|
122
|
+
direction="horizontal"
|
|
123
|
+
inputWidth="w-7 max-w-7"
|
|
124
|
+
>
|
|
125
|
+
<div className="flex items-center justify-center gap-1">
|
|
126
|
+
<div className="text-foreground flex-shrink-0 text-center text-sm leading-[22px]">
|
|
127
|
+
<span className="text-muted-foreground whitespace-nowrap text-xs">
|
|
128
|
+
{' FPS'}
|
|
129
|
+
</span>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</Numeric.NumberStepper>
|
|
133
|
+
</Numeric.Container>
|
|
134
|
+
</div>
|
|
135
|
+
</PopoverTrigger>
|
|
136
|
+
<PopoverContent
|
|
137
|
+
side="bottom"
|
|
138
|
+
align="center"
|
|
139
|
+
className="cine-fps-range-popover z-50 w-auto p-2"
|
|
140
|
+
sideOffset={8}
|
|
141
|
+
>
|
|
142
|
+
<Numeric.Container
|
|
143
|
+
mode="singleRange"
|
|
144
|
+
min={minFrameRate}
|
|
145
|
+
max={maxFrameRate}
|
|
146
|
+
step={stepFrameRate}
|
|
147
|
+
value={frameRate}
|
|
148
|
+
onChange={val => handleSetFrameRate(val as number)}
|
|
149
|
+
className="h-6 px-2"
|
|
150
|
+
>
|
|
151
|
+
<Numeric.SingleRange
|
|
152
|
+
showNumberInput={false}
|
|
153
|
+
sliderClassName="w-40"
|
|
154
|
+
/>
|
|
155
|
+
</Numeric.Container>
|
|
156
|
+
</PopoverContent>
|
|
157
|
+
</Popover>
|
|
158
|
+
</div>
|
|
159
|
+
|
|
160
|
+
<Button
|
|
161
|
+
variant="ghost"
|
|
162
|
+
size="icon"
|
|
163
|
+
onClick={onClose}
|
|
164
|
+
data-cy={'cine-player-close'}
|
|
165
|
+
>
|
|
166
|
+
<Icons.Close />
|
|
167
|
+
</Button>
|
|
168
|
+
</div>
|
|
169
|
+
|
|
170
|
+
{isDynamic && dynamicInfo && (
|
|
171
|
+
<Numeric.Container
|
|
172
|
+
mode="singleRange"
|
|
173
|
+
min={1}
|
|
174
|
+
max={dynamicInfo.numDimensionGroups}
|
|
175
|
+
step={1}
|
|
176
|
+
value={dynamicInfo.dimensionGroupNumber}
|
|
177
|
+
onChange={val => handleDimensionGroupNumberChange(val as number)}
|
|
178
|
+
className="pointer-events-auto mt-3 w-full"
|
|
179
|
+
>
|
|
180
|
+
<Numeric.SingleRange showNumberInput={false} />
|
|
181
|
+
</Numeric.Container>
|
|
182
|
+
)}
|
|
183
|
+
</div>
|
|
184
|
+
);
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
export default CinePlayer;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { Button } from '../Button';
|
|
3
|
+
import { Icons } from '../Icons';
|
|
4
|
+
|
|
5
|
+
interface ClipboardProps {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type CopyState = 'idle' | 'success' | 'error';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Copies `children` to the clipboard when it is plain text, reporting the
|
|
13
|
+
* outcome through `setCopyState` and resetting to idle after the feedback.
|
|
14
|
+
*
|
|
15
|
+
* Module scope on purpose: the React Compiler cannot yet lower a `try` with a
|
|
16
|
+
* `finally` clause, and inlining this bails the whole component. Plain
|
|
17
|
+
* functions are never compiled, so the limitation does not apply here.
|
|
18
|
+
*/
|
|
19
|
+
async function copyChildrenToClipboard(
|
|
20
|
+
children: ReactNode,
|
|
21
|
+
setCopyState: (state: CopyState) => void
|
|
22
|
+
): Promise<void> {
|
|
23
|
+
const text = typeof children === 'string' ? children.trim() : '';
|
|
24
|
+
if (!text) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
await navigator.clipboard.writeText(text);
|
|
29
|
+
setCopyState('success');
|
|
30
|
+
} catch {
|
|
31
|
+
setCopyState('error');
|
|
32
|
+
} finally {
|
|
33
|
+
setTimeout(() => setCopyState('idle'), 1500); // Reset state after feedback
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const Clipboard: React.FC<ClipboardProps> = ({ children }) => {
|
|
38
|
+
const [copyState, setCopyState] = React.useState<CopyState>('idle');
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Button
|
|
42
|
+
variant="ghost"
|
|
43
|
+
size="icon"
|
|
44
|
+
onClick={e => {
|
|
45
|
+
e.stopPropagation();
|
|
46
|
+
copyChildrenToClipboard(children, setCopyState);
|
|
47
|
+
}}
|
|
48
|
+
className="text-foreground"
|
|
49
|
+
title="Copy"
|
|
50
|
+
>
|
|
51
|
+
{copyState === 'idle' && <Icons.Copy className="h-6 w-6" />}
|
|
52
|
+
{copyState === 'success' && <Icons.FeedbackComplete className="h-6 w-6 text-foreground" />}
|
|
53
|
+
{copyState === 'error' && <Icons.StatusError className="h-6 w-6 text-foreground" />}
|
|
54
|
+
</Button>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export { Clipboard };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
export function ColorCircle({ colorHex, className = 'inline-flex' }) {
|
|
4
|
+
return (
|
|
5
|
+
<div className={`h-5 w-5 ${className} items-center justify-center`}>
|
|
6
|
+
<span
|
|
7
|
+
className="ml-2 h-2 w-2 rounded-full"
|
|
8
|
+
style={{ backgroundColor: colorHex, marginLeft: 0 }}
|
|
9
|
+
/>
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
}
|