@zendir/ui 0.1.0
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 +19 -0
- package/LICENSE +21 -0
- package/README.md +589 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +421 -0
- package/dist/index.js.map +1 -0
- package/dist/react/3d/EarthViewer.d.ts +46 -0
- package/dist/react/3d/EarthViewer.js +836 -0
- package/dist/react/3d/EarthViewer.js.map +1 -0
- package/dist/react/3d/SolarSystemViewer.d.ts +43 -0
- package/dist/react/3d/SolarSystemViewer.js +372 -0
- package/dist/react/3d/SolarSystemViewer.js.map +1 -0
- package/dist/react/3d/ZenSpace3D.d.ts +16 -0
- package/dist/react/3d/ZenSpace3D.js +1253 -0
- package/dist/react/3d/ZenSpace3D.js.map +1 -0
- package/dist/react/3d/ZenSpace3DCesium.d.ts +9 -0
- package/dist/react/3d/ZenSpace3DCesium.js +186 -0
- package/dist/react/3d/ZenSpace3DCesium.js.map +1 -0
- package/dist/react/3d/ZenSpace3DShaders.d.ts +78 -0
- package/dist/react/3d/ZenSpace3DShaders.js +94 -0
- package/dist/react/3d/ZenSpace3DShaders.js.map +1 -0
- package/dist/react/3d/ZenSpace3DTypes.d.ts +614 -0
- package/dist/react/3d/ZenSpace3DUtils.d.ts +183 -0
- package/dist/react/3d/ZenSpace3DUtils.js +213 -0
- package/dist/react/3d/ZenSpace3DUtils.js.map +1 -0
- package/dist/react/3d/index.d.ts +23 -0
- package/dist/react/3d/threeLoader.d.ts +22 -0
- package/dist/react/3d/threeLoader.js +18 -0
- package/dist/react/3d/threeLoader.js.map +1 -0
- package/dist/react/astro/ClassificationBanner.d.ts +25 -0
- package/dist/react/astro/ClassificationBanner.js +83 -0
- package/dist/react/astro/ClassificationBanner.js.map +1 -0
- package/dist/react/astro/GlobalStatusBar.d.ts +42 -0
- package/dist/react/astro/GlobalStatusBar.js +165 -0
- package/dist/react/astro/GlobalStatusBar.js.map +1 -0
- package/dist/react/astro/MissionClock.d.ts +169 -0
- package/dist/react/astro/MissionClock.js +411 -0
- package/dist/react/astro/MissionClock.js.map +1 -0
- package/dist/react/astro/MonitoringIcon.d.ts +60 -0
- package/dist/react/astro/MonitoringIcon.js +369 -0
- package/dist/react/astro/MonitoringIcon.js.map +1 -0
- package/dist/react/astro/Notification.d.ts +42 -0
- package/dist/react/astro/Notification.js +156 -0
- package/dist/react/astro/Notification.js.map +1 -0
- package/dist/react/astro/Progress.d.ts +39 -0
- package/dist/react/astro/Progress.js +149 -0
- package/dist/react/astro/Progress.js.map +1 -0
- package/dist/react/astro/SimulationControls.d.ts +136 -0
- package/dist/react/astro/SimulationControls.js +668 -0
- package/dist/react/astro/SimulationControls.js.map +1 -0
- package/dist/react/astro/StatusIndicator.d.ts +34 -0
- package/dist/react/astro/StatusIndicator.js +189 -0
- package/dist/react/astro/StatusIndicator.js.map +1 -0
- package/dist/react/astro/UnifiedTimeline.d.ts +106 -0
- package/dist/react/astro/UnifiedTimeline.js +1768 -0
- package/dist/react/astro/UnifiedTimeline.js.map +1 -0
- package/dist/react/astro/index.d.ts +63 -0
- package/dist/react/cards/AccessCard.d.ts +37 -0
- package/dist/react/cards/AccessCard.js +410 -0
- package/dist/react/cards/AccessCard.js.map +1 -0
- package/dist/react/cards/OrbitCard.d.ts +31 -0
- package/dist/react/cards/OrbitCard.js +372 -0
- package/dist/react/cards/OrbitCard.js.map +1 -0
- package/dist/react/cards/SpacecraftCard.d.ts +54 -0
- package/dist/react/cards/SpacecraftCard.js +941 -0
- package/dist/react/cards/SpacecraftCard.js.map +1 -0
- package/dist/react/cards/TelemetryCard.d.ts +40 -0
- package/dist/react/cards/TelemetryCard.js +742 -0
- package/dist/react/cards/TelemetryCard.js.map +1 -0
- package/dist/react/cards/TelemetryStreamCard.d.ts +59 -0
- package/dist/react/cards/TelemetryStreamCard.js +309 -0
- package/dist/react/cards/TelemetryStreamCard.js.map +1 -0
- package/dist/react/cards/index.d.ts +13 -0
- package/dist/react/charts/GroundTrackMap.d.ts +112 -0
- package/dist/react/charts/GroundTrackMap.js +1123 -0
- package/dist/react/charts/GroundTrackMap.js.map +1 -0
- package/dist/react/charts/GroundTrackMapLeaflet.d.ts +26 -0
- package/dist/react/charts/GroundTrackMapLeaflet.js +571 -0
- package/dist/react/charts/GroundTrackMapLeaflet.js.map +1 -0
- package/dist/react/charts/groundTrackMapLeafletTiles.d.ts +22 -0
- package/dist/react/charts/groundTrackMapLeafletTiles.js +11 -0
- package/dist/react/charts/groundTrackMapLeafletTiles.js.map +1 -0
- package/dist/react/charts/groundTrackMapLeafletUtils.d.ts +24 -0
- package/dist/react/charts/groundTrackMapLeafletUtils.js +109 -0
- package/dist/react/charts/groundTrackMapLeafletUtils.js.map +1 -0
- package/dist/react/charts/index.d.ts +10 -0
- package/dist/react/charts/unified/AstroChart.d.ts +24 -0
- package/dist/react/charts/unified/AstroChart.js +1405 -0
- package/dist/react/charts/unified/AstroChart.js.map +1 -0
- package/dist/react/charts/unified/PowerOverviewChart.d.ts +73 -0
- package/dist/react/charts/unified/PowerOverviewChart.js +488 -0
- package/dist/react/charts/unified/PowerOverviewChart.js.map +1 -0
- package/dist/react/charts/unified/domain.d.ts +845 -0
- package/dist/react/charts/unified/domain.js +3168 -0
- package/dist/react/charts/unified/domain.js.map +1 -0
- package/dist/react/charts/unified/generators.d.ts +276 -0
- package/dist/react/charts/unified/generators.js +518 -0
- package/dist/react/charts/unified/generators.js.map +1 -0
- package/dist/react/charts/unified/index.d.ts +55 -0
- package/dist/react/charts/unified/presets.d.ts +290 -0
- package/dist/react/charts/unified/presets.js +999 -0
- package/dist/react/charts/unified/presets.js.map +1 -0
- package/dist/react/charts/unified/sync.d.ts +69 -0
- package/dist/react/charts/unified/sync.js +219 -0
- package/dist/react/charts/unified/sync.js.map +1 -0
- package/dist/react/charts/unified/theme.d.ts +447 -0
- package/dist/react/charts/unified/theme.js +562 -0
- package/dist/react/charts/unified/theme.js.map +1 -0
- package/dist/react/charts/unified/types.d.ts +826 -0
- package/dist/react/charts/unified/useChartStream.d.ts +58 -0
- package/dist/react/charts/unified/useChartStream.js +226 -0
- package/dist/react/charts/unified/useChartStream.js.map +1 -0
- package/dist/react/chatgpt/AppCard.d.ts +59 -0
- package/dist/react/chatgpt/AppCard.js +306 -0
- package/dist/react/chatgpt/AppCard.js.map +1 -0
- package/dist/react/chatgpt/ChatGPTCard.d.ts +6 -0
- package/dist/react/chatgpt/index.d.ts +167 -0
- package/dist/react/chatgpt/index.js +166 -0
- package/dist/react/chatgpt/index.js.map +1 -0
- package/dist/react/context/DisplaySettingsContext.d.ts +107 -0
- package/dist/react/context/DisplaySettingsContext.js +169 -0
- package/dist/react/context/DisplaySettingsContext.js.map +1 -0
- package/dist/react/context/index.d.ts +5 -0
- package/dist/react/core/ActivityPlanner.d.ts +45 -0
- package/dist/react/core/ActivityPlanner.js +532 -0
- package/dist/react/core/ActivityPlanner.js.map +1 -0
- package/dist/react/core/AppBar.d.ts +71 -0
- package/dist/react/core/AppBar.js +817 -0
- package/dist/react/core/AppBar.js.map +1 -0
- package/dist/react/core/AstroIcon.d.ts +84 -0
- package/dist/react/core/AstroIcon.js +1243 -0
- package/dist/react/core/AstroIcon.js.map +1 -0
- package/dist/react/core/Badge.d.ts +27 -0
- package/dist/react/core/Badge.js +134 -0
- package/dist/react/core/Badge.js.map +1 -0
- package/dist/react/core/Button.d.ts +26 -0
- package/dist/react/core/Button.js +306 -0
- package/dist/react/core/Button.js.map +1 -0
- package/dist/react/core/CardHeader.d.ts +34 -0
- package/dist/react/core/CardHeader.js +316 -0
- package/dist/react/core/CardHeader.js.map +1 -0
- package/dist/react/core/ChatPanel.d.ts +627 -0
- package/dist/react/core/ChatPanel.js +1144 -0
- package/dist/react/core/ChatPanel.js.map +1 -0
- package/dist/react/core/Checkbox.d.ts +26 -0
- package/dist/react/core/Checkbox.js +130 -0
- package/dist/react/core/Checkbox.js.map +1 -0
- package/dist/react/core/ColorPickerPanel.d.ts +25 -0
- package/dist/react/core/ColorPickerPanel.js +293 -0
- package/dist/react/core/ColorPickerPanel.js.map +1 -0
- package/dist/react/core/CommandBuilder.d.ts +74 -0
- package/dist/react/core/CommandBuilder.js +518 -0
- package/dist/react/core/CommandBuilder.js.map +1 -0
- package/dist/react/core/ConfirmDialog.d.ts +45 -0
- package/dist/react/core/ConfirmDialog.js +315 -0
- package/dist/react/core/ConfirmDialog.js.map +1 -0
- package/dist/react/core/ConnectionForm.d.ts +57 -0
- package/dist/react/core/ConnectionForm.js +496 -0
- package/dist/react/core/ConnectionForm.js.map +1 -0
- package/dist/react/core/Container.d.ts +51 -0
- package/dist/react/core/Container.js +670 -0
- package/dist/react/core/Container.js.map +1 -0
- package/dist/react/core/CopyButton.d.ts +39 -0
- package/dist/react/core/CopyButton.js +105 -0
- package/dist/react/core/CopyButton.js.map +1 -0
- package/dist/react/core/DataTable.d.ts +113 -0
- package/dist/react/core/DataTable.js +446 -0
- package/dist/react/core/DataTable.js.map +1 -0
- package/dist/react/core/DataValue.d.ts +64 -0
- package/dist/react/core/DataValue.js +545 -0
- package/dist/react/core/DataValue.js.map +1 -0
- package/dist/react/core/Dialog.d.ts +32 -0
- package/dist/react/core/Dialog.js +201 -0
- package/dist/react/core/Dialog.js.map +1 -0
- package/dist/react/core/FileExplorer.d.ts +65 -0
- package/dist/react/core/FileExplorer.js +520 -0
- package/dist/react/core/FileExplorer.js.map +1 -0
- package/dist/react/core/GlassCard.d.ts +129 -0
- package/dist/react/core/GlassCard.js +375 -0
- package/dist/react/core/GlassCard.js.map +1 -0
- package/dist/react/core/HeaderIconWithStatus.d.ts +39 -0
- package/dist/react/core/HeaderIconWithStatus.js +157 -0
- package/dist/react/core/HeaderIconWithStatus.js.map +1 -0
- package/dist/react/core/HexViewer.d.ts +143 -0
- package/dist/react/core/HexViewer.js +1106 -0
- package/dist/react/core/HexViewer.js.map +1 -0
- package/dist/react/core/Icon.d.ts +32 -0
- package/dist/react/core/Icon.js +142 -0
- package/dist/react/core/Icon.js.map +1 -0
- package/dist/react/core/ImageGallery.d.ts +41 -0
- package/dist/react/core/ImageGallery.js +320 -0
- package/dist/react/core/ImageGallery.js.map +1 -0
- package/dist/react/core/Input.d.ts +38 -0
- package/dist/react/core/Input.js +288 -0
- package/dist/react/core/Input.js.map +1 -0
- package/dist/react/core/LimitsBar.d.ts +51 -0
- package/dist/react/core/LimitsBar.js +200 -0
- package/dist/react/core/LimitsBar.js.map +1 -0
- package/dist/react/core/LogViewer.d.ts +61 -0
- package/dist/react/core/LogViewer.js +599 -0
- package/dist/react/core/LogViewer.js.map +1 -0
- package/dist/react/core/MessageStream.d.ts +58 -0
- package/dist/react/core/MessageStream.js +455 -0
- package/dist/react/core/MessageStream.js.map +1 -0
- package/dist/react/core/MissionCalendar.d.ts +81 -0
- package/dist/react/core/MissionCalendar.js +1049 -0
- package/dist/react/core/MissionCalendar.js.map +1 -0
- package/dist/react/core/NumberInput.d.ts +85 -0
- package/dist/react/core/NumberInput.js +507 -0
- package/dist/react/core/NumberInput.js.map +1 -0
- package/dist/react/core/PacketViewer.d.ts +73 -0
- package/dist/react/core/PacketViewer.js +431 -0
- package/dist/react/core/PacketViewer.js.map +1 -0
- package/dist/react/core/Pagination.d.ts +30 -0
- package/dist/react/core/Pagination.js +190 -0
- package/dist/react/core/Pagination.js.map +1 -0
- package/dist/react/core/PinInput.d.ts +41 -0
- package/dist/react/core/PinInput.js +210 -0
- package/dist/react/core/PinInput.js.map +1 -0
- package/dist/react/core/Popover.d.ts +55 -0
- package/dist/react/core/Popover.js +288 -0
- package/dist/react/core/Popover.js.map +1 -0
- package/dist/react/core/Select.d.ts +42 -0
- package/dist/react/core/Select.js +303 -0
- package/dist/react/core/Select.js.map +1 -0
- package/dist/react/core/SideNav.d.ts +103 -0
- package/dist/react/core/SideNav.js +551 -0
- package/dist/react/core/SideNav.js.map +1 -0
- package/dist/react/core/SidePanel.d.ts +33 -0
- package/dist/react/core/SidePanel.js +199 -0
- package/dist/react/core/SidePanel.js.map +1 -0
- package/dist/react/core/Tabs.d.ts +47 -0
- package/dist/react/core/Tabs.js +129 -0
- package/dist/react/core/Tabs.js.map +1 -0
- package/dist/react/core/Toast.d.ts +56 -0
- package/dist/react/core/Toast.js +229 -0
- package/dist/react/core/Toast.js.map +1 -0
- package/dist/react/core/Toggle.d.ts +22 -0
- package/dist/react/core/Toggle.js +151 -0
- package/dist/react/core/Toggle.js.map +1 -0
- package/dist/react/core/Tooltip.d.ts +19 -0
- package/dist/react/core/Tooltip.js +179 -0
- package/dist/react/core/Tooltip.js.map +1 -0
- package/dist/react/core/Typography.d.ts +127 -0
- package/dist/react/core/Typography.js +187 -0
- package/dist/react/core/Typography.js.map +1 -0
- package/dist/react/core/index.d.ts +108 -0
- package/dist/react/core/layout/Box.d.ts +77 -0
- package/dist/react/core/layout/Box.js +126 -0
- package/dist/react/core/layout/Box.js.map +1 -0
- package/dist/react/core/layout/Center.d.ts +20 -0
- package/dist/react/core/layout/Center.js +34 -0
- package/dist/react/core/layout/Center.js.map +1 -0
- package/dist/react/core/layout/Divider.d.ts +16 -0
- package/dist/react/core/layout/Divider.js +108 -0
- package/dist/react/core/layout/Divider.js.map +1 -0
- package/dist/react/core/layout/Flex.d.ts +30 -0
- package/dist/react/core/layout/Flex.js +128 -0
- package/dist/react/core/layout/Flex.js.map +1 -0
- package/dist/react/core/layout/Grid.d.ts +36 -0
- package/dist/react/core/layout/Grid.js +142 -0
- package/dist/react/core/layout/Grid.js.map +1 -0
- package/dist/react/core/layout/Spacer.d.ts +8 -0
- package/dist/react/core/layout/Spacer.js +31 -0
- package/dist/react/core/layout/Spacer.js.map +1 -0
- package/dist/react/core/layout/Stack.d.ts +54 -0
- package/dist/react/core/layout/Stack.js +74 -0
- package/dist/react/core/layout/Stack.js.map +1 -0
- package/dist/react/core/layout/index.d.ts +38 -0
- package/dist/react/core/layout/responsive.d.ts +23 -0
- package/dist/react/core/layout/responsive.js +26 -0
- package/dist/react/core/layout/responsive.js.map +1 -0
- package/dist/react/core/layout/useBreakpoint.d.ts +77 -0
- package/dist/react/core/layout/useBreakpoint.js +73 -0
- package/dist/react/core/layout/useBreakpoint.js.map +1 -0
- package/dist/react/core/propertyConfig.d.ts +443 -0
- package/dist/react/core/propertyConfig.js +399 -0
- package/dist/react/core/propertyConfig.js.map +1 -0
- package/dist/react/hooks/index.d.ts +21 -0
- package/dist/react/hooks/useAccessWindows.d.ts +66 -0
- package/dist/react/hooks/useCompactMode.d.ts +82 -0
- package/dist/react/hooks/useCompactMode.js +62 -0
- package/dist/react/hooks/useCompactMode.js.map +1 -0
- package/dist/react/hooks/useLiveSelection.d.ts +57 -0
- package/dist/react/hooks/useSimulationPlayback.d.ts +97 -0
- package/dist/react/hooks/useSimulationTime.d.ts +61 -0
- package/dist/react/hooks/useSpacecraftPosition.d.ts +50 -0
- package/dist/react/hooks/useSpacecraftPosition.js +89 -0
- package/dist/react/hooks/useSpacecraftPosition.js.map +1 -0
- package/dist/react/hooks/useTelemetry.d.ts +55 -0
- package/dist/react/hooks/useTelemetry.js +73 -0
- package/dist/react/hooks/useTelemetry.js.map +1 -0
- package/dist/react/hooks/useZendirSession.d.ts +109 -0
- package/dist/react/hooks/useZendirSession.js +148 -0
- package/dist/react/hooks/useZendirSession.js.map +1 -0
- package/dist/react/index.d.ts +74 -0
- package/dist/react/shared/ErrorBoundary.d.ts +63 -0
- package/dist/react/shared/ErrorBoundary.js +142 -0
- package/dist/react/shared/ErrorBoundary.js.map +1 -0
- package/dist/react/shared/Skeleton.d.ts +110 -0
- package/dist/react/shared/Skeleton.js +324 -0
- package/dist/react/shared/Skeleton.js.map +1 -0
- package/dist/react/shared/index.d.ts +12 -0
- package/dist/react/theme/ThemeProvider.d.ts +385 -0
- package/dist/react/theme/ThemeProvider.js +1096 -0
- package/dist/react/theme/ThemeProvider.js.map +1 -0
- package/dist/react/theme/astro-tokens.d.ts +153 -0
- package/dist/react/theme/cardAccent.d.ts +75 -0
- package/dist/react/theme/cardAccent.js +137 -0
- package/dist/react/theme/cardAccent.js.map +1 -0
- package/dist/react/theme/config.d.ts +39 -0
- package/dist/react/theme/index.d.ts +9 -0
- package/dist/react/types.d.ts +360 -0
- package/dist/react/types.js +58 -0
- package/dist/react/types.js.map +1 -0
- package/dist/react/utils/index.d.ts +247 -0
- package/dist/react/utils/index.js +423 -0
- package/dist/react/utils/index.js.map +1 -0
- package/dist/react/visualizations/EclipseTimerCard.d.ts +17 -0
- package/dist/react/visualizations/EclipseTimerCard.js +250 -0
- package/dist/react/visualizations/EclipseTimerCard.js.map +1 -0
- package/dist/react/visualizations/LinkBudgetCard.d.ts +50 -0
- package/dist/react/visualizations/LinkBudgetCard.js +444 -0
- package/dist/react/visualizations/LinkBudgetCard.js.map +1 -0
- package/dist/react/visualizations/NavBallCard.d.ts +17 -0
- package/dist/react/visualizations/NavBallCard.js +243 -0
- package/dist/react/visualizations/NavBallCard.js.map +1 -0
- package/dist/react/visualizations/PropulsionCard.d.ts +37 -0
- package/dist/react/visualizations/PropulsionCard.js +298 -0
- package/dist/react/visualizations/PropulsionCard.js.map +1 -0
- package/dist/react/visualizations/SensorFootprintCard.d.ts +33 -0
- package/dist/react/visualizations/SensorFootprintCard.js +326 -0
- package/dist/react/visualizations/SensorFootprintCard.js.map +1 -0
- package/dist/react/visualizations/ThermalHeatmapCard.d.ts +38 -0
- package/dist/react/visualizations/ThermalHeatmapCard.js +372 -0
- package/dist/react/visualizations/ThermalHeatmapCard.js.map +1 -0
- package/dist/react/visualizations/index.d.ts +17 -0
- package/dist/react.d.ts +1 -0
- package/dist/react.js +421 -0
- package/dist/react.js.map +1 -0
- package/dist/shaders/atmosphere.frag.js +5 -0
- package/dist/shaders/atmosphere.frag.js.map +1 -0
- package/dist/shaders/atmosphere.vert.js +5 -0
- package/dist/shaders/atmosphere.vert.js.map +1 -0
- package/dist/shaders/stars.frag.js +5 -0
- package/dist/shaders/stars.frag.js.map +1 -0
- package/dist/shaders/stars.vert.js +5 -0
- package/dist/shaders/stars.vert.js.map +1 -0
- package/dist/style.css +143 -0
- package/dist/tokens/index.d.ts +296 -0
- package/dist/tokens/index.js +263 -0
- package/dist/tokens/index.js.map +1 -0
- package/dist/tokens/tokens.css +155 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +220 -0
- package/sdk-stub.js +22 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# @zendir/ui
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
Initial public release.
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- 60+ React components for space, air, land, and maritime operations
|
|
10
|
+
- Built on Astro UX Design System
|
|
11
|
+
- Themeable (Zen, Hybrid, Astro, Glass) with dark/light mode
|
|
12
|
+
- ECharts-based charting (line, area, bar, radar, treemap, sankey, and more)
|
|
13
|
+
- 3D viewers (Earth, Solar System, ZenSpace3D) via Three.js
|
|
14
|
+
- Ground track maps (Leaflet and canvas backends)
|
|
15
|
+
- Mission control widgets (MissionClock, SimulationControls, UnifiedTimeline)
|
|
16
|
+
- Layout primitives (Box, Flex, Grid, Stack, Container, SideNav, SidePanel)
|
|
17
|
+
- Accessibility-first (WCAG 2.2 AA oriented)
|
|
18
|
+
- Design tokens as JS objects and CSS custom properties
|
|
19
|
+
- Optional @zendir/sdk integration with graceful fallback
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026-present Space Services Australia Pty Ltd
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,589 @@
|
|
|
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/badge/version-0.1.0-6C47FF.svg?style=flat&colorA=18181B" alt="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="SECURITY.md">Security</a> ยท <a href="CODE_OF_CONDUCT.md">Code of Conduct</a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Overview
|
|
23
|
+
|
|
24
|
+
Zendir UI provides production-ready React components purpose-built for satellite telemetry, orbit visualization, mission control dashboards, and space simulation interfaces. Components follows the [Astro UX Design System](https://www.astrouxds.com/) โ the industry standard for space operations software.
|
|
25
|
+
|
|
26
|
+
**Why Zendir UI?**
|
|
27
|
+
|
|
28
|
+
- **60+ components** โ from core primitives to 3D orbit viewers
|
|
29
|
+
- **Astro UX compliant** โ dual-coded status indicators, classification banners, and mission clocks
|
|
30
|
+
- **TypeScript-first** โ full type safety with 200+ exported interfaces
|
|
31
|
+
- **Accessible** โ [WCAG 2.2 AA](https://www.w3.org/TR/WCAG22/) conformant, keyboard navigable, reduced motion aware, and aligned with the [European Accessibility Act](https://ec.europa.eu/social/main.jsp?catId=1202)
|
|
32
|
+
- **Modular** โ tree-shakeable, optional peer dependencies, zero runtime cost for unused features
|
|
33
|
+
- **Framework-ready** โ works standalone or with `@zendir/sdk` for live API integration
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
### Install
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm install @zendir/ui
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
> The SDK is optional. All TypeScript types ship with the UI library.
|
|
44
|
+
> Install `@zendir/sdk` only if you need the API client.
|
|
45
|
+
>
|
|
46
|
+
> **Vite / dev server:** If you do not install `@zendir/sdk`, add an alias so the optional peer resolves and the app runs (hooks will report "SDK not installed"):
|
|
47
|
+
> ```js
|
|
48
|
+
> // vite.config.js
|
|
49
|
+
> resolve: { alias: { '@zendir/sdk': require.resolve('@zendir/ui/sdk-stub') } }
|
|
50
|
+
> ```
|
|
51
|
+
|
|
52
|
+
### Use
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
import { ThemeProvider, SpacecraftCard, StatusIndicator } from '@zendir/ui/react';
|
|
56
|
+
|
|
57
|
+
function App() {
|
|
58
|
+
return (
|
|
59
|
+
<ThemeProvider defaultVariant="hybrid" defaultMode="dark">
|
|
60
|
+
<StatusIndicator status="normal" label="System Healthy" />
|
|
61
|
+
|
|
62
|
+
<SpacecraftCard
|
|
63
|
+
spacecraft={{
|
|
64
|
+
id: 'SAT-001',
|
|
65
|
+
name: 'Explorer-1',
|
|
66
|
+
noradId: 25544,
|
|
67
|
+
type: 'LEO Satellite',
|
|
68
|
+
status: 'operational',
|
|
69
|
+
}}
|
|
70
|
+
position={{
|
|
71
|
+
latitude: 45.2,
|
|
72
|
+
longitude: -122.5,
|
|
73
|
+
altitude: 408,
|
|
74
|
+
velocity: 7.66,
|
|
75
|
+
}}
|
|
76
|
+
/>
|
|
77
|
+
</ThemeProvider>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Components
|
|
85
|
+
|
|
86
|
+
### Core
|
|
87
|
+
|
|
88
|
+
Foundational primitives that compose into any interface.
|
|
89
|
+
|
|
90
|
+
| Component | Description |
|
|
91
|
+
|-----------|-------------|
|
|
92
|
+
| `Button` | Primary, secondary, and borderless variants with icon and loading support |
|
|
93
|
+
| `Input` | Text input with label, icon, validation, and size variants |
|
|
94
|
+
| `Select` | Dropdown selection with search and multi-select |
|
|
95
|
+
| `Toggle` | On/off switch with label |
|
|
96
|
+
| `Checkbox` | Checkbox and radio with accessible labeling |
|
|
97
|
+
| `Dialog` | Modal dialog with action slots |
|
|
98
|
+
| `Tabs` | Tabbed navigation with panel content |
|
|
99
|
+
| `Tooltip` | Contextual overlay on hover/focus |
|
|
100
|
+
| `Container` | Surface card with title, status accent, and elevation |
|
|
101
|
+
| `Badge` | Inline status label |
|
|
102
|
+
| `Pagination` | Page navigation controls |
|
|
103
|
+
| `NumberInput` | Numeric stepper with min/max/step and slider |
|
|
104
|
+
| `SidePanel` | Slide-out panel with configurable position |
|
|
105
|
+
| `DataTable` | Sortable, filterable data grid |
|
|
106
|
+
| `Menu` / `Popover` | Context menus and floating content |
|
|
107
|
+
| `ChatPanel` | AI chat interface with structured blocks, status system, and [3 LLM integration strategies](#ai-integration) |
|
|
108
|
+
|
|
109
|
+
### Status & Monitoring
|
|
110
|
+
|
|
111
|
+
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).
|
|
112
|
+
|
|
113
|
+
```tsx
|
|
114
|
+
import { StatusIndicator, MonitoringIcon } from '@zendir/ui/react';
|
|
115
|
+
|
|
116
|
+
<StatusIndicator status="normal" label="Operational" />
|
|
117
|
+
<StatusIndicator status="caution" label="Battery Low" />
|
|
118
|
+
<StatusIndicator status="critical" label="Comm Loss" pulse />
|
|
119
|
+
|
|
120
|
+
<MonitoringIcon status="normal" icon="power" label="Power" sublabel="85%" />
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Status levels:** `off` ยท `standby` ยท `normal` ยท `caution` ยท `serious` ยท `critical`
|
|
124
|
+
|
|
125
|
+
### Data Cards
|
|
126
|
+
|
|
127
|
+
Pre-built cards for common space operations data. All cards support **compact mode** โ collapsed by default, expand on hover, pin on click.
|
|
128
|
+
|
|
129
|
+
| Card | Data |
|
|
130
|
+
|------|------|
|
|
131
|
+
| `SpacecraftCard` | ID, orbit type, status, position |
|
|
132
|
+
| `TelemetryCard` | Subsystem health, alerts |
|
|
133
|
+
| `TelemetryStreamCard` | Live metric streaming |
|
|
134
|
+
| `AccessCard` | Ground station contact windows |
|
|
135
|
+
| `OrbitCard` | Keplerian elements, period, epoch |
|
|
136
|
+
|
|
137
|
+
```tsx
|
|
138
|
+
<SpacecraftCard compact spacecraft={data} position={pos} />
|
|
139
|
+
<TelemetryCard compact telemetry={tlm} />
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### DataValue
|
|
143
|
+
|
|
144
|
+
Display telemetry values with automatic icons, units, and status derivation from 30+ built-in property presets.
|
|
145
|
+
|
|
146
|
+
```tsx
|
|
147
|
+
import { DataValue, DataValueGroup } from '@zendir/ui/react';
|
|
148
|
+
|
|
149
|
+
<DataValue property="temperature" value={72.5} />
|
|
150
|
+
<DataValue property="battery" value={25} /> {/* auto-derives 'caution' */}
|
|
151
|
+
|
|
152
|
+
<DataValueGroup columns={2} title="Power" icon="propulsion-power">
|
|
153
|
+
<DataValue property="battery" value={85} />
|
|
154
|
+
<DataValue property="voltage" value={28.4} />
|
|
155
|
+
<DataValue property="solarPower" value={124} />
|
|
156
|
+
</DataValueGroup>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**Presets:** `battery` ยท `voltage` ยท `temperature` ยท `signalStrength` ยท `altitude` ยท `velocity` ยท `fuelLevel` ยท `cpuUsage` ยท `memoryUsage` ยท [and 20+ more](COMPONENTS.md)
|
|
160
|
+
|
|
161
|
+
### Visualizations
|
|
162
|
+
|
|
163
|
+
Domain-specific visualization cards for mission operations.
|
|
164
|
+
|
|
165
|
+
| Card | Description |
|
|
166
|
+
|------|-------------|
|
|
167
|
+
| `LinkBudgetCard` | RF link budget waterfall |
|
|
168
|
+
| `ThermalHeatmapCard` | Spacecraft thermal zone status |
|
|
169
|
+
| `PropulsionCard` | Fuel, thrusters, delta-V budget |
|
|
170
|
+
| `EclipseTimerCard` | Eclipse/sunlight timing |
|
|
171
|
+
| `NavBallCard` | 3D attitude indicator |
|
|
172
|
+
| `SensorFootprintCard` | Ground sensor coverage |
|
|
173
|
+
|
|
174
|
+
### Charts
|
|
175
|
+
|
|
176
|
+
40+ chart types built on ECharts with Astro UX color palettes, built-in export (PNG, SVG, CSV), zoom/pan, and streaming support.
|
|
177
|
+
|
|
178
|
+
```tsx
|
|
179
|
+
import { PowerChart, AttitudeChart, GroundTrackMap } from '@zendir/ui/react';
|
|
180
|
+
|
|
181
|
+
<PowerChart data={powerData} height={300} />
|
|
182
|
+
<AttitudeChart data={attitudeData} height={250} />
|
|
183
|
+
<GroundTrackMap groundTrack={track} groundStations={stations} />
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**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.
|
|
187
|
+
|
|
188
|
+
### 3D Viewers
|
|
189
|
+
|
|
190
|
+
Interactive Three.js-based viewers with orbital mechanics, TLE parsing, and SGP4 propagation.
|
|
191
|
+
|
|
192
|
+
```tsx
|
|
193
|
+
import { EarthViewer, SolarSystemViewer } from '@zendir/ui/react';
|
|
194
|
+
|
|
195
|
+
<EarthViewer
|
|
196
|
+
spacecraft={[{ id: 'SAT-001', name: 'Explorer-1', latitude: 45.2, longitude: -122.5, altitude: 408 }]}
|
|
197
|
+
groundStations={[{ id: 'DSN-14', name: 'Goldstone', latitude: 35.4, longitude: -116.9 }]}
|
|
198
|
+
showAtmosphere
|
|
199
|
+
showOrbits
|
|
200
|
+
autoRotate
|
|
201
|
+
/>
|
|
202
|
+
|
|
203
|
+
<SolarSystemViewer focusedPlanet="earth" autoOrbit showLabels />
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Astro UX Components
|
|
207
|
+
|
|
208
|
+
Mission operations components following [Astro UX Design System](https://www.astrouxds.com/) specifications.
|
|
209
|
+
|
|
210
|
+
| Component | Description |
|
|
211
|
+
|-----------|-------------|
|
|
212
|
+
| `GlobalStatusBar` | Application header with app name, clock, monitoring icons |
|
|
213
|
+
| `MissionClock` | UTC/local time display with multiple formats |
|
|
214
|
+
| `ClassificationBanner` | Security classification banner (CUI through Top Secret) |
|
|
215
|
+
| `Timeline` | Gantt, list, and scatter views for mission events |
|
|
216
|
+
| `Progress` | Determinate and indeterminate progress indicators |
|
|
217
|
+
| `Notification` | Toast notifications with status and auto-dismiss |
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Theme System
|
|
222
|
+
|
|
223
|
+
Wrap your application in `ThemeProvider` to enable the full token-based design system.
|
|
224
|
+
|
|
225
|
+
```tsx
|
|
226
|
+
import { ThemeProvider, useTheme } from '@zendir/ui/react';
|
|
227
|
+
|
|
228
|
+
<ThemeProvider
|
|
229
|
+
defaultVariant="hybrid" // 'astro' | 'purple-hue' | 'hybrid' | 'transparent'
|
|
230
|
+
defaultMode="dark" // 'light' | 'dark'
|
|
231
|
+
persistPreference={true} // save to localStorage
|
|
232
|
+
>
|
|
233
|
+
<App />
|
|
234
|
+
</ThemeProvider>
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Access tokens anywhere:
|
|
238
|
+
|
|
239
|
+
```tsx
|
|
240
|
+
const { tokens, mode, setMode } = useTheme();
|
|
241
|
+
|
|
242
|
+
<div style={{
|
|
243
|
+
background: tokens.colors.background.surface,
|
|
244
|
+
color: tokens.colors.text.primary,
|
|
245
|
+
padding: tokens.spacing.md,
|
|
246
|
+
borderRadius: tokens.borderRadius.md,
|
|
247
|
+
}}>
|
|
248
|
+
...
|
|
249
|
+
</div>
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
**Token categories:** colors (background, border, text, status, semantic, accent, interactive) ยท spacing ยท border radius ยท typography (Astro-compliant scale) ยท shadows ยท animation ยท focus
|
|
253
|
+
|
|
254
|
+
### Card Accent System
|
|
255
|
+
|
|
256
|
+
Automatically assign accent colors to cards by content domain:
|
|
257
|
+
|
|
258
|
+
```tsx
|
|
259
|
+
import { CardAccentProvider, useCardAccent } from '@zendir/ui/react';
|
|
260
|
+
|
|
261
|
+
<CardAccentProvider accentMode="mix">
|
|
262
|
+
<Container title="Power Systems" accentColor={getAccentColor('Power Systems')}>
|
|
263
|
+
...
|
|
264
|
+
</Container>
|
|
265
|
+
</CardAccentProvider>
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
**Accent modes:** `cyan` ยท `electric` ยท `purple` ยท `teal` ยท `prussianBlue` ยท `green` ยท `amber` ยท `mix`
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## SDK Integration (Optional)
|
|
273
|
+
|
|
274
|
+
For live API integration, add `@zendir/sdk`:
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
npm install @zendir/sdk
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
```tsx
|
|
281
|
+
import { ZendirClient } from '@zendir/sdk';
|
|
282
|
+
import { SpacecraftCard, useZendirSession } from '@zendir/ui/react';
|
|
283
|
+
|
|
284
|
+
const client = new ZendirClient({ apiKey: 'your-key' });
|
|
285
|
+
|
|
286
|
+
function Dashboard() {
|
|
287
|
+
const { isConnected } = useZendirSession({ client });
|
|
288
|
+
// ...
|
|
289
|
+
}
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
**SDK hooks:** `useZendirSession` ยท `useTelemetry` ยท `useSpacecraftPosition` ยท `useAccessWindows` ยท `useSimulationTime`
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## AI Integration
|
|
297
|
+
|
|
298
|
+
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.
|
|
299
|
+
|
|
300
|
+
### Quick Setup
|
|
301
|
+
|
|
302
|
+
```tsx
|
|
303
|
+
import { ChatPanel, parseChatResponse } from '@zendir/ui/react';
|
|
304
|
+
|
|
305
|
+
function OperatorChat() {
|
|
306
|
+
const [messages, setMessages] = useState([]);
|
|
307
|
+
|
|
308
|
+
const handleSend = async (text) => {
|
|
309
|
+
setMessages(prev => [...prev, { id: Date.now(), role: 'user', content: text, timestamp: Date.now() }]);
|
|
310
|
+
const response = await callYourAI(text);
|
|
311
|
+
const msg = parseChatResponse(response); // auto-detects JSON, YAML, or plain text
|
|
312
|
+
setMessages(prev => [...prev, msg]);
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
return <ChatPanel messages={messages} onSend={handleSend} title="Mission AI" />;
|
|
316
|
+
}
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Four Integration Strategies
|
|
320
|
+
|
|
321
|
+
| Strategy | Token Cost | Best For |
|
|
322
|
+
|----------|-----------|----------|
|
|
323
|
+
| **Tool/Function Calling** | Lowest | OpenAI, Anthropic, Gemini (production) |
|
|
324
|
+
| **MCP (Model Context Protocol)** | Lowest | Multi-tool, multi-server architectures |
|
|
325
|
+
| **YAML Prompt** | ~30-40% less than JSON | Any LLM, cost-sensitive deployments |
|
|
326
|
+
| **JSON Prompt** | Baseline | Simplest setup, widest LLM compatibility |
|
|
327
|
+
|
|
328
|
+
#### Strategy 1: Tool / Function Calling _(recommended for single-provider)_
|
|
329
|
+
|
|
330
|
+
```ts
|
|
331
|
+
import { CHAT_RESPONSE_TOOL_SCHEMA, parseChatResponse } from '@zendir/ui/react';
|
|
332
|
+
|
|
333
|
+
// OpenAI
|
|
334
|
+
const res = await openai.chat.completions.create({
|
|
335
|
+
model: 'gpt-4o',
|
|
336
|
+
messages: history,
|
|
337
|
+
tools: [{ type: 'function', function: CHAT_RESPONSE_TOOL_SCHEMA }],
|
|
338
|
+
tool_choice: { type: 'function', function: { name: 'respond_to_operator' } },
|
|
339
|
+
});
|
|
340
|
+
const msg = parseChatResponse(res.choices[0].message.tool_calls[0].function.arguments, 'json');
|
|
341
|
+
|
|
342
|
+
// Anthropic
|
|
343
|
+
tools: [{ name: CHAT_RESPONSE_TOOL_SCHEMA.name,
|
|
344
|
+
description: CHAT_RESPONSE_TOOL_SCHEMA.description,
|
|
345
|
+
input_schema: CHAT_RESPONSE_TOOL_SCHEMA.parameters }]
|
|
346
|
+
|
|
347
|
+
// Google Gemini
|
|
348
|
+
tools: [{ functionDeclarations: [CHAT_RESPONSE_TOOL_SCHEMA] }]
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
#### Strategy 2: MCP (Model Context Protocol) _(recommended for multi-tool)_
|
|
352
|
+
|
|
353
|
+
```ts
|
|
354
|
+
// Server: Register your tool with the pre-built schema
|
|
355
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
356
|
+
import { CHAT_RESPONSE_MCP_TOOL } from '@zendir/ui';
|
|
357
|
+
|
|
358
|
+
const server = new McpServer({ name: 'ops-assistant', version: '1.0.0' });
|
|
359
|
+
server.tool(
|
|
360
|
+
CHAT_RESPONSE_MCP_TOOL.name,
|
|
361
|
+
CHAT_RESPONSE_MCP_TOOL.description,
|
|
362
|
+
CHAT_RESPONSE_MCP_TOOL.inputSchema,
|
|
363
|
+
async (args) => ({ content: [{ type: 'text', text: JSON.stringify(args) }] })
|
|
364
|
+
);
|
|
365
|
+
|
|
366
|
+
// Client: Convert MCP results to ChatPanel messages
|
|
367
|
+
import { parseMcpToolResult } from '@zendir/ui/react';
|
|
368
|
+
|
|
369
|
+
const result = await mcpClient.callTool({ name: 'check_health', arguments: { id: 'SAT-001' } });
|
|
370
|
+
const msg = parseMcpToolResult('check_health', result);
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
#### Strategy 3: YAML Prompt
|
|
374
|
+
|
|
375
|
+
```ts
|
|
376
|
+
import { CHAT_RESPONSE_YAML_PROMPT, CHAT_STATUS_RULES_PROMPT, parseChatResponse } from '@zendir/ui/react';
|
|
377
|
+
|
|
378
|
+
const systemPrompt = `You are a spacecraft ops assistant.\n\n${CHAT_RESPONSE_YAML_PROMPT}\n\n${CHAT_STATUS_RULES_PROMPT}`;
|
|
379
|
+
const msg = parseChatResponse(aiOutput, 'yaml');
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
#### Strategy 4: JSON Prompt
|
|
383
|
+
|
|
384
|
+
```ts
|
|
385
|
+
import { CHAT_RESPONSE_JSON_PROMPT, CHAT_STATUS_RULES_PROMPT, parseChatResponse } from '@zendir/ui/react';
|
|
386
|
+
|
|
387
|
+
const systemPrompt = `You are a spacecraft ops assistant.\n\n${CHAT_RESPONSE_JSON_PROMPT}\n\n${CHAT_STATUS_RULES_PROMPT}`;
|
|
388
|
+
const msg = parseChatResponse(aiOutput, 'json');
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
### Global Configuration
|
|
392
|
+
|
|
393
|
+
```ts
|
|
394
|
+
import yaml from 'js-yaml';
|
|
395
|
+
import { createChatResponseParser } from '@zendir/ui/react';
|
|
396
|
+
|
|
397
|
+
// Create once, use everywhere
|
|
398
|
+
export const parseAI = createChatResponseParser({
|
|
399
|
+
yamlParser: (s) => yaml.load(s), // plug in production YAML parser
|
|
400
|
+
defaultFormat: 'yaml', // default format
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
const msg = parseAI(aiOutput);
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
### Structured Blocks
|
|
407
|
+
|
|
408
|
+
AI responses can include rich structured content:
|
|
409
|
+
|
|
410
|
+
| Block Type | Description | Interactive |
|
|
411
|
+
|-----------|-------------|-------------|
|
|
412
|
+
| `alert` | Status banner with severity shape | No |
|
|
413
|
+
| `telemetry` | Key-value readout with per-row status | No |
|
|
414
|
+
| `progress` | Progress bar with status color | No |
|
|
415
|
+
| `table` | Data table with column headers | No |
|
|
416
|
+
| `kv` | Compact key-value metadata | No |
|
|
417
|
+
| `command` | Code block with copy/run buttons | Yes |
|
|
418
|
+
| `choice` | Single or multi-select options | Yes |
|
|
419
|
+
| `confirm` | Confirmation gate (authorize/abort) | Yes |
|
|
420
|
+
|
|
421
|
+
Interactive blocks fire `onBlockEvent` with `{ blockId, messageId, action, value }`.
|
|
422
|
+
|
|
423
|
+
### Exported Helpers
|
|
424
|
+
|
|
425
|
+
| Export | What It Does |
|
|
426
|
+
|--------|-------------|
|
|
427
|
+
| `CHAT_RESPONSE_TOOL_SCHEMA` | Function/tool schema for OpenAI, Anthropic, Gemini |
|
|
428
|
+
| `CHAT_RESPONSE_MCP_TOOL` | MCP server tool definition (for `server.tool()` registration) |
|
|
429
|
+
| `parseChatResponse()` | Universal parser: auto-detects JSON / YAML / plain text |
|
|
430
|
+
| `parseMcpToolResult()` | Bridge MCP tool results โ ChatMessage with blocks |
|
|
431
|
+
| `createChatResponseParser()` | Factory for pre-configured parser (custom YAML, format, IDs) |
|
|
432
|
+
| `CHAT_RESPONSE_JSON_PROMPT` | JSON format instructions + block schema |
|
|
433
|
+
| `CHAT_RESPONSE_YAML_PROMPT` | YAML format instructions + block schema |
|
|
434
|
+
| `CHAT_STATUS_RULES_PROMPT` | Astro UX status thresholds (battery, temp, signal, memory) |
|
|
435
|
+
| `McpToolResult` / `McpToolContent` | Lightweight MCP types (no SDK dependency needed) |
|
|
436
|
+
|
|
437
|
+
> 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.
|
|
438
|
+
|
|
439
|
+
---
|
|
440
|
+
|
|
441
|
+
## AI Host / MCP Integration
|
|
442
|
+
|
|
443
|
+
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:
|
|
444
|
+
|
|
445
|
+
### AppCard โ Universal Widget Wrapper
|
|
446
|
+
|
|
447
|
+
`AppCard` is the base widget wrapper for any AI host โ ChatGPT Apps, Anthropic MCP Apps, Google Gemini, or any MCP-compatible environment:
|
|
448
|
+
|
|
449
|
+
```tsx
|
|
450
|
+
import { AppCard, useToolOutput, useCallTool } from '@zendir/ui/react';
|
|
451
|
+
|
|
452
|
+
function SatelliteWidget() {
|
|
453
|
+
const data = useToolOutput<SatelliteHealth>();
|
|
454
|
+
const { callTool, isLoading, error } = useCallTool();
|
|
455
|
+
|
|
456
|
+
return (
|
|
457
|
+
<AppCard
|
|
458
|
+
title="SAT-001"
|
|
459
|
+
subtitle="Health Monitor ยท LEO 421km"
|
|
460
|
+
status={{ level: 'caution', label: 'Battery Low' }} // Astro UX dual-coded (shape + color)
|
|
461
|
+
loading={isLoading}
|
|
462
|
+
error={error?.message}
|
|
463
|
+
onRetry={() => callTool('refresh_telemetry', { id: 'SAT-001' })}
|
|
464
|
+
allowFullscreen
|
|
465
|
+
icon={<span>๐ฐ๏ธ</span>}
|
|
466
|
+
>
|
|
467
|
+
<TelemetryDisplay data={data} />
|
|
468
|
+
</AppCard>
|
|
469
|
+
);
|
|
470
|
+
}
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
**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. `ChatGPTCard` is still exported as a deprecated alias for backward compatibility.
|
|
474
|
+
|
|
475
|
+
### MCP Server โ ChatPanel Bridge
|
|
476
|
+
|
|
477
|
+
Register your MCP server tools to produce ChatPanel-compatible structured blocks:
|
|
478
|
+
|
|
479
|
+
```ts
|
|
480
|
+
// server.ts
|
|
481
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
482
|
+
import { CHAT_RESPONSE_MCP_TOOL } from '@zendir/ui';
|
|
483
|
+
|
|
484
|
+
const server = new McpServer({ name: 'sat-ops', version: '1.0.0' });
|
|
485
|
+
server.tool(
|
|
486
|
+
CHAT_RESPONSE_MCP_TOOL.name,
|
|
487
|
+
CHAT_RESPONSE_MCP_TOOL.description,
|
|
488
|
+
CHAT_RESPONSE_MCP_TOOL.inputSchema,
|
|
489
|
+
async (args) => ({ content: [{ type: 'text', text: JSON.stringify(args) }] })
|
|
490
|
+
);
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
```tsx
|
|
494
|
+
// client.tsx โ Parse MCP results into ChatPanel messages
|
|
495
|
+
import { parseMcpToolResult, ChatPanel } from '@zendir/ui/react';
|
|
496
|
+
|
|
497
|
+
const result = await mcpClient.callTool({ name: 'check_health', arguments: { id: 'SAT-001' } });
|
|
498
|
+
const msg = parseMcpToolResult('check_health', result); // โ ChatMessage with typed blocks
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
### Available Host Hooks
|
|
502
|
+
|
|
503
|
+
| Hook | Purpose |
|
|
504
|
+
|------|---------|
|
|
505
|
+
| `useToolOutput()` | Read tool result (structuredContent) |
|
|
506
|
+
| `useToolInput()` | Read tool invocation arguments |
|
|
507
|
+
| `useCallTool()` | Call other MCP tools from widget |
|
|
508
|
+
| `useSendMessage()` | Insert follow-up user messages |
|
|
509
|
+
| `useChatGPTTheme()` | Match light/dark theme |
|
|
510
|
+
| `useWidgetState()` | Persist widget state across renders |
|
|
511
|
+
| `useMaxHeight()` | Get host height constraint |
|
|
512
|
+
| `useDisplayMode()` | Manage inline/PiP/fullscreen |
|
|
513
|
+
| `isInChatGPT()` | Detect ChatGPT environment |
|
|
514
|
+
|
|
515
|
+
---
|
|
516
|
+
|
|
517
|
+
## Project Structure
|
|
518
|
+
|
|
519
|
+
```
|
|
520
|
+
src/
|
|
521
|
+
โโโ react/
|
|
522
|
+
โ โโโ core/ # Buttons, inputs, dialogs, data table
|
|
523
|
+
โ โโโ astro/ # Astro UX โ timeline, status bar, clock
|
|
524
|
+
โ โโโ cards/ # Spacecraft, telemetry, orbit, access
|
|
525
|
+
โ โโโ charts/ # 40+ ECharts components
|
|
526
|
+
โ โโโ visualizations/ # Link budget, thermal, propulsion
|
|
527
|
+
โ โโโ 3d/ # Earth viewer, solar system
|
|
528
|
+
โ โโโ hooks/ # Data hooks
|
|
529
|
+
โ โโโ theme/ # ThemeProvider, tokens
|
|
530
|
+
โ โโโ chatgpt/ # AI host / MCP integration (AppCard, hooks)
|
|
531
|
+
โ โโโ shared/ # Error boundaries, skeletons, utils
|
|
532
|
+
โโโ tokens/ # Design tokens (CSS + TypeScript)
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
## Development
|
|
536
|
+
|
|
537
|
+
```bash
|
|
538
|
+
git clone https://github.com/zendir-dev/zendir-ui.git
|
|
539
|
+
cd zendir-ui && npm install
|
|
540
|
+
|
|
541
|
+
npm run storybook # Component playground
|
|
542
|
+
npm run demo # Full demo app
|
|
543
|
+
npm run build # Production build
|
|
544
|
+
npm run test # Run tests
|
|
545
|
+
npm run lint # Lint check
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
## Accessibility
|
|
549
|
+
|
|
550
|
+
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**.
|
|
551
|
+
|
|
552
|
+
- **Keyboard** โ every component is fully operable via keyboard. Focus order follows DOM order, focus indicators meet 3:1 contrast, and no keyboard traps exist.
|
|
553
|
+
- **Screen readers** โ semantic HTML, ARIA roles, live regions for dynamic content, and descriptive labels on all icon-only controls.
|
|
554
|
+
- **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.
|
|
555
|
+
- **Motion** โ all animations and transitions respect `prefers-reduced-motion` globally via CSS and JavaScript.
|
|
556
|
+
- **Target size** โ interactive controls meet the 24 ร 24 px minimum (WCAG 2.5.8).
|
|
557
|
+
- **Forms** โ validation errors are identified with `aria-invalid`, associated via `aria-describedby`, and announced with `role="alert"`.
|
|
558
|
+
|
|
559
|
+
| Standard | Status |
|
|
560
|
+
|----------|--------|
|
|
561
|
+
| WCAG 2.2 Level AA | Conformant |
|
|
562
|
+
| EN 301 549 v3.2.1 Clause 11 | Designed for conformance |
|
|
563
|
+
| EAA Directive (EU) 2019/882 | Designed for conformance |
|
|
564
|
+
| Revised Section 508 | Conformant |
|
|
565
|
+
|
|
566
|
+
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).
|
|
567
|
+
|
|
568
|
+
For the full conformance statement with WCAG success criteria mapping and EN 301 549 clause mapping, see [**ACCESSIBILITY.md**](ACCESSIBILITY.md).
|
|
569
|
+
|
|
570
|
+
Accessibility issues are treated as **P0 bugs**. [Report an issue](https://github.com/zendir-dev/zendir-ui/issues) with the `accessibility` label.
|
|
571
|
+
|
|
572
|
+
---
|
|
573
|
+
|
|
574
|
+
## Browser Support
|
|
575
|
+
|
|
576
|
+
Chrome 90+ ยท Firefox 88+ ยท Safari 14+ ยท Edge 90+
|
|
577
|
+
|
|
578
|
+
WebGL required for 3D components (graceful fallback to 2D).
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
## License
|
|
582
|
+
|
|
583
|
+
[MIT](LICENSE) โ Space Services Australia Pty Ltd
|
|
584
|
+
|
|
585
|
+
---
|
|
586
|
+
|
|
587
|
+
<p align="center">
|
|
588
|
+
<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>
|
|
589
|
+
</p>
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zendir/ui - UI Components and Widgets for Zendir
|
|
3
|
+
*
|
|
4
|
+
* React components, Three.js visualizations, and widgets for Zendir applications.
|
|
5
|
+
* All types are provided locally; install @zendir/sdk separately for API client.
|
|
6
|
+
*/
|
|
7
|
+
export * from './react/index.js';
|
|
8
|
+
export * from './types/index.js';
|