@zendir/ui 0.5.0 → 0.6.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 +20 -0
- 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 +312 -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 +217 -194
- 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 +419 -41
- package/dist/types/index.d.ts +2 -2
- package/package.json +310 -313
- package/dist/index.js.map +0 -1
- package/dist/react/3d/index.js.map +0 -1
- package/dist/react/astro/index.js.map +0 -1
- package/dist/react/cards/index.js.map +0 -1
- package/dist/react/charts/index.js.map +0 -1
- package/dist/react/core/index.js.map +0 -1
- package/dist/react/panels/index.js.map +0 -1
- package/dist/react/theme/astro-tokens.d.ts +0 -153
- package/dist/react/theme/index.js.map +0 -1
- package/dist/react.js.map +0 -1
|
@@ -1,518 +1,626 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { memo, useState, useCallback, useMemo } from "react";
|
|
3
1
|
import { useTheme } from "../../theme/ThemeProvider.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
2
|
+
import { memo, useCallback, useMemo, useState } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/react/core/widgets/CommandBuilder.tsx
|
|
5
|
+
/**
|
|
6
|
+
* @zendir/ui - CommandBuilder Component
|
|
7
|
+
*
|
|
8
|
+
* Dynamic command parameter form for spacecraft command construction and execution.
|
|
9
|
+
* Builds a form from a command definition with type-appropriate inputs,
|
|
10
|
+
* validation, hazardous warnings, and send/history functionality.
|
|
11
|
+
*
|
|
12
|
+
* Features:
|
|
13
|
+
* - Auto-generated form from command parameter definitions
|
|
14
|
+
* - Type-appropriate inputs (number, string, boolean, enum/state, hex)
|
|
15
|
+
* - Validation with min/max/regex constraints
|
|
16
|
+
* - Hazardous command warnings
|
|
17
|
+
* - Command history with re-send
|
|
18
|
+
* - Raw command preview
|
|
19
|
+
* - Required/optional parameter indicators
|
|
20
|
+
* - Default values
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <CommandBuilder
|
|
25
|
+
* target="INST"
|
|
26
|
+
* command="COLLECT"
|
|
27
|
+
* parameters={[
|
|
28
|
+
* { name: 'TYPE', type: 'enum', options: ['NORMAL', 'SPECIAL'], required: true },
|
|
29
|
+
* { name: 'DURATION', type: 'float', min: 0, max: 100, default: 1.0, units: 'sec' },
|
|
30
|
+
* ]}
|
|
31
|
+
* onSend={(params) => console.log('Send:', params)}
|
|
32
|
+
* />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
var CommandBuilder = memo(function CommandBuilder({ target, command, description, hazardous = false, hazardousDescription, parameters, onSend, history = [], showHistory = true, showPreview = true, disabled = false, height, className = "", bordered = true, style: styleProp }) {
|
|
36
|
+
const { tokens, theme } = useTheme();
|
|
37
|
+
const isTransparentTheme = theme === "transparent" || theme === "transparent-bold" || theme === "transparent-minimal";
|
|
38
|
+
const [values, setValues] = useState(() => {
|
|
39
|
+
const defaults = {};
|
|
40
|
+
parameters.forEach((p) => {
|
|
41
|
+
if (p.default !== void 0) defaults[p.name] = p.default;
|
|
42
|
+
else if (p.type === "boolean") defaults[p.name] = false;
|
|
43
|
+
else if (p.type === "enum" && p.options?.length) defaults[p.name] = p.options[0];
|
|
44
|
+
else defaults[p.name] = "";
|
|
45
|
+
});
|
|
46
|
+
return defaults;
|
|
47
|
+
});
|
|
48
|
+
const [errors, setErrors] = useState({});
|
|
49
|
+
const [sending, setSending] = useState(false);
|
|
50
|
+
const [showConfirm, setShowConfirm] = useState(false);
|
|
51
|
+
const [showHistoryPanel, setShowHistoryPanel] = useState(false);
|
|
52
|
+
const setValue = useCallback((name, value) => {
|
|
53
|
+
setValues((prev) => ({
|
|
54
|
+
...prev,
|
|
55
|
+
[name]: value
|
|
56
|
+
}));
|
|
57
|
+
setErrors((prev) => {
|
|
58
|
+
const next = { ...prev };
|
|
59
|
+
delete next[name];
|
|
60
|
+
return next;
|
|
61
|
+
});
|
|
62
|
+
}, []);
|
|
63
|
+
const validate = useCallback(() => {
|
|
64
|
+
const errs = {};
|
|
65
|
+
parameters.forEach((p) => {
|
|
66
|
+
const val = values[p.name];
|
|
67
|
+
if (p.required !== false && (val === void 0 || val === "" || val === null)) {
|
|
68
|
+
errs[p.name] = "Required";
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (val === "" || val === void 0) return;
|
|
72
|
+
if ((p.type === "int" || p.type === "uint" || p.type === "float") && typeof val === "string") {
|
|
73
|
+
const num = Number(val);
|
|
74
|
+
if (isNaN(num)) {
|
|
75
|
+
errs[p.name] = "Must be a number";
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (p.min !== void 0 && num < p.min) {
|
|
79
|
+
errs[p.name] = `Min: ${p.min}`;
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (p.max !== void 0 && num > p.max) {
|
|
83
|
+
errs[p.name] = `Max: ${p.max}`;
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (p.type === "uint" && num < 0) {
|
|
87
|
+
errs[p.name] = "Must be >= 0";
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (p.type === "int" && !Number.isInteger(num)) {
|
|
91
|
+
errs[p.name] = "Must be integer";
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (p.type === "string" && p.pattern && typeof val === "string") {
|
|
96
|
+
if (!new RegExp(p.pattern).test(val)) errs[p.name] = "Invalid format";
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
setErrors(errs);
|
|
100
|
+
return Object.keys(errs).length === 0;
|
|
101
|
+
}, [parameters, values]);
|
|
102
|
+
const handleSend = useCallback(async () => {
|
|
103
|
+
if (!validate()) return;
|
|
104
|
+
if (hazardous && !showConfirm) {
|
|
105
|
+
setShowConfirm(true);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
setShowConfirm(false);
|
|
109
|
+
setSending(true);
|
|
110
|
+
try {
|
|
111
|
+
const processedValues = {};
|
|
112
|
+
parameters.forEach((p) => {
|
|
113
|
+
let val = values[p.name];
|
|
114
|
+
if ((p.type === "int" || p.type === "uint" || p.type === "float") && typeof val === "string") val = Number(val);
|
|
115
|
+
processedValues[p.name] = val;
|
|
116
|
+
});
|
|
117
|
+
await onSend(processedValues);
|
|
118
|
+
} finally {
|
|
119
|
+
setSending(false);
|
|
120
|
+
}
|
|
121
|
+
}, [
|
|
122
|
+
validate,
|
|
123
|
+
hazardous,
|
|
124
|
+
showConfirm,
|
|
125
|
+
parameters,
|
|
126
|
+
values,
|
|
127
|
+
onSend
|
|
128
|
+
]);
|
|
129
|
+
const commandString = useMemo(() => {
|
|
130
|
+
const params = parameters.map((p) => `${p.name}=${JSON.stringify(values[p.name] ?? "")}`).join(", ");
|
|
131
|
+
return `cmd("${target} ${command}" ${params ? `with ${params}` : ""})`;
|
|
132
|
+
}, [
|
|
133
|
+
target,
|
|
134
|
+
command,
|
|
135
|
+
parameters,
|
|
136
|
+
values
|
|
137
|
+
]);
|
|
138
|
+
const resetToDefaults = useCallback(() => {
|
|
139
|
+
const defaults = {};
|
|
140
|
+
parameters.forEach((p) => {
|
|
141
|
+
if (p.default !== void 0) defaults[p.name] = p.default;
|
|
142
|
+
else if (p.type === "boolean") defaults[p.name] = false;
|
|
143
|
+
else if (p.type === "enum" && p.options?.length) defaults[p.name] = p.options[0];
|
|
144
|
+
else defaults[p.name] = "";
|
|
145
|
+
});
|
|
146
|
+
setValues(defaults);
|
|
147
|
+
setErrors({});
|
|
148
|
+
}, [parameters]);
|
|
149
|
+
const inputStyle = {
|
|
150
|
+
background: tokens.colors.background.base,
|
|
151
|
+
color: tokens.colors.text.primary,
|
|
152
|
+
border: `1px solid ${tokens.colors.border.muted}`,
|
|
153
|
+
borderRadius: tokens.borderRadius.md,
|
|
154
|
+
padding: `${tokens.spacing.sm} ${tokens.spacing.smd}`,
|
|
155
|
+
fontSize: tokens.typography.fontSize.xs,
|
|
156
|
+
outline: "none",
|
|
157
|
+
fontFamily: tokens.typography.fontFamily.mono,
|
|
158
|
+
width: "100%",
|
|
159
|
+
minHeight: 40,
|
|
160
|
+
boxSizing: "border-box",
|
|
161
|
+
transition: "border-color 150ms ease"
|
|
162
|
+
};
|
|
163
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
164
|
+
className: `command-builder ${className}`,
|
|
165
|
+
style: {
|
|
166
|
+
height: typeof height === "number" ? height : void 0,
|
|
167
|
+
background: tokens.colors.background.base,
|
|
168
|
+
...bordered ? tokens.colors.border.cardStyle ?? { border: `1px solid ${tokens.colors.border.muted}` } : { border: "none" },
|
|
169
|
+
borderRadius: tokens.borderRadius.lg,
|
|
170
|
+
overflow: "hidden",
|
|
171
|
+
display: "flex",
|
|
172
|
+
flexDirection: "column",
|
|
173
|
+
fontFamily: tokens.typography.fontFamily.primary,
|
|
174
|
+
color: tokens.colors.text.primary,
|
|
175
|
+
backdropFilter: isTransparentTheme ? "blur(10px)" : void 0,
|
|
176
|
+
WebkitBackdropFilter: isTransparentTheme ? "blur(10px)" : void 0,
|
|
177
|
+
...styleProp
|
|
178
|
+
},
|
|
179
|
+
children: [
|
|
180
|
+
/* @__PURE__ */ jsxs("div", {
|
|
181
|
+
style: {
|
|
182
|
+
padding: `${tokens.spacing.sm} ${tokens.spacing.smd}`,
|
|
183
|
+
borderBottom: `1px solid ${tokens.colors.border.muted}`,
|
|
184
|
+
background: hazardous ? `${tokens.colors.status.critical}12` : tokens.colors.background.surface,
|
|
185
|
+
display: "flex",
|
|
186
|
+
alignItems: "center",
|
|
187
|
+
justifyContent: "space-between"
|
|
188
|
+
},
|
|
189
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
190
|
+
style: {
|
|
191
|
+
display: "flex",
|
|
192
|
+
alignItems: "center",
|
|
193
|
+
gap: tokens.spacing.sm
|
|
194
|
+
},
|
|
195
|
+
children: [
|
|
196
|
+
hazardous && /* @__PURE__ */ jsx("span", {
|
|
197
|
+
role: "img",
|
|
198
|
+
"aria-label": "Hazardous command",
|
|
199
|
+
style: { fontSize: tokens.typography.fontSize.lg },
|
|
200
|
+
children: "⚠"
|
|
201
|
+
}),
|
|
202
|
+
/* @__PURE__ */ jsx("span", {
|
|
203
|
+
style: {
|
|
204
|
+
background: `${tokens.colors.interactive.default}22`,
|
|
205
|
+
color: tokens.colors.interactive.default,
|
|
206
|
+
padding: `${tokens.spacing.xxs} ${tokens.spacing.sm}`,
|
|
207
|
+
borderRadius: tokens.borderRadius.md,
|
|
208
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
209
|
+
fontWeight: tokens.typography.fontWeight.medium
|
|
210
|
+
},
|
|
211
|
+
children: target
|
|
212
|
+
}),
|
|
213
|
+
/* @__PURE__ */ jsx("span", {
|
|
214
|
+
style: {
|
|
215
|
+
fontWeight: tokens.typography.fontWeight.bold,
|
|
216
|
+
fontSize: tokens.typography.fontSize.sm
|
|
217
|
+
},
|
|
218
|
+
children: command
|
|
219
|
+
}),
|
|
220
|
+
hazardous && /* @__PURE__ */ jsx("span", {
|
|
221
|
+
style: {
|
|
222
|
+
background: `${tokens.colors.status.critical}22`,
|
|
223
|
+
color: tokens.colors.status.critical,
|
|
224
|
+
padding: `${tokens.spacing.xxs} ${tokens.spacing.sm}`,
|
|
225
|
+
borderRadius: tokens.borderRadius.sm,
|
|
226
|
+
fontSize: tokens.typography.fontSize.micro,
|
|
227
|
+
fontWeight: tokens.typography.fontWeight.bold,
|
|
228
|
+
textTransform: "uppercase",
|
|
229
|
+
letterSpacing: "0.5px"
|
|
230
|
+
},
|
|
231
|
+
children: "Hazardous"
|
|
232
|
+
})
|
|
233
|
+
]
|
|
234
|
+
}), showHistory && history.length > 0 && /* @__PURE__ */ jsxs("button", {
|
|
235
|
+
onClick: () => setShowHistoryPanel((p) => !p),
|
|
236
|
+
"aria-expanded": showHistoryPanel,
|
|
237
|
+
"aria-label": `Command history (${history.length} entries)`,
|
|
238
|
+
style: {
|
|
239
|
+
background: tokens.colors.background.base,
|
|
240
|
+
color: tokens.colors.text.secondary,
|
|
241
|
+
border: `1px solid ${tokens.colors.border.muted}`,
|
|
242
|
+
borderRadius: tokens.borderRadius.md,
|
|
243
|
+
padding: `${tokens.spacing.xxs} ${tokens.spacing.sm}`,
|
|
244
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
245
|
+
cursor: "pointer",
|
|
246
|
+
transition: "all 150ms ease"
|
|
247
|
+
},
|
|
248
|
+
children: [
|
|
249
|
+
"History (",
|
|
250
|
+
history.length,
|
|
251
|
+
")"
|
|
252
|
+
]
|
|
253
|
+
})]
|
|
254
|
+
}),
|
|
255
|
+
description && /* @__PURE__ */ jsx("div", {
|
|
256
|
+
style: {
|
|
257
|
+
padding: `${tokens.spacing.sm} ${tokens.spacing.smd}`,
|
|
258
|
+
fontSize: tokens.typography.fontSize.xs,
|
|
259
|
+
color: tokens.colors.text.secondary,
|
|
260
|
+
borderBottom: `1px solid ${tokens.colors.border.muted}`,
|
|
261
|
+
lineHeight: tokens.typography.lineHeight.normal
|
|
262
|
+
},
|
|
263
|
+
children: description
|
|
264
|
+
}),
|
|
265
|
+
/* @__PURE__ */ jsx("div", {
|
|
266
|
+
role: "form",
|
|
267
|
+
"aria-label": `${target} ${command} parameters`,
|
|
268
|
+
style: {
|
|
269
|
+
flex: 1,
|
|
270
|
+
overflow: "auto",
|
|
271
|
+
padding: tokens.spacing.smd
|
|
272
|
+
},
|
|
273
|
+
children: parameters.length === 0 ? /* @__PURE__ */ jsx("div", {
|
|
274
|
+
style: {
|
|
275
|
+
color: tokens.colors.text.muted,
|
|
276
|
+
fontSize: tokens.typography.fontSize.xs,
|
|
277
|
+
textAlign: "center",
|
|
278
|
+
padding: tokens.spacing.xl
|
|
279
|
+
},
|
|
280
|
+
children: "No parameters — command will be sent as-is"
|
|
281
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
282
|
+
style: {
|
|
283
|
+
display: "flex",
|
|
284
|
+
flexDirection: "column",
|
|
285
|
+
gap: tokens.spacing.smd
|
|
286
|
+
},
|
|
287
|
+
children: parameters.map((p) => /* @__PURE__ */ jsxs("div", { children: [
|
|
288
|
+
/* @__PURE__ */ jsxs("div", {
|
|
289
|
+
style: {
|
|
290
|
+
display: "flex",
|
|
291
|
+
alignItems: "center",
|
|
292
|
+
gap: tokens.spacing.sm,
|
|
293
|
+
marginBottom: tokens.spacing.xs
|
|
294
|
+
},
|
|
295
|
+
children: [
|
|
296
|
+
/* @__PURE__ */ jsxs("label", {
|
|
297
|
+
htmlFor: `cmd-param-${p.name}`,
|
|
298
|
+
style: {
|
|
299
|
+
fontWeight: tokens.typography.fontWeight.medium,
|
|
300
|
+
fontSize: tokens.typography.fontSize.xs,
|
|
301
|
+
color: tokens.colors.text.primary
|
|
302
|
+
},
|
|
303
|
+
children: [p.name, p.required !== false && /* @__PURE__ */ jsx("span", {
|
|
304
|
+
"aria-label": "required",
|
|
305
|
+
style: {
|
|
306
|
+
color: tokens.colors.status.critical,
|
|
307
|
+
marginLeft: tokens.spacing.xxs
|
|
308
|
+
},
|
|
309
|
+
children: "*"
|
|
310
|
+
})]
|
|
311
|
+
}),
|
|
312
|
+
/* @__PURE__ */ jsxs("span", {
|
|
313
|
+
style: {
|
|
314
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
315
|
+
color: tokens.colors.text.muted,
|
|
316
|
+
background: tokens.colors.background.surface,
|
|
317
|
+
padding: `1px ${tokens.spacing.xs}`,
|
|
318
|
+
borderRadius: tokens.borderRadius.sm
|
|
319
|
+
},
|
|
320
|
+
children: [p.type, p.bitSize ? ` (${p.bitSize}b)` : ""]
|
|
321
|
+
}),
|
|
322
|
+
p.units && /* @__PURE__ */ jsxs("span", {
|
|
323
|
+
style: {
|
|
324
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
325
|
+
color: tokens.colors.interactive.default
|
|
326
|
+
},
|
|
327
|
+
children: [
|
|
328
|
+
"[",
|
|
329
|
+
p.units,
|
|
330
|
+
"]"
|
|
331
|
+
]
|
|
332
|
+
}),
|
|
333
|
+
p.hazardous && /* @__PURE__ */ jsx("span", {
|
|
334
|
+
"aria-label": "Hazardous parameter",
|
|
335
|
+
style: {
|
|
336
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
337
|
+
color: tokens.colors.status.critical
|
|
338
|
+
},
|
|
339
|
+
children: "⚠"
|
|
340
|
+
})
|
|
341
|
+
]
|
|
342
|
+
}),
|
|
343
|
+
p.description && /* @__PURE__ */ jsx("div", {
|
|
344
|
+
id: `cmd-param-desc-${p.name}`,
|
|
345
|
+
style: {
|
|
346
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
347
|
+
color: tokens.colors.text.muted,
|
|
348
|
+
marginBottom: tokens.spacing.xs,
|
|
349
|
+
lineHeight: tokens.typography.lineHeight.tight
|
|
350
|
+
},
|
|
351
|
+
children: p.description
|
|
352
|
+
}),
|
|
353
|
+
p.type === "boolean" ? /* @__PURE__ */ jsxs("label", {
|
|
354
|
+
style: {
|
|
355
|
+
display: "flex",
|
|
356
|
+
alignItems: "center",
|
|
357
|
+
gap: tokens.spacing.sm,
|
|
358
|
+
fontSize: tokens.typography.fontSize.xs,
|
|
359
|
+
cursor: "pointer"
|
|
360
|
+
},
|
|
361
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
362
|
+
id: `cmd-param-${p.name}`,
|
|
363
|
+
type: "checkbox",
|
|
364
|
+
checked: !!values[p.name],
|
|
365
|
+
onChange: (e) => setValue(p.name, e.target.checked),
|
|
366
|
+
"aria-describedby": p.description ? `cmd-param-desc-${p.name}` : void 0,
|
|
367
|
+
style: { accentColor: tokens.colors.interactive.default }
|
|
368
|
+
}), values[p.name] ? "TRUE" : "FALSE"]
|
|
369
|
+
}) : p.type === "enum" ? /* @__PURE__ */ jsx("select", {
|
|
370
|
+
id: `cmd-param-${p.name}`,
|
|
371
|
+
value: String(values[p.name] ?? ""),
|
|
372
|
+
onChange: (e) => setValue(p.name, e.target.value),
|
|
373
|
+
"aria-describedby": p.description ? `cmd-param-desc-${p.name}` : void 0,
|
|
374
|
+
style: inputStyle,
|
|
375
|
+
children: p.options?.map((opt) => /* @__PURE__ */ jsx("option", {
|
|
376
|
+
value: String(opt),
|
|
377
|
+
children: String(opt)
|
|
378
|
+
}, String(opt)))
|
|
379
|
+
}) : /* @__PURE__ */ jsx("input", {
|
|
380
|
+
id: `cmd-param-${p.name}`,
|
|
381
|
+
type: p.type === "int" || p.type === "uint" || p.type === "float" ? "number" : "text",
|
|
382
|
+
value: String(values[p.name] ?? ""),
|
|
383
|
+
onChange: (e) => setValue(p.name, e.target.value),
|
|
384
|
+
placeholder: p.default !== void 0 ? `Default: ${p.default}` : void 0,
|
|
385
|
+
min: p.min,
|
|
386
|
+
max: p.max,
|
|
387
|
+
step: p.type === "float" ? "any" : 1,
|
|
388
|
+
"aria-describedby": p.description ? `cmd-param-desc-${p.name}` : void 0,
|
|
389
|
+
"aria-invalid": !!errors[p.name],
|
|
390
|
+
style: {
|
|
391
|
+
...inputStyle,
|
|
392
|
+
borderColor: errors[p.name] ? tokens.colors.status.critical : tokens.colors.border.muted
|
|
393
|
+
}
|
|
394
|
+
}),
|
|
395
|
+
errors[p.name] && /* @__PURE__ */ jsx("span", {
|
|
396
|
+
role: "alert",
|
|
397
|
+
style: {
|
|
398
|
+
display: "block",
|
|
399
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
400
|
+
color: tokens.colors.status.critical,
|
|
401
|
+
marginTop: tokens.spacing.xxs
|
|
402
|
+
},
|
|
403
|
+
children: errors[p.name]
|
|
404
|
+
})
|
|
405
|
+
] }, p.name))
|
|
406
|
+
})
|
|
407
|
+
}),
|
|
408
|
+
showPreview && /* @__PURE__ */ jsx("div", {
|
|
409
|
+
"aria-label": "Command preview",
|
|
410
|
+
style: {
|
|
411
|
+
padding: `${tokens.spacing.sm} ${tokens.spacing.smd}`,
|
|
412
|
+
borderTop: `1px solid ${tokens.colors.border.muted}`,
|
|
413
|
+
background: tokens.colors.background.surface,
|
|
414
|
+
fontFamily: tokens.typography.fontFamily.mono,
|
|
415
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
416
|
+
color: tokens.colors.text.muted,
|
|
417
|
+
overflow: "hidden",
|
|
418
|
+
textOverflow: "ellipsis",
|
|
419
|
+
whiteSpace: "nowrap"
|
|
420
|
+
},
|
|
421
|
+
children: commandString
|
|
422
|
+
}),
|
|
423
|
+
showConfirm && /* @__PURE__ */ jsxs("div", {
|
|
424
|
+
role: "alertdialog",
|
|
425
|
+
"aria-label": "Confirm hazardous command",
|
|
426
|
+
style: {
|
|
427
|
+
padding: tokens.spacing.smd,
|
|
428
|
+
borderTop: `1px solid ${tokens.colors.status.critical}44`,
|
|
429
|
+
background: `${tokens.colors.status.critical}12`
|
|
430
|
+
},
|
|
431
|
+
children: [
|
|
432
|
+
/* @__PURE__ */ jsx("div", {
|
|
433
|
+
style: {
|
|
434
|
+
fontWeight: tokens.typography.fontWeight.bold,
|
|
435
|
+
color: tokens.colors.status.critical,
|
|
436
|
+
marginBottom: tokens.spacing.sm,
|
|
437
|
+
fontSize: tokens.typography.fontSize.sm
|
|
438
|
+
},
|
|
439
|
+
children: "Confirm Hazardous Command"
|
|
440
|
+
}),
|
|
441
|
+
/* @__PURE__ */ jsx("p", {
|
|
442
|
+
style: {
|
|
443
|
+
fontSize: tokens.typography.fontSize.xs,
|
|
444
|
+
color: tokens.colors.text.secondary,
|
|
445
|
+
marginBottom: tokens.spacing.smd,
|
|
446
|
+
lineHeight: tokens.typography.lineHeight.normal
|
|
447
|
+
},
|
|
448
|
+
children: hazardousDescription || `Are you sure you want to send ${target} ${command}?`
|
|
449
|
+
}),
|
|
450
|
+
/* @__PURE__ */ jsxs("div", {
|
|
451
|
+
style: {
|
|
452
|
+
display: "flex",
|
|
453
|
+
gap: tokens.spacing.sm
|
|
454
|
+
},
|
|
455
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
456
|
+
onClick: handleSend,
|
|
457
|
+
style: {
|
|
458
|
+
background: tokens.colors.status.critical,
|
|
459
|
+
color: tokens.colors.text.inverse,
|
|
460
|
+
border: "none",
|
|
461
|
+
borderRadius: tokens.borderRadius.md,
|
|
462
|
+
padding: `${tokens.spacing.sm} ${tokens.spacing.md}`,
|
|
463
|
+
fontSize: tokens.typography.fontSize.xs,
|
|
464
|
+
fontWeight: tokens.typography.fontWeight.medium,
|
|
465
|
+
cursor: "pointer",
|
|
466
|
+
transition: "opacity 150ms ease"
|
|
467
|
+
},
|
|
468
|
+
children: "Confirm Send"
|
|
469
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
470
|
+
onClick: () => setShowConfirm(false),
|
|
471
|
+
style: {
|
|
472
|
+
background: tokens.colors.background.base,
|
|
473
|
+
color: tokens.colors.text.secondary,
|
|
474
|
+
border: `1px solid ${tokens.colors.border.muted}`,
|
|
475
|
+
borderRadius: tokens.borderRadius.md,
|
|
476
|
+
padding: `${tokens.spacing.sm} ${tokens.spacing.md}`,
|
|
477
|
+
fontSize: tokens.typography.fontSize.xs,
|
|
478
|
+
cursor: "pointer",
|
|
479
|
+
transition: "opacity 150ms ease"
|
|
480
|
+
},
|
|
481
|
+
children: "Cancel"
|
|
482
|
+
})]
|
|
483
|
+
})
|
|
484
|
+
]
|
|
485
|
+
}),
|
|
486
|
+
!showConfirm && /* @__PURE__ */ jsxs("div", {
|
|
487
|
+
style: {
|
|
488
|
+
padding: `${tokens.spacing.sm} ${tokens.spacing.smd}`,
|
|
489
|
+
borderTop: `1px solid ${tokens.colors.border.muted}`,
|
|
490
|
+
background: tokens.colors.background.surface,
|
|
491
|
+
display: "flex",
|
|
492
|
+
alignItems: "center",
|
|
493
|
+
justifyContent: "space-between"
|
|
494
|
+
},
|
|
495
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
496
|
+
onClick: resetToDefaults,
|
|
497
|
+
"aria-label": "Reset all parameters to defaults",
|
|
498
|
+
style: {
|
|
499
|
+
background: "transparent",
|
|
500
|
+
color: tokens.colors.text.muted,
|
|
501
|
+
border: `1px solid ${tokens.colors.border.muted}`,
|
|
502
|
+
borderRadius: tokens.borderRadius.md,
|
|
503
|
+
padding: `${tokens.spacing.xs} ${tokens.spacing.sm}`,
|
|
504
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
505
|
+
cursor: "pointer",
|
|
506
|
+
transition: "all 150ms ease"
|
|
507
|
+
},
|
|
508
|
+
children: "Reset Defaults"
|
|
509
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
510
|
+
onClick: handleSend,
|
|
511
|
+
disabled: disabled || sending,
|
|
512
|
+
"aria-busy": sending,
|
|
513
|
+
style: {
|
|
514
|
+
background: hazardous ? tokens.colors.status.critical : tokens.colors.interactive.default,
|
|
515
|
+
color: tokens.colors.text.inverse,
|
|
516
|
+
border: "none",
|
|
517
|
+
borderRadius: tokens.borderRadius.md,
|
|
518
|
+
padding: `${tokens.spacing.sm} ${tokens.spacing.lg}`,
|
|
519
|
+
fontSize: tokens.typography.fontSize.sm,
|
|
520
|
+
fontWeight: tokens.typography.fontWeight.medium,
|
|
521
|
+
cursor: disabled || sending ? "not-allowed" : "pointer",
|
|
522
|
+
opacity: disabled || sending ? .5 : 1,
|
|
523
|
+
transition: "opacity 150ms ease"
|
|
524
|
+
},
|
|
525
|
+
children: sending ? "Sending..." : "Send Command"
|
|
526
|
+
})]
|
|
527
|
+
}),
|
|
528
|
+
showHistoryPanel && history.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
529
|
+
role: "list",
|
|
530
|
+
"aria-label": "Command history",
|
|
531
|
+
style: {
|
|
532
|
+
borderTop: `1px solid ${tokens.colors.border.muted}`,
|
|
533
|
+
background: tokens.colors.background.surface,
|
|
534
|
+
maxHeight: 200,
|
|
535
|
+
overflow: "auto"
|
|
536
|
+
},
|
|
537
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
538
|
+
style: {
|
|
539
|
+
padding: `${tokens.spacing.sm} ${tokens.spacing.smd}`,
|
|
540
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
541
|
+
color: tokens.colors.text.muted,
|
|
542
|
+
fontWeight: tokens.typography.fontWeight.medium,
|
|
543
|
+
textTransform: "uppercase",
|
|
544
|
+
letterSpacing: "0.5px"
|
|
545
|
+
},
|
|
546
|
+
children: "Command History"
|
|
547
|
+
}), history.slice().reverse().map((h) => /* @__PURE__ */ jsx("div", {
|
|
548
|
+
role: "listitem",
|
|
549
|
+
style: { borderBottom: `1px solid ${tokens.colors.border.muted}` },
|
|
550
|
+
children: /* @__PURE__ */ jsxs("button", {
|
|
551
|
+
type: "button",
|
|
552
|
+
"aria-label": `${h.status} at ${h.timestamp.toLocaleTimeString()}`,
|
|
553
|
+
style: {
|
|
554
|
+
width: "100%",
|
|
555
|
+
textAlign: "left",
|
|
556
|
+
padding: `${tokens.spacing.sm} ${tokens.spacing.smd}`,
|
|
557
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
558
|
+
display: "flex",
|
|
559
|
+
alignItems: "center",
|
|
560
|
+
gap: tokens.spacing.sm,
|
|
561
|
+
cursor: "pointer",
|
|
562
|
+
transition: "background 150ms ease",
|
|
563
|
+
border: "none",
|
|
564
|
+
background: "transparent",
|
|
565
|
+
color: "inherit"
|
|
566
|
+
},
|
|
567
|
+
onClick: () => setValues(h.parameters),
|
|
568
|
+
children: [
|
|
569
|
+
/* @__PURE__ */ jsx("span", {
|
|
570
|
+
"aria-hidden": "true",
|
|
571
|
+
style: {
|
|
572
|
+
width: 8,
|
|
573
|
+
height: 8,
|
|
574
|
+
flexShrink: 0,
|
|
575
|
+
...h.status === "success" ? {
|
|
576
|
+
borderRadius: tokens.borderRadius.full,
|
|
577
|
+
background: tokens.colors.status.normal
|
|
578
|
+
} : h.status === "error" ? {
|
|
579
|
+
borderRadius: 0,
|
|
580
|
+
background: tokens.colors.status.critical,
|
|
581
|
+
clipPath: "polygon(50% 100%, 0% 0%, 100% 0%)"
|
|
582
|
+
} : {
|
|
583
|
+
borderRadius: tokens.borderRadius.full,
|
|
584
|
+
background: "transparent",
|
|
585
|
+
border: `2px solid ${tokens.colors.status.standby}`
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}),
|
|
589
|
+
/* @__PURE__ */ jsx("span", {
|
|
590
|
+
style: {
|
|
591
|
+
color: tokens.colors.text.muted,
|
|
592
|
+
fontFamily: tokens.typography.fontFamily.mono,
|
|
593
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
594
|
+
flexShrink: 0
|
|
595
|
+
},
|
|
596
|
+
children: h.timestamp.toLocaleTimeString()
|
|
597
|
+
}),
|
|
598
|
+
/* @__PURE__ */ jsx("span", {
|
|
599
|
+
style: {
|
|
600
|
+
fontFamily: tokens.typography.fontFamily.mono,
|
|
601
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
602
|
+
flex: 1,
|
|
603
|
+
overflow: "hidden",
|
|
604
|
+
textOverflow: "ellipsis",
|
|
605
|
+
whiteSpace: "nowrap"
|
|
606
|
+
},
|
|
607
|
+
children: Object.entries(h.parameters).map(([k, v]) => `${k}=${JSON.stringify(v)}`).join(", ")
|
|
608
|
+
}),
|
|
609
|
+
h.error && /* @__PURE__ */ jsx("span", {
|
|
610
|
+
style: {
|
|
611
|
+
fontSize: tokens.typography.fontSize.micro,
|
|
612
|
+
color: tokens.colors.status.critical
|
|
613
|
+
},
|
|
614
|
+
children: h.error
|
|
615
|
+
})
|
|
616
|
+
]
|
|
617
|
+
})
|
|
618
|
+
}, h.id))]
|
|
619
|
+
})
|
|
620
|
+
]
|
|
621
|
+
});
|
|
514
622
|
});
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
//# sourceMappingURL=CommandBuilder.js.map
|
|
623
|
+
//#endregion
|
|
624
|
+
export { CommandBuilder, CommandBuilder as default };
|
|
625
|
+
|
|
626
|
+
//# sourceMappingURL=CommandBuilder.js.map
|