@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,455 +1,525 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { memo, useMemo } from "react";
3
1
  import { useTheme } from "../../theme/ThemeProvider.js";
4
- import { classNames } from "../../utils/index.js";
5
2
  import { Icon } from "../display/Icon.js";
3
+ import { classNames } from "../../utils/index.js";
6
4
  import { useCompactMode } from "../../hooks/useCompactMode.js";
7
- const STATUS_SHAPES = {
8
- off: (size, color) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 12 12", width: size, height: size, "aria-hidden": "true", children: /* @__PURE__ */ jsx("circle", { cx: "6", cy: "6", r: "5", fill: color }) }),
9
- standby: (size, color) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 12 12", width: size, height: size, "aria-hidden": "true", children: /* @__PURE__ */ jsx("circle", { cx: "6", cy: "6", r: "5", fill: "none", stroke: color, strokeWidth: "2" }) }),
10
- normal: (size, color) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 12 12", width: size, height: size, "aria-hidden": "true", children: /* @__PURE__ */ jsx("circle", { cx: "6", cy: "6", r: "5", fill: color }) }),
11
- caution: (size, color) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 12 12", width: size, height: size, "aria-hidden": "true", children: /* @__PURE__ */ jsx("rect", { x: "1", y: "1", width: "10", height: "10", fill: color }) }),
12
- serious: (size, color) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 12 12", width: size, height: size, "aria-hidden": "true", children: /* @__PURE__ */ jsx("polygon", { points: "6,1 11,6 6,11 1,6", fill: color }) }),
13
- critical: (size, color) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 12 12", width: size, height: size, "aria-hidden": "true", children: /* @__PURE__ */ jsx("polygon", { points: "6,11 1,2 11,2", fill: color }) })
5
+ import { memo, useMemo } from "react";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/react/core/widgets/MessageStream.tsx
8
+ /**
9
+ * @zendir/ui - MessageStream Component
10
+ *
11
+ * Stream/notification window for displaying messages, events, or status updates.
12
+ * Each message card has integrated status system with dual-coding (color + shape).
13
+ *
14
+ * AstroUXDS Compliance:
15
+ * - Status colors per AstroUXDS status system
16
+ * - Dual-coding (color + shape) for accessibility
17
+ * - Clear visual hierarchy
18
+ * - Proper contrast ratios
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * import { MessageStream } from '@zendir/ui';
23
+ *
24
+ * <MessageStream
25
+ * title="Response Status"
26
+ * messages={[
27
+ * { id: '1', text: 'Message Received', status: 'standby' },
28
+ * { id: '2', text: 'Confirmation Receipt', status: 'normal' },
29
+ * { id: '3', text: 'Failed', status: 'critical' },
30
+ * ]}
31
+ * />
32
+ * ```
33
+ */
34
+ var STATUS_SHAPES = {
35
+ off: (size, color) => /* @__PURE__ */ jsx("svg", {
36
+ viewBox: "0 0 12 12",
37
+ width: size,
38
+ height: size,
39
+ "aria-hidden": "true",
40
+ children: /* @__PURE__ */ jsx("circle", {
41
+ cx: "6",
42
+ cy: "6",
43
+ r: "5",
44
+ fill: color
45
+ })
46
+ }),
47
+ standby: (size, color) => /* @__PURE__ */ jsx("svg", {
48
+ viewBox: "0 0 12 12",
49
+ width: size,
50
+ height: size,
51
+ "aria-hidden": "true",
52
+ children: /* @__PURE__ */ jsx("circle", {
53
+ cx: "6",
54
+ cy: "6",
55
+ r: "5",
56
+ fill: "none",
57
+ stroke: color,
58
+ strokeWidth: "2"
59
+ })
60
+ }),
61
+ normal: (size, color) => /* @__PURE__ */ jsx("svg", {
62
+ viewBox: "0 0 12 12",
63
+ width: size,
64
+ height: size,
65
+ "aria-hidden": "true",
66
+ children: /* @__PURE__ */ jsx("circle", {
67
+ cx: "6",
68
+ cy: "6",
69
+ r: "5",
70
+ fill: color
71
+ })
72
+ }),
73
+ caution: (size, color) => /* @__PURE__ */ jsx("svg", {
74
+ viewBox: "0 0 12 12",
75
+ width: size,
76
+ height: size,
77
+ "aria-hidden": "true",
78
+ children: /* @__PURE__ */ jsx("rect", {
79
+ x: "1",
80
+ y: "1",
81
+ width: "10",
82
+ height: "10",
83
+ fill: color
84
+ })
85
+ }),
86
+ serious: (size, color) => /* @__PURE__ */ jsx("svg", {
87
+ viewBox: "0 0 12 12",
88
+ width: size,
89
+ height: size,
90
+ "aria-hidden": "true",
91
+ children: /* @__PURE__ */ jsx("polygon", {
92
+ points: "6,1 11,6 6,11 1,6",
93
+ fill: color
94
+ })
95
+ }),
96
+ critical: (size, color) => /* @__PURE__ */ jsx("svg", {
97
+ viewBox: "0 0 12 12",
98
+ width: size,
99
+ height: size,
100
+ "aria-hidden": "true",
101
+ children: /* @__PURE__ */ jsx("polygon", {
102
+ points: "6,11 1,2 11,2",
103
+ fill: color
104
+ })
105
+ })
14
106
  };
15
107
  function getStatusColor(status, tokens) {
16
- switch (status) {
17
- case "normal":
18
- return tokens.colors.status.normal;
19
- case "standby":
20
- return tokens.colors.status.standby;
21
- case "caution":
22
- return tokens.colors.status.caution;
23
- case "serious":
24
- return tokens.colors.status.serious;
25
- case "critical":
26
- return tokens.colors.status.critical;
27
- case "off":
28
- return tokens.colors.status.off;
29
- default:
30
- return tokens.colors.status.standby;
31
- }
108
+ switch (status) {
109
+ case "normal": return tokens.colors.status.normal;
110
+ case "standby": return tokens.colors.status.standby;
111
+ case "caution": return tokens.colors.status.caution;
112
+ case "serious": return tokens.colors.status.serious;
113
+ case "critical": return tokens.colors.status.critical;
114
+ case "off": return tokens.colors.status.off;
115
+ default: return tokens.colors.status.standby;
116
+ }
32
117
  }
33
118
  function formatTimestamp(timestamp, format) {
34
- if (!timestamp) return "";
35
- const date = typeof timestamp === "string" ? new Date(timestamp) : timestamp;
36
- if (format === "relative") {
37
- const now = /* @__PURE__ */ new Date();
38
- const diff = now.getTime() - date.getTime();
39
- const seconds = Math.floor(diff / 1e3);
40
- const minutes = Math.floor(seconds / 60);
41
- const hours = Math.floor(minutes / 60);
42
- if (seconds < 60) return "Just now";
43
- if (minutes < 60) return `${minutes}m ago`;
44
- if (hours < 24) return `${hours}h ago`;
45
- return date.toLocaleDateString();
46
- }
47
- if (format === "time-only") {
48
- return date.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", second: "2-digit" });
49
- }
50
- return date.toLocaleString();
119
+ if (!timestamp) return "";
120
+ const date = typeof timestamp === "string" ? new Date(timestamp) : timestamp;
121
+ if (format === "relative") {
122
+ const diff = (/* @__PURE__ */ new Date()).getTime() - date.getTime();
123
+ const seconds = Math.floor(diff / 1e3);
124
+ const minutes = Math.floor(seconds / 60);
125
+ const hours = Math.floor(minutes / 60);
126
+ if (seconds < 60) return "Just now";
127
+ if (minutes < 60) return `${minutes}m ago`;
128
+ if (hours < 24) return `${hours}h ago`;
129
+ return date.toLocaleDateString();
130
+ }
131
+ if (format === "time-only") return date.toLocaleTimeString([], {
132
+ hour: "2-digit",
133
+ minute: "2-digit",
134
+ second: "2-digit"
135
+ });
136
+ return date.toLocaleString();
51
137
  }
52
- const MessageCard = memo(function MessageCard2({
53
- message,
54
- tokens,
55
- size,
56
- showTimestamp,
57
- timeFormat,
58
- onClick,
59
- variant
60
- }) {
61
- const status = message.status || "standby";
62
- const statusColor = getStatusColor(status, tokens);
63
- const sizeConfig = {
64
- sm: { padding: 8, fontSize: "0.75rem", fontSizeSmall: "0.625rem", iconSize: 10, gap: 6 },
65
- // 12px / 10px in rem
66
- md: { padding: 12, fontSize: "0.875rem", fontSizeSmall: "0.75rem", iconSize: 12, gap: 8 },
67
- // 14px / 12px in rem
68
- lg: { padding: 16, fontSize: "1rem", fontSizeSmall: "0.875rem", iconSize: 14, gap: 10 }
69
- // 16px / 14px in rem
70
- }[size];
71
- const isCompact = variant === "compact";
72
- return /* @__PURE__ */ jsxs(
73
- "div",
74
- {
75
- role: "listitem",
76
- "aria-label": `${message.text} - ${status}`,
77
- onClick: () => onClick == null ? void 0 : onClick(message),
78
- style: {
79
- display: "flex",
80
- alignItems: "center",
81
- gap: sizeConfig.gap,
82
- padding: isCompact ? `${sizeConfig.padding / 2}px ${sizeConfig.padding}px` : sizeConfig.padding,
83
- backgroundColor: tokens.colors.background.elevated,
84
- border: `1.5px solid ${statusColor}`,
85
- borderRadius: tokens.borderRadius.md,
86
- cursor: onClick ? "pointer" : "default",
87
- transition: "all 0.15s ease",
88
- ...message.active && {
89
- boxShadow: `0 0 0 2px ${statusColor}40`
90
- }
91
- },
92
- onMouseEnter: (e) => {
93
- if (onClick) {
94
- e.currentTarget.style.backgroundColor = tokens.colors.background.surface;
95
- e.currentTarget.style.transform = "translateY(-1px)";
96
- }
97
- },
98
- onMouseLeave: (e) => {
99
- if (onClick) {
100
- e.currentTarget.style.backgroundColor = tokens.colors.background.elevated;
101
- e.currentTarget.style.transform = "translateY(0)";
102
- }
103
- },
104
- children: [
105
- /* @__PURE__ */ jsx("span", { style: { flexShrink: 0, display: "flex", alignItems: "center" }, children: STATUS_SHAPES[status](sizeConfig.iconSize, statusColor) }),
106
- /* @__PURE__ */ jsx(
107
- "span",
108
- {
109
- style: {
110
- flex: 1,
111
- fontSize: sizeConfig.fontSize,
112
- fontWeight: 500,
113
- color: tokens.colors.text.primary,
114
- whiteSpace: "nowrap",
115
- overflow: "hidden",
116
- textOverflow: "ellipsis"
117
- },
118
- children: message.text
119
- }
120
- ),
121
- message.details && !isCompact && /* @__PURE__ */ jsx(
122
- "span",
123
- {
124
- style: {
125
- fontSize: sizeConfig.fontSizeSmall,
126
- color: tokens.colors.text.tertiary
127
- },
128
- children: message.details
129
- }
130
- ),
131
- showTimestamp && message.timestamp && /* @__PURE__ */ jsx(
132
- "span",
133
- {
134
- style: {
135
- fontSize: sizeConfig.fontSizeSmall,
136
- color: tokens.colors.text.tertiary,
137
- fontFamily: tokens.typography.fontFamily.mono,
138
- whiteSpace: "nowrap"
139
- },
140
- children: formatTimestamp(message.timestamp, timeFormat)
141
- }
142
- )
143
- ]
144
- }
145
- );
138
+ var MessageCard = memo(function MessageCard({ message, tokens, size, showTimestamp, timeFormat, onClick, variant }) {
139
+ const status = message.status || "standby";
140
+ const statusColor = getStatusColor(status, tokens);
141
+ const sizeConfig = {
142
+ sm: {
143
+ padding: 8,
144
+ fontSize: "0.75rem",
145
+ fontSizeSmall: "0.625rem",
146
+ iconSize: 10,
147
+ gap: 6
148
+ },
149
+ md: {
150
+ padding: 12,
151
+ fontSize: "0.875rem",
152
+ fontSizeSmall: "0.75rem",
153
+ iconSize: 12,
154
+ gap: 8
155
+ },
156
+ lg: {
157
+ padding: 16,
158
+ fontSize: "1rem",
159
+ fontSizeSmall: "0.875rem",
160
+ iconSize: 14,
161
+ gap: 10
162
+ }
163
+ }[size];
164
+ const isCompact = variant === "compact";
165
+ return /* @__PURE__ */ jsxs("div", {
166
+ role: "listitem",
167
+ "aria-label": `${message.text} - ${status}`,
168
+ onClick: () => onClick?.(message),
169
+ style: {
170
+ display: "flex",
171
+ alignItems: "center",
172
+ gap: sizeConfig.gap,
173
+ padding: isCompact ? `${sizeConfig.padding / 2}px ${sizeConfig.padding}px` : sizeConfig.padding,
174
+ backgroundColor: tokens.colors.background.elevated,
175
+ border: `1.5px solid ${statusColor}`,
176
+ borderRadius: tokens.borderRadius.md,
177
+ cursor: onClick ? "pointer" : "default",
178
+ transition: "all 0.15s ease",
179
+ ...message.active && { boxShadow: `0 0 0 2px ${statusColor}40` }
180
+ },
181
+ onMouseEnter: (e) => {
182
+ if (onClick) {
183
+ e.currentTarget.style.backgroundColor = tokens.colors.background.surface;
184
+ e.currentTarget.style.transform = "translateY(-1px)";
185
+ }
186
+ },
187
+ onMouseLeave: (e) => {
188
+ if (onClick) {
189
+ e.currentTarget.style.backgroundColor = tokens.colors.background.elevated;
190
+ e.currentTarget.style.transform = "translateY(0)";
191
+ }
192
+ },
193
+ children: [
194
+ /* @__PURE__ */ jsx("span", {
195
+ style: {
196
+ flexShrink: 0,
197
+ display: "flex",
198
+ alignItems: "center"
199
+ },
200
+ children: STATUS_SHAPES[status](sizeConfig.iconSize, statusColor)
201
+ }),
202
+ /* @__PURE__ */ jsx("span", {
203
+ style: {
204
+ flex: 1,
205
+ fontSize: sizeConfig.fontSize,
206
+ fontWeight: 500,
207
+ color: tokens.colors.text.primary,
208
+ whiteSpace: "nowrap",
209
+ overflow: "hidden",
210
+ textOverflow: "ellipsis"
211
+ },
212
+ children: message.text
213
+ }),
214
+ message.details && !isCompact && /* @__PURE__ */ jsx("span", {
215
+ style: {
216
+ fontSize: sizeConfig.fontSizeSmall,
217
+ color: tokens.colors.text.tertiary
218
+ },
219
+ children: message.details
220
+ }),
221
+ showTimestamp && message.timestamp && /* @__PURE__ */ jsx("span", {
222
+ style: {
223
+ fontSize: sizeConfig.fontSizeSmall,
224
+ color: tokens.colors.text.tertiary,
225
+ fontFamily: tokens.typography.fontFamily.mono,
226
+ whiteSpace: "nowrap"
227
+ },
228
+ children: formatTimestamp(message.timestamp, timeFormat)
229
+ })
230
+ ]
231
+ });
146
232
  });
147
- const TreeNode = memo(function TreeNode2({
148
- message,
149
- tokens,
150
- size,
151
- showTimestamp,
152
- timeFormat,
153
- onClick,
154
- depth,
155
- showConnectors,
156
- isLast
157
- }) {
158
- const hasChildren = message.children && message.children.length > 0;
159
- const indentSize = 32;
160
- return /* @__PURE__ */ jsxs("div", { style: { position: "relative" }, children: [
161
- showConnectors && depth > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
162
- /* @__PURE__ */ jsx(
163
- "div",
164
- {
165
- style: {
166
- position: "absolute",
167
- left: (depth - 1) * indentSize + 16,
168
- top: 0,
169
- width: 2,
170
- height: isLast ? "50%" : "100%",
171
- backgroundColor: tokens.colors.border.muted
172
- }
173
- }
174
- ),
175
- /* @__PURE__ */ jsx(
176
- "div",
177
- {
178
- style: {
179
- position: "absolute",
180
- left: (depth - 1) * indentSize + 16,
181
- top: "50%",
182
- width: indentSize - 8,
183
- height: 2,
184
- backgroundColor: tokens.colors.border.muted
185
- }
186
- }
187
- )
188
- ] }),
189
- /* @__PURE__ */ jsx("div", { style: { marginLeft: depth * indentSize }, children: /* @__PURE__ */ jsx(
190
- MessageCard,
191
- {
192
- message,
193
- tokens,
194
- size,
195
- showTimestamp,
196
- timeFormat,
197
- onClick,
198
- variant: "tree"
199
- }
200
- ) }),
201
- hasChildren && /* @__PURE__ */ jsx("div", { style: { marginTop: 8 }, children: message.children.map((child, index) => /* @__PURE__ */ jsx("div", { style: { marginTop: index > 0 ? 8 : 0 }, children: /* @__PURE__ */ jsx(
202
- TreeNode2,
203
- {
204
- message: child,
205
- tokens,
206
- size,
207
- showTimestamp,
208
- timeFormat,
209
- onClick,
210
- depth: depth + 1,
211
- showConnectors,
212
- isLast: index === message.children.length - 1
213
- }
214
- ) }, child.id)) })
215
- ] });
233
+ var TreeNode = memo(function TreeNode({ message, tokens, size, showTimestamp, timeFormat, onClick, depth, showConnectors, isLast }) {
234
+ const hasChildren = message.children && message.children.length > 0;
235
+ const indentSize = 32;
236
+ return /* @__PURE__ */ jsxs("div", {
237
+ style: { position: "relative" },
238
+ children: [
239
+ showConnectors && depth > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", { style: {
240
+ position: "absolute",
241
+ left: (depth - 1) * indentSize + 16,
242
+ top: 0,
243
+ width: 2,
244
+ height: isLast ? "50%" : "100%",
245
+ backgroundColor: tokens.colors.border.muted
246
+ } }), /* @__PURE__ */ jsx("div", { style: {
247
+ position: "absolute",
248
+ left: (depth - 1) * indentSize + 16,
249
+ top: "50%",
250
+ width: indentSize - 8,
251
+ height: 2,
252
+ backgroundColor: tokens.colors.border.muted
253
+ } })] }),
254
+ /* @__PURE__ */ jsx("div", {
255
+ style: { marginLeft: depth * indentSize },
256
+ children: /* @__PURE__ */ jsx(MessageCard, {
257
+ message,
258
+ tokens,
259
+ size,
260
+ showTimestamp,
261
+ timeFormat,
262
+ onClick,
263
+ variant: "tree"
264
+ })
265
+ }),
266
+ hasChildren && /* @__PURE__ */ jsx("div", {
267
+ style: { marginTop: 8 },
268
+ children: message.children.map((child, index) => /* @__PURE__ */ jsx("div", {
269
+ style: { marginTop: index > 0 ? 8 : 0 },
270
+ children: /* @__PURE__ */ jsx(TreeNode, {
271
+ message: child,
272
+ tokens,
273
+ size,
274
+ showTimestamp,
275
+ timeFormat,
276
+ onClick,
277
+ depth: depth + 1,
278
+ showConnectors,
279
+ isLast: index === message.children.length - 1
280
+ })
281
+ }, child.id))
282
+ })
283
+ ]
284
+ });
216
285
  });
217
- const MessageStream = memo(function MessageStream2({
218
- title,
219
- subtitle,
220
- messages,
221
- maxHeight,
222
- showTimestamps = false,
223
- timeFormat = "relative",
224
- variant = "list",
225
- className = "",
226
- size = "md",
227
- onMessageClick,
228
- loading = false,
229
- emptyMessage = "No messages",
230
- showConnectors = true,
231
- collapsible = false,
232
- defaultExpanded = false,
233
- onPinChange
234
- }) {
235
- const { tokens, theme, prefersReducedMotion } = useTheme();
236
- const isTransparentTheme = theme === "transparent" || theme === "transparent-bold" || theme === "transparent-minimal";
237
- const { expanded, isPinned, handlers, transitionDuration } = useCompactMode({
238
- compact: collapsible,
239
- defaultExpanded,
240
- onPinChange
241
- });
242
- const containerStyle = useMemo(() => ({
243
- backgroundColor: isTransparentTheme ? "transparent" : tokens.colors.background.surface,
244
- ...isTransparentTheme && {
245
- backdropFilter: "blur(12px)",
246
- WebkitBackdropFilter: "blur(12px)"
247
- },
248
- ...tokens.colors.border.cardStyle ?? { border: `1px solid ${tokens.colors.border.muted}` },
249
- borderRadius: tokens.borderRadius.lg,
250
- padding: tokens.spacing.md,
251
- display: "flex",
252
- flexDirection: "column"
253
- }), [tokens, isTransparentTheme]);
254
- const statusCounts = useMemo(() => {
255
- const counts = { normal: 0, caution: 0, critical: 0, other: 0 };
256
- messages.forEach((m) => {
257
- if (m.status === "normal") counts.normal++;
258
- else if (m.status === "caution") counts.caution++;
259
- else if (m.status === "critical" || m.status === "serious") counts.critical++;
260
- else counts.other++;
261
- });
262
- return counts;
263
- }, [messages]);
264
- if (loading) {
265
- return /* @__PURE__ */ jsxs(
266
- "article",
267
- {
268
- className: classNames("zendir-message-stream", className),
269
- style: containerStyle,
270
- "aria-busy": "true",
271
- "aria-label": "Loading messages",
272
- children: [
273
- title && /* @__PURE__ */ jsxs("div", { style: { marginBottom: 16 }, children: [
274
- /* @__PURE__ */ jsx("div", { style: {
275
- height: 18,
276
- width: 120,
277
- backgroundColor: tokens.colors.background.elevated,
278
- borderRadius: 4,
279
- marginBottom: 8
280
- } }),
281
- subtitle && /* @__PURE__ */ jsx("div", { style: {
282
- height: 14,
283
- width: 200,
284
- backgroundColor: tokens.colors.background.elevated,
285
- borderRadius: 4
286
- } })
287
- ] }),
288
- /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [1, 2, 3].map((i) => /* @__PURE__ */ jsx(
289
- "div",
290
- {
291
- style: {
292
- height: 44,
293
- backgroundColor: tokens.colors.background.elevated,
294
- borderRadius: tokens.borderRadius.md,
295
- border: `2px solid ${tokens.colors.border.muted}`
296
- }
297
- },
298
- i
299
- )) })
300
- ]
301
- }
302
- );
303
- }
304
- if (collapsible && !expanded) {
305
- return /* @__PURE__ */ jsx(
306
- "article",
307
- {
308
- className: classNames("zendir-message-stream", "collapsed", className),
309
- ...handlers,
310
- style: {
311
- ...containerStyle,
312
- padding: `${tokens.spacing.sm} ${tokens.spacing.md}`,
313
- cursor: "pointer",
314
- transition: `all ${transitionDuration} ease-out`
315
- },
316
- onMouseEnter: (e) => {
317
- handlers.onMouseEnter();
318
- if (!prefersReducedMotion) {
319
- e.currentTarget.style.transform = "scale(1.01)";
320
- e.currentTarget.style.boxShadow = `0 4px 12px ${tokens.colors.accent.primary}20`;
321
- }
322
- },
323
- onMouseLeave: (e) => {
324
- handlers.onMouseLeave();
325
- e.currentTarget.style.transform = "scale(1)";
326
- e.currentTarget.style.boxShadow = "";
327
- },
328
- "aria-label": `${title || "Messages"} (collapsed)`,
329
- children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: tokens.spacing.md }, children: [
330
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: tokens.spacing.sm }, children: [
331
- /* @__PURE__ */ jsx(Icon, { name: "message", size: 14, color: tokens.colors.accent.primary }),
332
- /* @__PURE__ */ jsx("span", { style: { fontWeight: tokens.typography.fontWeight.medium }, children: title ? title.split(" ")[0] : "Messages" }),
333
- /* @__PURE__ */ jsxs("span", { style: { color: tokens.colors.text.tertiary, fontSize: tokens.typography.fontSize.xs }, children: [
334
- "(",
335
- messages.length,
336
- ")"
337
- ] })
338
- ] }),
339
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: tokens.spacing.sm }, children: [
340
- statusCounts.critical > 0 && /* @__PURE__ */ jsxs("span", { style: {
341
- color: tokens.colors.status.critical,
342
- fontSize: tokens.typography.fontSize.xs,
343
- fontWeight: tokens.typography.fontWeight.medium
344
- }, children: [
345
- statusCounts.critical,
346
- " critical"
347
- ] }),
348
- statusCounts.caution > 0 && /* @__PURE__ */ jsxs("span", { style: {
349
- color: tokens.colors.status.caution,
350
- fontSize: tokens.typography.fontSize.xs,
351
- fontWeight: tokens.typography.fontWeight.medium
352
- }, children: [
353
- statusCounts.caution,
354
- " warn"
355
- ] }),
356
- isPinned && /* @__PURE__ */ jsx(Icon, { name: "lock", size: 12, color: tokens.colors.accent.primary })
357
- ] })
358
- ] })
359
- }
360
- );
361
- }
362
- return /* @__PURE__ */ jsxs(
363
- "div",
364
- {
365
- className: classNames("zendir-message-stream", collapsible ? "expanded" : "", className),
366
- ...collapsible ? handlers : {},
367
- role: collapsible ? handlers.role : "log",
368
- tabIndex: collapsible ? handlers.tabIndex : void 0,
369
- "aria-expanded": collapsible ? handlers["aria-expanded"] : void 0,
370
- style: {
371
- ...containerStyle,
372
- cursor: collapsible ? "pointer" : void 0,
373
- transition: collapsible ? `all ${transitionDuration} ease-out` : void 0
374
- },
375
- "aria-label": title || "Message stream",
376
- "aria-live": "polite",
377
- children: [
378
- (title || subtitle) && /* @__PURE__ */ jsxs("header", { style: { marginBottom: 16 }, children: [
379
- title && /* @__PURE__ */ jsx("h3", { style: {
380
- fontSize: tokens.typography.fontSize.lg,
381
- fontWeight: 500,
382
- // AstroUXDS medium for headers
383
- color: tokens.colors.text.primary,
384
- margin: 0
385
- }, children: title }),
386
- subtitle && /* @__PURE__ */ jsx("p", { style: {
387
- fontSize: tokens.typography.fontSize.sm,
388
- color: tokens.colors.text.tertiary,
389
- margin: "4px 0 0 0"
390
- }, children: subtitle })
391
- ] }),
392
- /* @__PURE__ */ jsx(
393
- "div",
394
- {
395
- role: "list",
396
- tabIndex: maxHeight ? 0 : void 0,
397
- "aria-label": maxHeight ? `${title || "Messages"} scrollable list` : void 0,
398
- style: {
399
- display: "flex",
400
- flexDirection: "column",
401
- gap: variant === "compact" ? 4 : 8,
402
- ...maxHeight && {
403
- maxHeight,
404
- overflowY: "auto",
405
- paddingRight: 8
406
- }
407
- },
408
- children: messages.length === 0 ? /* @__PURE__ */ jsx(
409
- "div",
410
- {
411
- style: {
412
- textAlign: "center",
413
- padding: 32,
414
- color: tokens.colors.text.tertiary,
415
- fontSize: tokens.typography.fontSize.sm
416
- },
417
- children: emptyMessage
418
- }
419
- ) : variant === "tree" ? messages.map((message, index) => /* @__PURE__ */ jsx(
420
- TreeNode,
421
- {
422
- message,
423
- tokens,
424
- size,
425
- showTimestamp: showTimestamps,
426
- timeFormat,
427
- onClick: onMessageClick,
428
- depth: 0,
429
- showConnectors,
430
- isLast: index === messages.length - 1
431
- },
432
- message.id
433
- )) : messages.map((message) => /* @__PURE__ */ jsx(
434
- MessageCard,
435
- {
436
- message,
437
- tokens,
438
- size,
439
- showTimestamp: showTimestamps,
440
- timeFormat,
441
- onClick: onMessageClick,
442
- variant
443
- },
444
- message.id
445
- ))
446
- }
447
- )
448
- ]
449
- }
450
- );
286
+ var MessageStream = memo(function MessageStream({ title, subtitle, messages, maxHeight, showTimestamps = false, timeFormat = "relative", variant = "list", className = "", size = "md", onMessageClick, loading = false, emptyMessage = "No messages", showConnectors = true, collapsible = false, defaultExpanded = false, onPinChange }) {
287
+ const { tokens, theme, prefersReducedMotion } = useTheme();
288
+ const isTransparentTheme = theme === "transparent" || theme === "transparent-bold" || theme === "transparent-minimal";
289
+ const { expanded, isPinned, handlers, transitionDuration } = useCompactMode({
290
+ compact: collapsible,
291
+ defaultExpanded,
292
+ onPinChange
293
+ });
294
+ const containerStyle = useMemo(() => ({
295
+ backgroundColor: isTransparentTheme ? "transparent" : tokens.colors.background.surface,
296
+ ...isTransparentTheme && {
297
+ backdropFilter: "blur(12px)",
298
+ WebkitBackdropFilter: "blur(12px)"
299
+ },
300
+ ...tokens.colors.border.cardStyle ?? { border: `1px solid ${tokens.colors.border.muted}` },
301
+ borderRadius: tokens.borderRadius.lg,
302
+ padding: tokens.spacing.md,
303
+ display: "flex",
304
+ flexDirection: "column"
305
+ }), [tokens, isTransparentTheme]);
306
+ const statusCounts = useMemo(() => {
307
+ const counts = {
308
+ normal: 0,
309
+ caution: 0,
310
+ critical: 0,
311
+ other: 0
312
+ };
313
+ messages.forEach((m) => {
314
+ if (m.status === "normal") counts.normal++;
315
+ else if (m.status === "caution") counts.caution++;
316
+ else if (m.status === "critical" || m.status === "serious") counts.critical++;
317
+ else counts.other++;
318
+ });
319
+ return counts;
320
+ }, [messages]);
321
+ if (loading) return /* @__PURE__ */ jsxs("article", {
322
+ className: classNames("zendir-message-stream", className),
323
+ style: containerStyle,
324
+ "aria-busy": "true",
325
+ "aria-label": "Loading messages",
326
+ children: [title && /* @__PURE__ */ jsxs("div", {
327
+ style: { marginBottom: 16 },
328
+ children: [/* @__PURE__ */ jsx("div", { style: {
329
+ height: 18,
330
+ width: 120,
331
+ backgroundColor: tokens.colors.background.elevated,
332
+ borderRadius: 4,
333
+ marginBottom: 8
334
+ } }), subtitle && /* @__PURE__ */ jsx("div", { style: {
335
+ height: 14,
336
+ width: 200,
337
+ backgroundColor: tokens.colors.background.elevated,
338
+ borderRadius: 4
339
+ } })]
340
+ }), /* @__PURE__ */ jsx("div", {
341
+ style: {
342
+ display: "flex",
343
+ flexDirection: "column",
344
+ gap: 8
345
+ },
346
+ children: [
347
+ 1,
348
+ 2,
349
+ 3
350
+ ].map((i) => /* @__PURE__ */ jsx("div", { style: {
351
+ height: 44,
352
+ backgroundColor: tokens.colors.background.elevated,
353
+ borderRadius: tokens.borderRadius.md,
354
+ border: `2px solid ${tokens.colors.border.muted}`
355
+ } }, i))
356
+ })]
357
+ });
358
+ if (collapsible && !expanded) return /* @__PURE__ */ jsx("article", {
359
+ className: classNames("zendir-message-stream", "collapsed", className),
360
+ ...handlers,
361
+ style: {
362
+ ...containerStyle,
363
+ padding: `${tokens.spacing.sm} ${tokens.spacing.md}`,
364
+ cursor: "pointer",
365
+ transition: `all ${transitionDuration} ease-out`
366
+ },
367
+ onMouseEnter: (e) => {
368
+ handlers.onMouseEnter();
369
+ if (!prefersReducedMotion) {
370
+ e.currentTarget.style.transform = "scale(1.01)";
371
+ e.currentTarget.style.boxShadow = `0 4px 12px ${tokens.colors.accent.primary}20`;
372
+ }
373
+ },
374
+ onMouseLeave: (e) => {
375
+ handlers.onMouseLeave();
376
+ e.currentTarget.style.transform = "scale(1)";
377
+ e.currentTarget.style.boxShadow = "";
378
+ },
379
+ "aria-label": `${title || "Messages"} (collapsed)`,
380
+ children: /* @__PURE__ */ jsxs("div", {
381
+ style: {
382
+ display: "flex",
383
+ alignItems: "center",
384
+ justifyContent: "space-between",
385
+ gap: tokens.spacing.md
386
+ },
387
+ children: [/* @__PURE__ */ jsxs("div", {
388
+ style: {
389
+ display: "flex",
390
+ alignItems: "center",
391
+ gap: tokens.spacing.sm
392
+ },
393
+ children: [
394
+ /* @__PURE__ */ jsx(Icon, {
395
+ name: "message",
396
+ size: 14,
397
+ color: tokens.colors.accent.primary
398
+ }),
399
+ /* @__PURE__ */ jsx("span", {
400
+ style: { fontWeight: tokens.typography.fontWeight.medium },
401
+ children: title ? title.split(" ")[0] : "Messages"
402
+ }),
403
+ /* @__PURE__ */ jsxs("span", {
404
+ style: {
405
+ color: tokens.colors.text.tertiary,
406
+ fontSize: tokens.typography.fontSize.xs
407
+ },
408
+ children: [
409
+ "(",
410
+ messages.length,
411
+ ")"
412
+ ]
413
+ })
414
+ ]
415
+ }), /* @__PURE__ */ jsxs("div", {
416
+ style: {
417
+ display: "flex",
418
+ alignItems: "center",
419
+ gap: tokens.spacing.sm
420
+ },
421
+ children: [
422
+ statusCounts.critical > 0 && /* @__PURE__ */ jsxs("span", {
423
+ style: {
424
+ color: tokens.colors.status.critical,
425
+ fontSize: tokens.typography.fontSize.xs,
426
+ fontWeight: tokens.typography.fontWeight.medium
427
+ },
428
+ children: [statusCounts.critical, " critical"]
429
+ }),
430
+ statusCounts.caution > 0 && /* @__PURE__ */ jsxs("span", {
431
+ style: {
432
+ color: tokens.colors.status.caution,
433
+ fontSize: tokens.typography.fontSize.xs,
434
+ fontWeight: tokens.typography.fontWeight.medium
435
+ },
436
+ children: [statusCounts.caution, " warn"]
437
+ }),
438
+ isPinned && /* @__PURE__ */ jsx(Icon, {
439
+ name: "lock",
440
+ size: 12,
441
+ color: tokens.colors.accent.primary
442
+ })
443
+ ]
444
+ })]
445
+ })
446
+ });
447
+ return /* @__PURE__ */ jsxs("div", {
448
+ className: classNames("zendir-message-stream", collapsible ? "expanded" : "", className),
449
+ ...collapsible ? handlers : {},
450
+ role: collapsible ? handlers.role : "log",
451
+ tabIndex: collapsible ? handlers.tabIndex : void 0,
452
+ "aria-expanded": collapsible ? handlers["aria-expanded"] : void 0,
453
+ style: {
454
+ ...containerStyle,
455
+ cursor: collapsible ? "pointer" : void 0,
456
+ transition: collapsible ? `all ${transitionDuration} ease-out` : void 0
457
+ },
458
+ "aria-label": title || "Message stream",
459
+ "aria-live": "polite",
460
+ children: [(title || subtitle) && /* @__PURE__ */ jsxs("header", {
461
+ style: { marginBottom: 16 },
462
+ children: [title && /* @__PURE__ */ jsx("h3", {
463
+ style: {
464
+ fontSize: tokens.typography.fontSize.lg,
465
+ fontWeight: 500,
466
+ color: tokens.colors.text.primary,
467
+ margin: 0
468
+ },
469
+ children: title
470
+ }), subtitle && /* @__PURE__ */ jsx("p", {
471
+ style: {
472
+ fontSize: tokens.typography.fontSize.sm,
473
+ color: tokens.colors.text.tertiary,
474
+ margin: "4px 0 0 0"
475
+ },
476
+ children: subtitle
477
+ })]
478
+ }), /* @__PURE__ */ jsx("div", {
479
+ role: "list",
480
+ tabIndex: maxHeight ? 0 : void 0,
481
+ "aria-label": maxHeight ? `${title || "Messages"} scrollable list` : void 0,
482
+ style: {
483
+ display: "flex",
484
+ flexDirection: "column",
485
+ gap: variant === "compact" ? 4 : 8,
486
+ ...maxHeight && {
487
+ maxHeight,
488
+ overflowY: "auto",
489
+ paddingRight: 8
490
+ }
491
+ },
492
+ children: messages.length === 0 ? /* @__PURE__ */ jsx("div", {
493
+ style: {
494
+ textAlign: "center",
495
+ padding: 32,
496
+ color: tokens.colors.text.tertiary,
497
+ fontSize: tokens.typography.fontSize.sm
498
+ },
499
+ children: emptyMessage
500
+ }) : variant === "tree" ? messages.map((message, index) => /* @__PURE__ */ jsx(TreeNode, {
501
+ message,
502
+ tokens,
503
+ size,
504
+ showTimestamp: showTimestamps,
505
+ timeFormat,
506
+ onClick: onMessageClick,
507
+ depth: 0,
508
+ showConnectors,
509
+ isLast: index === messages.length - 1
510
+ }, message.id)) : messages.map((message) => /* @__PURE__ */ jsx(MessageCard, {
511
+ message,
512
+ tokens,
513
+ size,
514
+ showTimestamp: showTimestamps,
515
+ timeFormat,
516
+ onClick: onMessageClick,
517
+ variant
518
+ }, message.id))
519
+ })]
520
+ });
451
521
  });
452
- export {
453
- MessageStream
454
- };
455
- //# sourceMappingURL=MessageStream.js.map
522
+ //#endregion
523
+ export { MessageStream, MessageStream as default };
524
+
525
+ //# sourceMappingURL=MessageStream.js.map