@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,532 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Button } from '../../components/Button/Button';
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenu,
|
|
5
|
+
DropdownMenuTrigger,
|
|
6
|
+
DropdownMenuContent,
|
|
7
|
+
DropdownMenuItem,
|
|
8
|
+
} from '../../components/DropdownMenu';
|
|
9
|
+
import { Icons } from '../../components/Icons/Icons';
|
|
10
|
+
import { Tooltip, TooltipTrigger, TooltipContent } from '../../components/Tooltip/Tooltip';
|
|
11
|
+
import { cn } from '../../lib/utils';
|
|
12
|
+
import { useTranslation } from 'react-i18next';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* DataRow is a complex UI component that displays a selectable, interactive row with hierarchical data.
|
|
16
|
+
* It's designed to show a numbered item with a title, optional color indicator, and expandable details.
|
|
17
|
+
* The row supports various interactive features like visibility toggling, locking, and contextual actions.
|
|
18
|
+
*
|
|
19
|
+
* @component
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* // Basic usage without status
|
|
23
|
+
* <DataRow
|
|
24
|
+
* number={1}
|
|
25
|
+
* title="My Item"
|
|
26
|
+
* details={{
|
|
27
|
+
* primary: ["Main detail", " Sub detail"],
|
|
28
|
+
* secondary: []
|
|
29
|
+
* }}
|
|
30
|
+
* isVisible={true}
|
|
31
|
+
* isLocked={false}
|
|
32
|
+
* onToggleVisibility={() => {}}
|
|
33
|
+
* onToggleLocked={() => {}}
|
|
34
|
+
* onRename={() => {}}
|
|
35
|
+
* onDelete={() => {}}
|
|
36
|
+
* onColor={() => {}}
|
|
37
|
+
* />
|
|
38
|
+
*
|
|
39
|
+
* // With warning status using composite pattern
|
|
40
|
+
* <DataRow
|
|
41
|
+
* // ... other props
|
|
42
|
+
* >
|
|
43
|
+
* <DataRow.Status.Warning tooltip="This structured report is not compatible with this application" />
|
|
44
|
+
* </DataRow>
|
|
45
|
+
*
|
|
46
|
+
* // With success status using composite pattern
|
|
47
|
+
* <DataRow
|
|
48
|
+
* // ... other props
|
|
49
|
+
* >
|
|
50
|
+
* <DataRow.Status.Success tooltip="Measurement completed successfully" />
|
|
51
|
+
* </DataRow>
|
|
52
|
+
*
|
|
53
|
+
* // Multiple status indicators
|
|
54
|
+
* <DataRow
|
|
55
|
+
* // ... other props
|
|
56
|
+
* >
|
|
57
|
+
* <DataRow.Status.Warning tooltip="Warning message" />
|
|
58
|
+
* <DataRow.Status.Info tooltip="Additional info" />
|
|
59
|
+
* </DataRow>
|
|
60
|
+
*
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Props for the DataRow component
|
|
66
|
+
* @interface DataRowProps
|
|
67
|
+
* @property {number} number - The display number/index of the row
|
|
68
|
+
* @property {string} title - The main text label for the row
|
|
69
|
+
* @property {boolean} disableEditing - When true, prevents rename and delete operations
|
|
70
|
+
* @property {string} [colorHex] - Optional hex color code to display a color indicator
|
|
71
|
+
* @property {Object} [details] - Optional hierarchical details to display below the row
|
|
72
|
+
* @property {string[]} details.primary - Primary details shown immediately below the row
|
|
73
|
+
* @property {string[]} details.secondary - Secondary details (currently unused)
|
|
74
|
+
* @property {boolean} [isSelected] - Whether the row is currently selected
|
|
75
|
+
* @property {() => void} [onSelect] - Callback when the row is clicked/selected
|
|
76
|
+
* @property {boolean} isVisible - Controls the row's visibility state
|
|
77
|
+
* @property {() => void} onToggleVisibility - Callback to toggle visibility
|
|
78
|
+
* @property {boolean} isLocked - Controls the row's locked state
|
|
79
|
+
* @property {() => void} onToggleLocked - Callback to toggle locked state
|
|
80
|
+
* @property {() => void} onRename - Callback when rename is requested
|
|
81
|
+
* @property {() => void} onDelete - Callback when delete is requested
|
|
82
|
+
* @property {() => void} onColor - Callback when color change is requested
|
|
83
|
+
* @property {React.ReactNode} children - Optional children, including Status components
|
|
84
|
+
*/
|
|
85
|
+
interface DataRowProps {
|
|
86
|
+
number: number | null;
|
|
87
|
+
disableEditing: boolean;
|
|
88
|
+
description: string;
|
|
89
|
+
details?: { primary: string[]; secondary: string[] };
|
|
90
|
+
//
|
|
91
|
+
/** Primary selection: selected and in the active segmentation */
|
|
92
|
+
isSelected?: boolean;
|
|
93
|
+
/** Secondary selection: selected but in an inactive segmentation */
|
|
94
|
+
isSecondarySelected?: boolean;
|
|
95
|
+
onSelect?: (e) => void;
|
|
96
|
+
//
|
|
97
|
+
isVisible: boolean;
|
|
98
|
+
onToggleVisibility: (e) => void;
|
|
99
|
+
//
|
|
100
|
+
isLocked: boolean;
|
|
101
|
+
onToggleLocked: (e) => void;
|
|
102
|
+
//
|
|
103
|
+
title: string;
|
|
104
|
+
onRename: (e) => void;
|
|
105
|
+
//
|
|
106
|
+
onDelete: (e) => void;
|
|
107
|
+
//
|
|
108
|
+
colorHex?: string;
|
|
109
|
+
onColor: (e) => void;
|
|
110
|
+
onCopy?: (e) => void;
|
|
111
|
+
className?: string;
|
|
112
|
+
children?: React.ReactNode;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const DataRowComponent = ({
|
|
116
|
+
number,
|
|
117
|
+
title,
|
|
118
|
+
colorHex,
|
|
119
|
+
details,
|
|
120
|
+
onSelect,
|
|
121
|
+
isLocked,
|
|
122
|
+
onToggleVisibility,
|
|
123
|
+
onToggleLocked,
|
|
124
|
+
onRename,
|
|
125
|
+
onDelete,
|
|
126
|
+
onColor,
|
|
127
|
+
onCopy,
|
|
128
|
+
isSelected = false,
|
|
129
|
+
isSecondarySelected = false,
|
|
130
|
+
isVisible = true,
|
|
131
|
+
disableEditing = false,
|
|
132
|
+
className,
|
|
133
|
+
children,
|
|
134
|
+
ref,
|
|
135
|
+
}: DataRowProps & { ref?: React.Ref<HTMLDivElement> }) => {
|
|
136
|
+
const { t } = useTranslation('DataRow');
|
|
137
|
+
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
|
138
|
+
const isTitleLong = title?.length > 25;
|
|
139
|
+
|
|
140
|
+
// Extract Status components from children
|
|
141
|
+
const statusComponents = React.Children.toArray(children).filter(
|
|
142
|
+
child =>
|
|
143
|
+
React.isValidElement(child) &&
|
|
144
|
+
child.type &&
|
|
145
|
+
(child.type as React.ComponentType).displayName?.startsWith('DataRow.Status')
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
const handleAction = (action: string, e: React.MouseEvent) => {
|
|
149
|
+
e.stopPropagation();
|
|
150
|
+
switch (action) {
|
|
151
|
+
case 'Rename':
|
|
152
|
+
onRename(e);
|
|
153
|
+
break;
|
|
154
|
+
case 'Copy':
|
|
155
|
+
onCopy?.(e);
|
|
156
|
+
break;
|
|
157
|
+
case 'Lock':
|
|
158
|
+
onToggleLocked(e);
|
|
159
|
+
break;
|
|
160
|
+
case 'Delete':
|
|
161
|
+
onDelete(e);
|
|
162
|
+
break;
|
|
163
|
+
case 'Color':
|
|
164
|
+
onColor(e);
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const decodeHTML = (html: string) => {
|
|
170
|
+
const txt = document.createElement('textarea');
|
|
171
|
+
txt.innerHTML = html;
|
|
172
|
+
return txt.value;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
const renderDetailText = (text: string, indent: number = 0) => {
|
|
176
|
+
const indentation = ' '.repeat(indent);
|
|
177
|
+
if (text === '') {
|
|
178
|
+
return (
|
|
179
|
+
<div
|
|
180
|
+
key={`empty-${indent}`}
|
|
181
|
+
className="h-2"
|
|
182
|
+
data-cy="data-row-detail-line-empty"
|
|
183
|
+
></div>
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
const cleanText = decodeHTML(text);
|
|
187
|
+
return (
|
|
188
|
+
<div
|
|
189
|
+
key={cleanText}
|
|
190
|
+
className="whitespace-pre-wrap"
|
|
191
|
+
data-cy="data-row-detail-line"
|
|
192
|
+
>
|
|
193
|
+
{indentation}
|
|
194
|
+
<span className="font-medium">{cleanText}</span>
|
|
195
|
+
</div>
|
|
196
|
+
);
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
const renderDetails = (details: string[], variant: 'primary' | 'secondary') => {
|
|
200
|
+
const visibleLines = details.slice(0, 4);
|
|
201
|
+
const hiddenLines = details.slice(4);
|
|
202
|
+
|
|
203
|
+
return (
|
|
204
|
+
<Tooltip>
|
|
205
|
+
<TooltipTrigger asChild>
|
|
206
|
+
<div
|
|
207
|
+
className="cursor-help"
|
|
208
|
+
data-cy={`data-row-details-${variant}`}
|
|
209
|
+
>
|
|
210
|
+
<div className="flex flex-col space-y-1">
|
|
211
|
+
{visibleLines.map((line, lineIndex) =>
|
|
212
|
+
renderDetailText(line, line.startsWith(' ') ? 1 : 0)
|
|
213
|
+
)}
|
|
214
|
+
</div>
|
|
215
|
+
{hiddenLines.length > 0 && (
|
|
216
|
+
<div className="text-muted-foreground mt-1 flex items-center text-sm">
|
|
217
|
+
<span>...</span>
|
|
218
|
+
<Icons.Info className="mr-1 h-5 w-5" />
|
|
219
|
+
</div>
|
|
220
|
+
)}
|
|
221
|
+
</div>
|
|
222
|
+
</TooltipTrigger>
|
|
223
|
+
<TooltipContent
|
|
224
|
+
side="right"
|
|
225
|
+
align="start"
|
|
226
|
+
className="max-w-md"
|
|
227
|
+
>
|
|
228
|
+
<div className="text-secondary-foreground flex flex-col space-y-1 text-sm leading-normal">
|
|
229
|
+
{details.map((line, lineIndex) =>
|
|
230
|
+
renderDetailText(line, line.startsWith(' ') ? 1 : 0)
|
|
231
|
+
)}
|
|
232
|
+
</div>
|
|
233
|
+
</TooltipContent>
|
|
234
|
+
</Tooltip>
|
|
235
|
+
);
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
return (
|
|
239
|
+
<div
|
|
240
|
+
ref={ref}
|
|
241
|
+
className={cn('flex flex-col', !isVisible && 'opacity-60', className)}
|
|
242
|
+
>
|
|
243
|
+
<div
|
|
244
|
+
className={`flex items-center ${
|
|
245
|
+
isSelected ? 'bg-popover' : 'bg-muted'
|
|
246
|
+
} group relative cursor-pointer`}
|
|
247
|
+
onClick={onSelect}
|
|
248
|
+
data-cy="data-row"
|
|
249
|
+
>
|
|
250
|
+
{/* Secondary Selection Tint (below hover, always visible when secondary-selected) */}
|
|
251
|
+
{isSecondarySelected && (
|
|
252
|
+
<div className="bg-primary/20 pointer-events-none absolute inset-0"></div>
|
|
253
|
+
)}
|
|
254
|
+
|
|
255
|
+
<div className="bg-primary/20 pointer-events-none absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100"></div>
|
|
256
|
+
|
|
257
|
+
{/* Number Box */}
|
|
258
|
+
{number !== null && (
|
|
259
|
+
<div
|
|
260
|
+
className={`flex h-7 max-h-7 w-7 flex-shrink-0 items-center justify-center rounded-l border-r border-background text-base ${
|
|
261
|
+
isSelected ? 'bg-highlight text-black' : 'bg-muted text-muted-foreground'
|
|
262
|
+
} overflow-hidden`}
|
|
263
|
+
>
|
|
264
|
+
{number}
|
|
265
|
+
</div>
|
|
266
|
+
)}
|
|
267
|
+
|
|
268
|
+
{/* add some space if there is not segment index */}
|
|
269
|
+
{number === null && <div className="ml-1 h-7"></div>}
|
|
270
|
+
{colorHex && (
|
|
271
|
+
<div className="flex h-7 w-5 items-center justify-center">
|
|
272
|
+
<span
|
|
273
|
+
className="ml-2 h-2 w-2 rounded-full"
|
|
274
|
+
style={{ backgroundColor: colorHex }}
|
|
275
|
+
data-cy="data-row-colorhex"
|
|
276
|
+
></span>
|
|
277
|
+
</div>
|
|
278
|
+
)}
|
|
279
|
+
|
|
280
|
+
{/* Label with Conditional Tooltip */}
|
|
281
|
+
<div className="ml-2 flex-1 overflow-hidden">
|
|
282
|
+
{isTitleLong ? (
|
|
283
|
+
<Tooltip>
|
|
284
|
+
<TooltipTrigger asChild>
|
|
285
|
+
<span
|
|
286
|
+
data-cy="data-row-title"
|
|
287
|
+
className={`cursor-default text-base ${
|
|
288
|
+
isSelected ? 'text-highlight' : 'text-muted-foreground'
|
|
289
|
+
} [overflow:hidden] [display:-webkit-box] [-webkit-line-clamp:2] [-webkit-box-orient:vertical]`}
|
|
290
|
+
>
|
|
291
|
+
{title}
|
|
292
|
+
</span>
|
|
293
|
+
</TooltipTrigger>
|
|
294
|
+
<TooltipContent
|
|
295
|
+
side="top"
|
|
296
|
+
align="center"
|
|
297
|
+
>
|
|
298
|
+
{title}
|
|
299
|
+
</TooltipContent>
|
|
300
|
+
</Tooltip>
|
|
301
|
+
) : (
|
|
302
|
+
<span
|
|
303
|
+
data-cy="data-row-title"
|
|
304
|
+
className={`text-base ${
|
|
305
|
+
isSelected ? 'text-highlight' : 'text-muted-foreground'
|
|
306
|
+
} [overflow:hidden] [display:-webkit-box] [-webkit-line-clamp:2] [-webkit-box-orient:vertical]`}
|
|
307
|
+
>
|
|
308
|
+
{title}
|
|
309
|
+
</span>
|
|
310
|
+
)}
|
|
311
|
+
</div>
|
|
312
|
+
|
|
313
|
+
{/* Actions and Visibility Toggle */}
|
|
314
|
+
<div className="relative ml-2 flex items-center space-x-1">
|
|
315
|
+
{/* Visibility Toggle Icon */}
|
|
316
|
+
<Button
|
|
317
|
+
size="icon"
|
|
318
|
+
variant="ghost"
|
|
319
|
+
className={`h-6 w-6 transition-opacity ${
|
|
320
|
+
isSelected || !isVisible ? 'opacity-100' : 'opacity-0 group-hover:opacity-100'
|
|
321
|
+
}`}
|
|
322
|
+
aria-label={isVisible ? t('Hide') : t('Show')}
|
|
323
|
+
dataCY="data-row-visibility-toggle"
|
|
324
|
+
onClick={e => {
|
|
325
|
+
e.stopPropagation();
|
|
326
|
+
onToggleVisibility(e);
|
|
327
|
+
}}
|
|
328
|
+
>
|
|
329
|
+
{isVisible ? <Icons.Hide className="h-6 w-6" /> : <Icons.Show className="h-6 w-6" />}
|
|
330
|
+
</Button>
|
|
331
|
+
|
|
332
|
+
{/* Lock Icon (if needed) */}
|
|
333
|
+
{isLocked && !disableEditing && <Icons.Lock className="text-muted-foreground h-6 w-6" />}
|
|
334
|
+
|
|
335
|
+
{/* Status Components */}
|
|
336
|
+
{statusComponents}
|
|
337
|
+
|
|
338
|
+
{/* Actions Dropdown Menu */}
|
|
339
|
+
{disableEditing && <div className="h-6 w-6"></div>}
|
|
340
|
+
{!disableEditing && (
|
|
341
|
+
<DropdownMenu onOpenChange={open => setIsDropdownOpen(open)}>
|
|
342
|
+
<DropdownMenuTrigger asChild>
|
|
343
|
+
<Button
|
|
344
|
+
size="icon"
|
|
345
|
+
variant="ghost"
|
|
346
|
+
className={`h-6 w-6 transition-opacity ${
|
|
347
|
+
isSelected || isDropdownOpen
|
|
348
|
+
? 'opacity-100'
|
|
349
|
+
: 'opacity-0 group-hover:opacity-100'
|
|
350
|
+
}`}
|
|
351
|
+
aria-label="Actions"
|
|
352
|
+
dataCY="actionsMenuTrigger"
|
|
353
|
+
onClick={e => e.stopPropagation()} // Prevent row selection on button click
|
|
354
|
+
>
|
|
355
|
+
<Icons.More className="h-6 w-6" />
|
|
356
|
+
</Button>
|
|
357
|
+
</DropdownMenuTrigger>
|
|
358
|
+
<DropdownMenuContent
|
|
359
|
+
align="end"
|
|
360
|
+
// this was causing issue for auto focus on input dialog
|
|
361
|
+
onCloseAutoFocus={e => e.preventDefault()}
|
|
362
|
+
>
|
|
363
|
+
<>
|
|
364
|
+
<DropdownMenuItem onClick={e => handleAction('Rename', e)}>
|
|
365
|
+
<Icons.Rename className="text-foreground" />
|
|
366
|
+
<span
|
|
367
|
+
className="pl-2"
|
|
368
|
+
data-cy="Rename"
|
|
369
|
+
>
|
|
370
|
+
{t('Rename')}
|
|
371
|
+
</span>
|
|
372
|
+
</DropdownMenuItem>
|
|
373
|
+
{onCopy && (
|
|
374
|
+
<DropdownMenuItem onClick={e => handleAction('Copy', e)}>
|
|
375
|
+
<Icons.Copy className="text-foreground" />
|
|
376
|
+
<span
|
|
377
|
+
className="pl-2"
|
|
378
|
+
data-cy="Duplicate"
|
|
379
|
+
>
|
|
380
|
+
{t('Duplicate')}
|
|
381
|
+
</span>
|
|
382
|
+
</DropdownMenuItem>
|
|
383
|
+
)}
|
|
384
|
+
<DropdownMenuItem onClick={e => handleAction('Delete', e)}>
|
|
385
|
+
<Icons.Delete className="text-foreground" />
|
|
386
|
+
<span
|
|
387
|
+
className="pl-2"
|
|
388
|
+
data-cy="Delete"
|
|
389
|
+
>
|
|
390
|
+
{t('Delete')}
|
|
391
|
+
</span>
|
|
392
|
+
</DropdownMenuItem>
|
|
393
|
+
{onColor && (
|
|
394
|
+
<DropdownMenuItem onClick={e => handleAction('Color', e)}>
|
|
395
|
+
<Icons.ColorChange className="text-foreground" />
|
|
396
|
+
<span
|
|
397
|
+
className="pl-2"
|
|
398
|
+
data-cy="Change Color"
|
|
399
|
+
>
|
|
400
|
+
{t('Change Color')}
|
|
401
|
+
</span>
|
|
402
|
+
</DropdownMenuItem>
|
|
403
|
+
)}
|
|
404
|
+
<DropdownMenuItem onClick={e => handleAction('Lock', e)}>
|
|
405
|
+
<Icons.Lock className="text-foreground" />
|
|
406
|
+
<span
|
|
407
|
+
className="pl-2"
|
|
408
|
+
data-cy="LockToggle"
|
|
409
|
+
>
|
|
410
|
+
{isLocked ? t('Unlock') : t('Lock')}
|
|
411
|
+
</span>
|
|
412
|
+
</DropdownMenuItem>
|
|
413
|
+
</>
|
|
414
|
+
</DropdownMenuContent>
|
|
415
|
+
</DropdownMenu>
|
|
416
|
+
)}
|
|
417
|
+
</div>
|
|
418
|
+
</div>
|
|
419
|
+
|
|
420
|
+
{/* Details Section */}
|
|
421
|
+
{details && (details.primary?.length > 0 || details.secondary?.length > 0) && (
|
|
422
|
+
<div
|
|
423
|
+
className="ml-7 px-2 py-2"
|
|
424
|
+
data-cy="data-row-details"
|
|
425
|
+
>
|
|
426
|
+
<div className="text-secondary-foreground flex items-center gap-1 text-base leading-normal">
|
|
427
|
+
{details.primary?.length > 0 && renderDetails(details.primary, 'primary')}
|
|
428
|
+
{details.secondary?.length > 0 && (
|
|
429
|
+
<div className="text-muted-foreground ml-auto text-sm">
|
|
430
|
+
{renderDetails(details.secondary, 'secondary')}
|
|
431
|
+
</div>
|
|
432
|
+
)}
|
|
433
|
+
</div>
|
|
434
|
+
</div>
|
|
435
|
+
)}
|
|
436
|
+
</div>
|
|
437
|
+
);
|
|
438
|
+
};
|
|
439
|
+
|
|
440
|
+
DataRowComponent.displayName = 'DataRow';
|
|
441
|
+
|
|
442
|
+
interface StatusProps {
|
|
443
|
+
children: React.ReactNode;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
interface StatusIndicatorProps {
|
|
447
|
+
tooltip?: string;
|
|
448
|
+
icon: React.ReactNode;
|
|
449
|
+
defaultTooltip: string;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
const StatusIndicator: React.FC<StatusIndicatorProps> = ({ tooltip, icon, defaultTooltip }) => (
|
|
453
|
+
<Tooltip>
|
|
454
|
+
<TooltipTrigger asChild>
|
|
455
|
+
<div className="flex h-6 w-6 items-center justify-center">{icon}</div>
|
|
456
|
+
</TooltipTrigger>
|
|
457
|
+
<TooltipContent side="bottom">
|
|
458
|
+
<div>{tooltip || defaultTooltip}</div>
|
|
459
|
+
</TooltipContent>
|
|
460
|
+
</Tooltip>
|
|
461
|
+
);
|
|
462
|
+
|
|
463
|
+
const Status: React.FC<StatusProps> & {
|
|
464
|
+
Warning: React.FC<{ tooltip?: string }>;
|
|
465
|
+
Success: React.FC<{ tooltip?: string }>;
|
|
466
|
+
Error: React.FC<{ tooltip?: string }>;
|
|
467
|
+
Info: React.FC<{ tooltip?: string }>;
|
|
468
|
+
} = ({ children }) => {
|
|
469
|
+
return <>{children}</>;
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
const StatusWarning: React.FC<{ tooltip?: string }> = ({ tooltip }) => (
|
|
473
|
+
<StatusIndicator
|
|
474
|
+
tooltip={tooltip}
|
|
475
|
+
icon={
|
|
476
|
+
<Icons.ByName
|
|
477
|
+
name="status-alert"
|
|
478
|
+
className="h-4 w-4 text-yellow-500"
|
|
479
|
+
/>
|
|
480
|
+
}
|
|
481
|
+
defaultTooltip="Warning"
|
|
482
|
+
/>
|
|
483
|
+
);
|
|
484
|
+
|
|
485
|
+
const StatusSuccess: React.FC<{ tooltip?: string }> = ({ tooltip }) => (
|
|
486
|
+
<StatusIndicator
|
|
487
|
+
tooltip={tooltip}
|
|
488
|
+
icon={<Icons.Checked className="h-4 w-4 text-green-500" />}
|
|
489
|
+
defaultTooltip="Success"
|
|
490
|
+
/>
|
|
491
|
+
);
|
|
492
|
+
|
|
493
|
+
const StatusError: React.FC<{ tooltip?: string }> = ({ tooltip }) => (
|
|
494
|
+
<StatusIndicator
|
|
495
|
+
tooltip={tooltip}
|
|
496
|
+
icon={
|
|
497
|
+
<Icons.ByName
|
|
498
|
+
name="status-error"
|
|
499
|
+
className="h-4 w-4 text-red-500"
|
|
500
|
+
/>
|
|
501
|
+
}
|
|
502
|
+
defaultTooltip="Error"
|
|
503
|
+
/>
|
|
504
|
+
);
|
|
505
|
+
|
|
506
|
+
const StatusInfo: React.FC<{ tooltip?: string }> = ({ tooltip }) => (
|
|
507
|
+
<StatusIndicator
|
|
508
|
+
tooltip={tooltip}
|
|
509
|
+
icon={<Icons.Info className="text-primary h-4 w-4" />}
|
|
510
|
+
defaultTooltip="Info"
|
|
511
|
+
/>
|
|
512
|
+
);
|
|
513
|
+
|
|
514
|
+
Status.displayName = 'DataRow.Status';
|
|
515
|
+
StatusWarning.displayName = 'DataRow.Status.Warning';
|
|
516
|
+
StatusSuccess.displayName = 'DataRow.Status.Success';
|
|
517
|
+
StatusError.displayName = 'DataRow.Status.Error';
|
|
518
|
+
StatusInfo.displayName = 'DataRow.Status.Info';
|
|
519
|
+
|
|
520
|
+
Status.Warning = StatusWarning;
|
|
521
|
+
Status.Success = StatusSuccess;
|
|
522
|
+
Status.Error = StatusError;
|
|
523
|
+
Status.Info = StatusInfo;
|
|
524
|
+
|
|
525
|
+
const DataRow = DataRowComponent as typeof DataRowComponent & {
|
|
526
|
+
Status: typeof Status;
|
|
527
|
+
};
|
|
528
|
+
|
|
529
|
+
DataRow.Status = Status;
|
|
530
|
+
|
|
531
|
+
export default DataRow;
|
|
532
|
+
export { DataRow };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DataRow';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a single data item in a list or table structure
|
|
3
|
+
*
|
|
4
|
+
* @interface DataItem
|
|
5
|
+
*/
|
|
6
|
+
export type DataItem = {
|
|
7
|
+
/** Unique identifier for the data item */
|
|
8
|
+
id: number;
|
|
9
|
+
/** Primary text or name of the data item */
|
|
10
|
+
title: string;
|
|
11
|
+
/** Detailed text description of the data item */
|
|
12
|
+
description: string;
|
|
13
|
+
/** Additional optional field for extra information */
|
|
14
|
+
optionalField?: string;
|
|
15
|
+
/** Hex color code (e.g., '#FF0000') for visual representation */
|
|
16
|
+
colorHex?: string;
|
|
17
|
+
/** Additional details or metadata about the item */
|
|
18
|
+
details?: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Represents a group of related data items with a common type
|
|
23
|
+
*
|
|
24
|
+
* @interface ListGroup
|
|
25
|
+
*/
|
|
26
|
+
export type ListGroup = {
|
|
27
|
+
/** The type or category of the group */
|
|
28
|
+
type: string;
|
|
29
|
+
/** Array of DataItem objects belonging to this group */
|
|
30
|
+
items: DataItem[];
|
|
31
|
+
};
|