@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,668 +1,614 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { memo, useMemo, useCallback, useState } from "react";
|
|
3
1
|
import { useTheme } from "../theme/ThemeProvider.js";
|
|
4
|
-
import {
|
|
5
|
-
import { AstroIcon } from "../core/display/AstroIcon.js";
|
|
2
|
+
import { classNames, safeAccentText, tabularNumsStyle } from "../utils/index.js";
|
|
6
3
|
import { Tooltip } from "../core/overlays/Tooltip.js";
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { AstroIcon } from "../core/display/AstroIcon.js";
|
|
5
|
+
import { memo, useCallback, useMemo, useState } from "react";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/react/astro/SimulationControls.tsx
|
|
8
|
+
/**
|
|
9
|
+
* @zendir/ui - SimulationControls Component
|
|
10
|
+
*
|
|
11
|
+
* Space operations simulation playback controls following Astro UX patterns.
|
|
12
|
+
* Provides play/pause/stop/step controls for simulation time management.
|
|
13
|
+
*
|
|
14
|
+
* Features:
|
|
15
|
+
* - Play/Pause toggle with visual state feedback
|
|
16
|
+
* - Stop (reset) functionality
|
|
17
|
+
* - Step forward/backward controls
|
|
18
|
+
* - Time scale (playback rate) adjustment
|
|
19
|
+
* - Simulation time display integration
|
|
20
|
+
* - AOS/LOS timer integration
|
|
21
|
+
* - Keyboard accessibility
|
|
22
|
+
* - AstroUXDS compliant styling
|
|
23
|
+
*
|
|
24
|
+
* Space Operations Terminology:
|
|
25
|
+
* - SIM: Simulation mode indicator
|
|
26
|
+
* - MET: Mission Elapsed Time
|
|
27
|
+
* - Epoch: Simulation start time (t=0)
|
|
28
|
+
* - Time Scale: Playback speed multiplier
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* import { SimulationControls } from '@zendir/ui/react';
|
|
33
|
+
*
|
|
34
|
+
* <SimulationControls
|
|
35
|
+
* isPlaying={isPlaying}
|
|
36
|
+
* onPlay={handlePlay}
|
|
37
|
+
* onPause={handlePause}
|
|
38
|
+
* onStop={handleStop}
|
|
39
|
+
* timeScale={1}
|
|
40
|
+
* onTimeScaleChange={setTimeScale}
|
|
41
|
+
* currentTime={simulationTime}
|
|
42
|
+
* epoch={epoch}
|
|
43
|
+
* />
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
var DEFAULT_TIME_SCALE_PRESETS = [
|
|
47
|
+
.1,
|
|
48
|
+
.25,
|
|
49
|
+
.5,
|
|
50
|
+
1,
|
|
51
|
+
2,
|
|
52
|
+
5,
|
|
53
|
+
10,
|
|
54
|
+
60,
|
|
55
|
+
3600
|
|
56
|
+
];
|
|
57
|
+
var DEFAULT_STEP_SIZE_PRESETS = [
|
|
58
|
+
1,
|
|
59
|
+
5,
|
|
60
|
+
10,
|
|
61
|
+
30,
|
|
62
|
+
60,
|
|
63
|
+
300,
|
|
64
|
+
600,
|
|
65
|
+
3600
|
|
66
|
+
];
|
|
67
|
+
/**
|
|
68
|
+
* Format elapsed time as DD:HH:MM:SS
|
|
69
|
+
*/
|
|
9
70
|
function formatElapsedTime(seconds) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
return `${sign}${hours.toString().padStart(2, "0")}:${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
|
|
71
|
+
const absSeconds = Math.abs(seconds);
|
|
72
|
+
const days = Math.floor(absSeconds / 86400);
|
|
73
|
+
const hours = Math.floor(absSeconds % 86400 / 3600);
|
|
74
|
+
const mins = Math.floor(absSeconds % 3600 / 60);
|
|
75
|
+
const secs = Math.floor(absSeconds % 60);
|
|
76
|
+
const sign = seconds < 0 ? "-" : "";
|
|
77
|
+
if (days > 0) return `${sign}${days}:${hours.toString().padStart(2, "0")}:${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
|
|
78
|
+
return `${sign}${hours.toString().padStart(2, "0")}:${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
|
|
20
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Format time scale for display
|
|
82
|
+
*/
|
|
21
83
|
function formatTimeScale(scale) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
84
|
+
if (scale >= 3600) return `${scale / 3600}h/s`;
|
|
85
|
+
if (scale >= 60) return `${scale / 60}m/s`;
|
|
86
|
+
if (scale === 1) return "1×";
|
|
87
|
+
if (scale < 1) return `${scale}×`;
|
|
88
|
+
return `${scale}×`;
|
|
27
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Format step size for display
|
|
92
|
+
*/
|
|
28
93
|
function formatStepSize(seconds) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
94
|
+
if (seconds >= 3600) return `${seconds / 3600}h`;
|
|
95
|
+
if (seconds >= 60) return `${seconds / 60}m`;
|
|
96
|
+
return `${seconds}s`;
|
|
32
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Format time for display
|
|
100
|
+
*/
|
|
33
101
|
function formatTimeDisplay(date) {
|
|
34
|
-
|
|
35
|
-
const mins = date.getUTCMinutes().toString().padStart(2, "0");
|
|
36
|
-
const secs = date.getUTCSeconds().toString().padStart(2, "0");
|
|
37
|
-
return `${hours}:${mins}:${secs}`;
|
|
102
|
+
return `${date.getUTCHours().toString().padStart(2, "0")}:${date.getUTCMinutes().toString().padStart(2, "0")}:${date.getUTCSeconds().toString().padStart(2, "0")}`;
|
|
38
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* Format date for display
|
|
106
|
+
*/
|
|
39
107
|
function formatDateDisplay(date) {
|
|
40
|
-
|
|
41
|
-
const month = (date.getUTCMonth() + 1).toString().padStart(2, "0");
|
|
42
|
-
const day = date.getUTCDate().toString().padStart(2, "0");
|
|
43
|
-
return `${year}-${month}-${day}`;
|
|
108
|
+
return `${date.getUTCFullYear()}-${(date.getUTCMonth() + 1).toString().padStart(2, "0")}-${date.getUTCDate().toString().padStart(2, "0")}`;
|
|
44
109
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
onMouseLeave: (e) => {
|
|
86
|
-
if (!disabled) {
|
|
87
|
-
e.currentTarget.style.backgroundColor = bgColor;
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
children: /* @__PURE__ */ jsx(
|
|
91
|
-
AstroIcon,
|
|
92
|
-
{
|
|
93
|
-
name: icon,
|
|
94
|
-
size: iconSize,
|
|
95
|
-
color: disabled ? tokens.colors.text.tertiary : baseColor
|
|
96
|
-
}
|
|
97
|
-
)
|
|
98
|
-
}
|
|
99
|
-
) });
|
|
110
|
+
var ControlButton = memo(function ControlButton({ icon, label, onClick, active = false, disabled = false, danger = false, tokens, small = false }) {
|
|
111
|
+
const size = small ? 28 : 32;
|
|
112
|
+
const iconSize = small ? 14 : 16;
|
|
113
|
+
const baseColor = danger ? tokens.colors.status.critical : active ? tokens.colors.status.normal : tokens.colors.text.primary;
|
|
114
|
+
const bgColor = active ? `${tokens.colors.status.normal}25` : "rgba(255,255,255,0.14)";
|
|
115
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
116
|
+
content: label,
|
|
117
|
+
placement: "bottom",
|
|
118
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
119
|
+
onClick,
|
|
120
|
+
disabled,
|
|
121
|
+
"aria-label": label,
|
|
122
|
+
style: {
|
|
123
|
+
display: "flex",
|
|
124
|
+
alignItems: "center",
|
|
125
|
+
justifyContent: "center",
|
|
126
|
+
width: size,
|
|
127
|
+
height: size,
|
|
128
|
+
padding: 0,
|
|
129
|
+
border: "none",
|
|
130
|
+
borderRadius: tokens.borderRadius.md,
|
|
131
|
+
backgroundColor: disabled ? "rgba(255,255,255,0.06)" : bgColor,
|
|
132
|
+
color: disabled ? tokens.colors.text.tertiary : baseColor,
|
|
133
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
134
|
+
transition: "all 0.15s ease",
|
|
135
|
+
opacity: disabled ? .5 : 1
|
|
136
|
+
},
|
|
137
|
+
onMouseEnter: (e) => {
|
|
138
|
+
if (!disabled) e.currentTarget.style.backgroundColor = active ? `${tokens.colors.status.normal}35` : "rgba(255,255,255,0.22)";
|
|
139
|
+
},
|
|
140
|
+
onMouseLeave: (e) => {
|
|
141
|
+
if (!disabled) e.currentTarget.style.backgroundColor = bgColor;
|
|
142
|
+
},
|
|
143
|
+
children: /* @__PURE__ */ jsx(AstroIcon, {
|
|
144
|
+
name: icon,
|
|
145
|
+
size: iconSize,
|
|
146
|
+
color: disabled ? tokens.colors.text.tertiary : baseColor
|
|
147
|
+
})
|
|
148
|
+
})
|
|
149
|
+
});
|
|
100
150
|
});
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
fontWeight: value === scale ? 500 : 400,
|
|
188
|
-
// AstroUXDS: 500 (medium) not 600
|
|
189
|
-
fontFamily: tokens.typography.fontFamily.mono,
|
|
190
|
-
textAlign: "center",
|
|
191
|
-
cursor: "pointer",
|
|
192
|
-
transition: "all 0.1s ease",
|
|
193
|
-
...tabularNumsStyle
|
|
194
|
-
},
|
|
195
|
-
onMouseEnter: (e) => {
|
|
196
|
-
if (value !== scale) {
|
|
197
|
-
e.currentTarget.style.backgroundColor = "rgba(255,255,255,0.1)";
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
onMouseLeave: (e) => {
|
|
201
|
-
e.currentTarget.style.backgroundColor = value === scale ? tokens.colors.accent.primary : "transparent";
|
|
202
|
-
},
|
|
203
|
-
children: formatTimeScale(scale)
|
|
204
|
-
},
|
|
205
|
-
scale
|
|
206
|
-
))
|
|
207
|
-
}
|
|
208
|
-
)
|
|
209
|
-
] })
|
|
210
|
-
] });
|
|
151
|
+
var TimeScaleSelector = memo(function TimeScaleSelector({ value, presets, onChange, disabled = false, tokens, small = false }) {
|
|
152
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
153
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
154
|
+
style: { position: "relative" },
|
|
155
|
+
children: [/* @__PURE__ */ jsx(Tooltip, {
|
|
156
|
+
content: "Time Scale / Playback Speed",
|
|
157
|
+
placement: "bottom",
|
|
158
|
+
children: /* @__PURE__ */ jsxs("button", {
|
|
159
|
+
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
160
|
+
disabled,
|
|
161
|
+
style: {
|
|
162
|
+
display: "flex",
|
|
163
|
+
alignItems: "center",
|
|
164
|
+
gap: 4,
|
|
165
|
+
padding: small ? "4px 8px" : "6px 10px",
|
|
166
|
+
border: "none",
|
|
167
|
+
borderRadius: tokens.borderRadius.sm,
|
|
168
|
+
backgroundColor: "rgba(255,255,255,0.08)",
|
|
169
|
+
color: value !== 1 ? tokens.colors.status.caution : tokens.colors.text.secondary,
|
|
170
|
+
fontSize: small ? tokens.typography.fontSize.xxs : "0.6875rem",
|
|
171
|
+
fontWeight: 700,
|
|
172
|
+
fontFamily: tokens.typography.fontFamily.mono,
|
|
173
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
174
|
+
transition: "all 0.15s ease",
|
|
175
|
+
opacity: disabled ? .5 : 1,
|
|
176
|
+
...tabularNumsStyle
|
|
177
|
+
},
|
|
178
|
+
children: [/* @__PURE__ */ jsx(AstroIcon, {
|
|
179
|
+
name: "fast-forward",
|
|
180
|
+
size: small ? 10 : 12,
|
|
181
|
+
color: "inherit"
|
|
182
|
+
}), formatTimeScale(value)]
|
|
183
|
+
})
|
|
184
|
+
}), isOpen && !disabled && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
185
|
+
style: {
|
|
186
|
+
position: "fixed",
|
|
187
|
+
inset: 0,
|
|
188
|
+
zIndex: 99
|
|
189
|
+
},
|
|
190
|
+
onClick: () => setIsOpen(false)
|
|
191
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
192
|
+
style: {
|
|
193
|
+
position: "absolute",
|
|
194
|
+
top: "100%",
|
|
195
|
+
left: "50%",
|
|
196
|
+
transform: "translateX(-50%)",
|
|
197
|
+
marginTop: 4,
|
|
198
|
+
padding: 4,
|
|
199
|
+
backgroundColor: tokens.colors.background.elevated,
|
|
200
|
+
border: `1px solid ${tokens.colors.border.default}`,
|
|
201
|
+
borderRadius: tokens.borderRadius.md,
|
|
202
|
+
boxShadow: tokens.shadows.lg,
|
|
203
|
+
zIndex: 100,
|
|
204
|
+
minWidth: 80
|
|
205
|
+
},
|
|
206
|
+
children: presets.map((scale) => /* @__PURE__ */ jsx("button", {
|
|
207
|
+
onClick: () => {
|
|
208
|
+
onChange?.(scale);
|
|
209
|
+
setIsOpen(false);
|
|
210
|
+
},
|
|
211
|
+
style: {
|
|
212
|
+
display: "block",
|
|
213
|
+
width: "100%",
|
|
214
|
+
padding: "6px 12px",
|
|
215
|
+
border: "none",
|
|
216
|
+
borderRadius: tokens.borderRadius.sm,
|
|
217
|
+
backgroundColor: value === scale ? tokens.colors.accent.primary : "transparent",
|
|
218
|
+
color: value === scale ? "#ffffff" : tokens.colors.text.secondary,
|
|
219
|
+
fontSize: "0.6875rem",
|
|
220
|
+
fontWeight: value === scale ? 500 : 400,
|
|
221
|
+
fontFamily: tokens.typography.fontFamily.mono,
|
|
222
|
+
textAlign: "center",
|
|
223
|
+
cursor: "pointer",
|
|
224
|
+
transition: "all 0.1s ease",
|
|
225
|
+
...tabularNumsStyle
|
|
226
|
+
},
|
|
227
|
+
onMouseEnter: (e) => {
|
|
228
|
+
if (value !== scale) e.currentTarget.style.backgroundColor = "rgba(255,255,255,0.1)";
|
|
229
|
+
},
|
|
230
|
+
onMouseLeave: (e) => {
|
|
231
|
+
e.currentTarget.style.backgroundColor = value === scale ? tokens.colors.accent.primary : "transparent";
|
|
232
|
+
},
|
|
233
|
+
children: formatTimeScale(scale)
|
|
234
|
+
}, scale))
|
|
235
|
+
})] })]
|
|
236
|
+
});
|
|
211
237
|
});
|
|
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
|
-
/* @__PURE__ */ jsxs(
|
|
276
|
-
"span",
|
|
277
|
-
{
|
|
278
|
-
style: {
|
|
279
|
-
fontSize: tokens.typography.fontSize.xs,
|
|
280
|
-
fontWeight: tokens.typography.fontWeight.medium,
|
|
281
|
-
color: isPlaying ? safeAccentText(tokens.colors.accent.primary) : tokens.colors.status.standby,
|
|
282
|
-
textTransform: "uppercase",
|
|
283
|
-
letterSpacing: tokens.typography.letterSpacing.wide,
|
|
284
|
-
display: "flex",
|
|
285
|
-
alignItems: "center",
|
|
286
|
-
gap: 4
|
|
287
|
-
},
|
|
288
|
-
children: [
|
|
289
|
-
isPlaying && /* @__PURE__ */ jsx(
|
|
290
|
-
"span",
|
|
291
|
-
{
|
|
292
|
-
style: {
|
|
293
|
-
width: 6,
|
|
294
|
-
height: 6,
|
|
295
|
-
borderRadius: "50%",
|
|
296
|
-
backgroundColor: tokens.colors.accent.primary,
|
|
297
|
-
animation: "pulse 1.5s ease-in-out infinite"
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
),
|
|
301
|
-
"SIM"
|
|
302
|
-
]
|
|
303
|
-
}
|
|
304
|
-
)
|
|
305
|
-
]
|
|
306
|
-
}
|
|
307
|
-
);
|
|
238
|
+
var SimulationTimeDisplay = memo(function SimulationTimeDisplay({ currentTime, elapsedSeconds, showElapsed = true, showCurrent = true, showDate = false, isPlaying = false, tokens, small = false }) {
|
|
239
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
240
|
+
style: {
|
|
241
|
+
display: "flex",
|
|
242
|
+
flexDirection: "column",
|
|
243
|
+
alignItems: "center",
|
|
244
|
+
gap: 2,
|
|
245
|
+
padding: `${tokens.spacing.xs} ${tokens.spacing.sm}`
|
|
246
|
+
},
|
|
247
|
+
children: [
|
|
248
|
+
showDate && currentTime && /* @__PURE__ */ jsx("span", {
|
|
249
|
+
style: {
|
|
250
|
+
fontSize: tokens.typography.fontSize.xs,
|
|
251
|
+
fontFamily: tokens.typography.fontFamily.mono,
|
|
252
|
+
color: tokens.colors.text.tertiary,
|
|
253
|
+
...tabularNumsStyle
|
|
254
|
+
},
|
|
255
|
+
children: formatDateDisplay(currentTime)
|
|
256
|
+
}),
|
|
257
|
+
showCurrent && currentTime && /* @__PURE__ */ jsx("span", {
|
|
258
|
+
style: {
|
|
259
|
+
fontSize: small ? tokens.typography.fontSize.lg : tokens.typography.fontSize.xl,
|
|
260
|
+
fontWeight: tokens.typography.fontWeight.bold,
|
|
261
|
+
fontFamily: tokens.typography.fontFamily.mono,
|
|
262
|
+
color: tokens.colors.text.primary,
|
|
263
|
+
...tabularNumsStyle
|
|
264
|
+
},
|
|
265
|
+
children: formatTimeDisplay(currentTime)
|
|
266
|
+
}),
|
|
267
|
+
showElapsed && elapsedSeconds !== void 0 && /* @__PURE__ */ jsxs("span", {
|
|
268
|
+
style: {
|
|
269
|
+
fontSize: tokens.typography.fontSize.sm,
|
|
270
|
+
fontFamily: tokens.typography.fontFamily.mono,
|
|
271
|
+
color: tokens.colors.status.caution,
|
|
272
|
+
...tabularNumsStyle
|
|
273
|
+
},
|
|
274
|
+
children: [
|
|
275
|
+
"T",
|
|
276
|
+
elapsedSeconds >= 0 ? "+" : "",
|
|
277
|
+
formatElapsedTime(elapsedSeconds)
|
|
278
|
+
]
|
|
279
|
+
}),
|
|
280
|
+
/* @__PURE__ */ jsxs("span", {
|
|
281
|
+
style: {
|
|
282
|
+
fontSize: tokens.typography.fontSize.xs,
|
|
283
|
+
fontWeight: tokens.typography.fontWeight.medium,
|
|
284
|
+
color: isPlaying ? safeAccentText(tokens.colors.accent.primary) : tokens.colors.status.standby,
|
|
285
|
+
textTransform: "uppercase",
|
|
286
|
+
letterSpacing: tokens.typography.letterSpacing.wide,
|
|
287
|
+
display: "flex",
|
|
288
|
+
alignItems: "center",
|
|
289
|
+
gap: 4
|
|
290
|
+
},
|
|
291
|
+
children: [isPlaying && /* @__PURE__ */ jsx("span", { style: {
|
|
292
|
+
width: 6,
|
|
293
|
+
height: 6,
|
|
294
|
+
borderRadius: "50%",
|
|
295
|
+
backgroundColor: tokens.colors.accent.primary,
|
|
296
|
+
animation: "pulse 1.5s ease-in-out infinite"
|
|
297
|
+
} }), "SIM"]
|
|
298
|
+
})
|
|
299
|
+
]
|
|
300
|
+
});
|
|
308
301
|
});
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
showTimeScale && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
590
|
-
/* @__PURE__ */ jsx(
|
|
591
|
-
"div",
|
|
592
|
-
{
|
|
593
|
-
style: {
|
|
594
|
-
width: 1,
|
|
595
|
-
height: 24,
|
|
596
|
-
backgroundColor: tokens.colors.border.muted
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
),
|
|
600
|
-
/* @__PURE__ */ jsx(
|
|
601
|
-
TimeScaleSelector,
|
|
602
|
-
{
|
|
603
|
-
value: timeScale,
|
|
604
|
-
presets: timeScalePresets,
|
|
605
|
-
onChange: onTimeScaleChange,
|
|
606
|
-
disabled: disabled || !onTimeScaleChange,
|
|
607
|
-
tokens,
|
|
608
|
-
small
|
|
609
|
-
}
|
|
610
|
-
)
|
|
611
|
-
] })
|
|
612
|
-
]
|
|
613
|
-
}
|
|
614
|
-
);
|
|
302
|
+
/**
|
|
303
|
+
* SimulationControls - Playback controls for space simulation
|
|
304
|
+
*
|
|
305
|
+
* Provides comprehensive simulation time control following Astro UX patterns.
|
|
306
|
+
* Designed for mission control and space operations applications.
|
|
307
|
+
*
|
|
308
|
+
* @example
|
|
309
|
+
* ```tsx
|
|
310
|
+
* // Basic usage
|
|
311
|
+
* <SimulationControls
|
|
312
|
+
* isPlaying={isPlaying}
|
|
313
|
+
* onPlay={() => setIsPlaying(true)}
|
|
314
|
+
* onPause={() => setIsPlaying(false)}
|
|
315
|
+
* onStop={handleReset}
|
|
316
|
+
* />
|
|
317
|
+
*
|
|
318
|
+
* // Full featured
|
|
319
|
+
* <SimulationControls
|
|
320
|
+
* isPlaying={isPlaying}
|
|
321
|
+
* onPlay={handlePlay}
|
|
322
|
+
* onPause={handlePause}
|
|
323
|
+
* onStop={handleStop}
|
|
324
|
+
* onStepForward={handleStepForward}
|
|
325
|
+
* onStepBackward={handleStepBackward}
|
|
326
|
+
* currentTime={simulationTime}
|
|
327
|
+
* epoch={epoch}
|
|
328
|
+
* elapsedSeconds={elapsed}
|
|
329
|
+
* timeScale={timeScale}
|
|
330
|
+
* onTimeScaleChange={setTimeScale}
|
|
331
|
+
* showTimeScale
|
|
332
|
+
* showStepControls
|
|
333
|
+
* showElapsedTime
|
|
334
|
+
* />
|
|
335
|
+
*
|
|
336
|
+
* // In AppBar center slot
|
|
337
|
+
* <AppBar
|
|
338
|
+
* appName="Mission Control"
|
|
339
|
+
* centerSlot={
|
|
340
|
+
* <SimulationControls
|
|
341
|
+
* compact
|
|
342
|
+
* isPlaying={isPlaying}
|
|
343
|
+
* onPlay={handlePlay}
|
|
344
|
+
* onPause={handlePause}
|
|
345
|
+
* currentTime={simTime}
|
|
346
|
+
* />
|
|
347
|
+
* }
|
|
348
|
+
* />
|
|
349
|
+
* ```
|
|
350
|
+
*/
|
|
351
|
+
var SimulationControls = memo(function SimulationControls({ state, isPlaying: isPlayingProp, isPaused, onPlay, onPause, onStop, onStepForward, onStepBackward, currentTime: currentTimeProp, epoch, elapsedSeconds: elapsedSecondsProp, showElapsedTime = true, showCurrentTime = true, showDate = true, timeScale = 1, onTimeScaleChange, timeScalePresets = DEFAULT_TIME_SCALE_PRESETS, showTimeScale = true, stepSize = 60, onStepSizeChange: _onStepSizeChange, stepSizePresets: _stepSizePresets = DEFAULT_STEP_SIZE_PRESETS, showStepControls = true, compact = false, small = false, className = "", disabled = false, showStatus = true, label }) {
|
|
352
|
+
const { tokens, theme } = useTheme();
|
|
353
|
+
const isTransparentTheme = theme === "transparent" || theme === "transparent-bold" || theme === "transparent-minimal";
|
|
354
|
+
const isPlaying = useMemo(() => {
|
|
355
|
+
if (state) return state === "playing";
|
|
356
|
+
return isPlayingProp ?? false;
|
|
357
|
+
}, [state, isPlayingProp]);
|
|
358
|
+
const isStopped = useMemo(() => {
|
|
359
|
+
if (state) return state === "stopped";
|
|
360
|
+
return !isPlayingProp && !isPaused;
|
|
361
|
+
}, [
|
|
362
|
+
state,
|
|
363
|
+
isPlayingProp,
|
|
364
|
+
isPaused
|
|
365
|
+
]);
|
|
366
|
+
const currentTime = useMemo(() => {
|
|
367
|
+
if (!currentTimeProp) return void 0;
|
|
368
|
+
return typeof currentTimeProp === "string" ? new Date(currentTimeProp) : currentTimeProp;
|
|
369
|
+
}, [currentTimeProp]);
|
|
370
|
+
const elapsedSeconds = useMemo(() => {
|
|
371
|
+
if (elapsedSecondsProp !== void 0) return elapsedSecondsProp;
|
|
372
|
+
if (currentTime && epoch) {
|
|
373
|
+
const epochDate = typeof epoch === "string" ? new Date(epoch) : epoch;
|
|
374
|
+
return (currentTime.getTime() - epochDate.getTime()) / 1e3;
|
|
375
|
+
}
|
|
376
|
+
}, [
|
|
377
|
+
elapsedSecondsProp,
|
|
378
|
+
currentTime,
|
|
379
|
+
epoch
|
|
380
|
+
]);
|
|
381
|
+
const handlePlayPause = useCallback(() => {
|
|
382
|
+
if (isPlaying) onPause?.();
|
|
383
|
+
else onPlay?.();
|
|
384
|
+
}, [
|
|
385
|
+
isPlaying,
|
|
386
|
+
onPlay,
|
|
387
|
+
onPause
|
|
388
|
+
]);
|
|
389
|
+
const handleKeyDown = useCallback((e) => {
|
|
390
|
+
if (disabled) return;
|
|
391
|
+
switch (e.key) {
|
|
392
|
+
case " ":
|
|
393
|
+
e.preventDefault();
|
|
394
|
+
handlePlayPause();
|
|
395
|
+
break;
|
|
396
|
+
case "Escape":
|
|
397
|
+
e.preventDefault();
|
|
398
|
+
onStop?.();
|
|
399
|
+
break;
|
|
400
|
+
case "ArrowRight":
|
|
401
|
+
e.preventDefault();
|
|
402
|
+
onStepForward?.();
|
|
403
|
+
break;
|
|
404
|
+
case "ArrowLeft":
|
|
405
|
+
e.preventDefault();
|
|
406
|
+
onStepBackward?.();
|
|
407
|
+
break;
|
|
408
|
+
}
|
|
409
|
+
}, [
|
|
410
|
+
disabled,
|
|
411
|
+
handlePlayPause,
|
|
412
|
+
onStop,
|
|
413
|
+
onStepForward,
|
|
414
|
+
onStepBackward
|
|
415
|
+
]);
|
|
416
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
417
|
+
className: classNames("zendir-simulation-controls", className),
|
|
418
|
+
role: "group",
|
|
419
|
+
"aria-label": label || "Simulation Controls",
|
|
420
|
+
onKeyDown: handleKeyDown,
|
|
421
|
+
tabIndex: 0,
|
|
422
|
+
style: {
|
|
423
|
+
display: "flex",
|
|
424
|
+
alignItems: "center",
|
|
425
|
+
gap: compact ? tokens.spacing.sm : tokens.spacing.md,
|
|
426
|
+
padding: compact ? `${tokens.spacing.xs} ${tokens.spacing.sm}` : `${tokens.spacing.sm} ${tokens.spacing.md}`,
|
|
427
|
+
backgroundColor: isTransparentTheme ? "rgba(0,0,0,0.3)" : tokens.colors.background.surface,
|
|
428
|
+
...isTransparentTheme && {
|
|
429
|
+
backdropFilter: "blur(12px)",
|
|
430
|
+
WebkitBackdropFilter: "blur(12px)"
|
|
431
|
+
},
|
|
432
|
+
...tokens.colors.border.cardStyle ?? { border: `1px solid ${tokens.colors.border.muted}` },
|
|
433
|
+
borderRadius: tokens.borderRadius.lg,
|
|
434
|
+
outline: "none",
|
|
435
|
+
transition: tokens.animation.fast
|
|
436
|
+
},
|
|
437
|
+
children: [
|
|
438
|
+
(showCurrentTime || showElapsedTime) && !compact && /* @__PURE__ */ jsx(SimulationTimeDisplay, {
|
|
439
|
+
currentTime,
|
|
440
|
+
elapsedSeconds,
|
|
441
|
+
showElapsed: showElapsedTime,
|
|
442
|
+
showCurrent: showCurrentTime,
|
|
443
|
+
showDate,
|
|
444
|
+
isPlaying,
|
|
445
|
+
tokens,
|
|
446
|
+
small
|
|
447
|
+
}),
|
|
448
|
+
compact && currentTime && /* @__PURE__ */ jsxs("div", {
|
|
449
|
+
style: {
|
|
450
|
+
display: "flex",
|
|
451
|
+
alignItems: "center",
|
|
452
|
+
gap: 8
|
|
453
|
+
},
|
|
454
|
+
children: [
|
|
455
|
+
showDate && /* @__PURE__ */ jsx("span", {
|
|
456
|
+
style: {
|
|
457
|
+
fontSize: tokens.typography.fontSize.xs,
|
|
458
|
+
fontFamily: tokens.typography.fontFamily.mono,
|
|
459
|
+
color: tokens.colors.text.tertiary,
|
|
460
|
+
...tabularNumsStyle
|
|
461
|
+
},
|
|
462
|
+
children: formatDateDisplay(currentTime)
|
|
463
|
+
}),
|
|
464
|
+
/* @__PURE__ */ jsx("span", {
|
|
465
|
+
style: {
|
|
466
|
+
fontSize: tokens.typography.fontSize.lg,
|
|
467
|
+
fontWeight: tokens.typography.fontWeight.bold,
|
|
468
|
+
fontFamily: tokens.typography.fontFamily.mono,
|
|
469
|
+
color: tokens.colors.text.primary,
|
|
470
|
+
...tabularNumsStyle
|
|
471
|
+
},
|
|
472
|
+
children: formatTimeDisplay(currentTime)
|
|
473
|
+
}),
|
|
474
|
+
showStatus && /* @__PURE__ */ jsxs("span", {
|
|
475
|
+
style: {
|
|
476
|
+
fontSize: tokens.typography.fontSize.xs,
|
|
477
|
+
fontWeight: tokens.typography.fontWeight.medium,
|
|
478
|
+
color: isPlaying ? safeAccentText(tokens.colors.accent.primary) : tokens.colors.status.standby,
|
|
479
|
+
textTransform: "uppercase",
|
|
480
|
+
display: "flex",
|
|
481
|
+
alignItems: "center",
|
|
482
|
+
gap: 4
|
|
483
|
+
},
|
|
484
|
+
children: [isPlaying && /* @__PURE__ */ jsx("span", { style: {
|
|
485
|
+
width: 6,
|
|
486
|
+
height: 6,
|
|
487
|
+
borderRadius: "50%",
|
|
488
|
+
backgroundColor: tokens.colors.accent.primary
|
|
489
|
+
} }), "SIM"]
|
|
490
|
+
})
|
|
491
|
+
]
|
|
492
|
+
}),
|
|
493
|
+
(showCurrentTime || showElapsedTime || compact && currentTime) && /* @__PURE__ */ jsx("div", { style: {
|
|
494
|
+
width: 1,
|
|
495
|
+
height: 24,
|
|
496
|
+
backgroundColor: tokens.colors.border.muted
|
|
497
|
+
} }),
|
|
498
|
+
/* @__PURE__ */ jsxs("div", {
|
|
499
|
+
style: {
|
|
500
|
+
display: "flex",
|
|
501
|
+
alignItems: "center",
|
|
502
|
+
gap: 4
|
|
503
|
+
},
|
|
504
|
+
children: [
|
|
505
|
+
showStepControls && /* @__PURE__ */ jsx(ControlButton, {
|
|
506
|
+
icon: "skip-previous",
|
|
507
|
+
label: `Step backward ${formatStepSize(stepSize)}`,
|
|
508
|
+
onClick: onStepBackward,
|
|
509
|
+
disabled: disabled || !onStepBackward,
|
|
510
|
+
tokens,
|
|
511
|
+
small
|
|
512
|
+
}),
|
|
513
|
+
/* @__PURE__ */ jsx(ControlButton, {
|
|
514
|
+
icon: "stop",
|
|
515
|
+
label: "Stop / Reset",
|
|
516
|
+
onClick: onStop,
|
|
517
|
+
disabled: disabled || !onStop,
|
|
518
|
+
danger: !isStopped,
|
|
519
|
+
tokens,
|
|
520
|
+
small
|
|
521
|
+
}),
|
|
522
|
+
/* @__PURE__ */ jsx(Tooltip, {
|
|
523
|
+
content: isPlaying ? "Pause (Space)" : "Play (Space)",
|
|
524
|
+
placement: "bottom",
|
|
525
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
526
|
+
onClick: handlePlayPause,
|
|
527
|
+
disabled,
|
|
528
|
+
"aria-label": isPlaying ? "Pause simulation" : "Play simulation",
|
|
529
|
+
style: {
|
|
530
|
+
display: "flex",
|
|
531
|
+
alignItems: "center",
|
|
532
|
+
justifyContent: "center",
|
|
533
|
+
width: small ? 36 : 44,
|
|
534
|
+
height: small ? 36 : 44,
|
|
535
|
+
padding: 0,
|
|
536
|
+
border: isPlaying ? `2px solid ${tokens.colors.accent.primary}` : "none",
|
|
537
|
+
borderRadius: "50%",
|
|
538
|
+
backgroundColor: isPlaying ? "rgba(138, 43, 226, 0.15)" : tokens.colors.accent.primary,
|
|
539
|
+
color: isPlaying ? safeAccentText(tokens.colors.accent.primary) : "#ffffff",
|
|
540
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
541
|
+
transition: "all 0.15s ease",
|
|
542
|
+
opacity: disabled ? .5 : 1,
|
|
543
|
+
boxShadow: isPlaying ? `0 0 16px ${tokens.colors.accent.primary}50` : `0 0 8px ${tokens.colors.accent.primary}40`
|
|
544
|
+
},
|
|
545
|
+
onMouseEnter: (e) => {
|
|
546
|
+
if (!disabled) e.currentTarget.style.transform = "scale(1.05)";
|
|
547
|
+
},
|
|
548
|
+
onMouseLeave: (e) => {
|
|
549
|
+
e.currentTarget.style.transform = "scale(1)";
|
|
550
|
+
},
|
|
551
|
+
children: /* @__PURE__ */ jsx(AstroIcon, {
|
|
552
|
+
name: isPlaying ? "pause" : "play-arrow",
|
|
553
|
+
size: small ? 18 : 22,
|
|
554
|
+
color: isPlaying ? tokens.colors.accent.primary : "#ffffff"
|
|
555
|
+
})
|
|
556
|
+
})
|
|
557
|
+
}),
|
|
558
|
+
showStepControls && /* @__PURE__ */ jsx(ControlButton, {
|
|
559
|
+
icon: "skip-next",
|
|
560
|
+
label: `Step forward ${formatStepSize(stepSize)}`,
|
|
561
|
+
onClick: onStepForward,
|
|
562
|
+
disabled: disabled || !onStepForward,
|
|
563
|
+
tokens,
|
|
564
|
+
small
|
|
565
|
+
})
|
|
566
|
+
]
|
|
567
|
+
}),
|
|
568
|
+
showTimeScale && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", { style: {
|
|
569
|
+
width: 1,
|
|
570
|
+
height: 24,
|
|
571
|
+
backgroundColor: tokens.colors.border.muted
|
|
572
|
+
} }), /* @__PURE__ */ jsx(TimeScaleSelector, {
|
|
573
|
+
value: timeScale,
|
|
574
|
+
presets: timeScalePresets,
|
|
575
|
+
onChange: onTimeScaleChange,
|
|
576
|
+
disabled: disabled || !onTimeScaleChange,
|
|
577
|
+
tokens,
|
|
578
|
+
small
|
|
579
|
+
})] })
|
|
580
|
+
]
|
|
581
|
+
});
|
|
615
582
|
});
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
onTimeScaleChange,
|
|
635
|
-
disabled,
|
|
636
|
-
compact: true,
|
|
637
|
-
small: true,
|
|
638
|
-
showCurrentTime: false,
|
|
639
|
-
showElapsedTime: false,
|
|
640
|
-
showDate: false,
|
|
641
|
-
showStepControls: false,
|
|
642
|
-
showTimeScale: Boolean(onTimeScaleChange),
|
|
643
|
-
className
|
|
644
|
-
}
|
|
645
|
-
);
|
|
583
|
+
var MiniSimulationControls = memo(function MiniSimulationControls({ isPlaying = false, onPlay, onPause, onStop, timeScale = 1, onTimeScaleChange, disabled = false, className = "" }) {
|
|
584
|
+
return /* @__PURE__ */ jsx(SimulationControls, {
|
|
585
|
+
isPlaying,
|
|
586
|
+
onPlay,
|
|
587
|
+
onPause,
|
|
588
|
+
onStop,
|
|
589
|
+
timeScale,
|
|
590
|
+
onTimeScaleChange,
|
|
591
|
+
disabled,
|
|
592
|
+
compact: true,
|
|
593
|
+
small: true,
|
|
594
|
+
showCurrentTime: false,
|
|
595
|
+
showElapsedTime: false,
|
|
596
|
+
showDate: false,
|
|
597
|
+
showStepControls: false,
|
|
598
|
+
showTimeScale: Boolean(onTimeScaleChange),
|
|
599
|
+
className
|
|
600
|
+
});
|
|
646
601
|
});
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
...props,
|
|
656
|
-
showCurrentTime: true,
|
|
657
|
-
showElapsedTime: true,
|
|
658
|
-
showDate: true,
|
|
659
|
-
label: `Simulation Controls - ${timezone}`
|
|
660
|
-
}
|
|
661
|
-
);
|
|
602
|
+
var SimulationControlsWithClock = memo(function SimulationControlsWithClock({ clockFormat: _clockFormat = "24h", timezone = "SIM", ...props }) {
|
|
603
|
+
return /* @__PURE__ */ jsx(SimulationControls, {
|
|
604
|
+
...props,
|
|
605
|
+
showCurrentTime: true,
|
|
606
|
+
showElapsedTime: true,
|
|
607
|
+
showDate: true,
|
|
608
|
+
label: `Simulation Controls - ${timezone}`
|
|
609
|
+
});
|
|
662
610
|
});
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
};
|
|
668
|
-
//# sourceMappingURL=SimulationControls.js.map
|
|
611
|
+
//#endregion
|
|
612
|
+
export { MiniSimulationControls, SimulationControls, SimulationControls as default, SimulationControlsWithClock };
|
|
613
|
+
|
|
614
|
+
//# sourceMappingURL=SimulationControls.js.map
|