@zendir/ui 0.5.0 → 0.6.1

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 +419 -386
  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 +313 -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 +26 -3
  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 +533 -155
  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,414 +1,391 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { memo, useState, useMemo, useCallback, useEffect } from "react";
3
1
  import { useTheme } from "../theme/ThemeProvider.js";
4
- import { tabularNumsStyle, classNames } from "../utils/index.js";
2
+ import { classNames, tabularNumsStyle } from "../utils/index.js";
3
+ import { memo, useCallback, useEffect, useMemo, useState } from "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ //#region src/react/astro/MissionClock.tsx
6
+ /**
7
+ * @zendir/ui - MissionClock Component (Pure React)
8
+ *
9
+ * Advanced mission time display following Astro UX patterns with full
10
+ * space operations support.
11
+ *
12
+ * Features:
13
+ * - Theme-integrated via useTheme()
14
+ * - UTC/Zulu time display
15
+ * - Configurable formats (12h, 24h, ISO)
16
+ * - Optional seconds display
17
+ * - AOS/LOS timer support (Acquisition/Loss of Signal)
18
+ * - MET (Mission Elapsed Time) display
19
+ * - Julian day format (DOY-###)
20
+ * - Simulation time support (custom epoch/time source)
21
+ * - Tabular numbers for stability
22
+ * - Zendir SDK integration for real-time data
23
+ *
24
+ * Space Operations Terminology:
25
+ * - AOS: Acquisition of Signal - when satellite rises above horizon
26
+ * - LOS: Loss of Signal - when satellite passes below horizon
27
+ * - TCA: Time of Closest Approach - maximum elevation point
28
+ * - MET: Mission Elapsed Time - time since launch (dd:hh:mm:ss)
29
+ * - DOY: Day of Year - Julian day format
30
+ */
31
+ /**
32
+ * Format duration as dd:hh:mm:ss (MET format)
33
+ */
5
34
  function formatMET(ms, showMilliseconds = false) {
6
- const totalSeconds = Math.floor(Math.abs(ms) / 1e3);
7
- const days = Math.floor(totalSeconds / 86400);
8
- const hours = Math.floor(totalSeconds % 86400 / 3600);
9
- const minutes = Math.floor(totalSeconds % 3600 / 60);
10
- const seconds = totalSeconds % 60;
11
- const sign = ms < 0 ? "-" : "";
12
- if (showMilliseconds) {
13
- const millis = Math.floor(Math.abs(ms) % 1e3);
14
- return `${sign}${days.toString().padStart(2, "0")}:${hours.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}.${millis.toString().padStart(3, "0")}`;
15
- }
16
- return `${sign}${days.toString().padStart(2, "0")}:${hours.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`;
35
+ const totalSeconds = Math.floor(Math.abs(ms) / 1e3);
36
+ const days = Math.floor(totalSeconds / 86400);
37
+ const hours = Math.floor(totalSeconds % 86400 / 3600);
38
+ const minutes = Math.floor(totalSeconds % 3600 / 60);
39
+ const seconds = totalSeconds % 60;
40
+ const sign = ms < 0 ? "-" : "";
41
+ if (showMilliseconds) {
42
+ const millis = Math.floor(Math.abs(ms) % 1e3);
43
+ return `${sign}${days.toString().padStart(2, "0")}:${hours.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}.${millis.toString().padStart(3, "0")}`;
44
+ }
45
+ return `${sign}${days.toString().padStart(2, "0")}:${hours.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`;
17
46
  }
47
+ /**
48
+ * Format duration for timers (compact: hh:mm:ss or mm:ss)
49
+ */
18
50
  function formatTimerDuration(ms, showDays = false) {
19
- const totalSeconds = Math.floor(Math.abs(ms) / 1e3);
20
- const days = Math.floor(totalSeconds / 86400);
21
- const hours = Math.floor(totalSeconds % 86400 / 3600);
22
- const minutes = Math.floor(totalSeconds % 3600 / 60);
23
- const seconds = totalSeconds % 60;
24
- const sign = ms < 0 ? "-" : "";
25
- if (showDays && days > 0) {
26
- return `${sign}${days}d ${hours.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`;
27
- }
28
- if (hours > 0 || showDays) {
29
- return `${sign}${hours.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`;
30
- }
31
- return `${sign}${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`;
51
+ const totalSeconds = Math.floor(Math.abs(ms) / 1e3);
52
+ const days = Math.floor(totalSeconds / 86400);
53
+ const hours = Math.floor(totalSeconds % 86400 / 3600);
54
+ const minutes = Math.floor(totalSeconds % 3600 / 60);
55
+ const seconds = totalSeconds % 60;
56
+ const sign = ms < 0 ? "-" : "";
57
+ if (showDays && days > 0) return `${sign}${days}d ${hours.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`;
58
+ if (hours > 0 || showDays) return `${sign}${hours.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`;
59
+ return `${sign}${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`;
32
60
  }
61
+ /**
62
+ * Get Julian day (day of year 001-366)
63
+ */
33
64
  function getJulianDay(date) {
34
- const start = new Date(Date.UTC(date.getUTCFullYear(), 0, 0));
35
- const diff = date.getTime() - start.getTime();
36
- const oneDay = 1e3 * 60 * 60 * 24;
37
- const day = Math.floor(diff / oneDay);
38
- return day.toString().padStart(3, "0");
65
+ const start = new Date(Date.UTC(date.getUTCFullYear(), 0, 0));
66
+ const diff = date.getTime() - start.getTime();
67
+ return Math.floor(diff / (1e3 * 60 * 60 * 24)).toString().padStart(3, "0");
39
68
  }
69
+ /**
70
+ * Normalize timer config from Date or TimerConfig
71
+ */
40
72
  function normalizeTimerConfig(timer, label) {
41
- if (!timer) return void 0;
42
- if (timer instanceof Date) {
43
- return {
44
- label,
45
- timestamp: timer,
46
- direction: "countdown"
47
- };
48
- }
49
- return timer;
73
+ if (!timer) return void 0;
74
+ if (timer instanceof Date) return {
75
+ label,
76
+ timestamp: timer,
77
+ direction: "countdown"
78
+ };
79
+ return timer;
50
80
  }
51
- const TimerDisplay = memo(function TimerDisplay2({
52
- timer,
53
- currentTime,
54
- tokens,
55
- compact = false
56
- }) {
57
- const diff = timer.direction === "countdown" ? timer.timestamp.getTime() - currentTime.getTime() : currentTime.getTime() - timer.timestamp.getTime();
58
- const isNegative = diff < 0;
59
- const statusColor = timer.status ? tokens.colors.status[timer.status] : isNegative ? tokens.colors.status.caution : tokens.colors.status.normal;
60
- return /* @__PURE__ */ jsxs(
61
- "div",
62
- {
63
- style: {
64
- display: "flex",
65
- alignItems: compact ? "center" : "flex-start",
66
- flexDirection: compact ? "row" : "column",
67
- gap: compact ? 8 : 2,
68
- padding: `${tokens.spacing.xs} ${tokens.spacing.sm}`,
69
- backgroundColor: `${statusColor}15`,
70
- borderRadius: tokens.borderRadius.sm,
71
- border: `1px solid ${statusColor}30`
72
- },
73
- children: [
74
- /* @__PURE__ */ jsx(
75
- "span",
76
- {
77
- style: {
78
- fontSize: tokens.typography.fontSize.xs,
79
- fontWeight: tokens.typography.fontWeight.semibold,
80
- color: statusColor,
81
- textTransform: "uppercase",
82
- letterSpacing: tokens.typography.letterSpacing.wide
83
- },
84
- children: timer.label
85
- }
86
- ),
87
- /* @__PURE__ */ jsxs(
88
- "span",
89
- {
90
- style: {
91
- fontSize: compact ? tokens.typography.fontSize.sm : tokens.typography.fontSize.base,
92
- fontWeight: tokens.typography.fontWeight.bold,
93
- // Bold (700) for timer readability
94
- fontFamily: tokens.typography.fontFamily.mono,
95
- color: statusColor,
96
- ...tabularNumsStyle
97
- },
98
- children: [
99
- isNegative ? "+" : "",
100
- formatTimerDuration(diff, timer.showDays)
101
- ]
102
- }
103
- )
104
- ]
105
- }
106
- );
81
+ var TimerDisplay = memo(function TimerDisplay({ timer, currentTime, tokens, compact = false }) {
82
+ const diff = timer.direction === "countdown" ? timer.timestamp.getTime() - currentTime.getTime() : currentTime.getTime() - timer.timestamp.getTime();
83
+ const isNegative = diff < 0;
84
+ const statusColor = timer.status ? tokens.colors.status[timer.status] : isNegative ? tokens.colors.status.caution : tokens.colors.status.normal;
85
+ return /* @__PURE__ */ jsxs("div", {
86
+ style: {
87
+ display: "flex",
88
+ alignItems: compact ? "center" : "flex-start",
89
+ flexDirection: compact ? "row" : "column",
90
+ gap: compact ? 8 : 2,
91
+ padding: `${tokens.spacing.xs} ${tokens.spacing.sm}`,
92
+ backgroundColor: `${statusColor}15`,
93
+ borderRadius: tokens.borderRadius.sm,
94
+ border: `1px solid ${statusColor}30`
95
+ },
96
+ children: [/* @__PURE__ */ jsx("span", {
97
+ style: {
98
+ fontSize: tokens.typography.fontSize.xs,
99
+ fontWeight: tokens.typography.fontWeight.semibold,
100
+ color: statusColor,
101
+ textTransform: "uppercase",
102
+ letterSpacing: tokens.typography.letterSpacing.wide
103
+ },
104
+ children: timer.label
105
+ }), /* @__PURE__ */ jsxs("span", {
106
+ style: {
107
+ fontSize: compact ? tokens.typography.fontSize.sm : tokens.typography.fontSize.base,
108
+ fontWeight: tokens.typography.fontWeight.bold,
109
+ fontFamily: tokens.typography.fontFamily.mono,
110
+ color: statusColor,
111
+ ...tabularNumsStyle
112
+ },
113
+ children: [isNegative ? "+" : "", formatTimerDuration(diff, timer.showDays)]
114
+ })]
115
+ });
107
116
  });
108
- const MissionClock = memo(function MissionClock2({
109
- format = "24h",
110
- timezone = "UTC",
111
- hideSeconds = false,
112
- small = false,
113
- showDate = false,
114
- dateFormat = "iso",
115
- className = "",
116
- onClick,
117
- aosTimer,
118
- losTimer,
119
- customTimers = [],
120
- timeSource = "realtime",
121
- simulationConfig,
122
- customTime,
123
- missionStart,
124
- showMET = false,
125
- updateInterval = 1e3,
126
- compact = false,
127
- showMilliseconds = false
128
- }) {
129
- const { tokens, theme } = useTheme();
130
- const isTransparentTheme = theme === "transparent" || theme === "transparent-bold" || theme === "transparent-minimal";
131
- const [time, setTime] = useState(() => getCurrentTimeFromSource());
132
- const normalizedAOS = useMemo(() => normalizeTimerConfig(aosTimer, "AOS"), [aosTimer]);
133
- const normalizedLOS = useMemo(() => normalizeTimerConfig(losTimer, "LOS"), [losTimer]);
134
- const allTimers = useMemo(() => {
135
- const timers = [];
136
- if (normalizedAOS) timers.push(normalizedAOS);
137
- if (normalizedLOS) timers.push(normalizedLOS);
138
- return [...timers, ...customTimers];
139
- }, [normalizedAOS, normalizedLOS, customTimers]);
140
- function getCurrentTimeFromSource() {
141
- switch (timeSource) {
142
- case "simulation":
143
- if (simulationConfig) {
144
- if (simulationConfig.getCurrentTime) {
145
- return simulationConfig.getCurrentTime();
146
- }
147
- const epoch = typeof simulationConfig.epoch === "string" ? new Date(simulationConfig.epoch) : simulationConfig.epoch;
148
- const elapsed = (simulationConfig.elapsedSeconds || 0) * 1e3;
149
- return new Date(epoch.getTime() + elapsed);
150
- }
151
- return /* @__PURE__ */ new Date();
152
- case "custom":
153
- if (customTime) {
154
- return typeof customTime === "function" ? customTime() : customTime;
155
- }
156
- return /* @__PURE__ */ new Date();
157
- case "realtime":
158
- default:
159
- return /* @__PURE__ */ new Date();
160
- }
161
- }
162
- const formatTimeDisplay = useCallback((date) => {
163
- if (showMET && missionStart) {
164
- const start = typeof missionStart === "string" ? new Date(missionStart) : missionStart;
165
- const elapsed = date.getTime() - start.getTime();
166
- return formatMET(elapsed, showMilliseconds);
167
- }
168
- if (format === "met" && missionStart) {
169
- const start = typeof missionStart === "string" ? new Date(missionStart) : missionStart;
170
- const elapsed = date.getTime() - start.getTime();
171
- return formatMET(elapsed, showMilliseconds);
172
- }
173
- const hours = date.getUTCHours();
174
- const mins = date.getUTCMinutes();
175
- const secs = date.getUTCSeconds();
176
- const millis = date.getUTCMilliseconds();
177
- let hoursStr;
178
- let suffix = "";
179
- if (format === "12h") {
180
- const h12 = hours % 12 || 12;
181
- hoursStr = h12.toString().padStart(2, "0");
182
- suffix = hours >= 12 ? " PM" : " AM";
183
- } else {
184
- hoursStr = hours.toString().padStart(2, "0");
185
- }
186
- const minsStr = mins.toString().padStart(2, "0");
187
- const secsStr = secs.toString().padStart(2, "0");
188
- const millisStr = millis.toString().padStart(3, "0");
189
- if (hideSeconds) {
190
- return `${hoursStr}:${minsStr}${suffix}`;
191
- }
192
- if (showMilliseconds) {
193
- return `${hoursStr}:${minsStr}:${secsStr}.${millisStr}${suffix}`;
194
- }
195
- return `${hoursStr}:${minsStr}:${secsStr}${suffix}`;
196
- }, [format, hideSeconds, showMET, missionStart, showMilliseconds]);
197
- const formatDateDisplay = useCallback((date) => {
198
- switch (dateFormat) {
199
- case "julian": {
200
- const year2 = date.getUTCFullYear();
201
- const doy = getJulianDay(date);
202
- return `${year2}/${doy}`;
203
- }
204
- case "gregorian": {
205
- const year2 = date.getUTCFullYear();
206
- const month2 = (date.getUTCMonth() + 1).toString().padStart(2, "0");
207
- const day2 = date.getUTCDate().toString().padStart(2, "0");
208
- return `${month2}/${day2}/${year2}`;
209
- }
210
- case "iso":
211
- default:
212
- if (format === "iso") {
213
- return date.toISOString().split("T")[0];
214
- }
215
- const year = date.getUTCFullYear();
216
- const month = (date.getUTCMonth() + 1).toString().padStart(2, "0");
217
- const day = date.getUTCDate().toString().padStart(2, "0");
218
- return `${year}-${month}-${day}`;
219
- }
220
- }, [format, dateFormat]);
221
- useEffect(() => {
222
- const effectiveInterval = showMilliseconds ? Math.min(updateInterval, 100) : hideSeconds ? 6e4 : updateInterval;
223
- const intervalId = setInterval(() => {
224
- setTime(getCurrentTimeFromSource());
225
- }, effectiveInterval);
226
- return () => clearInterval(intervalId);
227
- }, [hideSeconds, updateInterval, showMilliseconds, timeSource, simulationConfig, customTime]);
228
- const handleKeyDown = (e) => {
229
- if (onClick && (e.key === "Enter" || e.key === " ")) {
230
- e.preventDefault();
231
- onClick();
232
- }
233
- };
234
- const displayLabel = useMemo(() => {
235
- if (showMET || format === "met") {
236
- return "MET";
237
- }
238
- if (timeSource === "simulation") {
239
- return "SIM";
240
- }
241
- return timezone;
242
- }, [showMET, format, timeSource, timezone]);
243
- return /* @__PURE__ */ jsxs(
244
- "div",
245
- {
246
- className: classNames("zendir-mission-clock", className),
247
- onClick,
248
- onKeyDown: onClick ? handleKeyDown : void 0,
249
- tabIndex: onClick ? 0 : void 0,
250
- role: "timer",
251
- "aria-label": `Current time: ${formatTimeDisplay(time)} ${displayLabel}`,
252
- style: {
253
- display: "inline-flex",
254
- flexDirection: compact ? "row" : "column",
255
- alignItems: "center",
256
- gap: compact ? 16 : 4,
257
- padding: small ? `${tokens.spacing.xs} ${tokens.spacing.sm}` : `${tokens.spacing.sm} ${tokens.spacing.md}`,
258
- backgroundColor: isTransparentTheme ? "transparent" : tokens.colors.background.surface,
259
- ...isTransparentTheme && { backdropFilter: "blur(12px)", WebkitBackdropFilter: "blur(12px)" },
260
- ...tokens.colors.border.cardStyle ?? { border: `1px solid ${tokens.colors.border.muted}` },
261
- borderRadius: tokens.borderRadius.md,
262
- cursor: onClick ? "pointer" : "default",
263
- outline: "none",
264
- transition: tokens.animation.fast,
265
- ...tabularNumsStyle
266
- },
267
- children: [
268
- /* @__PURE__ */ jsxs(
269
- "div",
270
- {
271
- style: {
272
- display: "flex",
273
- flexDirection: "column",
274
- alignItems: "center",
275
- gap: 2
276
- },
277
- children: [
278
- showDate && dateFormat !== "none" && /* @__PURE__ */ jsx(
279
- "span",
280
- {
281
- style: {
282
- fontSize: tokens.typography.fontSize.xs,
283
- fontWeight: tokens.typography.fontWeight.normal,
284
- fontFamily: tokens.typography.fontFamily.mono,
285
- color: tokens.colors.text.tertiary,
286
- letterSpacing: tokens.typography.letterSpacing.normal
287
- },
288
- children: formatDateDisplay(time)
289
- }
290
- ),
291
- /* @__PURE__ */ jsx(
292
- "span",
293
- {
294
- style: {
295
- fontSize: small ? tokens.typography.fontSize.base : tokens.typography.fontSize.xl,
296
- fontWeight: tokens.typography.fontWeight.bold,
297
- // Bold (700) for readability - time is critical info
298
- fontFamily: tokens.typography.fontFamily.mono,
299
- letterSpacing: tokens.typography.letterSpacing.normal,
300
- color: tokens.colors.text.primary
301
- },
302
- children: formatTimeDisplay(time)
303
- }
304
- ),
305
- displayLabel && /* @__PURE__ */ jsx(
306
- "span",
307
- {
308
- style: {
309
- fontSize: tokens.typography.fontSize.xs,
310
- fontWeight: tokens.typography.fontWeight.medium,
311
- color: timeSource === "simulation" ? tokens.colors.status.caution : tokens.colors.text.tertiary,
312
- textTransform: "uppercase",
313
- letterSpacing: tokens.typography.letterSpacing.wide
314
- },
315
- children: displayLabel
316
- }
317
- )
318
- ]
319
- }
320
- ),
321
- allTimers.length > 0 && /* @__PURE__ */ jsx(
322
- "div",
323
- {
324
- style: {
325
- display: "flex",
326
- flexDirection: compact ? "row" : "column",
327
- gap: 8
328
- },
329
- children: allTimers.map((timer, index) => /* @__PURE__ */ jsx(
330
- TimerDisplay,
331
- {
332
- timer,
333
- currentTime: time,
334
- tokens,
335
- compact
336
- },
337
- `${timer.label}-${index}`
338
- ))
339
- }
340
- )
341
- ]
342
- }
343
- );
117
+ /**
118
+ * MissionClock - Advanced mission time display for space operations
119
+ *
120
+ * Supports real-time clock, simulation time, MET (Mission Elapsed Time),
121
+ * and AOS/LOS timers following Astro UX Design System patterns.
122
+ *
123
+ * @example
124
+ * ```tsx
125
+ * // Basic clock
126
+ * <MissionClock format="24h" timezone="UTC" />
127
+ *
128
+ * // With AOS/LOS timers
129
+ * <MissionClock
130
+ * format="24h"
131
+ * aosTimer={{ label: 'AOS', timestamp: new Date('2024-03-15T10:30:00Z'), direction: 'countdown' }}
132
+ * losTimer={{ label: 'LOS', timestamp: new Date('2024-03-15T10:45:00Z'), direction: 'countdown' }}
133
+ * />
134
+ *
135
+ * // Simulation time
136
+ * <MissionClock
137
+ * timeSource="simulation"
138
+ * simulationConfig={{
139
+ * epoch: new Date('2026-01-01T00:00:00Z'),
140
+ * elapsedSeconds: 3600,
141
+ * timeScale: 1,
142
+ * }}
143
+ * />
144
+ *
145
+ * // Mission Elapsed Time
146
+ * <MissionClock
147
+ * showMET
148
+ * missionStart={new Date('2026-01-01T00:00:00Z')}
149
+ * />
150
+ *
151
+ * // Julian day format
152
+ * <MissionClock showDate dateFormat="julian" />
153
+ * ```
154
+ */
155
+ var MissionClock = memo(function MissionClock({ format = "24h", timezone = "UTC", hideSeconds = false, small = false, showDate = false, dateFormat = "iso", className = "", onClick, aosTimer, losTimer, customTimers = [], timeSource = "realtime", simulationConfig, customTime, missionStart, showMET = false, updateInterval = 1e3, compact = false, showMilliseconds = false }) {
156
+ const { tokens, theme } = useTheme();
157
+ const isTransparentTheme = theme === "transparent" || theme === "transparent-bold" || theme === "transparent-minimal";
158
+ const [time, setTime] = useState(() => getCurrentTimeFromSource());
159
+ const normalizedAOS = useMemo(() => normalizeTimerConfig(aosTimer, "AOS"), [aosTimer]);
160
+ const normalizedLOS = useMemo(() => normalizeTimerConfig(losTimer, "LOS"), [losTimer]);
161
+ const allTimers = useMemo(() => {
162
+ const timers = [];
163
+ if (normalizedAOS) timers.push(normalizedAOS);
164
+ if (normalizedLOS) timers.push(normalizedLOS);
165
+ return [...timers, ...customTimers];
166
+ }, [
167
+ normalizedAOS,
168
+ normalizedLOS,
169
+ customTimers
170
+ ]);
171
+ function getCurrentTimeFromSource() {
172
+ switch (timeSource) {
173
+ case "simulation":
174
+ if (simulationConfig) {
175
+ if (simulationConfig.getCurrentTime) return simulationConfig.getCurrentTime();
176
+ const epoch = typeof simulationConfig.epoch === "string" ? new Date(simulationConfig.epoch) : simulationConfig.epoch;
177
+ const elapsed = (simulationConfig.elapsedSeconds || 0) * 1e3;
178
+ return new Date(epoch.getTime() + elapsed);
179
+ }
180
+ return /* @__PURE__ */ new Date();
181
+ case "custom":
182
+ if (customTime) return typeof customTime === "function" ? customTime() : customTime;
183
+ return /* @__PURE__ */ new Date();
184
+ default: return /* @__PURE__ */ new Date();
185
+ }
186
+ }
187
+ const formatTimeDisplay = useCallback((date) => {
188
+ if (showMET && missionStart) {
189
+ const start = typeof missionStart === "string" ? new Date(missionStart) : missionStart;
190
+ return formatMET(date.getTime() - start.getTime(), showMilliseconds);
191
+ }
192
+ if (format === "met" && missionStart) {
193
+ const start = typeof missionStart === "string" ? new Date(missionStart) : missionStart;
194
+ return formatMET(date.getTime() - start.getTime(), showMilliseconds);
195
+ }
196
+ const hours = date.getUTCHours();
197
+ const mins = date.getUTCMinutes();
198
+ const secs = date.getUTCSeconds();
199
+ const millis = date.getUTCMilliseconds();
200
+ let hoursStr;
201
+ let suffix = "";
202
+ if (format === "12h") {
203
+ hoursStr = (hours % 12 || 12).toString().padStart(2, "0");
204
+ suffix = hours >= 12 ? " PM" : " AM";
205
+ } else hoursStr = hours.toString().padStart(2, "0");
206
+ const minsStr = mins.toString().padStart(2, "0");
207
+ const secsStr = secs.toString().padStart(2, "0");
208
+ const millisStr = millis.toString().padStart(3, "0");
209
+ if (hideSeconds) return `${hoursStr}:${minsStr}${suffix}`;
210
+ if (showMilliseconds) return `${hoursStr}:${minsStr}:${secsStr}.${millisStr}${suffix}`;
211
+ return `${hoursStr}:${minsStr}:${secsStr}${suffix}`;
212
+ }, [
213
+ format,
214
+ hideSeconds,
215
+ showMET,
216
+ missionStart,
217
+ showMilliseconds
218
+ ]);
219
+ const formatDateDisplay = useCallback((date) => {
220
+ switch (dateFormat) {
221
+ case "julian": return `${date.getUTCFullYear()}/${getJulianDay(date)}`;
222
+ case "gregorian": {
223
+ const year = date.getUTCFullYear();
224
+ return `${(date.getUTCMonth() + 1).toString().padStart(2, "0")}/${date.getUTCDate().toString().padStart(2, "0")}/${year}`;
225
+ }
226
+ default:
227
+ if (format === "iso") return date.toISOString().split("T")[0];
228
+ return `${date.getUTCFullYear()}-${(date.getUTCMonth() + 1).toString().padStart(2, "0")}-${date.getUTCDate().toString().padStart(2, "0")}`;
229
+ }
230
+ }, [format, dateFormat]);
231
+ useEffect(() => {
232
+ const intervalId = setInterval(() => {
233
+ setTime(getCurrentTimeFromSource());
234
+ }, showMilliseconds ? Math.min(updateInterval, 100) : hideSeconds ? 6e4 : updateInterval);
235
+ return () => clearInterval(intervalId);
236
+ }, [
237
+ hideSeconds,
238
+ updateInterval,
239
+ showMilliseconds,
240
+ timeSource,
241
+ simulationConfig,
242
+ customTime
243
+ ]);
244
+ const handleKeyDown = (e) => {
245
+ if (onClick && (e.key === "Enter" || e.key === " ")) {
246
+ e.preventDefault();
247
+ onClick();
248
+ }
249
+ };
250
+ const displayLabel = useMemo(() => {
251
+ if (showMET || format === "met") return "MET";
252
+ if (timeSource === "simulation") return "SIM";
253
+ return timezone;
254
+ }, [
255
+ showMET,
256
+ format,
257
+ timeSource,
258
+ timezone
259
+ ]);
260
+ return /* @__PURE__ */ jsxs("div", {
261
+ className: classNames("zendir-mission-clock", className),
262
+ onClick,
263
+ onKeyDown: onClick ? handleKeyDown : void 0,
264
+ tabIndex: onClick ? 0 : void 0,
265
+ role: "timer",
266
+ "aria-label": `Current time: ${formatTimeDisplay(time)} ${displayLabel}`,
267
+ style: {
268
+ display: "inline-flex",
269
+ flexDirection: compact ? "row" : "column",
270
+ alignItems: "center",
271
+ gap: compact ? 16 : 4,
272
+ padding: small ? `${tokens.spacing.xs} ${tokens.spacing.sm}` : `${tokens.spacing.sm} ${tokens.spacing.md}`,
273
+ backgroundColor: isTransparentTheme ? "transparent" : tokens.colors.background.surface,
274
+ ...isTransparentTheme && {
275
+ backdropFilter: "blur(12px)",
276
+ WebkitBackdropFilter: "blur(12px)"
277
+ },
278
+ ...tokens.colors.border.cardStyle ?? { border: `1px solid ${tokens.colors.border.muted}` },
279
+ borderRadius: tokens.borderRadius.md,
280
+ cursor: onClick ? "pointer" : "default",
281
+ outline: "none",
282
+ transition: tokens.animation.fast,
283
+ ...tabularNumsStyle
284
+ },
285
+ children: [/* @__PURE__ */ jsxs("div", {
286
+ style: {
287
+ display: "flex",
288
+ flexDirection: "column",
289
+ alignItems: "center",
290
+ gap: 2
291
+ },
292
+ children: [
293
+ showDate && dateFormat !== "none" && /* @__PURE__ */ jsx("span", {
294
+ style: {
295
+ fontSize: tokens.typography.fontSize.xs,
296
+ fontWeight: tokens.typography.fontWeight.normal,
297
+ fontFamily: tokens.typography.fontFamily.mono,
298
+ color: tokens.colors.text.tertiary,
299
+ letterSpacing: tokens.typography.letterSpacing.normal
300
+ },
301
+ children: formatDateDisplay(time)
302
+ }),
303
+ /* @__PURE__ */ jsx("span", {
304
+ style: {
305
+ fontSize: small ? tokens.typography.fontSize.base : tokens.typography.fontSize.xl,
306
+ fontWeight: tokens.typography.fontWeight.bold,
307
+ fontFamily: tokens.typography.fontFamily.mono,
308
+ letterSpacing: tokens.typography.letterSpacing.normal,
309
+ color: tokens.colors.text.primary
310
+ },
311
+ children: formatTimeDisplay(time)
312
+ }),
313
+ displayLabel && /* @__PURE__ */ jsx("span", {
314
+ style: {
315
+ fontSize: tokens.typography.fontSize.xs,
316
+ fontWeight: tokens.typography.fontWeight.medium,
317
+ color: timeSource === "simulation" ? tokens.colors.status.caution : tokens.colors.text.tertiary,
318
+ textTransform: "uppercase",
319
+ letterSpacing: tokens.typography.letterSpacing.wide
320
+ },
321
+ children: displayLabel
322
+ })
323
+ ]
324
+ }), allTimers.length > 0 && /* @__PURE__ */ jsx("div", {
325
+ style: {
326
+ display: "flex",
327
+ flexDirection: compact ? "row" : "column",
328
+ gap: 8
329
+ },
330
+ children: allTimers.map((timer, index) => /* @__PURE__ */ jsx(TimerDisplay, {
331
+ timer,
332
+ currentTime: time,
333
+ tokens,
334
+ compact
335
+ }, `${timer.label}-${index}`))
336
+ })]
337
+ });
344
338
  });
345
- const SimpleTimer = memo(function SimpleTimer2({
346
- label,
347
- timestamp,
348
- direction = "countdown",
349
- status,
350
- showDays = false,
351
- className = ""
352
- }) {
353
- const { tokens } = useTheme();
354
- const [now, setNow] = useState(/* @__PURE__ */ new Date());
355
- useEffect(() => {
356
- const interval = setInterval(() => setNow(/* @__PURE__ */ new Date()), 1e3);
357
- return () => clearInterval(interval);
358
- }, []);
359
- const timer = { label, timestamp, direction, status, showDays };
360
- return /* @__PURE__ */ jsx("div", { className: classNames("zendir-simple-timer", className), children: /* @__PURE__ */ jsx(TimerDisplay, { timer, currentTime: now, tokens }) });
339
+ var SimpleTimer = memo(function SimpleTimer({ label, timestamp, direction = "countdown", status, showDays = false, className = "" }) {
340
+ const { tokens } = useTheme();
341
+ const [now, setNow] = useState(/* @__PURE__ */ new Date());
342
+ useEffect(() => {
343
+ const interval = setInterval(() => setNow(/* @__PURE__ */ new Date()), 1e3);
344
+ return () => clearInterval(interval);
345
+ }, []);
346
+ const timer = {
347
+ label,
348
+ timestamp,
349
+ direction,
350
+ status,
351
+ showDays
352
+ };
353
+ return /* @__PURE__ */ jsx("div", {
354
+ className: classNames("zendir-simple-timer", className),
355
+ children: /* @__PURE__ */ jsx(TimerDisplay, {
356
+ timer,
357
+ currentTime: now,
358
+ tokens
359
+ })
360
+ });
361
361
  });
362
- const MissionElapsedTime = memo(function MissionElapsedTime2({
363
- launchTime,
364
- showMilliseconds = false,
365
- className = "",
366
- small = false
367
- }) {
368
- return /* @__PURE__ */ jsx(
369
- MissionClock,
370
- {
371
- format: "met",
372
- missionStart: launchTime,
373
- showMET: true,
374
- showMilliseconds,
375
- className,
376
- small,
377
- timezone: ""
378
- }
379
- );
362
+ var MissionElapsedTime = memo(function MissionElapsedTime({ launchTime, showMilliseconds = false, className = "", small = false }) {
363
+ return /* @__PURE__ */ jsx(MissionClock, {
364
+ format: "met",
365
+ missionStart: launchTime,
366
+ showMET: true,
367
+ showMilliseconds,
368
+ className,
369
+ small,
370
+ timezone: ""
371
+ });
380
372
  });
381
- const SimulationClock = memo(function SimulationClock2({
382
- epoch,
383
- elapsedSeconds = 0,
384
- timeScale = 1,
385
- isRunning = true,
386
- showDate = true,
387
- dateFormat = "julian",
388
- className = "",
389
- small = false
390
- }) {
391
- return /* @__PURE__ */ jsx(
392
- MissionClock,
393
- {
394
- timeSource: "simulation",
395
- simulationConfig: {
396
- epoch,
397
- elapsedSeconds,
398
- timeScale,
399
- isRunning
400
- },
401
- showDate,
402
- dateFormat,
403
- className,
404
- small
405
- }
406
- );
373
+ var SimulationClock = memo(function SimulationClock({ epoch, elapsedSeconds = 0, timeScale = 1, isRunning = true, showDate = true, dateFormat = "julian", className = "", small = false }) {
374
+ return /* @__PURE__ */ jsx(MissionClock, {
375
+ timeSource: "simulation",
376
+ simulationConfig: {
377
+ epoch,
378
+ elapsedSeconds,
379
+ timeScale,
380
+ isRunning
381
+ },
382
+ showDate,
383
+ dateFormat,
384
+ className,
385
+ small
386
+ });
407
387
  });
408
- export {
409
- MissionClock,
410
- MissionElapsedTime,
411
- SimpleTimer,
412
- SimulationClock
413
- };
414
- //# sourceMappingURL=MissionClock.js.map
388
+ //#endregion
389
+ export { MissionClock, MissionClock as default, MissionElapsedTime, SimpleTimer, SimulationClock };
390
+
391
+ //# sourceMappingURL=MissionClock.js.map