@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.
- package/CHANGELOG.md +419 -386
- package/README.md +640 -631
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/index.js +17 -221
- package/dist/react/3d/CesiumCaptureSource.d.ts +0 -1
- package/dist/react/3d/CesiumCaptureSource.js +364 -283
- package/dist/react/3d/CesiumCaptureSource.js.map +1 -1
- package/dist/react/3d/ZenSpace3D.d.ts +2 -3
- package/dist/react/3d/ZenSpace3D.js +1681 -1237
- package/dist/react/3d/ZenSpace3D.js.map +1 -1
- package/dist/react/3d/ZenSpace3DCesium.d.ts +0 -1
- package/dist/react/3d/ZenSpace3DCesium.js +513 -560
- package/dist/react/3d/ZenSpace3DCesium.js.map +1 -1
- package/dist/react/3d/ZenSpace3DShaders.js +61 -66
- package/dist/react/3d/ZenSpace3DShaders.js.map +1 -1
- package/dist/react/3d/ZenSpace3DTypes.d.ts +19 -20
- package/dist/react/3d/ZenSpace3DUtils.d.ts +0 -1
- package/dist/react/3d/ZenSpace3DUtils.js +37 -24
- package/dist/react/3d/ZenSpace3DUtils.js.map +1 -1
- package/dist/react/3d/capturePngAnalysis.js +42 -36
- package/dist/react/3d/capturePngAnalysis.js.map +1 -1
- package/dist/react/3d/index.d.ts +3 -3
- package/dist/react/3d/index.js +5 -53
- package/dist/react/3d/threeLoader.d.ts +1 -1
- package/dist/react/3d/threeLoader.js +23 -18
- package/dist/react/3d/threeLoader.js.map +1 -1
- package/dist/react/astro/ClassificationBanner.d.ts +2 -3
- package/dist/react/astro/ClassificationBanner.js +95 -79
- package/dist/react/astro/ClassificationBanner.js.map +1 -1
- package/dist/react/astro/GlobalStatusBar.d.ts +0 -1
- package/dist/react/astro/GlobalStatusBar.js +157 -163
- package/dist/react/astro/GlobalStatusBar.js.map +1 -1
- package/dist/react/astro/MissionClock.d.ts +7 -8
- package/dist/react/astro/MissionClock.js +377 -400
- package/dist/react/astro/MissionClock.js.map +1 -1
- package/dist/react/astro/MonitoringIcon.d.ts +1 -2
- package/dist/react/astro/MonitoringIcon.js +422 -358
- package/dist/react/astro/MonitoringIcon.js.map +1 -1
- package/dist/react/astro/Notification.d.ts +1 -2
- package/dist/react/astro/Notification.js +229 -126
- package/dist/react/astro/Notification.js.map +1 -1
- package/dist/react/astro/Progress.d.ts +0 -1
- package/dist/react/astro/Progress.js +199 -141
- package/dist/react/astro/Progress.js.map +1 -1
- package/dist/react/astro/SimulationControls.d.ts +3 -4
- package/dist/react/astro/SimulationControls.js +596 -650
- package/dist/react/astro/SimulationControls.js.map +1 -1
- package/dist/react/astro/StatusIndicator.d.ts +0 -1
- package/dist/react/astro/StatusIndicator.js +236 -170
- package/dist/react/astro/StatusIndicator.js.map +1 -1
- package/dist/react/astro/UnifiedTimeline.d.ts +9 -10
- package/dist/react/astro/UnifiedTimeline.js +2345 -2392
- package/dist/react/astro/UnifiedTimeline.js.map +1 -1
- package/dist/react/astro/index.d.ts +5 -5
- package/dist/react/astro/index.js +1 -25
- package/dist/react/cards/AccessCard.d.ts +0 -1
- package/dist/react/cards/AccessCard.js +471 -405
- package/dist/react/cards/AccessCard.js.map +1 -1
- package/dist/react/cards/OrbitCard.d.ts +0 -1
- package/dist/react/cards/OrbitCard.js +487 -364
- package/dist/react/cards/OrbitCard.js.map +1 -1
- package/dist/react/cards/SpacecraftCard.d.ts +0 -1
- package/dist/react/cards/SpacecraftCard.js +813 -925
- package/dist/react/cards/SpacecraftCard.js.map +1 -1
- package/dist/react/cards/TelemetryCard.d.ts +0 -1
- package/dist/react/cards/TelemetryCard.js +1055 -732
- package/dist/react/cards/TelemetryCard.js.map +1 -1
- package/dist/react/cards/TelemetryStreamCard.d.ts +0 -1
- package/dist/react/cards/TelemetryStreamCard.js +323 -297
- package/dist/react/cards/TelemetryStreamCard.js.map +1 -1
- package/dist/react/cards/index.d.ts +1 -1
- package/dist/react/cards/index.js +1 -8
- package/dist/react/charts/GroundTrackMap.d.ts +6 -7
- package/dist/react/charts/GroundTrackMap.js +1377 -1256
- package/dist/react/charts/GroundTrackMap.js.map +1 -1
- package/dist/react/charts/GroundTrackMapLeaflet.d.ts +1 -2
- package/dist/react/charts/GroundTrackMapLeaflet.js +1065 -987
- package/dist/react/charts/GroundTrackMapLeaflet.js.map +1 -1
- package/dist/react/charts/groundTrackMapLeafletTiles.js +34 -25
- package/dist/react/charts/groundTrackMapLeafletTiles.js.map +1 -1
- package/dist/react/charts/groundTrackMapLeafletUtils.js +70 -61
- package/dist/react/charts/groundTrackMapLeafletUtils.js.map +1 -1
- package/dist/react/charts/index.d.ts +1 -1
- package/dist/react/charts/index.js +7 -100
- package/dist/react/charts/unified/AstroChart.d.ts +1 -2
- package/dist/react/charts/unified/AstroChart.js +1331 -1411
- package/dist/react/charts/unified/AstroChart.js.map +1 -1
- package/dist/react/charts/unified/PowerOverviewChart.d.ts +3 -3
- package/dist/react/charts/unified/PowerOverviewChart.js +495 -478
- package/dist/react/charts/unified/PowerOverviewChart.js.map +1 -1
- package/dist/react/charts/unified/domain.d.ts +12 -13
- package/dist/react/charts/unified/domain.js +3999 -3145
- package/dist/react/charts/unified/domain.js.map +1 -1
- package/dist/react/charts/unified/generators.d.ts +3 -4
- package/dist/react/charts/unified/generators.js +561 -498
- package/dist/react/charts/unified/generators.js.map +1 -1
- package/dist/react/charts/unified/index.d.ts +1 -1
- package/dist/react/charts/unified/presets.d.ts +14 -15
- package/dist/react/charts/unified/presets.js +857 -994
- package/dist/react/charts/unified/presets.js.map +1 -1
- package/dist/react/charts/unified/sync.d.ts +2 -3
- package/dist/react/charts/unified/sync.js +229 -195
- package/dist/react/charts/unified/sync.js.map +1 -1
- package/dist/react/charts/unified/theme.d.ts +11 -12
- package/dist/react/charts/unified/theme.js +606 -642
- package/dist/react/charts/unified/theme.js.map +1 -1
- package/dist/react/charts/unified/types.d.ts +32 -33
- package/dist/react/charts/unified/useChartStream.d.ts +1 -2
- package/dist/react/charts/unified/useChartStream.js +203 -216
- package/dist/react/charts/unified/useChartStream.js.map +1 -1
- package/dist/react/chatgpt/AppCard.d.ts +1 -2
- package/dist/react/chatgpt/index.d.ts +7 -7
- package/dist/react/chatgpt/index.js +160 -139
- package/dist/react/chatgpt/index.js.map +1 -1
- package/dist/react/context/CategoryContext.d.ts +0 -1
- package/dist/react/context/CategoryContext.js +78 -29
- package/dist/react/context/CategoryContext.js.map +1 -1
- package/dist/react/context/DisplaySettingsContext.d.ts +1 -2
- package/dist/react/context/DisplaySettingsContext.js +205 -156
- package/dist/react/context/DisplaySettingsContext.js.map +1 -1
- package/dist/react/context/SpatialSelectionContext.d.ts +0 -1
- package/dist/react/context/SpatialSelectionContext.js +36 -7
- package/dist/react/context/SpatialSelectionContext.js.map +1 -1
- package/dist/react/core/data/DataTable.d.ts +3 -4
- package/dist/react/core/data/DataTable.js +473 -440
- package/dist/react/core/data/DataTable.js.map +1 -1
- package/dist/react/core/data/DataValue.d.ts +4 -5
- package/dist/react/core/data/DataValue.js +605 -571
- package/dist/react/core/data/DataValue.js.map +1 -1
- package/dist/react/core/data/propertyConfig.d.ts +1 -2
- package/dist/react/core/data/propertyConfig.js +446 -382
- package/dist/react/core/data/propertyConfig.js.map +1 -1
- package/dist/react/core/display/AstroIcon.d.ts +4 -5
- package/dist/react/core/display/AstroIcon.js +339 -429
- package/dist/react/core/display/AstroIcon.js.map +1 -1
- package/dist/react/core/display/Badge.d.ts +2 -3
- package/dist/react/core/display/Badge.js +131 -131
- package/dist/react/core/display/Badge.js.map +1 -1
- package/dist/react/core/display/CardHeader.d.ts +0 -1
- package/dist/react/core/display/CardHeader.js +398 -311
- package/dist/react/core/display/CardHeader.js.map +1 -1
- package/dist/react/core/display/Container.d.ts +2 -3
- package/dist/react/core/display/Container.js +640 -668
- package/dist/react/core/display/Container.js.map +1 -1
- package/dist/react/core/display/CopyButton.d.ts +1 -2
- package/dist/react/core/display/CopyButton.js +158 -101
- package/dist/react/core/display/CopyButton.js.map +1 -1
- package/dist/react/core/display/GlassCard.d.ts +3 -4
- package/dist/react/core/display/GlassCard.js +416 -369
- package/dist/react/core/display/GlassCard.js.map +1 -1
- package/dist/react/core/display/HeaderIconWithStatus.d.ts +0 -1
- package/dist/react/core/display/HeaderIconWithStatus.js +152 -152
- package/dist/react/core/display/HeaderIconWithStatus.js.map +1 -1
- package/dist/react/core/display/Icon.d.ts +2 -3
- package/dist/react/core/display/Icon.js +172 -143
- package/dist/react/core/display/Icon.js.map +1 -1
- package/dist/react/core/display/Typography.d.ts +24 -25
- package/dist/react/core/display/Typography.js +360 -178
- package/dist/react/core/display/Typography.js.map +1 -1
- package/dist/react/core/feedback/ConfirmDialog.d.ts +1 -2
- package/dist/react/core/feedback/ConfirmDialog.js +343 -304
- package/dist/react/core/feedback/ConfirmDialog.js.map +1 -1
- package/dist/react/core/feedback/Dialog.d.ts +2 -3
- package/dist/react/core/feedback/Dialog.js +189 -197
- package/dist/react/core/feedback/Dialog.js.map +1 -1
- package/dist/react/core/feedback/Toast.d.ts +2 -3
- package/dist/react/core/feedback/Toast.js +346 -207
- package/dist/react/core/feedback/Toast.js.map +1 -1
- package/dist/react/core/index.d.ts +26 -26
- package/dist/react/core/index.js +7 -119
- package/dist/react/core/inputs/Button.d.ts +2 -3
- package/dist/react/core/inputs/Button.js +281 -304
- package/dist/react/core/inputs/Button.js.map +1 -1
- package/dist/react/core/inputs/Checkbox.d.ts +2 -3
- package/dist/react/core/inputs/Checkbox.js +139 -127
- package/dist/react/core/inputs/Checkbox.js.map +1 -1
- package/dist/react/core/inputs/Input.d.ts +3 -4
- package/dist/react/core/inputs/Input.js +277 -285
- package/dist/react/core/inputs/Input.js.map +1 -1
- package/dist/react/core/inputs/LimitsBar.d.ts +1 -2
- package/dist/react/core/inputs/LimitsBar.js +271 -196
- package/dist/react/core/inputs/LimitsBar.js.map +1 -1
- package/dist/react/core/inputs/NumberInput.d.ts +2 -3
- package/dist/react/core/inputs/NumberInput.js +531 -503
- package/dist/react/core/inputs/NumberInput.js.map +1 -1
- package/dist/react/core/inputs/PinInput.d.ts +2 -3
- package/dist/react/core/inputs/PinInput.js +224 -207
- package/dist/react/core/inputs/PinInput.js.map +1 -1
- package/dist/react/core/inputs/Select.d.ts +1 -2
- package/dist/react/core/inputs/Select.js +298 -299
- package/dist/react/core/inputs/Select.js.map +1 -1
- package/dist/react/core/inputs/Toggle.d.ts +2 -3
- package/dist/react/core/inputs/Toggle.js +142 -148
- package/dist/react/core/inputs/Toggle.js.map +1 -1
- package/dist/react/core/layout/Box.d.ts +3 -4
- package/dist/react/core/layout/Box.js +118 -122
- package/dist/react/core/layout/Box.js.map +1 -1
- package/dist/react/core/layout/Center.d.ts +0 -1
- package/dist/react/core/layout/Center.js +45 -32
- package/dist/react/core/layout/Center.js.map +1 -1
- package/dist/react/core/layout/Divider.d.ts +1 -2
- package/dist/react/core/layout/Divider.js +112 -106
- package/dist/react/core/layout/Divider.js.map +1 -1
- package/dist/react/core/layout/Flex.d.ts +4 -5
- package/dist/react/core/layout/Flex.js +120 -124
- package/dist/react/core/layout/Flex.js.map +1 -1
- package/dist/react/core/layout/Grid.d.ts +5 -6
- package/dist/react/core/layout/Grid.js +131 -138
- package/dist/react/core/layout/Grid.js.map +1 -1
- package/dist/react/core/layout/Spacer.d.ts +0 -1
- package/dist/react/core/layout/Spacer.js +36 -29
- package/dist/react/core/layout/Spacer.js.map +1 -1
- package/dist/react/core/layout/Stack.d.ts +4 -5
- package/dist/react/core/layout/Stack.js +127 -70
- package/dist/react/core/layout/Stack.js.map +1 -1
- package/dist/react/core/layout/responsive.d.ts +1 -2
- package/dist/react/core/layout/responsive.js +25 -19
- package/dist/react/core/layout/responsive.js.map +1 -1
- package/dist/react/core/layout/useBreakpoint.d.ts +1 -1
- package/dist/react/core/layout/useBreakpoint.js +119 -66
- package/dist/react/core/layout/useBreakpoint.js.map +1 -1
- package/dist/react/core/navigation/AppBar.d.ts +1 -2
- package/dist/react/core/navigation/AppBar.js +827 -805
- package/dist/react/core/navigation/AppBar.js.map +1 -1
- package/dist/react/core/navigation/Pagination.d.ts +2 -3
- package/dist/react/core/navigation/Pagination.js +207 -187
- package/dist/react/core/navigation/Pagination.js.map +1 -1
- package/dist/react/core/navigation/SideNav.d.ts +5 -6
- package/dist/react/core/navigation/SideNav.js +855 -629
- package/dist/react/core/navigation/SideNav.js.map +1 -1
- package/dist/react/core/navigation/Tabs.d.ts +0 -1
- package/dist/react/core/navigation/Tabs.js +113 -119
- package/dist/react/core/navigation/Tabs.js.map +1 -1
- package/dist/react/core/overlays/Popover.d.ts +2 -3
- package/dist/react/core/overlays/Popover.js +303 -282
- package/dist/react/core/overlays/Popover.js.map +1 -1
- package/dist/react/core/overlays/SidePanel.d.ts +1 -2
- package/dist/react/core/overlays/SidePanel.js +217 -212
- package/dist/react/core/overlays/SidePanel.js.map +1 -1
- package/dist/react/core/overlays/Tooltip.d.ts +1 -2
- package/dist/react/core/overlays/Tooltip.js +170 -176
- package/dist/react/core/overlays/Tooltip.js.map +1 -1
- package/dist/react/core/widgets/ActivityPlanner.d.ts +0 -1
- package/dist/react/core/widgets/ActivityPlanner.js +855 -517
- package/dist/react/core/widgets/ActivityPlanner.js.map +1 -1
- package/dist/react/core/widgets/Capture.d.ts +2 -3
- package/dist/react/core/widgets/Capture.js +965 -779
- package/dist/react/core/widgets/Capture.js.map +1 -1
- package/dist/react/core/widgets/ChatPanel.d.ts +16 -17
- package/dist/react/core/widgets/ChatPanel.js +1734 -1034
- package/dist/react/core/widgets/ChatPanel.js.map +1 -1
- package/dist/react/core/widgets/ColorPickerPanel.d.ts +0 -1
- package/dist/react/core/widgets/ColorPickerPanel.js +298 -287
- package/dist/react/core/widgets/ColorPickerPanel.js.map +1 -1
- package/dist/react/core/widgets/CommandBuilder.d.ts +2 -3
- package/dist/react/core/widgets/CommandBuilder.js +624 -516
- package/dist/react/core/widgets/CommandBuilder.js.map +1 -1
- package/dist/react/core/widgets/ConnectionForm.d.ts +2 -3
- package/dist/react/core/widgets/ConnectionForm.js +528 -492
- package/dist/react/core/widgets/ConnectionForm.js.map +1 -1
- package/dist/react/core/widgets/FileExplorer.d.ts +3 -4
- package/dist/react/core/widgets/FileExplorer.js +617 -505
- package/dist/react/core/widgets/FileExplorer.js.map +1 -1
- package/dist/react/core/widgets/HexViewer.d.ts +2 -3
- package/dist/react/core/widgets/HexViewer.js +1353 -1091
- package/dist/react/core/widgets/HexViewer.js.map +1 -1
- package/dist/react/core/widgets/ImageFrame.d.ts +1 -2
- package/dist/react/core/widgets/ImageFrame.js +230 -193
- package/dist/react/core/widgets/ImageFrame.js.map +1 -1
- package/dist/react/core/widgets/ImageGallery.d.ts +2 -1
- package/dist/react/core/widgets/ImageGallery.js +380 -314
- package/dist/react/core/widgets/ImageGallery.js.map +1 -1
- package/dist/react/core/widgets/ImagePanel.d.ts +0 -1
- package/dist/react/core/widgets/ImagePanel.js +110 -101
- package/dist/react/core/widgets/ImagePanel.js.map +1 -1
- package/dist/react/core/widgets/LogViewer.d.ts +2 -3
- package/dist/react/core/widgets/LogViewer.js +711 -607
- package/dist/react/core/widgets/LogViewer.js.map +1 -1
- package/dist/react/core/widgets/MessageStream.d.ts +3 -4
- package/dist/react/core/widgets/MessageStream.js +514 -444
- package/dist/react/core/widgets/MessageStream.js.map +1 -1
- package/dist/react/core/widgets/MissionCalendar.d.ts +3 -4
- package/dist/react/core/widgets/MissionCalendar.js +1488 -1020
- package/dist/react/core/widgets/MissionCalendar.js.map +1 -1
- package/dist/react/core/widgets/PacketViewer.d.ts +2 -3
- package/dist/react/core/widgets/PacketViewer.js +550 -421
- package/dist/react/core/widgets/PacketViewer.js.map +1 -1
- package/dist/react/core/widgets/capture-placeholder.png.js +6 -5
- package/dist/react/core/widgets/capture-placeholder.png.js.map +1 -1
- package/dist/react/hooks/index.d.ts +5 -5
- package/dist/react/hooks/useAccessWindows.d.ts +0 -1
- package/dist/react/hooks/useCompactMode.d.ts +1 -1
- package/dist/react/hooks/useCompactMode.js +104 -58
- package/dist/react/hooks/useCompactMode.js.map +1 -1
- package/dist/react/hooks/useGroundTrackHistory.d.ts +0 -1
- package/dist/react/hooks/useSimulationScene.d.ts +1 -2
- package/dist/react/hooks/useSimulationScene.js +481 -374
- package/dist/react/hooks/useSimulationScene.js.map +1 -1
- package/dist/react/index.d.ts +3 -3
- package/dist/react/panels/LayerControlPanel.d.ts +1 -2
- package/dist/react/panels/LayerControlPanel.js +223 -180
- package/dist/react/panels/LayerControlPanel.js.map +1 -1
- package/dist/react/panels/ObjectInventoryPanel.d.ts +2 -3
- package/dist/react/panels/ObjectInventoryPanel.js +315 -250
- package/dist/react/panels/ObjectInventoryPanel.js.map +1 -1
- package/dist/react/panels/index.d.ts +1 -1
- package/dist/react/panels/index.js +1 -6
- package/dist/react/shared/ErrorBoundary.d.ts +1 -2
- package/dist/react/shared/ErrorBoundary.js +170 -139
- package/dist/react/shared/ErrorBoundary.js.map +1 -1
- package/dist/react/shared/Skeleton.d.ts +1 -2
- package/dist/react/shared/Skeleton.js +300 -301
- package/dist/react/shared/Skeleton.js.map +1 -1
- package/dist/react/theme/ThemeProvider.d.ts +2 -321
- package/dist/react/theme/ThemeProvider.js +313 -939
- package/dist/react/theme/ThemeProvider.js.map +1 -1
- package/dist/react/theme/cardAccent.d.ts +1 -2
- package/dist/react/theme/cardAccent.js +196 -126
- package/dist/react/theme/cardAccent.js.map +1 -1
- package/dist/react/theme/config.d.ts +0 -1
- package/dist/react/theme/config.js +47 -25
- package/dist/react/theme/config.js.map +1 -1
- package/dist/react/theme/index.d.ts +2 -2
- package/dist/react/theme/index.js +1 -16
- package/dist/react/theme/types.d.ts +332 -0
- package/dist/react/theme/types.js +39 -0
- package/dist/react/theme/types.js.map +1 -0
- package/dist/react/types.d.ts +8 -8
- package/dist/react/types.js +147 -47
- package/dist/react/types.js.map +1 -1
- package/dist/react/utils/categoryPalette.d.ts +0 -1
- package/dist/react/utils/categoryPalette.js +91 -102
- package/dist/react/utils/categoryPalette.js.map +1 -1
- package/dist/react/utils/index.d.ts +5 -5
- package/dist/react/utils/index.js +457 -371
- package/dist/react/utils/index.js.map +1 -1
- package/dist/react/visualizations/EclipseTimerCard.d.ts +0 -1
- package/dist/react/visualizations/LinkBudgetCard.d.ts +0 -1
- package/dist/react/visualizations/NavBallCard.d.ts +0 -1
- package/dist/react/visualizations/PropulsionCard.d.ts +1 -2
- package/dist/react/visualizations/SensorFootprintCard.d.ts +1 -2
- package/dist/react/visualizations/ThermalHeatmapCard.d.ts +0 -1
- package/dist/react/visualizations/index.d.ts +3 -3
- package/dist/react.d.ts +2 -1
- package/dist/react.js +17 -221
- package/dist/shaders/atmosphere.frag.js +6 -5
- package/dist/shaders/atmosphere.frag.js.map +1 -1
- package/dist/shaders/atmosphere.vert.js +6 -5
- package/dist/shaders/atmosphere.vert.js.map +1 -1
- package/dist/shaders/stars.frag.js +6 -5
- package/dist/shaders/stars.frag.js.map +1 -1
- package/dist/shaders/stars.vert.js +6 -5
- package/dist/shaders/stars.vert.js.map +1 -1
- package/dist/style.css +26 -3
- package/dist/tokens/core.d.ts +159 -0
- package/dist/tokens/core.js +144 -0
- package/dist/tokens/core.js.map +1 -0
- package/dist/tokens/css-vars.d.ts +213 -2
- package/dist/tokens/css-vars.js +590 -227
- package/dist/tokens/css-vars.js.map +1 -1
- package/dist/tokens/index.d.ts +31 -228
- package/dist/tokens/index.js +281 -366
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/palettes/astro.d.ts +129 -0
- package/dist/tokens/palettes/astro.js +112 -0
- package/dist/tokens/palettes/astro.js.map +1 -0
- package/dist/tokens/palettes/index.d.ts +288 -0
- package/dist/tokens/palettes/index.js +35 -0
- package/dist/tokens/palettes/index.js.map +1 -0
- package/dist/tokens/palettes/tailwind.d.ts +324 -0
- package/dist/tokens/palettes/tailwind.js +201 -0
- package/dist/tokens/palettes/tailwind.js.map +1 -0
- package/dist/tokens/palettes/zendir.d.ts +126 -0
- package/dist/tokens/palettes/zendir.js +92 -0
- package/dist/tokens/palettes/zendir.js.map +1 -0
- package/dist/tokens/themes.d.ts +30 -0
- package/dist/tokens/themes.js +704 -0
- package/dist/tokens/themes.js.map +1 -0
- package/dist/tokens/tokens.css +533 -155
- package/dist/types/index.d.ts +2 -2
- package/package.json +310 -313
- package/dist/index.js.map +0 -1
- package/dist/react/3d/index.js.map +0 -1
- package/dist/react/astro/index.js.map +0 -1
- package/dist/react/cards/index.js.map +0 -1
- package/dist/react/charts/index.js.map +0 -1
- package/dist/react/core/index.js.map +0 -1
- package/dist/react/panels/index.js.map +0 -1
- package/dist/react/theme/astro-tokens.d.ts +0 -153
- package/dist/react/theme/index.js.map +0 -1
- 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 {
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
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
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
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
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
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
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
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
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
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
|