@zendir/ui 0.5.0 → 0.6.0

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 (391) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +640 -631
  3. package/dist/_virtual/_rolldown/runtime.js +13 -0
  4. package/dist/index.js +17 -221
  5. package/dist/react/3d/CesiumCaptureSource.d.ts +0 -1
  6. package/dist/react/3d/CesiumCaptureSource.js +364 -283
  7. package/dist/react/3d/CesiumCaptureSource.js.map +1 -1
  8. package/dist/react/3d/ZenSpace3D.d.ts +2 -3
  9. package/dist/react/3d/ZenSpace3D.js +1681 -1237
  10. package/dist/react/3d/ZenSpace3D.js.map +1 -1
  11. package/dist/react/3d/ZenSpace3DCesium.d.ts +0 -1
  12. package/dist/react/3d/ZenSpace3DCesium.js +513 -560
  13. package/dist/react/3d/ZenSpace3DCesium.js.map +1 -1
  14. package/dist/react/3d/ZenSpace3DShaders.js +61 -66
  15. package/dist/react/3d/ZenSpace3DShaders.js.map +1 -1
  16. package/dist/react/3d/ZenSpace3DTypes.d.ts +19 -20
  17. package/dist/react/3d/ZenSpace3DUtils.d.ts +0 -1
  18. package/dist/react/3d/ZenSpace3DUtils.js +37 -24
  19. package/dist/react/3d/ZenSpace3DUtils.js.map +1 -1
  20. package/dist/react/3d/capturePngAnalysis.js +42 -36
  21. package/dist/react/3d/capturePngAnalysis.js.map +1 -1
  22. package/dist/react/3d/index.d.ts +3 -3
  23. package/dist/react/3d/index.js +5 -53
  24. package/dist/react/3d/threeLoader.d.ts +1 -1
  25. package/dist/react/3d/threeLoader.js +23 -18
  26. package/dist/react/3d/threeLoader.js.map +1 -1
  27. package/dist/react/astro/ClassificationBanner.d.ts +2 -3
  28. package/dist/react/astro/ClassificationBanner.js +95 -79
  29. package/dist/react/astro/ClassificationBanner.js.map +1 -1
  30. package/dist/react/astro/GlobalStatusBar.d.ts +0 -1
  31. package/dist/react/astro/GlobalStatusBar.js +157 -163
  32. package/dist/react/astro/GlobalStatusBar.js.map +1 -1
  33. package/dist/react/astro/MissionClock.d.ts +7 -8
  34. package/dist/react/astro/MissionClock.js +377 -400
  35. package/dist/react/astro/MissionClock.js.map +1 -1
  36. package/dist/react/astro/MonitoringIcon.d.ts +1 -2
  37. package/dist/react/astro/MonitoringIcon.js +422 -358
  38. package/dist/react/astro/MonitoringIcon.js.map +1 -1
  39. package/dist/react/astro/Notification.d.ts +1 -2
  40. package/dist/react/astro/Notification.js +229 -126
  41. package/dist/react/astro/Notification.js.map +1 -1
  42. package/dist/react/astro/Progress.d.ts +0 -1
  43. package/dist/react/astro/Progress.js +199 -141
  44. package/dist/react/astro/Progress.js.map +1 -1
  45. package/dist/react/astro/SimulationControls.d.ts +3 -4
  46. package/dist/react/astro/SimulationControls.js +596 -650
  47. package/dist/react/astro/SimulationControls.js.map +1 -1
  48. package/dist/react/astro/StatusIndicator.d.ts +0 -1
  49. package/dist/react/astro/StatusIndicator.js +236 -170
  50. package/dist/react/astro/StatusIndicator.js.map +1 -1
  51. package/dist/react/astro/UnifiedTimeline.d.ts +9 -10
  52. package/dist/react/astro/UnifiedTimeline.js +2345 -2392
  53. package/dist/react/astro/UnifiedTimeline.js.map +1 -1
  54. package/dist/react/astro/index.d.ts +5 -5
  55. package/dist/react/astro/index.js +1 -25
  56. package/dist/react/cards/AccessCard.d.ts +0 -1
  57. package/dist/react/cards/AccessCard.js +471 -405
  58. package/dist/react/cards/AccessCard.js.map +1 -1
  59. package/dist/react/cards/OrbitCard.d.ts +0 -1
  60. package/dist/react/cards/OrbitCard.js +487 -364
  61. package/dist/react/cards/OrbitCard.js.map +1 -1
  62. package/dist/react/cards/SpacecraftCard.d.ts +0 -1
  63. package/dist/react/cards/SpacecraftCard.js +813 -925
  64. package/dist/react/cards/SpacecraftCard.js.map +1 -1
  65. package/dist/react/cards/TelemetryCard.d.ts +0 -1
  66. package/dist/react/cards/TelemetryCard.js +1055 -732
  67. package/dist/react/cards/TelemetryCard.js.map +1 -1
  68. package/dist/react/cards/TelemetryStreamCard.d.ts +0 -1
  69. package/dist/react/cards/TelemetryStreamCard.js +323 -297
  70. package/dist/react/cards/TelemetryStreamCard.js.map +1 -1
  71. package/dist/react/cards/index.d.ts +1 -1
  72. package/dist/react/cards/index.js +1 -8
  73. package/dist/react/charts/GroundTrackMap.d.ts +6 -7
  74. package/dist/react/charts/GroundTrackMap.js +1377 -1256
  75. package/dist/react/charts/GroundTrackMap.js.map +1 -1
  76. package/dist/react/charts/GroundTrackMapLeaflet.d.ts +1 -2
  77. package/dist/react/charts/GroundTrackMapLeaflet.js +1065 -987
  78. package/dist/react/charts/GroundTrackMapLeaflet.js.map +1 -1
  79. package/dist/react/charts/groundTrackMapLeafletTiles.js +34 -25
  80. package/dist/react/charts/groundTrackMapLeafletTiles.js.map +1 -1
  81. package/dist/react/charts/groundTrackMapLeafletUtils.js +70 -61
  82. package/dist/react/charts/groundTrackMapLeafletUtils.js.map +1 -1
  83. package/dist/react/charts/index.d.ts +1 -1
  84. package/dist/react/charts/index.js +7 -100
  85. package/dist/react/charts/unified/AstroChart.d.ts +1 -2
  86. package/dist/react/charts/unified/AstroChart.js +1331 -1411
  87. package/dist/react/charts/unified/AstroChart.js.map +1 -1
  88. package/dist/react/charts/unified/PowerOverviewChart.d.ts +3 -3
  89. package/dist/react/charts/unified/PowerOverviewChart.js +495 -478
  90. package/dist/react/charts/unified/PowerOverviewChart.js.map +1 -1
  91. package/dist/react/charts/unified/domain.d.ts +12 -13
  92. package/dist/react/charts/unified/domain.js +3999 -3145
  93. package/dist/react/charts/unified/domain.js.map +1 -1
  94. package/dist/react/charts/unified/generators.d.ts +3 -4
  95. package/dist/react/charts/unified/generators.js +561 -498
  96. package/dist/react/charts/unified/generators.js.map +1 -1
  97. package/dist/react/charts/unified/index.d.ts +1 -1
  98. package/dist/react/charts/unified/presets.d.ts +14 -15
  99. package/dist/react/charts/unified/presets.js +857 -994
  100. package/dist/react/charts/unified/presets.js.map +1 -1
  101. package/dist/react/charts/unified/sync.d.ts +2 -3
  102. package/dist/react/charts/unified/sync.js +229 -195
  103. package/dist/react/charts/unified/sync.js.map +1 -1
  104. package/dist/react/charts/unified/theme.d.ts +11 -12
  105. package/dist/react/charts/unified/theme.js +606 -642
  106. package/dist/react/charts/unified/theme.js.map +1 -1
  107. package/dist/react/charts/unified/types.d.ts +32 -33
  108. package/dist/react/charts/unified/useChartStream.d.ts +1 -2
  109. package/dist/react/charts/unified/useChartStream.js +203 -216
  110. package/dist/react/charts/unified/useChartStream.js.map +1 -1
  111. package/dist/react/chatgpt/AppCard.d.ts +1 -2
  112. package/dist/react/chatgpt/index.d.ts +7 -7
  113. package/dist/react/chatgpt/index.js +160 -139
  114. package/dist/react/chatgpt/index.js.map +1 -1
  115. package/dist/react/context/CategoryContext.d.ts +0 -1
  116. package/dist/react/context/CategoryContext.js +78 -29
  117. package/dist/react/context/CategoryContext.js.map +1 -1
  118. package/dist/react/context/DisplaySettingsContext.d.ts +1 -2
  119. package/dist/react/context/DisplaySettingsContext.js +205 -156
  120. package/dist/react/context/DisplaySettingsContext.js.map +1 -1
  121. package/dist/react/context/SpatialSelectionContext.d.ts +0 -1
  122. package/dist/react/context/SpatialSelectionContext.js +36 -7
  123. package/dist/react/context/SpatialSelectionContext.js.map +1 -1
  124. package/dist/react/core/data/DataTable.d.ts +3 -4
  125. package/dist/react/core/data/DataTable.js +473 -440
  126. package/dist/react/core/data/DataTable.js.map +1 -1
  127. package/dist/react/core/data/DataValue.d.ts +4 -5
  128. package/dist/react/core/data/DataValue.js +605 -571
  129. package/dist/react/core/data/DataValue.js.map +1 -1
  130. package/dist/react/core/data/propertyConfig.d.ts +1 -2
  131. package/dist/react/core/data/propertyConfig.js +446 -382
  132. package/dist/react/core/data/propertyConfig.js.map +1 -1
  133. package/dist/react/core/display/AstroIcon.d.ts +4 -5
  134. package/dist/react/core/display/AstroIcon.js +339 -429
  135. package/dist/react/core/display/AstroIcon.js.map +1 -1
  136. package/dist/react/core/display/Badge.d.ts +2 -3
  137. package/dist/react/core/display/Badge.js +131 -131
  138. package/dist/react/core/display/Badge.js.map +1 -1
  139. package/dist/react/core/display/CardHeader.d.ts +0 -1
  140. package/dist/react/core/display/CardHeader.js +398 -311
  141. package/dist/react/core/display/CardHeader.js.map +1 -1
  142. package/dist/react/core/display/Container.d.ts +2 -3
  143. package/dist/react/core/display/Container.js +640 -668
  144. package/dist/react/core/display/Container.js.map +1 -1
  145. package/dist/react/core/display/CopyButton.d.ts +1 -2
  146. package/dist/react/core/display/CopyButton.js +158 -101
  147. package/dist/react/core/display/CopyButton.js.map +1 -1
  148. package/dist/react/core/display/GlassCard.d.ts +3 -4
  149. package/dist/react/core/display/GlassCard.js +416 -369
  150. package/dist/react/core/display/GlassCard.js.map +1 -1
  151. package/dist/react/core/display/HeaderIconWithStatus.d.ts +0 -1
  152. package/dist/react/core/display/HeaderIconWithStatus.js +152 -152
  153. package/dist/react/core/display/HeaderIconWithStatus.js.map +1 -1
  154. package/dist/react/core/display/Icon.d.ts +2 -3
  155. package/dist/react/core/display/Icon.js +172 -143
  156. package/dist/react/core/display/Icon.js.map +1 -1
  157. package/dist/react/core/display/Typography.d.ts +24 -25
  158. package/dist/react/core/display/Typography.js +360 -178
  159. package/dist/react/core/display/Typography.js.map +1 -1
  160. package/dist/react/core/feedback/ConfirmDialog.d.ts +1 -2
  161. package/dist/react/core/feedback/ConfirmDialog.js +343 -304
  162. package/dist/react/core/feedback/ConfirmDialog.js.map +1 -1
  163. package/dist/react/core/feedback/Dialog.d.ts +2 -3
  164. package/dist/react/core/feedback/Dialog.js +189 -197
  165. package/dist/react/core/feedback/Dialog.js.map +1 -1
  166. package/dist/react/core/feedback/Toast.d.ts +2 -3
  167. package/dist/react/core/feedback/Toast.js +346 -207
  168. package/dist/react/core/feedback/Toast.js.map +1 -1
  169. package/dist/react/core/index.d.ts +26 -26
  170. package/dist/react/core/index.js +7 -119
  171. package/dist/react/core/inputs/Button.d.ts +2 -3
  172. package/dist/react/core/inputs/Button.js +281 -304
  173. package/dist/react/core/inputs/Button.js.map +1 -1
  174. package/dist/react/core/inputs/Checkbox.d.ts +2 -3
  175. package/dist/react/core/inputs/Checkbox.js +139 -127
  176. package/dist/react/core/inputs/Checkbox.js.map +1 -1
  177. package/dist/react/core/inputs/Input.d.ts +3 -4
  178. package/dist/react/core/inputs/Input.js +277 -285
  179. package/dist/react/core/inputs/Input.js.map +1 -1
  180. package/dist/react/core/inputs/LimitsBar.d.ts +1 -2
  181. package/dist/react/core/inputs/LimitsBar.js +271 -196
  182. package/dist/react/core/inputs/LimitsBar.js.map +1 -1
  183. package/dist/react/core/inputs/NumberInput.d.ts +2 -3
  184. package/dist/react/core/inputs/NumberInput.js +531 -503
  185. package/dist/react/core/inputs/NumberInput.js.map +1 -1
  186. package/dist/react/core/inputs/PinInput.d.ts +2 -3
  187. package/dist/react/core/inputs/PinInput.js +224 -207
  188. package/dist/react/core/inputs/PinInput.js.map +1 -1
  189. package/dist/react/core/inputs/Select.d.ts +1 -2
  190. package/dist/react/core/inputs/Select.js +298 -299
  191. package/dist/react/core/inputs/Select.js.map +1 -1
  192. package/dist/react/core/inputs/Toggle.d.ts +2 -3
  193. package/dist/react/core/inputs/Toggle.js +142 -148
  194. package/dist/react/core/inputs/Toggle.js.map +1 -1
  195. package/dist/react/core/layout/Box.d.ts +3 -4
  196. package/dist/react/core/layout/Box.js +118 -122
  197. package/dist/react/core/layout/Box.js.map +1 -1
  198. package/dist/react/core/layout/Center.d.ts +0 -1
  199. package/dist/react/core/layout/Center.js +45 -32
  200. package/dist/react/core/layout/Center.js.map +1 -1
  201. package/dist/react/core/layout/Divider.d.ts +1 -2
  202. package/dist/react/core/layout/Divider.js +112 -106
  203. package/dist/react/core/layout/Divider.js.map +1 -1
  204. package/dist/react/core/layout/Flex.d.ts +4 -5
  205. package/dist/react/core/layout/Flex.js +120 -124
  206. package/dist/react/core/layout/Flex.js.map +1 -1
  207. package/dist/react/core/layout/Grid.d.ts +5 -6
  208. package/dist/react/core/layout/Grid.js +131 -138
  209. package/dist/react/core/layout/Grid.js.map +1 -1
  210. package/dist/react/core/layout/Spacer.d.ts +0 -1
  211. package/dist/react/core/layout/Spacer.js +36 -29
  212. package/dist/react/core/layout/Spacer.js.map +1 -1
  213. package/dist/react/core/layout/Stack.d.ts +4 -5
  214. package/dist/react/core/layout/Stack.js +127 -70
  215. package/dist/react/core/layout/Stack.js.map +1 -1
  216. package/dist/react/core/layout/responsive.d.ts +1 -2
  217. package/dist/react/core/layout/responsive.js +25 -19
  218. package/dist/react/core/layout/responsive.js.map +1 -1
  219. package/dist/react/core/layout/useBreakpoint.d.ts +1 -1
  220. package/dist/react/core/layout/useBreakpoint.js +119 -66
  221. package/dist/react/core/layout/useBreakpoint.js.map +1 -1
  222. package/dist/react/core/navigation/AppBar.d.ts +1 -2
  223. package/dist/react/core/navigation/AppBar.js +827 -805
  224. package/dist/react/core/navigation/AppBar.js.map +1 -1
  225. package/dist/react/core/navigation/Pagination.d.ts +2 -3
  226. package/dist/react/core/navigation/Pagination.js +207 -187
  227. package/dist/react/core/navigation/Pagination.js.map +1 -1
  228. package/dist/react/core/navigation/SideNav.d.ts +5 -6
  229. package/dist/react/core/navigation/SideNav.js +855 -629
  230. package/dist/react/core/navigation/SideNav.js.map +1 -1
  231. package/dist/react/core/navigation/Tabs.d.ts +0 -1
  232. package/dist/react/core/navigation/Tabs.js +113 -119
  233. package/dist/react/core/navigation/Tabs.js.map +1 -1
  234. package/dist/react/core/overlays/Popover.d.ts +2 -3
  235. package/dist/react/core/overlays/Popover.js +303 -282
  236. package/dist/react/core/overlays/Popover.js.map +1 -1
  237. package/dist/react/core/overlays/SidePanel.d.ts +1 -2
  238. package/dist/react/core/overlays/SidePanel.js +217 -212
  239. package/dist/react/core/overlays/SidePanel.js.map +1 -1
  240. package/dist/react/core/overlays/Tooltip.d.ts +1 -2
  241. package/dist/react/core/overlays/Tooltip.js +170 -176
  242. package/dist/react/core/overlays/Tooltip.js.map +1 -1
  243. package/dist/react/core/widgets/ActivityPlanner.d.ts +0 -1
  244. package/dist/react/core/widgets/ActivityPlanner.js +855 -517
  245. package/dist/react/core/widgets/ActivityPlanner.js.map +1 -1
  246. package/dist/react/core/widgets/Capture.d.ts +2 -3
  247. package/dist/react/core/widgets/Capture.js +965 -779
  248. package/dist/react/core/widgets/Capture.js.map +1 -1
  249. package/dist/react/core/widgets/ChatPanel.d.ts +16 -17
  250. package/dist/react/core/widgets/ChatPanel.js +1734 -1034
  251. package/dist/react/core/widgets/ChatPanel.js.map +1 -1
  252. package/dist/react/core/widgets/ColorPickerPanel.d.ts +0 -1
  253. package/dist/react/core/widgets/ColorPickerPanel.js +298 -287
  254. package/dist/react/core/widgets/ColorPickerPanel.js.map +1 -1
  255. package/dist/react/core/widgets/CommandBuilder.d.ts +2 -3
  256. package/dist/react/core/widgets/CommandBuilder.js +624 -516
  257. package/dist/react/core/widgets/CommandBuilder.js.map +1 -1
  258. package/dist/react/core/widgets/ConnectionForm.d.ts +2 -3
  259. package/dist/react/core/widgets/ConnectionForm.js +528 -492
  260. package/dist/react/core/widgets/ConnectionForm.js.map +1 -1
  261. package/dist/react/core/widgets/FileExplorer.d.ts +3 -4
  262. package/dist/react/core/widgets/FileExplorer.js +617 -505
  263. package/dist/react/core/widgets/FileExplorer.js.map +1 -1
  264. package/dist/react/core/widgets/HexViewer.d.ts +2 -3
  265. package/dist/react/core/widgets/HexViewer.js +1353 -1091
  266. package/dist/react/core/widgets/HexViewer.js.map +1 -1
  267. package/dist/react/core/widgets/ImageFrame.d.ts +1 -2
  268. package/dist/react/core/widgets/ImageFrame.js +230 -193
  269. package/dist/react/core/widgets/ImageFrame.js.map +1 -1
  270. package/dist/react/core/widgets/ImageGallery.d.ts +2 -1
  271. package/dist/react/core/widgets/ImageGallery.js +380 -314
  272. package/dist/react/core/widgets/ImageGallery.js.map +1 -1
  273. package/dist/react/core/widgets/ImagePanel.d.ts +0 -1
  274. package/dist/react/core/widgets/ImagePanel.js +110 -101
  275. package/dist/react/core/widgets/ImagePanel.js.map +1 -1
  276. package/dist/react/core/widgets/LogViewer.d.ts +2 -3
  277. package/dist/react/core/widgets/LogViewer.js +711 -607
  278. package/dist/react/core/widgets/LogViewer.js.map +1 -1
  279. package/dist/react/core/widgets/MessageStream.d.ts +3 -4
  280. package/dist/react/core/widgets/MessageStream.js +514 -444
  281. package/dist/react/core/widgets/MessageStream.js.map +1 -1
  282. package/dist/react/core/widgets/MissionCalendar.d.ts +3 -4
  283. package/dist/react/core/widgets/MissionCalendar.js +1488 -1020
  284. package/dist/react/core/widgets/MissionCalendar.js.map +1 -1
  285. package/dist/react/core/widgets/PacketViewer.d.ts +2 -3
  286. package/dist/react/core/widgets/PacketViewer.js +550 -421
  287. package/dist/react/core/widgets/PacketViewer.js.map +1 -1
  288. package/dist/react/core/widgets/capture-placeholder.png.js +6 -5
  289. package/dist/react/core/widgets/capture-placeholder.png.js.map +1 -1
  290. package/dist/react/hooks/index.d.ts +5 -5
  291. package/dist/react/hooks/useAccessWindows.d.ts +0 -1
  292. package/dist/react/hooks/useCompactMode.d.ts +1 -1
  293. package/dist/react/hooks/useCompactMode.js +104 -58
  294. package/dist/react/hooks/useCompactMode.js.map +1 -1
  295. package/dist/react/hooks/useGroundTrackHistory.d.ts +0 -1
  296. package/dist/react/hooks/useSimulationScene.d.ts +1 -2
  297. package/dist/react/hooks/useSimulationScene.js +481 -374
  298. package/dist/react/hooks/useSimulationScene.js.map +1 -1
  299. package/dist/react/index.d.ts +3 -3
  300. package/dist/react/panels/LayerControlPanel.d.ts +1 -2
  301. package/dist/react/panels/LayerControlPanel.js +223 -180
  302. package/dist/react/panels/LayerControlPanel.js.map +1 -1
  303. package/dist/react/panels/ObjectInventoryPanel.d.ts +2 -3
  304. package/dist/react/panels/ObjectInventoryPanel.js +315 -250
  305. package/dist/react/panels/ObjectInventoryPanel.js.map +1 -1
  306. package/dist/react/panels/index.d.ts +1 -1
  307. package/dist/react/panels/index.js +1 -6
  308. package/dist/react/shared/ErrorBoundary.d.ts +1 -2
  309. package/dist/react/shared/ErrorBoundary.js +170 -139
  310. package/dist/react/shared/ErrorBoundary.js.map +1 -1
  311. package/dist/react/shared/Skeleton.d.ts +1 -2
  312. package/dist/react/shared/Skeleton.js +300 -301
  313. package/dist/react/shared/Skeleton.js.map +1 -1
  314. package/dist/react/theme/ThemeProvider.d.ts +2 -321
  315. package/dist/react/theme/ThemeProvider.js +312 -939
  316. package/dist/react/theme/ThemeProvider.js.map +1 -1
  317. package/dist/react/theme/cardAccent.d.ts +1 -2
  318. package/dist/react/theme/cardAccent.js +196 -126
  319. package/dist/react/theme/cardAccent.js.map +1 -1
  320. package/dist/react/theme/config.d.ts +0 -1
  321. package/dist/react/theme/config.js +47 -25
  322. package/dist/react/theme/config.js.map +1 -1
  323. package/dist/react/theme/index.d.ts +2 -2
  324. package/dist/react/theme/index.js +1 -16
  325. package/dist/react/theme/types.d.ts +332 -0
  326. package/dist/react/theme/types.js +39 -0
  327. package/dist/react/theme/types.js.map +1 -0
  328. package/dist/react/types.d.ts +8 -8
  329. package/dist/react/types.js +147 -47
  330. package/dist/react/types.js.map +1 -1
  331. package/dist/react/utils/categoryPalette.d.ts +0 -1
  332. package/dist/react/utils/categoryPalette.js +91 -102
  333. package/dist/react/utils/categoryPalette.js.map +1 -1
  334. package/dist/react/utils/index.d.ts +5 -5
  335. package/dist/react/utils/index.js +457 -371
  336. package/dist/react/utils/index.js.map +1 -1
  337. package/dist/react/visualizations/EclipseTimerCard.d.ts +0 -1
  338. package/dist/react/visualizations/LinkBudgetCard.d.ts +0 -1
  339. package/dist/react/visualizations/NavBallCard.d.ts +0 -1
  340. package/dist/react/visualizations/PropulsionCard.d.ts +1 -2
  341. package/dist/react/visualizations/SensorFootprintCard.d.ts +1 -2
  342. package/dist/react/visualizations/ThermalHeatmapCard.d.ts +0 -1
  343. package/dist/react/visualizations/index.d.ts +3 -3
  344. package/dist/react.d.ts +2 -1
  345. package/dist/react.js +17 -221
  346. package/dist/shaders/atmosphere.frag.js +6 -5
  347. package/dist/shaders/atmosphere.frag.js.map +1 -1
  348. package/dist/shaders/atmosphere.vert.js +6 -5
  349. package/dist/shaders/atmosphere.vert.js.map +1 -1
  350. package/dist/shaders/stars.frag.js +6 -5
  351. package/dist/shaders/stars.frag.js.map +1 -1
  352. package/dist/shaders/stars.vert.js +6 -5
  353. package/dist/shaders/stars.vert.js.map +1 -1
  354. package/dist/style.css +217 -194
  355. package/dist/tokens/core.d.ts +159 -0
  356. package/dist/tokens/core.js +144 -0
  357. package/dist/tokens/core.js.map +1 -0
  358. package/dist/tokens/css-vars.d.ts +213 -2
  359. package/dist/tokens/css-vars.js +590 -227
  360. package/dist/tokens/css-vars.js.map +1 -1
  361. package/dist/tokens/index.d.ts +31 -228
  362. package/dist/tokens/index.js +281 -366
  363. package/dist/tokens/index.js.map +1 -1
  364. package/dist/tokens/palettes/astro.d.ts +129 -0
  365. package/dist/tokens/palettes/astro.js +112 -0
  366. package/dist/tokens/palettes/astro.js.map +1 -0
  367. package/dist/tokens/palettes/index.d.ts +288 -0
  368. package/dist/tokens/palettes/index.js +35 -0
  369. package/dist/tokens/palettes/index.js.map +1 -0
  370. package/dist/tokens/palettes/tailwind.d.ts +324 -0
  371. package/dist/tokens/palettes/tailwind.js +201 -0
  372. package/dist/tokens/palettes/tailwind.js.map +1 -0
  373. package/dist/tokens/palettes/zendir.d.ts +126 -0
  374. package/dist/tokens/palettes/zendir.js +92 -0
  375. package/dist/tokens/palettes/zendir.js.map +1 -0
  376. package/dist/tokens/themes.d.ts +30 -0
  377. package/dist/tokens/themes.js +704 -0
  378. package/dist/tokens/themes.js.map +1 -0
  379. package/dist/tokens/tokens.css +419 -41
  380. package/dist/types/index.d.ts +2 -2
  381. package/package.json +310 -313
  382. package/dist/index.js.map +0 -1
  383. package/dist/react/3d/index.js.map +0 -1
  384. package/dist/react/astro/index.js.map +0 -1
  385. package/dist/react/cards/index.js.map +0 -1
  386. package/dist/react/charts/index.js.map +0 -1
  387. package/dist/react/core/index.js.map +0 -1
  388. package/dist/react/panels/index.js.map +0 -1
  389. package/dist/react/theme/astro-tokens.d.ts +0 -153
  390. package/dist/react/theme/index.js.map +0 -1
  391. package/dist/react.js.map +0 -1
@@ -1,431 +1,560 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import React, { memo, useState, useMemo, useCallback } from "react";
3
1
  import { useTheme } from "../../theme/ThemeProvider.js";
2
+ import React, { memo, useCallback, useMemo, useState } from "react";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/react/core/widgets/PacketViewer.tsx
5
+ /**
6
+ * @zendir/ui - PacketViewer Component
7
+ *
8
+ * Live telemetry packet viewer for spacecraft data analysis and monitoring.
9
+ * Displays telemetry items with limits coloring, raw/converted/formatted views,
10
+ * item details, and search filtering.
11
+ *
12
+ * Features:
13
+ * - Table of telemetry items with name, value, limits status
14
+ * - Limits coloring (blue, green, yellow, red) on values
15
+ * - View modes: raw, converted, formatted, with-units
16
+ * - Item search/filter
17
+ * - Item details on click (type, conversion, limits, description)
18
+ * - Stale data detection
19
+ * - Configurable refresh rate display
20
+ * - Compact mode for high-density displays
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * <PacketViewer
25
+ * target="INST"
26
+ * packet="HEALTH_STATUS"
27
+ * items={[
28
+ * { name: 'TEMP1', value: 72.5, limits: { state: 'GREEN', redLow: 0, yellowLow: 20, greenLow: 40, greenHigh: 80, yellowHigh: 90, redHigh: 100 } },
29
+ * { name: 'VOLTAGE', value: 28.1, units: 'V' },
30
+ * ]}
31
+ * />
32
+ * ```
33
+ */
4
34
  function getLimitsColor(state, tokens) {
5
- switch (state) {
6
- case "RED":
7
- case "RED_LOW":
8
- case "RED_HIGH":
9
- return tokens.colors.status.critical;
10
- case "YELLOW":
11
- case "YELLOW_LOW":
12
- case "YELLOW_HIGH":
13
- return tokens.colors.status.caution;
14
- case "GREEN":
15
- return tokens.colors.status.normal;
16
- case "BLUE":
17
- return tokens.colors.status.standby;
18
- case "STALE":
19
- return tokens.colors.status.off;
20
- default:
21
- return tokens.colors.text.primary;
22
- }
35
+ switch (state) {
36
+ case "RED":
37
+ case "RED_LOW":
38
+ case "RED_HIGH": return tokens.colors.status.critical;
39
+ case "YELLOW":
40
+ case "YELLOW_LOW":
41
+ case "YELLOW_HIGH": return tokens.colors.status.caution;
42
+ case "GREEN": return tokens.colors.status.normal;
43
+ case "BLUE": return tokens.colors.status.standby;
44
+ case "STALE": return tokens.colors.status.off;
45
+ default: return tokens.colors.text.primary;
46
+ }
23
47
  }
24
48
  function getLimitsBg(state, tokens) {
25
- const color = getLimitsColor(state, tokens);
26
- return state ? `${color}18` : "transparent";
49
+ const color = getLimitsColor(state, tokens);
50
+ return state ? `${color}18` : "transparent";
27
51
  }
52
+ /**
53
+ * Return Astro UX-compliant status shape style for a limits state.
54
+ * Maps packet limits levels to the canonical Astro status shapes:
55
+ * BLUE/STALE → off (small circle), GREEN → normal (filled circle),
56
+ * YELLOW → caution (square), RED → critical (triangle down via clip-path)
57
+ */
28
58
  function getLimitsShapeStyle(state, color) {
29
- const base = {
30
- width: 8,
31
- height: 8,
32
- display: "inline-block",
33
- background: color,
34
- boxShadow: `0 0 4px ${color}66`
35
- };
36
- switch (state) {
37
- case "GREEN":
38
- return { ...base, borderRadius: "50%" };
39
- case "YELLOW":
40
- case "YELLOW_LOW":
41
- case "YELLOW_HIGH":
42
- return { ...base, borderRadius: "1px" };
43
- case "RED":
44
- case "RED_LOW":
45
- case "RED_HIGH":
46
- return {
47
- ...base,
48
- borderRadius: 0,
49
- // critical triangle down
50
- clipPath: "polygon(50% 100%, 0% 0%, 100% 0%)"
51
- };
52
- case "BLUE":
53
- return {
54
- ...base,
55
- borderRadius: "50%",
56
- width: 6,
57
- height: 6,
58
- // standby → hollow ring
59
- background: "transparent",
60
- border: `2px solid ${color}`,
61
- boxShadow: "none"
62
- };
63
- case "STALE":
64
- return {
65
- ...base,
66
- borderRadius: "50%",
67
- width: 5,
68
- height: 5,
69
- // off → small dot
70
- opacity: 0.6
71
- };
72
- default:
73
- return { ...base, borderRadius: "50%" };
74
- }
59
+ const base = {
60
+ width: 8,
61
+ height: 8,
62
+ display: "inline-block",
63
+ background: color,
64
+ boxShadow: `0 0 4px ${color}66`
65
+ };
66
+ switch (state) {
67
+ case "GREEN": return {
68
+ ...base,
69
+ borderRadius: "50%"
70
+ };
71
+ case "YELLOW":
72
+ case "YELLOW_LOW":
73
+ case "YELLOW_HIGH": return {
74
+ ...base,
75
+ borderRadius: "1px"
76
+ };
77
+ case "RED":
78
+ case "RED_LOW":
79
+ case "RED_HIGH": return {
80
+ ...base,
81
+ borderRadius: 0,
82
+ clipPath: "polygon(50% 100%, 0% 0%, 100% 0%)"
83
+ };
84
+ case "BLUE": return {
85
+ ...base,
86
+ borderRadius: "50%",
87
+ width: 6,
88
+ height: 6,
89
+ background: "transparent",
90
+ border: `2px solid ${color}`,
91
+ boxShadow: "none"
92
+ };
93
+ case "STALE": return {
94
+ ...base,
95
+ borderRadius: "50%",
96
+ width: 5,
97
+ height: 5,
98
+ opacity: .6
99
+ };
100
+ default: return {
101
+ ...base,
102
+ borderRadius: "50%"
103
+ };
104
+ }
75
105
  }
76
106
  function getDisplayValue(item, mode) {
77
- switch (mode) {
78
- case "raw":
79
- return String(item.value);
80
- case "converted":
81
- return String(item.convertedValue ?? item.value);
82
- case "formatted":
83
- return item.formattedValue ?? String(item.convertedValue ?? item.value);
84
- case "with_units": {
85
- const val = item.formattedValue ?? String(item.convertedValue ?? item.value);
86
- return item.units ? `${val} ${item.units}` : val;
87
- }
88
- }
107
+ switch (mode) {
108
+ case "raw": return String(item.value);
109
+ case "converted": return String(item.convertedValue ?? item.value);
110
+ case "formatted": return item.formattedValue ?? String(item.convertedValue ?? item.value);
111
+ case "with_units": {
112
+ const val = item.formattedValue ?? String(item.convertedValue ?? item.value);
113
+ return item.units ? `${val} ${item.units}` : val;
114
+ }
115
+ }
89
116
  }
90
- const PacketViewer = memo(function PacketViewer2({
91
- target,
92
- packet,
93
- items,
94
- viewMode: initialViewMode = "converted",
95
- height = 500,
96
- derivedLast = true,
97
- showSearch = true,
98
- showViewMode = true,
99
- compact = false,
100
- onItemClick,
101
- className = "",
102
- bordered = true,
103
- style: styleProp
104
- }) {
105
- const { tokens, theme } = useTheme();
106
- const isTransparentTheme = theme === "transparent" || theme === "transparent-bold" || theme === "transparent-minimal";
107
- const [searchQuery, setSearchQuery] = useState("");
108
- const [viewMode, setViewMode] = useState(initialViewMode);
109
- const [selectedItem, setSelectedItem] = useState(null);
110
- const [showDetails, setShowDetails] = useState(false);
111
- const [scrollTop, setScrollTop] = useState(0);
112
- const [viewportHeight, setViewportHeight] = useState(240);
113
- const listRef = React.useRef(null);
114
- const sortedItems = useMemo(() => {
115
- let filtered = items;
116
- if (searchQuery.trim()) {
117
- const q = searchQuery.toLowerCase();
118
- filtered = items.filter((i) => i.name.toLowerCase().includes(q) || i.description && i.description.toLowerCase().includes(q));
119
- }
120
- if (derivedLast) {
121
- const regular = filtered.filter((i) => !i.derived);
122
- const derived = filtered.filter((i) => i.derived);
123
- return [...regular, ...derived];
124
- }
125
- return filtered;
126
- }, [items, searchQuery, derivedLast]);
127
- const handleItemClick = useCallback((item) => {
128
- setSelectedItem(item);
129
- setShowDetails(true);
130
- onItemClick == null ? void 0 : onItemClick(item);
131
- }, [onItemClick]);
132
- const rowHeight = compact ? 26 : 32;
133
- const overscanRows = 12;
134
- const totalRows = sortedItems.length;
135
- const startRow = Math.max(0, Math.floor(scrollTop / rowHeight) - overscanRows);
136
- const visibleRows = Math.ceil(viewportHeight / rowHeight) + overscanRows * 2;
137
- const endRow = Math.min(totalRows, startRow + visibleRows);
138
- const visibleItems = useMemo(
139
- () => sortedItems.slice(startRow, endRow),
140
- [sortedItems, startRow, endRow]
141
- );
142
- React.useEffect(() => {
143
- const el = listRef.current;
144
- if (!el) return void 0;
145
- const updateHeight = () => setViewportHeight(Math.max(rowHeight * 4, el.clientHeight || 240));
146
- updateHeight();
147
- if (typeof ResizeObserver !== "undefined") {
148
- const observer = new ResizeObserver(updateHeight);
149
- observer.observe(el);
150
- return () => observer.disconnect();
151
- }
152
- window.addEventListener("resize", updateHeight);
153
- return () => window.removeEventListener("resize", updateHeight);
154
- }, [rowHeight]);
155
- return /* @__PURE__ */ jsxs(
156
- "div",
157
- {
158
- className: `packet-viewer ${className}`,
159
- style: {
160
- height: typeof height === "number" ? height : void 0,
161
- background: tokens.colors.background.base,
162
- ...bordered ? tokens.colors.border.cardStyle ?? { border: `1px solid ${tokens.colors.border.muted}` } : { border: "none" },
163
- borderRadius: tokens.borderRadius.lg,
164
- overflow: "hidden",
165
- display: "flex",
166
- flexDirection: "column",
167
- fontFamily: tokens.typography.fontFamily.primary,
168
- color: tokens.colors.text.primary,
169
- backdropFilter: isTransparentTheme ? "blur(10px)" : void 0,
170
- WebkitBackdropFilter: isTransparentTheme ? "blur(10px)" : void 0,
171
- ...styleProp
172
- },
173
- children: [
174
- /* @__PURE__ */ jsxs("div", { style: {
175
- padding: "8px 12px",
176
- borderBottom: `1px solid ${tokens.colors.border.muted}`,
177
- display: "flex",
178
- alignItems: "center",
179
- justifyContent: "space-between",
180
- background: tokens.colors.background.surface,
181
- backdropFilter: "blur(8px)",
182
- flexWrap: "wrap",
183
- gap: 8
184
- }, children: [
185
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
186
- target && /* @__PURE__ */ jsx("span", { style: {
187
- background: `${tokens.colors.interactive.default}22`,
188
- color: tokens.colors.interactive.default,
189
- padding: "2px 8px",
190
- borderRadius: tokens.borderRadius.md,
191
- fontSize: tokens.typography.fontSize.xxs,
192
- fontWeight: 600
193
- }, children: target }),
194
- packet && /* @__PURE__ */ jsx("span", { style: { fontWeight: 600, fontSize: tokens.typography.fontSize.sm }, children: packet }),
195
- /* @__PURE__ */ jsxs("span", { style: { fontSize: tokens.typography.fontSize.xxs, color: tokens.colors.text.muted }, children: [
196
- sortedItems.length,
197
- " items"
198
- ] })
199
- ] }),
200
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
201
- showViewMode && /* @__PURE__ */ jsxs(
202
- "select",
203
- {
204
- value: viewMode,
205
- onChange: (e) => setViewMode(e.target.value),
206
- "aria-label": "Packet view mode",
207
- style: {
208
- background: tokens.colors.background.base,
209
- color: tokens.colors.text.primary,
210
- border: `1px solid ${tokens.colors.border.muted}`,
211
- borderRadius: tokens.borderRadius.md,
212
- padding: "3px 8px",
213
- fontSize: tokens.typography.fontSize.xxs
214
- },
215
- children: [
216
- /* @__PURE__ */ jsx("option", { value: "raw", children: "Raw" }),
217
- /* @__PURE__ */ jsx("option", { value: "converted", children: "Converted" }),
218
- /* @__PURE__ */ jsx("option", { value: "formatted", children: "Formatted" }),
219
- /* @__PURE__ */ jsx("option", { value: "with_units", children: "With Units" })
220
- ]
221
- }
222
- ),
223
- showSearch && /* @__PURE__ */ jsx(
224
- "input",
225
- {
226
- type: "text",
227
- value: searchQuery,
228
- onChange: (e) => setSearchQuery(e.target.value),
229
- placeholder: "Filter items...",
230
- "aria-label": "Filter packet items",
231
- style: {
232
- background: tokens.colors.background.base,
233
- color: tokens.colors.text.primary,
234
- border: `1px solid ${tokens.colors.border.muted}`,
235
- borderRadius: tokens.borderRadius.md,
236
- padding: "3px 8px",
237
- fontSize: tokens.typography.fontSize.xxs,
238
- outline: "none",
239
- minWidth: 120
240
- }
241
- }
242
- )
243
- ] })
244
- ] }),
245
- /* @__PURE__ */ jsxs("div", { role: "row", style: {
246
- display: "grid",
247
- gridTemplateColumns: "1fr 1fr auto",
248
- padding: `${tokens.spacing.xs} ${tokens.spacing.smd}`,
249
- borderBottom: `1px solid ${tokens.colors.border.muted}`,
250
- background: tokens.colors.background.surface,
251
- fontSize: tokens.typography.fontSize.xxs,
252
- color: tokens.colors.text.muted,
253
- textTransform: "uppercase",
254
- letterSpacing: "0.5px",
255
- fontWeight: tokens.typography.fontWeight.medium
256
- }, children: [
257
- /* @__PURE__ */ jsx("span", { role: "columnheader", children: "Item" }),
258
- /* @__PURE__ */ jsx("span", { role: "columnheader", style: { textAlign: "right" }, children: "Value" }),
259
- /* @__PURE__ */ jsx("span", { role: "columnheader", style: { minWidth: 50, textAlign: "center" }, children: "Limits" })
260
- ] }),
261
- /* @__PURE__ */ jsx(
262
- "div",
263
- {
264
- ref: listRef,
265
- role: "rowgroup",
266
- onScroll: (e) => setScrollTop(e.currentTarget.scrollTop),
267
- style: { flex: 1, overflow: "auto" },
268
- children: /* @__PURE__ */ jsx("div", { style: { height: totalRows * rowHeight, position: "relative" }, children: /* @__PURE__ */ jsx("div", { style: { position: "absolute", top: startRow * rowHeight, left: 0, right: 0 }, children: visibleItems.map((item, visibleIdx) => {
269
- var _a, _b, _c, _d;
270
- const idx = startRow + visibleIdx;
271
- const limitsColor = item.stale ? tokens.colors.status.off : getLimitsColor(((_a = item.limits) == null ? void 0 : _a.state) ?? null, tokens);
272
- const limitsBg = item.stale ? `${tokens.colors.status.off}14` : getLimitsBg(((_b = item.limits) == null ? void 0 : _b.state) ?? null, tokens);
273
- return /* @__PURE__ */ jsxs(
274
- "div",
275
- {
276
- role: "row",
277
- tabIndex: 0,
278
- onClick: () => handleItemClick(item),
279
- onKeyDown: (e) => {
280
- if (e.key === "Enter" || e.key === " ") {
281
- e.preventDefault();
282
- handleItemClick(item);
283
- }
284
- },
285
- "aria-label": `${item.name}: ${getDisplayValue(item, viewMode)}${((_c = item.limits) == null ? void 0 : _c.state) ? `, ${item.limits.state}` : ""}`,
286
- style: {
287
- display: "grid",
288
- gridTemplateColumns: "1fr 1fr auto",
289
- padding: `0 ${tokens.spacing.smd}`,
290
- height: rowHeight,
291
- alignItems: "center",
292
- borderBottom: `1px solid ${tokens.colors.border.muted}`,
293
- cursor: "pointer",
294
- transition: "background 150ms ease",
295
- background: item.derived ? `${tokens.colors.background.surface}44` : "transparent"
296
- },
297
- onMouseEnter: (e) => {
298
- e.currentTarget.style.background = tokens.colors.background.surface;
299
- },
300
- onMouseLeave: (e) => {
301
- e.currentTarget.style.background = item.derived ? `${tokens.colors.background.surface}44` : "transparent";
302
- },
303
- children: [
304
- /* @__PURE__ */ jsx("span", { style: {
305
- fontSize: compact ? tokens.typography.fontSize.xxs : tokens.typography.fontSize.xs,
306
- fontWeight: 500,
307
- color: item.derived ? tokens.colors.text.muted : tokens.colors.text.primary,
308
- fontStyle: item.derived ? "italic" : "normal",
309
- overflow: "hidden",
310
- textOverflow: "ellipsis",
311
- whiteSpace: "nowrap"
312
- }, children: item.name }),
313
- /* @__PURE__ */ jsx("span", { style: {
314
- textAlign: "right",
315
- fontFamily: tokens.typography.fontFamily.mono,
316
- fontSize: compact ? tokens.typography.fontSize.xxs : tokens.typography.fontSize.xs,
317
- fontWeight: 600,
318
- color: limitsColor,
319
- background: limitsBg,
320
- padding: "2px 8px",
321
- borderRadius: tokens.borderRadius.sm,
322
- overflow: "hidden",
323
- textOverflow: "ellipsis",
324
- whiteSpace: "nowrap"
325
- }, children: getDisplayValue(item, viewMode) }),
326
- /* @__PURE__ */ jsx("div", { style: { minWidth: 50, display: "flex", justifyContent: "center" }, children: ((_d = item.limits) == null ? void 0 : _d.state) && /* @__PURE__ */ jsxs("div", { style: {
327
- display: "flex",
328
- alignItems: "center",
329
- gap: 3
330
- }, children: [
331
- /* @__PURE__ */ jsx("span", { style: getLimitsShapeStyle(item.limits.state, limitsColor) }),
332
- /* @__PURE__ */ jsx("span", { style: { fontSize: tokens.typography.fontSize.micro, color: limitsColor, fontWeight: 600 }, children: item.limits.state.replace(/_/g, " ") })
333
- ] }) })
334
- ]
335
- },
336
- item.name + idx
337
- );
338
- }) }) })
339
- }
340
- ),
341
- showDetails && selectedItem && /* @__PURE__ */ jsxs("div", { style: {
342
- borderTop: `1px solid ${tokens.colors.border.muted}`,
343
- background: tokens.colors.background.surface,
344
- padding: 12,
345
- maxHeight: 200,
346
- overflow: "auto"
347
- }, children: [
348
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: tokens.spacing.sm }, children: [
349
- /* @__PURE__ */ jsx("span", { style: { fontWeight: tokens.typography.fontWeight.bold, fontSize: tokens.typography.fontSize.sm }, children: selectedItem.name }),
350
- /* @__PURE__ */ jsx(
351
- "button",
352
- {
353
- onClick: () => setShowDetails(false),
354
- "aria-label": "Close details panel",
355
- style: { background: "none", border: "none", color: tokens.colors.text.muted, cursor: "pointer", fontSize: tokens.typography.fontSize.lg, padding: tokens.spacing.xs, lineHeight: 1 },
356
- children: ""
357
- }
358
- )
359
- ] }),
360
- selectedItem.description && /* @__PURE__ */ jsx("p", { style: { color: tokens.colors.text.secondary, fontSize: tokens.typography.fontSize.xs, marginBottom: 8 }, children: selectedItem.description }),
361
- /* @__PURE__ */ jsxs("div", { style: {
362
- display: "grid",
363
- gridTemplateColumns: "auto 1fr",
364
- gap: "4px 12px",
365
- fontSize: tokens.typography.fontSize.xxs,
366
- fontFamily: tokens.typography.fontFamily.mono
367
- }, children: [
368
- /* @__PURE__ */ jsx("span", { style: { color: tokens.colors.text.muted }, children: "Raw:" }),
369
- /* @__PURE__ */ jsx("span", { children: String(selectedItem.value) }),
370
- selectedItem.convertedValue !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
371
- /* @__PURE__ */ jsx("span", { style: { color: tokens.colors.text.muted }, children: "Converted:" }),
372
- /* @__PURE__ */ jsx("span", { children: String(selectedItem.convertedValue) })
373
- ] }),
374
- selectedItem.units && /* @__PURE__ */ jsxs(Fragment, { children: [
375
- /* @__PURE__ */ jsx("span", { style: { color: tokens.colors.text.muted }, children: "Units:" }),
376
- /* @__PURE__ */ jsx("span", { children: selectedItem.units })
377
- ] }),
378
- selectedItem.dataType && /* @__PURE__ */ jsxs(Fragment, { children: [
379
- /* @__PURE__ */ jsx("span", { style: { color: tokens.colors.text.muted }, children: "Type:" }),
380
- /* @__PURE__ */ jsx("span", { children: selectedItem.dataType })
381
- ] }),
382
- selectedItem.bitSize !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
383
- /* @__PURE__ */ jsx("span", { style: { color: tokens.colors.text.muted }, children: "Bit Size:" }),
384
- /* @__PURE__ */ jsx("span", { children: selectedItem.bitSize })
385
- ] }),
386
- selectedItem.bitOffset !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
387
- /* @__PURE__ */ jsx("span", { style: { color: tokens.colors.text.muted }, children: "Bit Offset:" }),
388
- /* @__PURE__ */ jsx("span", { children: selectedItem.bitOffset })
389
- ] }),
390
- selectedItem.conversion && /* @__PURE__ */ jsxs(Fragment, { children: [
391
- /* @__PURE__ */ jsx("span", { style: { color: tokens.colors.text.muted }, children: "Conversion:" }),
392
- /* @__PURE__ */ jsx("span", { children: selectedItem.conversion })
393
- ] }),
394
- selectedItem.limits && /* @__PURE__ */ jsxs(Fragment, { children: [
395
- /* @__PURE__ */ jsx("span", { style: { color: tokens.colors.text.muted }, children: "Limits State:" }),
396
- /* @__PURE__ */ jsx("span", { style: { color: getLimitsColor(selectedItem.limits.state, tokens) }, children: selectedItem.limits.state }),
397
- selectedItem.limits.redLow !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
398
- /* @__PURE__ */ jsx("span", { style: { color: tokens.colors.text.muted }, children: "Red Low:" }),
399
- /* @__PURE__ */ jsx("span", { children: selectedItem.limits.redLow })
400
- ] }),
401
- selectedItem.limits.yellowLow !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
402
- /* @__PURE__ */ jsx("span", { style: { color: tokens.colors.text.muted }, children: "Yellow Low:" }),
403
- /* @__PURE__ */ jsx("span", { children: selectedItem.limits.yellowLow })
404
- ] }),
405
- selectedItem.limits.greenHigh !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
406
- /* @__PURE__ */ jsx("span", { style: { color: tokens.colors.text.muted }, children: "Green High:" }),
407
- /* @__PURE__ */ jsx("span", { children: selectedItem.limits.greenHigh })
408
- ] }),
409
- selectedItem.limits.yellowHigh !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
410
- /* @__PURE__ */ jsx("span", { style: { color: tokens.colors.text.muted }, children: "Yellow High:" }),
411
- /* @__PURE__ */ jsx("span", { children: selectedItem.limits.yellowHigh })
412
- ] }),
413
- selectedItem.limits.redHigh !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
414
- /* @__PURE__ */ jsx("span", { style: { color: tokens.colors.text.muted }, children: "Red High:" }),
415
- /* @__PURE__ */ jsx("span", { children: selectedItem.limits.redHigh })
416
- ] })
417
- ] }),
418
- selectedItem.states && /* @__PURE__ */ jsxs(Fragment, { children: [
419
- /* @__PURE__ */ jsx("span", { style: { color: tokens.colors.text.muted }, children: "States:" }),
420
- /* @__PURE__ */ jsx("span", { children: Object.entries(selectedItem.states).map(([k, v]) => `${k}=${v}`).join(", ") })
421
- ] })
422
- ] })
423
- ] })
424
- ]
425
- }
426
- );
117
+ var PacketViewer = memo(function PacketViewer({ target, packet, items, viewMode: initialViewMode = "converted", height = 500, derivedLast = true, showSearch = true, showViewMode = true, compact = false, onItemClick, className = "", bordered = true, style: styleProp }) {
118
+ const { tokens, theme } = useTheme();
119
+ const isTransparentTheme = theme === "transparent" || theme === "transparent-bold" || theme === "transparent-minimal";
120
+ const [searchQuery, setSearchQuery] = useState("");
121
+ const [viewMode, setViewMode] = useState(initialViewMode);
122
+ const [selectedItem, setSelectedItem] = useState(null);
123
+ const [showDetails, setShowDetails] = useState(false);
124
+ const [scrollTop, setScrollTop] = useState(0);
125
+ const [viewportHeight, setViewportHeight] = useState(240);
126
+ const listRef = React.useRef(null);
127
+ const sortedItems = useMemo(() => {
128
+ let filtered = items;
129
+ if (searchQuery.trim()) {
130
+ const q = searchQuery.toLowerCase();
131
+ filtered = items.filter((i) => i.name.toLowerCase().includes(q) || i.description && i.description.toLowerCase().includes(q));
132
+ }
133
+ if (derivedLast) {
134
+ const regular = filtered.filter((i) => !i.derived);
135
+ const derived = filtered.filter((i) => i.derived);
136
+ return [...regular, ...derived];
137
+ }
138
+ return filtered;
139
+ }, [
140
+ items,
141
+ searchQuery,
142
+ derivedLast
143
+ ]);
144
+ const handleItemClick = useCallback((item) => {
145
+ setSelectedItem(item);
146
+ setShowDetails(true);
147
+ onItemClick?.(item);
148
+ }, [onItemClick]);
149
+ const rowHeight = compact ? 26 : 32;
150
+ const overscanRows = 12;
151
+ const totalRows = sortedItems.length;
152
+ const startRow = Math.max(0, Math.floor(scrollTop / rowHeight) - overscanRows);
153
+ const visibleRows = Math.ceil(viewportHeight / rowHeight) + overscanRows * 2;
154
+ const endRow = Math.min(totalRows, startRow + visibleRows);
155
+ const visibleItems = useMemo(() => sortedItems.slice(startRow, endRow), [
156
+ sortedItems,
157
+ startRow,
158
+ endRow
159
+ ]);
160
+ React.useEffect(() => {
161
+ const el = listRef.current;
162
+ if (!el) return void 0;
163
+ const updateHeight = () => setViewportHeight(Math.max(rowHeight * 4, el.clientHeight || 240));
164
+ updateHeight();
165
+ if (typeof ResizeObserver !== "undefined") {
166
+ const observer = new ResizeObserver(updateHeight);
167
+ observer.observe(el);
168
+ return () => observer.disconnect();
169
+ }
170
+ window.addEventListener("resize", updateHeight);
171
+ return () => window.removeEventListener("resize", updateHeight);
172
+ }, [rowHeight]);
173
+ return /* @__PURE__ */ jsxs("div", {
174
+ className: `packet-viewer ${className}`,
175
+ style: {
176
+ height: typeof height === "number" ? height : void 0,
177
+ background: tokens.colors.background.base,
178
+ ...bordered ? tokens.colors.border.cardStyle ?? { border: `1px solid ${tokens.colors.border.muted}` } : { border: "none" },
179
+ borderRadius: tokens.borderRadius.lg,
180
+ overflow: "hidden",
181
+ display: "flex",
182
+ flexDirection: "column",
183
+ fontFamily: tokens.typography.fontFamily.primary,
184
+ color: tokens.colors.text.primary,
185
+ backdropFilter: isTransparentTheme ? "blur(10px)" : void 0,
186
+ WebkitBackdropFilter: isTransparentTheme ? "blur(10px)" : void 0,
187
+ ...styleProp
188
+ },
189
+ children: [
190
+ /* @__PURE__ */ jsxs("div", {
191
+ style: {
192
+ padding: "8px 12px",
193
+ borderBottom: `1px solid ${tokens.colors.border.muted}`,
194
+ display: "flex",
195
+ alignItems: "center",
196
+ justifyContent: "space-between",
197
+ background: tokens.colors.background.surface,
198
+ backdropFilter: "blur(8px)",
199
+ flexWrap: "wrap",
200
+ gap: 8
201
+ },
202
+ children: [/* @__PURE__ */ jsxs("div", {
203
+ style: {
204
+ display: "flex",
205
+ alignItems: "center",
206
+ gap: 8
207
+ },
208
+ children: [
209
+ target && /* @__PURE__ */ jsx("span", {
210
+ style: {
211
+ background: `${tokens.colors.interactive.default}22`,
212
+ color: tokens.colors.interactive.default,
213
+ padding: "2px 8px",
214
+ borderRadius: tokens.borderRadius.md,
215
+ fontSize: tokens.typography.fontSize.xxs,
216
+ fontWeight: 600
217
+ },
218
+ children: target
219
+ }),
220
+ packet && /* @__PURE__ */ jsx("span", {
221
+ style: {
222
+ fontWeight: 600,
223
+ fontSize: tokens.typography.fontSize.sm
224
+ },
225
+ children: packet
226
+ }),
227
+ /* @__PURE__ */ jsxs("span", {
228
+ style: {
229
+ fontSize: tokens.typography.fontSize.xxs,
230
+ color: tokens.colors.text.muted
231
+ },
232
+ children: [sortedItems.length, " items"]
233
+ })
234
+ ]
235
+ }), /* @__PURE__ */ jsxs("div", {
236
+ style: {
237
+ display: "flex",
238
+ alignItems: "center",
239
+ gap: 8
240
+ },
241
+ children: [showViewMode && /* @__PURE__ */ jsxs("select", {
242
+ value: viewMode,
243
+ onChange: (e) => setViewMode(e.target.value),
244
+ "aria-label": "Packet view mode",
245
+ style: {
246
+ background: tokens.colors.background.base,
247
+ color: tokens.colors.text.primary,
248
+ border: `1px solid ${tokens.colors.border.muted}`,
249
+ borderRadius: tokens.borderRadius.md,
250
+ padding: "3px 8px",
251
+ fontSize: tokens.typography.fontSize.xxs
252
+ },
253
+ children: [
254
+ /* @__PURE__ */ jsx("option", {
255
+ value: "raw",
256
+ children: "Raw"
257
+ }),
258
+ /* @__PURE__ */ jsx("option", {
259
+ value: "converted",
260
+ children: "Converted"
261
+ }),
262
+ /* @__PURE__ */ jsx("option", {
263
+ value: "formatted",
264
+ children: "Formatted"
265
+ }),
266
+ /* @__PURE__ */ jsx("option", {
267
+ value: "with_units",
268
+ children: "With Units"
269
+ })
270
+ ]
271
+ }), showSearch && /* @__PURE__ */ jsx("input", {
272
+ type: "text",
273
+ value: searchQuery,
274
+ onChange: (e) => setSearchQuery(e.target.value),
275
+ placeholder: "Filter items...",
276
+ "aria-label": "Filter packet items",
277
+ style: {
278
+ background: tokens.colors.background.base,
279
+ color: tokens.colors.text.primary,
280
+ border: `1px solid ${tokens.colors.border.muted}`,
281
+ borderRadius: tokens.borderRadius.md,
282
+ padding: "3px 8px",
283
+ fontSize: tokens.typography.fontSize.xxs,
284
+ outline: "none",
285
+ minWidth: 120
286
+ }
287
+ })]
288
+ })]
289
+ }),
290
+ /* @__PURE__ */ jsxs("div", {
291
+ role: "row",
292
+ style: {
293
+ display: "grid",
294
+ gridTemplateColumns: "1fr 1fr auto",
295
+ padding: `${tokens.spacing.xs} ${tokens.spacing.smd}`,
296
+ borderBottom: `1px solid ${tokens.colors.border.muted}`,
297
+ background: tokens.colors.background.surface,
298
+ fontSize: tokens.typography.fontSize.xxs,
299
+ color: tokens.colors.text.muted,
300
+ textTransform: "uppercase",
301
+ letterSpacing: "0.5px",
302
+ fontWeight: tokens.typography.fontWeight.medium
303
+ },
304
+ children: [
305
+ /* @__PURE__ */ jsx("span", {
306
+ role: "columnheader",
307
+ children: "Item"
308
+ }),
309
+ /* @__PURE__ */ jsx("span", {
310
+ role: "columnheader",
311
+ style: { textAlign: "right" },
312
+ children: "Value"
313
+ }),
314
+ /* @__PURE__ */ jsx("span", {
315
+ role: "columnheader",
316
+ style: {
317
+ minWidth: 50,
318
+ textAlign: "center"
319
+ },
320
+ children: "Limits"
321
+ })
322
+ ]
323
+ }),
324
+ /* @__PURE__ */ jsx("div", {
325
+ ref: listRef,
326
+ role: "rowgroup",
327
+ onScroll: (e) => setScrollTop(e.currentTarget.scrollTop),
328
+ style: {
329
+ flex: 1,
330
+ overflow: "auto"
331
+ },
332
+ children: /* @__PURE__ */ jsx("div", {
333
+ style: {
334
+ height: totalRows * rowHeight,
335
+ position: "relative"
336
+ },
337
+ children: /* @__PURE__ */ jsx("div", {
338
+ style: {
339
+ position: "absolute",
340
+ top: startRow * rowHeight,
341
+ left: 0,
342
+ right: 0
343
+ },
344
+ children: visibleItems.map((item, visibleIdx) => {
345
+ const idx = startRow + visibleIdx;
346
+ const limitsColor = item.stale ? tokens.colors.status.off : getLimitsColor(item.limits?.state ?? null, tokens);
347
+ const limitsBg = item.stale ? `${tokens.colors.status.off}14` : getLimitsBg(item.limits?.state ?? null, tokens);
348
+ return /* @__PURE__ */ jsxs("div", {
349
+ role: "row",
350
+ tabIndex: 0,
351
+ onClick: () => handleItemClick(item),
352
+ onKeyDown: (e) => {
353
+ if (e.key === "Enter" || e.key === " ") {
354
+ e.preventDefault();
355
+ handleItemClick(item);
356
+ }
357
+ },
358
+ "aria-label": `${item.name}: ${getDisplayValue(item, viewMode)}${item.limits?.state ? `, ${item.limits.state}` : ""}`,
359
+ style: {
360
+ display: "grid",
361
+ gridTemplateColumns: "1fr 1fr auto",
362
+ padding: `0 ${tokens.spacing.smd}`,
363
+ height: rowHeight,
364
+ alignItems: "center",
365
+ borderBottom: `1px solid ${tokens.colors.border.muted}`,
366
+ cursor: "pointer",
367
+ transition: "background 150ms ease",
368
+ background: item.derived ? `${tokens.colors.background.surface}44` : "transparent"
369
+ },
370
+ onMouseEnter: (e) => {
371
+ e.currentTarget.style.background = tokens.colors.background.surface;
372
+ },
373
+ onMouseLeave: (e) => {
374
+ e.currentTarget.style.background = item.derived ? `${tokens.colors.background.surface}44` : "transparent";
375
+ },
376
+ children: [
377
+ /* @__PURE__ */ jsx("span", {
378
+ style: {
379
+ fontSize: compact ? tokens.typography.fontSize.xxs : tokens.typography.fontSize.xs,
380
+ fontWeight: 500,
381
+ color: item.derived ? tokens.colors.text.muted : tokens.colors.text.primary,
382
+ fontStyle: item.derived ? "italic" : "normal",
383
+ overflow: "hidden",
384
+ textOverflow: "ellipsis",
385
+ whiteSpace: "nowrap"
386
+ },
387
+ children: item.name
388
+ }),
389
+ /* @__PURE__ */ jsx("span", {
390
+ style: {
391
+ textAlign: "right",
392
+ fontFamily: tokens.typography.fontFamily.mono,
393
+ fontSize: compact ? tokens.typography.fontSize.xxs : tokens.typography.fontSize.xs,
394
+ fontWeight: 600,
395
+ color: limitsColor,
396
+ background: limitsBg,
397
+ padding: "2px 8px",
398
+ borderRadius: tokens.borderRadius.sm,
399
+ overflow: "hidden",
400
+ textOverflow: "ellipsis",
401
+ whiteSpace: "nowrap"
402
+ },
403
+ children: getDisplayValue(item, viewMode)
404
+ }),
405
+ /* @__PURE__ */ jsx("div", {
406
+ style: {
407
+ minWidth: 50,
408
+ display: "flex",
409
+ justifyContent: "center"
410
+ },
411
+ children: item.limits?.state && /* @__PURE__ */ jsxs("div", {
412
+ style: {
413
+ display: "flex",
414
+ alignItems: "center",
415
+ gap: 3
416
+ },
417
+ children: [/* @__PURE__ */ jsx("span", { style: getLimitsShapeStyle(item.limits.state, limitsColor) }), /* @__PURE__ */ jsx("span", {
418
+ style: {
419
+ fontSize: tokens.typography.fontSize.micro,
420
+ color: limitsColor,
421
+ fontWeight: 600
422
+ },
423
+ children: item.limits.state.replace(/_/g, " ")
424
+ })]
425
+ })
426
+ })
427
+ ]
428
+ }, item.name + idx);
429
+ })
430
+ })
431
+ })
432
+ }),
433
+ showDetails && selectedItem && /* @__PURE__ */ jsxs("div", {
434
+ style: {
435
+ borderTop: `1px solid ${tokens.colors.border.muted}`,
436
+ background: tokens.colors.background.surface,
437
+ padding: 12,
438
+ maxHeight: 200,
439
+ overflow: "auto"
440
+ },
441
+ children: [
442
+ /* @__PURE__ */ jsxs("div", {
443
+ style: {
444
+ display: "flex",
445
+ justifyContent: "space-between",
446
+ alignItems: "center",
447
+ marginBottom: tokens.spacing.sm
448
+ },
449
+ children: [/* @__PURE__ */ jsx("span", {
450
+ style: {
451
+ fontWeight: tokens.typography.fontWeight.bold,
452
+ fontSize: tokens.typography.fontSize.sm
453
+ },
454
+ children: selectedItem.name
455
+ }), /* @__PURE__ */ jsx("button", {
456
+ onClick: () => setShowDetails(false),
457
+ "aria-label": "Close details panel",
458
+ style: {
459
+ background: "none",
460
+ border: "none",
461
+ color: tokens.colors.text.muted,
462
+ cursor: "pointer",
463
+ fontSize: tokens.typography.fontSize.lg,
464
+ padding: tokens.spacing.xs,
465
+ lineHeight: 1
466
+ },
467
+ children: "✕"
468
+ })]
469
+ }),
470
+ selectedItem.description && /* @__PURE__ */ jsx("p", {
471
+ style: {
472
+ color: tokens.colors.text.secondary,
473
+ fontSize: tokens.typography.fontSize.xs,
474
+ marginBottom: 8
475
+ },
476
+ children: selectedItem.description
477
+ }),
478
+ /* @__PURE__ */ jsxs("div", {
479
+ style: {
480
+ display: "grid",
481
+ gridTemplateColumns: "auto 1fr",
482
+ gap: "4px 12px",
483
+ fontSize: tokens.typography.fontSize.xxs,
484
+ fontFamily: tokens.typography.fontFamily.mono
485
+ },
486
+ children: [
487
+ /* @__PURE__ */ jsx("span", {
488
+ style: { color: tokens.colors.text.muted },
489
+ children: "Raw:"
490
+ }),
491
+ /* @__PURE__ */ jsx("span", { children: String(selectedItem.value) }),
492
+ selectedItem.convertedValue !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
493
+ style: { color: tokens.colors.text.muted },
494
+ children: "Converted:"
495
+ }), /* @__PURE__ */ jsx("span", { children: String(selectedItem.convertedValue) })] }),
496
+ selectedItem.units && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
497
+ style: { color: tokens.colors.text.muted },
498
+ children: "Units:"
499
+ }), /* @__PURE__ */ jsx("span", { children: selectedItem.units })] }),
500
+ selectedItem.dataType && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
501
+ style: { color: tokens.colors.text.muted },
502
+ children: "Type:"
503
+ }), /* @__PURE__ */ jsx("span", { children: selectedItem.dataType })] }),
504
+ selectedItem.bitSize !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
505
+ style: { color: tokens.colors.text.muted },
506
+ children: "Bit Size:"
507
+ }), /* @__PURE__ */ jsx("span", { children: selectedItem.bitSize })] }),
508
+ selectedItem.bitOffset !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
509
+ style: { color: tokens.colors.text.muted },
510
+ children: "Bit Offset:"
511
+ }), /* @__PURE__ */ jsx("span", { children: selectedItem.bitOffset })] }),
512
+ selectedItem.conversion && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
513
+ style: { color: tokens.colors.text.muted },
514
+ children: "Conversion:"
515
+ }), /* @__PURE__ */ jsx("span", { children: selectedItem.conversion })] }),
516
+ selectedItem.limits && /* @__PURE__ */ jsxs(Fragment, { children: [
517
+ /* @__PURE__ */ jsx("span", {
518
+ style: { color: tokens.colors.text.muted },
519
+ children: "Limits State:"
520
+ }),
521
+ /* @__PURE__ */ jsx("span", {
522
+ style: { color: getLimitsColor(selectedItem.limits.state, tokens) },
523
+ children: selectedItem.limits.state
524
+ }),
525
+ selectedItem.limits.redLow !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
526
+ style: { color: tokens.colors.text.muted },
527
+ children: "Red Low:"
528
+ }), /* @__PURE__ */ jsx("span", { children: selectedItem.limits.redLow })] }),
529
+ selectedItem.limits.yellowLow !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
530
+ style: { color: tokens.colors.text.muted },
531
+ children: "Yellow Low:"
532
+ }), /* @__PURE__ */ jsx("span", { children: selectedItem.limits.yellowLow })] }),
533
+ selectedItem.limits.greenHigh !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
534
+ style: { color: tokens.colors.text.muted },
535
+ children: "Green High:"
536
+ }), /* @__PURE__ */ jsx("span", { children: selectedItem.limits.greenHigh })] }),
537
+ selectedItem.limits.yellowHigh !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
538
+ style: { color: tokens.colors.text.muted },
539
+ children: "Yellow High:"
540
+ }), /* @__PURE__ */ jsx("span", { children: selectedItem.limits.yellowHigh })] }),
541
+ selectedItem.limits.redHigh !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
542
+ style: { color: tokens.colors.text.muted },
543
+ children: "Red High:"
544
+ }), /* @__PURE__ */ jsx("span", { children: selectedItem.limits.redHigh })] })
545
+ ] }),
546
+ selectedItem.states && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
547
+ style: { color: tokens.colors.text.muted },
548
+ children: "States:"
549
+ }), /* @__PURE__ */ jsx("span", { children: Object.entries(selectedItem.states).map(([k, v]) => `${k}=${v}`).join(", ") })] })
550
+ ]
551
+ })
552
+ ]
553
+ })
554
+ ]
555
+ });
427
556
  });
428
- export {
429
- PacketViewer
430
- };
431
- //# sourceMappingURL=PacketViewer.js.map
557
+ //#endregion
558
+ export { PacketViewer, PacketViewer as default };
559
+
560
+ //# sourceMappingURL=PacketViewer.js.map