@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.
Files changed (434) hide show
  1. package/dist/ohif-ui-next.css +6 -6
  2. package/dist/ohif-ui-next.umd.js +4 -1838
  3. package/package.json +31 -14
  4. package/src/__mocks__/fileMock.js +7 -0
  5. package/src/assets/fonts.css +50 -0
  6. package/src/assets/styles.css +55 -0
  7. package/src/assets/woff2/latin.woff2 +0 -0
  8. package/src/components/Accordion/Accordion.tsx +70 -0
  9. package/src/components/Accordion/index.ts +3 -0
  10. package/src/components/AllInOneMenu/BackItem.tsx +32 -0
  11. package/src/components/AllInOneMenu/DividerItem.tsx +11 -0
  12. package/src/components/AllInOneMenu/HeaderItem.tsx +15 -0
  13. package/src/components/AllInOneMenu/IconMenu.tsx +83 -0
  14. package/src/components/AllInOneMenu/Item.tsx +51 -0
  15. package/src/components/AllInOneMenu/ItemPanel.tsx +38 -0
  16. package/src/components/AllInOneMenu/Menu.tsx +231 -0
  17. package/src/components/AllInOneMenu/PanelSelector.tsx +32 -0
  18. package/src/components/AllInOneMenu/SubMenu.tsx +36 -0
  19. package/src/components/AllInOneMenu/index.ts +42 -0
  20. package/src/components/BackgroundColorSelect/BackgroundColorSelect.tsx +38 -0
  21. package/src/components/BackgroundColorSelect/index.tsx +1 -0
  22. package/src/components/Badge/Badge.tsx +38 -0
  23. package/src/components/Badge/index.ts +1 -0
  24. package/src/components/Button/Button.tsx +65 -0
  25. package/src/components/Button/index.ts +1 -0
  26. package/src/components/Calendar/Calendar.tsx +258 -0
  27. package/src/components/Calendar/index.tsx +3 -0
  28. package/src/components/Card/Card.tsx +83 -0
  29. package/src/components/Card/index.ts +2 -0
  30. package/src/components/Checkbox/Checkbox.tsx +27 -0
  31. package/src/components/Checkbox/index.tsx +3 -0
  32. package/src/components/CinePlayer/CinePlayer.tsx +187 -0
  33. package/src/components/CinePlayer/index.ts +5 -0
  34. package/src/components/Clipboard/Clipboard.tsx +58 -0
  35. package/src/components/Clipboard/index.tsx +3 -0
  36. package/src/components/ColorCircle.tsx +12 -0
  37. package/src/components/Combobox/Combobox.tsx +66 -0
  38. package/src/components/Combobox/index.ts +3 -0
  39. package/src/components/Command/Command.tsx +149 -0
  40. package/src/components/Command/index.ts +23 -0
  41. package/src/components/ContextMenu/ContextMenu.tsx +202 -0
  42. package/src/components/ContextMenu/index.ts +35 -0
  43. package/src/components/ContextMenuViewport/ContextMenuViewport.tsx +47 -0
  44. package/src/components/ContextMenuViewport/index.ts +1 -0
  45. package/src/components/DataRow/DataRow.tsx +532 -0
  46. package/src/components/DataRow/index.ts +1 -0
  47. package/src/components/DataRow/types.ts +31 -0
  48. package/src/components/DataTable/ActionOverlayCell.tsx +153 -0
  49. package/src/components/DataTable/ColumnHeader.tsx +70 -0
  50. package/src/components/DataTable/DataTable.tsx +532 -0
  51. package/src/components/DataTable/FilterRow.tsx +52 -0
  52. package/src/components/DataTable/Pagination.tsx +78 -0
  53. package/src/components/DataTable/Title.tsx +5 -0
  54. package/src/components/DataTable/Toolbar.tsx +5 -0
  55. package/src/components/DataTable/ViewOptions.tsx +86 -0
  56. package/src/components/DataTable/context.tsx +21 -0
  57. package/src/components/DataTable/index.ts +5 -0
  58. package/src/components/DataTable/types.ts +27 -0
  59. package/src/components/DataTable/useResponsiveColumns.tsx +346 -0
  60. package/src/components/DateRange/DateRange.tsx +163 -0
  61. package/src/components/DateRange/index.ts +3 -0
  62. package/src/components/Dialog/Dialog.tsx +201 -0
  63. package/src/components/Dialog/index.ts +25 -0
  64. package/src/components/Dialog/useDraggable.ts +108 -0
  65. package/src/components/DisplaySetMessageListTooltip/DisplaySetMessageListTooltip.tsx +64 -0
  66. package/src/components/DisplaySetMessageListTooltip/index.ts +3 -0
  67. package/src/components/DoubleSlider/DoubleSlider.test.ts +232 -0
  68. package/src/components/DoubleSlider/DoubleSlider.tsx +211 -0
  69. package/src/components/DoubleSlider/index.tsx +3 -0
  70. package/src/components/DropdownMenu/DropdownMenu.tsx +213 -0
  71. package/src/components/DropdownMenu/index.ts +35 -0
  72. package/src/components/Errorboundary/ErrorBoundary.tsx +345 -0
  73. package/src/components/Errorboundary/index.tsx +3 -0
  74. package/src/components/FooterAction/FooterAction.tsx +115 -0
  75. package/src/components/FooterAction/index.tsx +3 -0
  76. package/src/components/Header/Header.tsx +140 -0
  77. package/src/components/Header/index.js +2 -0
  78. package/src/components/HoverCard/HoverCard.tsx +30 -0
  79. package/src/components/HoverCard/index.ts +1 -0
  80. package/src/components/Icons/Icons.tsx +852 -0
  81. package/src/components/Icons/Sources/ActionNewDialog.tsx +64 -0
  82. package/src/components/Icons/Sources/Actions.tsx +47 -0
  83. package/src/components/Icons/Sources/Add.tsx +51 -0
  84. package/src/components/Icons/Sources/Alert.tsx +32 -0
  85. package/src/components/Icons/Sources/AlertOutline.tsx +30 -0
  86. package/src/components/Icons/Sources/ArrowLeftBold.tsx +49 -0
  87. package/src/components/Icons/Sources/ArrowRight.tsx +25 -0
  88. package/src/components/Icons/Sources/Cancel.tsx +37 -0
  89. package/src/components/Icons/Sources/CheckBoxChecked.tsx +39 -0
  90. package/src/components/Icons/Sources/CheckBoxUnChecked.tsx +25 -0
  91. package/src/components/Icons/Sources/Checked.tsx +23 -0
  92. package/src/components/Icons/Sources/ChevronClosed.tsx +40 -0
  93. package/src/components/Icons/Sources/ChevronLeft.tsx +28 -0
  94. package/src/components/Icons/Sources/ChevronOpen.tsx +38 -0
  95. package/src/components/Icons/Sources/Clear.tsx +34 -0
  96. package/src/components/Icons/Sources/Clipboard.tsx +15 -0
  97. package/src/components/Icons/Sources/Close.tsx +28 -0
  98. package/src/components/Icons/Sources/CloudSettings.tsx +34 -0
  99. package/src/components/Icons/Sources/Code.tsx +7 -0
  100. package/src/components/Icons/Sources/ColorChange.tsx +100 -0
  101. package/src/components/Icons/Sources/ContentNext.tsx +35 -0
  102. package/src/components/Icons/Sources/ContentPrev.tsx +35 -0
  103. package/src/components/Icons/Sources/Controls.tsx +99 -0
  104. package/src/components/Icons/Sources/Copy.tsx +44 -0
  105. package/src/components/Icons/Sources/Database.tsx +33 -0
  106. package/src/components/Icons/Sources/Delete.tsx +58 -0
  107. package/src/components/Icons/Sources/DicomTagBrowser.tsx +79 -0
  108. package/src/components/Icons/Sources/DisplayFillAndOutline.tsx +49 -0
  109. package/src/components/Icons/Sources/DisplayFillOnly.tsx +40 -0
  110. package/src/components/Icons/Sources/DisplayOutlineOnly.tsx +40 -0
  111. package/src/components/Icons/Sources/Download.tsx +75 -0
  112. package/src/components/Icons/Sources/Export.tsx +53 -0
  113. package/src/components/Icons/Sources/ExternalLink.tsx +26 -0
  114. package/src/components/Icons/Sources/EyeHidden.tsx +32 -0
  115. package/src/components/Icons/Sources/EyeVisible.tsx +28 -0
  116. package/src/components/Icons/Sources/FeedbackComplete.tsx +35 -0
  117. package/src/components/Icons/Sources/GearSettings.tsx +59 -0
  118. package/src/components/Icons/Sources/GroupLayers.tsx +33 -0
  119. package/src/components/Icons/Sources/Helpers.tsx +398 -0
  120. package/src/components/Icons/Sources/Hide.tsx +45 -0
  121. package/src/components/Icons/Sources/IconColorLUT.tsx +103 -0
  122. package/src/components/Icons/Sources/IconMPR.tsx +55 -0
  123. package/src/components/Icons/Sources/IconTransferring.tsx +25 -0
  124. package/src/components/Icons/Sources/IllustrationNotFound.tsx +102 -0
  125. package/src/components/Icons/Sources/Info.tsx +55 -0
  126. package/src/components/Icons/Sources/InfoLink.tsx +23 -0
  127. package/src/components/Icons/Sources/InfoSeries.tsx +52 -0
  128. package/src/components/Icons/Sources/InvestigationalUse.tsx +82 -0
  129. package/src/components/Icons/Sources/JumpToSlice.tsx +69 -0
  130. package/src/components/Icons/Sources/LaunchArrow.tsx +34 -0
  131. package/src/components/Icons/Sources/LaunchInfo.tsx +38 -0
  132. package/src/components/Icons/Sources/LayerBackground.tsx +28 -0
  133. package/src/components/Icons/Sources/LayerForeground.tsx +34 -0
  134. package/src/components/Icons/Sources/LayerSegmentation.tsx +20 -0
  135. package/src/components/Icons/Sources/Layout.tsx +433 -0
  136. package/src/components/Icons/Sources/Link.tsx +58 -0
  137. package/src/components/Icons/Sources/ListView.tsx +79 -0
  138. package/src/components/Icons/Sources/LoadingOHIFMark.tsx +21 -0
  139. package/src/components/Icons/Sources/LoadingSpinner.tsx +49 -0
  140. package/src/components/Icons/Sources/Lock.tsx +35 -0
  141. package/src/components/Icons/Sources/Magnifier.tsx +37 -0
  142. package/src/components/Icons/Sources/Minus.tsx +40 -0
  143. package/src/components/Icons/Sources/MissingIcon.tsx +6 -0
  144. package/src/components/Icons/Sources/More.tsx +53 -0
  145. package/src/components/Icons/Sources/MultiplePatients.tsx +76 -0
  146. package/src/components/Icons/Sources/NavigationPanelReveal.tsx +25 -0
  147. package/src/components/Icons/Sources/NotificationInfo.tsx +33 -0
  148. package/src/components/Icons/Sources/NotificationWarning.tsx +44 -0
  149. package/src/components/Icons/Sources/OHIFLogo.tsx +72 -0
  150. package/src/components/Icons/Sources/OHIFLogoColorDarkBackground.tsx +78 -0
  151. package/src/components/Icons/Sources/OHIFLogoHorizontal.tsx +139 -0
  152. package/src/components/Icons/Sources/Opacity.tsx +106 -0
  153. package/src/components/Icons/Sources/OrientationSwitch.tsx +41 -0
  154. package/src/components/Icons/Sources/OrientationSwitchA.tsx +41 -0
  155. package/src/components/Icons/Sources/OrientationSwitchC.tsx +41 -0
  156. package/src/components/Icons/Sources/OrientationSwitchR.tsx +41 -0
  157. package/src/components/Icons/Sources/OrientationSwitchS.tsx +41 -0
  158. package/src/components/Icons/Sources/PanelRight.tsx +29 -0
  159. package/src/components/Icons/Sources/Patient.tsx +58 -0
  160. package/src/components/Icons/Sources/PatientStudyList.tsx +62 -0
  161. package/src/components/Icons/Sources/Pause.tsx +26 -0
  162. package/src/components/Icons/Sources/Pencil.tsx +16 -0
  163. package/src/components/Icons/Sources/Pin.tsx +50 -0
  164. package/src/components/Icons/Sources/PinFill.tsx +51 -0
  165. package/src/components/Icons/Sources/Play.tsx +25 -0
  166. package/src/components/Icons/Sources/Plus.tsx +29 -0
  167. package/src/components/Icons/Sources/PowerOff.tsx +19 -0
  168. package/src/components/Icons/Sources/Redo.tsx +51 -0
  169. package/src/components/Icons/Sources/Refresh.tsx +42 -0
  170. package/src/components/Icons/Sources/Rename.tsx +50 -0
  171. package/src/components/Icons/Sources/Search.tsx +35 -0
  172. package/src/components/Icons/Sources/SegActions.tsx +594 -0
  173. package/src/components/Icons/Sources/Series.tsx +47 -0
  174. package/src/components/Icons/Sources/SeriesPlaceholder.tsx +40 -0
  175. package/src/components/Icons/Sources/Settings.tsx +105 -0
  176. package/src/components/Icons/Sources/SettingsStudyList.tsx +28 -0
  177. package/src/components/Icons/Sources/Show.tsx +67 -0
  178. package/src/components/Icons/Sources/SidePanelCloseLeft.tsx +75 -0
  179. package/src/components/Icons/Sources/SidePanelCloseRight.tsx +74 -0
  180. package/src/components/Icons/Sources/SocialGithub.tsx +39 -0
  181. package/src/components/Icons/Sources/Sorting.tsx +39 -0
  182. package/src/components/Icons/Sources/SortingAscending.tsx +28 -0
  183. package/src/components/Icons/Sources/SortingDescending.tsx +26 -0
  184. package/src/components/Icons/Sources/SortingNew.tsx +20 -0
  185. package/src/components/Icons/Sources/SortingNewAscending.tsx +35 -0
  186. package/src/components/Icons/Sources/SortingNewDescending.tsx +35 -0
  187. package/src/components/Icons/Sources/StatusAlert.tsx +36 -0
  188. package/src/components/Icons/Sources/StatusError.tsx +57 -0
  189. package/src/components/Icons/Sources/StatusLocked.tsx +35 -0
  190. package/src/components/Icons/Sources/StatusSuccess.tsx +45 -0
  191. package/src/components/Icons/Sources/StatusTracking.tsx +37 -0
  192. package/src/components/Icons/Sources/StatusUntracked.tsx +30 -0
  193. package/src/components/Icons/Sources/StatusWarning.tsx +58 -0
  194. package/src/components/Icons/Sources/Tab4D.tsx +54 -0
  195. package/src/components/Icons/Sources/TabContours.tsx +63 -0
  196. package/src/components/Icons/Sources/TabLinear.tsx +47 -0
  197. package/src/components/Icons/Sources/TabPatientInfo.tsx +33 -0
  198. package/src/components/Icons/Sources/TabRoiThreshold.tsx +38 -0
  199. package/src/components/Icons/Sources/TabSegmentation.tsx +38 -0
  200. package/src/components/Icons/Sources/TabStudies.tsx +62 -0
  201. package/src/components/Icons/Sources/Threshold.tsx +38 -0
  202. package/src/components/Icons/Sources/ThumbnailView.tsx +67 -0
  203. package/src/components/Icons/Sources/Tools.tsx +3659 -0
  204. package/src/components/Icons/Sources/Trash.tsx +17 -0
  205. package/src/components/Icons/Sources/Undo.tsx +51 -0
  206. package/src/components/Icons/Sources/Upload.tsx +29 -0
  207. package/src/components/Icons/Sources/ViewportViews.tsx +45 -0
  208. package/src/components/Icons/Sources/ViewportWindowLevel.tsx +58 -0
  209. package/src/components/Icons/Sources/WindowLevelAdvanced.tsx +30 -0
  210. package/src/components/Icons/index.ts +4 -0
  211. package/src/components/Icons/types.ts +3 -0
  212. package/src/components/Input/Input.tsx +25 -0
  213. package/src/components/Input/index.tsx +3 -0
  214. package/src/components/InputFilter/InputFilter.tsx +200 -0
  215. package/src/components/InputFilter/index.ts +2 -0
  216. package/src/components/InputMultiSelect/InputMultiSelect.tsx +370 -0
  217. package/src/components/InputMultiSelect/index.ts +1 -0
  218. package/src/components/InputNumber/InputNumber.tsx +439 -0
  219. package/src/components/InputNumber/index.ts +3 -0
  220. package/src/components/InvestigationalUseDialog/InvestigationalUseDialog.tsx +98 -0
  221. package/src/components/InvestigationalUseDialog/index.ts +3 -0
  222. package/src/components/Label/Label.tsx +24 -0
  223. package/src/components/Label/index.tsx +3 -0
  224. package/src/components/Labelling/LabellingFlow.tsx +92 -0
  225. package/src/components/Labelling/index.ts +2 -0
  226. package/src/components/LayoutSelector/LayoutSelector.tsx +345 -0
  227. package/src/components/LayoutSelector/index.ts +4 -0
  228. package/src/components/LineChart/LineChart.css +40 -0
  229. package/src/components/LineChart/LineChart.tsx +101 -0
  230. package/src/components/LineChart/d3LineChart/chart.ts +365 -0
  231. package/src/components/LineChart/d3LineChart/events.ts +149 -0
  232. package/src/components/LineChart/d3LineChart/index.ts +3 -0
  233. package/src/components/LineChart/d3LineChart/lineChart.ts +272 -0
  234. package/src/components/LineChart/index.ts +1 -0
  235. package/src/components/LoadingIndicatorProgress/LoadingIndicatorProgress.tsx +29 -0
  236. package/src/components/LoadingIndicatorProgress/index.ts +2 -0
  237. package/src/components/LoadingIndicatorTotalPercent/LoadingIndicatorTotalPercent.tsx +49 -0
  238. package/src/components/LoadingIndicatorTotalPercent/index.ts +2 -0
  239. package/src/components/MeasurementTable/MeasurementTable.tsx +144 -0
  240. package/src/components/MeasurementTable/index.js +3 -0
  241. package/src/components/Modal/Modal.tsx +44 -0
  242. package/src/components/NavBar/NavBar.tsx +32 -0
  243. package/src/components/NavBar/index.js +2 -0
  244. package/src/components/Numeric/Numeric.test.ts +124 -0
  245. package/src/components/Numeric/Numeric.tsx +576 -0
  246. package/src/components/Numeric/index.ts +3 -0
  247. package/src/components/OHIFDialogs/InputDialog.tsx +287 -0
  248. package/src/components/OHIFDialogs/PresetDialog.tsx +106 -0
  249. package/src/components/OHIFDialogs/index.ts +2 -0
  250. package/src/components/OHIFModals/AboutModal.tsx +114 -0
  251. package/src/components/OHIFModals/AppearanceModal.tsx +38 -0
  252. package/src/components/OHIFModals/ImageModal.tsx +251 -0
  253. package/src/components/OHIFModals/UserPreferencesModal.tsx +229 -0
  254. package/src/components/OHIFModals/index.ts +4 -0
  255. package/src/components/OHIFPanels/WindowLevel.tsx +162 -0
  256. package/src/components/OHIFPanels/WindowLevelHistogram.tsx +237 -0
  257. package/src/components/OHIFPanels/index.ts +3 -0
  258. package/src/components/OHIFPanels/types.ts +41 -0
  259. package/src/components/OHIFToolSettings/RowDoubleRange.tsx +67 -0
  260. package/src/components/OHIFToolSettings/RowInputRange.tsx +65 -0
  261. package/src/components/OHIFToolSettings/RowSegmentedControl.tsx +77 -0
  262. package/src/components/OHIFToolSettings/ToolSettings.tsx +253 -0
  263. package/src/components/OHIFToolSettings/index.ts +1 -0
  264. package/src/components/OHIFToolbox/ToolboxUI.tsx +104 -0
  265. package/src/components/OHIFToolbox/index.ts +1 -0
  266. package/src/components/Onboarding/Onboarding.css +48 -0
  267. package/src/components/Onboarding/Onboarding.tsx +58 -0
  268. package/src/components/Onboarding/index.ts +3 -0
  269. package/src/components/Onboarding/utilities.ts +91 -0
  270. package/src/components/PanelSection/PanelSection.tsx +70 -0
  271. package/src/components/PanelSection/index.ts +2 -0
  272. package/src/components/Popover/Popover.tsx +35 -0
  273. package/src/components/Popover/index.ts +3 -0
  274. package/src/components/ProgressDropdown/ProgressDiscreteBar.tsx +24 -0
  275. package/src/components/ProgressDropdown/ProgressDropdown.tsx +158 -0
  276. package/src/components/ProgressDropdown/ProgressItem.tsx +27 -0
  277. package/src/components/ProgressDropdown/ProgressItemDetail.tsx +89 -0
  278. package/src/components/ProgressDropdown/index.ts +1 -0
  279. package/src/components/ProgressDropdown/types.ts +9 -0
  280. package/src/components/ProgressLoadingBar/ProgressLoadingBar.css +26 -0
  281. package/src/components/ProgressLoadingBar/ProgressLoadingBar.tsx +32 -0
  282. package/src/components/ProgressLoadingBar/index.ts +2 -0
  283. package/src/components/Resizable/Resizable.tsx +43 -0
  284. package/src/components/Resizable/index.ts +3 -0
  285. package/src/components/ScrollArea/ScrollArea.tsx +127 -0
  286. package/src/components/ScrollArea/index.tsx +3 -0
  287. package/src/components/SegmentationTable/AddSegmentRow.tsx +78 -0
  288. package/src/components/SegmentationTable/AddSegmentationRow.tsx +56 -0
  289. package/src/components/SegmentationTable/SegmentStatistics.tsx +104 -0
  290. package/src/components/SegmentationTable/SegmentationCollapsed.tsx +211 -0
  291. package/src/components/SegmentationTable/SegmentationExpanded.tsx +173 -0
  292. package/src/components/SegmentationTable/SegmentationHeader.tsx +58 -0
  293. package/src/components/SegmentationTable/SegmentationLabel.tsx +27 -0
  294. package/src/components/SegmentationTable/SegmentationSegments.tsx +206 -0
  295. package/src/components/SegmentationTable/SegmentationTable.tsx +169 -0
  296. package/src/components/SegmentationTable/SegmentationTableConfig.tsx +194 -0
  297. package/src/components/SegmentationTable/contexts/SegmentStatisticsContext.tsx +45 -0
  298. package/src/components/SegmentationTable/contexts/SegmentationExpandedContext.tsx +45 -0
  299. package/src/components/SegmentationTable/contexts/SegmentationTableContext.tsx +148 -0
  300. package/src/components/SegmentationTable/contexts/index.ts +15 -0
  301. package/src/components/SegmentationTable/index.ts +24 -0
  302. package/src/components/Select/Select.tsx +167 -0
  303. package/src/components/Select/index.tsx +40 -0
  304. package/src/components/Separator/Separator.tsx +32 -0
  305. package/src/components/Separator/index.ts +3 -0
  306. package/src/components/Separator/index.tsx +3 -0
  307. package/src/components/SidePanel/SidePanel.tsx +479 -0
  308. package/src/components/SidePanel/index.ts +2 -0
  309. package/src/components/Slider/Slider.tsx +24 -0
  310. package/src/components/Slider/index.tsx +3 -0
  311. package/src/components/SmartScrollbar/SmartScrollbar.tsx +349 -0
  312. package/src/components/SmartScrollbar/SmartScrollbarEndpoints.tsx +82 -0
  313. package/src/components/SmartScrollbar/SmartScrollbarFill.tsx +54 -0
  314. package/src/components/SmartScrollbar/SmartScrollbarIndicator.tsx +59 -0
  315. package/src/components/SmartScrollbar/SmartScrollbarTrack.tsx +104 -0
  316. package/src/components/SmartScrollbar/defaultSmartScrollbarIndicatorConfig.tsx +48 -0
  317. package/src/components/SmartScrollbar/index.ts +11 -0
  318. package/src/components/SmartScrollbar/useByteArray.ts +146 -0
  319. package/src/components/SmartScrollbar/utils.test.ts +124 -0
  320. package/src/components/SmartScrollbar/utils.ts +168 -0
  321. package/src/components/Sonner/Sonner.tsx +31 -0
  322. package/src/components/Sonner/index.ts +4 -0
  323. package/src/components/StudyBrowser/StudyBrowser.tsx +89 -0
  324. package/src/components/StudyBrowser/index.ts +2 -0
  325. package/src/components/StudyBrowserSort/StudyBrowserSort.tsx +87 -0
  326. package/src/components/StudyBrowserSort/index.ts +3 -0
  327. package/src/components/StudyBrowserViewOptions/StudyBrowserViewOptions.tsx +50 -0
  328. package/src/components/StudyBrowserViewOptions/index.ts +3 -0
  329. package/src/components/StudyItem/StudyItem.tsx +100 -0
  330. package/src/components/StudyItem/index.ts +2 -0
  331. package/src/components/StudyList/columns/defaultColumns.tsx +258 -0
  332. package/src/components/StudyList/components/ActionCell.tsx +19 -0
  333. package/src/components/StudyList/components/Layout.tsx +206 -0
  334. package/src/components/StudyList/components/PreviewContainer.tsx +45 -0
  335. package/src/components/StudyList/components/PreviewContent.tsx +186 -0
  336. package/src/components/StudyList/components/PreviewHeader.tsx +5 -0
  337. package/src/components/StudyList/components/PreviewPatientSummary.tsx +224 -0
  338. package/src/components/StudyList/components/PreviewSeriesList.tsx +64 -0
  339. package/src/components/StudyList/components/PreviewToggleButton.tsx +69 -0
  340. package/src/components/StudyList/components/SettingsPopover.tsx +214 -0
  341. package/src/components/StudyList/components/Table.tsx +247 -0
  342. package/src/components/StudyList/components/WorkflowMenu.tsx +72 -0
  343. package/src/components/StudyList/components/WorkflowsProvider.tsx +169 -0
  344. package/src/components/StudyList/hooks/useDefaultWorkflow.ts +60 -0
  345. package/src/components/StudyList/index.ts +52 -0
  346. package/src/components/StudyList/types/types.ts +42 -0
  347. package/src/components/StudyList/utils/tokenizeModalities.ts +6 -0
  348. package/src/components/StudySummary/StudySummary.tsx +27 -0
  349. package/src/components/StudySummary/index.tsx +3 -0
  350. package/src/components/Switch/Switch.tsx +28 -0
  351. package/src/components/Switch/index.tsx +3 -0
  352. package/src/components/Table/Table.tsx +134 -0
  353. package/src/components/Table/index.ts +11 -0
  354. package/src/components/Tabs/Tabs.tsx +56 -0
  355. package/src/components/Tabs/index.ts +3 -0
  356. package/src/components/Tabs/index.tsx +3 -0
  357. package/src/components/ThemeWrapper/ThemeWrapper.tsx +5 -0
  358. package/src/components/ThemeWrapper/index.ts +1 -0
  359. package/src/components/Thumbnail/Thumbnail.test.ts +71 -0
  360. package/src/components/Thumbnail/Thumbnail.tsx +351 -0
  361. package/src/components/Thumbnail/index.ts +2 -0
  362. package/src/components/ThumbnailList/ThumbnailList.tsx +94 -0
  363. package/src/components/ThumbnailList/index.ts +2 -0
  364. package/src/components/Toggle/Toggle.tsx +45 -0
  365. package/src/components/Toggle/index.ts +3 -0
  366. package/src/components/Toggle/index.tsx +3 -0
  367. package/src/components/ToggleGroup/ToggleGroup.tsx +63 -0
  368. package/src/components/ToggleGroup/index.ts +3 -0
  369. package/src/components/ToolButton/ToolButton.tsx +134 -0
  370. package/src/components/ToolButton/ToolButtonList.tsx +243 -0
  371. package/src/components/ToolButton/index.ts +8 -0
  372. package/src/components/Tooltip/Tooltip.tsx +34 -0
  373. package/src/components/Tooltip/index.ts +3 -0
  374. package/src/components/Viewport/ImageScrollbar.module.css +89 -0
  375. package/src/components/Viewport/ImageScrollbar.tsx +71 -0
  376. package/src/components/Viewport/PatientInfo.tsx +126 -0
  377. package/src/components/Viewport/ViewportActionArrows.tsx +36 -0
  378. package/src/components/Viewport/ViewportActionBar.tsx +107 -0
  379. package/src/components/Viewport/ViewportActionButton.tsx +25 -0
  380. package/src/components/Viewport/ViewportActionCorners.tsx +171 -0
  381. package/src/components/Viewport/ViewportGrid.tsx +24 -0
  382. package/src/components/Viewport/ViewportOverlay.css +32 -0
  383. package/src/components/Viewport/ViewportOverlay.tsx +54 -0
  384. package/src/components/Viewport/ViewportPane.tsx +82 -0
  385. package/src/components/Viewport/index.ts +9 -0
  386. package/src/components/ViewportDialog/ViewportDialog.tsx +128 -0
  387. package/src/components/ViewportDialog/index.ts +2 -0
  388. package/src/components/index.ts +323 -0
  389. package/src/contextProviders/ActiveThemeProvider.tsx +204 -0
  390. package/src/contextProviders/CineProvider.tsx +98 -0
  391. package/src/contextProviders/DialogProvider.tsx +103 -0
  392. package/src/contextProviders/DragAndDropProvider.tsx +37 -0
  393. package/src/contextProviders/IconPresentationProvider.tsx +88 -0
  394. package/src/contextProviders/ImageViewerProvider.tsx +15 -0
  395. package/src/contextProviders/ManagedDialog.tsx +176 -0
  396. package/src/contextProviders/ModalProvider.tsx +102 -0
  397. package/src/contextProviders/NotificationProvider.tsx +246 -0
  398. package/src/contextProviders/UserAuthenticationProvider.tsx +118 -0
  399. package/src/contextProviders/ViewportDialogProvider.tsx +42 -0
  400. package/src/contextProviders/ViewportGridProvider.tsx +556 -0
  401. package/src/contextProviders/index.ts +26 -0
  402. package/src/hooks/index.ts +4 -0
  403. package/src/hooks/useDynamicMaxHeight.ts +105 -0
  404. package/src/hooks/useSessionStorage.test.js +103 -0
  405. package/src/hooks/useSessionStorage.tsx +71 -0
  406. package/src/index.ts +7 -0
  407. package/src/lib/utils.ts +6 -0
  408. package/src/tailwind.css +266 -0
  409. package/src/themes/arctic.json +31 -0
  410. package/src/themes/deep.json +31 -0
  411. package/src/themes/index.ts +16 -0
  412. package/src/themes/midnight.json +31 -0
  413. package/src/themes/orchid.json +31 -0
  414. package/src/themes/slate.json +31 -0
  415. package/src/themes/themes.css +206 -0
  416. package/src/themes/verdant.json +31 -0
  417. package/src/types/ActionCorners.ts +18 -0
  418. package/src/types/AppTypes.ts +24 -0
  419. package/src/types/ContextMenuItem.ts +9 -0
  420. package/src/types/Predicate.ts +1 -0
  421. package/src/types/ThumbnailType.ts +3 -0
  422. package/src/types/ViewportActionCornersTypes.ts +13 -0
  423. package/src/types/global.d.ts +4 -0
  424. package/src/types/index.ts +21 -0
  425. package/src/utils/formatDICOMDate.test.ts +61 -0
  426. package/src/utils/formatDICOMDate.ts +65 -0
  427. package/src/utils/formatDICOMTime.test.ts +62 -0
  428. package/src/utils/formatDICOMTime.ts +49 -0
  429. package/src/utils/getToggledClassName.tsx +5 -0
  430. package/src/utils/index.ts +15 -0
  431. package/src/utils/parseStudyDateTimestamp.test.ts +47 -0
  432. package/src/utils/parseStudyDateTimestamp.ts +27 -0
  433. package/src/utils/roundNumber.ts +43 -0
  434. package/tailwind.config.js +120 -0
@@ -0,0 +1,439 @@
1
+ import * as React from 'react';
2
+ import { cn } from '../../lib/utils';
3
+ import { Input } from '../Input/Input';
4
+ import { Button } from '../Button/Button';
5
+ import { ChevronUp, ChevronDown, ChevronLeft, ChevronRight } from 'lucide-react';
6
+
7
+ // Calculate decimal places based on step
8
+ const getDecimalPlaces = (step: number): number => {
9
+ if (Number.isInteger(step)) {
10
+ return 0;
11
+ }
12
+ const stepStr = step.toString();
13
+ if (stepStr.includes('.')) {
14
+ return stepStr.split('.')[1].length;
15
+ }
16
+ return 0;
17
+ };
18
+
19
+ // Enhanced context type - includes shared constraints
20
+ type InputNumberContextType = {
21
+ value: number | string;
22
+ setValue: React.Dispatch<React.SetStateAction<number | string>>;
23
+ onChange: (value: number) => void;
24
+ // Shared constraints that can be used by subcomponents
25
+ constraints?: {
26
+ min?: number;
27
+ max?: number;
28
+ step?: number;
29
+ disabled?: boolean;
30
+ };
31
+ };
32
+
33
+ // Create context
34
+ const InputNumberContext = React.createContext<InputNumberContextType | undefined>(undefined);
35
+
36
+ // Hook to use context
37
+ const useInputNumber = () => {
38
+ const context = React.useContext(InputNumberContext);
39
+ if (!context) {
40
+ throw new Error('useInputNumber must be used within an <InputNumber> component');
41
+ }
42
+ return context;
43
+ };
44
+
45
+ // Simplified root component props
46
+ export interface InputNumberProps {
47
+ value: number;
48
+ onChange: (value: number) => void;
49
+ className?: string;
50
+ children?: React.ReactNode;
51
+ }
52
+
53
+ // The single top-level InputNumber component - much simpler now
54
+ const InputNumber = ({
55
+ value,
56
+ onChange,
57
+ className,
58
+ children,
59
+ ref,
60
+ ...props
61
+ }: InputNumberProps & { ref?: React.Ref<HTMLDivElement> }) => {
62
+ const [inputValue, setInputValue] = React.useState<number | string>(value);
63
+
64
+ // Update internal state when prop changes
65
+ React.useEffect(() => {
66
+ setInputValue(value);
67
+ }, [value]);
68
+
69
+ // Context value - only core state
70
+ const contextValue = React.useMemo(
71
+ () => ({
72
+ value: inputValue,
73
+ setValue: setInputValue,
74
+ onChange,
75
+ }),
76
+ [inputValue, onChange]
77
+ );
78
+
79
+ return (
80
+ <InputNumberContext.Provider value={contextValue}>
81
+ <div
82
+ ref={ref}
83
+ className={cn('flex', className)}
84
+ {...props}
85
+ >
86
+ {children}
87
+ </div>
88
+ </InputNumberContext.Provider>
89
+ );
90
+ };
91
+
92
+ InputNumber.displayName = 'InputNumber';
93
+
94
+ // Input component with its own constraints
95
+ export interface InputNumberInputProps
96
+ extends Omit<React.ComponentProps<typeof Input>, 'onChange'> {
97
+ min?: number;
98
+ max?: number;
99
+ step?: number;
100
+ }
101
+
102
+ const InputNumberInput = ({ className, min, max, step, ref, ...props }: InputNumberInputProps) => {
103
+ // Get context which may include constraints from parent
104
+ const { value, setValue, onChange, constraints = {} } = useInputNumber();
105
+
106
+ // Use provided props or fall back to parent constraints or defaults
107
+ const effectiveMin = min ?? constraints.min ?? 0;
108
+ const effectiveMax = max ?? constraints.max ?? 100;
109
+ const effectiveStep = step ?? constraints.step ?? 1;
110
+ const decimalPlaces = getDecimalPlaces(effectiveStep);
111
+
112
+ // Format displayed value with proper decimal places
113
+ const displayValue = React.useMemo(() => {
114
+ if (typeof value === 'string') {
115
+ return value;
116
+ }
117
+ return decimalPlaces > 0 ? value.toFixed(decimalPlaces) : value.toString();
118
+ }, [value, decimalPlaces]);
119
+
120
+ // Handle input change with constraint awareness
121
+ const handleInputChange = React.useCallback(
122
+ (e: React.ChangeEvent<HTMLInputElement>) => {
123
+ const val = e.target.value;
124
+
125
+ // Allow empty string, minus sign, or decimal point for flexibility
126
+ if (val === '' || val === '-' || val === '.') {
127
+ setValue(val);
128
+ return;
129
+ }
130
+
131
+ const numValue = Number(val);
132
+ if (!isNaN(numValue)) {
133
+ setValue(numValue);
134
+ // Only call onChange if value is within boundaries
135
+ if (numValue >= effectiveMin && numValue <= effectiveMax) {
136
+ onChange(numValue);
137
+ }
138
+ }
139
+ },
140
+ [effectiveMin, effectiveMax, onChange, setValue]
141
+ );
142
+
143
+ // Handle blur to format and validate
144
+ const handleBlur = React.useCallback(() => {
145
+ if (typeof value === 'string') {
146
+ // Handle empty or partial inputs
147
+ if (value === '' || value === '-' || value === '.') {
148
+ setValue(effectiveMin);
149
+ onChange(effectiveMin);
150
+ return;
151
+ }
152
+
153
+ const numValue = parseFloat(value);
154
+ if (isNaN(numValue)) {
155
+ setValue(effectiveMin);
156
+ onChange(effectiveMin);
157
+ return;
158
+ }
159
+
160
+ // Constrain value to min/max
161
+ const boundedValue = Math.max(effectiveMin, Math.min(effectiveMax, numValue));
162
+ setValue(boundedValue);
163
+ onChange(boundedValue);
164
+ }
165
+ }, [value, effectiveMin, effectiveMax, onChange, setValue]);
166
+
167
+ return (
168
+ <Input
169
+ ref={ref}
170
+ type="text"
171
+ value={displayValue}
172
+ onChange={handleInputChange}
173
+ onBlur={handleBlur}
174
+ className={cn(
175
+ 'h-6 appearance-none border-none p-0 text-center shadow-none focus:border-none focus:outline-none',
176
+ className
177
+ )}
178
+ {...props}
179
+ />
180
+ );
181
+ };
182
+
183
+ InputNumberInput.displayName = 'InputNumber.Input';
184
+
185
+ // Label component with position prop
186
+ export interface InputNumberLabelProps extends React.HTMLAttributes<HTMLLabelElement> {
187
+ position?: 'left' | 'right' | 'top' | 'bottom';
188
+ }
189
+
190
+ const InputNumberLabel = ({
191
+ className,
192
+ position = 'left',
193
+ children,
194
+ ref,
195
+ ...props
196
+ }: InputNumberLabelProps & { ref?: React.Ref<HTMLLabelElement> }) => {
197
+ const positionClasses = {
198
+ left: 'mr-2',
199
+ right: 'ml-2',
200
+ top: 'mb-1',
201
+ bottom: 'mt-1',
202
+ };
203
+
204
+ return (
205
+ <label
206
+ ref={ref}
207
+ className={cn('text-muted-foreground text-xs', positionClasses[position], className)}
208
+ {...props}
209
+ >
210
+ {children}
211
+ </label>
212
+ );
213
+ };
214
+
215
+ InputNumberLabel.displayName = 'InputNumber.Label';
216
+
217
+ // Container for horizontal button layout with constraints that are shared via context
218
+ export interface InputNumberHorizontalControlsProps extends React.HTMLAttributes<HTMLDivElement> {
219
+ min?: number;
220
+ max?: number;
221
+ step?: number;
222
+ disabled?: boolean;
223
+ }
224
+
225
+ const InputNumberHorizontalControls = ({
226
+ className,
227
+ children,
228
+ min = 0,
229
+ max = 100,
230
+ step = 1,
231
+ disabled = false,
232
+ ref,
233
+ ...props
234
+ }: InputNumberHorizontalControlsProps & { ref?: React.Ref<HTMLDivElement> }) => {
235
+ // Get existing context and enhance it with constraints
236
+ const context = useInputNumber();
237
+ const { value, onChange } = context;
238
+
239
+ // Provide the constraints to children rather than writing them onto the context
240
+ // object. The root re-creates its context value whenever the input value
241
+ // changes, which silently discarded a mutated `constraints` on every keystroke
242
+ // until the effect re-ran - and children that had already rendered never saw it
243
+ // at all. Extending the context here means children have the constraints on
244
+ // their first render.
245
+ const contextWithConstraints = { ...context, constraints: { min, max, step, disabled } };
246
+
247
+ // Increment function with local constraints
248
+ const increment = React.useCallback(() => {
249
+ if (disabled) {
250
+ return;
251
+ }
252
+
253
+ const currentValue = typeof value === 'string' ? parseFloat(value) || min : value;
254
+ const newValue = Math.min(currentValue + step, max);
255
+ onChange(newValue);
256
+ }, [value, min, max, step, onChange, disabled]);
257
+
258
+ // Decrement function with local constraints
259
+ const decrement = React.useCallback(() => {
260
+ if (disabled) {
261
+ return;
262
+ }
263
+
264
+ const currentValue = typeof value === 'string' ? parseFloat(value) || min : value;
265
+ const newValue = Math.max(currentValue - step, min);
266
+ onChange(newValue);
267
+ }, [value, min, max, step, onChange, disabled]);
268
+
269
+ return (
270
+ <InputNumberContext.Provider value={contextWithConstraints}>
271
+ <div
272
+ ref={ref}
273
+ className={cn('flex flex-row items-center', className)}
274
+ {...props}
275
+ >
276
+ <Button
277
+ variant="ghost"
278
+ size="icon"
279
+ onClick={decrement}
280
+ disabled={disabled}
281
+ className="text-primary h-6 w-4 cursor-pointer p-0"
282
+ >
283
+ <ChevronLeft className="h-4 w-4" />
284
+ </Button>
285
+
286
+ {children}
287
+
288
+ <Button
289
+ variant="ghost"
290
+ size="icon"
291
+ onClick={increment}
292
+ disabled={disabled}
293
+ className="text-primary h-6 w-4 cursor-pointer p-0"
294
+ >
295
+ <ChevronRight className="h-4 w-4" />
296
+ </Button>
297
+ </div>
298
+ </InputNumberContext.Provider>
299
+ );
300
+ };
301
+
302
+ InputNumberHorizontalControls.displayName = 'InputNumber.HorizontalControls';
303
+
304
+ // Vertical controls with its own constraints
305
+ export interface InputNumberVerticalControlsProps extends React.HTMLAttributes<HTMLDivElement> {
306
+ min?: number;
307
+ max?: number;
308
+ step?: number;
309
+ disabled?: boolean;
310
+ }
311
+
312
+ const InputNumberVerticalControls = ({
313
+ className,
314
+ children,
315
+ min = 0,
316
+ max = 100,
317
+ step = 1,
318
+ disabled = false,
319
+ ref,
320
+ ...props
321
+ }: InputNumberVerticalControlsProps & { ref?: React.Ref<HTMLDivElement> }) => {
322
+ // Get existing context and enhance it with constraints
323
+ const context = useInputNumber();
324
+ const { value, onChange } = context;
325
+
326
+ // Provide the constraints to children rather than writing them onto the context
327
+ // object. The root re-creates its context value whenever the input value
328
+ // changes, which silently discarded a mutated `constraints` on every keystroke
329
+ // until the effect re-ran - and children that had already rendered never saw it
330
+ // at all. Extending the context here means children have the constraints on
331
+ // their first render.
332
+ const contextWithConstraints = { ...context, constraints: { min, max, step, disabled } };
333
+
334
+ // Increment function with local constraints
335
+ const increment = React.useCallback(() => {
336
+ if (disabled) {
337
+ return;
338
+ }
339
+
340
+ const currentValue = typeof value === 'string' ? parseFloat(value) || min : value;
341
+ const newValue = Math.min(currentValue + step, max);
342
+ onChange(newValue);
343
+ }, [value, min, max, step, onChange, disabled]);
344
+
345
+ // Decrement function with local constraints
346
+ const decrement = React.useCallback(() => {
347
+ if (disabled) {
348
+ return;
349
+ }
350
+
351
+ const currentValue = typeof value === 'string' ? parseFloat(value) || min : value;
352
+ const newValue = Math.max(currentValue - step, min);
353
+ onChange(newValue);
354
+ }, [value, min, max, step, onChange, disabled]);
355
+
356
+ return (
357
+ <InputNumberContext.Provider value={contextWithConstraints}>
358
+ <div
359
+ ref={ref}
360
+ className={cn('flex items-center', className)}
361
+ {...props}
362
+ >
363
+ {children}
364
+ <div className="ml-1 flex flex-col">
365
+ <Button
366
+ variant="ghost"
367
+ size="icon"
368
+ onClick={increment}
369
+ disabled={disabled}
370
+ className="text-primary h-3 w-5 pr-px"
371
+ >
372
+ <ChevronUp className="h-3 w-3" />
373
+ </Button>
374
+ <Button
375
+ variant="ghost"
376
+ size="icon"
377
+ onClick={decrement}
378
+ disabled={disabled}
379
+ className="text-primary h-3 w-5 pr-px"
380
+ >
381
+ <ChevronDown className="h-3 w-3" />
382
+ </Button>
383
+ </div>
384
+ </div>
385
+ </InputNumberContext.Provider>
386
+ );
387
+ };
388
+
389
+ InputNumberVerticalControls.displayName = 'InputNumber.VerticalControls';
390
+
391
+ // Container with size prop
392
+ const sizesClasses = {
393
+ sm: 'w-[45px] h-[28px]',
394
+ md: 'w-[58px] h-[28px]',
395
+ lg: 'w-[206px] h-[35px]',
396
+ };
397
+
398
+ export interface InputNumberContainerProps extends React.HTMLAttributes<HTMLDivElement> {
399
+ size?: 'sm' | 'md' | 'lg';
400
+ sizeClassName?: string;
401
+ }
402
+
403
+ const InputNumberContainer = ({
404
+ className,
405
+ size = 'md',
406
+ sizeClassName,
407
+ children,
408
+ ref,
409
+ ...props
410
+ }: InputNumberContainerProps & { ref?: React.Ref<HTMLDivElement> }) => {
411
+ const sizeToUse = sizeClassName || sizesClasses[size];
412
+
413
+ return (
414
+ <div
415
+ ref={ref}
416
+ className={cn(
417
+ 'bg-background border-input flex items-center rounded-md border',
418
+ sizeToUse,
419
+ className
420
+ )}
421
+ {...props}
422
+ >
423
+ {children}
424
+ </div>
425
+ );
426
+ };
427
+
428
+ InputNumberContainer.displayName = 'InputNumber.Container';
429
+
430
+ // Attach subcomponents
431
+ Object.assign(InputNumber, {
432
+ Input: InputNumberInput,
433
+ Label: InputNumberLabel,
434
+ Container: InputNumberContainer,
435
+ HorizontalControls: InputNumberHorizontalControls,
436
+ VerticalControls: InputNumberVerticalControls,
437
+ });
438
+
439
+ export { InputNumber };
@@ -0,0 +1,3 @@
1
+ import { InputNumber } from './InputNumber';
2
+ export { InputNumber };
3
+ export type { InputNumberProps } from './InputNumber';
@@ -0,0 +1,98 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import { Icons } from '@ohif/ui-next';
3
+ import { Button } from '../Button';
4
+ import { useTranslation } from 'react-i18next';
5
+
6
+ export enum showDialogOption {
7
+ NeverShowDialog = 'never',
8
+ AlwaysShowDialog = 'always',
9
+ ShowOnceAndConfigure = 'configure',
10
+ }
11
+
12
+ const InvestigationalUseDialog = ({
13
+ dialogConfiguration = {
14
+ option: showDialogOption.AlwaysShowDialog,
15
+ },
16
+ }) => {
17
+ const { option, days } = dialogConfiguration;
18
+ const [isHidden, setIsHidden] = useState(true);
19
+ const { t } = useTranslation('InvestigationalUseDialog');
20
+
21
+ useEffect(() => {
22
+ const dialogLocalState = localStorage.getItem('investigationalUseDialog');
23
+ const dialogSessionState = sessionStorage.getItem('investigationalUseDialog');
24
+
25
+ switch (option) {
26
+ case showDialogOption.NeverShowDialog:
27
+ setIsHidden(true);
28
+ break;
29
+ case showDialogOption.AlwaysShowDialog:
30
+ setIsHidden(!!dialogSessionState);
31
+ break;
32
+ case showDialogOption.ShowOnceAndConfigure:
33
+ if (dialogLocalState) {
34
+ const { expiryDate } = JSON.parse(dialogLocalState);
35
+ const isExpired = new Date() > new Date(expiryDate);
36
+ setIsHidden(!isExpired);
37
+ } else {
38
+ setIsHidden(false);
39
+ }
40
+ break;
41
+ default:
42
+ setIsHidden(true);
43
+ }
44
+ }, [option, days]);
45
+
46
+ const handleConfirmAndHide = () => {
47
+ const expiryDate = new Date();
48
+
49
+ switch (option) {
50
+ case showDialogOption.ShowOnceAndConfigure:
51
+ expiryDate.setDate(expiryDate.getDate() + days);
52
+ localStorage.setItem('investigationalUseDialog', JSON.stringify({ expiryDate }));
53
+ break;
54
+ case showDialogOption.AlwaysShowDialog:
55
+ sessionStorage.setItem('investigationalUseDialog', 'hidden');
56
+ break;
57
+ }
58
+ setIsHidden(true);
59
+ };
60
+
61
+ if (isHidden) {
62
+ return null;
63
+ }
64
+
65
+ return (
66
+ <div className="fixed bottom-2 z-50 flex h-[86px] w-full justify-center">
67
+ <div className="bg-popover border-muted flex w-[90%] items-center justify-between rounded-lg border-2 pl-[22px] pr-[22px] pt-[10px] pb-[10px] shadow-lg">
68
+ <div className="flex items-center gap-4">
69
+ <Icons.InvestigationalUse className="h-18 w-18" />
70
+ <div className="flex flex-col">
71
+ <div className="text-foreground text-[19px]">
72
+ OHIF Viewer is{' '}
73
+ <span className="text-highlight">{t('for investigational use only')}</span>
74
+ </div>
75
+ <div className="text-foreground text-[13px]">
76
+ <span
77
+ className="text-primary cursor-pointer"
78
+ onClick={() => window.open('https://ohif.org/', '_blank')}
79
+ >
80
+ {t('Learn more about OHIF Viewer')}
81
+ </span>
82
+ </div>
83
+ </div>
84
+ </div>
85
+ <Button
86
+ onClick={handleConfirmAndHide}
87
+ dataCY="confirm-and-hide-button"
88
+ >
89
+ {t('Confirm and hide')}
90
+ </Button>
91
+ </div>
92
+ </div>
93
+ );
94
+ };
95
+
96
+
97
+
98
+ export default InvestigationalUseDialog;
@@ -0,0 +1,3 @@
1
+ import InvestigationalUseDialog from './InvestigationalUseDialog';
2
+
3
+ export default InvestigationalUseDialog;
@@ -0,0 +1,24 @@
1
+ import * as React from 'react';
2
+ import * as LabelPrimitive from '@radix-ui/react-label';
3
+ import { cva, type VariantProps } from 'class-variance-authority';
4
+
5
+ import { cn } from '../../lib/utils';
6
+
7
+ const labelVariants = cva(
8
+ 'text-base text-foreground font-normal leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70'
9
+ );
10
+
11
+ const Label = ({
12
+ className,
13
+ ref,
14
+ ...props
15
+ }: React.ComponentProps<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>) => (
16
+ <LabelPrimitive.Root
17
+ ref={ref}
18
+ className={cn(labelVariants(), className)}
19
+ {...props}
20
+ />
21
+ );
22
+ Label.displayName = LabelPrimitive.Root.displayName;
23
+
24
+ export { Label };
@@ -0,0 +1,3 @@
1
+ import { Label } from './Label';
2
+
3
+ export { Label };
@@ -0,0 +1,92 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import { CheckIcon } from '@radix-ui/react-icons';
3
+ import cloneDeep from 'lodash.clonedeep';
4
+ import {
5
+ Command,
6
+ CommandEmpty,
7
+ CommandGroup,
8
+ CommandInput,
9
+ CommandItem,
10
+ CommandList,
11
+ } from '../Command/Command'; // Assuming Command is in ../Command relative path
12
+ import { cn } from '../../lib/utils'; // Assuming cn utility is here
13
+ import { ScrollArea } from '../ScrollArea/ScrollArea'; // Import ScrollArea
14
+
15
+ interface PropType {
16
+ labellingDoneCallback: (label: string) => void;
17
+ measurementData: any; // Keep any for now as per instructions
18
+ labelData: LabelInfo[]; // Use LabelInfo[] for better type safety
19
+ exclusive: boolean;
20
+ hide: () => void; // Add hide prop explicitly
21
+ placeholder?: string; // Optional placeholder for input
22
+ emptyMessage?: string; // Optional message for empty results
23
+ initialLabel?: string; // Optional initial selected label
24
+ }
25
+
26
+ export interface LabelInfo {
27
+ label: string;
28
+ value: string;
29
+ }
30
+
31
+ // Convert to Functional Component
32
+ const LabellingFlow: React.FC<PropType> = ({
33
+ labellingDoneCallback,
34
+ measurementData,
35
+ labelData,
36
+ exclusive,
37
+ hide,
38
+ placeholder = 'Type label or search...',
39
+ emptyMessage = 'No labels found.',
40
+ initialLabel,
41
+ }) => {
42
+ // State for the selected value
43
+ const [value, setValue] = useState<string | undefined>(initialLabel);
44
+ const [currentItems, setCurrentItems] = useState<LabelInfo[]>([]);
45
+
46
+ // Update items when labelData changes
47
+ useEffect(() => {
48
+ if (labelData) {
49
+ setCurrentItems(cloneDeep(labelData));
50
+ }
51
+ }, [labelData]);
52
+
53
+ // Original component used measurementData?.label in constructor,
54
+ // let's try to initialize based on that if initialLabel is not provided.
55
+ useEffect(() => {
56
+ if (!initialLabel && measurementData?.label) {
57
+ setValue(measurementData.label);
58
+ }
59
+ }, [initialLabel, measurementData]);
60
+
61
+ return (
62
+ <Command className="border-input border">
63
+ <CommandInput placeholder={placeholder} />
64
+ <CommandList>
65
+ <CommandEmpty>{emptyMessage}</CommandEmpty>
66
+ <ScrollArea className="h-[300px]">
67
+ <CommandGroup>
68
+ {currentItems.map(item => (
69
+ <CommandItem
70
+ key={item.value}
71
+ value={item.value}
72
+ onSelect={currentValue => {
73
+ const newValue = currentValue === value ? '' : currentValue;
74
+ setValue(newValue);
75
+ labellingDoneCallback(newValue);
76
+ hide();
77
+ }}
78
+ >
79
+ <CheckIcon
80
+ className={cn('mr-2 h-4 w-4', value === item.value ? 'opacity-100' : 'opacity-0')}
81
+ />
82
+ {item.label}
83
+ </CommandItem>
84
+ ))}
85
+ </CommandGroup>
86
+ </ScrollArea>
87
+ </CommandList>
88
+ </Command>
89
+ );
90
+ };
91
+
92
+ export default LabellingFlow;
@@ -0,0 +1,2 @@
1
+ import LabellingFlow from './LabellingFlow';
2
+ export default LabellingFlow;