@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
package/README.md
CHANGED
|
@@ -1,631 +1,640 @@
|
|
|
1
|
-
<h1 align="center">@zendir/ui</h1>
|
|
2
|
-
|
|
3
|
-
<p align="center">
|
|
4
|
-
React components for space operations.<br />
|
|
5
|
-
Built on the <a href="https://www.astrouxds.com/">Astro UX Design System</a>.
|
|
6
|
-
</p>
|
|
7
|
-
|
|
8
|
-
<p align="center">
|
|
9
|
-
<img src="https://img.shields.io/npm/v/@zendir/ui?style=flat&colorA=18181B&colorB=6C47FF" alt="npm version" />
|
|
10
|
-
<img src="https://img.shields.io/badge/license-MIT-6C47FF.svg?style=flat&colorA=18181B" alt="License" />
|
|
11
|
-
<img src="https://img.shields.io/badge/TypeScript-5.0+-6C47FF.svg?style=flat&colorA=18181B" alt="TypeScript" />
|
|
12
|
-
<img src="https://img.shields.io/badge/React-18%2F19-6C47FF.svg?style=flat&colorA=18181B" alt="React" />
|
|
13
|
-
<img src="https://img.shields.io/badge/WCAG_2.2_AA-conformant-6C47FF.svg?style=flat&colorA=18181B" alt="WCAG 2.2 AA conformant" />
|
|
14
|
-
</p>
|
|
15
|
-
|
|
16
|
-
<p align="center">
|
|
17
|
-
<a href="#quick-start">Quick Start</a> · <a href="#components">Components</a> · <a href="#ai-integration">AI Integration</a> · <a href="#theme-system">Theming</a> · <a href="#accessibility">Accessibility</a> · <a href="https://storybook.zendir.io">Storybook</a> · <a href="CONTRIBUTING.md">Contributing</a> · <a href="CODE_OF_CONDUCT.md">Code of Conduct</a>
|
|
18
|
-
</p>
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## Overview
|
|
23
|
-
|
|
24
|
-
React components for satellite telemetry, orbit visualisation, mission control dashboards, and space simulations. Follows the [Astro UX Design System](https://www.astrouxds.com/) used by the U.S. Space Force.
|
|
25
|
-
|
|
26
|
-
- **Astro UX-aligned** — dual-coded status indicators, classification banners, mission clocks
|
|
27
|
-
- **TypeScript-first** — full type definitions
|
|
28
|
-
- **Accessible** — [WCAG 2.2 AA](https://www.w3.org/TR/WCAG22/) conformant, keyboard navigable, reduced-motion aware, EAA-aligned
|
|
29
|
-
- **Tree-shakeable** with optional peer dependencies
|
|
30
|
-
- Works standalone or with [`zendir-ts`](https://www.npmjs.com/package/zendir-ts) for live API integration
|
|
31
|
-
|
|
32
|
-
The full component catalogue with live examples lives in [Storybook](https://storybook.zendir.io).
|
|
33
|
-
|
|
34
|
-
## Quick Start
|
|
35
|
-
|
|
36
|
-
### Install
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
npm install @zendir/ui
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
> The SDK is optional. All TypeScript types ship with the UI library.
|
|
43
|
-
> Install `zendir-ts` only if you need the API client.
|
|
44
|
-
>
|
|
45
|
-
> Recent versions of `@zendir/ui` hide the SDK specifier from static
|
|
46
|
-
> import-analysis, so no Vite alias is required — missing `zendir-ts` simply
|
|
47
|
-
> causes hooks like `useZendirSession` to report "SDK not installed" while the
|
|
48
|
-
> rest of the UI keeps working.
|
|
49
|
-
>
|
|
50
|
-
> **Older bundlers / strict resolvers:** if you hit "Failed to resolve import
|
|
51
|
-
> 'zendir-ts'", point the optional peer at the bundled stub:
|
|
52
|
-
> ```js
|
|
53
|
-
> // vite.config.js
|
|
54
|
-
> resolve: { alias: { 'zendir-ts': require.resolve('@zendir/ui/sdk-stub') } }
|
|
55
|
-
> ```
|
|
56
|
-
|
|
57
|
-
### Use
|
|
58
|
-
|
|
59
|
-
```tsx
|
|
60
|
-
import { ThemeProvider, SpacecraftCard, StatusIndicator } from '@zendir/ui/react';
|
|
61
|
-
|
|
62
|
-
function App() {
|
|
63
|
-
return (
|
|
64
|
-
<ThemeProvider defaultVariant="hybrid" defaultMode="dark">
|
|
65
|
-
<StatusIndicator status="normal" label="System Healthy" />
|
|
66
|
-
|
|
67
|
-
<SpacecraftCard
|
|
68
|
-
spacecraft={{
|
|
69
|
-
id: 'SAT-001',
|
|
70
|
-
name: 'Explorer-1',
|
|
71
|
-
noradId: 25544,
|
|
72
|
-
type: 'LEO Satellite',
|
|
73
|
-
status: 'operational',
|
|
74
|
-
}}
|
|
75
|
-
position={{
|
|
76
|
-
latitude: 45.2,
|
|
77
|
-
longitude: -122.5,
|
|
78
|
-
altitude: 408,
|
|
79
|
-
velocity: 7.66,
|
|
80
|
-
}}
|
|
81
|
-
/>
|
|
82
|
-
</ThemeProvider>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## Components
|
|
90
|
-
|
|
91
|
-
### Core
|
|
92
|
-
|
|
93
|
-
Foundational primitives that compose into any interface.
|
|
94
|
-
|
|
95
|
-
| Component | Description |
|
|
96
|
-
|-----------|-------------|
|
|
97
|
-
| `Button` | Primary, secondary, and borderless variants with icon and loading support |
|
|
98
|
-
| `Input` | Text input with label, icon, validation, and size variants |
|
|
99
|
-
| `Select` | Dropdown selection with search and multi-select |
|
|
100
|
-
| `Toggle` | On/off switch with label |
|
|
101
|
-
| `Checkbox` | Checkbox and radio with accessible labeling |
|
|
102
|
-
| `Dialog` | Modal dialog with action slots |
|
|
103
|
-
| `Tabs` | Tabbed navigation with panel content |
|
|
104
|
-
| `Tooltip` | Contextual overlay on hover/focus |
|
|
105
|
-
| `Container` | Surface card with title, status accent, and elevation |
|
|
106
|
-
| `Badge` | Inline status label |
|
|
107
|
-
| `Pagination` | Page navigation controls |
|
|
108
|
-
| `NumberInput` | Numeric stepper with min/max/step and slider |
|
|
109
|
-
| `SidePanel` | Slide-out panel with configurable position |
|
|
110
|
-
| `DataTable` | Sortable, filterable data grid |
|
|
111
|
-
| `Menu` / `Popover` | Context menus and floating content |
|
|
112
|
-
| `ChatPanel` | AI chat interface with structured blocks, status system, and [4 LLM integration strategies](#ai-integration) |
|
|
113
|
-
|
|
114
|
-
### Status & Monitoring
|
|
115
|
-
|
|
116
|
-
Astro UX status system — six severity levels, dual-coded with color and shape so that status is never conveyed by color alone (WCAG 1.4.1 Use of Color).
|
|
117
|
-
|
|
118
|
-
```tsx
|
|
119
|
-
import { StatusIndicator, MonitoringIcon } from '@zendir/ui/react';
|
|
120
|
-
|
|
121
|
-
<StatusIndicator status="normal" label="Operational" />
|
|
122
|
-
<StatusIndicator status="caution" label="Battery Low" />
|
|
123
|
-
<StatusIndicator status="critical" label="Comm Loss" pulse />
|
|
124
|
-
|
|
125
|
-
<MonitoringIcon status="normal" icon="power" label="Power" sublabel="85%" />
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
**Status levels:** `off` · `standby` · `normal` · `caution` · `serious` · `critical`
|
|
129
|
-
|
|
130
|
-
### Data Cards
|
|
131
|
-
|
|
132
|
-
Pre-built cards for common space operations data. All cards support **compact mode** — collapsed by default, expand on hover, pin on click.
|
|
133
|
-
|
|
134
|
-
| Card | Data |
|
|
135
|
-
|------|------|
|
|
136
|
-
| `SpacecraftCard` | ID, orbit type, status, position |
|
|
137
|
-
| `TelemetryCard` | Subsystem health, alerts |
|
|
138
|
-
| `TelemetryStreamCard` | Live metric streaming |
|
|
139
|
-
| `AccessCard` | Ground station contact windows |
|
|
140
|
-
| `OrbitCard` | Keplerian elements, period, epoch |
|
|
141
|
-
|
|
142
|
-
```tsx
|
|
143
|
-
<SpacecraftCard compact spacecraft={data} position={pos} />
|
|
144
|
-
<TelemetryCard compact telemetry={tlm} />
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
### DataValue
|
|
148
|
-
|
|
149
|
-
Display telemetry values with automatic icons, units, and status derivation from 30+ built-in property presets.
|
|
150
|
-
|
|
151
|
-
```tsx
|
|
152
|
-
import { DataValue, DataValueGroup } from '@zendir/ui/react';
|
|
153
|
-
|
|
154
|
-
<DataValue property="temperature" value={72.5} />
|
|
155
|
-
<DataValue property="battery" value={25} /> {/* auto-derives 'caution' */}
|
|
156
|
-
|
|
157
|
-
<DataValueGroup columns={2} title="Power" icon="propulsion-power">
|
|
158
|
-
<DataValue property="battery" value={85} />
|
|
159
|
-
<DataValue property="voltage" value={28.4} />
|
|
160
|
-
<DataValue property="solarPower" value={124} />
|
|
161
|
-
</DataValueGroup>
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
**Presets:** `battery` · `voltage` · `temperature` · `signalStrength` · `altitude` · `velocity` · `fuelLevel` · `cpuUsage` · `memoryUsage` · and 20+ more (see [Storybook](https://storybook.zendir.io) for the full list)
|
|
165
|
-
|
|
166
|
-
### Visualizations
|
|
167
|
-
|
|
168
|
-
Domain-specific visualization cards for mission operations.
|
|
169
|
-
|
|
170
|
-
| Card | Description |
|
|
171
|
-
|------|-------------|
|
|
172
|
-
| `LinkBudgetCard` | RF link budget waterfall |
|
|
173
|
-
| `ThermalHeatmapCard` | Spacecraft thermal zone status |
|
|
174
|
-
| `PropulsionCard` | Fuel, thrusters, delta-V budget |
|
|
175
|
-
| `EclipseTimerCard` | Eclipse/sunlight timing |
|
|
176
|
-
| `NavBallCard` | 3D attitude indicator |
|
|
177
|
-
| `SensorFootprintCard` | Ground sensor coverage |
|
|
178
|
-
|
|
179
|
-
### Charts
|
|
180
|
-
|
|
181
|
-
40+ chart types built on ECharts with Astro UX
|
|
182
|
-
|
|
183
|
-
```tsx
|
|
184
|
-
import { PowerChart, AttitudeChart, GroundTrackMap } from '@zendir/ui/react';
|
|
185
|
-
|
|
186
|
-
<PowerChart data={powerData} height={300} />
|
|
187
|
-
<AttitudeChart data={attitudeData} height={250} />
|
|
188
|
-
<GroundTrackMap groundTrack={track} groundStations={stations} />
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
**Includes:** Line, Area, Bar, Pie, Donut, Gauge, Radar, Heatmap, Scatter, Sankey, Treemap, Sunburst, Candlestick, 3D Scatter/Surface/Bar, Waterfall, Doppler, and domain-specific charts for power, attitude, thermal, orbits, contacts, spectrum, and more.
|
|
192
|
-
|
|
193
|
-
### 3D Viewers
|
|
194
|
-
|
|
195
|
-
Three viewers covering the operations spectrum from full-Earth to full solar system, with optional WebGL2 (Three.js) and Cesium backends.
|
|
196
|
-
|
|
197
|
-
```tsx
|
|
198
|
-
import { ZenSpace3D, EarthViewer, SolarSystemViewer } from '@zendir/ui/react';
|
|
199
|
-
|
|
200
|
-
// Unified 3D space view — Three.js by default, optional Cesium backend for
|
|
201
|
-
// physically-accurate ECI/ECEF transforms and high-fidelity Earth imagery.
|
|
202
|
-
// Pair with `useSimulationScene` (see SDK Integration) to render a live
|
|
203
|
-
// simulation directly from a `zendir-ts` `ZendirClient`.
|
|
204
|
-
<ZenSpace3D
|
|
205
|
-
satellites={satellites}
|
|
206
|
-
groundStations={groundStations}
|
|
207
|
-
satelliteCoverages={coverages}
|
|
208
|
-
referenceTime={referenceDate}
|
|
209
|
-
/>
|
|
210
|
-
|
|
211
|
-
// Lightweight Three.js Earth view — good for small dashboards and demos.
|
|
212
|
-
<EarthViewer
|
|
213
|
-
spacecraft={[{ id: 'SAT-001', name: 'Explorer-1', latitude: 45.2, longitude: -122.5, altitude: 408 }]}
|
|
214
|
-
groundStations={[{ id: 'DSN-14', name: 'Goldstone', latitude: 35.4, longitude: -116.9 }]}
|
|
215
|
-
showAtmosphere
|
|
216
|
-
showOrbits
|
|
217
|
-
autoRotate
|
|
218
|
-
/>
|
|
219
|
-
|
|
220
|
-
<SolarSystemViewer focusedPlanet="earth" autoOrbit showLabels />
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
Coverage geometry (footprint polygons, sensor cones, nadir lines) is rendered from explicit `SatelliteCoverage` records — see `ZenSpace3DTypes` for the full prop surface. Heavy orbital propagation (SGP4 / TLE) is intentionally **not** shipped in this package; bring your own propagator (e.g. [`satellite.js`](https://github.com/shashwatak/satellite-js)) and feed positions in via props, or use `useSimulationScene` to read live `Position_BN_N` from the engine.
|
|
224
|
-
|
|
225
|
-
### Astro UX Components
|
|
226
|
-
|
|
227
|
-
Mission operations components following [Astro UX Design System](https://www.astrouxds.com/) specifications.
|
|
228
|
-
|
|
229
|
-
| Component | Description |
|
|
230
|
-
|-----------|-------------|
|
|
231
|
-
| `GlobalStatusBar` | Application header with app name, clock, monitoring icons |
|
|
232
|
-
| `MissionClock` | UTC/local time display with multiple formats |
|
|
233
|
-
| `ClassificationBanner` | Security classification banner (CUI through Top Secret) |
|
|
234
|
-
| `Timeline` | Gantt, list, and scatter views for mission events |
|
|
235
|
-
| `Progress` | Determinate and indeterminate progress indicators |
|
|
236
|
-
| `Notification` | Toast notifications with status and auto-dismiss |
|
|
237
|
-
|
|
238
|
-
---
|
|
239
|
-
|
|
240
|
-
## Theme System
|
|
241
|
-
|
|
242
|
-
Wrap your application in `ThemeProvider` to enable the full token-based design system.
|
|
243
|
-
|
|
244
|
-
```tsx
|
|
245
|
-
import { ThemeProvider, useTheme } from '@zendir/ui/react';
|
|
246
|
-
|
|
247
|
-
<ThemeProvider
|
|
248
|
-
defaultVariant="hybrid" // 'astro' | 'purple-hue' | 'hybrid' | '
|
|
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
|
-
}
|
|
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
|
-
tools: [{
|
|
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
|
-
const
|
|
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
|
-
server.
|
|
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
|
-
npm run
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
```
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
1
|
+
<h1 align="center">@zendir/ui</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
React components for space operations.<br />
|
|
5
|
+
Built on the <a href="https://www.astrouxds.com/">Astro UX Design System</a>.
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<img src="https://img.shields.io/npm/v/@zendir/ui?style=flat&colorA=18181B&colorB=6C47FF" alt="npm version" />
|
|
10
|
+
<img src="https://img.shields.io/badge/license-MIT-6C47FF.svg?style=flat&colorA=18181B" alt="License" />
|
|
11
|
+
<img src="https://img.shields.io/badge/TypeScript-5.0+-6C47FF.svg?style=flat&colorA=18181B" alt="TypeScript" />
|
|
12
|
+
<img src="https://img.shields.io/badge/React-18%2F19-6C47FF.svg?style=flat&colorA=18181B" alt="React" />
|
|
13
|
+
<img src="https://img.shields.io/badge/WCAG_2.2_AA-conformant-6C47FF.svg?style=flat&colorA=18181B" alt="WCAG 2.2 AA conformant" />
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="#quick-start">Quick Start</a> · <a href="#components">Components</a> · <a href="#ai-integration">AI Integration</a> · <a href="#theme-system">Theming</a> · <a href="#accessibility">Accessibility</a> · <a href="https://storybook.zendir.io">Storybook</a> · <a href="CONTRIBUTING.md">Contributing</a> · <a href="CODE_OF_CONDUCT.md">Code of Conduct</a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Overview
|
|
23
|
+
|
|
24
|
+
React components for satellite telemetry, orbit visualisation, mission control dashboards, and space simulations. Follows the [Astro UX Design System](https://www.astrouxds.com/) used by the U.S. Space Force.
|
|
25
|
+
|
|
26
|
+
- **Astro UX-aligned** — dual-coded status indicators, classification banners, mission clocks
|
|
27
|
+
- **TypeScript-first** — full type definitions
|
|
28
|
+
- **Accessible** — [WCAG 2.2 AA](https://www.w3.org/TR/WCAG22/) conformant, keyboard navigable, reduced-motion aware, EAA-aligned
|
|
29
|
+
- **Tree-shakeable** with optional peer dependencies
|
|
30
|
+
- Works standalone or with [`zendir-ts`](https://www.npmjs.com/package/zendir-ts) for live API integration
|
|
31
|
+
|
|
32
|
+
The full component catalogue with live examples lives in [Storybook](https://storybook.zendir.io).
|
|
33
|
+
|
|
34
|
+
## Quick Start
|
|
35
|
+
|
|
36
|
+
### Install
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm install @zendir/ui
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
> The SDK is optional. All TypeScript types ship with the UI library.
|
|
43
|
+
> Install `zendir-ts` only if you need the API client.
|
|
44
|
+
>
|
|
45
|
+
> Recent versions of `@zendir/ui` hide the SDK specifier from static
|
|
46
|
+
> import-analysis, so no Vite alias is required — missing `zendir-ts` simply
|
|
47
|
+
> causes hooks like `useZendirSession` to report "SDK not installed" while the
|
|
48
|
+
> rest of the UI keeps working.
|
|
49
|
+
>
|
|
50
|
+
> **Older bundlers / strict resolvers:** if you hit "Failed to resolve import
|
|
51
|
+
> 'zendir-ts'", point the optional peer at the bundled stub:
|
|
52
|
+
> ```js
|
|
53
|
+
> // vite.config.js
|
|
54
|
+
> resolve: { alias: { 'zendir-ts': require.resolve('@zendir/ui/sdk-stub') } }
|
|
55
|
+
> ```
|
|
56
|
+
|
|
57
|
+
### Use
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import { ThemeProvider, SpacecraftCard, StatusIndicator } from '@zendir/ui/react';
|
|
61
|
+
|
|
62
|
+
function App() {
|
|
63
|
+
return (
|
|
64
|
+
<ThemeProvider defaultVariant="hybrid" defaultMode="dark">
|
|
65
|
+
<StatusIndicator status="normal" label="System Healthy" />
|
|
66
|
+
|
|
67
|
+
<SpacecraftCard
|
|
68
|
+
spacecraft={{
|
|
69
|
+
id: 'SAT-001',
|
|
70
|
+
name: 'Explorer-1',
|
|
71
|
+
noradId: 25544,
|
|
72
|
+
type: 'LEO Satellite',
|
|
73
|
+
status: 'operational',
|
|
74
|
+
}}
|
|
75
|
+
position={{
|
|
76
|
+
latitude: 45.2,
|
|
77
|
+
longitude: -122.5,
|
|
78
|
+
altitude: 408,
|
|
79
|
+
velocity: 7.66,
|
|
80
|
+
}}
|
|
81
|
+
/>
|
|
82
|
+
</ThemeProvider>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Components
|
|
90
|
+
|
|
91
|
+
### Core
|
|
92
|
+
|
|
93
|
+
Foundational primitives that compose into any interface.
|
|
94
|
+
|
|
95
|
+
| Component | Description |
|
|
96
|
+
|-----------|-------------|
|
|
97
|
+
| `Button` | Primary, secondary, and borderless variants with icon and loading support |
|
|
98
|
+
| `Input` | Text input with label, icon, validation, and size variants |
|
|
99
|
+
| `Select` | Dropdown selection with search and multi-select |
|
|
100
|
+
| `Toggle` | On/off switch with label |
|
|
101
|
+
| `Checkbox` | Checkbox and radio with accessible labeling |
|
|
102
|
+
| `Dialog` | Modal dialog with action slots |
|
|
103
|
+
| `Tabs` | Tabbed navigation with panel content |
|
|
104
|
+
| `Tooltip` | Contextual overlay on hover/focus |
|
|
105
|
+
| `Container` | Surface card with title, status accent, and elevation |
|
|
106
|
+
| `Badge` | Inline status label |
|
|
107
|
+
| `Pagination` | Page navigation controls |
|
|
108
|
+
| `NumberInput` | Numeric stepper with min/max/step and slider |
|
|
109
|
+
| `SidePanel` | Slide-out panel with configurable position |
|
|
110
|
+
| `DataTable` | Sortable, filterable data grid |
|
|
111
|
+
| `Menu` / `Popover` | Context menus and floating content |
|
|
112
|
+
| `ChatPanel` | AI chat interface with structured blocks, status system, and [4 LLM integration strategies](#ai-integration) |
|
|
113
|
+
|
|
114
|
+
### Status & Monitoring
|
|
115
|
+
|
|
116
|
+
Astro UX status system — six severity levels, dual-coded with color and shape so that status is never conveyed by color alone (WCAG 1.4.1 Use of Color).
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
import { StatusIndicator, MonitoringIcon } from '@zendir/ui/react';
|
|
120
|
+
|
|
121
|
+
<StatusIndicator status="normal" label="Operational" />
|
|
122
|
+
<StatusIndicator status="caution" label="Battery Low" />
|
|
123
|
+
<StatusIndicator status="critical" label="Comm Loss" pulse />
|
|
124
|
+
|
|
125
|
+
<MonitoringIcon status="normal" icon="power" label="Power" sublabel="85%" />
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Status levels:** `off` · `standby` · `normal` · `caution` · `serious` · `critical`
|
|
129
|
+
|
|
130
|
+
### Data Cards
|
|
131
|
+
|
|
132
|
+
Pre-built cards for common space operations data. All cards support **compact mode** — collapsed by default, expand on hover, pin on click.
|
|
133
|
+
|
|
134
|
+
| Card | Data |
|
|
135
|
+
|------|------|
|
|
136
|
+
| `SpacecraftCard` | ID, orbit type, status, position |
|
|
137
|
+
| `TelemetryCard` | Subsystem health, alerts |
|
|
138
|
+
| `TelemetryStreamCard` | Live metric streaming |
|
|
139
|
+
| `AccessCard` | Ground station contact windows |
|
|
140
|
+
| `OrbitCard` | Keplerian elements, period, epoch |
|
|
141
|
+
|
|
142
|
+
```tsx
|
|
143
|
+
<SpacecraftCard compact spacecraft={data} position={pos} />
|
|
144
|
+
<TelemetryCard compact telemetry={tlm} />
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### DataValue
|
|
148
|
+
|
|
149
|
+
Display telemetry values with automatic icons, units, and status derivation from 30+ built-in property presets.
|
|
150
|
+
|
|
151
|
+
```tsx
|
|
152
|
+
import { DataValue, DataValueGroup } from '@zendir/ui/react';
|
|
153
|
+
|
|
154
|
+
<DataValue property="temperature" value={72.5} />
|
|
155
|
+
<DataValue property="battery" value={25} /> {/* auto-derives 'caution' */}
|
|
156
|
+
|
|
157
|
+
<DataValueGroup columns={2} title="Power" icon="propulsion-power">
|
|
158
|
+
<DataValue property="battery" value={85} />
|
|
159
|
+
<DataValue property="voltage" value={28.4} />
|
|
160
|
+
<DataValue property="solarPower" value={124} />
|
|
161
|
+
</DataValueGroup>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Presets:** `battery` · `voltage` · `temperature` · `signalStrength` · `altitude` · `velocity` · `fuelLevel` · `cpuUsage` · `memoryUsage` · and 20+ more (see [Storybook](https://storybook.zendir.io) for the full list)
|
|
165
|
+
|
|
166
|
+
### Visualizations
|
|
167
|
+
|
|
168
|
+
Domain-specific visualization cards for mission operations.
|
|
169
|
+
|
|
170
|
+
| Card | Description |
|
|
171
|
+
|------|-------------|
|
|
172
|
+
| `LinkBudgetCard` | RF link budget waterfall |
|
|
173
|
+
| `ThermalHeatmapCard` | Spacecraft thermal zone status |
|
|
174
|
+
| `PropulsionCard` | Fuel, thrusters, delta-V budget |
|
|
175
|
+
| `EclipseTimerCard` | Eclipse/sunlight timing |
|
|
176
|
+
| `NavBallCard` | 3D attitude indicator |
|
|
177
|
+
| `SensorFootprintCard` | Ground sensor coverage |
|
|
178
|
+
|
|
179
|
+
### Charts
|
|
180
|
+
|
|
181
|
+
40+ chart types built on ECharts with Zendir brand and Astro UX data-viz palettes, built-in export (PNG, SVG, CSV), zoom/pan, and streaming support.
|
|
182
|
+
|
|
183
|
+
```tsx
|
|
184
|
+
import { PowerChart, AttitudeChart, GroundTrackMap } from '@zendir/ui/react';
|
|
185
|
+
|
|
186
|
+
<PowerChart data={powerData} height={300} />
|
|
187
|
+
<AttitudeChart data={attitudeData} height={250} />
|
|
188
|
+
<GroundTrackMap groundTrack={track} groundStations={stations} />
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**Includes:** Line, Area, Bar, Pie, Donut, Gauge, Radar, Heatmap, Scatter, Sankey, Treemap, Sunburst, Candlestick, 3D Scatter/Surface/Bar, Waterfall, Doppler, and domain-specific charts for power, attitude, thermal, orbits, contacts, spectrum, and more.
|
|
192
|
+
|
|
193
|
+
### 3D Viewers
|
|
194
|
+
|
|
195
|
+
Three viewers covering the operations spectrum from full-Earth to full solar system, with optional WebGL2 (Three.js) and Cesium backends.
|
|
196
|
+
|
|
197
|
+
```tsx
|
|
198
|
+
import { ZenSpace3D, EarthViewer, SolarSystemViewer } from '@zendir/ui/react';
|
|
199
|
+
|
|
200
|
+
// Unified 3D space view — Three.js by default, optional Cesium backend for
|
|
201
|
+
// physically-accurate ECI/ECEF transforms and high-fidelity Earth imagery.
|
|
202
|
+
// Pair with `useSimulationScene` (see SDK Integration) to render a live
|
|
203
|
+
// simulation directly from a `zendir-ts` `ZendirClient`.
|
|
204
|
+
<ZenSpace3D
|
|
205
|
+
satellites={satellites}
|
|
206
|
+
groundStations={groundStations}
|
|
207
|
+
satelliteCoverages={coverages}
|
|
208
|
+
referenceTime={referenceDate}
|
|
209
|
+
/>
|
|
210
|
+
|
|
211
|
+
// Lightweight Three.js Earth view — good for small dashboards and demos.
|
|
212
|
+
<EarthViewer
|
|
213
|
+
spacecraft={[{ id: 'SAT-001', name: 'Explorer-1', latitude: 45.2, longitude: -122.5, altitude: 408 }]}
|
|
214
|
+
groundStations={[{ id: 'DSN-14', name: 'Goldstone', latitude: 35.4, longitude: -116.9 }]}
|
|
215
|
+
showAtmosphere
|
|
216
|
+
showOrbits
|
|
217
|
+
autoRotate
|
|
218
|
+
/>
|
|
219
|
+
|
|
220
|
+
<SolarSystemViewer focusedPlanet="earth" autoOrbit showLabels />
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Coverage geometry (footprint polygons, sensor cones, nadir lines) is rendered from explicit `SatelliteCoverage` records — see `ZenSpace3DTypes` for the full prop surface. Heavy orbital propagation (SGP4 / TLE) is intentionally **not** shipped in this package; bring your own propagator (e.g. [`satellite.js`](https://github.com/shashwatak/satellite-js)) and feed positions in via props, or use `useSimulationScene` to read live `Position_BN_N` from the engine.
|
|
224
|
+
|
|
225
|
+
### Astro UX Components
|
|
226
|
+
|
|
227
|
+
Mission operations components following [Astro UX Design System](https://www.astrouxds.com/) specifications.
|
|
228
|
+
|
|
229
|
+
| Component | Description |
|
|
230
|
+
|-----------|-------------|
|
|
231
|
+
| `GlobalStatusBar` | Application header with app name, clock, monitoring icons |
|
|
232
|
+
| `MissionClock` | UTC/local time display with multiple formats |
|
|
233
|
+
| `ClassificationBanner` | Security classification banner (CUI through Top Secret) |
|
|
234
|
+
| `Timeline` | Gantt, list, and scatter views for mission events |
|
|
235
|
+
| `Progress` | Determinate and indeterminate progress indicators |
|
|
236
|
+
| `Notification` | Toast notifications with status and auto-dismiss |
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Theme System
|
|
241
|
+
|
|
242
|
+
Wrap your application in `ThemeProvider` to enable the full token-based design system.
|
|
243
|
+
|
|
244
|
+
```tsx
|
|
245
|
+
import { ThemeProvider, useTheme } from '@zendir/ui/react';
|
|
246
|
+
|
|
247
|
+
<ThemeProvider
|
|
248
|
+
defaultVariant="hybrid" // 'astro' | 'purple-hue' | 'hybrid' | 'nebula' |
|
|
249
|
+
// 'transparent' | 'transparent-bold' | 'transparent-minimal'
|
|
250
|
+
defaultMode="dark" // 'light' | 'dark'
|
|
251
|
+
persist={true} // save to localStorage
|
|
252
|
+
>
|
|
253
|
+
<App />
|
|
254
|
+
</ThemeProvider>
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
Seven theme variants are available: `hybrid` (default, Astro status colors + purple accents), `nebula` (palette-native — Ultraviolet accent on Zendir neutral surfaces), `astro` (AstroUXDS reference, dark + light), `purple-hue`, and the glassmorphic `transparent` / `transparent-bold` / `transparent-minimal` family.
|
|
258
|
+
|
|
259
|
+
Access tokens anywhere:
|
|
260
|
+
|
|
261
|
+
```tsx
|
|
262
|
+
const { tokens, mode, setMode } = useTheme();
|
|
263
|
+
|
|
264
|
+
<div style={{
|
|
265
|
+
background: tokens.colors.background.surface,
|
|
266
|
+
color: tokens.colors.text.primary,
|
|
267
|
+
padding: tokens.spacing.md,
|
|
268
|
+
borderRadius: tokens.borderRadius.md,
|
|
269
|
+
}}>
|
|
270
|
+
...
|
|
271
|
+
</div>
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
**Token categories:** colors (background, border, text, status, semantic, accent, interactive) · spacing · border radius · typography (Astro-compliant scale) · shadows · animation · focus
|
|
275
|
+
|
|
276
|
+
Tokens flow from primitive palettes (`src/tokens/palettes/` — Zendir brand, Astro UXDS status, Tailwind v4.2 scales) through semantic themes (`src/tokens/themes.ts`) into generated CSS variables (`@zendir/ui/tokens/css`, `--zendir-*`) and the `ThemeProvider` runtime. See `THEME_ARCHITECTURE.md` for the full layering model.
|
|
277
|
+
|
|
278
|
+
### Card Accent System
|
|
279
|
+
|
|
280
|
+
Automatically assign accent colors to cards by content domain:
|
|
281
|
+
|
|
282
|
+
```tsx
|
|
283
|
+
import { CardAccentProvider, useCardAccent } from '@zendir/ui/react';
|
|
284
|
+
|
|
285
|
+
<CardAccentProvider accentMode="mix">
|
|
286
|
+
<Container title="Power Systems" accentColor={getAccentColor('Power Systems')}>
|
|
287
|
+
...
|
|
288
|
+
</Container>
|
|
289
|
+
</CardAccentProvider>
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
**Accent modes:** `cyan` · `electric` · `purple` · `teal` · `prussianBlue` · `green` · `amber` · `mix`
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## SDK Integration (Optional)
|
|
297
|
+
|
|
298
|
+
For live API integration, add the Zendir TypeScript SDK (`zendir-ts`):
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
npm install zendir-ts
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
`useZendirSession` provisions the container + simulation lifecycle.
|
|
305
|
+
`useSimulationScene` is the canonical bridge — it polls `Position_BN_N`,
|
|
306
|
+
buckets the simulation structure, and feeds props straight into `<ZenSpace3D />`.
|
|
307
|
+
|
|
308
|
+
```tsx
|
|
309
|
+
import { useZendirSession, useSimulationScene, ZenSpace3D } from '@zendir/ui/react';
|
|
310
|
+
|
|
311
|
+
function MissionControl() {
|
|
312
|
+
// Lifecycle: createContainer → waitForRunning → createSimulation
|
|
313
|
+
const { client, session, connect, disconnect, isLoading, error } =
|
|
314
|
+
useZendirSession({ apiKey: 'your-key', autoConnect: true });
|
|
315
|
+
|
|
316
|
+
// Live data: structure + position polling, ECI→ECEF on the Cesium backend
|
|
317
|
+
const scene = useSimulationScene({
|
|
318
|
+
client,
|
|
319
|
+
containerId: session?.containerId ?? null,
|
|
320
|
+
simulationId: session?.simulationId ?? null,
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
if (error) return <div>Error: {error}</div>;
|
|
324
|
+
if (isLoading) return <div>Connecting…</div>;
|
|
325
|
+
if (!session) return <button onClick={connect}>Connect</button>;
|
|
326
|
+
|
|
327
|
+
return (
|
|
328
|
+
<ZenSpace3D
|
|
329
|
+
satellites={scene.satellites}
|
|
330
|
+
groundStations={scene.groundStations}
|
|
331
|
+
referenceTime={scene.referenceDate}
|
|
332
|
+
/>
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
| Hook | Purpose |
|
|
338
|
+
|---|---|
|
|
339
|
+
| `useZendirSession` | Container + simulation lifecycle (`createContainer` → `waitForRunning` → `createSimulation`); `disconnect` tears down |
|
|
340
|
+
| `useSimulationScene` | Bridges a `ZendirClient` to live `<ZenSpace3D />` props (satellites, ground stations, custom objects, reference time) |
|
|
341
|
+
| `useAccessWindows` | Pure client-side AOS/LOS pass-timing math from a list of `AccessPass` records (no SDK call) |
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
## AI Integration
|
|
346
|
+
|
|
347
|
+
The `ChatPanel` component provides a complete AI-powered operator interface with structured responses, interactive blocks, and four integration strategies — including first-class MCP (Model Context Protocol) support.
|
|
348
|
+
|
|
349
|
+
### Quick Setup
|
|
350
|
+
|
|
351
|
+
```tsx
|
|
352
|
+
import { ChatPanel, parseChatResponse } from '@zendir/ui/react';
|
|
353
|
+
|
|
354
|
+
function OperatorChat() {
|
|
355
|
+
const [messages, setMessages] = useState([]);
|
|
356
|
+
|
|
357
|
+
const handleSend = async (text) => {
|
|
358
|
+
setMessages(prev => [...prev, { id: Date.now(), role: 'user', content: text, timestamp: Date.now() }]);
|
|
359
|
+
const response = await callYourAI(text);
|
|
360
|
+
const msg = parseChatResponse(response); // auto-detects JSON, YAML, or plain text
|
|
361
|
+
setMessages(prev => [...prev, msg]);
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
return <ChatPanel messages={messages} onSend={handleSend} title="Mission AI" />;
|
|
365
|
+
}
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
### Four Integration Strategies
|
|
369
|
+
|
|
370
|
+
| Strategy | Token Cost | Best For |
|
|
371
|
+
|----------|-----------|----------|
|
|
372
|
+
| **Tool/Function Calling** | Lowest | OpenAI, Anthropic, Gemini (production) |
|
|
373
|
+
| **MCP (Model Context Protocol)** | Lowest | Multi-tool, multi-server architectures |
|
|
374
|
+
| **YAML Prompt** | ~30-40% less than JSON | Any LLM, cost-sensitive deployments |
|
|
375
|
+
| **JSON Prompt** | Baseline | Simplest setup, widest LLM compatibility |
|
|
376
|
+
|
|
377
|
+
#### Strategy 1: Tool / Function Calling _(recommended for single-provider)_
|
|
378
|
+
|
|
379
|
+
```ts
|
|
380
|
+
import { CHAT_RESPONSE_TOOL_SCHEMA, parseChatResponse } from '@zendir/ui/react';
|
|
381
|
+
|
|
382
|
+
// OpenAI
|
|
383
|
+
const res = await openai.chat.completions.create({
|
|
384
|
+
model: 'gpt-4o',
|
|
385
|
+
messages: history,
|
|
386
|
+
tools: [{ type: 'function', function: CHAT_RESPONSE_TOOL_SCHEMA }],
|
|
387
|
+
tool_choice: { type: 'function', function: { name: 'respond_to_operator' } },
|
|
388
|
+
});
|
|
389
|
+
const msg = parseChatResponse(res.choices[0].message.tool_calls[0].function.arguments, 'json');
|
|
390
|
+
|
|
391
|
+
// Anthropic
|
|
392
|
+
tools: [{ name: CHAT_RESPONSE_TOOL_SCHEMA.name,
|
|
393
|
+
description: CHAT_RESPONSE_TOOL_SCHEMA.description,
|
|
394
|
+
input_schema: CHAT_RESPONSE_TOOL_SCHEMA.parameters }]
|
|
395
|
+
|
|
396
|
+
// Google Gemini
|
|
397
|
+
tools: [{ functionDeclarations: [CHAT_RESPONSE_TOOL_SCHEMA] }]
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
#### Strategy 2: MCP (Model Context Protocol) _(recommended for multi-tool)_
|
|
401
|
+
|
|
402
|
+
```ts
|
|
403
|
+
// Server: Register your tool with the pre-built schema
|
|
404
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
405
|
+
import { CHAT_RESPONSE_MCP_TOOL } from '@zendir/ui';
|
|
406
|
+
|
|
407
|
+
const server = new McpServer({ name: 'ops-assistant', version: '1.0.0' });
|
|
408
|
+
server.tool(
|
|
409
|
+
CHAT_RESPONSE_MCP_TOOL.name,
|
|
410
|
+
CHAT_RESPONSE_MCP_TOOL.description,
|
|
411
|
+
CHAT_RESPONSE_MCP_TOOL.inputSchema,
|
|
412
|
+
async (args) => ({ content: [{ type: 'text', text: JSON.stringify(args) }] })
|
|
413
|
+
);
|
|
414
|
+
|
|
415
|
+
// Client: Convert MCP results to ChatPanel messages
|
|
416
|
+
import { parseMcpToolResult } from '@zendir/ui/react';
|
|
417
|
+
|
|
418
|
+
const result = await mcpClient.callTool({ name: 'check_health', arguments: { id: 'SAT-001' } });
|
|
419
|
+
const msg = parseMcpToolResult('check_health', result);
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
#### Strategy 3: YAML Prompt
|
|
423
|
+
|
|
424
|
+
```ts
|
|
425
|
+
import { CHAT_RESPONSE_YAML_PROMPT, CHAT_STATUS_RULES_PROMPT, parseChatResponse } from '@zendir/ui/react';
|
|
426
|
+
|
|
427
|
+
const systemPrompt = `You are a spacecraft ops assistant.\n\n${CHAT_RESPONSE_YAML_PROMPT}\n\n${CHAT_STATUS_RULES_PROMPT}`;
|
|
428
|
+
const msg = parseChatResponse(aiOutput, 'yaml');
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
#### Strategy 4: JSON Prompt
|
|
432
|
+
|
|
433
|
+
```ts
|
|
434
|
+
import { CHAT_RESPONSE_JSON_PROMPT, CHAT_STATUS_RULES_PROMPT, parseChatResponse } from '@zendir/ui/react';
|
|
435
|
+
|
|
436
|
+
const systemPrompt = `You are a spacecraft ops assistant.\n\n${CHAT_RESPONSE_JSON_PROMPT}\n\n${CHAT_STATUS_RULES_PROMPT}`;
|
|
437
|
+
const msg = parseChatResponse(aiOutput, 'json');
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
### Global Configuration
|
|
441
|
+
|
|
442
|
+
```ts
|
|
443
|
+
import yaml from 'js-yaml';
|
|
444
|
+
import { createChatResponseParser } from '@zendir/ui/react';
|
|
445
|
+
|
|
446
|
+
// Create once, use everywhere
|
|
447
|
+
export const parseAI = createChatResponseParser({
|
|
448
|
+
yamlParser: (s) => yaml.load(s), // plug in production YAML parser
|
|
449
|
+
defaultFormat: 'yaml', // default format
|
|
450
|
+
});
|
|
451
|
+
|
|
452
|
+
const msg = parseAI(aiOutput);
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
### Structured Blocks
|
|
456
|
+
|
|
457
|
+
AI responses can include rich structured content:
|
|
458
|
+
|
|
459
|
+
| Block Type | Description | Interactive |
|
|
460
|
+
|-----------|-------------|-------------|
|
|
461
|
+
| `alert` | Status banner with severity shape | No |
|
|
462
|
+
| `telemetry` | Key-value readout with per-row status | No |
|
|
463
|
+
| `progress` | Progress bar with status color | No |
|
|
464
|
+
| `table` | Data table with column headers | No |
|
|
465
|
+
| `kv` | Compact key-value metadata | No |
|
|
466
|
+
| `command` | Code block with copy/run buttons | Yes |
|
|
467
|
+
| `choice` | Single or multi-select options | Yes |
|
|
468
|
+
| `confirm` | Confirmation gate (authorize/abort) | Yes |
|
|
469
|
+
|
|
470
|
+
Interactive blocks fire `onBlockEvent` with `{ blockId, messageId, action, value }`.
|
|
471
|
+
|
|
472
|
+
### Exported Helpers
|
|
473
|
+
|
|
474
|
+
| Export | What It Does |
|
|
475
|
+
|--------|-------------|
|
|
476
|
+
| `CHAT_RESPONSE_TOOL_SCHEMA` | Function/tool schema for OpenAI, Anthropic, Gemini |
|
|
477
|
+
| `CHAT_RESPONSE_MCP_TOOL` | MCP server tool definition (for `server.tool()` registration) |
|
|
478
|
+
| `parseChatResponse()` | Universal parser: auto-detects JSON / YAML / plain text |
|
|
479
|
+
| `parseMcpToolResult()` | Bridge MCP tool results → ChatMessage with blocks |
|
|
480
|
+
| `createChatResponseParser()` | Factory for pre-configured parser (custom YAML, format, IDs) |
|
|
481
|
+
| `CHAT_RESPONSE_JSON_PROMPT` | JSON format instructions + block schema |
|
|
482
|
+
| `CHAT_RESPONSE_YAML_PROMPT` | YAML format instructions + block schema |
|
|
483
|
+
| `CHAT_STATUS_RULES_PROMPT` | Astro UX status thresholds (battery, temp, signal, memory) |
|
|
484
|
+
| `McpToolResult` / `McpToolContent` | Lightweight MCP types (no SDK dependency needed) |
|
|
485
|
+
|
|
486
|
+
> See the **[AI Integration Guide](https://storybook.zendir.io/?path=/story/core-chatpanel--ai-integration-guide)** and **[MCP Integration](https://storybook.zendir.io/?path=/story/core-chatpanel--mcp-integration)** stories in Storybook for interactive demos.
|
|
487
|
+
|
|
488
|
+
---
|
|
489
|
+
|
|
490
|
+
## AI Host / MCP Integration
|
|
491
|
+
|
|
492
|
+
Components are designed to embed in any AI host — ChatGPT Apps, Anthropic MCP Apps, Google Gemini, or any MCP-compatible environment. The SDK includes dedicated hooks and a universal widget wrapper:
|
|
493
|
+
|
|
494
|
+
### AppCard — Universal Widget Wrapper
|
|
495
|
+
|
|
496
|
+
`AppCard` is the base widget wrapper for any AI host — ChatGPT Apps, Anthropic MCP Apps, Google Gemini, or any MCP-compatible environment:
|
|
497
|
+
|
|
498
|
+
```tsx
|
|
499
|
+
import { AppCard, useToolOutput, useCallTool } from '@zendir/ui/react';
|
|
500
|
+
|
|
501
|
+
function SatelliteWidget() {
|
|
502
|
+
const data = useToolOutput<SatelliteHealth>();
|
|
503
|
+
const { callTool, isLoading, error } = useCallTool();
|
|
504
|
+
|
|
505
|
+
return (
|
|
506
|
+
<AppCard
|
|
507
|
+
title="SAT-001"
|
|
508
|
+
subtitle="Health Monitor · LEO 421km"
|
|
509
|
+
status={{ level: 'caution', label: 'Battery Low' }} // Astro UX dual-coded (shape + color)
|
|
510
|
+
loading={isLoading}
|
|
511
|
+
error={error?.message}
|
|
512
|
+
onRetry={() => callTool('refresh_telemetry', { id: 'SAT-001' })}
|
|
513
|
+
allowFullscreen
|
|
514
|
+
icon={<span>🛰️</span>}
|
|
515
|
+
>
|
|
516
|
+
<TelemetryDisplay data={data} />
|
|
517
|
+
</AppCard>
|
|
518
|
+
);
|
|
519
|
+
}
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
**Enterprise features:** Error boundary (children never crash host), loading skeleton, error display with retry, Astro UX 6-level status badges with shapes, WCAG 2.1 AA ARIA labels, `maxHeight` auto-constraint, theme sync, fullscreen support.
|
|
523
|
+
|
|
524
|
+
### MCP Server → ChatPanel Bridge
|
|
525
|
+
|
|
526
|
+
Register your MCP server tools to produce ChatPanel-compatible structured blocks:
|
|
527
|
+
|
|
528
|
+
```ts
|
|
529
|
+
// server.ts
|
|
530
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
531
|
+
import { CHAT_RESPONSE_MCP_TOOL } from '@zendir/ui';
|
|
532
|
+
|
|
533
|
+
const server = new McpServer({ name: 'sat-ops', version: '1.0.0' });
|
|
534
|
+
server.tool(
|
|
535
|
+
CHAT_RESPONSE_MCP_TOOL.name,
|
|
536
|
+
CHAT_RESPONSE_MCP_TOOL.description,
|
|
537
|
+
CHAT_RESPONSE_MCP_TOOL.inputSchema,
|
|
538
|
+
async (args) => ({ content: [{ type: 'text', text: JSON.stringify(args) }] })
|
|
539
|
+
);
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
```tsx
|
|
543
|
+
// client.tsx — Parse MCP results into ChatPanel messages
|
|
544
|
+
import { parseMcpToolResult, ChatPanel } from '@zendir/ui/react';
|
|
545
|
+
|
|
546
|
+
const result = await mcpClient.callTool({ name: 'check_health', arguments: { id: 'SAT-001' } });
|
|
547
|
+
const msg = parseMcpToolResult('check_health', result); // → ChatMessage with typed blocks
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
### Available Host Hooks
|
|
551
|
+
|
|
552
|
+
| Hook | Purpose |
|
|
553
|
+
|------|---------|
|
|
554
|
+
| `useToolOutput()` | Read tool result (structuredContent) |
|
|
555
|
+
| `useToolInput()` | Read tool invocation arguments |
|
|
556
|
+
| `useCallTool()` | Call other MCP tools from widget |
|
|
557
|
+
| `useSendMessage()` | Insert follow-up user messages |
|
|
558
|
+
| `useChatGPTTheme()` | Match light/dark theme |
|
|
559
|
+
| `useWidgetState()` | Persist widget state across renders |
|
|
560
|
+
| `useMaxHeight()` | Get host height constraint |
|
|
561
|
+
| `useDisplayMode()` | Manage inline/PiP/fullscreen |
|
|
562
|
+
| `isInChatGPT()` | Detect ChatGPT environment |
|
|
563
|
+
|
|
564
|
+
---
|
|
565
|
+
|
|
566
|
+
## Project Structure
|
|
567
|
+
|
|
568
|
+
```
|
|
569
|
+
src/
|
|
570
|
+
├── react/
|
|
571
|
+
│ ├── core/ # Buttons, inputs, dialogs, data table
|
|
572
|
+
│ ├── astro/ # Astro UX — timeline, status bar, clock
|
|
573
|
+
│ ├── cards/ # Spacecraft, telemetry, orbit, access
|
|
574
|
+
│ ├── charts/ # 40+ ECharts components
|
|
575
|
+
│ ├── visualizations/ # Link budget, thermal, propulsion
|
|
576
|
+
│ ├── 3d/ # Earth viewer, solar system
|
|
577
|
+
│ ├── hooks/ # Data hooks
|
|
578
|
+
│ ├── theme/ # ThemeProvider runtime, theme types, foundation stories
|
|
579
|
+
│ ├── chatgpt/ # AI host / MCP integration (AppCard, hooks)
|
|
580
|
+
│ └── shared/ # Error boundaries, skeletons, utils
|
|
581
|
+
└── tokens/ # Design tokens
|
|
582
|
+
├── palettes/ # Primitive color scales (Zendir, Astro UXDS, Tailwind v4.2)
|
|
583
|
+
├── themes.ts # Semantic theme definitions (7 variants)
|
|
584
|
+
├── core.ts # Shared non-color tokens (spacing, typography, shadows)
|
|
585
|
+
└── tokens.css # Generated CSS variables (+ css-vars.ts) — npm run build:tokens
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
## Development
|
|
589
|
+
|
|
590
|
+
```bash
|
|
591
|
+
git clone https://github.com/zendir-dev/zendir-ui.git
|
|
592
|
+
cd zendir-ui && npm install
|
|
593
|
+
|
|
594
|
+
npm run storybook # Component playground
|
|
595
|
+
npm run demo # Full demo app
|
|
596
|
+
npm run build # Production build
|
|
597
|
+
npm run test # Run tests
|
|
598
|
+
npm run lint # Lint check
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
## Accessibility
|
|
602
|
+
|
|
603
|
+
Zendir UI conforms to [**WCAG 2.2 Level AA**](https://www.w3.org/TR/WCAG22/) and is designed to satisfy the [**European Accessibility Act (EAA)**](https://ec.europa.eu/social/main.jsp?catId=1202) via [**EN 301 549 v3.2.1**](https://www.etsi.org/deliver/etsi_en/301500_301599/301549/03.02.01_60/en_301549v030201p.pdf) and the **Revised Section 508**.
|
|
604
|
+
|
|
605
|
+
- **Keyboard** — every component is fully operable via keyboard. Focus order follows DOM order, focus indicators meet 3:1 contrast, and no keyboard traps exist.
|
|
606
|
+
- **Screen readers** — semantic HTML, ARIA roles, live regions for dynamic content, and descriptive labels on all icon-only controls.
|
|
607
|
+
- **Color** — status indicators use dual coding (color + shape). All text meets 4.5:1 contrast; accent colors are dynamically adjusted at runtime to guarantee compliance across all themes.
|
|
608
|
+
- **Motion** — all animations and transitions respect `prefers-reduced-motion` globally via CSS and JavaScript.
|
|
609
|
+
- **Target size** — interactive controls meet the 24 × 24 px minimum (WCAG 2.5.8).
|
|
610
|
+
- **Forms** — validation errors are identified with `aria-invalid`, associated via `aria-describedby`, and announced with `role="alert"`.
|
|
611
|
+
|
|
612
|
+
| Standard | Status |
|
|
613
|
+
|----------|--------|
|
|
614
|
+
| WCAG 2.2 Level AA | Conformant |
|
|
615
|
+
| EN 301 549 v3.2.1 Clause 11 | Designed for conformance |
|
|
616
|
+
| EAA Directive (EU) 2019/882 | Designed for conformance |
|
|
617
|
+
| Revised Section 508 | Conformant |
|
|
618
|
+
|
|
619
|
+
Testing: [eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y) in CI, [axe-core](https://storybook.js.org/addons/@storybook/addon-a11y) on all Storybook stories, manual keyboard and screen reader verification (VoiceOver, NVDA, TalkBack).
|
|
620
|
+
|
|
621
|
+
Accessibility issues are treated as **P0 bugs**. [Report an issue](https://github.com/zendir-dev/zendir-ui/issues) with the `accessibility` label.
|
|
622
|
+
|
|
623
|
+
---
|
|
624
|
+
|
|
625
|
+
## Browser Support
|
|
626
|
+
|
|
627
|
+
Chrome 90+ · Firefox 88+ · Safari 14+ · Edge 90+
|
|
628
|
+
|
|
629
|
+
WebGL required for 3D components (graceful fallback to 2D).
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
## License
|
|
633
|
+
|
|
634
|
+
[MIT](LICENSE) — Space Services Australia Pty Ltd
|
|
635
|
+
|
|
636
|
+
---
|
|
637
|
+
|
|
638
|
+
<p align="center">
|
|
639
|
+
<a href="https://www.astrouxds.com/">Astro UX Design System</a> · <a href="https://storybook.zendir.io">Storybook</a> · <a href="https://github.com/zendir-dev/zendir-ui/issues">Issues</a> · <a href="CONTRIBUTING.md">Contributing</a>
|
|
640
|
+
</p>
|