@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,532 +1,870 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { memo, useState, useRef, useMemo, useCallback } from "react";
3
1
  import { useTheme } from "../../theme/ThemeProvider.js";
2
+ import { memo, useCallback, useMemo, useRef, useState } from "react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/react/core/widgets/ActivityPlanner.tsx
5
+ /**
6
+ * @zendir/ui - ActivityPlanner Component
7
+ *
8
+ * Activity scheduling and management panel. Creates, edits, and monitors
9
+ * scheduled activities across timelines. Integrates with MissionCalendar
10
+ * and Timeline components.
11
+ *
12
+ * Space Mission Features:
13
+ * - Create/edit activities with command or script execution
14
+ * - Drag-and-drop reorder within timeline
15
+ * - Hazardous activity warnings (Astro UX)
16
+ * - Activity lifecycle tracking (created → scheduled → started → completed)
17
+ * - Overlap detection within a timeline
18
+ * - Metadata recording (operator, environment, notes)
19
+ * - Contact window awareness
20
+ * - Batch scheduling
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * <ActivityPlanner
25
+ * activities={activities}
26
+ * timelines={timelines}
27
+ * onActivityCreate={(a) => console.log('Create:', a)}
28
+ * onActivityUpdate={(a) => console.log('Update:', a)}
29
+ * />
30
+ * ```
31
+ */
32
+ /**
33
+ * Map activity status → Astro UX status color using tokens.
34
+ * created/scheduled → standby (cyan)
35
+ * started/completed → normal (green)
36
+ * paused/stopped/disabled → caution (yellow)
37
+ * error/failed/crashed → critical (red)
38
+ */
4
39
  function getStatusColor(status, tokens) {
5
- if (!status || !tokens) return (tokens == null ? void 0 : tokens.colors.text.muted) ?? "currentColor";
6
- switch (status) {
7
- case "created":
8
- case "scheduled":
9
- return tokens.colors.status.standby;
10
- case "started":
11
- case "completed":
12
- return tokens.colors.status.normal;
13
- case "paused":
14
- case "stopped":
15
- case "disabled":
16
- return tokens.colors.status.caution;
17
- case "error":
18
- case "failed":
19
- case "crashed":
20
- return tokens.colors.status.critical;
21
- }
40
+ if (!status || !tokens) return tokens?.colors.text.muted ?? "currentColor";
41
+ switch (status) {
42
+ case "created":
43
+ case "scheduled": return tokens.colors.status.standby;
44
+ case "started":
45
+ case "completed": return tokens.colors.status.normal;
46
+ case "paused":
47
+ case "stopped":
48
+ case "disabled": return tokens.colors.status.caution;
49
+ case "error":
50
+ case "failed":
51
+ case "crashed": return tokens.colors.status.critical;
52
+ }
22
53
  }
54
+ /**
55
+ * Return Astro UX status shape + contextual icon.
56
+ * The leading character is the Astro status shape for the mapped level:
57
+ * standby → ◯ (ring), normal → ● (filled circle),
58
+ * caution → ■ (square), critical → ▼ (triangle down)
59
+ * Followed by a contextual glyph for the specific activity state.
60
+ */
23
61
  function getStatusIcon(status) {
24
- if (!status) return "◯";
25
- switch (status) {
26
- case "created":
27
- return "◯";
28
- case "scheduled":
29
- return " ";
30
- case "started":
31
- return " ";
32
- case "completed":
33
- return "● ✓";
34
- case "paused":
35
- return " ";
36
- case "stopped":
37
- return "■ ⏹";
38
- case "disabled":
39
- return "■ ⊘";
40
- case "error":
41
- case "failed":
42
- case "crashed":
43
- return "▼";
44
- }
62
+ if (!status) return "◯";
63
+ switch (status) {
64
+ case "created": return "◯";
65
+ case "scheduled": return "◯";
66
+ case "started": return "● ▶";
67
+ case "completed": return " ";
68
+ case "paused": return "■ ⏸";
69
+ case "stopped": return " ";
70
+ case "disabled": return "■ ⊘";
71
+ case "error":
72
+ case "failed":
73
+ case "crashed": return "▼";
74
+ }
45
75
  }
46
76
  function formatDate(d) {
47
- return d.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
77
+ return d.toLocaleDateString("en-US", {
78
+ month: "short",
79
+ day: "numeric",
80
+ year: "numeric"
81
+ });
48
82
  }
49
83
  function formatTime(d) {
50
- return d.toLocaleTimeString("en-US", { hour12: false, hour: "2-digit", minute: "2-digit", second: "2-digit" });
84
+ return d.toLocaleTimeString("en-US", {
85
+ hour12: false,
86
+ hour: "2-digit",
87
+ minute: "2-digit",
88
+ second: "2-digit"
89
+ });
51
90
  }
52
91
  function checkOverlap(a, b) {
53
- if (!a.end || !b.end) return false;
54
- if (a.timeline !== b.timeline) return false;
55
- return a.start < b.end && b.start < a.end;
92
+ if (!a.end || !b.end) return false;
93
+ if (a.timeline !== b.timeline) return false;
94
+ return a.start < b.end && b.start < a.end;
56
95
  }
57
- const ActivityForm = memo(function ActivityForm2({
58
- timelines,
59
- selectedDate,
60
- tokens,
61
- onSubmit,
62
- onCancel
63
- }) {
64
- var _a;
65
- const now = selectedDate || /* @__PURE__ */ new Date();
66
- const endDefault = new Date(now.getTime() + 36e5);
67
- const [form, setForm] = useState({
68
- title: "",
69
- type: "command",
70
- start: now.toISOString().slice(0, 16),
71
- end: endDefault.toISOString().slice(0, 16),
72
- timeline: ((_a = timelines[0]) == null ? void 0 : _a.id) || "",
73
- description: "",
74
- command: "",
75
- script: "",
76
- hazardous: false,
77
- metadata: {}
78
- });
79
- const [metaKey, setMetaKey] = useState("");
80
- const [metaValue, setMetaValue] = useState("");
81
- const addMetadata = useCallback(() => {
82
- if (metaKey.trim()) {
83
- setForm((prev) => ({ ...prev, metadata: { ...prev.metadata, [metaKey.trim()]: metaValue } }));
84
- setMetaKey("");
85
- setMetaValue("");
86
- }
87
- }, [metaKey, metaValue]);
88
- const inputStyle = {
89
- background: tokens.colors.background.base,
90
- color: tokens.colors.text.primary,
91
- border: `1px solid ${tokens.colors.border.muted}`,
92
- borderRadius: tokens.borderRadius.md,
93
- padding: `${tokens.spacing.xs}px ${tokens.spacing.sm}px`,
94
- fontSize: tokens.typography.fontSize.xs,
95
- width: "100%",
96
- minHeight: 40,
97
- fontFamily: tokens.typography.fontFamily.primary,
98
- transition: "all 150ms ease"
99
- };
100
- const labelStyle = {
101
- fontSize: tokens.typography.fontSize.xxs,
102
- fontWeight: 500,
103
- color: tokens.colors.text.muted,
104
- textTransform: "uppercase",
105
- marginBottom: 3,
106
- display: "block"
107
- };
108
- return /* @__PURE__ */ jsxs("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 8 }, children: [
109
- /* @__PURE__ */ jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 120px", gap: 8 }, children: [
110
- /* @__PURE__ */ jsxs("div", { children: [
111
- /* @__PURE__ */ jsx("label", { htmlFor: "activity-title", style: labelStyle, children: "Title" }),
112
- /* @__PURE__ */ jsx("input", { id: "activity-title", "aria-label": "Activity title", style: inputStyle, value: form.title, onChange: (e) => setForm((p) => ({ ...p, title: e.target.value })), placeholder: "Activity name" })
113
- ] }),
114
- /* @__PURE__ */ jsxs("div", { children: [
115
- /* @__PURE__ */ jsx("label", { htmlFor: "activity-type", style: labelStyle, children: "Type" }),
116
- /* @__PURE__ */ jsxs("select", { id: "activity-type", "aria-label": "Activity type", style: inputStyle, value: form.type, onChange: (e) => setForm((p) => ({ ...p, type: e.target.value })), children: [
117
- /* @__PURE__ */ jsx("option", { value: "command", children: "Command" }),
118
- /* @__PURE__ */ jsx("option", { value: "script", children: "Script" }),
119
- /* @__PURE__ */ jsx("option", { value: "reserve", children: "Reserve" }),
120
- /* @__PURE__ */ jsx("option", { value: "contact", children: "Contact" }),
121
- /* @__PURE__ */ jsx("option", { value: "note", children: "Note" }),
122
- /* @__PURE__ */ jsx("option", { value: "metadata", children: "Metadata" })
123
- ] })
124
- ] })
125
- ] }),
126
- /* @__PURE__ */ jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 8 }, children: [
127
- /* @__PURE__ */ jsxs("div", { children: [
128
- /* @__PURE__ */ jsx("label", { htmlFor: "activity-start-time", style: labelStyle, children: "Start Time" }),
129
- /* @__PURE__ */ jsx("input", { id: "activity-start-time", "aria-label": "Start time", type: "datetime-local", style: { ...inputStyle, fontFamily: tokens.typography.fontFamily.mono }, value: form.start, onChange: (e) => setForm((p) => ({ ...p, start: e.target.value })) })
130
- ] }),
131
- /* @__PURE__ */ jsxs("div", { children: [
132
- /* @__PURE__ */ jsx("label", { htmlFor: "activity-end-time", style: labelStyle, children: "End Time" }),
133
- /* @__PURE__ */ jsx("input", { id: "activity-end-time", "aria-label": "End time", type: "datetime-local", style: { ...inputStyle, fontFamily: tokens.typography.fontFamily.mono }, value: form.end, onChange: (e) => setForm((p) => ({ ...p, end: e.target.value })) })
134
- ] })
135
- ] }),
136
- timelines.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
137
- /* @__PURE__ */ jsx("label", { htmlFor: "activity-timeline", style: labelStyle, children: "Timeline" }),
138
- /* @__PURE__ */ jsx("select", { id: "activity-timeline", "aria-label": "Timeline", style: inputStyle, value: form.timeline, onChange: (e) => setForm((p) => ({ ...p, timeline: e.target.value })), children: timelines.map((t) => /* @__PURE__ */ jsx("option", { value: t.id, children: t.name }, t.id)) })
139
- ] }),
140
- form.type === "command" && /* @__PURE__ */ jsxs("div", { children: [
141
- /* @__PURE__ */ jsx("label", { htmlFor: "activity-command", style: labelStyle, children: "Command" }),
142
- /* @__PURE__ */ jsx("input", { id: "activity-command", "aria-label": "Command", style: { ...inputStyle, fontFamily: tokens.typography.fontFamily.mono }, value: form.command, onChange: (e) => setForm((p) => ({ ...p, command: e.target.value })), placeholder: 'cmd("TARGET COMMAND")' })
143
- ] }),
144
- form.type === "script" && /* @__PURE__ */ jsxs("div", { children: [
145
- /* @__PURE__ */ jsx("label", { htmlFor: "activity-script", style: labelStyle, children: "Script Path" }),
146
- /* @__PURE__ */ jsx("input", { id: "activity-script", "aria-label": "Script path", style: { ...inputStyle, fontFamily: tokens.typography.fontFamily.mono }, value: form.script, onChange: (e) => setForm((p) => ({ ...p, script: e.target.value })), placeholder: "/scripts/ops/collect.rb" })
147
- ] }),
148
- /* @__PURE__ */ jsxs("div", { children: [
149
- /* @__PURE__ */ jsx("label", { htmlFor: "activity-description", style: labelStyle, children: "Description" }),
150
- /* @__PURE__ */ jsx("textarea", { id: "activity-description", "aria-label": "Description", style: { ...inputStyle, minHeight: 48, resize: "vertical" }, value: form.description, onChange: (e) => setForm((p) => ({ ...p, description: e.target.value })), placeholder: "Notes..." })
151
- ] }),
152
- /* @__PURE__ */ jsxs("div", { children: [
153
- /* @__PURE__ */ jsx("div", { style: labelStyle, children: "Metadata" }),
154
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 4, marginBottom: 4 }, children: [
155
- /* @__PURE__ */ jsx("input", { "aria-label": "Metadata key", style: { ...inputStyle, flex: 1 }, value: metaKey, onChange: (e) => setMetaKey(e.target.value), placeholder: "Key" }),
156
- /* @__PURE__ */ jsx("input", { "aria-label": "Metadata value", style: { ...inputStyle, flex: 1 }, value: metaValue, onChange: (e) => setMetaValue(e.target.value), placeholder: "Value" }),
157
- /* @__PURE__ */ jsx("button", { onClick: addMetadata, style: {
158
- background: tokens.colors.interactive.default,
159
- color: tokens.colors.text.inverse,
160
- border: "none",
161
- borderRadius: tokens.borderRadius.md,
162
- padding: `0 ${tokens.spacing.sm}px`,
163
- fontSize: tokens.typography.fontSize.xs,
164
- cursor: "pointer",
165
- transition: "all 150ms ease"
166
- }, children: "+" })
167
- ] }),
168
- Object.keys(form.metadata).length > 0 && /* @__PURE__ */ jsx("div", { style: { display: "flex", gap: 4, flexWrap: "wrap" }, children: Object.entries(form.metadata).map(([k, v]) => /* @__PURE__ */ jsxs("span", { style: {
169
- fontSize: tokens.typography.fontSize.micro,
170
- background: tokens.colors.background.surface,
171
- padding: `2px 6px`,
172
- borderRadius: tokens.borderRadius.sm,
173
- display: "flex",
174
- alignItems: "center",
175
- gap: tokens.spacing.xs
176
- }, children: [
177
- k,
178
- ": ",
179
- v,
180
- /* @__PURE__ */ jsx(
181
- "button",
182
- {
183
- type: "button",
184
- "aria-label": `Remove metadata ${k}`,
185
- onClick: () => setForm((p) => {
186
- const m = { ...p.metadata };
187
- delete m[k];
188
- return { ...p, metadata: m };
189
- }),
190
- style: {
191
- cursor: "pointer",
192
- color: tokens.colors.status.critical,
193
- fontWeight: 500,
194
- border: "none",
195
- background: "transparent",
196
- padding: 0,
197
- lineHeight: 1
198
- },
199
- children: "×"
200
- }
201
- )
202
- ] }, k)) })
203
- ] }),
204
- /* @__PURE__ */ jsxs("label", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: tokens.typography.fontSize.xs, cursor: "pointer" }, children: [
205
- /* @__PURE__ */ jsx("input", { "aria-label": "Hazardous activity", type: "checkbox", checked: form.hazardous, onChange: (e) => setForm((p) => ({ ...p, hazardous: e.target.checked })) }),
206
- /* @__PURE__ */ jsx("span", { style: { color: form.hazardous ? tokens.colors.status.critical : tokens.colors.text.secondary }, children: "⚠ Hazardous Activity" })
207
- ] }),
208
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 6, justifyContent: "flex-end", marginTop: 4 }, children: [
209
- /* @__PURE__ */ jsx("button", { onClick: onCancel, style: {
210
- background: "transparent",
211
- color: tokens.colors.text.muted,
212
- border: `1px solid ${tokens.colors.border.muted}`,
213
- borderRadius: tokens.borderRadius.md,
214
- padding: `${tokens.spacing.xs}px 14px`,
215
- fontSize: tokens.typography.fontSize.xs,
216
- cursor: "pointer",
217
- transition: "all 150ms ease"
218
- }, children: "Cancel" }),
219
- /* @__PURE__ */ jsx("button", { onClick: () => onSubmit(form), disabled: !form.title.trim(), style: {
220
- background: tokens.colors.interactive.default,
221
- color: tokens.colors.text.inverse,
222
- border: "none",
223
- borderRadius: tokens.borderRadius.md,
224
- padding: `${tokens.spacing.xs}px 14px`,
225
- fontSize: tokens.typography.fontSize.xs,
226
- cursor: form.title.trim() ? "pointer" : "not-allowed",
227
- fontWeight: 500,
228
- opacity: form.title.trim() ? 1 : 0.5,
229
- transition: "all 150ms ease"
230
- }, children: "Create Activity" })
231
- ] })
232
- ] });
96
+ var ActivityForm = memo(function ActivityForm({ timelines, selectedDate, tokens, onSubmit, onCancel }) {
97
+ const now = selectedDate || /* @__PURE__ */ new Date();
98
+ const endDefault = new Date(now.getTime() + 36e5);
99
+ const [form, setForm] = useState({
100
+ title: "",
101
+ type: "command",
102
+ start: now.toISOString().slice(0, 16),
103
+ end: endDefault.toISOString().slice(0, 16),
104
+ timeline: timelines[0]?.id || "",
105
+ description: "",
106
+ command: "",
107
+ script: "",
108
+ hazardous: false,
109
+ metadata: {}
110
+ });
111
+ const [metaKey, setMetaKey] = useState("");
112
+ const [metaValue, setMetaValue] = useState("");
113
+ const addMetadata = useCallback(() => {
114
+ if (metaKey.trim()) {
115
+ setForm((prev) => ({
116
+ ...prev,
117
+ metadata: {
118
+ ...prev.metadata,
119
+ [metaKey.trim()]: metaValue
120
+ }
121
+ }));
122
+ setMetaKey("");
123
+ setMetaValue("");
124
+ }
125
+ }, [metaKey, metaValue]);
126
+ const inputStyle = {
127
+ background: tokens.colors.background.base,
128
+ color: tokens.colors.text.primary,
129
+ border: `1px solid ${tokens.colors.border.muted}`,
130
+ borderRadius: tokens.borderRadius.md,
131
+ padding: `${tokens.spacing.xs}px ${tokens.spacing.sm}px`,
132
+ fontSize: tokens.typography.fontSize.xs,
133
+ width: "100%",
134
+ minHeight: 40,
135
+ fontFamily: tokens.typography.fontFamily.primary,
136
+ transition: "all 150ms ease"
137
+ };
138
+ const labelStyle = {
139
+ fontSize: tokens.typography.fontSize.xxs,
140
+ fontWeight: 500,
141
+ color: tokens.colors.text.muted,
142
+ textTransform: "uppercase",
143
+ marginBottom: 3,
144
+ display: "block"
145
+ };
146
+ return /* @__PURE__ */ jsxs("div", {
147
+ style: {
148
+ padding: 12,
149
+ display: "flex",
150
+ flexDirection: "column",
151
+ gap: 8
152
+ },
153
+ children: [
154
+ /* @__PURE__ */ jsxs("div", {
155
+ style: {
156
+ display: "grid",
157
+ gridTemplateColumns: "1fr 120px",
158
+ gap: 8
159
+ },
160
+ children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
161
+ htmlFor: "activity-title",
162
+ style: labelStyle,
163
+ children: "Title"
164
+ }), /* @__PURE__ */ jsx("input", {
165
+ id: "activity-title",
166
+ "aria-label": "Activity title",
167
+ style: inputStyle,
168
+ value: form.title,
169
+ onChange: (e) => setForm((p) => ({
170
+ ...p,
171
+ title: e.target.value
172
+ })),
173
+ placeholder: "Activity name"
174
+ })] }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
175
+ htmlFor: "activity-type",
176
+ style: labelStyle,
177
+ children: "Type"
178
+ }), /* @__PURE__ */ jsxs("select", {
179
+ id: "activity-type",
180
+ "aria-label": "Activity type",
181
+ style: inputStyle,
182
+ value: form.type,
183
+ onChange: (e) => setForm((p) => ({
184
+ ...p,
185
+ type: e.target.value
186
+ })),
187
+ children: [
188
+ /* @__PURE__ */ jsx("option", {
189
+ value: "command",
190
+ children: "Command"
191
+ }),
192
+ /* @__PURE__ */ jsx("option", {
193
+ value: "script",
194
+ children: "Script"
195
+ }),
196
+ /* @__PURE__ */ jsx("option", {
197
+ value: "reserve",
198
+ children: "Reserve"
199
+ }),
200
+ /* @__PURE__ */ jsx("option", {
201
+ value: "contact",
202
+ children: "Contact"
203
+ }),
204
+ /* @__PURE__ */ jsx("option", {
205
+ value: "note",
206
+ children: "Note"
207
+ }),
208
+ /* @__PURE__ */ jsx("option", {
209
+ value: "metadata",
210
+ children: "Metadata"
211
+ })
212
+ ]
213
+ })] })]
214
+ }),
215
+ /* @__PURE__ */ jsxs("div", {
216
+ style: {
217
+ display: "grid",
218
+ gridTemplateColumns: "1fr 1fr",
219
+ gap: 8
220
+ },
221
+ children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
222
+ htmlFor: "activity-start-time",
223
+ style: labelStyle,
224
+ children: "Start Time"
225
+ }), /* @__PURE__ */ jsx("input", {
226
+ id: "activity-start-time",
227
+ "aria-label": "Start time",
228
+ type: "datetime-local",
229
+ style: {
230
+ ...inputStyle,
231
+ fontFamily: tokens.typography.fontFamily.mono
232
+ },
233
+ value: form.start,
234
+ onChange: (e) => setForm((p) => ({
235
+ ...p,
236
+ start: e.target.value
237
+ }))
238
+ })] }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
239
+ htmlFor: "activity-end-time",
240
+ style: labelStyle,
241
+ children: "End Time"
242
+ }), /* @__PURE__ */ jsx("input", {
243
+ id: "activity-end-time",
244
+ "aria-label": "End time",
245
+ type: "datetime-local",
246
+ style: {
247
+ ...inputStyle,
248
+ fontFamily: tokens.typography.fontFamily.mono
249
+ },
250
+ value: form.end,
251
+ onChange: (e) => setForm((p) => ({
252
+ ...p,
253
+ end: e.target.value
254
+ }))
255
+ })] })]
256
+ }),
257
+ timelines.length > 0 && /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
258
+ htmlFor: "activity-timeline",
259
+ style: labelStyle,
260
+ children: "Timeline"
261
+ }), /* @__PURE__ */ jsx("select", {
262
+ id: "activity-timeline",
263
+ "aria-label": "Timeline",
264
+ style: inputStyle,
265
+ value: form.timeline,
266
+ onChange: (e) => setForm((p) => ({
267
+ ...p,
268
+ timeline: e.target.value
269
+ })),
270
+ children: timelines.map((t) => /* @__PURE__ */ jsx("option", {
271
+ value: t.id,
272
+ children: t.name
273
+ }, t.id))
274
+ })] }),
275
+ form.type === "command" && /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
276
+ htmlFor: "activity-command",
277
+ style: labelStyle,
278
+ children: "Command"
279
+ }), /* @__PURE__ */ jsx("input", {
280
+ id: "activity-command",
281
+ "aria-label": "Command",
282
+ style: {
283
+ ...inputStyle,
284
+ fontFamily: tokens.typography.fontFamily.mono
285
+ },
286
+ value: form.command,
287
+ onChange: (e) => setForm((p) => ({
288
+ ...p,
289
+ command: e.target.value
290
+ })),
291
+ placeholder: "cmd(\"TARGET COMMAND\")"
292
+ })] }),
293
+ form.type === "script" && /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
294
+ htmlFor: "activity-script",
295
+ style: labelStyle,
296
+ children: "Script Path"
297
+ }), /* @__PURE__ */ jsx("input", {
298
+ id: "activity-script",
299
+ "aria-label": "Script path",
300
+ style: {
301
+ ...inputStyle,
302
+ fontFamily: tokens.typography.fontFamily.mono
303
+ },
304
+ value: form.script,
305
+ onChange: (e) => setForm((p) => ({
306
+ ...p,
307
+ script: e.target.value
308
+ })),
309
+ placeholder: "/scripts/ops/collect.rb"
310
+ })] }),
311
+ /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
312
+ htmlFor: "activity-description",
313
+ style: labelStyle,
314
+ children: "Description"
315
+ }), /* @__PURE__ */ jsx("textarea", {
316
+ id: "activity-description",
317
+ "aria-label": "Description",
318
+ style: {
319
+ ...inputStyle,
320
+ minHeight: 48,
321
+ resize: "vertical"
322
+ },
323
+ value: form.description,
324
+ onChange: (e) => setForm((p) => ({
325
+ ...p,
326
+ description: e.target.value
327
+ })),
328
+ placeholder: "Notes..."
329
+ })] }),
330
+ /* @__PURE__ */ jsxs("div", { children: [
331
+ /* @__PURE__ */ jsx("div", {
332
+ style: labelStyle,
333
+ children: "Metadata"
334
+ }),
335
+ /* @__PURE__ */ jsxs("div", {
336
+ style: {
337
+ display: "flex",
338
+ gap: 4,
339
+ marginBottom: 4
340
+ },
341
+ children: [
342
+ /* @__PURE__ */ jsx("input", {
343
+ "aria-label": "Metadata key",
344
+ style: {
345
+ ...inputStyle,
346
+ flex: 1
347
+ },
348
+ value: metaKey,
349
+ onChange: (e) => setMetaKey(e.target.value),
350
+ placeholder: "Key"
351
+ }),
352
+ /* @__PURE__ */ jsx("input", {
353
+ "aria-label": "Metadata value",
354
+ style: {
355
+ ...inputStyle,
356
+ flex: 1
357
+ },
358
+ value: metaValue,
359
+ onChange: (e) => setMetaValue(e.target.value),
360
+ placeholder: "Value"
361
+ }),
362
+ /* @__PURE__ */ jsx("button", {
363
+ onClick: addMetadata,
364
+ style: {
365
+ background: tokens.colors.interactive.default,
366
+ color: tokens.colors.text.inverse,
367
+ border: "none",
368
+ borderRadius: tokens.borderRadius.md,
369
+ padding: `0 ${tokens.spacing.sm}px`,
370
+ fontSize: tokens.typography.fontSize.xs,
371
+ cursor: "pointer",
372
+ transition: "all 150ms ease"
373
+ },
374
+ children: "+"
375
+ })
376
+ ]
377
+ }),
378
+ Object.keys(form.metadata).length > 0 && /* @__PURE__ */ jsx("div", {
379
+ style: {
380
+ display: "flex",
381
+ gap: 4,
382
+ flexWrap: "wrap"
383
+ },
384
+ children: Object.entries(form.metadata).map(([k, v]) => /* @__PURE__ */ jsxs("span", {
385
+ style: {
386
+ fontSize: tokens.typography.fontSize.micro,
387
+ background: tokens.colors.background.surface,
388
+ padding: `2px 6px`,
389
+ borderRadius: tokens.borderRadius.sm,
390
+ display: "flex",
391
+ alignItems: "center",
392
+ gap: tokens.spacing.xs
393
+ },
394
+ children: [
395
+ k,
396
+ ": ",
397
+ v,
398
+ /* @__PURE__ */ jsx("button", {
399
+ type: "button",
400
+ "aria-label": `Remove metadata ${k}`,
401
+ onClick: () => setForm((p) => {
402
+ const m = { ...p.metadata };
403
+ delete m[k];
404
+ return {
405
+ ...p,
406
+ metadata: m
407
+ };
408
+ }),
409
+ style: {
410
+ cursor: "pointer",
411
+ color: tokens.colors.status.critical,
412
+ fontWeight: 500,
413
+ border: "none",
414
+ background: "transparent",
415
+ padding: 0,
416
+ lineHeight: 1
417
+ },
418
+ children: "×"
419
+ })
420
+ ]
421
+ }, k))
422
+ })
423
+ ] }),
424
+ /* @__PURE__ */ jsxs("label", {
425
+ style: {
426
+ display: "flex",
427
+ alignItems: "center",
428
+ gap: 6,
429
+ fontSize: tokens.typography.fontSize.xs,
430
+ cursor: "pointer"
431
+ },
432
+ children: [/* @__PURE__ */ jsx("input", {
433
+ "aria-label": "Hazardous activity",
434
+ type: "checkbox",
435
+ checked: form.hazardous,
436
+ onChange: (e) => setForm((p) => ({
437
+ ...p,
438
+ hazardous: e.target.checked
439
+ }))
440
+ }), /* @__PURE__ */ jsx("span", {
441
+ style: { color: form.hazardous ? tokens.colors.status.critical : tokens.colors.text.secondary },
442
+ children: "⚠ Hazardous Activity"
443
+ })]
444
+ }),
445
+ /* @__PURE__ */ jsxs("div", {
446
+ style: {
447
+ display: "flex",
448
+ gap: 6,
449
+ justifyContent: "flex-end",
450
+ marginTop: 4
451
+ },
452
+ children: [/* @__PURE__ */ jsx("button", {
453
+ onClick: onCancel,
454
+ style: {
455
+ background: "transparent",
456
+ color: tokens.colors.text.muted,
457
+ border: `1px solid ${tokens.colors.border.muted}`,
458
+ borderRadius: tokens.borderRadius.md,
459
+ padding: `${tokens.spacing.xs}px 14px`,
460
+ fontSize: tokens.typography.fontSize.xs,
461
+ cursor: "pointer",
462
+ transition: "all 150ms ease"
463
+ },
464
+ children: "Cancel"
465
+ }), /* @__PURE__ */ jsx("button", {
466
+ onClick: () => onSubmit(form),
467
+ disabled: !form.title.trim(),
468
+ style: {
469
+ background: tokens.colors.interactive.default,
470
+ color: tokens.colors.text.inverse,
471
+ border: "none",
472
+ borderRadius: tokens.borderRadius.md,
473
+ padding: `${tokens.spacing.xs}px 14px`,
474
+ fontSize: tokens.typography.fontSize.xs,
475
+ cursor: form.title.trim() ? "pointer" : "not-allowed",
476
+ fontWeight: 500,
477
+ opacity: form.title.trim() ? 1 : .5,
478
+ transition: "all 150ms ease"
479
+ },
480
+ children: "Create Activity"
481
+ })]
482
+ })
483
+ ]
484
+ });
233
485
  });
234
- const ActivityPlanner = memo(function ActivityPlanner2({
235
- activities,
236
- timelines,
237
- selectedDate,
238
- height = 500,
239
- title = "Activity Planner",
240
- readOnly = false,
241
- showOverlapWarning = true,
242
- onActivityCreate,
243
- onActivityUpdate: _onActivityUpdate,
244
- onActivityDelete,
245
- onViewInCalendar,
246
- onViewInTimeline,
247
- className = ""
248
- }) {
249
- const { tokens, theme } = useTheme();
250
- const isTransparentTheme = theme === "transparent" || theme === "transparent-bold" || theme === "transparent-minimal";
251
- const [showForm, setShowForm] = useState(false);
252
- const [filter, setFilter] = useState("");
253
- const [sortBy, setSortBy] = useState("time");
254
- const listRef = useRef(null);
255
- const overlaps = useMemo(() => {
256
- const pairs = [];
257
- for (let i = 0; i < activities.length; i++) {
258
- for (let j = i + 1; j < activities.length; j++) {
259
- if (checkOverlap(activities[i], activities[j])) {
260
- pairs.push([activities[i].id, activities[j].id]);
261
- }
262
- }
263
- }
264
- return new Set(pairs.flat());
265
- }, [activities]);
266
- const displayActivities = useMemo(() => {
267
- let list = [...activities];
268
- if (filter) {
269
- const lf = filter.toLowerCase();
270
- list = list.filter(
271
- (a) => {
272
- var _a, _b, _c;
273
- return a.title.toLowerCase().includes(lf) || ((_a = a.description) == null ? void 0 : _a.toLowerCase().includes(lf)) || ((_b = a.timeline) == null ? void 0 : _b.toLowerCase().includes(lf)) || ((_c = a.command) == null ? void 0 : _c.toLowerCase().includes(lf));
274
- }
275
- );
276
- }
277
- switch (sortBy) {
278
- case "time":
279
- list.sort((a, b) => a.start.getTime() - b.start.getTime());
280
- break;
281
- case "status":
282
- list.sort((a, b) => (a.status || "").localeCompare(b.status || ""));
283
- break;
284
- case "timeline":
285
- list.sort((a, b) => (a.timeline || "").localeCompare(b.timeline || ""));
286
- break;
287
- }
288
- return list;
289
- }, [activities, filter, sortBy]);
290
- const stats = useMemo(() => ({
291
- total: activities.length,
292
- scheduled: activities.filter((a) => a.status === "scheduled" || a.status === "created").length,
293
- running: activities.filter((a) => a.status === "started").length,
294
- completed: activities.filter((a) => a.status === "completed").length,
295
- errors: activities.filter((a) => a.status === "error" || a.status === "failed" || a.status === "crashed").length
296
- }), [activities]);
297
- const handleCreate = useCallback((data) => {
298
- onActivityCreate == null ? void 0 : onActivityCreate({
299
- title: data.title,
300
- type: data.type,
301
- start: new Date(data.start),
302
- end: new Date(data.end),
303
- timeline: data.timeline,
304
- description: data.description,
305
- command: data.command || void 0,
306
- script: data.script || void 0,
307
- metadata: Object.keys(data.metadata).length > 0 ? data.metadata : void 0,
308
- status: "created"
309
- });
310
- setShowForm(false);
311
- }, [onActivityCreate]);
312
- const panelPadX = tokens.spacing.md;
313
- const panelPadY = tokens.spacing.sm;
314
- return /* @__PURE__ */ jsxs(
315
- "div",
316
- {
317
- className: `activity-planner ${className}`,
318
- style: {
319
- height: typeof height === "number" ? height : void 0,
320
- background: tokens.colors.background.base,
321
- ...tokens.colors.border.cardStyle ?? { border: `1px solid ${tokens.colors.border.muted}` },
322
- borderRadius: tokens.borderRadius.lg,
323
- overflow: "hidden",
324
- display: "flex",
325
- flexDirection: "column",
326
- fontFamily: tokens.typography.fontFamily.primary,
327
- color: tokens.colors.text.primary,
328
- backdropFilter: isTransparentTheme ? "blur(10px)" : void 0,
329
- WebkitBackdropFilter: isTransparentTheme ? "blur(10px)" : void 0
330
- },
331
- children: [
332
- /* @__PURE__ */ jsxs("div", { style: {
333
- padding: `${panelPadY}px ${panelPadX}px`,
334
- borderBottom: `1px solid ${tokens.colors.border.muted}`,
335
- background: tokens.colors.background.surface,
336
- backdropFilter: "blur(8px)",
337
- display: "flex",
338
- alignItems: "center",
339
- justifyContent: "space-between"
340
- }, children: [
341
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: tokens.spacing.sm }, children: [
342
- /* @__PURE__ */ jsx("span", { style: { fontWeight: 500, fontSize: tokens.typography.fontSize.sm }, children: title }),
343
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 10, fontSize: tokens.typography.fontSize.xxs, color: tokens.colors.text.muted }, children: [
344
- /* @__PURE__ */ jsxs("span", { children: [
345
- "Scheduled ",
346
- stats.scheduled
347
- ] }),
348
- /* @__PURE__ */ jsxs("span", { style: { color: tokens.colors.text.secondary }, children: [
349
- "Running ",
350
- stats.running
351
- ] }),
352
- /* @__PURE__ */ jsxs("span", { style: { color: tokens.colors.text.secondary }, children: [
353
- "Completed ",
354
- stats.completed
355
- ] }),
356
- stats.errors > 0 && /* @__PURE__ */ jsxs("span", { style: { color: tokens.colors.status.critical }, children: [
357
- "Errors ",
358
- stats.errors
359
- ] })
360
- ] })
361
- ] }),
362
- !readOnly && /* @__PURE__ */ jsx(
363
- "button",
364
- {
365
- onClick: () => setShowForm(!showForm),
366
- style: {
367
- background: showForm ? tokens.colors.status.critical + "22" : tokens.colors.interactive.default,
368
- color: showForm ? tokens.colors.status.critical : tokens.colors.text.inverse,
369
- border: "none",
370
- borderRadius: tokens.borderRadius.md,
371
- padding: "3px 10px",
372
- fontSize: tokens.typography.fontSize.xs,
373
- fontWeight: 500,
374
- cursor: "pointer",
375
- transition: "all 150ms ease"
376
- },
377
- children: showForm ? "✕ Cancel" : "+ New Activity"
378
- }
379
- )
380
- ] }),
381
- showForm && !readOnly && /* @__PURE__ */ jsx("div", { style: { borderBottom: `1px solid ${tokens.colors.border.muted}`, background: tokens.colors.background.surface + "88" }, children: /* @__PURE__ */ jsx(
382
- ActivityForm,
383
- {
384
- timelines,
385
- selectedDate,
386
- tokens,
387
- onSubmit: handleCreate,
388
- onCancel: () => setShowForm(false)
389
- }
390
- ) }),
391
- /* @__PURE__ */ jsxs("div", { style: {
392
- padding: `${tokens.spacing.xs}px ${panelPadX}px`,
393
- display: "flex",
394
- gap: 6,
395
- alignItems: "center",
396
- borderBottom: `1px solid ${tokens.colors.border.muted}`
397
- }, children: [
398
- /* @__PURE__ */ jsx(
399
- "input",
400
- {
401
- value: filter,
402
- onChange: (e) => setFilter(e.target.value),
403
- "aria-label": "Search activities",
404
- placeholder: "Search activities...",
405
- style: {
406
- flex: 1,
407
- background: tokens.colors.background.surface,
408
- color: tokens.colors.text.primary,
409
- border: `1px solid ${tokens.colors.border.muted}`,
410
- borderRadius: tokens.borderRadius.md,
411
- padding: "3px 8px",
412
- fontSize: tokens.typography.fontSize.xxs,
413
- fontFamily: tokens.typography.fontFamily.primary,
414
- transition: "all 150ms ease"
415
- }
416
- }
417
- ),
418
- /* @__PURE__ */ jsxs(
419
- "select",
420
- {
421
- value: sortBy,
422
- onChange: (e) => setSortBy(e.target.value),
423
- "aria-label": "Sort activities",
424
- style: {
425
- background: tokens.colors.background.surface,
426
- color: tokens.colors.text.secondary,
427
- border: `1px solid ${tokens.colors.border.muted}`,
428
- borderRadius: tokens.borderRadius.md,
429
- padding: "3px 6px",
430
- fontSize: tokens.typography.fontSize.xxs,
431
- transition: "all 150ms ease"
432
- },
433
- children: [
434
- /* @__PURE__ */ jsx("option", { value: "time", children: "Sort: Time" }),
435
- /* @__PURE__ */ jsx("option", { value: "status", children: "Sort: Status" }),
436
- /* @__PURE__ */ jsx("option", { value: "timeline", children: "Sort: Timeline" })
437
- ]
438
- }
439
- )
440
- ] }),
441
- /* @__PURE__ */ jsx("div", { ref: listRef, style: { flex: 1, overflow: "auto", padding: 8 }, children: displayActivities.length === 0 ? /* @__PURE__ */ jsx("div", { style: { textAlign: "center", color: tokens.colors.text.muted, padding: 40, fontSize: tokens.typography.fontSize.xs }, children: filter ? "No matching activities" : "No activities scheduled" }) : /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: displayActivities.map((a) => {
442
- const color = a.color || getStatusColor(a.status, tokens);
443
- const hasOverlap = overlaps.has(a.id);
444
- return /* @__PURE__ */ jsxs(
445
- "div",
446
- {
447
- style: {
448
- display: "grid",
449
- gridTemplateColumns: "24px 1fr auto",
450
- alignItems: "center",
451
- gap: tokens.spacing.sm,
452
- padding: "6px 10px",
453
- background: hasOverlap ? `${tokens.colors.status.caution}10` : `${color}08`,
454
- borderLeft: `3px solid ${color}`,
455
- borderRadius: tokens.borderRadius.md,
456
- fontSize: tokens.typography.fontSize.xs,
457
- cursor: "pointer",
458
- border: hasOverlap && showOverlapWarning ? `1px solid ${tokens.colors.status.caution}44` : void 0,
459
- transition: "all 150ms ease"
460
- },
461
- children: [
462
- /* @__PURE__ */ jsx("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ jsx("span", { style: { color, fontSize: tokens.typography.fontSize.sm, fontWeight: 500 }, children: getStatusIcon(a.status) }) }),
463
- /* @__PURE__ */ jsxs("div", { style: { overflow: "hidden" }, children: [
464
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 2 }, children: [
465
- /* @__PURE__ */ jsx("span", { style: { fontWeight: 500, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: a.title }),
466
- a.timeline && /* @__PURE__ */ jsx("span", { style: {
467
- fontSize: tokens.typography.fontSize.micro,
468
- background: tokens.colors.background.surface,
469
- padding: `0 ${tokens.spacing.xs}px`,
470
- borderRadius: tokens.borderRadius.sm,
471
- color: tokens.colors.text.muted
472
- }, children: a.timeline }),
473
- hasOverlap && showOverlapWarning && /* @__PURE__ */ jsx("span", { style: { fontSize: tokens.typography.fontSize.micro, color: tokens.colors.status.caution, fontWeight: 500 }, children: "⚠ OVERLAP" })
474
- ] }),
475
- /* @__PURE__ */ jsxs("div", { style: { fontSize: tokens.typography.fontSize.micro, fontFamily: tokens.typography.fontFamily.mono, color: tokens.colors.text.muted }, children: [
476
- formatDate(a.start),
477
- " ",
478
- formatTime(a.start),
479
- a.end ? ` → ${formatTime(a.end)}` : ""
480
- ] })
481
- ] }),
482
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 4 }, children: [
483
- onViewInCalendar && /* @__PURE__ */ jsx("button", { "aria-label": `View ${a.title} in calendar`, onClick: () => onViewInCalendar(a), style: actionBtnStyle(tokens), title: "View in Calendar", children: "Calendar" }),
484
- onViewInTimeline && /* @__PURE__ */ jsx("button", { "aria-label": `View ${a.title} in timeline`, onClick: () => onViewInTimeline(a), style: actionBtnStyle(tokens), title: "View in Timeline", children: "Timeline" }),
485
- !readOnly && onActivityDelete && /* @__PURE__ */ jsx("button", { "aria-label": `Delete ${a.title}`, onClick: () => onActivityDelete(a.id), style: { ...actionBtnStyle(tokens), color: tokens.colors.status.critical }, title: "Delete", children: "Delete" })
486
- ] })
487
- ]
488
- },
489
- a.id
490
- );
491
- }) }) }),
492
- /* @__PURE__ */ jsxs("div", { style: {
493
- padding: `${tokens.spacing.xs}px ${panelPadX}px`,
494
- borderTop: `1px solid ${tokens.colors.border.muted}`,
495
- background: tokens.colors.background.surface,
496
- fontSize: tokens.typography.fontSize.micro,
497
- color: tokens.colors.text.muted,
498
- display: "flex",
499
- justifyContent: "space-between"
500
- }, children: [
501
- /* @__PURE__ */ jsxs("span", { children: [
502
- displayActivities.length,
503
- " / ",
504
- activities.length,
505
- " activities"
506
- ] }),
507
- overlaps.size > 0 && showOverlapWarning && /* @__PURE__ */ jsxs("span", { style: { color: tokens.colors.status.caution }, children: [
508
- "⚠ ",
509
- overlaps.size,
510
- " overlapping activities"
511
- ] })
512
- ] })
513
- ]
514
- }
515
- );
486
+ var ActivityPlanner = memo(function ActivityPlanner({ activities, timelines, selectedDate, height = 500, title = "Activity Planner", readOnly = false, showOverlapWarning = true, onActivityCreate, onActivityUpdate: _onActivityUpdate, onActivityDelete, onViewInCalendar, onViewInTimeline, className = "" }) {
487
+ const { tokens, theme } = useTheme();
488
+ const isTransparentTheme = theme === "transparent" || theme === "transparent-bold" || theme === "transparent-minimal";
489
+ const [showForm, setShowForm] = useState(false);
490
+ const [filter, setFilter] = useState("");
491
+ const [sortBy, setSortBy] = useState("time");
492
+ const listRef = useRef(null);
493
+ const overlaps = useMemo(() => {
494
+ const pairs = [];
495
+ for (let i = 0; i < activities.length; i++) for (let j = i + 1; j < activities.length; j++) if (checkOverlap(activities[i], activities[j])) pairs.push([activities[i].id, activities[j].id]);
496
+ return new Set(pairs.flat());
497
+ }, [activities]);
498
+ const displayActivities = useMemo(() => {
499
+ let list = [...activities];
500
+ if (filter) {
501
+ const lf = filter.toLowerCase();
502
+ list = list.filter((a) => a.title.toLowerCase().includes(lf) || a.description?.toLowerCase().includes(lf) || a.timeline?.toLowerCase().includes(lf) || a.command?.toLowerCase().includes(lf));
503
+ }
504
+ switch (sortBy) {
505
+ case "time":
506
+ list.sort((a, b) => a.start.getTime() - b.start.getTime());
507
+ break;
508
+ case "status":
509
+ list.sort((a, b) => (a.status || "").localeCompare(b.status || ""));
510
+ break;
511
+ case "timeline":
512
+ list.sort((a, b) => (a.timeline || "").localeCompare(b.timeline || ""));
513
+ break;
514
+ }
515
+ return list;
516
+ }, [
517
+ activities,
518
+ filter,
519
+ sortBy
520
+ ]);
521
+ const stats = useMemo(() => ({
522
+ total: activities.length,
523
+ scheduled: activities.filter((a) => a.status === "scheduled" || a.status === "created").length,
524
+ running: activities.filter((a) => a.status === "started").length,
525
+ completed: activities.filter((a) => a.status === "completed").length,
526
+ errors: activities.filter((a) => a.status === "error" || a.status === "failed" || a.status === "crashed").length
527
+ }), [activities]);
528
+ const handleCreate = useCallback((data) => {
529
+ onActivityCreate?.({
530
+ title: data.title,
531
+ type: data.type,
532
+ start: new Date(data.start),
533
+ end: new Date(data.end),
534
+ timeline: data.timeline,
535
+ description: data.description,
536
+ command: data.command || void 0,
537
+ script: data.script || void 0,
538
+ metadata: Object.keys(data.metadata).length > 0 ? data.metadata : void 0,
539
+ status: "created"
540
+ });
541
+ setShowForm(false);
542
+ }, [onActivityCreate]);
543
+ const panelPadX = tokens.spacing.md;
544
+ const panelPadY = tokens.spacing.sm;
545
+ return /* @__PURE__ */ jsxs("div", {
546
+ className: `activity-planner ${className}`,
547
+ style: {
548
+ height: typeof height === "number" ? height : void 0,
549
+ background: tokens.colors.background.base,
550
+ ...tokens.colors.border.cardStyle ?? { border: `1px solid ${tokens.colors.border.muted}` },
551
+ borderRadius: tokens.borderRadius.lg,
552
+ overflow: "hidden",
553
+ display: "flex",
554
+ flexDirection: "column",
555
+ fontFamily: tokens.typography.fontFamily.primary,
556
+ color: tokens.colors.text.primary,
557
+ backdropFilter: isTransparentTheme ? "blur(10px)" : void 0,
558
+ WebkitBackdropFilter: isTransparentTheme ? "blur(10px)" : void 0
559
+ },
560
+ children: [
561
+ /* @__PURE__ */ jsxs("div", {
562
+ style: {
563
+ padding: `${panelPadY}px ${panelPadX}px`,
564
+ borderBottom: `1px solid ${tokens.colors.border.muted}`,
565
+ background: tokens.colors.background.surface,
566
+ backdropFilter: "blur(8px)",
567
+ display: "flex",
568
+ alignItems: "center",
569
+ justifyContent: "space-between"
570
+ },
571
+ children: [/* @__PURE__ */ jsxs("div", {
572
+ style: {
573
+ display: "flex",
574
+ alignItems: "center",
575
+ gap: tokens.spacing.sm
576
+ },
577
+ children: [/* @__PURE__ */ jsx("span", {
578
+ style: {
579
+ fontWeight: 500,
580
+ fontSize: tokens.typography.fontSize.sm
581
+ },
582
+ children: title
583
+ }), /* @__PURE__ */ jsxs("div", {
584
+ style: {
585
+ display: "flex",
586
+ gap: 10,
587
+ fontSize: tokens.typography.fontSize.xxs,
588
+ color: tokens.colors.text.muted
589
+ },
590
+ children: [
591
+ /* @__PURE__ */ jsxs("span", { children: ["Scheduled ", stats.scheduled] }),
592
+ /* @__PURE__ */ jsxs("span", {
593
+ style: { color: tokens.colors.text.secondary },
594
+ children: ["Running ", stats.running]
595
+ }),
596
+ /* @__PURE__ */ jsxs("span", {
597
+ style: { color: tokens.colors.text.secondary },
598
+ children: ["Completed ", stats.completed]
599
+ }),
600
+ stats.errors > 0 && /* @__PURE__ */ jsxs("span", {
601
+ style: { color: tokens.colors.status.critical },
602
+ children: ["Errors ", stats.errors]
603
+ })
604
+ ]
605
+ })]
606
+ }), !readOnly && /* @__PURE__ */ jsx("button", {
607
+ onClick: () => setShowForm(!showForm),
608
+ style: {
609
+ background: showForm ? tokens.colors.status.critical + "22" : tokens.colors.interactive.default,
610
+ color: showForm ? tokens.colors.status.critical : tokens.colors.text.inverse,
611
+ border: "none",
612
+ borderRadius: tokens.borderRadius.md,
613
+ padding: "3px 10px",
614
+ fontSize: tokens.typography.fontSize.xs,
615
+ fontWeight: 500,
616
+ cursor: "pointer",
617
+ transition: "all 150ms ease"
618
+ },
619
+ children: showForm ? "✕ Cancel" : "+ New Activity"
620
+ })]
621
+ }),
622
+ showForm && !readOnly && /* @__PURE__ */ jsx("div", {
623
+ style: {
624
+ borderBottom: `1px solid ${tokens.colors.border.muted}`,
625
+ background: tokens.colors.background.surface + "88"
626
+ },
627
+ children: /* @__PURE__ */ jsx(ActivityForm, {
628
+ timelines,
629
+ selectedDate,
630
+ tokens,
631
+ onSubmit: handleCreate,
632
+ onCancel: () => setShowForm(false)
633
+ })
634
+ }),
635
+ /* @__PURE__ */ jsxs("div", {
636
+ style: {
637
+ padding: `${tokens.spacing.xs}px ${panelPadX}px`,
638
+ display: "flex",
639
+ gap: 6,
640
+ alignItems: "center",
641
+ borderBottom: `1px solid ${tokens.colors.border.muted}`
642
+ },
643
+ children: [/* @__PURE__ */ jsx("input", {
644
+ value: filter,
645
+ onChange: (e) => setFilter(e.target.value),
646
+ "aria-label": "Search activities",
647
+ placeholder: "Search activities...",
648
+ style: {
649
+ flex: 1,
650
+ background: tokens.colors.background.surface,
651
+ color: tokens.colors.text.primary,
652
+ border: `1px solid ${tokens.colors.border.muted}`,
653
+ borderRadius: tokens.borderRadius.md,
654
+ padding: "3px 8px",
655
+ fontSize: tokens.typography.fontSize.xxs,
656
+ fontFamily: tokens.typography.fontFamily.primary,
657
+ transition: "all 150ms ease"
658
+ }
659
+ }), /* @__PURE__ */ jsxs("select", {
660
+ value: sortBy,
661
+ onChange: (e) => setSortBy(e.target.value),
662
+ "aria-label": "Sort activities",
663
+ style: {
664
+ background: tokens.colors.background.surface,
665
+ color: tokens.colors.text.secondary,
666
+ border: `1px solid ${tokens.colors.border.muted}`,
667
+ borderRadius: tokens.borderRadius.md,
668
+ padding: "3px 6px",
669
+ fontSize: tokens.typography.fontSize.xxs,
670
+ transition: "all 150ms ease"
671
+ },
672
+ children: [
673
+ /* @__PURE__ */ jsx("option", {
674
+ value: "time",
675
+ children: "Sort: Time"
676
+ }),
677
+ /* @__PURE__ */ jsx("option", {
678
+ value: "status",
679
+ children: "Sort: Status"
680
+ }),
681
+ /* @__PURE__ */ jsx("option", {
682
+ value: "timeline",
683
+ children: "Sort: Timeline"
684
+ })
685
+ ]
686
+ })]
687
+ }),
688
+ /* @__PURE__ */ jsx("div", {
689
+ ref: listRef,
690
+ style: {
691
+ flex: 1,
692
+ overflow: "auto",
693
+ padding: 8
694
+ },
695
+ children: displayActivities.length === 0 ? /* @__PURE__ */ jsx("div", {
696
+ style: {
697
+ textAlign: "center",
698
+ color: tokens.colors.text.muted,
699
+ padding: 40,
700
+ fontSize: tokens.typography.fontSize.xs
701
+ },
702
+ children: filter ? "No matching activities" : "No activities scheduled"
703
+ }) : /* @__PURE__ */ jsx("div", {
704
+ style: {
705
+ display: "flex",
706
+ flexDirection: "column",
707
+ gap: 4
708
+ },
709
+ children: displayActivities.map((a) => {
710
+ const color = a.color || getStatusColor(a.status, tokens);
711
+ const hasOverlap = overlaps.has(a.id);
712
+ return /* @__PURE__ */ jsxs("div", {
713
+ style: {
714
+ display: "grid",
715
+ gridTemplateColumns: "24px 1fr auto",
716
+ alignItems: "center",
717
+ gap: tokens.spacing.sm,
718
+ padding: "6px 10px",
719
+ background: hasOverlap ? `${tokens.colors.status.caution}10` : `${color}08`,
720
+ borderLeft: `3px solid ${color}`,
721
+ borderRadius: tokens.borderRadius.md,
722
+ fontSize: tokens.typography.fontSize.xs,
723
+ cursor: "pointer",
724
+ border: hasOverlap && showOverlapWarning ? `1px solid ${tokens.colors.status.caution}44` : void 0,
725
+ transition: "all 150ms ease"
726
+ },
727
+ children: [
728
+ /* @__PURE__ */ jsx("div", {
729
+ style: { textAlign: "center" },
730
+ children: /* @__PURE__ */ jsx("span", {
731
+ style: {
732
+ color,
733
+ fontSize: tokens.typography.fontSize.sm,
734
+ fontWeight: 500
735
+ },
736
+ children: getStatusIcon(a.status)
737
+ })
738
+ }),
739
+ /* @__PURE__ */ jsxs("div", {
740
+ style: { overflow: "hidden" },
741
+ children: [/* @__PURE__ */ jsxs("div", {
742
+ style: {
743
+ display: "flex",
744
+ alignItems: "center",
745
+ gap: 6,
746
+ marginBottom: 2
747
+ },
748
+ children: [
749
+ /* @__PURE__ */ jsx("span", {
750
+ style: {
751
+ fontWeight: 500,
752
+ overflow: "hidden",
753
+ textOverflow: "ellipsis",
754
+ whiteSpace: "nowrap"
755
+ },
756
+ children: a.title
757
+ }),
758
+ a.timeline && /* @__PURE__ */ jsx("span", {
759
+ style: {
760
+ fontSize: tokens.typography.fontSize.micro,
761
+ background: tokens.colors.background.surface,
762
+ padding: `0 ${tokens.spacing.xs}px`,
763
+ borderRadius: tokens.borderRadius.sm,
764
+ color: tokens.colors.text.muted
765
+ },
766
+ children: a.timeline
767
+ }),
768
+ hasOverlap && showOverlapWarning && /* @__PURE__ */ jsx("span", {
769
+ style: {
770
+ fontSize: tokens.typography.fontSize.micro,
771
+ color: tokens.colors.status.caution,
772
+ fontWeight: 500
773
+ },
774
+ children: "⚠ OVERLAP"
775
+ })
776
+ ]
777
+ }), /* @__PURE__ */ jsxs("div", {
778
+ style: {
779
+ fontSize: tokens.typography.fontSize.micro,
780
+ fontFamily: tokens.typography.fontFamily.mono,
781
+ color: tokens.colors.text.muted
782
+ },
783
+ children: [
784
+ formatDate(a.start),
785
+ " ",
786
+ formatTime(a.start),
787
+ a.end ? ` → ${formatTime(a.end)}` : ""
788
+ ]
789
+ })]
790
+ }),
791
+ /* @__PURE__ */ jsxs("div", {
792
+ style: {
793
+ display: "flex",
794
+ gap: 4
795
+ },
796
+ children: [
797
+ onViewInCalendar && /* @__PURE__ */ jsx("button", {
798
+ "aria-label": `View ${a.title} in calendar`,
799
+ onClick: () => onViewInCalendar(a),
800
+ style: actionBtnStyle(tokens),
801
+ title: "View in Calendar",
802
+ children: "Calendar"
803
+ }),
804
+ onViewInTimeline && /* @__PURE__ */ jsx("button", {
805
+ "aria-label": `View ${a.title} in timeline`,
806
+ onClick: () => onViewInTimeline(a),
807
+ style: actionBtnStyle(tokens),
808
+ title: "View in Timeline",
809
+ children: "Timeline"
810
+ }),
811
+ !readOnly && onActivityDelete && /* @__PURE__ */ jsx("button", {
812
+ "aria-label": `Delete ${a.title}`,
813
+ onClick: () => onActivityDelete(a.id),
814
+ style: {
815
+ ...actionBtnStyle(tokens),
816
+ color: tokens.colors.status.critical
817
+ },
818
+ title: "Delete",
819
+ children: "Delete"
820
+ })
821
+ ]
822
+ })
823
+ ]
824
+ }, a.id);
825
+ })
826
+ })
827
+ }),
828
+ /* @__PURE__ */ jsxs("div", {
829
+ style: {
830
+ padding: `${tokens.spacing.xs}px ${panelPadX}px`,
831
+ borderTop: `1px solid ${tokens.colors.border.muted}`,
832
+ background: tokens.colors.background.surface,
833
+ fontSize: tokens.typography.fontSize.micro,
834
+ color: tokens.colors.text.muted,
835
+ display: "flex",
836
+ justifyContent: "space-between"
837
+ },
838
+ children: [/* @__PURE__ */ jsxs("span", { children: [
839
+ displayActivities.length,
840
+ " / ",
841
+ activities.length,
842
+ " activities"
843
+ ] }), overlaps.size > 0 && showOverlapWarning && /* @__PURE__ */ jsxs("span", {
844
+ style: { color: tokens.colors.status.caution },
845
+ children: [
846
+ "⚠ ",
847
+ overlaps.size,
848
+ " overlapping activities"
849
+ ]
850
+ })]
851
+ })
852
+ ]
853
+ });
516
854
  });
517
855
  function actionBtnStyle(tokens) {
518
- return {
519
- background: "transparent",
520
- border: `1px solid ${tokens.colors.border.muted}`,
521
- borderRadius: tokens.borderRadius.sm,
522
- padding: `2px ${tokens.spacing.xs}px`,
523
- fontSize: tokens.typography.fontSize.xxs,
524
- cursor: "pointer",
525
- lineHeight: 1,
526
- transition: "all 150ms ease"
527
- };
856
+ return {
857
+ background: "transparent",
858
+ border: `1px solid ${tokens.colors.border.muted}`,
859
+ borderRadius: tokens.borderRadius.sm,
860
+ padding: `2px ${tokens.spacing.xs}px`,
861
+ fontSize: tokens.typography.fontSize.xxs,
862
+ cursor: "pointer",
863
+ lineHeight: 1,
864
+ transition: "all 150ms ease"
865
+ };
528
866
  }
529
- export {
530
- ActivityPlanner
531
- };
532
- //# sourceMappingURL=ActivityPlanner.js.map
867
+ //#endregion
868
+ export { ActivityPlanner, ActivityPlanner as default };
869
+
870
+ //# sourceMappingURL=ActivityPlanner.js.map