@ohif/ui-next 3.14.0-beta.12 → 3.14.0-beta.121

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,186 @@
1
+ import * as React from 'react';
2
+ import { Thumbnail } from '../../Thumbnail';
3
+ import { TooltipProvider } from '../../Tooltip';
4
+ import {
5
+ PreviewThumbnailStatusState,
6
+ type PreviewThumbnailStatus,
7
+ type StudyRow,
8
+ } from '../types/types';
9
+ import { PreviewPatientSummary } from './PreviewPatientSummary';
10
+ import { PreviewSeriesList } from './PreviewSeriesList';
11
+ import { ToggleGroup, ToggleGroupItem } from '../../ToggleGroup';
12
+ import { Icons } from '../../Icons';
13
+ import { ScrollArea } from '../../ScrollArea';
14
+
15
+ type PreviewSeriesViewMode = 'thumbnails' | 'list';
16
+ type PreviewSeriesView = 'all' | PreviewSeriesViewMode;
17
+
18
+ function PreviewContent({
19
+ study,
20
+ series = [],
21
+ seriesView = 'all',
22
+ onThumbnailImageError,
23
+ }: {
24
+ study?: StudyRow | null;
25
+ series?: Array<{
26
+ seriesInstanceUid?: string;
27
+ SeriesInstanceUID?: string;
28
+ description?: string;
29
+ SeriesDescription?: string;
30
+ seriesNumber?: number;
31
+ SeriesNumber?: number;
32
+ numInstances?: number;
33
+ numSeriesInstances?: number;
34
+ modality?: string;
35
+ Modality?: string;
36
+ thumbnailStatus?: PreviewThumbnailStatus;
37
+ }>;
38
+ /**
39
+ * Controls which series views are available in the preview.
40
+ * - `'all'` (default): toggle visible; initially shows the thumbnails.
41
+ * - `'thumbnails'`: toggle hidden; locked to thumbnails view.
42
+ * - `'list'`: toggle hidden; locked to list view.
43
+ */
44
+ seriesView?: PreviewSeriesView;
45
+ /**
46
+ * Called when the thumbnail src URL fails to decode in the browser (broken image).
47
+ */
48
+ onThumbnailImageError?: (seriesInstanceUid: string) => void;
49
+ }) {
50
+ const isToggleVisible = seriesView === 'all';
51
+ const [seriesViewMode, setSeriesViewMode] = React.useState<PreviewSeriesViewMode>('thumbnails');
52
+ const effectiveSeriesViewMode: PreviewSeriesViewMode = isToggleVisible
53
+ ? seriesViewMode
54
+ : seriesView;
55
+ const imagingSeries = series.filter(
56
+ s => s.thumbnailStatus?.status !== PreviewThumbnailStatusState.NotApplicable
57
+ );
58
+ const nonImagingSeries = series.filter(
59
+ s => s.thumbnailStatus?.status === PreviewThumbnailStatusState.NotApplicable
60
+ );
61
+
62
+ // Handle empty state when no study is provided
63
+ if (!study) {
64
+ return (
65
+ <PreviewPatientSummary>
66
+ <PreviewPatientSummary.Patient />
67
+ <PreviewPatientSummary.Workflows />
68
+ </PreviewPatientSummary>
69
+ );
70
+ }
71
+
72
+ return (
73
+ <TooltipProvider delayDuration={200}>
74
+ <div className="flex h-full min-h-0 w-full flex-col gap-3">
75
+ <PreviewPatientSummary data={study}>
76
+ <PreviewPatientSummary.Patient />
77
+ <PreviewPatientSummary.Workflows />
78
+ </PreviewPatientSummary>
79
+ <div className="text-muted-foreground flex h-5 w-full items-center justify-between gap-1 px-2 text-base">
80
+ <span className="leading-tight">
81
+ {series?.length ? study?.description || 'No Description' : 'No Series'}
82
+ </span>
83
+ {isToggleVisible && (
84
+ <ToggleGroup
85
+ type="single"
86
+ value={seriesViewMode}
87
+ onValueChange={value => value && setSeriesViewMode(value as 'thumbnails' | 'list')}
88
+ >
89
+ <ToggleGroupItem
90
+ value="thumbnails"
91
+ aria-label="Thumbnail view"
92
+ className="text-primary"
93
+ >
94
+ <Icons.ThumbnailView />
95
+ </ToggleGroupItem>
96
+ <ToggleGroupItem
97
+ value="list"
98
+ aria-label="List view"
99
+ className="text-primary"
100
+ >
101
+ <Icons.ListView />
102
+ </ToggleGroupItem>
103
+ </ToggleGroup>
104
+ )}
105
+ </div>
106
+ <ScrollArea className="h-full min-h-0 w-full flex-1">
107
+ {effectiveSeriesViewMode === 'thumbnails' ? (
108
+ <div className="flex flex-col">
109
+ {imagingSeries.length > 0 && (
110
+ <div className="grid grid-cols-[repeat(auto-fit,_minmax(0,135px))] place-items-start gap-[4px] pr-2">
111
+ {imagingSeries.map((seriesItem, index) => {
112
+ const seriesUID =
113
+ seriesItem.seriesInstanceUid || seriesItem.SeriesInstanceUID || String(index);
114
+ const thumbnailState = seriesItem.thumbnailStatus;
115
+ const imageSrc =
116
+ thumbnailState?.status === PreviewThumbnailStatusState.Ready
117
+ ? thumbnailState.src
118
+ : undefined;
119
+ return (
120
+ <Thumbnail
121
+ key={`series-imaging-${seriesUID}`}
122
+ displaySetInstanceUID={`series-${seriesUID}`}
123
+ imageSrc={imageSrc as any}
124
+ onImageLoadError={() => onThumbnailImageError?.(seriesUID)}
125
+ imageAltText={seriesItem.description || seriesItem.SeriesDescription || ''}
126
+ description={
127
+ seriesItem.description || seriesItem.SeriesDescription || '(empty)'
128
+ }
129
+ seriesNumber={seriesItem.seriesNumber ?? seriesItem.SeriesNumber ?? ''}
130
+ numInstances={seriesItem.numSeriesInstances ?? seriesItem.numInstances ?? 0}
131
+ modality={seriesItem.modality || seriesItem.Modality || ''}
132
+ isActive={false}
133
+ onClick={() => {}}
134
+ onDoubleClick={() => {}}
135
+ isDraggable={false}
136
+ viewPreset="thumbnails"
137
+ thumbnailType="thumbnail"
138
+ >
139
+ {thumbnailState?.status === PreviewThumbnailStatusState.NotAvailable && (
140
+ <div className="bg-muted/50 flex h-full w-full items-center justify-center rounded">
141
+ <Icons.SeriesPlaceholder className="text-muted-foreground h-[40px] w-[60px] opacity-50" />
142
+ </div>
143
+ )}
144
+ </Thumbnail>
145
+ );
146
+ })}
147
+ </div>
148
+ )}
149
+ {nonImagingSeries.length > 0 && (
150
+ <div className="mt-1 grid grid-cols-[repeat(auto-fit,_minmax(0,275px))] place-items-start gap-[2px] pr-2">
151
+ {nonImagingSeries.map((seriesItem, index) => {
152
+ const seriesUID =
153
+ seriesItem.seriesInstanceUid || seriesItem.SeriesInstanceUID || String(index);
154
+ return (
155
+ <Thumbnail
156
+ key={`series-non-imaging-${seriesUID}`}
157
+ displaySetInstanceUID={`series-${seriesUID}`}
158
+ imageAltText={seriesItem.description || seriesItem.SeriesDescription || ''}
159
+ description={
160
+ seriesItem.description || seriesItem.SeriesDescription || '(empty)'
161
+ }
162
+ seriesNumber={seriesItem.seriesNumber ?? seriesItem.SeriesNumber ?? ''}
163
+ numInstances={seriesItem.numSeriesInstances ?? seriesItem.numInstances ?? 0}
164
+ modality={seriesItem.modality || seriesItem.Modality || ''}
165
+ isActive={false}
166
+ onClick={() => {}}
167
+ onDoubleClick={() => {}}
168
+ isDraggable={false}
169
+ viewPreset="list"
170
+ thumbnailType="thumbnailNoImage"
171
+ />
172
+ );
173
+ })}
174
+ </div>
175
+ )}
176
+ </div>
177
+ ) : (
178
+ <PreviewSeriesList series={series} />
179
+ )}
180
+ </ScrollArea>
181
+ </div>
182
+ </TooltipProvider>
183
+ );
184
+ }
185
+
186
+ export { PreviewContent };
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+
3
+ export function PreviewHeader({ children }: { children?: React.ReactNode }) {
4
+ return <div className="z-10 mt-5 mr-5 flex items-center justify-end gap-1">{children}</div>;
5
+ }
@@ -0,0 +1,224 @@
1
+ /**
2
+ * PreviewPatientSummary — compound component for patient header + workflow actions
3
+ *
4
+ * What it is
5
+ * - A compact summary API composed under a root provider: Patient and Workflows.
6
+ * - Subcomponents read the current study row from context.
7
+ *
8
+ * Minimal usage
9
+ * <PreviewPatientSummary data={row}>
10
+ * <PreviewPatientSummary.Patient />
11
+ * <PreviewPatientSummary.Workflows />
12
+ * </PreviewPatientSummary>
13
+ *
14
+ * Default workflow behavior
15
+ * - Workflows uses WorkflowsProvider context for available workflows and the default selection.
16
+ * - Shows the default workflow as a badge (with a clear-X) and the remaining applicable
17
+ * workflows as buttons below.
18
+ *
19
+ * Helpful references
20
+ * - platform/ui-next/src/components/StudyList/components/PreviewContent.tsx (in-context example, including empty state handling)
21
+ */
22
+ import * as React from 'react';
23
+ import { Cross2Icon } from '@radix-ui/react-icons';
24
+ import { cn } from '../../../lib/utils';
25
+ import { Icons } from '../../Icons/Icons';
26
+ import { Button } from '../../Button';
27
+ import type { StudyRow } from '../types/types';
28
+ import { useWorkflows } from './WorkflowsProvider';
29
+
30
+ type SummaryContextValue = {
31
+ data: StudyRow | null;
32
+ };
33
+
34
+ const SummaryContext = React.createContext<SummaryContextValue | null>(null);
35
+
36
+ function useSummaryContext(): SummaryContextValue {
37
+ const context = React.useContext(SummaryContext);
38
+ if (!context) {
39
+ throw new Error(
40
+ 'PreviewPatientSummary.* components must be used within <PreviewPatientSummary>'
41
+ );
42
+ }
43
+ return context;
44
+ }
45
+
46
+ type RootProps = {
47
+ data?: StudyRow | null;
48
+ className?: string;
49
+ children?: React.ReactNode;
50
+ };
51
+
52
+ function Root({ data: dataProp, className, children }: RootProps) {
53
+ const data = dataProp ?? null;
54
+ const value: SummaryContextValue = { data };
55
+
56
+ return (
57
+ <SummaryContext.Provider value={value}>
58
+ <div className={cn('flex w-full flex-col gap-1', className)}>{children}</div>
59
+ </SummaryContext.Provider>
60
+ );
61
+ }
62
+
63
+ function Patient({ className }: { className?: string } = {}) {
64
+ const { data } = useSummaryContext();
65
+ const patientName = data?.patientName;
66
+ const mrn = data?.mrn;
67
+
68
+ const nameContent = patientName ?? 'Select a study';
69
+ const nameTitle =
70
+ typeof patientName === 'string' || typeof patientName === 'number'
71
+ ? String(patientName)
72
+ : undefined;
73
+
74
+ const showMrn = mrn !== null && mrn !== undefined && mrn !== '';
75
+ const mrnTitle =
76
+ typeof mrn === 'string' || typeof mrn === 'number' ? String(mrn) : undefined;
77
+
78
+ return (
79
+ <div className={cn('bg-muted flex items-center gap-3 rounded-lg px-4 py-3', className)}>
80
+ <div
81
+ className="text-primary shrink-0"
82
+ aria-hidden
83
+ style={{ width: 33, height: 33 }}
84
+ >
85
+ <Icons.PatientStudyList />
86
+ </div>
87
+ <div className="flex h-[38px] min-w-0 flex-col justify-center gap-px">
88
+ <span
89
+ className="text-foreground truncate text-lg font-medium leading-tight"
90
+ title={nameTitle}
91
+ >
92
+ {nameContent}
93
+ </span>
94
+ {showMrn && (
95
+ <span
96
+ className="text-muted-foreground truncate text-lg leading-tight"
97
+ title={mrnTitle}
98
+ >
99
+ {mrn}
100
+ </span>
101
+ )}
102
+ </div>
103
+ </div>
104
+ );
105
+ }
106
+
107
+ /**
108
+ * Workflows panel.
109
+ *
110
+ * - Must be used inside `<PreviewPatientSummary>` to read the current study from context.
111
+ * - Must be used inside `<WorkflowsProvider>` to access workflow context.
112
+ * - Shows the default workflow badge (with a clear-X) when one is set, and renders the
113
+ * remaining applicable workflows as buttons below.
114
+ */
115
+ function Workflows({ className }: { className?: string } = {}) {
116
+ const { data: studyRow } = useSummaryContext();
117
+ const { workflows, getWorkflowsForStudy, getDefaultWorkflowForStudy, setDefaultWorkflowId } =
118
+ useWorkflows();
119
+
120
+ const availableWorkflows = studyRow ? getWorkflowsForStudy(studyRow) : workflows;
121
+
122
+ const defaultWorkflow = studyRow
123
+ ? getDefaultWorkflowForStudy(studyRow)
124
+ : workflows.find(w => w.isDefault);
125
+
126
+ const otherWorkflows = !defaultWorkflow
127
+ ? availableWorkflows
128
+ : availableWorkflows.filter(w => w.displayName !== defaultWorkflow.displayName);
129
+
130
+ const handleLaunch = (displayName: string) => {
131
+ if (!studyRow) {
132
+ return;
133
+ }
134
+ const wf = availableWorkflows.find(w => w.displayName === displayName);
135
+ wf?.launchWithStudy(studyRow);
136
+ };
137
+
138
+ const handleClearDefault = () => {
139
+ setDefaultWorkflowId();
140
+ };
141
+
142
+ return (
143
+ <div
144
+ className={cn(
145
+ 'border-border/50 bg-muted w-full rounded-lg px-4 py-3 text-left transition',
146
+ className
147
+ )}
148
+ >
149
+ <div className="flex w-full items-center justify-between">
150
+ <span className="text-foreground text-base font-medium leading-tight">Launch workflow</span>
151
+ <span
152
+ className="text-primary shrink-0 -translate-y-0.5"
153
+ aria-hidden
154
+ style={{ width: 18, height: 18 }}
155
+ >
156
+ <Icons.Info />
157
+ </span>
158
+ </div>
159
+
160
+ {defaultWorkflow && (
161
+ <div
162
+ className="mt-2 flex flex-wrap items-center gap-0"
163
+ role="status"
164
+ aria-live="polite"
165
+ >
166
+ <Button
167
+ variant="ghost"
168
+ size="sm"
169
+ className="bg-primary/20 text-primary ring-primary ring-offset-background ml-1 mb-1 h-6 w-32 overflow-hidden ring-1 ring-offset-2"
170
+ onClick={() => handleLaunch(defaultWorkflow.displayName)}
171
+ title={defaultWorkflow.displayName}
172
+ >
173
+ <span className="truncate">{defaultWorkflow.displayName}</span>
174
+ </Button>
175
+ <Button
176
+ type="button"
177
+ variant="ghost"
178
+ size="icon"
179
+ aria-label="Clear default mode"
180
+ className="text-primary focus-visible:ring-ring focus-visible:ring-offset-background ml-1.5 mb-1 opacity-70 transition hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2"
181
+ onClick={handleClearDefault}
182
+ >
183
+ <Cross2Icon
184
+ className="text-primary h-3.5 w-3.5"
185
+ aria-hidden
186
+ />
187
+ <span className="sr-only">Clear default mode</span>
188
+ </Button>
189
+ </div>
190
+ )}
191
+
192
+ {defaultWorkflow && studyRow && otherWorkflows.length > 0 && (
193
+ <div className="text-muted-foreground mt-2 text-sm">Other Available Workflows</div>
194
+ )}
195
+
196
+ {studyRow && otherWorkflows.length > 0 && (
197
+ <div className="mt-2 flex flex-wrap items-center gap-0">
198
+ {otherWorkflows.map(wf => (
199
+ <Button
200
+ key={wf.displayName}
201
+ variant="ghost"
202
+ size="sm"
203
+ className="bg-primary/20 ml-1 mb-1 h-6 w-32 overflow-hidden"
204
+ onClick={() => handleLaunch(wf.displayName)}
205
+ title={wf.displayName}
206
+ >
207
+ <span className="truncate">{wf.displayName}</span>
208
+ </Button>
209
+ ))}
210
+ </div>
211
+ )}
212
+ </div>
213
+ );
214
+ }
215
+
216
+ type PreviewPatientSummaryNamespace = typeof Root & {
217
+ Patient: typeof Patient;
218
+ Workflows: typeof Workflows;
219
+ };
220
+
221
+ export const PreviewPatientSummary: PreviewPatientSummaryNamespace = Object.assign(Root, {
222
+ Patient,
223
+ Workflows,
224
+ });
@@ -0,0 +1,64 @@
1
+ import * as React from 'react';
2
+ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '../../Table';
3
+ import { Icons } from '../../Icons';
4
+
5
+ type Series = {
6
+ seriesInstanceUid?: string;
7
+ SeriesInstanceUID?: string;
8
+ modality?: string;
9
+ Modality?: string;
10
+ description?: string;
11
+ SeriesDescription?: string;
12
+ seriesNumber?: number | string;
13
+ SeriesNumber?: number | string;
14
+ numSeriesInstances?: number;
15
+ numInstances?: number;
16
+ };
17
+
18
+ type PreviewSeriesListProps = {
19
+ series: Series[];
20
+ onSeriesClick?: (series: Series) => void;
21
+ };
22
+
23
+ export function PreviewSeriesList({ series, onSeriesClick }: PreviewSeriesListProps) {
24
+ return (
25
+ <div className="w-full px-2">
26
+ <Table noScroll>
27
+ <TableHeader>
28
+ <TableRow className="hover:bg-transparent">
29
+ <TableHead className="pl-0 text-base font-normal">
30
+ <span className="text-foreground">Modality</span>
31
+ <span className="text-muted-foreground"> / Series</span>
32
+ </TableHead>
33
+ <TableHead className="text-foreground w-8 pr-0 text-right text-base font-normal">
34
+ <Icons.Series className="ml-auto h-4 w-4" />
35
+ </TableHead>
36
+ </TableRow>
37
+ </TableHeader>
38
+ <TableBody>
39
+ {series.map((s, idx) => {
40
+ const seriesUID = s.seriesInstanceUid || s.SeriesInstanceUID || String(idx);
41
+ const modality = String(s.modality || s.Modality || '').toUpperCase();
42
+ const description = s.description || s.SeriesDescription || '';
43
+ const numInstances = s.numSeriesInstances ?? s.numInstances ?? 0;
44
+
45
+ return (
46
+ <TableRow
47
+ key={seriesUID}
48
+ className="hover:text-muted-foreground cursor-default hover:bg-transparent"
49
+ >
50
+ <TableCell className="pl-0 text-base">
51
+ <div className="flex items-center gap-2">
52
+ <span className="text-foreground font-normal">{modality}</span>
53
+ <span className="font-normal">{description}</span>
54
+ </div>
55
+ </TableCell>
56
+ <TableCell className="w-8 pr-0 text-right text-base">{numInstances}</TableCell>
57
+ </TableRow>
58
+ );
59
+ })}
60
+ </TableBody>
61
+ </Table>
62
+ </div>
63
+ );
64
+ }
@@ -0,0 +1,69 @@
1
+ import * as React from 'react';
2
+ import { Button } from '../../Button';
3
+ import { Icons } from '../../Icons';
4
+ import { useLayout } from './Layout';
5
+
6
+ type PreviewToggleButtonProps = React.HTMLAttributes<HTMLButtonElement> & {
7
+ 'aria-label'?: string;
8
+ shouldShow: boolean;
9
+ onClick: () => void;
10
+ defaultAriaLabel: string;
11
+ };
12
+
13
+ function PreviewToggleButton({
14
+ className,
15
+ 'aria-label': ariaLabel,
16
+ shouldShow,
17
+ onClick,
18
+ defaultAriaLabel,
19
+ }: PreviewToggleButtonProps) {
20
+ if (!shouldShow) {
21
+ return null;
22
+ }
23
+ return (
24
+ <Button
25
+ variant="ghost"
26
+ size="icon"
27
+ aria-label={ariaLabel ?? defaultAriaLabel}
28
+ onClick={onClick}
29
+ className={className}
30
+ >
31
+ <Icons.PanelRight
32
+ aria-hidden="true"
33
+ className="text-primary h-4 w-4"
34
+ />
35
+ </Button>
36
+ );
37
+ }
38
+
39
+ export function OpenPreviewButton({
40
+ className,
41
+ 'aria-label': ariaLabel = 'Open preview',
42
+ }: React.HTMLAttributes<HTMLButtonElement> & { 'aria-label'?: string }) {
43
+ const { isPreviewOpen, openPreview } = useLayout();
44
+ return (
45
+ <PreviewToggleButton
46
+ className={className}
47
+ aria-label={ariaLabel}
48
+ shouldShow={!isPreviewOpen}
49
+ onClick={openPreview}
50
+ defaultAriaLabel="Open preview"
51
+ />
52
+ );
53
+ }
54
+
55
+ export function ClosePreviewButton({
56
+ className,
57
+ 'aria-label': ariaLabel = 'Close preview',
58
+ }: React.HTMLAttributes<HTMLButtonElement> & { 'aria-label'?: string }) {
59
+ const { isPreviewOpen, closePreview } = useLayout();
60
+ return (
61
+ <PreviewToggleButton
62
+ className={className}
63
+ aria-label={ariaLabel}
64
+ shouldShow={isPreviewOpen}
65
+ onClick={closePreview}
66
+ defaultAriaLabel="Close preview"
67
+ />
68
+ );
69
+ }