@ohif/ui-next 3.14.0-beta.11 → 3.14.0-beta.111

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 +16 -0
  301. package/src/components/SegmentationTable/index.ts +27 -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 +330 -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,50 @@
1
+ import React from 'react';
2
+ import {
3
+ DropdownMenu,
4
+ DropdownMenuTrigger,
5
+ DropdownMenuContent,
6
+ DropdownMenuItem,
7
+ } from '../DropdownMenu/DropdownMenu';
8
+ import { Tooltip, TooltipContent, TooltipTrigger } from '../Tooltip';
9
+
10
+ export function StudyBrowserViewOptions({ tabs, onSelectTab, activeTabName }: withAppTypes) {
11
+ const handleTabChange = (tabName: string) => {
12
+ onSelectTab(tabName);
13
+ };
14
+
15
+ const activeTab = tabs.find(tab => tab.name === activeTabName);
16
+
17
+ return (
18
+ <DropdownMenu>
19
+ <Tooltip>
20
+ <TooltipTrigger className="w-full w-[50%] overflow-hidden">
21
+ <DropdownMenuTrigger className="border-input focus:border-input text-foreground flex h-[26px] w-full items-center justify-start rounded border bg-background p-2 text-base">
22
+ {activeTab?.label}
23
+ </DropdownMenuTrigger>
24
+ </TooltipTrigger>
25
+ <TooltipContent>{activeTab?.label}</TooltipContent>
26
+ </Tooltip>
27
+ <DropdownMenuContent className="bg-background">
28
+ {tabs.map(tab => {
29
+ const { name, label, studies } = tab;
30
+ const isActive = activeTabName === name;
31
+ const isDisabled = !studies.length;
32
+
33
+ if (isDisabled) {
34
+ return null;
35
+ }
36
+
37
+ return (
38
+ <DropdownMenuItem
39
+ key={name}
40
+ className={`text-foreground ${isActive ? 'font-bold' : ''}`}
41
+ onClick={() => handleTabChange(name)}
42
+ >
43
+ {label}
44
+ </DropdownMenuItem>
45
+ );
46
+ })}
47
+ </DropdownMenuContent>
48
+ </DropdownMenu>
49
+ );
50
+ }
@@ -0,0 +1,3 @@
1
+ import { StudyBrowserViewOptions } from './StudyBrowserViewOptions';
2
+
3
+ export { StudyBrowserViewOptions };
@@ -0,0 +1,100 @@
1
+ import React from 'react';
2
+ import classnames from 'classnames';
3
+ import { ThumbnailList } from '../ThumbnailList';
4
+
5
+ import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '../Accordion';
6
+ import { Tooltip, TooltipContent, TooltipTrigger } from '../Tooltip';
7
+
8
+ const StudyItem = ({
9
+ date,
10
+ description,
11
+ numInstances,
12
+ modalities,
13
+ isActive,
14
+ onClick,
15
+ isExpanded,
16
+ displaySets,
17
+ activeDisplaySetInstanceUIDs,
18
+ onClickThumbnail,
19
+ onDoubleClickThumbnail,
20
+ onClickUntrack,
21
+ viewPreset = 'thumbnails',
22
+ ThumbnailMenuItems,
23
+ StudyMenuItems,
24
+ StudyInstanceUID,
25
+ }: withAppTypes) => {
26
+ return (
27
+ <Accordion
28
+ type="single"
29
+ collapsible
30
+ onClick={onClick}
31
+ onKeyDown={() => {}}
32
+ role="button"
33
+ tabIndex={0}
34
+ defaultValue={isActive ? 'study-item' : undefined}
35
+ >
36
+ <AccordionItem value="study-item">
37
+ <AccordionTrigger className={classnames('hover:bg-accent bg-popover group w-full rounded')}>
38
+ <div className="flex h-[40px] w-full flex-row overflow-hidden">
39
+ <div className="flex w-full flex-row items-center justify-between">
40
+ <div className="flex min-w-0 flex-col items-start text-[13px]">
41
+ <Tooltip>
42
+ <TooltipContent>{date}</TooltipContent>
43
+ <TooltipTrigger
44
+ className="w-full"
45
+ asChild
46
+ >
47
+ <div className="text-foreground h-[18px] w-full max-w-[160px] overflow-hidden truncate whitespace-nowrap text-left">
48
+ {date}
49
+ </div>
50
+ </TooltipTrigger>
51
+ </Tooltip>
52
+ <Tooltip>
53
+ <TooltipContent>{description}</TooltipContent>
54
+ <TooltipTrigger
55
+ className="w-full"
56
+ asChild
57
+ >
58
+ <div className="text-muted-foreground h-[18px] w-full overflow-hidden truncate whitespace-nowrap text-left">
59
+ {description}
60
+ </div>
61
+ </TooltipTrigger>
62
+ </Tooltip>
63
+ </div>
64
+ <div className="text-muted-foreground flex flex-col items-end pl-[10px] text-[12px]">
65
+ <div className="max-w-[150px] overflow-hidden text-ellipsis">{modalities}</div>
66
+ <div>{numInstances}</div>
67
+ </div>
68
+ {StudyMenuItems && (
69
+ <div className="ml-2 flex items-center">
70
+ <StudyMenuItems StudyInstanceUID={StudyInstanceUID} />
71
+ </div>
72
+ )}
73
+ </div>
74
+ </div>
75
+ </AccordionTrigger>
76
+ <AccordionContent
77
+ onClick={event => {
78
+ event.stopPropagation();
79
+ }}
80
+ >
81
+ {isExpanded && displaySets && (
82
+ <ThumbnailList
83
+ thumbnails={displaySets}
84
+ activeDisplaySetInstanceUIDs={activeDisplaySetInstanceUIDs}
85
+ onThumbnailClick={onClickThumbnail}
86
+ onThumbnailDoubleClick={onDoubleClickThumbnail}
87
+ onClickUntrack={onClickUntrack}
88
+ viewPreset={viewPreset}
89
+ ThumbnailMenuItems={ThumbnailMenuItems}
90
+ />
91
+ )}
92
+ </AccordionContent>
93
+ </AccordionItem>
94
+ </Accordion>
95
+ );
96
+ };
97
+
98
+
99
+
100
+ export { StudyItem };
@@ -0,0 +1,2 @@
1
+ import { StudyItem } from './StudyItem';
2
+ export { StudyItem };
@@ -0,0 +1,258 @@
1
+ import * as React from 'react';
2
+ import type { ColumnDef } from '@tanstack/react-table';
3
+ import type { DataTableFeatures } from '../../DataTable/DataTable';
4
+ import { DataTable } from '../../DataTable';
5
+ import type { ColumnMeta } from '../../DataTable/types';
6
+ import { Icons } from '../../Icons';
7
+ import type { StudyDateRangeFilter, StudyRow } from '../types/types';
8
+ import { ActionCell } from '../components/ActionCell';
9
+ import { tokenizeModalities } from '../utils/tokenizeModalities';
10
+ import { formatDICOMDate } from '../../../utils/formatDICOMDate';
11
+ import { formatDICOMTime } from '../../../utils/formatDICOMTime';
12
+ import { parseStudyDateTimestamp } from '../../../utils/parseStudyDateTimestamp';
13
+
14
+ // Column ID constants - shared across the codebase
15
+ export const COLUMN_IDS = {
16
+ PATIENT: 'patient',
17
+ MRN: 'mrn',
18
+ STUDY_DATE_TIME: 'studyDateTime',
19
+ MODALITIES: 'modalities',
20
+ DESCRIPTION: 'description',
21
+ ACCESSION: 'accession',
22
+ INSTANCES: 'instances',
23
+ ACTIONS: 'actions',
24
+ } as const;
25
+
26
+ // Filterable column IDs (columns that support filtering)
27
+ export const FILTERABLE_COLUMN_IDS = [
28
+ COLUMN_IDS.PATIENT,
29
+ COLUMN_IDS.MRN,
30
+ COLUMN_IDS.MODALITIES,
31
+ COLUMN_IDS.DESCRIPTION,
32
+ COLUMN_IDS.ACCESSION,
33
+ ] as const;
34
+
35
+ // Text filter column IDs (columns that use text-based filtering)
36
+ export const TEXT_FILTER_COLUMN_IDS = [
37
+ COLUMN_IDS.PATIENT,
38
+ COLUMN_IDS.MRN,
39
+ COLUMN_IDS.ACCESSION,
40
+ COLUMN_IDS.DESCRIPTION,
41
+ ] as const;
42
+
43
+ /**
44
+ * Creates a basic, display-only text column. Use this to add simple columns
45
+ * declaratively (e.g. via the `workList.columns` customization) without
46
+ * writing the accessor/header/cell wiring by hand.
47
+ */
48
+ export function textColumn(
49
+ id: string,
50
+ label: string,
51
+ meta?: Partial<ColumnMeta>
52
+ ): ColumnDef<DataTableFeatures, StudyRow, unknown> {
53
+ return {
54
+ id,
55
+ accessorFn: row => (row as Record<string, unknown>)[id] ?? '',
56
+ header: ({ column }) => <DataTable.ColumnHeader column={column} />,
57
+ cell: ({ row }) => <div className="truncate">{row.getValue<string>(id)}</div>,
58
+ meta: { label, minWidth: 120, ...meta },
59
+ };
60
+ }
61
+
62
+ export const defaultColumns: ColumnDef<DataTableFeatures, StudyRow, unknown>[] = [
63
+ {
64
+ id: COLUMN_IDS.PATIENT,
65
+ accessorFn: row => {
66
+ const r = row as StudyRow;
67
+ return r.patientName ?? '';
68
+ },
69
+ header: ({ column }) => <DataTable.ColumnHeader column={column} />,
70
+ cell: ({ row }) => <div className="truncate">{row.getValue(COLUMN_IDS.PATIENT)}</div>,
71
+ meta: {
72
+ label: 'Patient',
73
+ headerClassName: 'min-w-[165px]',
74
+ cellClassName: 'min-w-[165px]',
75
+ minWidth: 165,
76
+ priority: 100,
77
+ },
78
+ },
79
+ {
80
+ id: COLUMN_IDS.MRN,
81
+ accessorFn: row => {
82
+ const r = row as StudyRow;
83
+ return r.mrn ?? '';
84
+ },
85
+ header: ({ column }) => <DataTable.ColumnHeader column={column} />,
86
+ cell: ({ row }) => <div className="truncate">{row.getValue(COLUMN_IDS.MRN)}</div>,
87
+ meta: {
88
+ label: 'MRN',
89
+ headerClassName: 'min-w-[120px]',
90
+ cellClassName: 'min-w-[120px]',
91
+ minWidth: 120,
92
+ priority: 20,
93
+ },
94
+ },
95
+ {
96
+ id: COLUMN_IDS.STUDY_DATE_TIME,
97
+ accessorFn: row => {
98
+ const r = row as StudyRow;
99
+ // Date drives the cell: with no valid date we show nothing, even if a
100
+ // time is present.
101
+ const date = formatDICOMDate(r.date ?? '', {
102
+ fallbackFormat: 'MMM-DD-YYYY',
103
+ invalidFallback: '',
104
+ });
105
+ if (!date) {
106
+ return '';
107
+ }
108
+ const time = formatDICOMTime(r.time ?? '', { invalidFallback: '' });
109
+ return time ? `${date} ${time}` : date;
110
+ },
111
+ filterFn: (row, _colId, filter) => {
112
+ const range =
113
+ filter && typeof filter === 'object' ? (filter as StudyDateRangeFilter) : undefined;
114
+ const startDate = range?.startDate;
115
+ const endDate = range?.endDate;
116
+
117
+ if (!startDate && !endDate) {
118
+ return true;
119
+ }
120
+
121
+ const rowDate = String((row.original as StudyRow).date ?? '').replace(/\D/g, '');
122
+ if (!rowDate) {
123
+ return false;
124
+ }
125
+
126
+ if (startDate && rowDate < startDate) {
127
+ return false;
128
+ }
129
+ if (endDate && rowDate > endDate) {
130
+ return false;
131
+ }
132
+ return true;
133
+ },
134
+ header: ({ column }) => <DataTable.ColumnHeader column={column} />,
135
+ cell: ({ row }) => {
136
+ return <div className="truncate">{row.getValue(COLUMN_IDS.STUDY_DATE_TIME)}</div>;
137
+ },
138
+ sortFn: (a, b) => {
139
+ const aRow = a.original as StudyRow;
140
+ const bRow = b.original as StudyRow;
141
+ const aTimestamp = parseStudyDateTimestamp(aRow.date ?? '', aRow.time ?? '');
142
+ const bTimestamp = parseStudyDateTimestamp(bRow.date ?? '', bRow.time ?? '');
143
+ return aTimestamp - bTimestamp;
144
+ },
145
+ meta: {
146
+ label: 'Study Date',
147
+ headerClassName: 'min-w-[195px]',
148
+ cellClassName: 'min-w-[195px]',
149
+ minWidth: 195,
150
+ priority: 70,
151
+ },
152
+ },
153
+ {
154
+ id: COLUMN_IDS.MODALITIES,
155
+ accessorFn: row => {
156
+ const r = row as StudyRow;
157
+ return r.modalities ?? '';
158
+ },
159
+ header: ({ column }) => <DataTable.ColumnHeader column={column} />,
160
+ cell: ({ row }) => <div className="truncate">{row.getValue(COLUMN_IDS.MODALITIES)}</div>,
161
+ filterFn: (row, colId, filter) => {
162
+ const selected = Array.isArray(filter) ? (filter as string[]) : [];
163
+ if (!selected.length) {
164
+ return true;
165
+ }
166
+ const tokens = tokenizeModalities(String(row.getValue(colId) ?? ''));
167
+ const set = new Set(tokens);
168
+ return selected.some(v => set.has(String(v).toUpperCase()));
169
+ },
170
+ meta: {
171
+ label: 'Modalities',
172
+ headerClassName: 'min-w-[97px]',
173
+ cellClassName: 'min-w-[97px]',
174
+ minWidth: 97,
175
+ priority: 60,
176
+ },
177
+ },
178
+ {
179
+ id: COLUMN_IDS.DESCRIPTION,
180
+ accessorFn: row => {
181
+ const r = row as StudyRow;
182
+ return r.description ?? '';
183
+ },
184
+ header: ({ column }) => <DataTable.ColumnHeader column={column} />,
185
+ cell: ({ row }) => {
186
+ const description = row.getValue(COLUMN_IDS.DESCRIPTION) as string;
187
+ return (
188
+ <div className={!description ? 'text-muted-foreground/40' : ''}>
189
+ {description || 'No Description'}
190
+ </div>
191
+ );
192
+ },
193
+ meta: {
194
+ label: 'Description',
195
+ headerClassName: 'min-w-[290px]',
196
+ cellClassName: 'min-w-[290px]',
197
+ minWidth: 290,
198
+ priority: 90,
199
+ },
200
+ },
201
+ {
202
+ id: COLUMN_IDS.ACCESSION,
203
+ accessorFn: row => {
204
+ const r = row as StudyRow;
205
+ return r.accession ?? '';
206
+ },
207
+ header: ({ column }) => <DataTable.ColumnHeader column={column} />,
208
+ cell: ({ row }) => <div className="truncate">{row.getValue(COLUMN_IDS.ACCESSION)}</div>,
209
+ meta: {
210
+ label: 'Accession',
211
+ headerClassName: 'min-w-[140px]',
212
+ cellClassName: 'min-w-[140px]',
213
+ minWidth: 140,
214
+ priority: 30,
215
+ },
216
+ },
217
+ {
218
+ id: COLUMN_IDS.INSTANCES,
219
+ accessorFn: row => {
220
+ const r = row as StudyRow;
221
+ return Number(r.instances ?? 0);
222
+ },
223
+ header: ({ column }) => <DataTable.ColumnHeader column={column} />,
224
+ cell: ({ row }) => {
225
+ const value = row.getValue(COLUMN_IDS.INSTANCES) as number;
226
+ return <div className="text-right">{value}</div>;
227
+ },
228
+ sortFn: (a, b, colId) => (a.getValue(colId) as number) - (b.getValue(colId) as number),
229
+ meta: {
230
+ label: 'Instances',
231
+ headerContent: (
232
+ <Icons.Series
233
+ className="text-muted-foreground h-4 w-4 shrink-0"
234
+ aria-hidden="true"
235
+ />
236
+ ),
237
+ align: 'right',
238
+ headerClassName: 'min-w-[45px]',
239
+ cellClassName: 'min-w-[45px] overflow-hidden',
240
+ minWidth: 45,
241
+ priority: 50,
242
+ },
243
+ },
244
+ // Non-hideable trailing actions column to keep the menu at row end
245
+ {
246
+ id: COLUMN_IDS.ACTIONS,
247
+ header: () => null,
248
+ enableSorting: false,
249
+ enableHiding: false,
250
+ cell: ({ cell }) => <ActionCell cell={cell} />,
251
+ meta: {
252
+ // No label so it never appears labeled in any UI; also non-hideable
253
+ headerClassName: 'w-[56px] min-w-[56px] max-w-[56px]',
254
+ cellClassName: 'w-[56px] min-w-[56px] max-w-[56px] overflow-visible',
255
+ minWidth: 56,
256
+ },
257
+ },
258
+ ];
@@ -0,0 +1,19 @@
1
+ import type { Cell } from '@tanstack/react-table';
2
+ import type { DataTableFeatures } from '../../DataTable/DataTable';
3
+ import { DataTable } from '../../DataTable';
4
+ import { WorkflowMenu } from './WorkflowMenu';
5
+ import type { StudyRow } from '../types/types';
6
+
7
+ export function ActionCell({ cell }: { cell: Cell<DataTableFeatures, StudyRow, unknown> }) {
8
+ const original = cell.row.original as StudyRow;
9
+
10
+ return (
11
+ <DataTable.ActionOverlayCell cell={cell}>
12
+ <DataTable.ActionOverlayCell.Overlay>
13
+ <div onClick={e => e.stopPropagation()}>
14
+ <WorkflowMenu studyRow={original} />
15
+ </div>
16
+ </DataTable.ActionOverlayCell.Overlay>
17
+ </DataTable.ActionOverlayCell>
18
+ );
19
+ }
@@ -0,0 +1,206 @@
1
+ import * as React from 'react';
2
+ import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from '../../Resizable';
3
+ import { Table as StudyListTable, type TableProps as StudyListTableProps } from './Table';
4
+ import { WorkflowsProvider, type Mode } from './WorkflowsProvider';
5
+
6
+ type LayoutContextValue = {
7
+ isPreviewOpen: boolean;
8
+ openPreview: () => void;
9
+ closePreview: () => void;
10
+ defaultPreviewSizePercent: number;
11
+ minPreviewSizePercent: number;
12
+ };
13
+
14
+ const LayoutContext = React.createContext<LayoutContextValue | undefined>(undefined);
15
+
16
+ export function useLayout() {
17
+ const ctx = React.useContext(LayoutContext);
18
+ if (!ctx) {
19
+ throw new Error('useLayout must be used within <StudyList>');
20
+ }
21
+ return ctx;
22
+ }
23
+
24
+ export type LayoutProps = {
25
+ isPreviewOpen: boolean;
26
+ onIsPreviewOpenChange: (open: boolean) => void;
27
+ defaultPreviewSizePercent: number;
28
+ minPreviewSizePercent?: number;
29
+ className?: string;
30
+ children?: React.ReactNode;
31
+ /** Array of loaded modes from appConfig */
32
+ loadedModes?: Mode[];
33
+ /** Optional data path prefix for routes (e.g., '/dicomweb') */
34
+ dataPath?: string;
35
+ /** Function to preserve query parameters when launching workflows */
36
+ preserveQueryParameters: (query: URLSearchParams) => void;
37
+ };
38
+
39
+ function LayoutRoot({
40
+ isPreviewOpen,
41
+ onIsPreviewOpenChange,
42
+ defaultPreviewSizePercent,
43
+ minPreviewSizePercent = 15,
44
+ className,
45
+ loadedModes = [],
46
+ preserveQueryParameters,
47
+ dataPath,
48
+ children,
49
+ }: LayoutProps) {
50
+ let tableChild: React.ReactNode = null;
51
+ let previewChild: React.ReactNode = null;
52
+
53
+ React.Children.forEach(children, child => {
54
+ if (React.isValidElement(child)) {
55
+ const childType = child.type;
56
+
57
+ if (childType === Table) {
58
+ if (tableChild) {
59
+ throw new Error('StudyList can only contain one Table component.');
60
+ }
61
+ tableChild = child;
62
+ } else if (childType === Preview) {
63
+ if (previewChild) {
64
+ throw new Error('StudyList can only contain one Preview component.');
65
+ }
66
+ previewChild = child;
67
+ } else {
68
+ throw new Error('StudyList can only contain Table and Preview components.');
69
+ }
70
+ }
71
+ });
72
+
73
+ if (!tableChild) {
74
+ throw new Error('StudyList must contain a Table component.');
75
+ }
76
+
77
+ const openPreview = () => onIsPreviewOpenChange(true);
78
+ const closePreview = () => onIsPreviewOpenChange(false);
79
+
80
+ const value: LayoutContextValue = {
81
+ isPreviewOpen,
82
+ openPreview,
83
+ closePreview,
84
+ defaultPreviewSizePercent,
85
+ minPreviewSizePercent,
86
+ };
87
+
88
+ return (
89
+ <WorkflowsProvider
90
+ loadedModes={loadedModes}
91
+ preserveQueryParameters={preserveQueryParameters}
92
+ dataPath={dataPath}
93
+ >
94
+ <LayoutContext.Provider value={value}>
95
+ <ResizablePanelGroup
96
+ direction="horizontal"
97
+ className={className ?? 'h-full w-full'}
98
+ >
99
+ {tableChild}
100
+ {previewChild}
101
+ </ResizablePanelGroup>
102
+ </LayoutContext.Provider>
103
+ </WorkflowsProvider>
104
+ );
105
+ }
106
+
107
+ type TableProps = StudyListTableProps & {
108
+ children?: React.ReactNode; // If provided, overrides table rendering (for custom content)
109
+ };
110
+
111
+ function Table({
112
+ columns,
113
+ data,
114
+ title,
115
+ initialVisibility,
116
+ enforceSingleSelection,
117
+ showColumnVisibility,
118
+ tableClassName,
119
+ onSelectionChange,
120
+ onSortingChange,
121
+ onPaginationChange,
122
+ onFiltersChange,
123
+ manualFiltering,
124
+ sorting,
125
+ pagination,
126
+ filters,
127
+ toolbarLeftComponent,
128
+ toolbarRightComponent,
129
+ toolbarRightActionsComponent,
130
+ isLoading,
131
+ loadingComponent,
132
+ onStudyDoubleClick,
133
+ children,
134
+ }: TableProps) {
135
+ const { defaultPreviewSizePercent } = useLayout();
136
+
137
+ // If children are provided, use them (for custom content)
138
+ // Otherwise, render the StudyList.Table with the provided props
139
+ const content = children ? (
140
+ children
141
+ ) : (
142
+ <div className="flex h-full min-h-0 w-full flex-col px-3 pb-3 pt-0">
143
+ <div className="min-h-0 flex-1">
144
+ <div className="h-full rounded-md px-2 pb-2 pt-0">
145
+ <StudyListTable
146
+ columns={columns}
147
+ data={data}
148
+ title={title}
149
+ initialVisibility={initialVisibility}
150
+ enforceSingleSelection={enforceSingleSelection}
151
+ showColumnVisibility={showColumnVisibility}
152
+ tableClassName={tableClassName}
153
+ onSelectionChange={onSelectionChange}
154
+ toolbarLeftComponent={toolbarLeftComponent}
155
+ toolbarRightComponent={toolbarRightComponent}
156
+ toolbarRightActionsComponent={toolbarRightActionsComponent}
157
+ onSortingChange={onSortingChange}
158
+ onPaginationChange={onPaginationChange}
159
+ onFiltersChange={onFiltersChange}
160
+ manualFiltering={manualFiltering}
161
+ sorting={sorting}
162
+ pagination={pagination}
163
+ filters={filters}
164
+ isLoading={isLoading}
165
+ loadingComponent={loadingComponent}
166
+ onStudyDoubleClick={onStudyDoubleClick}
167
+ />
168
+ </div>
169
+ </div>
170
+ </div>
171
+ );
172
+
173
+ return <ResizablePanel defaultSize={100 - defaultPreviewSizePercent}>{content}</ResizablePanel>;
174
+ }
175
+
176
+ function Preview({
177
+ minSizePercent,
178
+ children,
179
+ }: {
180
+ minSizePercent?: number;
181
+ children?: React.ReactNode;
182
+ }) {
183
+ const { isPreviewOpen, defaultPreviewSizePercent, minPreviewSizePercent } = useLayout();
184
+ if (!isPreviewOpen) {
185
+ return null;
186
+ }
187
+ return (
188
+ <>
189
+ <ResizableHandle />
190
+ <ResizablePanel
191
+ defaultSize={defaultPreviewSizePercent}
192
+ minSize={minSizePercent ?? minPreviewSizePercent}
193
+ >
194
+ {children}
195
+ </ResizablePanel>
196
+ </>
197
+ );
198
+ }
199
+
200
+ LayoutRoot.displayName = 'Layout';
201
+
202
+ // Export for backward compatibility (will be removed from StudyList namespace)
203
+ export const Layout = Object.assign(LayoutRoot, {
204
+ Table,
205
+ Preview,
206
+ });
@@ -0,0 +1,45 @@
1
+ import * as React from 'react';
2
+ import { ScrollArea } from '../../ScrollArea';
3
+ import { PreviewContent } from './PreviewContent';
4
+ import { PreviewHeader } from './PreviewHeader';
5
+
6
+ type PreviewContainerProps = {
7
+ children: React.ReactNode;
8
+ };
9
+
10
+ function PreviewContainerRoot({ children }: PreviewContainerProps) {
11
+ let header: React.ReactNode = null;
12
+ let content: React.ReactNode = null;
13
+
14
+ React.Children.forEach(children, child => {
15
+ if (React.isValidElement(child)) {
16
+ const childType = child.type;
17
+
18
+ if (childType === PreviewHeader) {
19
+ header = child;
20
+ } else if (childType === PreviewContent) {
21
+ if (content) {
22
+ throw new Error('PreviewContainer can only contain one PreviewContent.');
23
+ }
24
+ content = child;
25
+ } else {
26
+ throw new Error('PreviewContainer can only contain PreviewHeader and PreviewContent.');
27
+ }
28
+ }
29
+ });
30
+
31
+ if (!content) {
32
+ throw new Error('PreviewContainer must contain PreviewContent.');
33
+ }
34
+
35
+ return (
36
+ <div className="bg-background relative flex h-full w-full flex-col">
37
+ {header}
38
+ <div className="direction-y flex min-h-0 flex-1 pr-3 pb-3 pt-[15px]">{content}</div>
39
+ </div>
40
+ );
41
+ }
42
+
43
+ PreviewContainerRoot.displayName = 'PreviewContainer';
44
+
45
+ export const PreviewContainer = PreviewContainerRoot;