@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responsive.js","sources":["../../../../src/react/core/layout/responsive.ts"],"sourcesContent":["/**\r\n * @zendir/ui - Responsive Utilities\r\n * \r\n * Helpers for resolving responsive values and spacing tokens to CSS values.\r\n * Used internally by layout primitives (Box, Flex, Grid, Stack).\r\n */\r\n\r\nimport type { ThemeTokens } from '../../theme';\r\nimport type { Breakpoint, ResponsiveValue } from './useBreakpoint';\r\nimport { resolveResponsiveValue } from './useBreakpoint';\r\n\r\n/** Spacing token names matching ThemeTokens.spacing */\r\nexport type SpacingToken = 'xxs' | 'xs' | 'sm' | 'smd' | 'md' | 'mdl' | 'lg' | 'xl' | 'xxl';\r\n\r\n/** Value that can be a spacing token, a CSS string, or a number (px) */\r\ntype SpacingInput = SpacingToken | string | number;\r\n\r\n/**\r\n * Resolve a spacing value to a CSS string.\r\n * - SpacingToken ('xs', 'sm', etc.) → looks up token value\r\n * - number → converts to px string\r\n * - string → passes through (e.g., '1rem', '50%')\r\n */\r\nexport function resolveSpacing(\r\n value: SpacingInput | undefined,\r\n tokens: ThemeTokens\r\n): string | undefined {\r\n if (value === undefined || value === null) return undefined;\r\n \r\n // Spacing token\r\n if (typeof value === 'string' && value in tokens.spacing) {\r\n return tokens.spacing[value as SpacingToken];\r\n }\r\n \r\n // Number → px\r\n if (typeof value === 'number') {\r\n return `${value}px`;\r\n }\r\n \r\n // CSS string passthrough\r\n return value;\r\n}\r\n\r\n/**\r\n * Resolve a responsive spacing value at the current breakpoint.\r\n */\r\nexport function resolveResponsiveSpacing(\r\n value: ResponsiveValue<SpacingInput> | undefined,\r\n breakpoint: Breakpoint,\r\n tokens: ThemeTokens\r\n): string | undefined {\r\n if (value === undefined || value === null) return undefined;\r\n \r\n const resolved = Array.isArray(value)\r\n ? resolveResponsiveValue(value, breakpoint)\r\n : value;\r\n \r\n return resolveSpacing(resolved, tokens);\r\n}\r\n\r\n/**\r\n * Resolve a responsive value (non-spacing) at the current breakpoint.\r\n */\r\nexport function resolveResponsive<T>(\r\n value: ResponsiveValue<T> | undefined,\r\n breakpoint: Breakpoint\r\n): T | undefined {\r\n if (value === undefined || value === null) return undefined;\r\n return Array.isArray(value)\r\n ? resolveResponsiveValue(value, breakpoint)\r\n : value;\r\n}\r\n"],"names":[],"mappings":";AAuBO,SAAS,eACd,OACA,QACoB;AACpB,MAAI,UAAU,UAAa,UAAU,KAAM,QAAO;AAGlD,MAAI,OAAO,UAAU,YAAY,SAAS,OAAO,SAAS;AACxD,WAAO,OAAO,QAAQ,KAAqB;AAAA,EAC7C;AAGA,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO,GAAG,KAAK;AAAA,EACjB;AAGA,SAAO;AACT;AAKO,SAAS,yBACd,OACA,YACA,QACoB;AACpB,MAAI,UAAU,UAAa,UAAU,KAAM,QAAO;AAElD,QAAM,WAAW,MAAM,QAAQ,KAAK,IAChC,uBAAuB,OAAO,UAAU,IACxC;AAEJ,SAAO,eAAe,UAAU,MAAM;AACxC;AAKO,SAAS,kBACd,OACA,YACe;AACf,MAAI,UAAU,UAAa,UAAU,KAAM,QAAO;AAClD,SAAO,MAAM,QAAQ,KAAK,IACtB,uBAAuB,OAAO,UAAU,IACxC;AACN;"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zendir/ui - Responsive Breakpoint System
|
|
3
|
+
*
|
|
4
|
+
* Breakpoints aligned with Astro UX Design System responsive guidelines.
|
|
5
|
+
* Supports mission control displays (4K) down to mobile field devices.
|
|
6
|
+
*
|
|
7
|
+
* Breakpoints:
|
|
8
|
+
* - sm: 640px — Mobile landscape / small tablets
|
|
9
|
+
* - md: 768px — Tablets
|
|
10
|
+
* - lg: 1024px — Laptops / desktop
|
|
11
|
+
* - xl: 1280px — Large monitors
|
|
12
|
+
* - xxl: 1920px — Mission control displays (HD)
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const { isMobile, isTablet, isDesktop, breakpoint, width } = useBreakpoint();
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export type Breakpoint = 'base' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
20
|
+
/** Responsive value: single value or [base, sm?, md?, lg?, xl?, xxl?] */
|
|
21
|
+
export type ResponsiveValue<T> = T | [T, T?, T?, T?, T?, T?];
|
|
22
|
+
export declare const BREAKPOINTS: {
|
|
23
|
+
readonly base: 0;
|
|
24
|
+
readonly sm: 640;
|
|
25
|
+
readonly md: 768;
|
|
26
|
+
readonly lg: 1024;
|
|
27
|
+
readonly xl: 1280;
|
|
28
|
+
readonly xxl: 1920;
|
|
29
|
+
};
|
|
30
|
+
export interface UseBreakpointReturn {
|
|
31
|
+
/** Current breakpoint name */
|
|
32
|
+
breakpoint: Breakpoint;
|
|
33
|
+
/** Current viewport width in px */
|
|
34
|
+
width: number;
|
|
35
|
+
/** True when viewport < 768px (base, sm) */
|
|
36
|
+
isMobile: boolean;
|
|
37
|
+
/** True when viewport >= 768px and < 1024px */
|
|
38
|
+
isTablet: boolean;
|
|
39
|
+
/** True when viewport >= 1024px */
|
|
40
|
+
isDesktop: boolean;
|
|
41
|
+
/** True when viewport >= 1920px (mission control) */
|
|
42
|
+
isWidescreen: boolean;
|
|
43
|
+
/** Check if viewport is at or above a given breakpoint */
|
|
44
|
+
isAbove: (bp: Breakpoint) => boolean;
|
|
45
|
+
/** Check if viewport is below a given breakpoint */
|
|
46
|
+
isBelow: (bp: Breakpoint) => boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Hook for responsive breakpoint detection.
|
|
50
|
+
*
|
|
51
|
+
* Uses matchMedia for efficient, debounce-free breakpoint tracking.
|
|
52
|
+
* Respects SSR by defaulting to 'lg' (desktop).
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* const { isMobile, isDesktop, breakpoint } = useBreakpoint();
|
|
57
|
+
*
|
|
58
|
+
* return (
|
|
59
|
+
* <Grid columns={isMobile ? 1 : 3}>
|
|
60
|
+
* ...
|
|
61
|
+
* </Grid>
|
|
62
|
+
* );
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export declare function useBreakpoint(): UseBreakpointReturn;
|
|
66
|
+
/**
|
|
67
|
+
* Resolve a responsive value based on current breakpoint.
|
|
68
|
+
*
|
|
69
|
+
* Given `[1, 2, 3]` at breakpoint 'lg', returns 3.
|
|
70
|
+
* Falls back to the last defined value for higher breakpoints.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* resolveResponsiveValue([1, 2, 3], 'lg') // → 3
|
|
74
|
+
* resolveResponsiveValue([1, 2], 'xl') // → 2 (falls back to last defined)
|
|
75
|
+
* resolveResponsiveValue(5, 'md') // → 5 (non-array passthrough)
|
|
76
|
+
*/
|
|
77
|
+
export declare function resolveResponsiveValue<T>(value: ResponsiveValue<T>, breakpoint: Breakpoint): T;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { useState, useEffect, useMemo, useCallback } from "react";
|
|
2
|
+
const BREAKPOINTS = {
|
|
3
|
+
base: 0,
|
|
4
|
+
sm: 640,
|
|
5
|
+
md: 768,
|
|
6
|
+
lg: 1024,
|
|
7
|
+
xl: 1280,
|
|
8
|
+
xxl: 1920
|
|
9
|
+
};
|
|
10
|
+
const BREAKPOINT_ORDER = ["base", "sm", "md", "lg", "xl", "xxl"];
|
|
11
|
+
function getBreakpoint(width) {
|
|
12
|
+
if (width >= BREAKPOINTS.xxl) return "xxl";
|
|
13
|
+
if (width >= BREAKPOINTS.xl) return "xl";
|
|
14
|
+
if (width >= BREAKPOINTS.lg) return "lg";
|
|
15
|
+
if (width >= BREAKPOINTS.md) return "md";
|
|
16
|
+
if (width >= BREAKPOINTS.sm) return "sm";
|
|
17
|
+
return "base";
|
|
18
|
+
}
|
|
19
|
+
function useBreakpoint() {
|
|
20
|
+
const [width, setWidth] = useState(() => {
|
|
21
|
+
if (typeof window !== "undefined") return window.innerWidth;
|
|
22
|
+
return 1024;
|
|
23
|
+
});
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (typeof window === "undefined") return;
|
|
26
|
+
let rafId;
|
|
27
|
+
const handleResize = () => {
|
|
28
|
+
cancelAnimationFrame(rafId);
|
|
29
|
+
rafId = requestAnimationFrame(() => {
|
|
30
|
+
setWidth(window.innerWidth);
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
window.addEventListener("resize", handleResize, { passive: true });
|
|
34
|
+
return () => {
|
|
35
|
+
window.removeEventListener("resize", handleResize);
|
|
36
|
+
cancelAnimationFrame(rafId);
|
|
37
|
+
};
|
|
38
|
+
}, []);
|
|
39
|
+
const breakpoint = useMemo(() => getBreakpoint(width), [width]);
|
|
40
|
+
const isAbove = useCallback((bp) => {
|
|
41
|
+
return width >= BREAKPOINTS[bp];
|
|
42
|
+
}, [width]);
|
|
43
|
+
const isBelow = useCallback((bp) => {
|
|
44
|
+
return width < BREAKPOINTS[bp];
|
|
45
|
+
}, [width]);
|
|
46
|
+
return useMemo(() => ({
|
|
47
|
+
breakpoint,
|
|
48
|
+
width,
|
|
49
|
+
isMobile: width < BREAKPOINTS.md,
|
|
50
|
+
isTablet: width >= BREAKPOINTS.md && width < BREAKPOINTS.lg,
|
|
51
|
+
isDesktop: width >= BREAKPOINTS.lg,
|
|
52
|
+
isWidescreen: width >= BREAKPOINTS.xxl,
|
|
53
|
+
isAbove,
|
|
54
|
+
isBelow
|
|
55
|
+
}), [breakpoint, width, isAbove, isBelow]);
|
|
56
|
+
}
|
|
57
|
+
function resolveResponsiveValue(value, breakpoint) {
|
|
58
|
+
if (!Array.isArray(value)) return value;
|
|
59
|
+
const index = BREAKPOINT_ORDER.indexOf(breakpoint);
|
|
60
|
+
for (let i = Math.min(index, value.length - 1); i >= 0; i--) {
|
|
61
|
+
if (value[i] !== void 0 && value[i] !== null) return value[i];
|
|
62
|
+
}
|
|
63
|
+
for (let i = 0; i < value.length; i++) {
|
|
64
|
+
if (value[i] !== void 0 && value[i] !== null) return value[i];
|
|
65
|
+
}
|
|
66
|
+
return value[0];
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
BREAKPOINTS,
|
|
70
|
+
resolveResponsiveValue,
|
|
71
|
+
useBreakpoint
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=useBreakpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBreakpoint.js","sources":["../../../../src/react/core/layout/useBreakpoint.ts"],"sourcesContent":["/**\r\n * @zendir/ui - Responsive Breakpoint System\r\n * \r\n * Breakpoints aligned with Astro UX Design System responsive guidelines.\r\n * Supports mission control displays (4K) down to mobile field devices.\r\n * \r\n * Breakpoints:\r\n * - sm: 640px — Mobile landscape / small tablets\r\n * - md: 768px — Tablets\r\n * - lg: 1024px — Laptops / desktop\r\n * - xl: 1280px — Large monitors\r\n * - xxl: 1920px — Mission control displays (HD)\r\n * \r\n * @example\r\n * ```tsx\r\n * const { isMobile, isTablet, isDesktop, breakpoint, width } = useBreakpoint();\r\n * ```\r\n */\r\n\r\nimport { useState, useEffect, useCallback, useMemo } from 'react';\r\n\r\nexport type Breakpoint = 'base' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';\r\n\r\n/** Responsive value: single value or [base, sm?, md?, lg?, xl?, xxl?] */\r\nexport type ResponsiveValue<T> = T | [T, T?, T?, T?, T?, T?];\r\n\r\nexport const BREAKPOINTS = {\r\n base: 0,\r\n sm: 640,\r\n md: 768,\r\n lg: 1024,\r\n xl: 1280,\r\n xxl: 1920,\r\n} as const;\r\n\r\nconst BREAKPOINT_ORDER: Breakpoint[] = ['base', 'sm', 'md', 'lg', 'xl', 'xxl'];\r\n\r\nfunction getBreakpoint(width: number): Breakpoint {\r\n if (width >= BREAKPOINTS.xxl) return 'xxl';\r\n if (width >= BREAKPOINTS.xl) return 'xl';\r\n if (width >= BREAKPOINTS.lg) return 'lg';\r\n if (width >= BREAKPOINTS.md) return 'md';\r\n if (width >= BREAKPOINTS.sm) return 'sm';\r\n return 'base';\r\n}\r\n\r\nexport interface UseBreakpointReturn {\r\n /** Current breakpoint name */\r\n breakpoint: Breakpoint;\r\n /** Current viewport width in px */\r\n width: number;\r\n /** True when viewport < 768px (base, sm) */\r\n isMobile: boolean;\r\n /** True when viewport >= 768px and < 1024px */\r\n isTablet: boolean;\r\n /** True when viewport >= 1024px */\r\n isDesktop: boolean;\r\n /** True when viewport >= 1920px (mission control) */\r\n isWidescreen: boolean;\r\n /** Check if viewport is at or above a given breakpoint */\r\n isAbove: (bp: Breakpoint) => boolean;\r\n /** Check if viewport is below a given breakpoint */\r\n isBelow: (bp: Breakpoint) => boolean;\r\n}\r\n\r\n/**\r\n * Hook for responsive breakpoint detection.\r\n * \r\n * Uses matchMedia for efficient, debounce-free breakpoint tracking.\r\n * Respects SSR by defaulting to 'lg' (desktop).\r\n * \r\n * @example\r\n * ```tsx\r\n * const { isMobile, isDesktop, breakpoint } = useBreakpoint();\r\n * \r\n * return (\r\n * <Grid columns={isMobile ? 1 : 3}>\r\n * ...\r\n * </Grid>\r\n * );\r\n * ```\r\n */\r\nexport function useBreakpoint(): UseBreakpointReturn {\r\n const [width, setWidth] = useState(() => {\r\n if (typeof window !== 'undefined') return window.innerWidth;\r\n return 1024; // SSR default: desktop\r\n });\r\n\r\n useEffect(() => {\r\n if (typeof window === 'undefined') return;\r\n\r\n let rafId: number;\r\n const handleResize = () => {\r\n cancelAnimationFrame(rafId);\r\n rafId = requestAnimationFrame(() => {\r\n setWidth(window.innerWidth);\r\n });\r\n };\r\n\r\n window.addEventListener('resize', handleResize, { passive: true });\r\n return () => {\r\n window.removeEventListener('resize', handleResize);\r\n cancelAnimationFrame(rafId);\r\n };\r\n }, []);\r\n\r\n const breakpoint = useMemo(() => getBreakpoint(width), [width]);\r\n\r\n const isAbove = useCallback((bp: Breakpoint) => {\r\n return width >= BREAKPOINTS[bp];\r\n }, [width]);\r\n\r\n const isBelow = useCallback((bp: Breakpoint) => {\r\n return width < BREAKPOINTS[bp];\r\n }, [width]);\r\n\r\n return useMemo(() => ({\r\n breakpoint,\r\n width,\r\n isMobile: width < BREAKPOINTS.md,\r\n isTablet: width >= BREAKPOINTS.md && width < BREAKPOINTS.lg,\r\n isDesktop: width >= BREAKPOINTS.lg,\r\n isWidescreen: width >= BREAKPOINTS.xxl,\r\n isAbove,\r\n isBelow,\r\n }), [breakpoint, width, isAbove, isBelow]);\r\n}\r\n\r\n/**\r\n * Resolve a responsive value based on current breakpoint.\r\n * \r\n * Given `[1, 2, 3]` at breakpoint 'lg', returns 3.\r\n * Falls back to the last defined value for higher breakpoints.\r\n * \r\n * @example\r\n * resolveResponsiveValue([1, 2, 3], 'lg') // → 3\r\n * resolveResponsiveValue([1, 2], 'xl') // → 2 (falls back to last defined)\r\n * resolveResponsiveValue(5, 'md') // → 5 (non-array passthrough)\r\n */\r\nexport function resolveResponsiveValue<T>(value: ResponsiveValue<T>, breakpoint: Breakpoint): T {\r\n if (!Array.isArray(value)) return value;\r\n \r\n const index = BREAKPOINT_ORDER.indexOf(breakpoint);\r\n \r\n // Walk backwards from current breakpoint to find a defined value\r\n for (let i = Math.min(index, value.length - 1); i >= 0; i--) {\r\n if (value[i] !== undefined && value[i] !== null) return value[i] as T;\r\n }\r\n \r\n // Fallback: find first defined value in the responsive array.\r\n for (let i = 0; i < value.length; i++) {\r\n if (value[i] !== undefined && value[i] !== null) return value[i] as T;\r\n }\r\n\r\n return value[0] as T;\r\n}\r\n"],"names":[],"mappings":";AA0BO,MAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,KAAK;AACP;AAEA,MAAM,mBAAiC,CAAC,QAAQ,MAAM,MAAM,MAAM,MAAM,KAAK;AAE7E,SAAS,cAAc,OAA2B;AAChD,MAAI,SAAS,YAAY,IAAK,QAAO;AACrC,MAAI,SAAS,YAAY,GAAI,QAAO;AACpC,MAAI,SAAS,YAAY,GAAI,QAAO;AACpC,MAAI,SAAS,YAAY,GAAI,QAAO;AACpC,MAAI,SAAS,YAAY,GAAI,QAAO;AACpC,SAAO;AACT;AAsCO,SAAS,gBAAqC;AACnD,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,MAAM;AACvC,QAAI,OAAO,WAAW,YAAa,QAAO,OAAO;AACjD,WAAO;AAAA,EACT,CAAC;AAED,YAAU,MAAM;AACd,QAAI,OAAO,WAAW,YAAa;AAEnC,QAAI;AACJ,UAAM,eAAe,MAAM;AACzB,2BAAqB,KAAK;AAC1B,cAAQ,sBAAsB,MAAM;AAClC,iBAAS,OAAO,UAAU;AAAA,MAC5B,CAAC;AAAA,IACH;AAEA,WAAO,iBAAiB,UAAU,cAAc,EAAE,SAAS,MAAM;AACjE,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU,YAAY;AACjD,2BAAqB,KAAK;AAAA,IAC5B;AAAA,EACF,GAAG,CAAA,CAAE;AAEL,QAAM,aAAa,QAAQ,MAAM,cAAc,KAAK,GAAG,CAAC,KAAK,CAAC;AAE9D,QAAM,UAAU,YAAY,CAAC,OAAmB;AAC9C,WAAO,SAAS,YAAY,EAAE;AAAA,EAChC,GAAG,CAAC,KAAK,CAAC;AAEV,QAAM,UAAU,YAAY,CAAC,OAAmB;AAC9C,WAAO,QAAQ,YAAY,EAAE;AAAA,EAC/B,GAAG,CAAC,KAAK,CAAC;AAEV,SAAO,QAAQ,OAAO;AAAA,IACpB;AAAA,IACA;AAAA,IACA,UAAU,QAAQ,YAAY;AAAA,IAC9B,UAAU,SAAS,YAAY,MAAM,QAAQ,YAAY;AAAA,IACzD,WAAW,SAAS,YAAY;AAAA,IAChC,cAAc,SAAS,YAAY;AAAA,IACnC;AAAA,IACA;AAAA,EAAA,IACE,CAAC,YAAY,OAAO,SAAS,OAAO,CAAC;AAC3C;AAaO,SAAS,uBAA0B,OAA2B,YAA2B;AAC9F,MAAI,CAAC,MAAM,QAAQ,KAAK,EAAG,QAAO;AAElC,QAAM,QAAQ,iBAAiB,QAAQ,UAAU;AAGjD,WAAS,IAAI,KAAK,IAAI,OAAO,MAAM,SAAS,CAAC,GAAG,KAAK,GAAG,KAAK;AAC3D,QAAI,MAAM,CAAC,MAAM,UAAa,MAAM,CAAC,MAAM,KAAM,QAAO,MAAM,CAAC;AAAA,EACjE;AAGA,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,QAAI,MAAM,CAAC,MAAM,UAAa,MAAM,CAAC,MAAM,KAAM,QAAO,MAAM,CAAC;AAAA,EACjE;AAEA,SAAO,MAAM,CAAC;AAChB;"}
|
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
import { StatusLevel } from '../utils';
|
|
2
|
+
import { AstroIconName } from './AstroIcon';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Threshold configuration for automatic status derivation
|
|
6
|
+
* Values are compared: value >= threshold triggers that status (high thresholds)
|
|
7
|
+
* or value <= threshold triggers that status (low thresholds)
|
|
8
|
+
*/
|
|
9
|
+
export interface StatusThresholds {
|
|
10
|
+
/** Value at or above which status becomes 'critical' (high is bad) */
|
|
11
|
+
critical?: number;
|
|
12
|
+
/** Value at or above which status becomes 'serious' (high is bad) */
|
|
13
|
+
serious?: number;
|
|
14
|
+
/** Value at or above which status becomes 'caution' (high is bad) */
|
|
15
|
+
caution?: number;
|
|
16
|
+
/** Value at or below which status becomes 'caution' (low is bad) */
|
|
17
|
+
cautionLow?: number;
|
|
18
|
+
/** Value at or below which status becomes 'serious' (low is bad) */
|
|
19
|
+
seriousLow?: number;
|
|
20
|
+
/** Value at or below which status becomes 'critical' (low is bad) */
|
|
21
|
+
criticalLow?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Complete property configuration
|
|
25
|
+
*/
|
|
26
|
+
export interface PropertyConfig {
|
|
27
|
+
/** Display name (sentence case per AstroUXDS) */
|
|
28
|
+
label: string;
|
|
29
|
+
/** Astro icon name */
|
|
30
|
+
icon: AstroIconName;
|
|
31
|
+
/** Unit of measurement */
|
|
32
|
+
unit?: string;
|
|
33
|
+
/** Precision for number formatting */
|
|
34
|
+
precision?: number;
|
|
35
|
+
/** Status thresholds for auto-derivation */
|
|
36
|
+
thresholds?: StatusThresholds;
|
|
37
|
+
/** Category for grouping */
|
|
38
|
+
category?: PropertyCategory;
|
|
39
|
+
/** Description for tooltips */
|
|
40
|
+
description?: string;
|
|
41
|
+
/** Format function override */
|
|
42
|
+
format?: (value: number) => string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Property categories for organization
|
|
46
|
+
*/
|
|
47
|
+
export type PropertyCategory = 'power' | 'thermal' | 'attitude' | 'communications' | 'propulsion' | 'navigation' | 'payload' | 'health' | 'orbital' | 'general';
|
|
48
|
+
/**
|
|
49
|
+
* Property key - either a preset name or custom string
|
|
50
|
+
*/
|
|
51
|
+
export type PropertyKey = keyof typeof PROPERTY_PRESETS | (string & {});
|
|
52
|
+
/**
|
|
53
|
+
* Predefined property configurations for common space operations telemetry
|
|
54
|
+
*
|
|
55
|
+
* These provide sensible defaults that can be overridden per-use.
|
|
56
|
+
*/
|
|
57
|
+
export declare const PROPERTY_PRESETS: {
|
|
58
|
+
readonly battery: {
|
|
59
|
+
readonly label: "Battery";
|
|
60
|
+
readonly icon: AstroIconName;
|
|
61
|
+
readonly unit: "%";
|
|
62
|
+
readonly precision: 1;
|
|
63
|
+
readonly category: PropertyCategory;
|
|
64
|
+
readonly thresholds: {
|
|
65
|
+
readonly criticalLow: 10;
|
|
66
|
+
readonly seriousLow: 20;
|
|
67
|
+
readonly cautionLow: 30;
|
|
68
|
+
};
|
|
69
|
+
readonly description: "Battery state of charge";
|
|
70
|
+
};
|
|
71
|
+
readonly voltage: {
|
|
72
|
+
readonly label: "Voltage";
|
|
73
|
+
readonly icon: AstroIconName;
|
|
74
|
+
readonly unit: "V";
|
|
75
|
+
readonly precision: 2;
|
|
76
|
+
readonly category: PropertyCategory;
|
|
77
|
+
readonly thresholds: {
|
|
78
|
+
readonly criticalLow: 24;
|
|
79
|
+
readonly cautionLow: 26;
|
|
80
|
+
};
|
|
81
|
+
readonly description: "Bus voltage";
|
|
82
|
+
};
|
|
83
|
+
readonly current: {
|
|
84
|
+
readonly label: "Current";
|
|
85
|
+
readonly icon: AstroIconName;
|
|
86
|
+
readonly unit: "A";
|
|
87
|
+
readonly precision: 2;
|
|
88
|
+
readonly category: PropertyCategory;
|
|
89
|
+
readonly description: "Current draw";
|
|
90
|
+
};
|
|
91
|
+
readonly power: {
|
|
92
|
+
readonly label: "Power";
|
|
93
|
+
readonly icon: AstroIconName;
|
|
94
|
+
readonly unit: "W";
|
|
95
|
+
readonly precision: 1;
|
|
96
|
+
readonly category: PropertyCategory;
|
|
97
|
+
readonly description: "Power consumption or generation";
|
|
98
|
+
};
|
|
99
|
+
readonly solarPower: {
|
|
100
|
+
readonly label: "Solar";
|
|
101
|
+
readonly icon: AstroIconName;
|
|
102
|
+
readonly unit: "W";
|
|
103
|
+
readonly precision: 1;
|
|
104
|
+
readonly category: PropertyCategory;
|
|
105
|
+
readonly description: "Solar array output";
|
|
106
|
+
};
|
|
107
|
+
readonly load: {
|
|
108
|
+
readonly label: "Load";
|
|
109
|
+
readonly icon: AstroIconName;
|
|
110
|
+
readonly unit: "W";
|
|
111
|
+
readonly precision: 1;
|
|
112
|
+
readonly category: PropertyCategory;
|
|
113
|
+
readonly description: "Power load";
|
|
114
|
+
};
|
|
115
|
+
readonly temperature: {
|
|
116
|
+
readonly label: "Temperature";
|
|
117
|
+
readonly icon: AstroIconName;
|
|
118
|
+
readonly unit: "°C";
|
|
119
|
+
readonly precision: 1;
|
|
120
|
+
readonly category: PropertyCategory;
|
|
121
|
+
readonly thresholds: {
|
|
122
|
+
readonly critical: 80;
|
|
123
|
+
readonly serious: 70;
|
|
124
|
+
readonly caution: 60;
|
|
125
|
+
readonly cautionLow: -20;
|
|
126
|
+
readonly criticalLow: -40;
|
|
127
|
+
};
|
|
128
|
+
readonly description: "Component temperature";
|
|
129
|
+
};
|
|
130
|
+
readonly heater: {
|
|
131
|
+
readonly label: "Heater";
|
|
132
|
+
readonly icon: AstroIconName;
|
|
133
|
+
readonly unit: "";
|
|
134
|
+
readonly category: PropertyCategory;
|
|
135
|
+
readonly description: "Heater status";
|
|
136
|
+
};
|
|
137
|
+
readonly roll: {
|
|
138
|
+
readonly label: "Roll";
|
|
139
|
+
readonly icon: AstroIconName;
|
|
140
|
+
readonly unit: "°";
|
|
141
|
+
readonly precision: 2;
|
|
142
|
+
readonly category: PropertyCategory;
|
|
143
|
+
readonly thresholds: {
|
|
144
|
+
readonly critical: 45;
|
|
145
|
+
readonly caution: 30;
|
|
146
|
+
};
|
|
147
|
+
readonly description: "Roll angle";
|
|
148
|
+
};
|
|
149
|
+
readonly pitch: {
|
|
150
|
+
readonly label: "Pitch";
|
|
151
|
+
readonly icon: AstroIconName;
|
|
152
|
+
readonly unit: "°";
|
|
153
|
+
readonly precision: 2;
|
|
154
|
+
readonly category: PropertyCategory;
|
|
155
|
+
readonly thresholds: {
|
|
156
|
+
readonly critical: 45;
|
|
157
|
+
readonly caution: 30;
|
|
158
|
+
};
|
|
159
|
+
readonly description: "Pitch angle";
|
|
160
|
+
};
|
|
161
|
+
readonly yaw: {
|
|
162
|
+
readonly label: "Yaw";
|
|
163
|
+
readonly icon: AstroIconName;
|
|
164
|
+
readonly unit: "°";
|
|
165
|
+
readonly precision: 2;
|
|
166
|
+
readonly category: PropertyCategory;
|
|
167
|
+
readonly thresholds: {
|
|
168
|
+
readonly critical: 45;
|
|
169
|
+
readonly caution: 30;
|
|
170
|
+
};
|
|
171
|
+
readonly description: "Yaw angle";
|
|
172
|
+
};
|
|
173
|
+
readonly pointingError: {
|
|
174
|
+
readonly label: "Pointing error";
|
|
175
|
+
readonly icon: AstroIconName;
|
|
176
|
+
readonly unit: "°";
|
|
177
|
+
readonly precision: 3;
|
|
178
|
+
readonly category: PropertyCategory;
|
|
179
|
+
readonly thresholds: {
|
|
180
|
+
readonly critical: 1;
|
|
181
|
+
readonly serious: 0.5;
|
|
182
|
+
readonly caution: 0.1;
|
|
183
|
+
};
|
|
184
|
+
readonly description: "Attitude pointing error";
|
|
185
|
+
};
|
|
186
|
+
readonly angularVelocity: {
|
|
187
|
+
readonly label: "Angular velocity";
|
|
188
|
+
readonly icon: AstroIconName;
|
|
189
|
+
readonly unit: "°/s";
|
|
190
|
+
readonly precision: 3;
|
|
191
|
+
readonly category: PropertyCategory;
|
|
192
|
+
readonly thresholds: {
|
|
193
|
+
readonly critical: 5;
|
|
194
|
+
readonly caution: 2;
|
|
195
|
+
};
|
|
196
|
+
readonly description: "Rotation rate";
|
|
197
|
+
};
|
|
198
|
+
readonly signalStrength: {
|
|
199
|
+
readonly label: "Signal";
|
|
200
|
+
readonly icon: AstroIconName;
|
|
201
|
+
readonly unit: "dBm";
|
|
202
|
+
readonly precision: 1;
|
|
203
|
+
readonly category: PropertyCategory;
|
|
204
|
+
readonly thresholds: {
|
|
205
|
+
readonly criticalLow: -100;
|
|
206
|
+
readonly cautionLow: -85;
|
|
207
|
+
};
|
|
208
|
+
readonly description: "Received signal strength";
|
|
209
|
+
};
|
|
210
|
+
readonly dataRate: {
|
|
211
|
+
readonly label: "Data rate";
|
|
212
|
+
readonly icon: AstroIconName;
|
|
213
|
+
readonly unit: "Mbps";
|
|
214
|
+
readonly precision: 2;
|
|
215
|
+
readonly category: PropertyCategory;
|
|
216
|
+
readonly description: "Communication data rate";
|
|
217
|
+
};
|
|
218
|
+
readonly packetLoss: {
|
|
219
|
+
readonly label: "Packet loss";
|
|
220
|
+
readonly icon: AstroIconName;
|
|
221
|
+
readonly unit: "%";
|
|
222
|
+
readonly precision: 2;
|
|
223
|
+
readonly category: PropertyCategory;
|
|
224
|
+
readonly thresholds: {
|
|
225
|
+
readonly critical: 10;
|
|
226
|
+
readonly serious: 5;
|
|
227
|
+
readonly caution: 1;
|
|
228
|
+
};
|
|
229
|
+
readonly description: "Communication packet loss rate";
|
|
230
|
+
};
|
|
231
|
+
readonly snr: {
|
|
232
|
+
readonly label: "SNR";
|
|
233
|
+
readonly icon: AstroIconName;
|
|
234
|
+
readonly unit: "dB";
|
|
235
|
+
readonly precision: 1;
|
|
236
|
+
readonly category: PropertyCategory;
|
|
237
|
+
readonly thresholds: {
|
|
238
|
+
readonly criticalLow: 5;
|
|
239
|
+
readonly cautionLow: 10;
|
|
240
|
+
};
|
|
241
|
+
readonly description: "Signal-to-noise ratio";
|
|
242
|
+
};
|
|
243
|
+
readonly queue: {
|
|
244
|
+
readonly label: "Queue";
|
|
245
|
+
readonly icon: AstroIconName;
|
|
246
|
+
readonly unit: "pkts";
|
|
247
|
+
readonly precision: 0;
|
|
248
|
+
readonly category: PropertyCategory;
|
|
249
|
+
readonly thresholds: {
|
|
250
|
+
readonly critical: 1000;
|
|
251
|
+
readonly caution: 500;
|
|
252
|
+
};
|
|
253
|
+
readonly description: "Packet queue depth";
|
|
254
|
+
};
|
|
255
|
+
readonly fuelLevel: {
|
|
256
|
+
readonly label: "Fuel";
|
|
257
|
+
readonly icon: AstroIconName;
|
|
258
|
+
readonly unit: "%";
|
|
259
|
+
readonly precision: 1;
|
|
260
|
+
readonly category: PropertyCategory;
|
|
261
|
+
readonly thresholds: {
|
|
262
|
+
readonly critical: 5;
|
|
263
|
+
readonly serious: 10;
|
|
264
|
+
readonly caution: 20;
|
|
265
|
+
};
|
|
266
|
+
readonly description: "Propellant remaining";
|
|
267
|
+
};
|
|
268
|
+
readonly deltaV: {
|
|
269
|
+
readonly label: "Delta-V";
|
|
270
|
+
readonly icon: AstroIconName;
|
|
271
|
+
readonly unit: "m/s";
|
|
272
|
+
readonly precision: 1;
|
|
273
|
+
readonly category: PropertyCategory;
|
|
274
|
+
readonly description: "Available delta-V budget";
|
|
275
|
+
};
|
|
276
|
+
readonly thrustLevel: {
|
|
277
|
+
readonly label: "Thrust";
|
|
278
|
+
readonly icon: AstroIconName;
|
|
279
|
+
readonly unit: "N";
|
|
280
|
+
readonly precision: 2;
|
|
281
|
+
readonly category: PropertyCategory;
|
|
282
|
+
readonly description: "Current thrust output";
|
|
283
|
+
};
|
|
284
|
+
readonly altitude: {
|
|
285
|
+
readonly label: "Altitude";
|
|
286
|
+
readonly icon: AstroIconName;
|
|
287
|
+
readonly unit: "km";
|
|
288
|
+
readonly precision: 1;
|
|
289
|
+
readonly category: PropertyCategory;
|
|
290
|
+
readonly thresholds: {
|
|
291
|
+
readonly criticalLow: 200;
|
|
292
|
+
readonly cautionLow: 250;
|
|
293
|
+
};
|
|
294
|
+
readonly description: "Orbital altitude";
|
|
295
|
+
};
|
|
296
|
+
readonly velocity: {
|
|
297
|
+
readonly label: "Velocity";
|
|
298
|
+
readonly icon: AstroIconName;
|
|
299
|
+
readonly unit: "km/s";
|
|
300
|
+
readonly precision: 3;
|
|
301
|
+
readonly category: PropertyCategory;
|
|
302
|
+
readonly description: "Orbital velocity";
|
|
303
|
+
};
|
|
304
|
+
readonly inclination: {
|
|
305
|
+
readonly label: "Inclination";
|
|
306
|
+
readonly icon: AstroIconName;
|
|
307
|
+
readonly unit: "°";
|
|
308
|
+
readonly precision: 2;
|
|
309
|
+
readonly category: PropertyCategory;
|
|
310
|
+
readonly description: "Orbital inclination";
|
|
311
|
+
};
|
|
312
|
+
readonly eccentricity: {
|
|
313
|
+
readonly label: "Eccentricity";
|
|
314
|
+
readonly icon: AstroIconName;
|
|
315
|
+
readonly unit: "";
|
|
316
|
+
readonly precision: 6;
|
|
317
|
+
readonly category: PropertyCategory;
|
|
318
|
+
readonly description: "Orbital eccentricity";
|
|
319
|
+
};
|
|
320
|
+
readonly payloadStatus: {
|
|
321
|
+
readonly label: "Payload";
|
|
322
|
+
readonly icon: AstroIconName;
|
|
323
|
+
readonly unit: "";
|
|
324
|
+
readonly category: PropertyCategory;
|
|
325
|
+
readonly description: "Payload operational status";
|
|
326
|
+
};
|
|
327
|
+
readonly storageUsed: {
|
|
328
|
+
readonly label: "Storage";
|
|
329
|
+
readonly icon: AstroIconName;
|
|
330
|
+
readonly unit: "%";
|
|
331
|
+
readonly precision: 1;
|
|
332
|
+
readonly category: PropertyCategory;
|
|
333
|
+
readonly thresholds: {
|
|
334
|
+
readonly critical: 95;
|
|
335
|
+
readonly serious: 90;
|
|
336
|
+
readonly caution: 80;
|
|
337
|
+
};
|
|
338
|
+
readonly description: "Onboard storage usage";
|
|
339
|
+
};
|
|
340
|
+
readonly cpuUsage: {
|
|
341
|
+
readonly label: "CPU";
|
|
342
|
+
readonly icon: AstroIconName;
|
|
343
|
+
readonly unit: "%";
|
|
344
|
+
readonly precision: 1;
|
|
345
|
+
readonly category: PropertyCategory;
|
|
346
|
+
readonly thresholds: {
|
|
347
|
+
readonly critical: 95;
|
|
348
|
+
readonly serious: 85;
|
|
349
|
+
readonly caution: 75;
|
|
350
|
+
};
|
|
351
|
+
readonly description: "Processor utilization";
|
|
352
|
+
};
|
|
353
|
+
readonly memoryUsage: {
|
|
354
|
+
readonly label: "Memory";
|
|
355
|
+
readonly icon: AstroIconName;
|
|
356
|
+
readonly unit: "%";
|
|
357
|
+
readonly precision: 1;
|
|
358
|
+
readonly category: PropertyCategory;
|
|
359
|
+
readonly thresholds: {
|
|
360
|
+
readonly critical: 95;
|
|
361
|
+
readonly serious: 85;
|
|
362
|
+
readonly caution: 75;
|
|
363
|
+
};
|
|
364
|
+
readonly description: "Memory utilization";
|
|
365
|
+
};
|
|
366
|
+
readonly uptime: {
|
|
367
|
+
readonly label: "Uptime";
|
|
368
|
+
readonly icon: AstroIconName;
|
|
369
|
+
readonly unit: "s";
|
|
370
|
+
readonly precision: 0;
|
|
371
|
+
readonly category: PropertyCategory;
|
|
372
|
+
readonly description: "System uptime";
|
|
373
|
+
};
|
|
374
|
+
readonly count: {
|
|
375
|
+
readonly label: "Count";
|
|
376
|
+
readonly icon: AstroIconName;
|
|
377
|
+
readonly unit: "";
|
|
378
|
+
readonly precision: 0;
|
|
379
|
+
readonly category: PropertyCategory;
|
|
380
|
+
readonly description: "Item count";
|
|
381
|
+
};
|
|
382
|
+
readonly percentage: {
|
|
383
|
+
readonly label: "Percentage";
|
|
384
|
+
readonly icon: AstroIconName;
|
|
385
|
+
readonly unit: "%";
|
|
386
|
+
readonly precision: 1;
|
|
387
|
+
readonly category: PropertyCategory;
|
|
388
|
+
readonly description: "Percentage value";
|
|
389
|
+
};
|
|
390
|
+
readonly duration: {
|
|
391
|
+
readonly label: "Duration";
|
|
392
|
+
readonly icon: AstroIconName;
|
|
393
|
+
readonly unit: "s";
|
|
394
|
+
readonly precision: 0;
|
|
395
|
+
readonly category: PropertyCategory;
|
|
396
|
+
readonly description: "Time duration";
|
|
397
|
+
};
|
|
398
|
+
};
|
|
399
|
+
export declare const CATEGORY_ICONS: Record<PropertyCategory, AstroIconName>;
|
|
400
|
+
export declare const CATEGORY_LABELS: Record<PropertyCategory, string>;
|
|
401
|
+
/**
|
|
402
|
+
* Get property configuration by key
|
|
403
|
+
* Returns preset config or a default config for unknown properties
|
|
404
|
+
*/
|
|
405
|
+
export declare function getPropertyConfig(key: PropertyKey): PropertyConfig;
|
|
406
|
+
/**
|
|
407
|
+
* Format a property key into a display label (sentence case)
|
|
408
|
+
*/
|
|
409
|
+
export declare function formatPropertyLabel(key: string): string;
|
|
410
|
+
/**
|
|
411
|
+
* Derive status level from a value and thresholds
|
|
412
|
+
*
|
|
413
|
+
* @param value - Current value
|
|
414
|
+
* @param thresholds - Status thresholds
|
|
415
|
+
* @returns StatusLevel
|
|
416
|
+
*
|
|
417
|
+
* @example
|
|
418
|
+
* ```tsx
|
|
419
|
+
* deriveStatus(75, { caution: 60, critical: 80 }) // 'caution'
|
|
420
|
+
* deriveStatus(25, { criticalLow: 10, cautionLow: 30 }) // 'caution'
|
|
421
|
+
* deriveStatus(50, { caution: 60, critical: 80 }) // 'normal'
|
|
422
|
+
* ```
|
|
423
|
+
*/
|
|
424
|
+
export declare function deriveStatus(value: number | undefined | null, thresholds?: StatusThresholds): StatusLevel;
|
|
425
|
+
/**
|
|
426
|
+
* Derive status for battery specifically (low is bad)
|
|
427
|
+
*/
|
|
428
|
+
export declare function deriveBatteryStatus(level: number | undefined): StatusLevel;
|
|
429
|
+
/**
|
|
430
|
+
* Format a value with its property config
|
|
431
|
+
*/
|
|
432
|
+
export declare function formatPropertyValue(value: number | undefined | null, config: PropertyConfig): string;
|
|
433
|
+
/**
|
|
434
|
+
* Create a custom property config by merging with a preset
|
|
435
|
+
*/
|
|
436
|
+
export declare function createPropertyConfig(baseKey: PropertyKey, overrides: Partial<PropertyConfig>): PropertyConfig;
|
|
437
|
+
/**
|
|
438
|
+
* Get all properties in a category
|
|
439
|
+
*/
|
|
440
|
+
export declare function getPropertiesByCategory(category: PropertyCategory): Array<{
|
|
441
|
+
key: string;
|
|
442
|
+
config: PropertyConfig;
|
|
443
|
+
}>;
|