@ohif/ui-next 3.14.0-beta.97 → 3.14.0-beta.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ohif-ui-next.umd.js +4 -1925
- package/package.json +18 -7
- package/src/__mocks__/fileMock.js +7 -0
- package/src/assets/fonts.css +50 -0
- package/src/assets/styles.css +55 -0
- package/src/assets/woff2/latin.woff2 +0 -0
- package/src/components/Accordion/Accordion.tsx +70 -0
- package/src/components/Accordion/index.ts +3 -0
- package/src/components/AllInOneMenu/BackItem.tsx +32 -0
- package/src/components/AllInOneMenu/DividerItem.tsx +11 -0
- package/src/components/AllInOneMenu/HeaderItem.tsx +15 -0
- package/src/components/AllInOneMenu/IconMenu.tsx +83 -0
- package/src/components/AllInOneMenu/Item.tsx +51 -0
- package/src/components/AllInOneMenu/ItemPanel.tsx +38 -0
- package/src/components/AllInOneMenu/Menu.tsx +231 -0
- package/src/components/AllInOneMenu/PanelSelector.tsx +32 -0
- package/src/components/AllInOneMenu/SubMenu.tsx +36 -0
- package/src/components/AllInOneMenu/index.ts +42 -0
- package/src/components/BackgroundColorSelect/BackgroundColorSelect.tsx +38 -0
- package/src/components/BackgroundColorSelect/index.tsx +1 -0
- package/src/components/Badge/Badge.tsx +38 -0
- package/src/components/Badge/index.ts +1 -0
- package/src/components/Button/Button.tsx +65 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Calendar/Calendar.tsx +258 -0
- package/src/components/Calendar/index.tsx +3 -0
- package/src/components/Card/Card.tsx +83 -0
- package/src/components/Card/index.ts +2 -0
- package/src/components/Checkbox/Checkbox.tsx +27 -0
- package/src/components/Checkbox/index.tsx +3 -0
- package/src/components/CinePlayer/CinePlayer.tsx +187 -0
- package/src/components/CinePlayer/index.ts +5 -0
- package/src/components/Clipboard/Clipboard.tsx +58 -0
- package/src/components/Clipboard/index.tsx +3 -0
- package/src/components/ColorCircle.tsx +12 -0
- package/src/components/Combobox/Combobox.tsx +66 -0
- package/src/components/Combobox/index.ts +3 -0
- package/src/components/Command/Command.tsx +149 -0
- package/src/components/Command/index.ts +23 -0
- package/src/components/ContextMenu/ContextMenu.tsx +202 -0
- package/src/components/ContextMenu/index.ts +35 -0
- package/src/components/ContextMenuViewport/ContextMenuViewport.tsx +47 -0
- package/src/components/ContextMenuViewport/index.ts +1 -0
- package/src/components/DataRow/DataRow.tsx +532 -0
- package/src/components/DataRow/index.ts +1 -0
- package/src/components/DataRow/types.ts +31 -0
- package/src/components/DataTable/ActionOverlayCell.tsx +153 -0
- package/src/components/DataTable/ColumnHeader.tsx +70 -0
- package/src/components/DataTable/DataTable.tsx +532 -0
- package/src/components/DataTable/FilterRow.tsx +52 -0
- package/src/components/DataTable/Pagination.tsx +78 -0
- package/src/components/DataTable/Title.tsx +5 -0
- package/src/components/DataTable/Toolbar.tsx +5 -0
- package/src/components/DataTable/ViewOptions.tsx +86 -0
- package/src/components/DataTable/context.tsx +21 -0
- package/src/components/DataTable/index.ts +5 -0
- package/src/components/DataTable/types.ts +27 -0
- package/src/components/DataTable/useResponsiveColumns.tsx +346 -0
- package/src/components/DateRange/DateRange.tsx +163 -0
- package/src/components/DateRange/index.ts +3 -0
- package/src/components/Dialog/Dialog.tsx +201 -0
- package/src/components/Dialog/index.ts +25 -0
- package/src/components/Dialog/useDraggable.ts +108 -0
- package/src/components/DisplaySetMessageListTooltip/DisplaySetMessageListTooltip.tsx +64 -0
- package/src/components/DisplaySetMessageListTooltip/index.ts +3 -0
- package/src/components/DoubleSlider/DoubleSlider.test.ts +232 -0
- package/src/components/DoubleSlider/DoubleSlider.tsx +211 -0
- package/src/components/DoubleSlider/index.tsx +3 -0
- package/src/components/DropdownMenu/DropdownMenu.tsx +213 -0
- package/src/components/DropdownMenu/index.ts +35 -0
- package/src/components/Errorboundary/ErrorBoundary.tsx +345 -0
- package/src/components/Errorboundary/index.tsx +3 -0
- package/src/components/FooterAction/FooterAction.tsx +115 -0
- package/src/components/FooterAction/index.tsx +3 -0
- package/src/components/Header/Header.tsx +140 -0
- package/src/components/Header/index.js +2 -0
- package/src/components/HoverCard/HoverCard.tsx +30 -0
- package/src/components/HoverCard/index.ts +1 -0
- package/src/components/Icons/Icons.tsx +852 -0
- package/src/components/Icons/Sources/ActionNewDialog.tsx +64 -0
- package/src/components/Icons/Sources/Actions.tsx +47 -0
- package/src/components/Icons/Sources/Add.tsx +51 -0
- package/src/components/Icons/Sources/Alert.tsx +32 -0
- package/src/components/Icons/Sources/AlertOutline.tsx +30 -0
- package/src/components/Icons/Sources/ArrowLeftBold.tsx +49 -0
- package/src/components/Icons/Sources/ArrowRight.tsx +25 -0
- package/src/components/Icons/Sources/Cancel.tsx +37 -0
- package/src/components/Icons/Sources/CheckBoxChecked.tsx +39 -0
- package/src/components/Icons/Sources/CheckBoxUnChecked.tsx +25 -0
- package/src/components/Icons/Sources/Checked.tsx +23 -0
- package/src/components/Icons/Sources/ChevronClosed.tsx +40 -0
- package/src/components/Icons/Sources/ChevronLeft.tsx +28 -0
- package/src/components/Icons/Sources/ChevronOpen.tsx +38 -0
- package/src/components/Icons/Sources/Clear.tsx +34 -0
- package/src/components/Icons/Sources/Clipboard.tsx +15 -0
- package/src/components/Icons/Sources/Close.tsx +28 -0
- package/src/components/Icons/Sources/CloudSettings.tsx +34 -0
- package/src/components/Icons/Sources/Code.tsx +7 -0
- package/src/components/Icons/Sources/ColorChange.tsx +100 -0
- package/src/components/Icons/Sources/ContentNext.tsx +35 -0
- package/src/components/Icons/Sources/ContentPrev.tsx +35 -0
- package/src/components/Icons/Sources/Controls.tsx +99 -0
- package/src/components/Icons/Sources/Copy.tsx +44 -0
- package/src/components/Icons/Sources/Database.tsx +33 -0
- package/src/components/Icons/Sources/Delete.tsx +58 -0
- package/src/components/Icons/Sources/DicomTagBrowser.tsx +79 -0
- package/src/components/Icons/Sources/DisplayFillAndOutline.tsx +49 -0
- package/src/components/Icons/Sources/DisplayFillOnly.tsx +40 -0
- package/src/components/Icons/Sources/DisplayOutlineOnly.tsx +40 -0
- package/src/components/Icons/Sources/Download.tsx +75 -0
- package/src/components/Icons/Sources/Export.tsx +53 -0
- package/src/components/Icons/Sources/ExternalLink.tsx +26 -0
- package/src/components/Icons/Sources/EyeHidden.tsx +32 -0
- package/src/components/Icons/Sources/EyeVisible.tsx +28 -0
- package/src/components/Icons/Sources/FeedbackComplete.tsx +35 -0
- package/src/components/Icons/Sources/GearSettings.tsx +59 -0
- package/src/components/Icons/Sources/GroupLayers.tsx +33 -0
- package/src/components/Icons/Sources/Helpers.tsx +398 -0
- package/src/components/Icons/Sources/Hide.tsx +45 -0
- package/src/components/Icons/Sources/IconColorLUT.tsx +103 -0
- package/src/components/Icons/Sources/IconMPR.tsx +55 -0
- package/src/components/Icons/Sources/IconTransferring.tsx +25 -0
- package/src/components/Icons/Sources/IllustrationNotFound.tsx +102 -0
- package/src/components/Icons/Sources/Info.tsx +55 -0
- package/src/components/Icons/Sources/InfoLink.tsx +23 -0
- package/src/components/Icons/Sources/InfoSeries.tsx +52 -0
- package/src/components/Icons/Sources/InvestigationalUse.tsx +82 -0
- package/src/components/Icons/Sources/JumpToSlice.tsx +69 -0
- package/src/components/Icons/Sources/LaunchArrow.tsx +34 -0
- package/src/components/Icons/Sources/LaunchInfo.tsx +38 -0
- package/src/components/Icons/Sources/LayerBackground.tsx +28 -0
- package/src/components/Icons/Sources/LayerForeground.tsx +34 -0
- package/src/components/Icons/Sources/LayerSegmentation.tsx +20 -0
- package/src/components/Icons/Sources/Layout.tsx +433 -0
- package/src/components/Icons/Sources/Link.tsx +58 -0
- package/src/components/Icons/Sources/ListView.tsx +79 -0
- package/src/components/Icons/Sources/LoadingOHIFMark.tsx +21 -0
- package/src/components/Icons/Sources/LoadingSpinner.tsx +49 -0
- package/src/components/Icons/Sources/Lock.tsx +35 -0
- package/src/components/Icons/Sources/Magnifier.tsx +37 -0
- package/src/components/Icons/Sources/Minus.tsx +40 -0
- package/src/components/Icons/Sources/MissingIcon.tsx +6 -0
- package/src/components/Icons/Sources/More.tsx +53 -0
- package/src/components/Icons/Sources/MultiplePatients.tsx +76 -0
- package/src/components/Icons/Sources/NavigationPanelReveal.tsx +25 -0
- package/src/components/Icons/Sources/NotificationInfo.tsx +33 -0
- package/src/components/Icons/Sources/NotificationWarning.tsx +44 -0
- package/src/components/Icons/Sources/OHIFLogo.tsx +72 -0
- package/src/components/Icons/Sources/OHIFLogoColorDarkBackground.tsx +78 -0
- package/src/components/Icons/Sources/OHIFLogoHorizontal.tsx +139 -0
- package/src/components/Icons/Sources/Opacity.tsx +106 -0
- package/src/components/Icons/Sources/OrientationSwitch.tsx +41 -0
- package/src/components/Icons/Sources/OrientationSwitchA.tsx +41 -0
- package/src/components/Icons/Sources/OrientationSwitchC.tsx +41 -0
- package/src/components/Icons/Sources/OrientationSwitchR.tsx +41 -0
- package/src/components/Icons/Sources/OrientationSwitchS.tsx +41 -0
- package/src/components/Icons/Sources/PanelRight.tsx +29 -0
- package/src/components/Icons/Sources/Patient.tsx +58 -0
- package/src/components/Icons/Sources/PatientStudyList.tsx +62 -0
- package/src/components/Icons/Sources/Pause.tsx +26 -0
- package/src/components/Icons/Sources/Pencil.tsx +16 -0
- package/src/components/Icons/Sources/Pin.tsx +50 -0
- package/src/components/Icons/Sources/PinFill.tsx +51 -0
- package/src/components/Icons/Sources/Play.tsx +25 -0
- package/src/components/Icons/Sources/Plus.tsx +29 -0
- package/src/components/Icons/Sources/PowerOff.tsx +19 -0
- package/src/components/Icons/Sources/Redo.tsx +51 -0
- package/src/components/Icons/Sources/Refresh.tsx +42 -0
- package/src/components/Icons/Sources/Rename.tsx +50 -0
- package/src/components/Icons/Sources/Search.tsx +35 -0
- package/src/components/Icons/Sources/SegActions.tsx +594 -0
- package/src/components/Icons/Sources/Series.tsx +47 -0
- package/src/components/Icons/Sources/SeriesPlaceholder.tsx +40 -0
- package/src/components/Icons/Sources/Settings.tsx +105 -0
- package/src/components/Icons/Sources/SettingsStudyList.tsx +28 -0
- package/src/components/Icons/Sources/Show.tsx +67 -0
- package/src/components/Icons/Sources/SidePanelCloseLeft.tsx +75 -0
- package/src/components/Icons/Sources/SidePanelCloseRight.tsx +74 -0
- package/src/components/Icons/Sources/SocialGithub.tsx +39 -0
- package/src/components/Icons/Sources/Sorting.tsx +39 -0
- package/src/components/Icons/Sources/SortingAscending.tsx +28 -0
- package/src/components/Icons/Sources/SortingDescending.tsx +26 -0
- package/src/components/Icons/Sources/SortingNew.tsx +20 -0
- package/src/components/Icons/Sources/SortingNewAscending.tsx +35 -0
- package/src/components/Icons/Sources/SortingNewDescending.tsx +35 -0
- package/src/components/Icons/Sources/StatusAlert.tsx +36 -0
- package/src/components/Icons/Sources/StatusError.tsx +57 -0
- package/src/components/Icons/Sources/StatusLocked.tsx +35 -0
- package/src/components/Icons/Sources/StatusSuccess.tsx +45 -0
- package/src/components/Icons/Sources/StatusTracking.tsx +37 -0
- package/src/components/Icons/Sources/StatusUntracked.tsx +30 -0
- package/src/components/Icons/Sources/StatusWarning.tsx +58 -0
- package/src/components/Icons/Sources/Tab4D.tsx +54 -0
- package/src/components/Icons/Sources/TabContours.tsx +63 -0
- package/src/components/Icons/Sources/TabLinear.tsx +47 -0
- package/src/components/Icons/Sources/TabPatientInfo.tsx +33 -0
- package/src/components/Icons/Sources/TabRoiThreshold.tsx +38 -0
- package/src/components/Icons/Sources/TabSegmentation.tsx +38 -0
- package/src/components/Icons/Sources/TabStudies.tsx +62 -0
- package/src/components/Icons/Sources/Threshold.tsx +38 -0
- package/src/components/Icons/Sources/ThumbnailView.tsx +67 -0
- package/src/components/Icons/Sources/Tools.tsx +3659 -0
- package/src/components/Icons/Sources/Trash.tsx +17 -0
- package/src/components/Icons/Sources/Undo.tsx +51 -0
- package/src/components/Icons/Sources/Upload.tsx +29 -0
- package/src/components/Icons/Sources/ViewportViews.tsx +45 -0
- package/src/components/Icons/Sources/ViewportWindowLevel.tsx +58 -0
- package/src/components/Icons/Sources/WindowLevelAdvanced.tsx +30 -0
- package/src/components/Icons/index.ts +4 -0
- package/src/components/Icons/types.ts +3 -0
- package/src/components/Input/Input.tsx +25 -0
- package/src/components/Input/index.tsx +3 -0
- package/src/components/InputFilter/InputFilter.tsx +200 -0
- package/src/components/InputFilter/index.ts +2 -0
- package/src/components/InputMultiSelect/InputMultiSelect.tsx +370 -0
- package/src/components/InputMultiSelect/index.ts +1 -0
- package/src/components/InputNumber/InputNumber.tsx +439 -0
- package/src/components/InputNumber/index.ts +3 -0
- package/src/components/InvestigationalUseDialog/InvestigationalUseDialog.tsx +98 -0
- package/src/components/InvestigationalUseDialog/index.ts +3 -0
- package/src/components/Label/Label.tsx +24 -0
- package/src/components/Label/index.tsx +3 -0
- package/src/components/Labelling/LabellingFlow.tsx +92 -0
- package/src/components/Labelling/index.ts +2 -0
- package/src/components/LayoutSelector/LayoutSelector.tsx +345 -0
- package/src/components/LayoutSelector/index.ts +4 -0
- package/src/components/LineChart/LineChart.css +40 -0
- package/src/components/LineChart/LineChart.tsx +101 -0
- package/src/components/LineChart/d3LineChart/chart.ts +365 -0
- package/src/components/LineChart/d3LineChart/events.ts +149 -0
- package/src/components/LineChart/d3LineChart/index.ts +3 -0
- package/src/components/LineChart/d3LineChart/lineChart.ts +272 -0
- package/src/components/LineChart/index.ts +1 -0
- package/src/components/LoadingIndicatorProgress/LoadingIndicatorProgress.tsx +29 -0
- package/src/components/LoadingIndicatorProgress/index.ts +2 -0
- package/src/components/LoadingIndicatorTotalPercent/LoadingIndicatorTotalPercent.tsx +49 -0
- package/src/components/LoadingIndicatorTotalPercent/index.ts +2 -0
- package/src/components/MeasurementTable/MeasurementTable.tsx +144 -0
- package/src/components/MeasurementTable/index.js +3 -0
- package/src/components/Modal/Modal.tsx +44 -0
- package/src/components/NavBar/NavBar.tsx +32 -0
- package/src/components/NavBar/index.js +2 -0
- package/src/components/Numeric/Numeric.test.ts +124 -0
- package/src/components/Numeric/Numeric.tsx +576 -0
- package/src/components/Numeric/index.ts +3 -0
- package/src/components/OHIFDialogs/InputDialog.tsx +287 -0
- package/src/components/OHIFDialogs/PresetDialog.tsx +106 -0
- package/src/components/OHIFDialogs/index.ts +2 -0
- package/src/components/OHIFModals/AboutModal.tsx +114 -0
- package/src/components/OHIFModals/AppearanceModal.tsx +38 -0
- package/src/components/OHIFModals/ImageModal.tsx +251 -0
- package/src/components/OHIFModals/UserPreferencesModal.tsx +229 -0
- package/src/components/OHIFModals/index.ts +4 -0
- package/src/components/OHIFPanels/WindowLevel.tsx +162 -0
- package/src/components/OHIFPanels/WindowLevelHistogram.tsx +237 -0
- package/src/components/OHIFPanels/index.ts +3 -0
- package/src/components/OHIFPanels/types.ts +41 -0
- package/src/components/OHIFToolSettings/RowDoubleRange.tsx +67 -0
- package/src/components/OHIFToolSettings/RowInputRange.tsx +65 -0
- package/src/components/OHIFToolSettings/RowSegmentedControl.tsx +77 -0
- package/src/components/OHIFToolSettings/ToolSettings.tsx +253 -0
- package/src/components/OHIFToolSettings/index.ts +1 -0
- package/src/components/OHIFToolbox/ToolboxUI.tsx +104 -0
- package/src/components/OHIFToolbox/index.ts +1 -0
- package/src/components/Onboarding/Onboarding.css +48 -0
- package/src/components/Onboarding/Onboarding.tsx +58 -0
- package/src/components/Onboarding/index.ts +3 -0
- package/src/components/Onboarding/utilities.ts +91 -0
- package/src/components/PanelSection/PanelSection.tsx +70 -0
- package/src/components/PanelSection/index.ts +2 -0
- package/src/components/Popover/Popover.tsx +35 -0
- package/src/components/Popover/index.ts +3 -0
- package/src/components/ProgressDropdown/ProgressDiscreteBar.tsx +24 -0
- package/src/components/ProgressDropdown/ProgressDropdown.tsx +158 -0
- package/src/components/ProgressDropdown/ProgressItem.tsx +27 -0
- package/src/components/ProgressDropdown/ProgressItemDetail.tsx +89 -0
- package/src/components/ProgressDropdown/index.ts +1 -0
- package/src/components/ProgressDropdown/types.ts +9 -0
- package/src/components/ProgressLoadingBar/ProgressLoadingBar.css +26 -0
- package/src/components/ProgressLoadingBar/ProgressLoadingBar.tsx +32 -0
- package/src/components/ProgressLoadingBar/index.ts +2 -0
- package/src/components/Resizable/Resizable.tsx +43 -0
- package/src/components/Resizable/index.ts +3 -0
- package/src/components/ScrollArea/ScrollArea.tsx +127 -0
- package/src/components/ScrollArea/index.tsx +3 -0
- package/src/components/SegmentationTable/AddSegmentRow.tsx +78 -0
- package/src/components/SegmentationTable/AddSegmentationRow.tsx +56 -0
- package/src/components/SegmentationTable/SegmentStatistics.tsx +104 -0
- package/src/components/SegmentationTable/SegmentationCollapsed.tsx +211 -0
- package/src/components/SegmentationTable/SegmentationExpanded.tsx +173 -0
- package/src/components/SegmentationTable/SegmentationHeader.tsx +58 -0
- package/src/components/SegmentationTable/SegmentationLabel.tsx +27 -0
- package/src/components/SegmentationTable/SegmentationSegments.tsx +206 -0
- package/src/components/SegmentationTable/SegmentationTable.tsx +169 -0
- package/src/components/SegmentationTable/SegmentationTableConfig.tsx +194 -0
- package/src/components/SegmentationTable/contexts/SegmentStatisticsContext.tsx +45 -0
- package/src/components/SegmentationTable/contexts/SegmentationExpandedContext.tsx +45 -0
- package/src/components/SegmentationTable/contexts/SegmentationTableContext.tsx +148 -0
- package/src/components/SegmentationTable/contexts/index.ts +15 -0
- package/src/components/SegmentationTable/index.ts +24 -0
- package/src/components/Select/Select.tsx +167 -0
- package/src/components/Select/index.tsx +40 -0
- package/src/components/Separator/Separator.tsx +32 -0
- package/src/components/Separator/index.ts +3 -0
- package/src/components/Separator/index.tsx +3 -0
- package/src/components/SidePanel/SidePanel.tsx +479 -0
- package/src/components/SidePanel/index.ts +2 -0
- package/src/components/Slider/Slider.tsx +24 -0
- package/src/components/Slider/index.tsx +3 -0
- package/src/components/SmartScrollbar/SmartScrollbar.tsx +349 -0
- package/src/components/SmartScrollbar/SmartScrollbarEndpoints.tsx +82 -0
- package/src/components/SmartScrollbar/SmartScrollbarFill.tsx +54 -0
- package/src/components/SmartScrollbar/SmartScrollbarIndicator.tsx +59 -0
- package/src/components/SmartScrollbar/SmartScrollbarTrack.tsx +104 -0
- package/src/components/SmartScrollbar/defaultSmartScrollbarIndicatorConfig.tsx +48 -0
- package/src/components/SmartScrollbar/index.ts +11 -0
- package/src/components/SmartScrollbar/useByteArray.ts +146 -0
- package/src/components/SmartScrollbar/utils.test.ts +124 -0
- package/src/components/SmartScrollbar/utils.ts +168 -0
- package/src/components/Sonner/Sonner.tsx +31 -0
- package/src/components/Sonner/index.ts +4 -0
- package/src/components/StudyBrowser/StudyBrowser.tsx +89 -0
- package/src/components/StudyBrowser/index.ts +2 -0
- package/src/components/StudyBrowserSort/StudyBrowserSort.tsx +87 -0
- package/src/components/StudyBrowserSort/index.ts +3 -0
- package/src/components/StudyBrowserViewOptions/StudyBrowserViewOptions.tsx +50 -0
- package/src/components/StudyBrowserViewOptions/index.ts +3 -0
- package/src/components/StudyItem/StudyItem.tsx +100 -0
- package/src/components/StudyItem/index.ts +2 -0
- package/src/components/StudyList/columns/defaultColumns.tsx +258 -0
- package/src/components/StudyList/components/ActionCell.tsx +19 -0
- package/src/components/StudyList/components/Layout.tsx +206 -0
- package/src/components/StudyList/components/PreviewContainer.tsx +45 -0
- package/src/components/StudyList/components/PreviewContent.tsx +186 -0
- package/src/components/StudyList/components/PreviewHeader.tsx +5 -0
- package/src/components/StudyList/components/PreviewPatientSummary.tsx +224 -0
- package/src/components/StudyList/components/PreviewSeriesList.tsx +64 -0
- package/src/components/StudyList/components/PreviewToggleButton.tsx +69 -0
- package/src/components/StudyList/components/SettingsPopover.tsx +214 -0
- package/src/components/StudyList/components/Table.tsx +247 -0
- package/src/components/StudyList/components/WorkflowMenu.tsx +72 -0
- package/src/components/StudyList/components/WorkflowsProvider.tsx +169 -0
- package/src/components/StudyList/hooks/useDefaultWorkflow.ts +60 -0
- package/src/components/StudyList/index.ts +52 -0
- package/src/components/StudyList/types/types.ts +42 -0
- package/src/components/StudyList/utils/tokenizeModalities.ts +6 -0
- package/src/components/StudySummary/StudySummary.tsx +27 -0
- package/src/components/StudySummary/index.tsx +3 -0
- package/src/components/Switch/Switch.tsx +28 -0
- package/src/components/Switch/index.tsx +3 -0
- package/src/components/Table/Table.tsx +134 -0
- package/src/components/Table/index.ts +11 -0
- package/src/components/Tabs/Tabs.tsx +56 -0
- package/src/components/Tabs/index.ts +3 -0
- package/src/components/Tabs/index.tsx +3 -0
- package/src/components/ThemeWrapper/ThemeWrapper.tsx +5 -0
- package/src/components/ThemeWrapper/index.ts +1 -0
- package/src/components/Thumbnail/Thumbnail.test.ts +71 -0
- package/src/components/Thumbnail/Thumbnail.tsx +351 -0
- package/src/components/Thumbnail/index.ts +2 -0
- package/src/components/ThumbnailList/ThumbnailList.tsx +94 -0
- package/src/components/ThumbnailList/index.ts +2 -0
- package/src/components/Toggle/Toggle.tsx +45 -0
- package/src/components/Toggle/index.ts +3 -0
- package/src/components/Toggle/index.tsx +3 -0
- package/src/components/ToggleGroup/ToggleGroup.tsx +63 -0
- package/src/components/ToggleGroup/index.ts +3 -0
- package/src/components/ToolButton/ToolButton.tsx +134 -0
- package/src/components/ToolButton/ToolButtonList.tsx +243 -0
- package/src/components/ToolButton/index.ts +8 -0
- package/src/components/Tooltip/Tooltip.tsx +34 -0
- package/src/components/Tooltip/index.ts +3 -0
- package/src/components/Viewport/ImageScrollbar.module.css +89 -0
- package/src/components/Viewport/ImageScrollbar.tsx +71 -0
- package/src/components/Viewport/PatientInfo.tsx +126 -0
- package/src/components/Viewport/ViewportActionArrows.tsx +36 -0
- package/src/components/Viewport/ViewportActionBar.tsx +107 -0
- package/src/components/Viewport/ViewportActionButton.tsx +25 -0
- package/src/components/Viewport/ViewportActionCorners.tsx +171 -0
- package/src/components/Viewport/ViewportGrid.tsx +24 -0
- package/src/components/Viewport/ViewportOverlay.css +32 -0
- package/src/components/Viewport/ViewportOverlay.tsx +54 -0
- package/src/components/Viewport/ViewportPane.tsx +82 -0
- package/src/components/Viewport/index.ts +9 -0
- package/src/components/ViewportDialog/ViewportDialog.tsx +128 -0
- package/src/components/ViewportDialog/index.ts +2 -0
- package/src/components/index.ts +323 -0
- package/src/contextProviders/ActiveThemeProvider.tsx +204 -0
- package/src/contextProviders/CineProvider.tsx +98 -0
- package/src/contextProviders/DialogProvider.tsx +103 -0
- package/src/contextProviders/DragAndDropProvider.tsx +37 -0
- package/src/contextProviders/IconPresentationProvider.tsx +88 -0
- package/src/contextProviders/ImageViewerProvider.tsx +15 -0
- package/src/contextProviders/ManagedDialog.tsx +176 -0
- package/src/contextProviders/ModalProvider.tsx +102 -0
- package/src/contextProviders/NotificationProvider.tsx +246 -0
- package/src/contextProviders/UserAuthenticationProvider.tsx +118 -0
- package/src/contextProviders/ViewportDialogProvider.tsx +42 -0
- package/src/contextProviders/ViewportGridProvider.tsx +556 -0
- package/src/contextProviders/index.ts +26 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useDynamicMaxHeight.ts +105 -0
- package/src/hooks/useSessionStorage.test.js +103 -0
- package/src/hooks/useSessionStorage.tsx +71 -0
- package/src/index.ts +7 -0
- package/src/lib/utils.ts +6 -0
- package/src/tailwind.css +266 -0
- package/src/themes/arctic.json +31 -0
- package/src/themes/deep.json +31 -0
- package/src/themes/index.ts +16 -0
- package/src/themes/midnight.json +31 -0
- package/src/themes/orchid.json +31 -0
- package/src/themes/slate.json +31 -0
- package/src/themes/themes.css +206 -0
- package/src/themes/verdant.json +31 -0
- package/src/types/ActionCorners.ts +18 -0
- package/src/types/AppTypes.ts +24 -0
- package/src/types/ContextMenuItem.ts +9 -0
- package/src/types/Predicate.ts +1 -0
- package/src/types/ThumbnailType.ts +3 -0
- package/src/types/ViewportActionCornersTypes.ts +13 -0
- package/src/types/global.d.ts +4 -0
- package/src/types/index.ts +21 -0
- package/src/utils/formatDICOMDate.test.ts +61 -0
- package/src/utils/formatDICOMDate.ts +65 -0
- package/src/utils/formatDICOMTime.test.ts +62 -0
- package/src/utils/formatDICOMTime.ts +49 -0
- package/src/utils/getToggledClassName.tsx +5 -0
- package/src/utils/index.ts +15 -0
- package/src/utils/parseStudyDateTimestamp.test.ts +47 -0
- package/src/utils/parseStudyDateTimestamp.ts +27 -0
- package/src/utils/roundNumber.ts +43 -0
- package/tailwind.config.js +120 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import React, { useLayoutEffect, useEffect, useRef } from 'react';
|
|
2
|
+
import { Range, VOIRange, Histogram, Colormap } from './types';
|
|
3
|
+
|
|
4
|
+
const DEFAULT_COLORMAP = {
|
|
5
|
+
Name: 'Grayscale',
|
|
6
|
+
RGBPoints: [0, 0, 0, 0, 1, 1, 1, 1],
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const clamp = (value: number, min: number, max: number) => Math.min(Math.max(min, value), max);
|
|
10
|
+
|
|
11
|
+
const interpolateVec3 = (a: number[], b: number[], t: number) => {
|
|
12
|
+
return [a[0] * (1 - t) + b[0] * t, a[1] * (1 - t) + b[1] * t, a[2] * (1 - t) + b[2] * t];
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const drawBackground = (canvas: HTMLCanvasElement, range: Range, voiRange: VOIRange, colormap: Colormap) => {
|
|
16
|
+
const context = canvas.getContext('2d');
|
|
17
|
+
if (!context) return;
|
|
18
|
+
|
|
19
|
+
const { width, height } = canvas;
|
|
20
|
+
const windowWidth = voiRange.max - voiRange.min;
|
|
21
|
+
const rgbPoints = colormap.RGBPoints;
|
|
22
|
+
const colorsCount = rgbPoints.length / 4;
|
|
23
|
+
|
|
24
|
+
const getColorPoint = (index: number) => {
|
|
25
|
+
const offset = 4 * index;
|
|
26
|
+
|
|
27
|
+
return index < colorsCount
|
|
28
|
+
? {
|
|
29
|
+
index,
|
|
30
|
+
position: rgbPoints[offset],
|
|
31
|
+
color: [rgbPoints[offset + 1], rgbPoints[offset + 2], rgbPoints[offset + 3]],
|
|
32
|
+
}
|
|
33
|
+
: undefined;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
let leftColorPoint = undefined;
|
|
37
|
+
let rightColorPoint = getColorPoint(0);
|
|
38
|
+
|
|
39
|
+
const incRawPixelValue = (range.max - range.min) / (width - 1);
|
|
40
|
+
let rawPixelValue = range.min;
|
|
41
|
+
|
|
42
|
+
for (let x = 0; x < width; x++) {
|
|
43
|
+
const tVoiRange = (rawPixelValue - voiRange.min) / windowWidth;
|
|
44
|
+
|
|
45
|
+
// Find the color in a linear way (O(n) complexity)
|
|
46
|
+
if (rightColorPoint) {
|
|
47
|
+
for (let i = rightColorPoint.index; i < colorsCount; i++) {
|
|
48
|
+
if (tVoiRange <= rightColorPoint.position) {
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
leftColorPoint = rightColorPoint;
|
|
53
|
+
rightColorPoint = getColorPoint(i + 1);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
let normColor;
|
|
58
|
+
|
|
59
|
+
if (!leftColorPoint) {
|
|
60
|
+
normColor = [...rightColorPoint!.color];
|
|
61
|
+
} else if (!rightColorPoint) {
|
|
62
|
+
normColor = [...leftColorPoint.color];
|
|
63
|
+
} else {
|
|
64
|
+
const tColorRange =
|
|
65
|
+
(tVoiRange - leftColorPoint.position) /
|
|
66
|
+
(rightColorPoint.position - leftColorPoint.position);
|
|
67
|
+
|
|
68
|
+
normColor = interpolateVec3(leftColorPoint.color, rightColorPoint.color, tColorRange);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const color = normColor.map(color => clamp(Math.round(color * 255), 0, 255));
|
|
72
|
+
|
|
73
|
+
context.fillStyle = `rgb(${color[0]}, ${color[1]}, ${color[2]})`;
|
|
74
|
+
context.fillRect(x, 0, 1, height);
|
|
75
|
+
|
|
76
|
+
rawPixelValue += incRawPixelValue;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/* plots the histogram bins as a polygon that traces the centers of each bin */
|
|
81
|
+
const drawPolygonHistogram = (
|
|
82
|
+
canvas: HTMLCanvasElement,
|
|
83
|
+
context: CanvasRenderingContext2D,
|
|
84
|
+
histogram: Histogram,
|
|
85
|
+
options: { scale: (val: number) => number, fillColor: string, lineColor: string }
|
|
86
|
+
) => {
|
|
87
|
+
const xScale = canvas.width / histogram.numBins;
|
|
88
|
+
const { scale } = options;
|
|
89
|
+
const maxVal = scale(histogram.maxBinValue);
|
|
90
|
+
|
|
91
|
+
context.beginPath();
|
|
92
|
+
context.moveTo(0, canvas.height);
|
|
93
|
+
context.lineTo(0, canvas.height - (canvas.height * scale(histogram.bins[0])) / maxVal);
|
|
94
|
+
|
|
95
|
+
let x = xScale / 2;
|
|
96
|
+
for (let bin = 0; bin < histogram.numBins; bin++) {
|
|
97
|
+
context.lineTo(x, canvas.height - (canvas.height * scale(histogram.bins[bin])) / maxVal);
|
|
98
|
+
x += xScale;
|
|
99
|
+
}
|
|
100
|
+
context.lineTo(
|
|
101
|
+
canvas.width,
|
|
102
|
+
canvas.height - (canvas.height * scale(histogram.bins[histogram.numBins - 1])) / maxVal
|
|
103
|
+
);
|
|
104
|
+
context.lineTo(canvas.width, canvas.height);
|
|
105
|
+
context.lineTo(0, canvas.height);
|
|
106
|
+
|
|
107
|
+
context.closePath();
|
|
108
|
+
context.fill();
|
|
109
|
+
context.stroke();
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/* plots the histogram bins as a series of n vertical bars (n = number of bins) */
|
|
113
|
+
const drawBarHistogram = (
|
|
114
|
+
canvas: HTMLCanvasElement,
|
|
115
|
+
context: CanvasRenderingContext2D,
|
|
116
|
+
histogram: Histogram,
|
|
117
|
+
options: { scale: (val: number) => number, fillColor: string, lineColor: string }
|
|
118
|
+
) => {
|
|
119
|
+
const xScale = canvas.width / histogram.numBins;
|
|
120
|
+
const { scale } = options;
|
|
121
|
+
const maxVal = scale(histogram.maxBinValue);
|
|
122
|
+
|
|
123
|
+
context.beginPath();
|
|
124
|
+
|
|
125
|
+
for (let bin = 0; bin < histogram.numBins; bin++) {
|
|
126
|
+
context.moveTo(xScale * bin, canvas.height);
|
|
127
|
+
context.lineTo(
|
|
128
|
+
xScale * bin,
|
|
129
|
+
canvas.height - (canvas.height * scale(histogram.bins[bin])) / maxVal
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
context.closePath();
|
|
134
|
+
context.strokeStyle = options.fillColor;
|
|
135
|
+
context.lineWidth = xScale;
|
|
136
|
+
context.stroke();
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const drawHistogram = (
|
|
140
|
+
canvas: HTMLCanvasElement,
|
|
141
|
+
histogram: Histogram,
|
|
142
|
+
options: {
|
|
143
|
+
style: 'polygon' | 'bars',
|
|
144
|
+
fillColor: string,
|
|
145
|
+
lineColor: string,
|
|
146
|
+
scale: (val: number) => number
|
|
147
|
+
}
|
|
148
|
+
) => {
|
|
149
|
+
const context = canvas.getContext('2d');
|
|
150
|
+
if (!context) return;
|
|
151
|
+
|
|
152
|
+
context.fillStyle = options.fillColor;
|
|
153
|
+
context.strokeStyle = options.lineColor;
|
|
154
|
+
|
|
155
|
+
if (options.style === 'polygon') {
|
|
156
|
+
drawPolygonHistogram(canvas, context, histogram, options);
|
|
157
|
+
} else if (options.style === 'bars') {
|
|
158
|
+
drawBarHistogram(canvas, context, histogram, options);
|
|
159
|
+
} else {
|
|
160
|
+
throw new Error(`Invalid style (${options.style})`);
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
interface WindowLevelHistogramProps {
|
|
165
|
+
range: Range;
|
|
166
|
+
voiRange: VOIRange;
|
|
167
|
+
histogram: Histogram;
|
|
168
|
+
colormap?: Colormap;
|
|
169
|
+
style?: 'polygon' | 'bars';
|
|
170
|
+
fillColor?: string;
|
|
171
|
+
lineColor?: string;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const WindowLevelHistogram = ({
|
|
175
|
+
range,
|
|
176
|
+
voiRange,
|
|
177
|
+
histogram,
|
|
178
|
+
colormap = DEFAULT_COLORMAP,
|
|
179
|
+
style = 'polygon',
|
|
180
|
+
fillColor = '#3f3f3f',
|
|
181
|
+
lineColor = '#707070',
|
|
182
|
+
}: WindowLevelHistogramProps) => {
|
|
183
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
184
|
+
const canvasRef = useRef<HTMLCanvasElement>(null);
|
|
185
|
+
const minVOIPercent = ((voiRange.min - range.min) / (range.max - range.min)) * 100;
|
|
186
|
+
const maxVoiPercent = (1 - (range.max - voiRange.max) / (range.max - range.min)) * 100;
|
|
187
|
+
const background =
|
|
188
|
+
colormap.Name !== 'Grayscale'
|
|
189
|
+
? undefined
|
|
190
|
+
: `linear-gradient(to right, #000 0%, #000 ${minVOIPercent}%, #fff ${maxVoiPercent}%, #fff 100%)`;
|
|
191
|
+
|
|
192
|
+
useLayoutEffect(() => {
|
|
193
|
+
const container = containerRef.current;
|
|
194
|
+
const canvas = canvasRef.current;
|
|
195
|
+
if (!container || !canvas) return;
|
|
196
|
+
|
|
197
|
+
canvas.width = container.offsetWidth;
|
|
198
|
+
canvas.height = container.offsetHeight;
|
|
199
|
+
}, [containerRef, canvasRef]);
|
|
200
|
+
|
|
201
|
+
useEffect(() => {
|
|
202
|
+
const canvas = canvasRef.current;
|
|
203
|
+
if (!canvas) return;
|
|
204
|
+
|
|
205
|
+
const context = canvas.getContext('2d');
|
|
206
|
+
if (!context) return;
|
|
207
|
+
|
|
208
|
+
const fnIdentity = (x: number) => x;
|
|
209
|
+
const options = {
|
|
210
|
+
style,
|
|
211
|
+
fillColor,
|
|
212
|
+
lineColor,
|
|
213
|
+
scale: fnIdentity,
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
context.clearRect(0, 0, canvas.width, canvas.height);
|
|
217
|
+
|
|
218
|
+
drawBackground(canvas, range, voiRange, colormap);
|
|
219
|
+
drawHistogram(canvas, histogram, options);
|
|
220
|
+
}, [range, voiRange, histogram, colormap, style, fillColor, lineColor]);
|
|
221
|
+
|
|
222
|
+
return (
|
|
223
|
+
<div
|
|
224
|
+
ref={containerRef}
|
|
225
|
+
className="h-full"
|
|
226
|
+
style={{ background }}
|
|
227
|
+
>
|
|
228
|
+
<canvas
|
|
229
|
+
ref={canvasRef}
|
|
230
|
+
width="1"
|
|
231
|
+
height="1"
|
|
232
|
+
></canvas>
|
|
233
|
+
</div>
|
|
234
|
+
);
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
export default WindowLevelHistogram;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Window-level related types
|
|
2
|
+
|
|
3
|
+
export interface Range {
|
|
4
|
+
min: number;
|
|
5
|
+
max: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface VOIRange {
|
|
9
|
+
min: number;
|
|
10
|
+
max: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface VOI {
|
|
14
|
+
windowWidth: number;
|
|
15
|
+
windowCenter: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface Histogram {
|
|
19
|
+
bins: number[] | Int32Array;
|
|
20
|
+
numBins: number;
|
|
21
|
+
maxBin: number;
|
|
22
|
+
maxBinValue: number;
|
|
23
|
+
range: Range;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface Colormap {
|
|
27
|
+
Name: string;
|
|
28
|
+
RGBPoints: number[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface WindowLevelData {
|
|
32
|
+
volumeId: string;
|
|
33
|
+
viewportId: string;
|
|
34
|
+
modality: string;
|
|
35
|
+
voi: VOI;
|
|
36
|
+
step: number;
|
|
37
|
+
histogram: Histogram;
|
|
38
|
+
showOpacitySlider: boolean;
|
|
39
|
+
opacity?: number;
|
|
40
|
+
colormap?: Colormap;
|
|
41
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Numeric from '../Numeric';
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from '../Tooltip';
|
|
5
|
+
|
|
6
|
+
interface RowDoubleRangeProps {
|
|
7
|
+
values: [number, number];
|
|
8
|
+
onChange: (values: [number, number]) => void;
|
|
9
|
+
minValue: number;
|
|
10
|
+
maxValue: number;
|
|
11
|
+
allowTypedExpansion?: boolean | [number, number];
|
|
12
|
+
step: number;
|
|
13
|
+
showLabel?: boolean;
|
|
14
|
+
label?: string;
|
|
15
|
+
tooltip?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const RowDoubleRange: React.FC<RowDoubleRangeProps> = ({
|
|
20
|
+
values,
|
|
21
|
+
onChange,
|
|
22
|
+
minValue,
|
|
23
|
+
maxValue,
|
|
24
|
+
allowTypedExpansion,
|
|
25
|
+
step,
|
|
26
|
+
showLabel = false,
|
|
27
|
+
label = '',
|
|
28
|
+
tooltip,
|
|
29
|
+
className,
|
|
30
|
+
}) => {
|
|
31
|
+
const renderLabel = () => {
|
|
32
|
+
if (!showLabel || !label) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const labelNode = <Numeric.Label showValue>{label}</Numeric.Label>;
|
|
37
|
+
|
|
38
|
+
if (!tooltip) {
|
|
39
|
+
return labelNode;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<Tooltip>
|
|
44
|
+
<TooltipTrigger asChild>{labelNode}</TooltipTrigger>
|
|
45
|
+
<TooltipContent side="top">{tooltip}</TooltipContent>
|
|
46
|
+
</Tooltip>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<Numeric.Container
|
|
52
|
+
mode="doubleRange"
|
|
53
|
+
values={values}
|
|
54
|
+
onChange={onChange}
|
|
55
|
+
min={minValue}
|
|
56
|
+
max={maxValue}
|
|
57
|
+
allowTypedExpansion={allowTypedExpansion}
|
|
58
|
+
step={step}
|
|
59
|
+
className={cn('flex flex-col space-y-2', className)}
|
|
60
|
+
>
|
|
61
|
+
{renderLabel()}
|
|
62
|
+
<Numeric.DoubleRange showNumberInputs />
|
|
63
|
+
</Numeric.Container>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default RowDoubleRange;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Numeric from '../Numeric';
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
|
|
5
|
+
interface RowInputRangeProps {
|
|
6
|
+
value: number;
|
|
7
|
+
onChange: (newValue: number) => void;
|
|
8
|
+
minValue?: number;
|
|
9
|
+
maxValue?: number;
|
|
10
|
+
step?: number;
|
|
11
|
+
label?: string;
|
|
12
|
+
showLabel?: boolean;
|
|
13
|
+
labelPosition?: 'left' | 'right';
|
|
14
|
+
allowNumberEdit?: boolean;
|
|
15
|
+
showNumberInput?: boolean;
|
|
16
|
+
className?: string;
|
|
17
|
+
containerClassName?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const RowInputRange: React.FC<RowInputRangeProps> = ({
|
|
21
|
+
value,
|
|
22
|
+
onChange,
|
|
23
|
+
minValue = 0,
|
|
24
|
+
maxValue = 100,
|
|
25
|
+
step = 1,
|
|
26
|
+
label = '',
|
|
27
|
+
showLabel = false,
|
|
28
|
+
labelPosition = 'right',
|
|
29
|
+
allowNumberEdit = false,
|
|
30
|
+
showNumberInput = true,
|
|
31
|
+
className,
|
|
32
|
+
containerClassName,
|
|
33
|
+
}) => {
|
|
34
|
+
const handleChange = (newValue: number | [number, number]) => {
|
|
35
|
+
if (typeof newValue === 'number') {
|
|
36
|
+
onChange(newValue);
|
|
37
|
+
} else {
|
|
38
|
+
onChange(newValue[0]);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const content = (
|
|
43
|
+
<Numeric.Container
|
|
44
|
+
mode="singleRange"
|
|
45
|
+
value={value}
|
|
46
|
+
onChange={handleChange}
|
|
47
|
+
min={minValue}
|
|
48
|
+
max={maxValue}
|
|
49
|
+
step={step}
|
|
50
|
+
className={cn('flex flex-row items-center space-x-2', className)}
|
|
51
|
+
>
|
|
52
|
+
{showLabel && label && labelPosition === 'left' && (
|
|
53
|
+
<Numeric.Label showValue={showNumberInput}>{label}</Numeric.Label>
|
|
54
|
+
)}
|
|
55
|
+
<Numeric.SingleRange showNumberInput={allowNumberEdit && showNumberInput} />
|
|
56
|
+
{showLabel && label && labelPosition === 'right' && (
|
|
57
|
+
<Numeric.Label showValue={showNumberInput}>{label}</Numeric.Label>
|
|
58
|
+
)}
|
|
59
|
+
</Numeric.Container>
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
return containerClassName ? <div className={containerClassName}>{content}</div> : content;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default RowInputRange;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Label } from '../Label';
|
|
3
|
+
import { Tabs, TabsList, TabsTrigger } from '../Tabs';
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from '../Tooltip';
|
|
6
|
+
|
|
7
|
+
interface RadioValue {
|
|
8
|
+
value: string;
|
|
9
|
+
label: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface RadioOption {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
value: string;
|
|
16
|
+
values: RadioValue[];
|
|
17
|
+
onChange?: (val: string) => void;
|
|
18
|
+
tooltip?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface RowSegmentedControlProps {
|
|
22
|
+
option: RadioOption;
|
|
23
|
+
className?: string;
|
|
24
|
+
onChange?: (val: string) => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const RowSegmentedControl: React.FC<RowSegmentedControlProps> = ({
|
|
28
|
+
option,
|
|
29
|
+
className,
|
|
30
|
+
onChange,
|
|
31
|
+
}) => {
|
|
32
|
+
const handleValueChange = (newVal: string) => {
|
|
33
|
+
if (onChange) {
|
|
34
|
+
onChange(newVal);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
className={cn('flex items-center justify-between text-[13px]', className)}
|
|
41
|
+
key={option.id}
|
|
42
|
+
>
|
|
43
|
+
<Label className="mr-2">
|
|
44
|
+
{option.tooltip ? (
|
|
45
|
+
<Tooltip>
|
|
46
|
+
<TooltipTrigger asChild>
|
|
47
|
+
<span className="cursor-help">{option.name}</span>
|
|
48
|
+
</TooltipTrigger>
|
|
49
|
+
<TooltipContent side="top">{option.tooltip}</TooltipContent>
|
|
50
|
+
</Tooltip>
|
|
51
|
+
) : (
|
|
52
|
+
option.name
|
|
53
|
+
)}
|
|
54
|
+
</Label>
|
|
55
|
+
<div className="max-w-1/2">
|
|
56
|
+
<Tabs
|
|
57
|
+
value={option.value}
|
|
58
|
+
onValueChange={handleValueChange}
|
|
59
|
+
>
|
|
60
|
+
<TabsList className="inline-flex space-x-1">
|
|
61
|
+
{option.values.map(({ label, value: itemValue }, index) => (
|
|
62
|
+
<TabsTrigger
|
|
63
|
+
value={itemValue}
|
|
64
|
+
key={`button-${option.id}-${index}`}
|
|
65
|
+
data-cy={`${option.id}-${itemValue}`}
|
|
66
|
+
>
|
|
67
|
+
{label}
|
|
68
|
+
</TabsTrigger>
|
|
69
|
+
))}
|
|
70
|
+
</TabsList>
|
|
71
|
+
</Tabs>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export default RowSegmentedControl;
|