@zendir/ui 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/CHANGELOG.md +419 -386
  2. package/README.md +640 -631
  3. package/dist/_virtual/_rolldown/runtime.js +13 -0
  4. package/dist/index.js +17 -221
  5. package/dist/react/3d/CesiumCaptureSource.d.ts +0 -1
  6. package/dist/react/3d/CesiumCaptureSource.js +364 -283
  7. package/dist/react/3d/CesiumCaptureSource.js.map +1 -1
  8. package/dist/react/3d/ZenSpace3D.d.ts +2 -3
  9. package/dist/react/3d/ZenSpace3D.js +1681 -1237
  10. package/dist/react/3d/ZenSpace3D.js.map +1 -1
  11. package/dist/react/3d/ZenSpace3DCesium.d.ts +0 -1
  12. package/dist/react/3d/ZenSpace3DCesium.js +513 -560
  13. package/dist/react/3d/ZenSpace3DCesium.js.map +1 -1
  14. package/dist/react/3d/ZenSpace3DShaders.js +61 -66
  15. package/dist/react/3d/ZenSpace3DShaders.js.map +1 -1
  16. package/dist/react/3d/ZenSpace3DTypes.d.ts +19 -20
  17. package/dist/react/3d/ZenSpace3DUtils.d.ts +0 -1
  18. package/dist/react/3d/ZenSpace3DUtils.js +37 -24
  19. package/dist/react/3d/ZenSpace3DUtils.js.map +1 -1
  20. package/dist/react/3d/capturePngAnalysis.js +42 -36
  21. package/dist/react/3d/capturePngAnalysis.js.map +1 -1
  22. package/dist/react/3d/index.d.ts +3 -3
  23. package/dist/react/3d/index.js +5 -53
  24. package/dist/react/3d/threeLoader.d.ts +1 -1
  25. package/dist/react/3d/threeLoader.js +23 -18
  26. package/dist/react/3d/threeLoader.js.map +1 -1
  27. package/dist/react/astro/ClassificationBanner.d.ts +2 -3
  28. package/dist/react/astro/ClassificationBanner.js +95 -79
  29. package/dist/react/astro/ClassificationBanner.js.map +1 -1
  30. package/dist/react/astro/GlobalStatusBar.d.ts +0 -1
  31. package/dist/react/astro/GlobalStatusBar.js +157 -163
  32. package/dist/react/astro/GlobalStatusBar.js.map +1 -1
  33. package/dist/react/astro/MissionClock.d.ts +7 -8
  34. package/dist/react/astro/MissionClock.js +377 -400
  35. package/dist/react/astro/MissionClock.js.map +1 -1
  36. package/dist/react/astro/MonitoringIcon.d.ts +1 -2
  37. package/dist/react/astro/MonitoringIcon.js +422 -358
  38. package/dist/react/astro/MonitoringIcon.js.map +1 -1
  39. package/dist/react/astro/Notification.d.ts +1 -2
  40. package/dist/react/astro/Notification.js +229 -126
  41. package/dist/react/astro/Notification.js.map +1 -1
  42. package/dist/react/astro/Progress.d.ts +0 -1
  43. package/dist/react/astro/Progress.js +199 -141
  44. package/dist/react/astro/Progress.js.map +1 -1
  45. package/dist/react/astro/SimulationControls.d.ts +3 -4
  46. package/dist/react/astro/SimulationControls.js +596 -650
  47. package/dist/react/astro/SimulationControls.js.map +1 -1
  48. package/dist/react/astro/StatusIndicator.d.ts +0 -1
  49. package/dist/react/astro/StatusIndicator.js +236 -170
  50. package/dist/react/astro/StatusIndicator.js.map +1 -1
  51. package/dist/react/astro/UnifiedTimeline.d.ts +9 -10
  52. package/dist/react/astro/UnifiedTimeline.js +2345 -2392
  53. package/dist/react/astro/UnifiedTimeline.js.map +1 -1
  54. package/dist/react/astro/index.d.ts +5 -5
  55. package/dist/react/astro/index.js +1 -25
  56. package/dist/react/cards/AccessCard.d.ts +0 -1
  57. package/dist/react/cards/AccessCard.js +471 -405
  58. package/dist/react/cards/AccessCard.js.map +1 -1
  59. package/dist/react/cards/OrbitCard.d.ts +0 -1
  60. package/dist/react/cards/OrbitCard.js +487 -364
  61. package/dist/react/cards/OrbitCard.js.map +1 -1
  62. package/dist/react/cards/SpacecraftCard.d.ts +0 -1
  63. package/dist/react/cards/SpacecraftCard.js +813 -925
  64. package/dist/react/cards/SpacecraftCard.js.map +1 -1
  65. package/dist/react/cards/TelemetryCard.d.ts +0 -1
  66. package/dist/react/cards/TelemetryCard.js +1055 -732
  67. package/dist/react/cards/TelemetryCard.js.map +1 -1
  68. package/dist/react/cards/TelemetryStreamCard.d.ts +0 -1
  69. package/dist/react/cards/TelemetryStreamCard.js +323 -297
  70. package/dist/react/cards/TelemetryStreamCard.js.map +1 -1
  71. package/dist/react/cards/index.d.ts +1 -1
  72. package/dist/react/cards/index.js +1 -8
  73. package/dist/react/charts/GroundTrackMap.d.ts +6 -7
  74. package/dist/react/charts/GroundTrackMap.js +1377 -1256
  75. package/dist/react/charts/GroundTrackMap.js.map +1 -1
  76. package/dist/react/charts/GroundTrackMapLeaflet.d.ts +1 -2
  77. package/dist/react/charts/GroundTrackMapLeaflet.js +1065 -987
  78. package/dist/react/charts/GroundTrackMapLeaflet.js.map +1 -1
  79. package/dist/react/charts/groundTrackMapLeafletTiles.js +34 -25
  80. package/dist/react/charts/groundTrackMapLeafletTiles.js.map +1 -1
  81. package/dist/react/charts/groundTrackMapLeafletUtils.js +70 -61
  82. package/dist/react/charts/groundTrackMapLeafletUtils.js.map +1 -1
  83. package/dist/react/charts/index.d.ts +1 -1
  84. package/dist/react/charts/index.js +7 -100
  85. package/dist/react/charts/unified/AstroChart.d.ts +1 -2
  86. package/dist/react/charts/unified/AstroChart.js +1331 -1411
  87. package/dist/react/charts/unified/AstroChart.js.map +1 -1
  88. package/dist/react/charts/unified/PowerOverviewChart.d.ts +3 -3
  89. package/dist/react/charts/unified/PowerOverviewChart.js +495 -478
  90. package/dist/react/charts/unified/PowerOverviewChart.js.map +1 -1
  91. package/dist/react/charts/unified/domain.d.ts +12 -13
  92. package/dist/react/charts/unified/domain.js +3999 -3145
  93. package/dist/react/charts/unified/domain.js.map +1 -1
  94. package/dist/react/charts/unified/generators.d.ts +3 -4
  95. package/dist/react/charts/unified/generators.js +561 -498
  96. package/dist/react/charts/unified/generators.js.map +1 -1
  97. package/dist/react/charts/unified/index.d.ts +1 -1
  98. package/dist/react/charts/unified/presets.d.ts +14 -15
  99. package/dist/react/charts/unified/presets.js +857 -994
  100. package/dist/react/charts/unified/presets.js.map +1 -1
  101. package/dist/react/charts/unified/sync.d.ts +2 -3
  102. package/dist/react/charts/unified/sync.js +229 -195
  103. package/dist/react/charts/unified/sync.js.map +1 -1
  104. package/dist/react/charts/unified/theme.d.ts +11 -12
  105. package/dist/react/charts/unified/theme.js +606 -642
  106. package/dist/react/charts/unified/theme.js.map +1 -1
  107. package/dist/react/charts/unified/types.d.ts +32 -33
  108. package/dist/react/charts/unified/useChartStream.d.ts +1 -2
  109. package/dist/react/charts/unified/useChartStream.js +203 -216
  110. package/dist/react/charts/unified/useChartStream.js.map +1 -1
  111. package/dist/react/chatgpt/AppCard.d.ts +1 -2
  112. package/dist/react/chatgpt/index.d.ts +7 -7
  113. package/dist/react/chatgpt/index.js +160 -139
  114. package/dist/react/chatgpt/index.js.map +1 -1
  115. package/dist/react/context/CategoryContext.d.ts +0 -1
  116. package/dist/react/context/CategoryContext.js +78 -29
  117. package/dist/react/context/CategoryContext.js.map +1 -1
  118. package/dist/react/context/DisplaySettingsContext.d.ts +1 -2
  119. package/dist/react/context/DisplaySettingsContext.js +205 -156
  120. package/dist/react/context/DisplaySettingsContext.js.map +1 -1
  121. package/dist/react/context/SpatialSelectionContext.d.ts +0 -1
  122. package/dist/react/context/SpatialSelectionContext.js +36 -7
  123. package/dist/react/context/SpatialSelectionContext.js.map +1 -1
  124. package/dist/react/core/data/DataTable.d.ts +3 -4
  125. package/dist/react/core/data/DataTable.js +473 -440
  126. package/dist/react/core/data/DataTable.js.map +1 -1
  127. package/dist/react/core/data/DataValue.d.ts +4 -5
  128. package/dist/react/core/data/DataValue.js +605 -571
  129. package/dist/react/core/data/DataValue.js.map +1 -1
  130. package/dist/react/core/data/propertyConfig.d.ts +1 -2
  131. package/dist/react/core/data/propertyConfig.js +446 -382
  132. package/dist/react/core/data/propertyConfig.js.map +1 -1
  133. package/dist/react/core/display/AstroIcon.d.ts +4 -5
  134. package/dist/react/core/display/AstroIcon.js +339 -429
  135. package/dist/react/core/display/AstroIcon.js.map +1 -1
  136. package/dist/react/core/display/Badge.d.ts +2 -3
  137. package/dist/react/core/display/Badge.js +131 -131
  138. package/dist/react/core/display/Badge.js.map +1 -1
  139. package/dist/react/core/display/CardHeader.d.ts +0 -1
  140. package/dist/react/core/display/CardHeader.js +398 -311
  141. package/dist/react/core/display/CardHeader.js.map +1 -1
  142. package/dist/react/core/display/Container.d.ts +2 -3
  143. package/dist/react/core/display/Container.js +640 -668
  144. package/dist/react/core/display/Container.js.map +1 -1
  145. package/dist/react/core/display/CopyButton.d.ts +1 -2
  146. package/dist/react/core/display/CopyButton.js +158 -101
  147. package/dist/react/core/display/CopyButton.js.map +1 -1
  148. package/dist/react/core/display/GlassCard.d.ts +3 -4
  149. package/dist/react/core/display/GlassCard.js +416 -369
  150. package/dist/react/core/display/GlassCard.js.map +1 -1
  151. package/dist/react/core/display/HeaderIconWithStatus.d.ts +0 -1
  152. package/dist/react/core/display/HeaderIconWithStatus.js +152 -152
  153. package/dist/react/core/display/HeaderIconWithStatus.js.map +1 -1
  154. package/dist/react/core/display/Icon.d.ts +2 -3
  155. package/dist/react/core/display/Icon.js +172 -143
  156. package/dist/react/core/display/Icon.js.map +1 -1
  157. package/dist/react/core/display/Typography.d.ts +24 -25
  158. package/dist/react/core/display/Typography.js +360 -178
  159. package/dist/react/core/display/Typography.js.map +1 -1
  160. package/dist/react/core/feedback/ConfirmDialog.d.ts +1 -2
  161. package/dist/react/core/feedback/ConfirmDialog.js +343 -304
  162. package/dist/react/core/feedback/ConfirmDialog.js.map +1 -1
  163. package/dist/react/core/feedback/Dialog.d.ts +2 -3
  164. package/dist/react/core/feedback/Dialog.js +189 -197
  165. package/dist/react/core/feedback/Dialog.js.map +1 -1
  166. package/dist/react/core/feedback/Toast.d.ts +2 -3
  167. package/dist/react/core/feedback/Toast.js +346 -207
  168. package/dist/react/core/feedback/Toast.js.map +1 -1
  169. package/dist/react/core/index.d.ts +26 -26
  170. package/dist/react/core/index.js +7 -119
  171. package/dist/react/core/inputs/Button.d.ts +2 -3
  172. package/dist/react/core/inputs/Button.js +281 -304
  173. package/dist/react/core/inputs/Button.js.map +1 -1
  174. package/dist/react/core/inputs/Checkbox.d.ts +2 -3
  175. package/dist/react/core/inputs/Checkbox.js +139 -127
  176. package/dist/react/core/inputs/Checkbox.js.map +1 -1
  177. package/dist/react/core/inputs/Input.d.ts +3 -4
  178. package/dist/react/core/inputs/Input.js +277 -285
  179. package/dist/react/core/inputs/Input.js.map +1 -1
  180. package/dist/react/core/inputs/LimitsBar.d.ts +1 -2
  181. package/dist/react/core/inputs/LimitsBar.js +271 -196
  182. package/dist/react/core/inputs/LimitsBar.js.map +1 -1
  183. package/dist/react/core/inputs/NumberInput.d.ts +2 -3
  184. package/dist/react/core/inputs/NumberInput.js +531 -503
  185. package/dist/react/core/inputs/NumberInput.js.map +1 -1
  186. package/dist/react/core/inputs/PinInput.d.ts +2 -3
  187. package/dist/react/core/inputs/PinInput.js +224 -207
  188. package/dist/react/core/inputs/PinInput.js.map +1 -1
  189. package/dist/react/core/inputs/Select.d.ts +1 -2
  190. package/dist/react/core/inputs/Select.js +298 -299
  191. package/dist/react/core/inputs/Select.js.map +1 -1
  192. package/dist/react/core/inputs/Toggle.d.ts +2 -3
  193. package/dist/react/core/inputs/Toggle.js +142 -148
  194. package/dist/react/core/inputs/Toggle.js.map +1 -1
  195. package/dist/react/core/layout/Box.d.ts +3 -4
  196. package/dist/react/core/layout/Box.js +118 -122
  197. package/dist/react/core/layout/Box.js.map +1 -1
  198. package/dist/react/core/layout/Center.d.ts +0 -1
  199. package/dist/react/core/layout/Center.js +45 -32
  200. package/dist/react/core/layout/Center.js.map +1 -1
  201. package/dist/react/core/layout/Divider.d.ts +1 -2
  202. package/dist/react/core/layout/Divider.js +112 -106
  203. package/dist/react/core/layout/Divider.js.map +1 -1
  204. package/dist/react/core/layout/Flex.d.ts +4 -5
  205. package/dist/react/core/layout/Flex.js +120 -124
  206. package/dist/react/core/layout/Flex.js.map +1 -1
  207. package/dist/react/core/layout/Grid.d.ts +5 -6
  208. package/dist/react/core/layout/Grid.js +131 -138
  209. package/dist/react/core/layout/Grid.js.map +1 -1
  210. package/dist/react/core/layout/Spacer.d.ts +0 -1
  211. package/dist/react/core/layout/Spacer.js +36 -29
  212. package/dist/react/core/layout/Spacer.js.map +1 -1
  213. package/dist/react/core/layout/Stack.d.ts +4 -5
  214. package/dist/react/core/layout/Stack.js +127 -70
  215. package/dist/react/core/layout/Stack.js.map +1 -1
  216. package/dist/react/core/layout/responsive.d.ts +1 -2
  217. package/dist/react/core/layout/responsive.js +25 -19
  218. package/dist/react/core/layout/responsive.js.map +1 -1
  219. package/dist/react/core/layout/useBreakpoint.d.ts +1 -1
  220. package/dist/react/core/layout/useBreakpoint.js +119 -66
  221. package/dist/react/core/layout/useBreakpoint.js.map +1 -1
  222. package/dist/react/core/navigation/AppBar.d.ts +1 -2
  223. package/dist/react/core/navigation/AppBar.js +827 -805
  224. package/dist/react/core/navigation/AppBar.js.map +1 -1
  225. package/dist/react/core/navigation/Pagination.d.ts +2 -3
  226. package/dist/react/core/navigation/Pagination.js +207 -187
  227. package/dist/react/core/navigation/Pagination.js.map +1 -1
  228. package/dist/react/core/navigation/SideNav.d.ts +5 -6
  229. package/dist/react/core/navigation/SideNav.js +855 -629
  230. package/dist/react/core/navigation/SideNav.js.map +1 -1
  231. package/dist/react/core/navigation/Tabs.d.ts +0 -1
  232. package/dist/react/core/navigation/Tabs.js +113 -119
  233. package/dist/react/core/navigation/Tabs.js.map +1 -1
  234. package/dist/react/core/overlays/Popover.d.ts +2 -3
  235. package/dist/react/core/overlays/Popover.js +303 -282
  236. package/dist/react/core/overlays/Popover.js.map +1 -1
  237. package/dist/react/core/overlays/SidePanel.d.ts +1 -2
  238. package/dist/react/core/overlays/SidePanel.js +217 -212
  239. package/dist/react/core/overlays/SidePanel.js.map +1 -1
  240. package/dist/react/core/overlays/Tooltip.d.ts +1 -2
  241. package/dist/react/core/overlays/Tooltip.js +170 -176
  242. package/dist/react/core/overlays/Tooltip.js.map +1 -1
  243. package/dist/react/core/widgets/ActivityPlanner.d.ts +0 -1
  244. package/dist/react/core/widgets/ActivityPlanner.js +855 -517
  245. package/dist/react/core/widgets/ActivityPlanner.js.map +1 -1
  246. package/dist/react/core/widgets/Capture.d.ts +2 -3
  247. package/dist/react/core/widgets/Capture.js +965 -779
  248. package/dist/react/core/widgets/Capture.js.map +1 -1
  249. package/dist/react/core/widgets/ChatPanel.d.ts +16 -17
  250. package/dist/react/core/widgets/ChatPanel.js +1734 -1034
  251. package/dist/react/core/widgets/ChatPanel.js.map +1 -1
  252. package/dist/react/core/widgets/ColorPickerPanel.d.ts +0 -1
  253. package/dist/react/core/widgets/ColorPickerPanel.js +298 -287
  254. package/dist/react/core/widgets/ColorPickerPanel.js.map +1 -1
  255. package/dist/react/core/widgets/CommandBuilder.d.ts +2 -3
  256. package/dist/react/core/widgets/CommandBuilder.js +624 -516
  257. package/dist/react/core/widgets/CommandBuilder.js.map +1 -1
  258. package/dist/react/core/widgets/ConnectionForm.d.ts +2 -3
  259. package/dist/react/core/widgets/ConnectionForm.js +528 -492
  260. package/dist/react/core/widgets/ConnectionForm.js.map +1 -1
  261. package/dist/react/core/widgets/FileExplorer.d.ts +3 -4
  262. package/dist/react/core/widgets/FileExplorer.js +617 -505
  263. package/dist/react/core/widgets/FileExplorer.js.map +1 -1
  264. package/dist/react/core/widgets/HexViewer.d.ts +2 -3
  265. package/dist/react/core/widgets/HexViewer.js +1353 -1091
  266. package/dist/react/core/widgets/HexViewer.js.map +1 -1
  267. package/dist/react/core/widgets/ImageFrame.d.ts +1 -2
  268. package/dist/react/core/widgets/ImageFrame.js +230 -193
  269. package/dist/react/core/widgets/ImageFrame.js.map +1 -1
  270. package/dist/react/core/widgets/ImageGallery.d.ts +2 -1
  271. package/dist/react/core/widgets/ImageGallery.js +380 -314
  272. package/dist/react/core/widgets/ImageGallery.js.map +1 -1
  273. package/dist/react/core/widgets/ImagePanel.d.ts +0 -1
  274. package/dist/react/core/widgets/ImagePanel.js +110 -101
  275. package/dist/react/core/widgets/ImagePanel.js.map +1 -1
  276. package/dist/react/core/widgets/LogViewer.d.ts +2 -3
  277. package/dist/react/core/widgets/LogViewer.js +711 -607
  278. package/dist/react/core/widgets/LogViewer.js.map +1 -1
  279. package/dist/react/core/widgets/MessageStream.d.ts +3 -4
  280. package/dist/react/core/widgets/MessageStream.js +514 -444
  281. package/dist/react/core/widgets/MessageStream.js.map +1 -1
  282. package/dist/react/core/widgets/MissionCalendar.d.ts +3 -4
  283. package/dist/react/core/widgets/MissionCalendar.js +1488 -1020
  284. package/dist/react/core/widgets/MissionCalendar.js.map +1 -1
  285. package/dist/react/core/widgets/PacketViewer.d.ts +2 -3
  286. package/dist/react/core/widgets/PacketViewer.js +550 -421
  287. package/dist/react/core/widgets/PacketViewer.js.map +1 -1
  288. package/dist/react/core/widgets/capture-placeholder.png.js +6 -5
  289. package/dist/react/core/widgets/capture-placeholder.png.js.map +1 -1
  290. package/dist/react/hooks/index.d.ts +5 -5
  291. package/dist/react/hooks/useAccessWindows.d.ts +0 -1
  292. package/dist/react/hooks/useCompactMode.d.ts +1 -1
  293. package/dist/react/hooks/useCompactMode.js +104 -58
  294. package/dist/react/hooks/useCompactMode.js.map +1 -1
  295. package/dist/react/hooks/useGroundTrackHistory.d.ts +0 -1
  296. package/dist/react/hooks/useSimulationScene.d.ts +1 -2
  297. package/dist/react/hooks/useSimulationScene.js +481 -374
  298. package/dist/react/hooks/useSimulationScene.js.map +1 -1
  299. package/dist/react/index.d.ts +3 -3
  300. package/dist/react/panels/LayerControlPanel.d.ts +1 -2
  301. package/dist/react/panels/LayerControlPanel.js +223 -180
  302. package/dist/react/panels/LayerControlPanel.js.map +1 -1
  303. package/dist/react/panels/ObjectInventoryPanel.d.ts +2 -3
  304. package/dist/react/panels/ObjectInventoryPanel.js +315 -250
  305. package/dist/react/panels/ObjectInventoryPanel.js.map +1 -1
  306. package/dist/react/panels/index.d.ts +1 -1
  307. package/dist/react/panels/index.js +1 -6
  308. package/dist/react/shared/ErrorBoundary.d.ts +1 -2
  309. package/dist/react/shared/ErrorBoundary.js +170 -139
  310. package/dist/react/shared/ErrorBoundary.js.map +1 -1
  311. package/dist/react/shared/Skeleton.d.ts +1 -2
  312. package/dist/react/shared/Skeleton.js +300 -301
  313. package/dist/react/shared/Skeleton.js.map +1 -1
  314. package/dist/react/theme/ThemeProvider.d.ts +2 -321
  315. package/dist/react/theme/ThemeProvider.js +313 -939
  316. package/dist/react/theme/ThemeProvider.js.map +1 -1
  317. package/dist/react/theme/cardAccent.d.ts +1 -2
  318. package/dist/react/theme/cardAccent.js +196 -126
  319. package/dist/react/theme/cardAccent.js.map +1 -1
  320. package/dist/react/theme/config.d.ts +0 -1
  321. package/dist/react/theme/config.js +47 -25
  322. package/dist/react/theme/config.js.map +1 -1
  323. package/dist/react/theme/index.d.ts +2 -2
  324. package/dist/react/theme/index.js +1 -16
  325. package/dist/react/theme/types.d.ts +332 -0
  326. package/dist/react/theme/types.js +39 -0
  327. package/dist/react/theme/types.js.map +1 -0
  328. package/dist/react/types.d.ts +8 -8
  329. package/dist/react/types.js +147 -47
  330. package/dist/react/types.js.map +1 -1
  331. package/dist/react/utils/categoryPalette.d.ts +0 -1
  332. package/dist/react/utils/categoryPalette.js +91 -102
  333. package/dist/react/utils/categoryPalette.js.map +1 -1
  334. package/dist/react/utils/index.d.ts +5 -5
  335. package/dist/react/utils/index.js +457 -371
  336. package/dist/react/utils/index.js.map +1 -1
  337. package/dist/react/visualizations/EclipseTimerCard.d.ts +0 -1
  338. package/dist/react/visualizations/LinkBudgetCard.d.ts +0 -1
  339. package/dist/react/visualizations/NavBallCard.d.ts +0 -1
  340. package/dist/react/visualizations/PropulsionCard.d.ts +1 -2
  341. package/dist/react/visualizations/SensorFootprintCard.d.ts +1 -2
  342. package/dist/react/visualizations/ThermalHeatmapCard.d.ts +0 -1
  343. package/dist/react/visualizations/index.d.ts +3 -3
  344. package/dist/react.d.ts +2 -1
  345. package/dist/react.js +17 -221
  346. package/dist/shaders/atmosphere.frag.js +6 -5
  347. package/dist/shaders/atmosphere.frag.js.map +1 -1
  348. package/dist/shaders/atmosphere.vert.js +6 -5
  349. package/dist/shaders/atmosphere.vert.js.map +1 -1
  350. package/dist/shaders/stars.frag.js +6 -5
  351. package/dist/shaders/stars.frag.js.map +1 -1
  352. package/dist/shaders/stars.vert.js +6 -5
  353. package/dist/shaders/stars.vert.js.map +1 -1
  354. package/dist/style.css +26 -3
  355. package/dist/tokens/core.d.ts +159 -0
  356. package/dist/tokens/core.js +144 -0
  357. package/dist/tokens/core.js.map +1 -0
  358. package/dist/tokens/css-vars.d.ts +213 -2
  359. package/dist/tokens/css-vars.js +590 -227
  360. package/dist/tokens/css-vars.js.map +1 -1
  361. package/dist/tokens/index.d.ts +31 -228
  362. package/dist/tokens/index.js +281 -366
  363. package/dist/tokens/index.js.map +1 -1
  364. package/dist/tokens/palettes/astro.d.ts +129 -0
  365. package/dist/tokens/palettes/astro.js +112 -0
  366. package/dist/tokens/palettes/astro.js.map +1 -0
  367. package/dist/tokens/palettes/index.d.ts +288 -0
  368. package/dist/tokens/palettes/index.js +35 -0
  369. package/dist/tokens/palettes/index.js.map +1 -0
  370. package/dist/tokens/palettes/tailwind.d.ts +324 -0
  371. package/dist/tokens/palettes/tailwind.js +201 -0
  372. package/dist/tokens/palettes/tailwind.js.map +1 -0
  373. package/dist/tokens/palettes/zendir.d.ts +126 -0
  374. package/dist/tokens/palettes/zendir.js +92 -0
  375. package/dist/tokens/palettes/zendir.js.map +1 -0
  376. package/dist/tokens/themes.d.ts +30 -0
  377. package/dist/tokens/themes.js +704 -0
  378. package/dist/tokens/themes.js.map +1 -0
  379. package/dist/tokens/tokens.css +533 -155
  380. package/dist/types/index.d.ts +2 -2
  381. package/package.json +310 -313
  382. package/dist/index.js.map +0 -1
  383. package/dist/react/3d/index.js.map +0 -1
  384. package/dist/react/astro/index.js.map +0 -1
  385. package/dist/react/cards/index.js.map +0 -1
  386. package/dist/react/charts/index.js.map +0 -1
  387. package/dist/react/core/index.js.map +0 -1
  388. package/dist/react/panels/index.js.map +0 -1
  389. package/dist/react/theme/astro-tokens.d.ts +0 -153
  390. package/dist/react/theme/index.js.map +0 -1
  391. package/dist/react.js.map +0 -1
@@ -1,578 +1,612 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { memo, useMemo } from "react";
3
1
  import { useTheme } from "../../theme/ThemeProvider.js";
4
2
  import { AstroIcon } from "../display/AstroIcon.js";
5
- import { getPropertyConfig, deriveStatus, formatPropertyValue } from "./propertyConfig.js";
6
- const STATUS_BORDER_COLORS = {
7
- off: "#3c3e42",
8
- standby: "#285766",
9
- normal: "#005a00",
10
- caution: "#645600",
11
- serious: "#664618",
12
- critical: "#661102"
3
+ import { deriveStatus, formatPropertyValue, getPropertyConfig } from "./propertyConfig.js";
4
+ import { memo, useMemo } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/react/core/data/DataValue.tsx
7
+ /**
8
+ * @zendir/ui - DataValue Component
9
+ *
10
+ * Enterprise-grade data value display with icon, label, value, and status.
11
+ * The building block for telemetry displays, dashboards, and monitoring UIs.
12
+ *
13
+ * AstroUXDS Compliance:
14
+ * - Status colors per AstroUXDS status system
15
+ * - Dual-coding (color + shape) for accessibility via StatusIndicator
16
+ * - Tabular numbers for alignment
17
+ * - Sentence-case labels
18
+ *
19
+ * Features:
20
+ * - Auto-derive status from value + thresholds
21
+ * - Contextual icons from property presets
22
+ * - Multiple layout variants (stacked, inline, compact)
23
+ * - Theme-aware styling
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * import { DataValue } from '@zendir/ui';
28
+ *
29
+ * // Simple usage with property preset
30
+ * <DataValue property="temperature" value={72.5} />
31
+ *
32
+ * // Custom configuration
33
+ * <DataValue
34
+ * label="Battery"
35
+ * value={85}
36
+ * unit="%"
37
+ * icon="battery-full"
38
+ * thresholds={{ critical: 10, caution: 30 }}
39
+ * />
40
+ *
41
+ * // Inline layout
42
+ * <DataValue property="voltage" value={28.4} variant="inline" />
43
+ * ```
44
+ */
45
+ var STATUS_BORDER_COLORS = {
46
+ off: "#3c3e42",
47
+ standby: "#285766",
48
+ normal: "#005a00",
49
+ caution: "#645600",
50
+ serious: "#664618",
51
+ critical: "#661102"
13
52
  };
14
- const StatusShape = ({ status, size, color, borderColor, glow = true }) => {
15
- const hasBorder = !!borderColor;
16
- const strokeWidth = hasBorder ? 1 : 0;
17
- const glowFilter = glow && !hasBorder ? `drop-shadow(0 0 3px ${color})` : void 0;
18
- const renderShape = () => {
19
- switch (status) {
20
- case "off":
21
- return /* @__PURE__ */ jsx("circle", { cx: "6", cy: "6", r: hasBorder ? 2.5 : 3, fill: color, stroke: borderColor, strokeWidth });
22
- case "standby":
23
- return /* @__PURE__ */ jsx("circle", { cx: "6", cy: "6", r: "3.5", fill: "none", stroke: color, strokeWidth: "2" });
24
- case "normal":
25
- return /* @__PURE__ */ jsx(
26
- "circle",
27
- {
28
- cx: "6",
29
- cy: "6",
30
- r: hasBorder ? 4.5 : 5,
31
- fill: color,
32
- stroke: borderColor,
33
- strokeWidth
34
- }
35
- );
36
- case "caution":
37
- return /* @__PURE__ */ jsx(
38
- "rect",
39
- {
40
- x: hasBorder ? 1.5 : 1,
41
- y: hasBorder ? 1.5 : 1,
42
- width: hasBorder ? 9 : 10,
43
- height: hasBorder ? 9 : 10,
44
- fill: color,
45
- stroke: borderColor,
46
- strokeWidth
47
- }
48
- );
49
- case "serious":
50
- return /* @__PURE__ */ jsx(
51
- "polygon",
52
- {
53
- points: "6,1 11,6 6,11 1,6",
54
- fill: color,
55
- stroke: borderColor,
56
- strokeWidth
57
- }
58
- );
59
- case "critical":
60
- return /* @__PURE__ */ jsx(
61
- "polygon",
62
- {
63
- points: "6,11 1,2 11,2",
64
- fill: color,
65
- stroke: borderColor,
66
- strokeWidth
67
- }
68
- );
69
- default:
70
- return null;
71
- }
72
- };
73
- return /* @__PURE__ */ jsx(
74
- "svg",
75
- {
76
- viewBox: "0 0 12 12",
77
- width: size,
78
- height: size,
79
- style: { filter: glowFilter },
80
- children: renderShape()
81
- }
82
- );
53
+ var StatusShape = ({ status, size, color, borderColor, glow = true }) => {
54
+ const hasBorder = !!borderColor;
55
+ const strokeWidth = hasBorder ? 1 : 0;
56
+ const glowFilter = glow && !hasBorder ? `drop-shadow(0 0 3px ${color})` : void 0;
57
+ const renderShape = () => {
58
+ switch (status) {
59
+ case "off": return /* @__PURE__ */ jsx("circle", {
60
+ cx: "6",
61
+ cy: "6",
62
+ r: hasBorder ? 2.5 : 3,
63
+ fill: color,
64
+ stroke: borderColor,
65
+ strokeWidth
66
+ });
67
+ case "standby": return /* @__PURE__ */ jsx("circle", {
68
+ cx: "6",
69
+ cy: "6",
70
+ r: "3.5",
71
+ fill: "none",
72
+ stroke: color,
73
+ strokeWidth: "2"
74
+ });
75
+ case "normal": return /* @__PURE__ */ jsx("circle", {
76
+ cx: "6",
77
+ cy: "6",
78
+ r: hasBorder ? 4.5 : 5,
79
+ fill: color,
80
+ stroke: borderColor,
81
+ strokeWidth
82
+ });
83
+ case "caution": return /* @__PURE__ */ jsx("rect", {
84
+ x: hasBorder ? 1.5 : 1,
85
+ y: hasBorder ? 1.5 : 1,
86
+ width: hasBorder ? 9 : 10,
87
+ height: hasBorder ? 9 : 10,
88
+ fill: color,
89
+ stroke: borderColor,
90
+ strokeWidth
91
+ });
92
+ case "serious": return /* @__PURE__ */ jsx("polygon", {
93
+ points: "6,1 11,6 6,11 1,6",
94
+ fill: color,
95
+ stroke: borderColor,
96
+ strokeWidth
97
+ });
98
+ case "critical": return /* @__PURE__ */ jsx("polygon", {
99
+ points: "6,11 1,2 11,2",
100
+ fill: color,
101
+ stroke: borderColor,
102
+ strokeWidth
103
+ });
104
+ default: return null;
105
+ }
106
+ };
107
+ return /* @__PURE__ */ jsx("svg", {
108
+ viewBox: "0 0 12 12",
109
+ width: size,
110
+ height: size,
111
+ style: { filter: glowFilter },
112
+ children: renderShape()
113
+ });
83
114
  };
84
- const IconWithBadge = memo(function IconWithBadge2({
85
- icon,
86
- iconSize,
87
- iconColor,
88
- showBadge,
89
- status,
90
- statusColor,
91
- isLightTheme = false
92
- }) {
93
- const badgeSizeRatio = 0.3;
94
- const badgeSize = Math.max(7, Math.min(14, Math.round(iconSize * badgeSizeRatio)));
95
- const badgeOffsetX = -2;
96
- const badgeOffsetY = -2;
97
- const borderColor = isLightTheme ? STATUS_BORDER_COLORS[status] : void 0;
98
- const containerSize = iconSize;
99
- return /* @__PURE__ */ jsxs("div", { style: {
100
- position: "relative",
101
- display: "flex",
102
- alignItems: "center",
103
- justifyContent: "center",
104
- flexShrink: 0,
105
- width: containerSize,
106
- height: containerSize
107
- }, children: [
108
- /* @__PURE__ */ jsx(AstroIcon, { name: icon, size: iconSize, color: iconColor }),
109
- showBadge && /* @__PURE__ */ jsx("span", { style: {
110
- position: "absolute",
111
- top: badgeOffsetY,
112
- left: badgeOffsetX,
113
- display: "flex",
114
- alignItems: "center",
115
- justifyContent: "center"
116
- }, children: /* @__PURE__ */ jsx(
117
- StatusShape,
118
- {
119
- status,
120
- size: badgeSize,
121
- color: statusColor,
122
- borderColor,
123
- glow: !isLightTheme
124
- }
125
- ) })
126
- ] });
115
+ var IconWithBadge = memo(function IconWithBadge({ icon, iconSize, iconColor, showBadge, status, statusColor, isLightTheme = false }) {
116
+ const badgeSize = Math.max(7, Math.min(14, Math.round(iconSize * .3)));
117
+ const badgeOffsetX = -2;
118
+ const badgeOffsetY = -2;
119
+ const borderColor = isLightTheme ? STATUS_BORDER_COLORS[status] : void 0;
120
+ const containerSize = iconSize;
121
+ return /* @__PURE__ */ jsxs("div", {
122
+ style: {
123
+ position: "relative",
124
+ display: "flex",
125
+ alignItems: "center",
126
+ justifyContent: "center",
127
+ flexShrink: 0,
128
+ width: containerSize,
129
+ height: containerSize
130
+ },
131
+ children: [/* @__PURE__ */ jsx(AstroIcon, {
132
+ name: icon,
133
+ size: iconSize,
134
+ color: iconColor
135
+ }), showBadge && /* @__PURE__ */ jsx("span", {
136
+ style: {
137
+ position: "absolute",
138
+ top: badgeOffsetY,
139
+ left: badgeOffsetX,
140
+ display: "flex",
141
+ alignItems: "center",
142
+ justifyContent: "center"
143
+ },
144
+ children: /* @__PURE__ */ jsx(StatusShape, {
145
+ status,
146
+ size: badgeSize,
147
+ color: statusColor,
148
+ borderColor,
149
+ glow: !isLightTheme
150
+ })
151
+ })]
152
+ });
127
153
  });
128
- const DataValue = memo(function DataValue2({
129
- property,
130
- label: labelProp,
131
- value,
132
- unit: unitProp,
133
- icon: iconProp,
134
- showIcon = true,
135
- thresholds: thresholdsProp,
136
- status: statusProp,
137
- showStatus = true,
138
- precision: precisionProp,
139
- variant = "stacked",
140
- size = "md",
141
- color: colorProp,
142
- className = "",
143
- style,
144
- onClick,
145
- tooltip
146
- }) {
147
- const { tokens, mode } = useTheme();
148
- const isLightTheme = mode === "light";
149
- const config = useMemo(() => {
150
- const preset = property ? getPropertyConfig(property) : {
151
- label: labelProp || "Value",
152
- icon: iconProp || "info",
153
- unit: unitProp,
154
- precision: precisionProp,
155
- thresholds: thresholdsProp
156
- };
157
- return {
158
- ...preset,
159
- ...labelProp !== void 0 && { label: labelProp },
160
- ...iconProp !== void 0 && { icon: iconProp },
161
- ...unitProp !== void 0 && { unit: unitProp },
162
- ...precisionProp !== void 0 && { precision: precisionProp },
163
- ...thresholdsProp !== void 0 && { thresholds: thresholdsProp }
164
- };
165
- }, [property, labelProp, iconProp, unitProp, precisionProp, thresholdsProp]);
166
- const status = useMemo(() => {
167
- if (statusProp) return statusProp;
168
- if (typeof value === "number") {
169
- return deriveStatus(value, config.thresholds);
170
- }
171
- return "normal";
172
- }, [statusProp, value, config.thresholds]);
173
- const formattedValue = useMemo(() => {
174
- if (value === void 0 || value === null) return "--";
175
- if (typeof value === "string") return value;
176
- return formatPropertyValue(value, config);
177
- }, [value, config]);
178
- const statusColor = tokens.colors.status[status] || tokens.colors.status.off;
179
- const valueColor = colorProp || (showStatus && status !== "normal" ? statusColor : tokens.colors.text.primary);
180
- const sizeConfig = {
181
- sm: {
182
- iconSize: 16,
183
- labelSize: tokens.typography.fontSize.xs,
184
- // 10px - matches DataCell
185
- valueSize: tokens.typography.fontSize.sm,
186
- // 12px - matches DataCell
187
- lineHeight: 1.4,
188
- gap: 6,
189
- // Increased from 4px to 6px for better icon separation with larger icons
190
- rowGap: 2
191
- // 2px between label and value
192
- },
193
- md: {
194
- iconSize: 20,
195
- labelSize: tokens.typography.fontSize.xs,
196
- // 10px
197
- valueSize: tokens.typography.fontSize.base,
198
- // 14px
199
- lineHeight: 1.4,
200
- gap: 10,
201
- // Increased from 8px to 10px
202
- rowGap: 2
203
- // 2px between label and value
204
- },
205
- lg: {
206
- iconSize: 24,
207
- labelSize: tokens.typography.fontSize.sm,
208
- // 12px
209
- valueSize: tokens.typography.fontSize.md,
210
- // 14px
211
- lineHeight: 1.4,
212
- gap: 14,
213
- // Increased from 12px to 14px
214
- rowGap: 4
215
- // 4px between label and value
216
- }
217
- }[size];
218
- const renderContent = () => {
219
- const hasStatus = showStatus && status !== "normal" && status !== "off";
220
- switch (variant) {
221
- case "inline": {
222
- return /* @__PURE__ */ jsxs("div", { style: {
223
- display: "flex",
224
- alignItems: "center",
225
- justifyContent: "space-between",
226
- gap: sizeConfig.gap * 2,
227
- minHeight: sizeConfig.iconSize
228
- // Ensure consistent row height
229
- }, children: [
230
- /* @__PURE__ */ jsxs("div", { style: {
231
- display: "flex",
232
- alignItems: "center",
233
- gap: sizeConfig.gap
234
- }, children: [
235
- showIcon && config.icon && /* @__PURE__ */ jsx(
236
- IconWithBadge,
237
- {
238
- icon: config.icon,
239
- iconSize: sizeConfig.iconSize,
240
- iconColor: hasStatus ? statusColor : tokens.colors.text.tertiary,
241
- showBadge: hasStatus,
242
- status,
243
- statusColor,
244
- isLightTheme
245
- }
246
- ),
247
- /* @__PURE__ */ jsx("span", { style: {
248
- fontSize: sizeConfig.labelSize,
249
- lineHeight: sizeConfig.lineHeight,
250
- color: tokens.colors.text.secondary,
251
- fontWeight: 500,
252
- fontFamily: tokens.typography.fontFamily.primary
253
- }, children: config.label })
254
- ] }),
255
- /* @__PURE__ */ jsx("span", { style: {
256
- fontSize: sizeConfig.valueSize,
257
- lineHeight: sizeConfig.lineHeight,
258
- fontWeight: 500,
259
- // Match SpacecraftCard DataCell
260
- fontFamily: tokens.typography.fontFamily.mono,
261
- fontVariantNumeric: "tabular-nums",
262
- color: valueColor
263
- }, children: formattedValue })
264
- ] });
265
- }
266
- case "compact": {
267
- return /* @__PURE__ */ jsxs("div", { style: {
268
- display: "flex",
269
- alignItems: "center",
270
- gap: sizeConfig.gap,
271
- minHeight: sizeConfig.iconSize
272
- }, children: [
273
- showIcon && config.icon && /* @__PURE__ */ jsx(
274
- IconWithBadge,
275
- {
276
- icon: config.icon,
277
- iconSize: sizeConfig.iconSize,
278
- iconColor: hasStatus ? statusColor : tokens.colors.text.tertiary,
279
- showBadge: hasStatus,
280
- status,
281
- statusColor,
282
- isLightTheme
283
- }
284
- ),
285
- /* @__PURE__ */ jsx("span", { style: {
286
- fontSize: sizeConfig.valueSize,
287
- lineHeight: sizeConfig.lineHeight,
288
- fontWeight: 500,
289
- // Match SpacecraftCard DataCell
290
- fontFamily: tokens.typography.fontFamily.mono,
291
- fontVariantNumeric: "tabular-nums",
292
- color: valueColor
293
- }, children: formattedValue })
294
- ] });
295
- }
296
- case "minimal":
297
- return /* @__PURE__ */ jsx("span", { style: {
298
- fontSize: sizeConfig.valueSize,
299
- lineHeight: sizeConfig.lineHeight,
300
- fontWeight: 500,
301
- // Match SpacecraftCard DataCell
302
- fontFamily: tokens.typography.fontFamily.mono,
303
- fontVariantNumeric: "tabular-nums",
304
- color: valueColor
305
- }, children: formattedValue });
306
- case "card": {
307
- const iconMultiplier = 0.7;
308
- const iconToTextGap = 4;
309
- const baseSize = { sm: 26, md: 32, lg: 40 }[size];
310
- const iconSize = Math.round(baseSize * iconMultiplier);
311
- return /* @__PURE__ */ jsxs("div", { style: {
312
- display: "flex",
313
- alignItems: "center",
314
- gap: iconToTextGap
315
- }, children: [
316
- showIcon && config.icon && /* @__PURE__ */ jsx(
317
- IconWithBadge,
318
- {
319
- icon: config.icon,
320
- iconSize,
321
- iconColor: hasStatus ? statusColor : tokens.colors.text.tertiary,
322
- showBadge: hasStatus,
323
- status,
324
- statusColor,
325
- isLightTheme
326
- }
327
- ),
328
- /* @__PURE__ */ jsxs("div", { style: {
329
- display: "flex",
330
- flexDirection: "column",
331
- justifyContent: "space-between",
332
- // Distribute label/value to edges
333
- gap: sizeConfig.rowGap,
334
- minWidth: 0
335
- }, children: [
336
- /* @__PURE__ */ jsx("span", { style: {
337
- fontSize: sizeConfig.labelSize,
338
- lineHeight: sizeConfig.lineHeight,
339
- color: tokens.colors.text.secondary,
340
- fontWeight: 500,
341
- fontFamily: tokens.typography.fontFamily.primary
342
- }, children: config.label }),
343
- /* @__PURE__ */ jsx("span", { style: {
344
- fontSize: sizeConfig.valueSize,
345
- lineHeight: sizeConfig.lineHeight,
346
- fontWeight: 500,
347
- // Match SpacecraftCard DataCell
348
- fontFamily: tokens.typography.fontFamily.mono,
349
- fontVariantNumeric: "tabular-nums",
350
- color: valueColor
351
- }, children: formattedValue })
352
- ] })
353
- ] });
354
- }
355
- case "banner": {
356
- const bannerIconSize = { sm: 18, md: 22, lg: 28 }[size];
357
- return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: sizeConfig.rowGap, minWidth: 0, width: "100%" }, children: [
358
- /* @__PURE__ */ jsx("span", { style: {
359
- fontSize: sizeConfig.labelSize,
360
- lineHeight: sizeConfig.lineHeight,
361
- color: tokens.colors.text.secondary,
362
- fontWeight: 500,
363
- fontFamily: tokens.typography.fontFamily.primary,
364
- textTransform: "uppercase",
365
- letterSpacing: "0.5px"
366
- }, children: config.label }),
367
- /* @__PURE__ */ jsxs("div", { style: {
368
- display: "flex",
369
- alignItems: "center",
370
- justifyContent: "flex-start",
371
- width: "100%",
372
- gap: 6,
373
- minWidth: 0
374
- }, children: [
375
- showIcon && config.icon && /* @__PURE__ */ jsx(
376
- IconWithBadge,
377
- {
378
- icon: config.icon,
379
- iconSize: bannerIconSize,
380
- iconColor: hasStatus ? statusColor : tokens.colors.text.tertiary,
381
- showBadge: hasStatus,
382
- status,
383
- statusColor,
384
- isLightTheme
385
- }
386
- ),
387
- /* @__PURE__ */ jsx("span", { style: {
388
- fontSize: sizeConfig.valueSize,
389
- lineHeight: sizeConfig.lineHeight,
390
- fontWeight: 600,
391
- fontFamily: tokens.typography.fontFamily.mono,
392
- fontVariantNumeric: "tabular-nums",
393
- color: valueColor,
394
- textAlign: "left"
395
- }, children: formattedValue })
396
- ] })
397
- ] });
398
- }
399
- case "stat": {
400
- const statSize = {
401
- sm: { icon: 13, value: 13, label: 9.5 },
402
- md: { icon: 15, value: 14, label: 10 },
403
- lg: { icon: 18, value: 16, label: 11 }
404
- }[size];
405
- const statColor = colorProp || statusColor;
406
- return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "flex-start", gap: 2 }, children: [
407
- /* @__PURE__ */ jsxs("div", { style: {
408
- display: "flex",
409
- alignItems: "center",
410
- gap: 6,
411
- fontFamily: tokens.typography.fontFamily.mono,
412
- fontSize: statSize.value,
413
- fontWeight: 600,
414
- color: statColor,
415
- fontVariantNumeric: "tabular-nums",
416
- letterSpacing: "0.02em",
417
- lineHeight: 1.1
418
- }, children: [
419
- showIcon && config.icon && /* @__PURE__ */ jsx(AstroIcon, { name: config.icon, size: statSize.icon, color: statColor }),
420
- /* @__PURE__ */ jsx("span", { children: formattedValue })
421
- ] }),
422
- /* @__PURE__ */ jsx("span", { style: {
423
- fontFamily: tokens.typography.fontFamily.mono,
424
- fontSize: statSize.label,
425
- letterSpacing: "0.06em",
426
- textTransform: "uppercase",
427
- color: tokens.colors.text.tertiary,
428
- lineHeight: 1.1
429
- }, children: config.label })
430
- ] });
431
- }
432
- case "stacked":
433
- default: {
434
- const iconMultiplier = 0.7;
435
- const iconToTextGap = 4;
436
- const baseSize = { sm: 26, md: 32, lg: 40 }[size];
437
- const iconSize = Math.round(baseSize * iconMultiplier);
438
- return /* @__PURE__ */ jsxs("div", { style: {
439
- display: "flex",
440
- alignItems: "center",
441
- gap: iconToTextGap
442
- }, children: [
443
- showIcon && config.icon && /* @__PURE__ */ jsx(
444
- IconWithBadge,
445
- {
446
- icon: config.icon,
447
- iconSize,
448
- iconColor: hasStatus ? statusColor : tokens.colors.text.tertiary,
449
- showBadge: hasStatus,
450
- status,
451
- statusColor,
452
- isLightTheme
453
- }
454
- ),
455
- /* @__PURE__ */ jsxs("div", { style: {
456
- display: "flex",
457
- flexDirection: "column",
458
- justifyContent: "space-between",
459
- // Distribute label/value to edges
460
- gap: sizeConfig.rowGap,
461
- minWidth: 0
462
- }, children: [
463
- /* @__PURE__ */ jsx("span", { style: {
464
- fontSize: sizeConfig.labelSize,
465
- lineHeight: sizeConfig.lineHeight,
466
- color: tokens.colors.text.secondary,
467
- fontWeight: 500,
468
- fontFamily: tokens.typography.fontFamily.primary
469
- }, children: config.label }),
470
- /* @__PURE__ */ jsx("span", { style: {
471
- fontSize: sizeConfig.valueSize,
472
- lineHeight: sizeConfig.lineHeight,
473
- fontWeight: 500,
474
- // Match SpacecraftCard DataCell
475
- fontFamily: tokens.typography.fontFamily.mono,
476
- fontVariantNumeric: "tabular-nums",
477
- color: valueColor
478
- }, children: formattedValue })
479
- ] })
480
- ] });
481
- }
482
- }
483
- };
484
- return /* @__PURE__ */ jsx(
485
- "div",
486
- {
487
- className: `zendir-data-value zendir-data-value--${variant} zendir-data-value--${size} ${className}`,
488
- style: {
489
- cursor: onClick ? "pointer" : "default",
490
- ...variant === "banner" ? { flex: 1, minWidth: 0 } : {},
491
- ...style
492
- },
493
- onClick,
494
- title: tooltip || config.description,
495
- role: onClick ? "button" : void 0,
496
- tabIndex: onClick ? 0 : void 0,
497
- onKeyDown: onClick ? (e) => e.key === "Enter" && onClick() : void 0,
498
- children: renderContent()
499
- }
500
- );
154
+ var DataValue = memo(function DataValue({ property, label: labelProp, value, unit: unitProp, icon: iconProp, showIcon = true, thresholds: thresholdsProp, status: statusProp, showStatus = true, precision: precisionProp, variant = "stacked", size = "md", color: colorProp, className = "", style, onClick, tooltip }) {
155
+ const { tokens, mode } = useTheme();
156
+ const isLightTheme = mode === "light";
157
+ const config = useMemo(() => {
158
+ return {
159
+ ...property ? getPropertyConfig(property) : {
160
+ label: labelProp || "Value",
161
+ icon: iconProp || "info",
162
+ unit: unitProp,
163
+ precision: precisionProp,
164
+ thresholds: thresholdsProp
165
+ },
166
+ ...labelProp !== void 0 && { label: labelProp },
167
+ ...iconProp !== void 0 && { icon: iconProp },
168
+ ...unitProp !== void 0 && { unit: unitProp },
169
+ ...precisionProp !== void 0 && { precision: precisionProp },
170
+ ...thresholdsProp !== void 0 && { thresholds: thresholdsProp }
171
+ };
172
+ }, [
173
+ property,
174
+ labelProp,
175
+ iconProp,
176
+ unitProp,
177
+ precisionProp,
178
+ thresholdsProp
179
+ ]);
180
+ const status = useMemo(() => {
181
+ if (statusProp) return statusProp;
182
+ if (typeof value === "number") return deriveStatus(value, config.thresholds);
183
+ return "normal";
184
+ }, [
185
+ statusProp,
186
+ value,
187
+ config.thresholds
188
+ ]);
189
+ const formattedValue = useMemo(() => {
190
+ if (value === void 0 || value === null) return "--";
191
+ if (typeof value === "string") return value;
192
+ return formatPropertyValue(value, config);
193
+ }, [value, config]);
194
+ const statusColor = tokens.colors.status[status] || tokens.colors.status.off;
195
+ const valueColor = colorProp || (showStatus && status !== "normal" ? statusColor : tokens.colors.text.primary);
196
+ const sizeConfig = {
197
+ sm: {
198
+ iconSize: 16,
199
+ labelSize: tokens.typography.fontSize.xs,
200
+ valueSize: tokens.typography.fontSize.sm,
201
+ lineHeight: 1.4,
202
+ gap: 6,
203
+ rowGap: 2
204
+ },
205
+ md: {
206
+ iconSize: 20,
207
+ labelSize: tokens.typography.fontSize.xs,
208
+ valueSize: tokens.typography.fontSize.base,
209
+ lineHeight: 1.4,
210
+ gap: 10,
211
+ rowGap: 2
212
+ },
213
+ lg: {
214
+ iconSize: 24,
215
+ labelSize: tokens.typography.fontSize.sm,
216
+ valueSize: tokens.typography.fontSize.md,
217
+ lineHeight: 1.4,
218
+ gap: 14,
219
+ rowGap: 4
220
+ }
221
+ }[size];
222
+ const renderContent = () => {
223
+ const hasStatus = showStatus && status !== "normal" && status !== "off";
224
+ switch (variant) {
225
+ case "inline": return /* @__PURE__ */ jsxs("div", {
226
+ style: {
227
+ display: "flex",
228
+ alignItems: "center",
229
+ justifyContent: "space-between",
230
+ gap: sizeConfig.gap * 2,
231
+ minHeight: sizeConfig.iconSize
232
+ },
233
+ children: [/* @__PURE__ */ jsxs("div", {
234
+ style: {
235
+ display: "flex",
236
+ alignItems: "center",
237
+ gap: sizeConfig.gap
238
+ },
239
+ children: [showIcon && config.icon && /* @__PURE__ */ jsx(IconWithBadge, {
240
+ icon: config.icon,
241
+ iconSize: sizeConfig.iconSize,
242
+ iconColor: hasStatus ? statusColor : tokens.colors.text.tertiary,
243
+ showBadge: hasStatus,
244
+ status,
245
+ statusColor,
246
+ isLightTheme
247
+ }), /* @__PURE__ */ jsx("span", {
248
+ style: {
249
+ fontSize: sizeConfig.labelSize,
250
+ lineHeight: sizeConfig.lineHeight,
251
+ color: tokens.colors.text.secondary,
252
+ fontWeight: 500,
253
+ fontFamily: tokens.typography.fontFamily.primary
254
+ },
255
+ children: config.label
256
+ })]
257
+ }), /* @__PURE__ */ jsx("span", {
258
+ style: {
259
+ fontSize: sizeConfig.valueSize,
260
+ lineHeight: sizeConfig.lineHeight,
261
+ fontWeight: 500,
262
+ fontFamily: tokens.typography.fontFamily.mono,
263
+ fontVariantNumeric: "tabular-nums",
264
+ color: valueColor
265
+ },
266
+ children: formattedValue
267
+ })]
268
+ });
269
+ case "compact": return /* @__PURE__ */ jsxs("div", {
270
+ style: {
271
+ display: "flex",
272
+ alignItems: "center",
273
+ gap: sizeConfig.gap,
274
+ minHeight: sizeConfig.iconSize
275
+ },
276
+ children: [showIcon && config.icon && /* @__PURE__ */ jsx(IconWithBadge, {
277
+ icon: config.icon,
278
+ iconSize: sizeConfig.iconSize,
279
+ iconColor: hasStatus ? statusColor : tokens.colors.text.tertiary,
280
+ showBadge: hasStatus,
281
+ status,
282
+ statusColor,
283
+ isLightTheme
284
+ }), /* @__PURE__ */ jsx("span", {
285
+ style: {
286
+ fontSize: sizeConfig.valueSize,
287
+ lineHeight: sizeConfig.lineHeight,
288
+ fontWeight: 500,
289
+ fontFamily: tokens.typography.fontFamily.mono,
290
+ fontVariantNumeric: "tabular-nums",
291
+ color: valueColor
292
+ },
293
+ children: formattedValue
294
+ })]
295
+ });
296
+ case "minimal": return /* @__PURE__ */ jsx("span", {
297
+ style: {
298
+ fontSize: sizeConfig.valueSize,
299
+ lineHeight: sizeConfig.lineHeight,
300
+ fontWeight: 500,
301
+ fontFamily: tokens.typography.fontFamily.mono,
302
+ fontVariantNumeric: "tabular-nums",
303
+ color: valueColor
304
+ },
305
+ children: formattedValue
306
+ });
307
+ case "card": {
308
+ const iconMultiplier = .7;
309
+ const iconToTextGap = 4;
310
+ const baseSize = {
311
+ sm: 26,
312
+ md: 32,
313
+ lg: 40
314
+ }[size];
315
+ const iconSize = Math.round(baseSize * iconMultiplier);
316
+ return /* @__PURE__ */ jsxs("div", {
317
+ style: {
318
+ display: "flex",
319
+ alignItems: "center",
320
+ gap: iconToTextGap
321
+ },
322
+ children: [showIcon && config.icon && /* @__PURE__ */ jsx(IconWithBadge, {
323
+ icon: config.icon,
324
+ iconSize,
325
+ iconColor: hasStatus ? statusColor : tokens.colors.text.tertiary,
326
+ showBadge: hasStatus,
327
+ status,
328
+ statusColor,
329
+ isLightTheme
330
+ }), /* @__PURE__ */ jsxs("div", {
331
+ style: {
332
+ display: "flex",
333
+ flexDirection: "column",
334
+ justifyContent: "space-between",
335
+ gap: sizeConfig.rowGap,
336
+ minWidth: 0
337
+ },
338
+ children: [/* @__PURE__ */ jsx("span", {
339
+ style: {
340
+ fontSize: sizeConfig.labelSize,
341
+ lineHeight: sizeConfig.lineHeight,
342
+ color: tokens.colors.text.secondary,
343
+ fontWeight: 500,
344
+ fontFamily: tokens.typography.fontFamily.primary
345
+ },
346
+ children: config.label
347
+ }), /* @__PURE__ */ jsx("span", {
348
+ style: {
349
+ fontSize: sizeConfig.valueSize,
350
+ lineHeight: sizeConfig.lineHeight,
351
+ fontWeight: 500,
352
+ fontFamily: tokens.typography.fontFamily.mono,
353
+ fontVariantNumeric: "tabular-nums",
354
+ color: valueColor
355
+ },
356
+ children: formattedValue
357
+ })]
358
+ })]
359
+ });
360
+ }
361
+ case "banner": {
362
+ const bannerIconSize = {
363
+ sm: 18,
364
+ md: 22,
365
+ lg: 28
366
+ }[size];
367
+ return /* @__PURE__ */ jsxs("div", {
368
+ style: {
369
+ display: "flex",
370
+ flexDirection: "column",
371
+ gap: sizeConfig.rowGap,
372
+ minWidth: 0,
373
+ width: "100%"
374
+ },
375
+ children: [/* @__PURE__ */ jsx("span", {
376
+ style: {
377
+ fontSize: sizeConfig.labelSize,
378
+ lineHeight: sizeConfig.lineHeight,
379
+ color: tokens.colors.text.secondary,
380
+ fontWeight: 500,
381
+ fontFamily: tokens.typography.fontFamily.primary,
382
+ textTransform: "uppercase",
383
+ letterSpacing: "0.5px"
384
+ },
385
+ children: config.label
386
+ }), /* @__PURE__ */ jsxs("div", {
387
+ style: {
388
+ display: "flex",
389
+ alignItems: "center",
390
+ justifyContent: "flex-start",
391
+ width: "100%",
392
+ gap: 6,
393
+ minWidth: 0
394
+ },
395
+ children: [showIcon && config.icon && /* @__PURE__ */ jsx(IconWithBadge, {
396
+ icon: config.icon,
397
+ iconSize: bannerIconSize,
398
+ iconColor: hasStatus ? statusColor : tokens.colors.text.tertiary,
399
+ showBadge: hasStatus,
400
+ status,
401
+ statusColor,
402
+ isLightTheme
403
+ }), /* @__PURE__ */ jsx("span", {
404
+ style: {
405
+ fontSize: sizeConfig.valueSize,
406
+ lineHeight: sizeConfig.lineHeight,
407
+ fontWeight: 600,
408
+ fontFamily: tokens.typography.fontFamily.mono,
409
+ fontVariantNumeric: "tabular-nums",
410
+ color: valueColor,
411
+ textAlign: "left"
412
+ },
413
+ children: formattedValue
414
+ })]
415
+ })]
416
+ });
417
+ }
418
+ case "stat": {
419
+ const statSize = {
420
+ sm: {
421
+ icon: 13,
422
+ value: 13,
423
+ label: 9.5
424
+ },
425
+ md: {
426
+ icon: 15,
427
+ value: 14,
428
+ label: 10
429
+ },
430
+ lg: {
431
+ icon: 18,
432
+ value: 16,
433
+ label: 11
434
+ }
435
+ }[size];
436
+ const statColor = colorProp || statusColor;
437
+ return /* @__PURE__ */ jsxs("div", {
438
+ style: {
439
+ display: "flex",
440
+ flexDirection: "column",
441
+ alignItems: "flex-start",
442
+ gap: 2
443
+ },
444
+ children: [/* @__PURE__ */ jsxs("div", {
445
+ style: {
446
+ display: "flex",
447
+ alignItems: "center",
448
+ gap: 6,
449
+ fontFamily: tokens.typography.fontFamily.mono,
450
+ fontSize: statSize.value,
451
+ fontWeight: 600,
452
+ color: statColor,
453
+ fontVariantNumeric: "tabular-nums",
454
+ letterSpacing: "0.02em",
455
+ lineHeight: 1.1
456
+ },
457
+ children: [showIcon && config.icon && /* @__PURE__ */ jsx(AstroIcon, {
458
+ name: config.icon,
459
+ size: statSize.icon,
460
+ color: statColor
461
+ }), /* @__PURE__ */ jsx("span", { children: formattedValue })]
462
+ }), /* @__PURE__ */ jsx("span", {
463
+ style: {
464
+ fontFamily: tokens.typography.fontFamily.mono,
465
+ fontSize: statSize.label,
466
+ letterSpacing: "0.06em",
467
+ textTransform: "uppercase",
468
+ color: tokens.colors.text.tertiary,
469
+ lineHeight: 1.1
470
+ },
471
+ children: config.label
472
+ })]
473
+ });
474
+ }
475
+ default: {
476
+ const iconMultiplier = .7;
477
+ const iconToTextGap = 4;
478
+ const baseSize = {
479
+ sm: 26,
480
+ md: 32,
481
+ lg: 40
482
+ }[size];
483
+ const iconSize = Math.round(baseSize * iconMultiplier);
484
+ return /* @__PURE__ */ jsxs("div", {
485
+ style: {
486
+ display: "flex",
487
+ alignItems: "center",
488
+ gap: iconToTextGap
489
+ },
490
+ children: [showIcon && config.icon && /* @__PURE__ */ jsx(IconWithBadge, {
491
+ icon: config.icon,
492
+ iconSize,
493
+ iconColor: hasStatus ? statusColor : tokens.colors.text.tertiary,
494
+ showBadge: hasStatus,
495
+ status,
496
+ statusColor,
497
+ isLightTheme
498
+ }), /* @__PURE__ */ jsxs("div", {
499
+ style: {
500
+ display: "flex",
501
+ flexDirection: "column",
502
+ justifyContent: "space-between",
503
+ gap: sizeConfig.rowGap,
504
+ minWidth: 0
505
+ },
506
+ children: [/* @__PURE__ */ jsx("span", {
507
+ style: {
508
+ fontSize: sizeConfig.labelSize,
509
+ lineHeight: sizeConfig.lineHeight,
510
+ color: tokens.colors.text.secondary,
511
+ fontWeight: 500,
512
+ fontFamily: tokens.typography.fontFamily.primary
513
+ },
514
+ children: config.label
515
+ }), /* @__PURE__ */ jsx("span", {
516
+ style: {
517
+ fontSize: sizeConfig.valueSize,
518
+ lineHeight: sizeConfig.lineHeight,
519
+ fontWeight: 500,
520
+ fontFamily: tokens.typography.fontFamily.mono,
521
+ fontVariantNumeric: "tabular-nums",
522
+ color: valueColor
523
+ },
524
+ children: formattedValue
525
+ })]
526
+ })]
527
+ });
528
+ }
529
+ }
530
+ };
531
+ return /* @__PURE__ */ jsx("div", {
532
+ className: `zendir-data-value zendir-data-value--${variant} zendir-data-value--${size} ${className}`,
533
+ style: {
534
+ cursor: onClick ? "pointer" : "default",
535
+ ...variant === "banner" ? {
536
+ flex: 1,
537
+ minWidth: 0
538
+ } : {},
539
+ ...style
540
+ },
541
+ onClick,
542
+ title: tooltip || config.description,
543
+ role: onClick ? "button" : void 0,
544
+ tabIndex: onClick ? 0 : void 0,
545
+ onKeyDown: onClick ? (e) => e.key === "Enter" && onClick() : void 0,
546
+ children: renderContent()
547
+ });
501
548
  });
502
- const DataValueGroup = memo(function DataValueGroup2({
503
- title,
504
- icon,
505
- direction = "grid",
506
- columns = 2,
507
- gap = "md",
508
- children,
509
- className = "",
510
- style
511
- }) {
512
- const { tokens } = useTheme();
513
- const gapSize = {
514
- sm: 8,
515
- // 2 × 4px
516
- md: 16,
517
- // 4 × 4px
518
- lg: 24
519
- // 6 × 4px
520
- }[gap];
521
- const layoutStyles = {
522
- row: {
523
- display: "flex",
524
- flexDirection: "row",
525
- flexWrap: "wrap",
526
- gap: gapSize,
527
- alignItems: "flex-start"
528
- },
529
- column: {
530
- display: "flex",
531
- flexDirection: "column",
532
- gap: gapSize
533
- },
534
- grid: {
535
- display: "grid",
536
- gridTemplateColumns: `repeat(${columns}, 1fr)`,
537
- gap: gapSize,
538
- alignItems: "start"
539
- }
540
- };
541
- const layoutStyle = layoutStyles[direction];
542
- return /* @__PURE__ */ jsxs("div", { className: `zendir-data-value-group ${className}`, style, children: [
543
- title && /* @__PURE__ */ jsxs("div", { style: {
544
- display: "flex",
545
- alignItems: "center",
546
- gap: 6,
547
- // 6px gap for tight header
548
- marginBottom: 12,
549
- // 3 × 4px
550
- paddingBottom: 8,
551
- // 2 × 4px
552
- borderBottom: `1px solid ${tokens.colors.border.muted}`
553
- }, children: [
554
- icon && /* @__PURE__ */ jsx(
555
- AstroIcon,
556
- {
557
- name: icon,
558
- size: 14,
559
- color: tokens.colors.text.tertiary,
560
- style: { flexShrink: 0 }
561
- }
562
- ),
563
- /* @__PURE__ */ jsx("span", { style: {
564
- fontSize: "12px",
565
- fontWeight: 500,
566
- color: tokens.colors.text.secondary,
567
- textTransform: "uppercase",
568
- letterSpacing: "0.5px"
569
- }, children: title })
570
- ] }),
571
- /* @__PURE__ */ jsx("div", { style: layoutStyle, children })
572
- ] });
549
+ var DataValueGroup = memo(function DataValueGroup({ title, icon, direction = "grid", columns = 2, gap = "md", children, className = "", style }) {
550
+ const { tokens } = useTheme();
551
+ const gapSize = {
552
+ sm: 8,
553
+ md: 16,
554
+ lg: 24
555
+ }[gap];
556
+ const layoutStyle = {
557
+ row: {
558
+ display: "flex",
559
+ flexDirection: "row",
560
+ flexWrap: "wrap",
561
+ gap: gapSize,
562
+ alignItems: "flex-start"
563
+ },
564
+ column: {
565
+ display: "flex",
566
+ flexDirection: "column",
567
+ gap: gapSize
568
+ },
569
+ grid: {
570
+ display: "grid",
571
+ gridTemplateColumns: `repeat(${columns}, 1fr)`,
572
+ gap: gapSize,
573
+ alignItems: "start"
574
+ }
575
+ }[direction];
576
+ return /* @__PURE__ */ jsxs("div", {
577
+ className: `zendir-data-value-group ${className}`,
578
+ style,
579
+ children: [title && /* @__PURE__ */ jsxs("div", {
580
+ style: {
581
+ display: "flex",
582
+ alignItems: "center",
583
+ gap: 6,
584
+ marginBottom: 12,
585
+ paddingBottom: 8,
586
+ borderBottom: `1px solid ${tokens.colors.border.muted}`
587
+ },
588
+ children: [icon && /* @__PURE__ */ jsx(AstroIcon, {
589
+ name: icon,
590
+ size: 14,
591
+ color: tokens.colors.text.tertiary,
592
+ style: { flexShrink: 0 }
593
+ }), /* @__PURE__ */ jsx("span", {
594
+ style: {
595
+ fontSize: "12px",
596
+ fontWeight: 500,
597
+ color: tokens.colors.text.secondary,
598
+ textTransform: "uppercase",
599
+ letterSpacing: "0.5px"
600
+ },
601
+ children: title
602
+ })]
603
+ }), /* @__PURE__ */ jsx("div", {
604
+ style: layoutStyle,
605
+ children
606
+ })]
607
+ });
573
608
  });
574
- export {
575
- DataValue,
576
- DataValueGroup
577
- };
578
- //# sourceMappingURL=DataValue.js.map
609
+ //#endregion
610
+ export { DataValue, DataValue as default, DataValueGroup };
611
+
612
+ //# sourceMappingURL=DataValue.js.map