@zendir/ui 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/CHANGELOG.md +20 -0
  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 +312 -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 +217 -194
  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 +419 -41
  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,315 +1,354 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { memo, useRef, useId, useEffect, useState, useCallback, useContext, createContext } from "react";
3
- import { createPortal } from "react-dom";
4
1
  import { useTheme } from "../../theme/ThemeProvider.js";
5
- const ConfirmDialog = memo(function ConfirmDialog2({
6
- open,
7
- onClose,
8
- onConfirm,
9
- title,
10
- message,
11
- status,
12
- confirmLabel = "Confirm",
13
- cancelLabel = "Cancel",
14
- destructive = false
15
- }) {
16
- const { tokens, theme } = useTheme();
17
- const isTransparentTheme = theme === "transparent" || theme === "transparent-bold" || theme === "transparent-minimal";
18
- const dialogRef = useRef(null);
19
- const confirmRef = useRef(null);
20
- const previousActiveElement = useRef(null);
21
- const titleId = useId();
22
- const messageId = useId();
23
- const CONFIRM_DIALOG_Z_INDEX = 2147483200;
24
- useEffect(() => {
25
- if (!open) return;
26
- previousActiveElement.current = document.activeElement;
27
- document.body.style.overflow = "hidden";
28
- const handleKeyDown = (e) => {
29
- if (e.key === "Escape") {
30
- e.preventDefault();
31
- onClose();
32
- return;
33
- }
34
- if (e.key !== "Tab") return;
35
- const root = dialogRef.current;
36
- if (!root) return;
37
- const focusableElements = root.querySelectorAll(
38
- 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
39
- );
40
- const focusable = Array.from(focusableElements).filter((el) => !el.hasAttribute("disabled"));
41
- if (focusable.length === 0) return;
42
- const first = focusable[0];
43
- const last = focusable[focusable.length - 1];
44
- const active = document.activeElement;
45
- if (e.shiftKey && active === first) {
46
- e.preventDefault();
47
- last.focus();
48
- } else if (!e.shiftKey && active === last) {
49
- e.preventDefault();
50
- first.focus();
51
- }
52
- };
53
- document.addEventListener("keydown", handleKeyDown);
54
- const focusTimer = window.setTimeout(() => {
55
- var _a;
56
- (_a = confirmRef.current) == null ? void 0 : _a.focus();
57
- }, 0);
58
- return () => {
59
- var _a;
60
- window.clearTimeout(focusTimer);
61
- document.removeEventListener("keydown", handleKeyDown);
62
- document.body.style.overflow = "";
63
- (_a = previousActiveElement.current) == null ? void 0 : _a.focus();
64
- };
65
- }, [open, onClose]);
66
- if (!open) return null;
67
- if (typeof document === "undefined") return null;
68
- const statusColors = {
69
- normal: tokens.colors.status.normal,
70
- caution: tokens.colors.status.caution,
71
- serious: tokens.colors.status.serious,
72
- critical: tokens.colors.status.critical
73
- };
74
- const accentColor = status ? statusColors[status] : tokens.colors.accent.primary;
75
- const confirmBg = destructive ? tokens.colors.status.critical : tokens.colors.accent.primary;
76
- const statusIcon = status && (() => {
77
- const s = 32;
78
- const innerIcon = /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: accentColor, strokeWidth: "2.5", strokeLinecap: "round", children: [
79
- /* @__PURE__ */ jsx("path", { d: "M12 9v4" }),
80
- /* @__PURE__ */ jsx("path", { d: "M12 17h.01" })
81
- ] });
82
- const baseStyle = {
83
- width: s,
84
- height: s,
85
- display: "flex",
86
- alignItems: "center",
87
- justifyContent: "center",
88
- flexShrink: 0
89
- };
90
- switch (status) {
91
- case "critical":
92
- return /* @__PURE__ */ jsx("div", { style: {
93
- ...baseStyle,
94
- backgroundColor: `${accentColor}20`,
95
- border: `2px solid ${accentColor}`,
96
- clipPath: "polygon(50% 0%, 0% 100%, 100% 100%)",
97
- paddingTop: 8
98
- }, children: innerIcon });
99
- case "serious":
100
- return /* @__PURE__ */ jsx("div", { style: {
101
- ...baseStyle,
102
- backgroundColor: `${accentColor}20`,
103
- border: `2px solid ${accentColor}`,
104
- transform: "rotate(45deg)"
105
- }, children: /* @__PURE__ */ jsx("div", { style: { transform: "rotate(-45deg)" }, children: innerIcon }) });
106
- case "caution":
107
- return /* @__PURE__ */ jsx("div", { style: {
108
- ...baseStyle,
109
- backgroundColor: `${accentColor}20`,
110
- border: `2px solid ${accentColor}`,
111
- borderRadius: "4px"
112
- }, children: innerIcon });
113
- default:
114
- return /* @__PURE__ */ jsx("div", { style: {
115
- ...baseStyle,
116
- backgroundColor: `${accentColor}20`,
117
- border: `2px solid ${accentColor}`,
118
- borderRadius: "50%"
119
- }, children: innerIcon });
120
- }
121
- })();
122
- return createPortal(/* @__PURE__ */ jsxs(Fragment, { children: [
123
- /* @__PURE__ */ jsx(
124
- "div",
125
- {
126
- style: {
127
- position: "fixed",
128
- inset: 0,
129
- zIndex: CONFIRM_DIALOG_Z_INDEX,
130
- backgroundColor: isTransparentTheme ? `${tokens.colors.background.base}80` : `${tokens.colors.background.base}B3`,
131
- backdropFilter: "blur(6px)",
132
- WebkitBackdropFilter: "blur(6px)",
133
- animation: `zendir-confirm-backdrop 200ms ${tokens.animation.easing.default}`
134
- },
135
- onClick: onClose
136
- }
137
- ),
138
- /* @__PURE__ */ jsxs(
139
- "div",
140
- {
141
- ref: dialogRef,
142
- role: "alertdialog",
143
- "aria-modal": "true",
144
- "aria-labelledby": titleId,
145
- "aria-describedby": message ? messageId : void 0,
146
- onClick: (e) => e.stopPropagation(),
147
- style: {
148
- position: "fixed",
149
- top: "50%",
150
- left: "50%",
151
- transform: "translate(-50%, -50%)",
152
- zIndex: CONFIRM_DIALOG_Z_INDEX + 1,
153
- width: "100%",
154
- maxWidth: "min(440px, calc(100vw - 32px))",
155
- backgroundColor: isTransparentTheme ? "rgba(15, 12, 30, 0.9)" : tokens.colors.background.surface,
156
- border: `1px solid ${tokens.colors.border.default}`,
157
- borderRadius: tokens.borderRadius.lg,
158
- boxShadow: tokens.shadows.xl,
159
- fontFamily: tokens.typography.fontFamily.primary,
160
- animation: `zendir-confirm-enter 250ms ${tokens.animation.easing.default}`,
161
- overflow: "hidden",
162
- ...isTransparentTheme ? {
163
- backdropFilter: "blur(20px)",
164
- WebkitBackdropFilter: "blur(20px)"
165
- } : {}
166
- },
167
- children: [
168
- status && /* @__PURE__ */ jsx("div", { style: {
169
- height: 3,
170
- backgroundColor: accentColor,
171
- width: "100%"
172
- } }),
173
- /* @__PURE__ */ jsx("div", { style: { padding: `${tokens.spacing.lg} ${tokens.spacing.lg} ${tokens.spacing.md}` }, children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: tokens.spacing.md, alignItems: "flex-start" }, children: [
174
- statusIcon,
175
- /* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
176
- /* @__PURE__ */ jsx(
177
- "div",
178
- {
179
- id: titleId,
180
- style: {
181
- fontSize: tokens.typography.fontSize.md,
182
- fontWeight: tokens.typography.fontWeight.semibold,
183
- color: tokens.colors.text.primary,
184
- lineHeight: tokens.typography.lineHeight.tight
185
- },
186
- children: title
187
- }
188
- ),
189
- message && /* @__PURE__ */ jsx(
190
- "div",
191
- {
192
- id: messageId,
193
- style: {
194
- fontSize: tokens.typography.fontSize.sm,
195
- color: tokens.colors.text.secondary,
196
- marginTop: tokens.spacing.sm,
197
- lineHeight: tokens.typography.lineHeight.normal
198
- },
199
- children: message
200
- }
201
- )
202
- ] })
203
- ] }) }),
204
- /* @__PURE__ */ jsxs("div", { style: {
205
- display: "flex",
206
- justifyContent: "flex-end",
207
- gap: tokens.spacing.sm,
208
- padding: `${tokens.spacing.md} ${tokens.spacing.lg} ${tokens.spacing.lg}`,
209
- borderTop: tokens.borders.divider
210
- }, children: [
211
- /* @__PURE__ */ jsx(
212
- "button",
213
- {
214
- onClick: onClose,
215
- style: {
216
- padding: `0 ${tokens.spacing.md}`,
217
- minHeight: tokens.elementSize.lg,
218
- fontSize: tokens.typography.fontSize.sm,
219
- fontWeight: tokens.typography.fontWeight.medium,
220
- fontFamily: tokens.typography.fontFamily.primary,
221
- color: tokens.colors.text.primary,
222
- backgroundColor: tokens.colors.background.base,
223
- border: `1px solid ${tokens.colors.border.muted}`,
224
- borderRadius: tokens.borderRadius.md,
225
- cursor: "pointer",
226
- transition: tokens.animation.fast
227
- },
228
- children: cancelLabel
229
- }
230
- ),
231
- /* @__PURE__ */ jsx(
232
- "button",
233
- {
234
- ref: confirmRef,
235
- onClick: () => {
236
- onConfirm();
237
- onClose();
238
- },
239
- style: {
240
- padding: `0 ${tokens.spacing.md}`,
241
- minHeight: tokens.elementSize.lg,
242
- fontSize: tokens.typography.fontSize.sm,
243
- fontWeight: tokens.typography.fontWeight.semibold,
244
- fontFamily: tokens.typography.fontFamily.primary,
245
- color: tokens.colors.text.inverse || "#fff",
246
- backgroundColor: confirmBg,
247
- border: "none",
248
- borderRadius: tokens.borderRadius.md,
249
- cursor: "pointer",
250
- transition: tokens.animation.fast,
251
- boxShadow: `0 2px 8px ${confirmBg}40`
252
- },
253
- children: confirmLabel
254
- }
255
- )
256
- ] })
257
- ]
258
- }
259
- ),
260
- /* @__PURE__ */ jsx("style", { children: `
2
+ import { createContext, memo, useCallback, useContext, useEffect, useId, useRef, useState } from "react";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import { createPortal } from "react-dom";
5
+ //#region src/react/core/feedback/ConfirmDialog.tsx
6
+ /**
7
+ * @zendir/ui - Confirmation Dialog
8
+ *
9
+ * Convenience wrapper over Dialog for confirm/cancel actions.
10
+ * Provides both a component API and a `useConfirm()` hook for imperative usage.
11
+ *
12
+ * Astro UX Compliance:
13
+ * - Status-based alert colors
14
+ * - Focus trap, escape to close
15
+ * - Primary button on right (Astro convention)
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * // Hook API (imperative)
20
+ * const confirm = useConfirm();
21
+ * const ok = await confirm({
22
+ * title: 'Reset Component',
23
+ * message: 'This will reboot the spacecraft and suspend commands for 120 seconds.',
24
+ * status: 'caution',
25
+ * confirmLabel: 'Reset',
26
+ * destructive: true,
27
+ * });
28
+ * if (ok) doReset();
29
+ *
30
+ * // Component API (declarative)
31
+ * <ConfirmDialog
32
+ * open={isOpen}
33
+ * onClose={() => setOpen(false)}
34
+ * onConfirm={handleReset}
35
+ * title="Delete All Data?"
36
+ * message="This cannot be undone."
37
+ * status="critical"
38
+ * destructive
39
+ * />
40
+ * ```
41
+ */
42
+ var ConfirmDialog = memo(function ConfirmDialog({ open, onClose, onConfirm, title, message, status, confirmLabel = "Confirm", cancelLabel = "Cancel", destructive = false }) {
43
+ const { tokens, theme } = useTheme();
44
+ const isTransparentTheme = theme === "transparent" || theme === "transparent-bold" || theme === "transparent-minimal";
45
+ const dialogRef = useRef(null);
46
+ const confirmRef = useRef(null);
47
+ const previousActiveElement = useRef(null);
48
+ const titleId = useId();
49
+ const messageId = useId();
50
+ const CONFIRM_DIALOG_Z_INDEX = 2147483200;
51
+ useEffect(() => {
52
+ if (!open) return;
53
+ previousActiveElement.current = document.activeElement;
54
+ document.body.style.overflow = "hidden";
55
+ const handleKeyDown = (e) => {
56
+ if (e.key === "Escape") {
57
+ e.preventDefault();
58
+ onClose();
59
+ return;
60
+ }
61
+ if (e.key !== "Tab") return;
62
+ const root = dialogRef.current;
63
+ if (!root) return;
64
+ const focusableElements = root.querySelectorAll("button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])");
65
+ const focusable = Array.from(focusableElements).filter((el) => !el.hasAttribute("disabled"));
66
+ if (focusable.length === 0) return;
67
+ const first = focusable[0];
68
+ const last = focusable[focusable.length - 1];
69
+ const active = document.activeElement;
70
+ if (e.shiftKey && active === first) {
71
+ e.preventDefault();
72
+ last.focus();
73
+ } else if (!e.shiftKey && active === last) {
74
+ e.preventDefault();
75
+ first.focus();
76
+ }
77
+ };
78
+ document.addEventListener("keydown", handleKeyDown);
79
+ const focusTimer = window.setTimeout(() => {
80
+ confirmRef.current?.focus();
81
+ }, 0);
82
+ return () => {
83
+ window.clearTimeout(focusTimer);
84
+ document.removeEventListener("keydown", handleKeyDown);
85
+ document.body.style.overflow = "";
86
+ previousActiveElement.current?.focus();
87
+ };
88
+ }, [open, onClose]);
89
+ if (!open) return null;
90
+ if (typeof document === "undefined") return null;
91
+ const statusColors = {
92
+ normal: tokens.colors.status.normal,
93
+ caution: tokens.colors.status.caution,
94
+ serious: tokens.colors.status.serious,
95
+ critical: tokens.colors.status.critical
96
+ };
97
+ const accentColor = status ? statusColors[status] : tokens.colors.accent.primary;
98
+ const confirmBg = destructive ? tokens.colors.status.critical : tokens.colors.accent.primary;
99
+ const statusIcon = status && (() => {
100
+ const s = 32;
101
+ const innerIcon = /* @__PURE__ */ jsxs("svg", {
102
+ width: "16",
103
+ height: "16",
104
+ viewBox: "0 0 24 24",
105
+ fill: "none",
106
+ stroke: accentColor,
107
+ strokeWidth: "2.5",
108
+ strokeLinecap: "round",
109
+ children: [/* @__PURE__ */ jsx("path", { d: "M12 9v4" }), /* @__PURE__ */ jsx("path", { d: "M12 17h.01" })]
110
+ });
111
+ const baseStyle = {
112
+ width: s,
113
+ height: s,
114
+ display: "flex",
115
+ alignItems: "center",
116
+ justifyContent: "center",
117
+ flexShrink: 0
118
+ };
119
+ switch (status) {
120
+ case "critical": return /* @__PURE__ */ jsx("div", {
121
+ style: {
122
+ ...baseStyle,
123
+ backgroundColor: `${accentColor}20`,
124
+ border: `2px solid ${accentColor}`,
125
+ clipPath: "polygon(50% 0%, 0% 100%, 100% 100%)",
126
+ paddingTop: 8
127
+ },
128
+ children: innerIcon
129
+ });
130
+ case "serious": return /* @__PURE__ */ jsx("div", {
131
+ style: {
132
+ ...baseStyle,
133
+ backgroundColor: `${accentColor}20`,
134
+ border: `2px solid ${accentColor}`,
135
+ transform: "rotate(45deg)"
136
+ },
137
+ children: /* @__PURE__ */ jsx("div", {
138
+ style: { transform: "rotate(-45deg)" },
139
+ children: innerIcon
140
+ })
141
+ });
142
+ case "caution": return /* @__PURE__ */ jsx("div", {
143
+ style: {
144
+ ...baseStyle,
145
+ backgroundColor: `${accentColor}20`,
146
+ border: `2px solid ${accentColor}`,
147
+ borderRadius: "4px"
148
+ },
149
+ children: innerIcon
150
+ });
151
+ default: return /* @__PURE__ */ jsx("div", {
152
+ style: {
153
+ ...baseStyle,
154
+ backgroundColor: `${accentColor}20`,
155
+ border: `2px solid ${accentColor}`,
156
+ borderRadius: "50%"
157
+ },
158
+ children: innerIcon
159
+ });
160
+ }
161
+ })();
162
+ return createPortal(/* @__PURE__ */ jsxs(Fragment, { children: [
163
+ /* @__PURE__ */ jsx("div", {
164
+ style: {
165
+ position: "fixed",
166
+ inset: 0,
167
+ zIndex: CONFIRM_DIALOG_Z_INDEX,
168
+ backgroundColor: isTransparentTheme ? `${tokens.colors.background.base}80` : `${tokens.colors.background.base}B3`,
169
+ backdropFilter: "blur(6px)",
170
+ WebkitBackdropFilter: "blur(6px)",
171
+ animation: `zendir-confirm-backdrop 200ms ${tokens.animation.easing.default}`
172
+ },
173
+ onClick: onClose
174
+ }),
175
+ /* @__PURE__ */ jsxs("div", {
176
+ ref: dialogRef,
177
+ role: "alertdialog",
178
+ "aria-modal": "true",
179
+ "aria-labelledby": titleId,
180
+ "aria-describedby": message ? messageId : void 0,
181
+ onClick: (e) => e.stopPropagation(),
182
+ style: {
183
+ position: "fixed",
184
+ top: "50%",
185
+ left: "50%",
186
+ transform: "translate(-50%, -50%)",
187
+ zIndex: 2147483201,
188
+ width: "100%",
189
+ maxWidth: "min(440px, calc(100vw - 32px))",
190
+ backgroundColor: isTransparentTheme ? "rgba(15, 12, 30, 0.9)" : tokens.colors.background.surface,
191
+ border: `1px solid ${tokens.colors.border.default}`,
192
+ borderRadius: tokens.borderRadius.lg,
193
+ boxShadow: tokens.shadows.xl,
194
+ fontFamily: tokens.typography.fontFamily.primary,
195
+ animation: `zendir-confirm-enter 250ms ${tokens.animation.easing.default}`,
196
+ overflow: "hidden",
197
+ ...isTransparentTheme ? {
198
+ backdropFilter: "blur(20px)",
199
+ WebkitBackdropFilter: "blur(20px)"
200
+ } : {}
201
+ },
202
+ children: [
203
+ status && /* @__PURE__ */ jsx("div", { style: {
204
+ height: 3,
205
+ backgroundColor: accentColor,
206
+ width: "100%"
207
+ } }),
208
+ /* @__PURE__ */ jsx("div", {
209
+ style: { padding: `${tokens.spacing.lg} ${tokens.spacing.lg} ${tokens.spacing.md}` },
210
+ children: /* @__PURE__ */ jsxs("div", {
211
+ style: {
212
+ display: "flex",
213
+ gap: tokens.spacing.md,
214
+ alignItems: "flex-start"
215
+ },
216
+ children: [statusIcon, /* @__PURE__ */ jsxs("div", {
217
+ style: { flex: 1 },
218
+ children: [/* @__PURE__ */ jsx("div", {
219
+ id: titleId,
220
+ style: {
221
+ fontSize: tokens.typography.fontSize.md,
222
+ fontWeight: tokens.typography.fontWeight.semibold,
223
+ color: tokens.colors.text.primary,
224
+ lineHeight: tokens.typography.lineHeight.tight
225
+ },
226
+ children: title
227
+ }), message && /* @__PURE__ */ jsx("div", {
228
+ id: messageId,
229
+ style: {
230
+ fontSize: tokens.typography.fontSize.sm,
231
+ color: tokens.colors.text.secondary,
232
+ marginTop: tokens.spacing.sm,
233
+ lineHeight: tokens.typography.lineHeight.normal
234
+ },
235
+ children: message
236
+ })]
237
+ })]
238
+ })
239
+ }),
240
+ /* @__PURE__ */ jsxs("div", {
241
+ style: {
242
+ display: "flex",
243
+ justifyContent: "flex-end",
244
+ gap: tokens.spacing.sm,
245
+ padding: `${tokens.spacing.md} ${tokens.spacing.lg} ${tokens.spacing.lg}`,
246
+ borderTop: tokens.borders.divider
247
+ },
248
+ children: [/* @__PURE__ */ jsx("button", {
249
+ onClick: onClose,
250
+ style: {
251
+ padding: `0 ${tokens.spacing.md}`,
252
+ minHeight: tokens.elementSize.lg,
253
+ fontSize: tokens.typography.fontSize.sm,
254
+ fontWeight: tokens.typography.fontWeight.medium,
255
+ fontFamily: tokens.typography.fontFamily.primary,
256
+ color: tokens.colors.text.primary,
257
+ backgroundColor: tokens.colors.background.base,
258
+ border: `1px solid ${tokens.colors.border.muted}`,
259
+ borderRadius: tokens.borderRadius.md,
260
+ cursor: "pointer",
261
+ transition: tokens.animation.fast
262
+ },
263
+ children: cancelLabel
264
+ }), /* @__PURE__ */ jsx("button", {
265
+ ref: confirmRef,
266
+ onClick: () => {
267
+ onConfirm();
268
+ onClose();
269
+ },
270
+ style: {
271
+ padding: `0 ${tokens.spacing.md}`,
272
+ minHeight: tokens.elementSize.lg,
273
+ fontSize: tokens.typography.fontSize.sm,
274
+ fontWeight: tokens.typography.fontWeight.semibold,
275
+ fontFamily: tokens.typography.fontFamily.primary,
276
+ color: tokens.colors.text.inverse || "#fff",
277
+ backgroundColor: confirmBg,
278
+ border: "none",
279
+ borderRadius: tokens.borderRadius.md,
280
+ cursor: "pointer",
281
+ transition: tokens.animation.fast,
282
+ boxShadow: `0 2px 8px ${confirmBg}40`
283
+ },
284
+ children: confirmLabel
285
+ })]
286
+ })
287
+ ]
288
+ }),
289
+ /* @__PURE__ */ jsx("style", { children: `
261
290
  @keyframes zendir-confirm-backdrop { from { opacity: 0; } to { opacity: 1; } }
262
291
  @keyframes zendir-confirm-enter {
263
292
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
264
293
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
265
294
  }
266
295
  ` })
267
- ] }), document.body);
296
+ ] }), document.body);
268
297
  });
269
- const ConfirmContext = createContext(null);
298
+ var ConfirmContext = createContext(null);
299
+ /**
300
+ * Imperative confirmation hook.
301
+ * Must be used within `<ConfirmProvider>`.
302
+ *
303
+ * @example
304
+ * ```tsx
305
+ * const confirm = useConfirm();
306
+ * const ok = await confirm({ title: 'Delete?', status: 'critical', destructive: true });
307
+ * ```
308
+ */
270
309
  function useConfirm() {
271
- const ctx = useContext(ConfirmContext);
272
- if (!ctx) throw new Error("useConfirm must be used within <ConfirmProvider>");
273
- return ctx.requestConfirm;
310
+ const ctx = useContext(ConfirmContext);
311
+ if (!ctx) throw new Error("useConfirm must be used within <ConfirmProvider>");
312
+ return ctx.requestConfirm;
274
313
  }
275
- const ConfirmProvider = memo(function ConfirmProvider2({
276
- children
277
- }) {
278
- const [state, setState] = useState(null);
279
- const requestConfirm = useCallback((options) => {
280
- return new Promise((resolve) => {
281
- setState({ ...options, resolve });
282
- });
283
- }, []);
284
- const handleClose = useCallback(() => {
285
- state == null ? void 0 : state.resolve(false);
286
- setState(null);
287
- }, [state]);
288
- const handleConfirm = useCallback(() => {
289
- state == null ? void 0 : state.resolve(true);
290
- setState(null);
291
- }, [state]);
292
- return /* @__PURE__ */ jsxs(ConfirmContext.Provider, { value: { requestConfirm }, children: [
293
- children,
294
- state && /* @__PURE__ */ jsx(
295
- ConfirmDialog,
296
- {
297
- open: true,
298
- onClose: handleClose,
299
- onConfirm: handleConfirm,
300
- title: state.title,
301
- message: state.message,
302
- status: state.status,
303
- confirmLabel: state.confirmLabel,
304
- cancelLabel: state.cancelLabel,
305
- destructive: state.destructive
306
- }
307
- )
308
- ] });
314
+ /**
315
+ * Provider for the useConfirm() hook.
316
+ * Renders the confirmation dialog as needed.
317
+ */
318
+ var ConfirmProvider = memo(function ConfirmProvider({ children }) {
319
+ const [state, setState] = useState(null);
320
+ const requestConfirm = useCallback((options) => {
321
+ return new Promise((resolve) => {
322
+ setState({
323
+ ...options,
324
+ resolve
325
+ });
326
+ });
327
+ }, []);
328
+ const handleClose = useCallback(() => {
329
+ state?.resolve(false);
330
+ setState(null);
331
+ }, [state]);
332
+ const handleConfirm = useCallback(() => {
333
+ state?.resolve(true);
334
+ setState(null);
335
+ }, [state]);
336
+ return /* @__PURE__ */ jsxs(ConfirmContext.Provider, {
337
+ value: { requestConfirm },
338
+ children: [children, state && /* @__PURE__ */ jsx(ConfirmDialog, {
339
+ open: true,
340
+ onClose: handleClose,
341
+ onConfirm: handleConfirm,
342
+ title: state.title,
343
+ message: state.message,
344
+ status: state.status,
345
+ confirmLabel: state.confirmLabel,
346
+ cancelLabel: state.cancelLabel,
347
+ destructive: state.destructive
348
+ })]
349
+ });
309
350
  });
310
- export {
311
- ConfirmDialog,
312
- ConfirmProvider,
313
- useConfirm
314
- };
315
- //# sourceMappingURL=ConfirmDialog.js.map
351
+ //#endregion
352
+ export { ConfirmDialog, ConfirmDialog as default, ConfirmProvider, useConfirm };
353
+
354
+ //# sourceMappingURL=ConfirmDialog.js.map