@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.
Files changed (359) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/LICENSE +21 -0
  3. package/README.md +589 -0
  4. package/dist/index.d.ts +8 -0
  5. package/dist/index.js +421 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/react/3d/EarthViewer.d.ts +46 -0
  8. package/dist/react/3d/EarthViewer.js +836 -0
  9. package/dist/react/3d/EarthViewer.js.map +1 -0
  10. package/dist/react/3d/SolarSystemViewer.d.ts +43 -0
  11. package/dist/react/3d/SolarSystemViewer.js +372 -0
  12. package/dist/react/3d/SolarSystemViewer.js.map +1 -0
  13. package/dist/react/3d/ZenSpace3D.d.ts +16 -0
  14. package/dist/react/3d/ZenSpace3D.js +1253 -0
  15. package/dist/react/3d/ZenSpace3D.js.map +1 -0
  16. package/dist/react/3d/ZenSpace3DCesium.d.ts +9 -0
  17. package/dist/react/3d/ZenSpace3DCesium.js +186 -0
  18. package/dist/react/3d/ZenSpace3DCesium.js.map +1 -0
  19. package/dist/react/3d/ZenSpace3DShaders.d.ts +78 -0
  20. package/dist/react/3d/ZenSpace3DShaders.js +94 -0
  21. package/dist/react/3d/ZenSpace3DShaders.js.map +1 -0
  22. package/dist/react/3d/ZenSpace3DTypes.d.ts +614 -0
  23. package/dist/react/3d/ZenSpace3DUtils.d.ts +183 -0
  24. package/dist/react/3d/ZenSpace3DUtils.js +213 -0
  25. package/dist/react/3d/ZenSpace3DUtils.js.map +1 -0
  26. package/dist/react/3d/index.d.ts +23 -0
  27. package/dist/react/3d/threeLoader.d.ts +22 -0
  28. package/dist/react/3d/threeLoader.js +18 -0
  29. package/dist/react/3d/threeLoader.js.map +1 -0
  30. package/dist/react/astro/ClassificationBanner.d.ts +25 -0
  31. package/dist/react/astro/ClassificationBanner.js +83 -0
  32. package/dist/react/astro/ClassificationBanner.js.map +1 -0
  33. package/dist/react/astro/GlobalStatusBar.d.ts +42 -0
  34. package/dist/react/astro/GlobalStatusBar.js +165 -0
  35. package/dist/react/astro/GlobalStatusBar.js.map +1 -0
  36. package/dist/react/astro/MissionClock.d.ts +169 -0
  37. package/dist/react/astro/MissionClock.js +411 -0
  38. package/dist/react/astro/MissionClock.js.map +1 -0
  39. package/dist/react/astro/MonitoringIcon.d.ts +60 -0
  40. package/dist/react/astro/MonitoringIcon.js +369 -0
  41. package/dist/react/astro/MonitoringIcon.js.map +1 -0
  42. package/dist/react/astro/Notification.d.ts +42 -0
  43. package/dist/react/astro/Notification.js +156 -0
  44. package/dist/react/astro/Notification.js.map +1 -0
  45. package/dist/react/astro/Progress.d.ts +39 -0
  46. package/dist/react/astro/Progress.js +149 -0
  47. package/dist/react/astro/Progress.js.map +1 -0
  48. package/dist/react/astro/SimulationControls.d.ts +136 -0
  49. package/dist/react/astro/SimulationControls.js +668 -0
  50. package/dist/react/astro/SimulationControls.js.map +1 -0
  51. package/dist/react/astro/StatusIndicator.d.ts +34 -0
  52. package/dist/react/astro/StatusIndicator.js +189 -0
  53. package/dist/react/astro/StatusIndicator.js.map +1 -0
  54. package/dist/react/astro/UnifiedTimeline.d.ts +106 -0
  55. package/dist/react/astro/UnifiedTimeline.js +1768 -0
  56. package/dist/react/astro/UnifiedTimeline.js.map +1 -0
  57. package/dist/react/astro/index.d.ts +63 -0
  58. package/dist/react/cards/AccessCard.d.ts +37 -0
  59. package/dist/react/cards/AccessCard.js +410 -0
  60. package/dist/react/cards/AccessCard.js.map +1 -0
  61. package/dist/react/cards/OrbitCard.d.ts +31 -0
  62. package/dist/react/cards/OrbitCard.js +372 -0
  63. package/dist/react/cards/OrbitCard.js.map +1 -0
  64. package/dist/react/cards/SpacecraftCard.d.ts +54 -0
  65. package/dist/react/cards/SpacecraftCard.js +941 -0
  66. package/dist/react/cards/SpacecraftCard.js.map +1 -0
  67. package/dist/react/cards/TelemetryCard.d.ts +40 -0
  68. package/dist/react/cards/TelemetryCard.js +742 -0
  69. package/dist/react/cards/TelemetryCard.js.map +1 -0
  70. package/dist/react/cards/TelemetryStreamCard.d.ts +59 -0
  71. package/dist/react/cards/TelemetryStreamCard.js +309 -0
  72. package/dist/react/cards/TelemetryStreamCard.js.map +1 -0
  73. package/dist/react/cards/index.d.ts +13 -0
  74. package/dist/react/charts/GroundTrackMap.d.ts +112 -0
  75. package/dist/react/charts/GroundTrackMap.js +1123 -0
  76. package/dist/react/charts/GroundTrackMap.js.map +1 -0
  77. package/dist/react/charts/GroundTrackMapLeaflet.d.ts +26 -0
  78. package/dist/react/charts/GroundTrackMapLeaflet.js +571 -0
  79. package/dist/react/charts/GroundTrackMapLeaflet.js.map +1 -0
  80. package/dist/react/charts/groundTrackMapLeafletTiles.d.ts +22 -0
  81. package/dist/react/charts/groundTrackMapLeafletTiles.js +11 -0
  82. package/dist/react/charts/groundTrackMapLeafletTiles.js.map +1 -0
  83. package/dist/react/charts/groundTrackMapLeafletUtils.d.ts +24 -0
  84. package/dist/react/charts/groundTrackMapLeafletUtils.js +109 -0
  85. package/dist/react/charts/groundTrackMapLeafletUtils.js.map +1 -0
  86. package/dist/react/charts/index.d.ts +10 -0
  87. package/dist/react/charts/unified/AstroChart.d.ts +24 -0
  88. package/dist/react/charts/unified/AstroChart.js +1405 -0
  89. package/dist/react/charts/unified/AstroChart.js.map +1 -0
  90. package/dist/react/charts/unified/PowerOverviewChart.d.ts +73 -0
  91. package/dist/react/charts/unified/PowerOverviewChart.js +488 -0
  92. package/dist/react/charts/unified/PowerOverviewChart.js.map +1 -0
  93. package/dist/react/charts/unified/domain.d.ts +845 -0
  94. package/dist/react/charts/unified/domain.js +3168 -0
  95. package/dist/react/charts/unified/domain.js.map +1 -0
  96. package/dist/react/charts/unified/generators.d.ts +276 -0
  97. package/dist/react/charts/unified/generators.js +518 -0
  98. package/dist/react/charts/unified/generators.js.map +1 -0
  99. package/dist/react/charts/unified/index.d.ts +55 -0
  100. package/dist/react/charts/unified/presets.d.ts +290 -0
  101. package/dist/react/charts/unified/presets.js +999 -0
  102. package/dist/react/charts/unified/presets.js.map +1 -0
  103. package/dist/react/charts/unified/sync.d.ts +69 -0
  104. package/dist/react/charts/unified/sync.js +219 -0
  105. package/dist/react/charts/unified/sync.js.map +1 -0
  106. package/dist/react/charts/unified/theme.d.ts +447 -0
  107. package/dist/react/charts/unified/theme.js +562 -0
  108. package/dist/react/charts/unified/theme.js.map +1 -0
  109. package/dist/react/charts/unified/types.d.ts +826 -0
  110. package/dist/react/charts/unified/useChartStream.d.ts +58 -0
  111. package/dist/react/charts/unified/useChartStream.js +226 -0
  112. package/dist/react/charts/unified/useChartStream.js.map +1 -0
  113. package/dist/react/chatgpt/AppCard.d.ts +59 -0
  114. package/dist/react/chatgpt/AppCard.js +306 -0
  115. package/dist/react/chatgpt/AppCard.js.map +1 -0
  116. package/dist/react/chatgpt/ChatGPTCard.d.ts +6 -0
  117. package/dist/react/chatgpt/index.d.ts +167 -0
  118. package/dist/react/chatgpt/index.js +166 -0
  119. package/dist/react/chatgpt/index.js.map +1 -0
  120. package/dist/react/context/DisplaySettingsContext.d.ts +107 -0
  121. package/dist/react/context/DisplaySettingsContext.js +169 -0
  122. package/dist/react/context/DisplaySettingsContext.js.map +1 -0
  123. package/dist/react/context/index.d.ts +5 -0
  124. package/dist/react/core/ActivityPlanner.d.ts +45 -0
  125. package/dist/react/core/ActivityPlanner.js +532 -0
  126. package/dist/react/core/ActivityPlanner.js.map +1 -0
  127. package/dist/react/core/AppBar.d.ts +71 -0
  128. package/dist/react/core/AppBar.js +817 -0
  129. package/dist/react/core/AppBar.js.map +1 -0
  130. package/dist/react/core/AstroIcon.d.ts +84 -0
  131. package/dist/react/core/AstroIcon.js +1243 -0
  132. package/dist/react/core/AstroIcon.js.map +1 -0
  133. package/dist/react/core/Badge.d.ts +27 -0
  134. package/dist/react/core/Badge.js +134 -0
  135. package/dist/react/core/Badge.js.map +1 -0
  136. package/dist/react/core/Button.d.ts +26 -0
  137. package/dist/react/core/Button.js +306 -0
  138. package/dist/react/core/Button.js.map +1 -0
  139. package/dist/react/core/CardHeader.d.ts +34 -0
  140. package/dist/react/core/CardHeader.js +316 -0
  141. package/dist/react/core/CardHeader.js.map +1 -0
  142. package/dist/react/core/ChatPanel.d.ts +627 -0
  143. package/dist/react/core/ChatPanel.js +1144 -0
  144. package/dist/react/core/ChatPanel.js.map +1 -0
  145. package/dist/react/core/Checkbox.d.ts +26 -0
  146. package/dist/react/core/Checkbox.js +130 -0
  147. package/dist/react/core/Checkbox.js.map +1 -0
  148. package/dist/react/core/ColorPickerPanel.d.ts +25 -0
  149. package/dist/react/core/ColorPickerPanel.js +293 -0
  150. package/dist/react/core/ColorPickerPanel.js.map +1 -0
  151. package/dist/react/core/CommandBuilder.d.ts +74 -0
  152. package/dist/react/core/CommandBuilder.js +518 -0
  153. package/dist/react/core/CommandBuilder.js.map +1 -0
  154. package/dist/react/core/ConfirmDialog.d.ts +45 -0
  155. package/dist/react/core/ConfirmDialog.js +315 -0
  156. package/dist/react/core/ConfirmDialog.js.map +1 -0
  157. package/dist/react/core/ConnectionForm.d.ts +57 -0
  158. package/dist/react/core/ConnectionForm.js +496 -0
  159. package/dist/react/core/ConnectionForm.js.map +1 -0
  160. package/dist/react/core/Container.d.ts +51 -0
  161. package/dist/react/core/Container.js +670 -0
  162. package/dist/react/core/Container.js.map +1 -0
  163. package/dist/react/core/CopyButton.d.ts +39 -0
  164. package/dist/react/core/CopyButton.js +105 -0
  165. package/dist/react/core/CopyButton.js.map +1 -0
  166. package/dist/react/core/DataTable.d.ts +113 -0
  167. package/dist/react/core/DataTable.js +446 -0
  168. package/dist/react/core/DataTable.js.map +1 -0
  169. package/dist/react/core/DataValue.d.ts +64 -0
  170. package/dist/react/core/DataValue.js +545 -0
  171. package/dist/react/core/DataValue.js.map +1 -0
  172. package/dist/react/core/Dialog.d.ts +32 -0
  173. package/dist/react/core/Dialog.js +201 -0
  174. package/dist/react/core/Dialog.js.map +1 -0
  175. package/dist/react/core/FileExplorer.d.ts +65 -0
  176. package/dist/react/core/FileExplorer.js +520 -0
  177. package/dist/react/core/FileExplorer.js.map +1 -0
  178. package/dist/react/core/GlassCard.d.ts +129 -0
  179. package/dist/react/core/GlassCard.js +375 -0
  180. package/dist/react/core/GlassCard.js.map +1 -0
  181. package/dist/react/core/HeaderIconWithStatus.d.ts +39 -0
  182. package/dist/react/core/HeaderIconWithStatus.js +157 -0
  183. package/dist/react/core/HeaderIconWithStatus.js.map +1 -0
  184. package/dist/react/core/HexViewer.d.ts +143 -0
  185. package/dist/react/core/HexViewer.js +1106 -0
  186. package/dist/react/core/HexViewer.js.map +1 -0
  187. package/dist/react/core/Icon.d.ts +32 -0
  188. package/dist/react/core/Icon.js +142 -0
  189. package/dist/react/core/Icon.js.map +1 -0
  190. package/dist/react/core/ImageGallery.d.ts +41 -0
  191. package/dist/react/core/ImageGallery.js +320 -0
  192. package/dist/react/core/ImageGallery.js.map +1 -0
  193. package/dist/react/core/Input.d.ts +38 -0
  194. package/dist/react/core/Input.js +288 -0
  195. package/dist/react/core/Input.js.map +1 -0
  196. package/dist/react/core/LimitsBar.d.ts +51 -0
  197. package/dist/react/core/LimitsBar.js +200 -0
  198. package/dist/react/core/LimitsBar.js.map +1 -0
  199. package/dist/react/core/LogViewer.d.ts +61 -0
  200. package/dist/react/core/LogViewer.js +599 -0
  201. package/dist/react/core/LogViewer.js.map +1 -0
  202. package/dist/react/core/MessageStream.d.ts +58 -0
  203. package/dist/react/core/MessageStream.js +455 -0
  204. package/dist/react/core/MessageStream.js.map +1 -0
  205. package/dist/react/core/MissionCalendar.d.ts +81 -0
  206. package/dist/react/core/MissionCalendar.js +1049 -0
  207. package/dist/react/core/MissionCalendar.js.map +1 -0
  208. package/dist/react/core/NumberInput.d.ts +85 -0
  209. package/dist/react/core/NumberInput.js +507 -0
  210. package/dist/react/core/NumberInput.js.map +1 -0
  211. package/dist/react/core/PacketViewer.d.ts +73 -0
  212. package/dist/react/core/PacketViewer.js +431 -0
  213. package/dist/react/core/PacketViewer.js.map +1 -0
  214. package/dist/react/core/Pagination.d.ts +30 -0
  215. package/dist/react/core/Pagination.js +190 -0
  216. package/dist/react/core/Pagination.js.map +1 -0
  217. package/dist/react/core/PinInput.d.ts +41 -0
  218. package/dist/react/core/PinInput.js +210 -0
  219. package/dist/react/core/PinInput.js.map +1 -0
  220. package/dist/react/core/Popover.d.ts +55 -0
  221. package/dist/react/core/Popover.js +288 -0
  222. package/dist/react/core/Popover.js.map +1 -0
  223. package/dist/react/core/Select.d.ts +42 -0
  224. package/dist/react/core/Select.js +303 -0
  225. package/dist/react/core/Select.js.map +1 -0
  226. package/dist/react/core/SideNav.d.ts +103 -0
  227. package/dist/react/core/SideNav.js +551 -0
  228. package/dist/react/core/SideNav.js.map +1 -0
  229. package/dist/react/core/SidePanel.d.ts +33 -0
  230. package/dist/react/core/SidePanel.js +199 -0
  231. package/dist/react/core/SidePanel.js.map +1 -0
  232. package/dist/react/core/Tabs.d.ts +47 -0
  233. package/dist/react/core/Tabs.js +129 -0
  234. package/dist/react/core/Tabs.js.map +1 -0
  235. package/dist/react/core/Toast.d.ts +56 -0
  236. package/dist/react/core/Toast.js +229 -0
  237. package/dist/react/core/Toast.js.map +1 -0
  238. package/dist/react/core/Toggle.d.ts +22 -0
  239. package/dist/react/core/Toggle.js +151 -0
  240. package/dist/react/core/Toggle.js.map +1 -0
  241. package/dist/react/core/Tooltip.d.ts +19 -0
  242. package/dist/react/core/Tooltip.js +179 -0
  243. package/dist/react/core/Tooltip.js.map +1 -0
  244. package/dist/react/core/Typography.d.ts +127 -0
  245. package/dist/react/core/Typography.js +187 -0
  246. package/dist/react/core/Typography.js.map +1 -0
  247. package/dist/react/core/index.d.ts +108 -0
  248. package/dist/react/core/layout/Box.d.ts +77 -0
  249. package/dist/react/core/layout/Box.js +126 -0
  250. package/dist/react/core/layout/Box.js.map +1 -0
  251. package/dist/react/core/layout/Center.d.ts +20 -0
  252. package/dist/react/core/layout/Center.js +34 -0
  253. package/dist/react/core/layout/Center.js.map +1 -0
  254. package/dist/react/core/layout/Divider.d.ts +16 -0
  255. package/dist/react/core/layout/Divider.js +108 -0
  256. package/dist/react/core/layout/Divider.js.map +1 -0
  257. package/dist/react/core/layout/Flex.d.ts +30 -0
  258. package/dist/react/core/layout/Flex.js +128 -0
  259. package/dist/react/core/layout/Flex.js.map +1 -0
  260. package/dist/react/core/layout/Grid.d.ts +36 -0
  261. package/dist/react/core/layout/Grid.js +142 -0
  262. package/dist/react/core/layout/Grid.js.map +1 -0
  263. package/dist/react/core/layout/Spacer.d.ts +8 -0
  264. package/dist/react/core/layout/Spacer.js +31 -0
  265. package/dist/react/core/layout/Spacer.js.map +1 -0
  266. package/dist/react/core/layout/Stack.d.ts +54 -0
  267. package/dist/react/core/layout/Stack.js +74 -0
  268. package/dist/react/core/layout/Stack.js.map +1 -0
  269. package/dist/react/core/layout/index.d.ts +38 -0
  270. package/dist/react/core/layout/responsive.d.ts +23 -0
  271. package/dist/react/core/layout/responsive.js +26 -0
  272. package/dist/react/core/layout/responsive.js.map +1 -0
  273. package/dist/react/core/layout/useBreakpoint.d.ts +77 -0
  274. package/dist/react/core/layout/useBreakpoint.js +73 -0
  275. package/dist/react/core/layout/useBreakpoint.js.map +1 -0
  276. package/dist/react/core/propertyConfig.d.ts +443 -0
  277. package/dist/react/core/propertyConfig.js +399 -0
  278. package/dist/react/core/propertyConfig.js.map +1 -0
  279. package/dist/react/hooks/index.d.ts +21 -0
  280. package/dist/react/hooks/useAccessWindows.d.ts +66 -0
  281. package/dist/react/hooks/useCompactMode.d.ts +82 -0
  282. package/dist/react/hooks/useCompactMode.js +62 -0
  283. package/dist/react/hooks/useCompactMode.js.map +1 -0
  284. package/dist/react/hooks/useLiveSelection.d.ts +57 -0
  285. package/dist/react/hooks/useSimulationPlayback.d.ts +97 -0
  286. package/dist/react/hooks/useSimulationTime.d.ts +61 -0
  287. package/dist/react/hooks/useSpacecraftPosition.d.ts +50 -0
  288. package/dist/react/hooks/useSpacecraftPosition.js +89 -0
  289. package/dist/react/hooks/useSpacecraftPosition.js.map +1 -0
  290. package/dist/react/hooks/useTelemetry.d.ts +55 -0
  291. package/dist/react/hooks/useTelemetry.js +73 -0
  292. package/dist/react/hooks/useTelemetry.js.map +1 -0
  293. package/dist/react/hooks/useZendirSession.d.ts +109 -0
  294. package/dist/react/hooks/useZendirSession.js +148 -0
  295. package/dist/react/hooks/useZendirSession.js.map +1 -0
  296. package/dist/react/index.d.ts +74 -0
  297. package/dist/react/shared/ErrorBoundary.d.ts +63 -0
  298. package/dist/react/shared/ErrorBoundary.js +142 -0
  299. package/dist/react/shared/ErrorBoundary.js.map +1 -0
  300. package/dist/react/shared/Skeleton.d.ts +110 -0
  301. package/dist/react/shared/Skeleton.js +324 -0
  302. package/dist/react/shared/Skeleton.js.map +1 -0
  303. package/dist/react/shared/index.d.ts +12 -0
  304. package/dist/react/theme/ThemeProvider.d.ts +385 -0
  305. package/dist/react/theme/ThemeProvider.js +1096 -0
  306. package/dist/react/theme/ThemeProvider.js.map +1 -0
  307. package/dist/react/theme/astro-tokens.d.ts +153 -0
  308. package/dist/react/theme/cardAccent.d.ts +75 -0
  309. package/dist/react/theme/cardAccent.js +137 -0
  310. package/dist/react/theme/cardAccent.js.map +1 -0
  311. package/dist/react/theme/config.d.ts +39 -0
  312. package/dist/react/theme/index.d.ts +9 -0
  313. package/dist/react/types.d.ts +360 -0
  314. package/dist/react/types.js +58 -0
  315. package/dist/react/types.js.map +1 -0
  316. package/dist/react/utils/index.d.ts +247 -0
  317. package/dist/react/utils/index.js +423 -0
  318. package/dist/react/utils/index.js.map +1 -0
  319. package/dist/react/visualizations/EclipseTimerCard.d.ts +17 -0
  320. package/dist/react/visualizations/EclipseTimerCard.js +250 -0
  321. package/dist/react/visualizations/EclipseTimerCard.js.map +1 -0
  322. package/dist/react/visualizations/LinkBudgetCard.d.ts +50 -0
  323. package/dist/react/visualizations/LinkBudgetCard.js +444 -0
  324. package/dist/react/visualizations/LinkBudgetCard.js.map +1 -0
  325. package/dist/react/visualizations/NavBallCard.d.ts +17 -0
  326. package/dist/react/visualizations/NavBallCard.js +243 -0
  327. package/dist/react/visualizations/NavBallCard.js.map +1 -0
  328. package/dist/react/visualizations/PropulsionCard.d.ts +37 -0
  329. package/dist/react/visualizations/PropulsionCard.js +298 -0
  330. package/dist/react/visualizations/PropulsionCard.js.map +1 -0
  331. package/dist/react/visualizations/SensorFootprintCard.d.ts +33 -0
  332. package/dist/react/visualizations/SensorFootprintCard.js +326 -0
  333. package/dist/react/visualizations/SensorFootprintCard.js.map +1 -0
  334. package/dist/react/visualizations/ThermalHeatmapCard.d.ts +38 -0
  335. package/dist/react/visualizations/ThermalHeatmapCard.js +372 -0
  336. package/dist/react/visualizations/ThermalHeatmapCard.js.map +1 -0
  337. package/dist/react/visualizations/index.d.ts +17 -0
  338. package/dist/react.d.ts +1 -0
  339. package/dist/react.js +421 -0
  340. package/dist/react.js.map +1 -0
  341. package/dist/shaders/atmosphere.frag.js +5 -0
  342. package/dist/shaders/atmosphere.frag.js.map +1 -0
  343. package/dist/shaders/atmosphere.vert.js +5 -0
  344. package/dist/shaders/atmosphere.vert.js.map +1 -0
  345. package/dist/shaders/stars.frag.js +5 -0
  346. package/dist/shaders/stars.frag.js.map +1 -0
  347. package/dist/shaders/stars.vert.js +5 -0
  348. package/dist/shaders/stars.vert.js.map +1 -0
  349. package/dist/style.css +143 -0
  350. package/dist/tokens/index.d.ts +296 -0
  351. package/dist/tokens/index.js +263 -0
  352. package/dist/tokens/index.js.map +1 -0
  353. package/dist/tokens/tokens.css +155 -0
  354. package/dist/types/index.d.ts +23 -0
  355. package/dist/types.d.ts +1 -0
  356. package/dist/types.js +2 -0
  357. package/dist/types.js.map +1 -0
  358. package/package.json +220 -0
  359. package/sdk-stub.js +22 -0
@@ -0,0 +1,247 @@
1
+ /**
2
+ * @zendir/ui - Enterprise Utility Functions
3
+ *
4
+ * Shared utilities for null-safety, formatting, and defensive coding.
5
+ * These utilities ensure components never crash due to undefined data.
6
+ */
7
+ /**
8
+ * Safely access a value with a fallback for null/undefined
9
+ * @example withNullSafety(data?.temperature, 0) // Returns 0 if undefined
10
+ */
11
+ export declare function withNullSafety<T>(value: T | null | undefined, fallback: T): T;
12
+ /**
13
+ * Safely format a number, returning '--' if undefined
14
+ * @example safeNumber(data?.value, 2) // "123.45" or "--"
15
+ */
16
+ export declare function safeNumber(value: number | null | undefined, decimals?: number, fallback?: string): string;
17
+ /**
18
+ * Check if value is a valid finite number
19
+ */
20
+ export declare function isValidNumber(value: unknown): value is number;
21
+ export interface FormatNumberOptions {
22
+ decimals?: number;
23
+ locale?: string;
24
+ notation?: 'standard' | 'scientific' | 'engineering' | 'compact';
25
+ unit?: string;
26
+ signDisplay?: 'auto' | 'never' | 'always' | 'exceptZero';
27
+ }
28
+ /**
29
+ * Format a number with locale-aware formatting and optional unit
30
+ * @example formatNumber(1234567, { notation: 'compact' }) // "1.2M"
31
+ */
32
+ export declare function formatNumber(value: number | null | undefined, options?: FormatNumberOptions): string;
33
+ /**
34
+ * Format a number with tabular (monospace) digits for alignment
35
+ * Uses font-feature-settings: 'tnum' 1
36
+ */
37
+ export declare function formatTabular(value: number | null | undefined, decimals?: number): string;
38
+ /**
39
+ * Format temperature with unit conversion
40
+ * @example formatTemperature(25) // "25.0°C"
41
+ * @example formatTemperature(25, 'fahrenheit') // "77.0°F"
42
+ */
43
+ export declare function formatTemperature(celsius: number | null | undefined, unit?: 'celsius' | 'fahrenheit' | 'kelvin', decimals?: number): string;
44
+ /**
45
+ * Format data rate with automatic unit scaling
46
+ * @example formatDataRate(1500000) // "1.50 Mbps"
47
+ */
48
+ export declare function formatDataRate(bitsPerSecond: number | null | undefined): string;
49
+ /**
50
+ * Format distance with automatic unit scaling
51
+ * @example formatDistance(1500) // "1.50 km"
52
+ */
53
+ export declare function formatDistance(meters: number | null | undefined): string;
54
+ /**
55
+ * Format altitude (always in km for space ops)
56
+ * @example formatAltitude(418.2) // "418.2 km"
57
+ */
58
+ export declare function formatAltitude(km: number | null | undefined): string;
59
+ /**
60
+ * Format velocity
61
+ * @example formatVelocity(7.66) // "7.66 km/s"
62
+ */
63
+ export declare function formatVelocity(kmPerSec: number | null | undefined): string;
64
+ /**
65
+ * Format percentage with bounds checking
66
+ * @example formatPercentage(0.856) // "85.6%"
67
+ * @example formatPercentage(85.6, false) // "85.6%" (already percentage)
68
+ */
69
+ export declare function formatPercentage(value: number | null | undefined, isDecimal?: boolean, decimals?: number): string;
70
+ /**
71
+ * Format power (watts) with auto-scaling
72
+ * @example formatPower(1500) // "1.50 kW"
73
+ */
74
+ export declare function formatPower(watts: number | null | undefined): string;
75
+ /**
76
+ * Format frequency (Hz) with auto-scaling
77
+ * @example formatFrequency(2400000000) // "2.40 GHz"
78
+ */
79
+ export declare function formatFrequency(hz: number | null | undefined): string;
80
+ /**
81
+ * Format duration in human-readable form
82
+ * @example formatDuration(3661) // "1h 1m 1s"
83
+ */
84
+ export declare function formatDuration(seconds: number | null | undefined): string;
85
+ /**
86
+ * Format countdown timer (supports negative values for past events)
87
+ * @example formatCountdown(125) // "T-02:05"
88
+ * @example formatCountdown(-60) // "T+01:00"
89
+ */
90
+ export declare function formatCountdown(seconds: number | null | undefined): string;
91
+ /**
92
+ * Format UTC timestamp
93
+ * @example formatUTC(new Date()) // "2026-01-27 14:30:00Z"
94
+ */
95
+ export declare function formatUTC(date: Date | string | null | undefined): string;
96
+ /**
97
+ * Format time only (HH:MM:SS)
98
+ * @example formatTime(new Date()) // "14:30:00"
99
+ */
100
+ export declare function formatTime(date: Date | string | null | undefined, includeSeconds?: boolean): string;
101
+ /**
102
+ * Format latitude/longitude
103
+ * @example formatCoordinate(32.4, 'lat') // "32.40° N"
104
+ * @example formatCoordinate(-117.2, 'lon') // "117.20° W"
105
+ */
106
+ export declare function formatCoordinate(value: number | null | undefined, type: 'lat' | 'lon'): string;
107
+ /**
108
+ * Format lat/lon pair
109
+ * @example formatLatLon(32.4, -117.2) // "32.40° N, 117.20° W"
110
+ */
111
+ export declare function formatLatLon(lat: number | null | undefined, lon: number | null | undefined): string;
112
+ /**
113
+ * Format angle in degrees
114
+ * @example formatDegrees(45.5) // "45.5°"
115
+ */
116
+ export declare function formatDegrees(value: number | null | undefined, decimals?: number): string;
117
+ /**
118
+ * Format decibels
119
+ * @example formatDecibels(3.5) // "3.5 dB"
120
+ */
121
+ export declare function formatDecibels(value: number | null | undefined, decimals?: number): string;
122
+ /**
123
+ * Clamp a value between min and max
124
+ * @example clamp(150, 0, 100) // 100
125
+ */
126
+ export declare function clamp(value: number, min: number, max: number): number;
127
+ /**
128
+ * Linear interpolation
129
+ * @example lerp(0, 100, 0.5) // 50
130
+ */
131
+ export declare function lerp(start: number, end: number, t: number): number;
132
+ /**
133
+ * Map a value from one range to another
134
+ * @example mapRange(50, 0, 100, 0, 1) // 0.5
135
+ */
136
+ export declare function mapRange(value: number, inMin: number, inMax: number, outMin: number, outMax: number): number;
137
+ export type StatusLevel = 'off' | 'standby' | 'normal' | 'caution' | 'serious' | 'critical';
138
+ /**
139
+ * Astro UX Design System status colors
140
+ * These match the official Astro status semantics
141
+ */
142
+ export declare const STATUS_COLORS: Record<StatusLevel, string>;
143
+ /**
144
+ * Get status color from level
145
+ * @example getStatusColor('normal') // '#56f000'
146
+ */
147
+ export declare function getStatusColor(status: StatusLevel | null | undefined): string;
148
+ /**
149
+ * Derive status for battery specifically (low is bad)
150
+ * @example deriveBatteryStatus(25) // 'caution'
151
+ */
152
+ export declare function deriveBatteryStatus(level: number | undefined | null): StatusLevel;
153
+ /**
154
+ * Determine status level from a value and thresholds
155
+ * @example getStatusFromValue(85, { critical: 20, serious: 40, caution: 60, normal: 80 }) // 'normal'
156
+ */
157
+ export declare function getStatusFromValue(value: number | null | undefined, thresholds: {
158
+ critical?: number;
159
+ serious?: number;
160
+ caution?: number;
161
+ normal?: number;
162
+ }, higherIsBetter?: boolean): StatusLevel;
163
+ /**
164
+ * Normalize any status string to the 6-level StatusLevel system
165
+ *
166
+ * @param status - Any status string from domain/backend
167
+ * @param defaultStatus - Fallback if status is not recognized (default: 'off')
168
+ * @returns StatusLevel
169
+ *
170
+ * @example
171
+ * ```typescript
172
+ * normalizeStatus('degraded') // 'caution'
173
+ * normalizeStatus('nominal') // 'normal'
174
+ * normalizeStatus('transmitting') // 'normal'
175
+ * normalizeStatus('warning') // 'caution'
176
+ * normalizeStatus('error') // 'critical'
177
+ * normalizeStatus(undefined) // 'off'
178
+ * ```
179
+ */
180
+ export declare function normalizeStatus(status: string | undefined | null, defaultStatus?: StatusLevel): StatusLevel;
181
+ /**
182
+ * Check if a string is a valid StatusLevel
183
+ */
184
+ export declare function isStatusLevel(value: string): value is StatusLevel;
185
+ /**
186
+ * Get the severity order of a status (higher = more severe)
187
+ * Useful for sorting or finding worst status
188
+ */
189
+ export declare function getStatusSeverity(status: StatusLevel): number;
190
+ /**
191
+ * Get the worst (most severe) status from an array
192
+ *
193
+ * @example
194
+ * ```typescript
195
+ * getWorstStatus(['normal', 'caution', 'normal']) // 'caution'
196
+ * getWorstStatus(['normal', 'critical', 'caution']) // 'critical'
197
+ * ```
198
+ */
199
+ export declare function getWorstStatus(statuses: StatusLevel[]): StatusLevel;
200
+ /**
201
+ * Safely add alpha to any CSS color string.
202
+ * Handles hex (#RRGGBB → #RRGGBBAA), rgb(), and rgba() formats.
203
+ *
204
+ * Avoids the common bug of appending a hex alpha string to an rgba() color,
205
+ * which produces invalid CSS (e.g. "rgba(15, 20, 35, 0.85)80").
206
+ *
207
+ * @param color - CSS color string (hex, rgb, or rgba)
208
+ * @param alpha - Alpha value 0–1
209
+ * @returns Valid CSS color string with alpha applied
210
+ *
211
+ * @example
212
+ * addAlpha('#1b2d3e', 0.5) // '#1b2d3e80'
213
+ * addAlpha('rgba(15, 20, 35, 0.85)', 0.5) // 'rgba(15, 20, 35, 0.5)'
214
+ * addAlpha('rgb(15, 20, 35)', 0.031) // 'rgba(15, 20, 35, 0.031)'
215
+ */
216
+ export declare function addAlpha(color: string, alpha: number): string;
217
+ /**
218
+ * Merge class names, filtering out falsy values
219
+ * @example classNames('base', isActive && 'active', className) // "base active custom"
220
+ */
221
+ export declare function classNames(...classes: (string | boolean | undefined | null)[]): string;
222
+ /**
223
+ * Generate CSS for tabular numbers (monospace digits)
224
+ */
225
+ export declare const tabularNumsStyle: React.CSSProperties;
226
+ /**
227
+ * CSS transition presets
228
+ */
229
+ export declare const transitions: {
230
+ readonly fast: "all 150ms ease-out";
231
+ readonly normal: "all 250ms ease-out";
232
+ readonly slow: "all 400ms ease-out";
233
+ readonly spring: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)";
234
+ };
235
+ /**
236
+ * Focus ring styles for accessibility
237
+ */
238
+ export declare const focusRingStyle: React.CSSProperties;
239
+ /**
240
+ * Compute a WCAG AA safe version of an accent color for use as foreground text
241
+ * on dark backgrounds. If the accent already passes 4.5:1 contrast on typical
242
+ * dark surfaces (L ≈ 0.01), returns it unchanged. Otherwise lightens toward
243
+ * white until the minimum contrast is met.
244
+ *
245
+ * @example safeAccentText('#8b5cf6') // '#a885f8' — lightened to pass 4.5:1
246
+ */
247
+ export declare function safeAccentText(accent: string): string;
@@ -0,0 +1,423 @@
1
+ function withNullSafety(value, fallback) {
2
+ return value ?? fallback;
3
+ }
4
+ function safeNumber(value, decimals = 2, fallback = "--") {
5
+ if (value === null || value === void 0 || !Number.isFinite(value)) {
6
+ return fallback;
7
+ }
8
+ return value.toFixed(decimals);
9
+ }
10
+ function isValidNumber(value) {
11
+ return typeof value === "number" && Number.isFinite(value);
12
+ }
13
+ function formatNumber(value, options = {}) {
14
+ if (value === null || value === void 0 || !Number.isFinite(value)) {
15
+ return "--";
16
+ }
17
+ const {
18
+ decimals = 2,
19
+ locale = "en-US",
20
+ notation = "standard",
21
+ unit,
22
+ signDisplay = "auto"
23
+ } = options;
24
+ try {
25
+ const formatted = new Intl.NumberFormat(locale, {
26
+ notation,
27
+ minimumFractionDigits: notation === "compact" ? 0 : decimals,
28
+ maximumFractionDigits: decimals,
29
+ signDisplay
30
+ }).format(value);
31
+ return unit ? `${formatted} ${unit}` : formatted;
32
+ } catch {
33
+ return value.toFixed(decimals);
34
+ }
35
+ }
36
+ function formatTabular(value, decimals = 2) {
37
+ return safeNumber(value, decimals);
38
+ }
39
+ function formatTemperature(celsius, unit = "celsius", decimals = 1) {
40
+ if (celsius === null || celsius === void 0 || !Number.isFinite(celsius)) {
41
+ return "--°C";
42
+ }
43
+ switch (unit) {
44
+ case "fahrenheit":
45
+ return `${(celsius * 9 / 5 + 32).toFixed(decimals)}°F`;
46
+ case "kelvin":
47
+ return `${(celsius + 273.15).toFixed(decimals)}K`;
48
+ default:
49
+ return `${celsius.toFixed(decimals)}°C`;
50
+ }
51
+ }
52
+ function formatDataRate(bitsPerSecond) {
53
+ if (bitsPerSecond === null || bitsPerSecond === void 0 || !Number.isFinite(bitsPerSecond)) {
54
+ return "-- bps";
55
+ }
56
+ const units = ["bps", "Kbps", "Mbps", "Gbps", "Tbps"];
57
+ let unitIndex = 0;
58
+ let value = bitsPerSecond;
59
+ while (value >= 1e3 && unitIndex < units.length - 1) {
60
+ value /= 1e3;
61
+ unitIndex++;
62
+ }
63
+ return `${value.toFixed(2)} ${units[unitIndex]}`;
64
+ }
65
+ function formatDistance(meters) {
66
+ if (meters === null || meters === void 0 || !Number.isFinite(meters)) {
67
+ return "-- m";
68
+ }
69
+ if (meters >= 1e6) {
70
+ return `${(meters / 1e6).toFixed(2)} Mm`;
71
+ } else if (meters >= 1e3) {
72
+ return `${(meters / 1e3).toFixed(2)} km`;
73
+ } else if (meters < 1) {
74
+ return `${(meters * 100).toFixed(1)} cm`;
75
+ }
76
+ return `${meters.toFixed(1)} m`;
77
+ }
78
+ function formatAltitude(km) {
79
+ if (km === null || km === void 0 || !Number.isFinite(km)) {
80
+ return "-- km";
81
+ }
82
+ return `${km.toFixed(1)} km`;
83
+ }
84
+ function formatVelocity(kmPerSec) {
85
+ if (kmPerSec === null || kmPerSec === void 0 || !Number.isFinite(kmPerSec)) {
86
+ return "-- km/s";
87
+ }
88
+ return `${kmPerSec.toFixed(2)} km/s`;
89
+ }
90
+ function formatPercentage(value, isDecimal = false, decimals = 1) {
91
+ if (value === null || value === void 0 || !Number.isFinite(value)) {
92
+ return "--%";
93
+ }
94
+ const percentage = isDecimal ? value * 100 : value;
95
+ return `${percentage.toFixed(decimals)}%`;
96
+ }
97
+ function formatPower(watts) {
98
+ if (watts === null || watts === void 0 || !Number.isFinite(watts)) {
99
+ return "-- W";
100
+ }
101
+ if (Math.abs(watts) >= 1e6) {
102
+ return `${(watts / 1e6).toFixed(2)} MW`;
103
+ } else if (Math.abs(watts) >= 1e3) {
104
+ return `${(watts / 1e3).toFixed(2)} kW`;
105
+ } else if (Math.abs(watts) < 1) {
106
+ return `${(watts * 1e3).toFixed(1)} mW`;
107
+ }
108
+ return `${watts.toFixed(1)} W`;
109
+ }
110
+ function formatFrequency(hz) {
111
+ if (hz === null || hz === void 0 || !Number.isFinite(hz)) {
112
+ return "-- Hz";
113
+ }
114
+ if (hz >= 1e9) {
115
+ return `${(hz / 1e9).toFixed(2)} GHz`;
116
+ } else if (hz >= 1e6) {
117
+ return `${(hz / 1e6).toFixed(2)} MHz`;
118
+ } else if (hz >= 1e3) {
119
+ return `${(hz / 1e3).toFixed(2)} kHz`;
120
+ }
121
+ return `${hz.toFixed(0)} Hz`;
122
+ }
123
+ function formatDuration(seconds) {
124
+ if (seconds === null || seconds === void 0 || !Number.isFinite(seconds)) {
125
+ return "--:--";
126
+ }
127
+ const absSeconds = Math.abs(seconds);
128
+ const sign = seconds < 0 ? "-" : "";
129
+ if (absSeconds < 60) {
130
+ return `${sign}${absSeconds.toFixed(0)}s`;
131
+ } else if (absSeconds < 3600) {
132
+ const mins = Math.floor(absSeconds / 60);
133
+ const secs = Math.floor(absSeconds % 60);
134
+ return `${sign}${mins}m ${secs}s`;
135
+ } else if (absSeconds < 86400) {
136
+ const hours = Math.floor(absSeconds / 3600);
137
+ const mins = Math.floor(absSeconds % 3600 / 60);
138
+ return `${sign}${hours}h ${mins}m`;
139
+ } else {
140
+ const days = Math.floor(absSeconds / 86400);
141
+ const hours = Math.floor(absSeconds % 86400 / 3600);
142
+ return `${sign}${days}d ${hours}h`;
143
+ }
144
+ }
145
+ function formatCountdown(seconds) {
146
+ if (seconds === null || seconds === void 0 || !Number.isFinite(seconds)) {
147
+ return "T--:--";
148
+ }
149
+ const prefix = seconds >= 0 ? "T-" : "T+";
150
+ const absSeconds = Math.abs(seconds);
151
+ if (absSeconds >= 3600) {
152
+ const hours = Math.floor(absSeconds / 3600);
153
+ const mins2 = Math.floor(absSeconds % 3600 / 60);
154
+ const secs2 = Math.floor(absSeconds % 60);
155
+ return `${prefix}${hours}:${mins2.toString().padStart(2, "0")}:${secs2.toString().padStart(2, "0")}`;
156
+ }
157
+ const mins = Math.floor(absSeconds / 60);
158
+ const secs = Math.floor(absSeconds % 60);
159
+ return `${prefix}${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
160
+ }
161
+ function formatUTC(date) {
162
+ if (!date) return "--:--:-- UTC";
163
+ try {
164
+ const d = typeof date === "string" ? new Date(date) : date;
165
+ if (isNaN(d.getTime())) return "--:--:-- UTC";
166
+ return d.toISOString().replace("T", " ").slice(0, 19) + "Z";
167
+ } catch {
168
+ return "--:--:-- UTC";
169
+ }
170
+ }
171
+ function formatTime(date, includeSeconds = true) {
172
+ if (!date) return includeSeconds ? "--:--:--" : "--:--";
173
+ try {
174
+ const d = typeof date === "string" ? new Date(date) : date;
175
+ if (isNaN(d.getTime())) return includeSeconds ? "--:--:--" : "--:--";
176
+ const hours = d.getUTCHours().toString().padStart(2, "0");
177
+ const mins = d.getUTCMinutes().toString().padStart(2, "0");
178
+ const secs = d.getUTCSeconds().toString().padStart(2, "0");
179
+ return includeSeconds ? `${hours}:${mins}:${secs}` : `${hours}:${mins}`;
180
+ } catch {
181
+ return includeSeconds ? "--:--:--" : "--:--";
182
+ }
183
+ }
184
+ function formatCoordinate(value, type) {
185
+ if (value === null || value === void 0 || !Number.isFinite(value)) {
186
+ return "--°";
187
+ }
188
+ const absValue = Math.abs(value);
189
+ let direction;
190
+ if (type === "lat") {
191
+ direction = value >= 0 ? "N" : "S";
192
+ } else {
193
+ direction = value >= 0 ? "E" : "W";
194
+ }
195
+ return `${absValue.toFixed(2)}° ${direction}`;
196
+ }
197
+ function formatLatLon(lat, lon) {
198
+ return `${formatCoordinate(lat, "lat")}, ${formatCoordinate(lon, "lon")}`;
199
+ }
200
+ function formatDegrees(value, decimals = 1) {
201
+ if (value === null || value === void 0 || !Number.isFinite(value)) {
202
+ return "--°";
203
+ }
204
+ return `${value.toFixed(decimals)}°`;
205
+ }
206
+ function formatDecibels(value, decimals = 1) {
207
+ if (value === null || value === void 0 || !Number.isFinite(value)) {
208
+ return "-- dB";
209
+ }
210
+ return `${value.toFixed(decimals)} dB`;
211
+ }
212
+ function clamp(value, min, max) {
213
+ return Math.min(Math.max(value, min), max);
214
+ }
215
+ function lerp(start, end, t) {
216
+ return start + (end - start) * clamp(t, 0, 1);
217
+ }
218
+ function mapRange(value, inMin, inMax, outMin, outMax) {
219
+ const t = (value - inMin) / (inMax - inMin);
220
+ return lerp(outMin, outMax, t);
221
+ }
222
+ const STATUS_COLORS = {
223
+ off: "#a4abb6",
224
+ standby: "#2dccff",
225
+ normal: "#56f000",
226
+ caution: "#fce83a",
227
+ serious: "#ffb302",
228
+ critical: "#ff3838"
229
+ };
230
+ function getStatusColor(status) {
231
+ return STATUS_COLORS[status ?? "off"];
232
+ }
233
+ function deriveBatteryStatus(level) {
234
+ if (level === void 0 || level === null) return "off";
235
+ if (level <= 10) return "critical";
236
+ if (level <= 20) return "serious";
237
+ if (level <= 30) return "caution";
238
+ return "normal";
239
+ }
240
+ function getStatusFromValue(value, thresholds, higherIsBetter = true) {
241
+ if (value === null || value === void 0 || !Number.isFinite(value)) {
242
+ return "off";
243
+ }
244
+ const { critical = 10, serious = 25, caution = 50, normal = 75 } = thresholds;
245
+ if (higherIsBetter) {
246
+ if (value <= critical) return "critical";
247
+ if (value <= serious) return "serious";
248
+ if (value <= caution) return "caution";
249
+ if (value <= normal) return "standby";
250
+ return "normal";
251
+ } else {
252
+ if (value >= critical) return "critical";
253
+ if (value >= serious) return "serious";
254
+ if (value >= caution) return "caution";
255
+ if (value >= normal) return "standby";
256
+ return "normal";
257
+ }
258
+ }
259
+ const STATUS_MAPPING = {
260
+ // → 'off'
261
+ "off": "off",
262
+ "disabled": "off",
263
+ "inactive": "off",
264
+ "offline": "off",
265
+ "unknown": "off",
266
+ "null": "off",
267
+ "none": "off",
268
+ // → 'standby'
269
+ "standby": "standby",
270
+ "idle": "standby",
271
+ "waiting": "standby",
272
+ "ready": "standby",
273
+ "pending": "standby",
274
+ "queued": "standby",
275
+ // → 'normal'
276
+ "normal": "normal",
277
+ "nominal": "normal",
278
+ "healthy": "normal",
279
+ "ok": "normal",
280
+ "good": "normal",
281
+ "success": "normal",
282
+ "operational": "normal",
283
+ "active": "normal",
284
+ "online": "normal",
285
+ "connected": "normal",
286
+ "stable": "normal",
287
+ "transmitting": "normal",
288
+ "receiving": "normal",
289
+ // → 'caution'
290
+ "caution": "caution",
291
+ "warning": "caution",
292
+ "degraded": "caution",
293
+ "elevated": "caution",
294
+ "alert": "caution",
295
+ "attention": "caution",
296
+ "limited": "caution",
297
+ // → 'serious'
298
+ "serious": "serious",
299
+ "unstable": "serious",
300
+ "danger": "serious",
301
+ "severe": "serious",
302
+ // → 'critical'
303
+ "critical": "critical",
304
+ "error": "critical",
305
+ "failed": "critical",
306
+ "failure": "critical",
307
+ "emergency": "critical",
308
+ "fault": "critical",
309
+ "alarm": "critical"
310
+ };
311
+ function normalizeStatus(status, defaultStatus = "off") {
312
+ if (!status) return defaultStatus;
313
+ const normalized = status.toLowerCase().trim();
314
+ return STATUS_MAPPING[normalized] ?? defaultStatus;
315
+ }
316
+ function isStatusLevel(value) {
317
+ return ["off", "standby", "normal", "caution", "serious", "critical"].includes(value);
318
+ }
319
+ function getStatusSeverity(status) {
320
+ const order = {
321
+ off: 0,
322
+ standby: 1,
323
+ normal: 2,
324
+ caution: 3,
325
+ serious: 4,
326
+ critical: 5
327
+ };
328
+ return order[status];
329
+ }
330
+ function getWorstStatus(statuses) {
331
+ if (statuses.length === 0) return "off";
332
+ return statuses.reduce(
333
+ (worst, current) => getStatusSeverity(current) > getStatusSeverity(worst) ? current : worst
334
+ );
335
+ }
336
+ function addAlpha(color, alpha) {
337
+ if (!color) return color;
338
+ const a = Math.max(0, Math.min(1, alpha));
339
+ if (color.startsWith("rgba(")) {
340
+ return color.replace(/,\s*[\d.]+\)\s*$/, `, ${a})`);
341
+ }
342
+ if (color.startsWith("rgb(")) {
343
+ return color.replace(/^rgb\(/, "rgba(").replace(/\)\s*$/, `, ${a})`);
344
+ }
345
+ if (color.startsWith("#")) {
346
+ const hexA = Math.round(a * 255).toString(16).padStart(2, "0");
347
+ return `${color}${hexA}`;
348
+ }
349
+ return color;
350
+ }
351
+ function classNames(...classes) {
352
+ return classes.filter(Boolean).join(" ");
353
+ }
354
+ const tabularNumsStyle = {
355
+ fontVariantNumeric: "tabular-nums",
356
+ fontFeatureSettings: '"tnum" 1'
357
+ };
358
+ const transitions = {
359
+ fast: "all 150ms ease-out",
360
+ normal: "all 250ms ease-out",
361
+ slow: "all 400ms ease-out",
362
+ spring: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)"
363
+ };
364
+ const focusRingStyle = {
365
+ outline: "2px solid #4dc3ff",
366
+ outlineOffset: "2px"
367
+ };
368
+ function safeAccentText(accent) {
369
+ const hex = accent.replace("#", "");
370
+ if (hex.length < 6) return accent;
371
+ const r = parseInt(hex.slice(0, 2), 16) / 255;
372
+ const g = parseInt(hex.slice(2, 4), 16) / 255;
373
+ const b = parseInt(hex.slice(4, 6), 16) / 255;
374
+ const toLinear = (c) => c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
375
+ const L = 0.2126 * toLinear(r) + 0.7152 * toLinear(g) + 0.0722 * toLinear(b);
376
+ if (L >= 0.22) return accent;
377
+ const mix = 0.25;
378
+ const lr = Math.min(255, Math.round((r + (1 - r) * mix) * 255));
379
+ const lg = Math.min(255, Math.round((g + (1 - g) * mix) * 255));
380
+ const lb = Math.min(255, Math.round((b + (1 - b) * mix) * 255));
381
+ return `#${lr.toString(16).padStart(2, "0")}${lg.toString(16).padStart(2, "0")}${lb.toString(16).padStart(2, "0")}`;
382
+ }
383
+ export {
384
+ STATUS_COLORS,
385
+ addAlpha,
386
+ clamp,
387
+ classNames,
388
+ deriveBatteryStatus,
389
+ focusRingStyle,
390
+ formatAltitude,
391
+ formatCoordinate,
392
+ formatCountdown,
393
+ formatDataRate,
394
+ formatDecibels,
395
+ formatDegrees,
396
+ formatDistance,
397
+ formatDuration,
398
+ formatFrequency,
399
+ formatLatLon,
400
+ formatNumber,
401
+ formatPercentage,
402
+ formatPower,
403
+ formatTabular,
404
+ formatTemperature,
405
+ formatTime,
406
+ formatUTC,
407
+ formatVelocity,
408
+ getStatusColor,
409
+ getStatusFromValue,
410
+ getStatusSeverity,
411
+ getWorstStatus,
412
+ isStatusLevel,
413
+ isValidNumber,
414
+ lerp,
415
+ mapRange,
416
+ normalizeStatus,
417
+ safeAccentText,
418
+ safeNumber,
419
+ tabularNumsStyle,
420
+ transitions,
421
+ withNullSafety
422
+ };
423
+ //# sourceMappingURL=index.js.map