@zendir/ui 0.4.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/README.md +640 -631
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/index.js +17 -221
- package/dist/react/3d/CesiumCaptureSource.d.ts +0 -1
- package/dist/react/3d/CesiumCaptureSource.js +364 -283
- package/dist/react/3d/CesiumCaptureSource.js.map +1 -1
- package/dist/react/3d/ZenSpace3D.d.ts +2 -3
- package/dist/react/3d/ZenSpace3D.js +1681 -1237
- package/dist/react/3d/ZenSpace3D.js.map +1 -1
- package/dist/react/3d/ZenSpace3DCesium.d.ts +0 -1
- package/dist/react/3d/ZenSpace3DCesium.js +513 -560
- package/dist/react/3d/ZenSpace3DCesium.js.map +1 -1
- package/dist/react/3d/ZenSpace3DShaders.js +61 -66
- package/dist/react/3d/ZenSpace3DShaders.js.map +1 -1
- package/dist/react/3d/ZenSpace3DTypes.d.ts +19 -20
- package/dist/react/3d/ZenSpace3DUtils.d.ts +0 -1
- package/dist/react/3d/ZenSpace3DUtils.js +37 -24
- package/dist/react/3d/ZenSpace3DUtils.js.map +1 -1
- package/dist/react/3d/capturePngAnalysis.js +42 -36
- package/dist/react/3d/capturePngAnalysis.js.map +1 -1
- package/dist/react/3d/index.d.ts +3 -3
- package/dist/react/3d/index.js +5 -53
- package/dist/react/3d/threeLoader.d.ts +1 -1
- package/dist/react/3d/threeLoader.js +23 -18
- package/dist/react/3d/threeLoader.js.map +1 -1
- package/dist/react/astro/ClassificationBanner.d.ts +2 -3
- package/dist/react/astro/ClassificationBanner.js +95 -79
- package/dist/react/astro/ClassificationBanner.js.map +1 -1
- package/dist/react/astro/GlobalStatusBar.d.ts +0 -1
- package/dist/react/astro/GlobalStatusBar.js +157 -163
- package/dist/react/astro/GlobalStatusBar.js.map +1 -1
- package/dist/react/astro/MissionClock.d.ts +7 -8
- package/dist/react/astro/MissionClock.js +377 -400
- package/dist/react/astro/MissionClock.js.map +1 -1
- package/dist/react/astro/MonitoringIcon.d.ts +1 -2
- package/dist/react/astro/MonitoringIcon.js +422 -358
- package/dist/react/astro/MonitoringIcon.js.map +1 -1
- package/dist/react/astro/Notification.d.ts +1 -2
- package/dist/react/astro/Notification.js +229 -126
- package/dist/react/astro/Notification.js.map +1 -1
- package/dist/react/astro/Progress.d.ts +0 -1
- package/dist/react/astro/Progress.js +199 -141
- package/dist/react/astro/Progress.js.map +1 -1
- package/dist/react/astro/SimulationControls.d.ts +3 -4
- package/dist/react/astro/SimulationControls.js +596 -650
- package/dist/react/astro/SimulationControls.js.map +1 -1
- package/dist/react/astro/StatusIndicator.d.ts +0 -1
- package/dist/react/astro/StatusIndicator.js +236 -170
- package/dist/react/astro/StatusIndicator.js.map +1 -1
- package/dist/react/astro/UnifiedTimeline.d.ts +9 -10
- package/dist/react/astro/UnifiedTimeline.js +2345 -2392
- package/dist/react/astro/UnifiedTimeline.js.map +1 -1
- package/dist/react/astro/index.d.ts +5 -5
- package/dist/react/astro/index.js +1 -25
- package/dist/react/cards/AccessCard.d.ts +0 -1
- package/dist/react/cards/AccessCard.js +471 -405
- package/dist/react/cards/AccessCard.js.map +1 -1
- package/dist/react/cards/OrbitCard.d.ts +0 -1
- package/dist/react/cards/OrbitCard.js +487 -364
- package/dist/react/cards/OrbitCard.js.map +1 -1
- package/dist/react/cards/SpacecraftCard.d.ts +0 -1
- package/dist/react/cards/SpacecraftCard.js +813 -925
- package/dist/react/cards/SpacecraftCard.js.map +1 -1
- package/dist/react/cards/TelemetryCard.d.ts +0 -1
- package/dist/react/cards/TelemetryCard.js +1055 -732
- package/dist/react/cards/TelemetryCard.js.map +1 -1
- package/dist/react/cards/TelemetryStreamCard.d.ts +0 -1
- package/dist/react/cards/TelemetryStreamCard.js +323 -297
- package/dist/react/cards/TelemetryStreamCard.js.map +1 -1
- package/dist/react/cards/index.d.ts +1 -1
- package/dist/react/cards/index.js +1 -8
- package/dist/react/charts/GroundTrackMap.d.ts +6 -7
- package/dist/react/charts/GroundTrackMap.js +1377 -1256
- package/dist/react/charts/GroundTrackMap.js.map +1 -1
- package/dist/react/charts/GroundTrackMapLeaflet.d.ts +1 -2
- package/dist/react/charts/GroundTrackMapLeaflet.js +1065 -987
- package/dist/react/charts/GroundTrackMapLeaflet.js.map +1 -1
- package/dist/react/charts/groundTrackMapLeafletTiles.js +34 -25
- package/dist/react/charts/groundTrackMapLeafletTiles.js.map +1 -1
- package/dist/react/charts/groundTrackMapLeafletUtils.js +70 -61
- package/dist/react/charts/groundTrackMapLeafletUtils.js.map +1 -1
- package/dist/react/charts/index.d.ts +1 -1
- package/dist/react/charts/index.js +7 -100
- package/dist/react/charts/unified/AstroChart.d.ts +1 -2
- package/dist/react/charts/unified/AstroChart.js +1331 -1411
- package/dist/react/charts/unified/AstroChart.js.map +1 -1
- package/dist/react/charts/unified/PowerOverviewChart.d.ts +3 -3
- package/dist/react/charts/unified/PowerOverviewChart.js +495 -478
- package/dist/react/charts/unified/PowerOverviewChart.js.map +1 -1
- package/dist/react/charts/unified/domain.d.ts +12 -13
- package/dist/react/charts/unified/domain.js +3999 -3145
- package/dist/react/charts/unified/domain.js.map +1 -1
- package/dist/react/charts/unified/generators.d.ts +3 -4
- package/dist/react/charts/unified/generators.js +561 -498
- package/dist/react/charts/unified/generators.js.map +1 -1
- package/dist/react/charts/unified/index.d.ts +1 -1
- package/dist/react/charts/unified/presets.d.ts +14 -15
- package/dist/react/charts/unified/presets.js +857 -994
- package/dist/react/charts/unified/presets.js.map +1 -1
- package/dist/react/charts/unified/sync.d.ts +2 -3
- package/dist/react/charts/unified/sync.js +229 -195
- package/dist/react/charts/unified/sync.js.map +1 -1
- package/dist/react/charts/unified/theme.d.ts +11 -12
- package/dist/react/charts/unified/theme.js +606 -642
- package/dist/react/charts/unified/theme.js.map +1 -1
- package/dist/react/charts/unified/types.d.ts +32 -33
- package/dist/react/charts/unified/useChartStream.d.ts +1 -2
- package/dist/react/charts/unified/useChartStream.js +203 -216
- package/dist/react/charts/unified/useChartStream.js.map +1 -1
- package/dist/react/chatgpt/AppCard.d.ts +1 -2
- package/dist/react/chatgpt/index.d.ts +7 -7
- package/dist/react/chatgpt/index.js +160 -139
- package/dist/react/chatgpt/index.js.map +1 -1
- package/dist/react/context/CategoryContext.d.ts +0 -1
- package/dist/react/context/CategoryContext.js +78 -29
- package/dist/react/context/CategoryContext.js.map +1 -1
- package/dist/react/context/DisplaySettingsContext.d.ts +1 -2
- package/dist/react/context/DisplaySettingsContext.js +205 -156
- package/dist/react/context/DisplaySettingsContext.js.map +1 -1
- package/dist/react/context/SpatialSelectionContext.d.ts +0 -1
- package/dist/react/context/SpatialSelectionContext.js +36 -7
- package/dist/react/context/SpatialSelectionContext.js.map +1 -1
- package/dist/react/core/data/DataTable.d.ts +3 -4
- package/dist/react/core/data/DataTable.js +473 -440
- package/dist/react/core/data/DataTable.js.map +1 -1
- package/dist/react/core/data/DataValue.d.ts +4 -5
- package/dist/react/core/data/DataValue.js +605 -538
- package/dist/react/core/data/DataValue.js.map +1 -1
- package/dist/react/core/data/propertyConfig.d.ts +1 -2
- package/dist/react/core/data/propertyConfig.js +446 -382
- package/dist/react/core/data/propertyConfig.js.map +1 -1
- package/dist/react/core/display/AstroIcon.d.ts +4 -5
- package/dist/react/core/display/AstroIcon.js +339 -429
- package/dist/react/core/display/AstroIcon.js.map +1 -1
- package/dist/react/core/display/Badge.d.ts +2 -3
- package/dist/react/core/display/Badge.js +131 -131
- package/dist/react/core/display/Badge.js.map +1 -1
- package/dist/react/core/display/CardHeader.d.ts +0 -1
- package/dist/react/core/display/CardHeader.js +398 -311
- package/dist/react/core/display/CardHeader.js.map +1 -1
- package/dist/react/core/display/Container.d.ts +2 -3
- package/dist/react/core/display/Container.js +640 -668
- package/dist/react/core/display/Container.js.map +1 -1
- package/dist/react/core/display/CopyButton.d.ts +1 -2
- package/dist/react/core/display/CopyButton.js +158 -101
- package/dist/react/core/display/CopyButton.js.map +1 -1
- package/dist/react/core/display/GlassCard.d.ts +3 -4
- package/dist/react/core/display/GlassCard.js +416 -369
- package/dist/react/core/display/GlassCard.js.map +1 -1
- package/dist/react/core/display/HeaderIconWithStatus.d.ts +0 -1
- package/dist/react/core/display/HeaderIconWithStatus.js +152 -152
- package/dist/react/core/display/HeaderIconWithStatus.js.map +1 -1
- package/dist/react/core/display/Icon.d.ts +2 -3
- package/dist/react/core/display/Icon.js +172 -143
- package/dist/react/core/display/Icon.js.map +1 -1
- package/dist/react/core/display/Typography.d.ts +24 -25
- package/dist/react/core/display/Typography.js +360 -178
- package/dist/react/core/display/Typography.js.map +1 -1
- package/dist/react/core/feedback/ConfirmDialog.d.ts +1 -2
- package/dist/react/core/feedback/ConfirmDialog.js +343 -304
- package/dist/react/core/feedback/ConfirmDialog.js.map +1 -1
- package/dist/react/core/feedback/Dialog.d.ts +2 -3
- package/dist/react/core/feedback/Dialog.js +189 -197
- package/dist/react/core/feedback/Dialog.js.map +1 -1
- package/dist/react/core/feedback/Toast.d.ts +2 -3
- package/dist/react/core/feedback/Toast.js +346 -207
- package/dist/react/core/feedback/Toast.js.map +1 -1
- package/dist/react/core/index.d.ts +26 -26
- package/dist/react/core/index.js +7 -119
- package/dist/react/core/inputs/Button.d.ts +2 -3
- package/dist/react/core/inputs/Button.js +281 -304
- package/dist/react/core/inputs/Button.js.map +1 -1
- package/dist/react/core/inputs/Checkbox.d.ts +2 -3
- package/dist/react/core/inputs/Checkbox.js +139 -127
- package/dist/react/core/inputs/Checkbox.js.map +1 -1
- package/dist/react/core/inputs/Input.d.ts +3 -4
- package/dist/react/core/inputs/Input.js +277 -285
- package/dist/react/core/inputs/Input.js.map +1 -1
- package/dist/react/core/inputs/LimitsBar.d.ts +1 -2
- package/dist/react/core/inputs/LimitsBar.js +271 -196
- package/dist/react/core/inputs/LimitsBar.js.map +1 -1
- package/dist/react/core/inputs/NumberInput.d.ts +2 -3
- package/dist/react/core/inputs/NumberInput.js +531 -503
- package/dist/react/core/inputs/NumberInput.js.map +1 -1
- package/dist/react/core/inputs/PinInput.d.ts +2 -3
- package/dist/react/core/inputs/PinInput.js +224 -207
- package/dist/react/core/inputs/PinInput.js.map +1 -1
- package/dist/react/core/inputs/Select.d.ts +1 -2
- package/dist/react/core/inputs/Select.js +298 -299
- package/dist/react/core/inputs/Select.js.map +1 -1
- package/dist/react/core/inputs/Toggle.d.ts +2 -3
- package/dist/react/core/inputs/Toggle.js +142 -148
- package/dist/react/core/inputs/Toggle.js.map +1 -1
- package/dist/react/core/layout/Box.d.ts +3 -4
- package/dist/react/core/layout/Box.js +118 -122
- package/dist/react/core/layout/Box.js.map +1 -1
- package/dist/react/core/layout/Center.d.ts +0 -1
- package/dist/react/core/layout/Center.js +45 -32
- package/dist/react/core/layout/Center.js.map +1 -1
- package/dist/react/core/layout/Divider.d.ts +1 -2
- package/dist/react/core/layout/Divider.js +112 -106
- package/dist/react/core/layout/Divider.js.map +1 -1
- package/dist/react/core/layout/Flex.d.ts +4 -5
- package/dist/react/core/layout/Flex.js +120 -124
- package/dist/react/core/layout/Flex.js.map +1 -1
- package/dist/react/core/layout/Grid.d.ts +5 -6
- package/dist/react/core/layout/Grid.js +131 -138
- package/dist/react/core/layout/Grid.js.map +1 -1
- package/dist/react/core/layout/Spacer.d.ts +0 -1
- package/dist/react/core/layout/Spacer.js +36 -29
- package/dist/react/core/layout/Spacer.js.map +1 -1
- package/dist/react/core/layout/Stack.d.ts +4 -5
- package/dist/react/core/layout/Stack.js +127 -70
- package/dist/react/core/layout/Stack.js.map +1 -1
- package/dist/react/core/layout/responsive.d.ts +1 -2
- package/dist/react/core/layout/responsive.js +25 -19
- package/dist/react/core/layout/responsive.js.map +1 -1
- package/dist/react/core/layout/useBreakpoint.d.ts +1 -1
- package/dist/react/core/layout/useBreakpoint.js +119 -66
- package/dist/react/core/layout/useBreakpoint.js.map +1 -1
- package/dist/react/core/navigation/AppBar.d.ts +1 -2
- package/dist/react/core/navigation/AppBar.js +827 -805
- package/dist/react/core/navigation/AppBar.js.map +1 -1
- package/dist/react/core/navigation/Pagination.d.ts +2 -3
- package/dist/react/core/navigation/Pagination.js +207 -187
- package/dist/react/core/navigation/Pagination.js.map +1 -1
- package/dist/react/core/navigation/SideNav.d.ts +11 -5
- package/dist/react/core/navigation/SideNav.js +857 -602
- package/dist/react/core/navigation/SideNav.js.map +1 -1
- package/dist/react/core/navigation/Tabs.d.ts +0 -1
- package/dist/react/core/navigation/Tabs.js +113 -119
- package/dist/react/core/navigation/Tabs.js.map +1 -1
- package/dist/react/core/overlays/Popover.d.ts +2 -3
- package/dist/react/core/overlays/Popover.js +303 -282
- package/dist/react/core/overlays/Popover.js.map +1 -1
- package/dist/react/core/overlays/SidePanel.d.ts +1 -2
- package/dist/react/core/overlays/SidePanel.js +217 -212
- package/dist/react/core/overlays/SidePanel.js.map +1 -1
- package/dist/react/core/overlays/Tooltip.d.ts +1 -2
- package/dist/react/core/overlays/Tooltip.js +170 -176
- package/dist/react/core/overlays/Tooltip.js.map +1 -1
- package/dist/react/core/widgets/ActivityPlanner.d.ts +0 -1
- package/dist/react/core/widgets/ActivityPlanner.js +855 -517
- package/dist/react/core/widgets/ActivityPlanner.js.map +1 -1
- package/dist/react/core/widgets/Capture.d.ts +2 -3
- package/dist/react/core/widgets/Capture.js +965 -779
- package/dist/react/core/widgets/Capture.js.map +1 -1
- package/dist/react/core/widgets/ChatPanel.d.ts +16 -17
- package/dist/react/core/widgets/ChatPanel.js +1734 -1034
- package/dist/react/core/widgets/ChatPanel.js.map +1 -1
- package/dist/react/core/widgets/ColorPickerPanel.d.ts +0 -1
- package/dist/react/core/widgets/ColorPickerPanel.js +298 -287
- package/dist/react/core/widgets/ColorPickerPanel.js.map +1 -1
- package/dist/react/core/widgets/CommandBuilder.d.ts +2 -3
- package/dist/react/core/widgets/CommandBuilder.js +624 -516
- package/dist/react/core/widgets/CommandBuilder.js.map +1 -1
- package/dist/react/core/widgets/ConnectionForm.d.ts +2 -3
- package/dist/react/core/widgets/ConnectionForm.js +528 -492
- package/dist/react/core/widgets/ConnectionForm.js.map +1 -1
- package/dist/react/core/widgets/FileExplorer.d.ts +3 -4
- package/dist/react/core/widgets/FileExplorer.js +617 -505
- package/dist/react/core/widgets/FileExplorer.js.map +1 -1
- package/dist/react/core/widgets/HexViewer.d.ts +2 -3
- package/dist/react/core/widgets/HexViewer.js +1353 -1091
- package/dist/react/core/widgets/HexViewer.js.map +1 -1
- package/dist/react/core/widgets/ImageFrame.d.ts +1 -2
- package/dist/react/core/widgets/ImageFrame.js +230 -193
- package/dist/react/core/widgets/ImageFrame.js.map +1 -1
- package/dist/react/core/widgets/ImageGallery.d.ts +2 -1
- package/dist/react/core/widgets/ImageGallery.js +380 -314
- package/dist/react/core/widgets/ImageGallery.js.map +1 -1
- package/dist/react/core/widgets/ImagePanel.d.ts +0 -1
- package/dist/react/core/widgets/ImagePanel.js +110 -101
- package/dist/react/core/widgets/ImagePanel.js.map +1 -1
- package/dist/react/core/widgets/LogViewer.d.ts +2 -3
- package/dist/react/core/widgets/LogViewer.js +711 -607
- package/dist/react/core/widgets/LogViewer.js.map +1 -1
- package/dist/react/core/widgets/MessageStream.d.ts +3 -4
- package/dist/react/core/widgets/MessageStream.js +514 -444
- package/dist/react/core/widgets/MessageStream.js.map +1 -1
- package/dist/react/core/widgets/MissionCalendar.d.ts +3 -4
- package/dist/react/core/widgets/MissionCalendar.js +1488 -1020
- package/dist/react/core/widgets/MissionCalendar.js.map +1 -1
- package/dist/react/core/widgets/PacketViewer.d.ts +2 -3
- package/dist/react/core/widgets/PacketViewer.js +550 -421
- package/dist/react/core/widgets/PacketViewer.js.map +1 -1
- package/dist/react/core/widgets/capture-placeholder.png.js +6 -5
- package/dist/react/core/widgets/capture-placeholder.png.js.map +1 -1
- package/dist/react/hooks/index.d.ts +5 -5
- package/dist/react/hooks/useAccessWindows.d.ts +0 -1
- package/dist/react/hooks/useCompactMode.d.ts +1 -1
- package/dist/react/hooks/useCompactMode.js +104 -58
- package/dist/react/hooks/useCompactMode.js.map +1 -1
- package/dist/react/hooks/useGroundTrackHistory.d.ts +0 -1
- package/dist/react/hooks/useSimulationScene.d.ts +1 -2
- package/dist/react/hooks/useSimulationScene.js +481 -374
- package/dist/react/hooks/useSimulationScene.js.map +1 -1
- package/dist/react/index.d.ts +3 -3
- package/dist/react/panels/LayerControlPanel.d.ts +1 -2
- package/dist/react/panels/LayerControlPanel.js +223 -180
- package/dist/react/panels/LayerControlPanel.js.map +1 -1
- package/dist/react/panels/ObjectInventoryPanel.d.ts +2 -3
- package/dist/react/panels/ObjectInventoryPanel.js +315 -250
- package/dist/react/panels/ObjectInventoryPanel.js.map +1 -1
- package/dist/react/panels/index.d.ts +1 -1
- package/dist/react/panels/index.js +1 -6
- package/dist/react/shared/ErrorBoundary.d.ts +1 -2
- package/dist/react/shared/ErrorBoundary.js +170 -139
- package/dist/react/shared/ErrorBoundary.js.map +1 -1
- package/dist/react/shared/Skeleton.d.ts +1 -2
- package/dist/react/shared/Skeleton.js +300 -301
- package/dist/react/shared/Skeleton.js.map +1 -1
- package/dist/react/theme/ThemeProvider.d.ts +2 -321
- package/dist/react/theme/ThemeProvider.js +312 -939
- package/dist/react/theme/ThemeProvider.js.map +1 -1
- package/dist/react/theme/cardAccent.d.ts +1 -2
- package/dist/react/theme/cardAccent.js +196 -126
- package/dist/react/theme/cardAccent.js.map +1 -1
- package/dist/react/theme/config.d.ts +0 -1
- package/dist/react/theme/config.js +47 -25
- package/dist/react/theme/config.js.map +1 -1
- package/dist/react/theme/index.d.ts +2 -2
- package/dist/react/theme/index.js +1 -16
- package/dist/react/theme/types.d.ts +332 -0
- package/dist/react/theme/types.js +39 -0
- package/dist/react/theme/types.js.map +1 -0
- package/dist/react/types.d.ts +8 -8
- package/dist/react/types.js +147 -47
- package/dist/react/types.js.map +1 -1
- package/dist/react/utils/categoryPalette.d.ts +0 -1
- package/dist/react/utils/categoryPalette.js +91 -102
- package/dist/react/utils/categoryPalette.js.map +1 -1
- package/dist/react/utils/index.d.ts +5 -5
- package/dist/react/utils/index.js +457 -371
- package/dist/react/utils/index.js.map +1 -1
- package/dist/react/visualizations/EclipseTimerCard.d.ts +0 -1
- package/dist/react/visualizations/LinkBudgetCard.d.ts +0 -1
- package/dist/react/visualizations/NavBallCard.d.ts +0 -1
- package/dist/react/visualizations/PropulsionCard.d.ts +1 -2
- package/dist/react/visualizations/SensorFootprintCard.d.ts +1 -2
- package/dist/react/visualizations/ThermalHeatmapCard.d.ts +0 -1
- package/dist/react/visualizations/index.d.ts +3 -3
- package/dist/react.d.ts +2 -1
- package/dist/react.js +17 -221
- package/dist/shaders/atmosphere.frag.js +6 -5
- package/dist/shaders/atmosphere.frag.js.map +1 -1
- package/dist/shaders/atmosphere.vert.js +6 -5
- package/dist/shaders/atmosphere.vert.js.map +1 -1
- package/dist/shaders/stars.frag.js +6 -5
- package/dist/shaders/stars.frag.js.map +1 -1
- package/dist/shaders/stars.vert.js +6 -5
- package/dist/shaders/stars.vert.js.map +1 -1
- package/dist/style.css +217 -194
- package/dist/tokens/core.d.ts +159 -0
- package/dist/tokens/core.js +144 -0
- package/dist/tokens/core.js.map +1 -0
- package/dist/tokens/css-vars.d.ts +213 -2
- package/dist/tokens/css-vars.js +590 -227
- package/dist/tokens/css-vars.js.map +1 -1
- package/dist/tokens/index.d.ts +31 -228
- package/dist/tokens/index.js +281 -366
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/palettes/astro.d.ts +129 -0
- package/dist/tokens/palettes/astro.js +112 -0
- package/dist/tokens/palettes/astro.js.map +1 -0
- package/dist/tokens/palettes/index.d.ts +288 -0
- package/dist/tokens/palettes/index.js +35 -0
- package/dist/tokens/palettes/index.js.map +1 -0
- package/dist/tokens/palettes/tailwind.d.ts +324 -0
- package/dist/tokens/palettes/tailwind.js +201 -0
- package/dist/tokens/palettes/tailwind.js.map +1 -0
- package/dist/tokens/palettes/zendir.d.ts +126 -0
- package/dist/tokens/palettes/zendir.js +92 -0
- package/dist/tokens/palettes/zendir.js.map +1 -0
- package/dist/tokens/themes.d.ts +30 -0
- package/dist/tokens/themes.js +704 -0
- package/dist/tokens/themes.js.map +1 -0
- package/dist/tokens/tokens.css +419 -41
- package/dist/types/index.d.ts +2 -2
- package/package.json +310 -313
- package/dist/index.js.map +0 -1
- package/dist/react/3d/index.js.map +0 -1
- package/dist/react/astro/index.js.map +0 -1
- package/dist/react/cards/index.js.map +0 -1
- package/dist/react/charts/index.js.map +0 -1
- package/dist/react/core/index.js.map +0 -1
- package/dist/react/panels/index.js.map +0 -1
- package/dist/react/theme/astro-tokens.d.ts +0 -153
- package/dist/react/theme/index.js.map +0 -1
- package/dist/react.js.map +0 -1
|
@@ -1,496 +1,532 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { memo, useMemo, useId, useRef, useState, useEffect, useCallback } from "react";
|
|
3
1
|
import { useTheme } from "../../theme/ThemeProvider.js";
|
|
4
2
|
import { useBreakpoint } from "../layout/useBreakpoint.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
import { memo, useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/react/core/widgets/ConnectionForm.tsx
|
|
6
|
+
/**
|
|
7
|
+
* @zendir/ui - ConnectionForm Component
|
|
8
|
+
*
|
|
9
|
+
* MQTT/WebSocket connection form with URL composition, recent connections,
|
|
10
|
+
* URL parameter sharing, and persistence. Tailored for operator dashboards
|
|
11
|
+
* that require broker configuration (host, port, protocol, credentials).
|
|
12
|
+
*
|
|
13
|
+
* Astro UX Compliance:
|
|
14
|
+
* - Status indicators for connection state (connected/disconnected/error)
|
|
15
|
+
* - Form validation with clear error states
|
|
16
|
+
* - Keyboard shortcut for quick connect (Ctrl+Enter)
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <ConnectionForm
|
|
21
|
+
* onConnect={(config) => client.connect(config)}
|
|
22
|
+
* onDisconnect={() => client.disconnect()}
|
|
23
|
+
* connected={isConnected}
|
|
24
|
+
* defaultProtocol="wss"
|
|
25
|
+
* showAdvanced
|
|
26
|
+
* />
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
var PROTOCOLS = [
|
|
30
|
+
"wss",
|
|
31
|
+
"ws",
|
|
32
|
+
"mqtts",
|
|
33
|
+
"mqtt",
|
|
34
|
+
"tcp"
|
|
35
|
+
];
|
|
36
|
+
var DEFAULT_PORTS = {
|
|
37
|
+
ws: 80,
|
|
38
|
+
wss: 443,
|
|
39
|
+
mqtt: 1883,
|
|
40
|
+
mqtts: 8883,
|
|
41
|
+
tcp: 1883
|
|
12
42
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
43
|
+
var ConnectionForm = memo(function ConnectionForm({ onConnect, onDisconnect, connected = false, connecting = false, defaultProtocol = "wss", defaultHost = "localhost", defaultPort, defaultPath = "/mqtt", showAdvanced = false, persistKey, parseUrlParams = false, error, compact = false, style, labelPlacement = "outlined" }) {
|
|
44
|
+
const { tokens } = useTheme();
|
|
45
|
+
const { isMobile } = useBreakpoint();
|
|
46
|
+
const isOutlined = labelPlacement === "outlined";
|
|
47
|
+
const initialConfig = useMemo(() => {
|
|
48
|
+
if (persistKey) try {
|
|
49
|
+
const saved = localStorage.getItem(persistKey);
|
|
50
|
+
if (saved) return JSON.parse(saved);
|
|
51
|
+
} catch {}
|
|
52
|
+
if (parseUrlParams && typeof window !== "undefined") {
|
|
53
|
+
const params = new URLSearchParams(window.location.search);
|
|
54
|
+
if (params.has("host")) return {
|
|
55
|
+
host: params.get("host") || defaultHost,
|
|
56
|
+
port: parseInt(params.get("port") || String(defaultPort || DEFAULT_PORTS[defaultProtocol])),
|
|
57
|
+
protocol: params.get("protocol") || defaultProtocol,
|
|
58
|
+
path: params.get("path") || defaultPath,
|
|
59
|
+
username: params.get("username") || "",
|
|
60
|
+
password: params.get("password") || "",
|
|
61
|
+
clientId: params.get("clientId") || ""
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
host: defaultHost,
|
|
66
|
+
port: defaultPort || DEFAULT_PORTS[defaultProtocol],
|
|
67
|
+
protocol: defaultProtocol,
|
|
68
|
+
path: defaultPath,
|
|
69
|
+
username: "",
|
|
70
|
+
password: "",
|
|
71
|
+
clientId: ""
|
|
72
|
+
};
|
|
73
|
+
}, []);
|
|
74
|
+
const baseId = useId();
|
|
75
|
+
const passwordInputRef = useRef(null);
|
|
76
|
+
const usernameInputRef = useRef(null);
|
|
77
|
+
const [config, setConfig] = useState(initialConfig);
|
|
78
|
+
const [showAdv, setShowAdv] = useState(showAdvanced);
|
|
79
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (persistKey) try {
|
|
82
|
+
localStorage.setItem(persistKey, JSON.stringify(config));
|
|
83
|
+
} catch {}
|
|
84
|
+
}, [config, persistKey]);
|
|
85
|
+
const updateField = useCallback((key, value) => {
|
|
86
|
+
setConfig((prev) => ({
|
|
87
|
+
...prev,
|
|
88
|
+
[key]: value
|
|
89
|
+
}));
|
|
90
|
+
}, []);
|
|
91
|
+
const handleProtocolChange = useCallback((protocol) => {
|
|
92
|
+
setConfig((prev) => ({
|
|
93
|
+
...prev,
|
|
94
|
+
protocol,
|
|
95
|
+
port: prev.port === DEFAULT_PORTS[prev.protocol] ? DEFAULT_PORTS[protocol] : prev.port
|
|
96
|
+
}));
|
|
97
|
+
}, []);
|
|
98
|
+
const handleSubmit = useCallback((e) => {
|
|
99
|
+
e.preventDefault();
|
|
100
|
+
if (!connected) onConnect(config);
|
|
101
|
+
else onDisconnect?.();
|
|
102
|
+
}, [
|
|
103
|
+
config,
|
|
104
|
+
connected,
|
|
105
|
+
onConnect,
|
|
106
|
+
onDisconnect
|
|
107
|
+
]);
|
|
108
|
+
const getShareUrl = useCallback(() => {
|
|
109
|
+
return `${window.location.origin + window.location.pathname}?${new URLSearchParams({
|
|
110
|
+
host: config.host,
|
|
111
|
+
port: String(config.port),
|
|
112
|
+
protocol: config.protocol,
|
|
113
|
+
...config.path ? { path: config.path } : {}
|
|
114
|
+
}).toString()}`;
|
|
115
|
+
}, [config]);
|
|
116
|
+
const fullUrl = `${config.protocol}://${config.host}:${config.port}${config.path || ""}`;
|
|
117
|
+
const inputStyle = {
|
|
118
|
+
width: "100%",
|
|
119
|
+
minHeight: compact ? 32 : 40,
|
|
120
|
+
padding: compact ? `6px ${tokens.spacing.sm}` : `${tokens.spacing.sm} ${tokens.spacing.md}`,
|
|
121
|
+
fontSize: tokens.typography.fontSize.sm,
|
|
122
|
+
fontFamily: tokens.typography.fontFamily.primary,
|
|
123
|
+
color: tokens.colors.text.primary,
|
|
124
|
+
backgroundColor: tokens.colors.background.base,
|
|
125
|
+
border: `1px solid ${tokens.colors.border.default}`,
|
|
126
|
+
borderRadius: tokens.borderRadius.md,
|
|
127
|
+
outline: "none",
|
|
128
|
+
transition: tokens.animation.fast,
|
|
129
|
+
boxSizing: "border-box"
|
|
130
|
+
};
|
|
131
|
+
const labelStyle = isOutlined ? {
|
|
132
|
+
position: "absolute",
|
|
133
|
+
top: 0,
|
|
134
|
+
left: "10px",
|
|
135
|
+
transform: "translateY(-50%)",
|
|
136
|
+
backgroundColor: tokens.colors.background.base,
|
|
137
|
+
padding: "0 5px",
|
|
138
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
139
|
+
fontWeight: tokens.typography.fontWeight.medium,
|
|
140
|
+
color: tokens.colors.text.tertiary,
|
|
141
|
+
textTransform: "uppercase",
|
|
142
|
+
letterSpacing: "0.04em",
|
|
143
|
+
zIndex: 1,
|
|
144
|
+
pointerEvents: "none",
|
|
145
|
+
lineHeight: 1.2,
|
|
146
|
+
whiteSpace: "nowrap"
|
|
147
|
+
} : {
|
|
148
|
+
display: "block",
|
|
149
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
150
|
+
fontWeight: tokens.typography.fontWeight.medium,
|
|
151
|
+
color: tokens.colors.text.tertiary,
|
|
152
|
+
marginBottom: "4px",
|
|
153
|
+
textTransform: "uppercase",
|
|
154
|
+
letterSpacing: "0.04em"
|
|
155
|
+
};
|
|
156
|
+
const fieldWrapperStyle = isOutlined ? { position: "relative" } : {};
|
|
157
|
+
const statusColor = connected ? tokens.colors.status.normal : error ? tokens.colors.status.critical : tokens.colors.status.off;
|
|
158
|
+
return /* @__PURE__ */ jsxs("form", {
|
|
159
|
+
onSubmit: handleSubmit,
|
|
160
|
+
"aria-label": "Connection configuration",
|
|
161
|
+
style: {
|
|
162
|
+
fontFamily: tokens.typography.fontFamily.primary,
|
|
163
|
+
...style
|
|
164
|
+
},
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ jsxs("div", {
|
|
167
|
+
"aria-live": "polite",
|
|
168
|
+
style: {
|
|
169
|
+
display: "flex",
|
|
170
|
+
alignItems: "center",
|
|
171
|
+
gap: tokens.spacing.sm,
|
|
172
|
+
flexWrap: "wrap",
|
|
173
|
+
marginBottom: tokens.spacing.md
|
|
174
|
+
},
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ jsx("div", { style: {
|
|
177
|
+
width: 8,
|
|
178
|
+
height: 8,
|
|
179
|
+
borderRadius: "50%",
|
|
180
|
+
backgroundColor: statusColor,
|
|
181
|
+
boxShadow: connected ? `0 0 6px ${statusColor}` : "none",
|
|
182
|
+
transition: tokens.animation.fast
|
|
183
|
+
} }),
|
|
184
|
+
/* @__PURE__ */ jsx("span", {
|
|
185
|
+
style: {
|
|
186
|
+
fontSize: tokens.typography.fontSize.xs,
|
|
187
|
+
color: tokens.colors.text.secondary,
|
|
188
|
+
fontWeight: tokens.typography.fontWeight.medium
|
|
189
|
+
},
|
|
190
|
+
children: connecting ? "Connecting..." : connected ? "Connected" : "Disconnected"
|
|
191
|
+
}),
|
|
192
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
|
|
193
|
+
/* @__PURE__ */ jsx("span", {
|
|
194
|
+
style: {
|
|
195
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
196
|
+
color: tokens.colors.text.tertiary,
|
|
197
|
+
fontFamily: tokens.typography.fontFamily.mono,
|
|
198
|
+
overflow: "hidden",
|
|
199
|
+
textOverflow: "ellipsis",
|
|
200
|
+
maxWidth: isMobile ? "100%" : 280,
|
|
201
|
+
whiteSpace: isMobile ? "normal" : "nowrap",
|
|
202
|
+
wordBreak: isMobile ? "break-all" : "normal"
|
|
203
|
+
},
|
|
204
|
+
children: fullUrl
|
|
205
|
+
})
|
|
206
|
+
]
|
|
207
|
+
}),
|
|
208
|
+
/* @__PURE__ */ jsxs("div", {
|
|
209
|
+
style: {
|
|
210
|
+
display: "grid",
|
|
211
|
+
gridTemplateColumns: isMobile ? "1fr" : "minmax(80px, 100px) 1fr minmax(60px, 80px)",
|
|
212
|
+
gap: tokens.spacing.sm
|
|
213
|
+
},
|
|
214
|
+
children: [
|
|
215
|
+
/* @__PURE__ */ jsxs("div", {
|
|
216
|
+
style: fieldWrapperStyle,
|
|
217
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
218
|
+
htmlFor: `${baseId}-protocol`,
|
|
219
|
+
style: labelStyle,
|
|
220
|
+
children: "Protocol"
|
|
221
|
+
}), /* @__PURE__ */ jsx("select", {
|
|
222
|
+
id: `${baseId}-protocol`,
|
|
223
|
+
value: config.protocol,
|
|
224
|
+
onChange: (e) => handleProtocolChange(e.target.value),
|
|
225
|
+
disabled: connected || connecting,
|
|
226
|
+
style: {
|
|
227
|
+
...inputStyle,
|
|
228
|
+
cursor: "pointer",
|
|
229
|
+
appearance: "auto"
|
|
230
|
+
},
|
|
231
|
+
children: PROTOCOLS.map((p) => /* @__PURE__ */ jsx("option", {
|
|
232
|
+
value: p,
|
|
233
|
+
children: p.toUpperCase()
|
|
234
|
+
}, p))
|
|
235
|
+
})]
|
|
236
|
+
}),
|
|
237
|
+
/* @__PURE__ */ jsxs("div", {
|
|
238
|
+
style: fieldWrapperStyle,
|
|
239
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
240
|
+
htmlFor: `${baseId}-host`,
|
|
241
|
+
style: labelStyle,
|
|
242
|
+
children: "Host"
|
|
243
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
244
|
+
id: `${baseId}-host`,
|
|
245
|
+
type: "text",
|
|
246
|
+
value: config.host,
|
|
247
|
+
onChange: (e) => updateField("host", e.target.value),
|
|
248
|
+
disabled: connected || connecting,
|
|
249
|
+
placeholder: "broker.example.com",
|
|
250
|
+
style: inputStyle
|
|
251
|
+
})]
|
|
252
|
+
}),
|
|
253
|
+
/* @__PURE__ */ jsxs("div", {
|
|
254
|
+
style: fieldWrapperStyle,
|
|
255
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
256
|
+
htmlFor: `${baseId}-port`,
|
|
257
|
+
style: labelStyle,
|
|
258
|
+
children: "Port"
|
|
259
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
260
|
+
id: `${baseId}-port`,
|
|
261
|
+
type: "number",
|
|
262
|
+
value: config.port,
|
|
263
|
+
min: 1,
|
|
264
|
+
max: 65535,
|
|
265
|
+
onChange: (e) => {
|
|
266
|
+
const v = parseInt(e.target.value) || 0;
|
|
267
|
+
updateField("port", Math.max(0, Math.min(65535, v)));
|
|
268
|
+
},
|
|
269
|
+
disabled: connected || connecting,
|
|
270
|
+
style: {
|
|
271
|
+
...inputStyle,
|
|
272
|
+
fontFamily: tokens.typography.fontFamily.mono
|
|
273
|
+
}
|
|
274
|
+
})]
|
|
275
|
+
})
|
|
276
|
+
]
|
|
277
|
+
}),
|
|
278
|
+
/* @__PURE__ */ jsxs("div", {
|
|
279
|
+
style: {
|
|
280
|
+
marginTop: tokens.spacing.sm,
|
|
281
|
+
...fieldWrapperStyle
|
|
282
|
+
},
|
|
283
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
284
|
+
htmlFor: `${baseId}-path`,
|
|
285
|
+
style: labelStyle,
|
|
286
|
+
children: "Path"
|
|
287
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
288
|
+
id: `${baseId}-path`,
|
|
289
|
+
type: "text",
|
|
290
|
+
value: config.path || "",
|
|
291
|
+
onChange: (e) => updateField("path", e.target.value),
|
|
292
|
+
disabled: connected || connecting,
|
|
293
|
+
placeholder: "/mqtt",
|
|
294
|
+
style: inputStyle
|
|
295
|
+
})]
|
|
296
|
+
}),
|
|
297
|
+
/* @__PURE__ */ jsxs("button", {
|
|
298
|
+
type: "button",
|
|
299
|
+
onClick: () => setShowAdv((p) => !p),
|
|
300
|
+
style: {
|
|
301
|
+
display: "flex",
|
|
302
|
+
alignItems: "center",
|
|
303
|
+
gap: "4px",
|
|
304
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
305
|
+
color: tokens.colors.text.tertiary,
|
|
306
|
+
backgroundColor: "transparent",
|
|
307
|
+
border: "none",
|
|
308
|
+
cursor: "pointer",
|
|
309
|
+
marginTop: tokens.spacing.sm,
|
|
310
|
+
padding: 0,
|
|
311
|
+
fontFamily: tokens.typography.fontFamily.primary
|
|
312
|
+
},
|
|
313
|
+
children: [/* @__PURE__ */ jsx("svg", {
|
|
314
|
+
width: "12",
|
|
315
|
+
height: "12",
|
|
316
|
+
viewBox: "0 0 24 24",
|
|
317
|
+
fill: "none",
|
|
318
|
+
stroke: "currentColor",
|
|
319
|
+
strokeWidth: "2",
|
|
320
|
+
style: {
|
|
321
|
+
transition: tokens.animation.fast,
|
|
322
|
+
transform: showAdv ? "rotate(90deg)" : "rotate(0)"
|
|
323
|
+
},
|
|
324
|
+
children: /* @__PURE__ */ jsx("polyline", { points: "9 18 15 12 9 6" })
|
|
325
|
+
}), "Advanced"]
|
|
326
|
+
}),
|
|
327
|
+
showAdv && /* @__PURE__ */ jsxs("div", {
|
|
328
|
+
style: {
|
|
329
|
+
marginTop: tokens.spacing.sm,
|
|
330
|
+
display: "grid",
|
|
331
|
+
gridTemplateColumns: isMobile ? "1fr" : "1fr 1fr",
|
|
332
|
+
gap: tokens.spacing.sm
|
|
333
|
+
},
|
|
334
|
+
children: [
|
|
335
|
+
/* @__PURE__ */ jsxs("div", {
|
|
336
|
+
style: fieldWrapperStyle,
|
|
337
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
338
|
+
htmlFor: `${baseId}-username`,
|
|
339
|
+
style: labelStyle,
|
|
340
|
+
children: "Username"
|
|
341
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
342
|
+
ref: usernameInputRef,
|
|
343
|
+
id: `${baseId}-username`,
|
|
344
|
+
type: "text",
|
|
345
|
+
value: config.username || "",
|
|
346
|
+
onChange: (e) => updateField("username", e.target.value),
|
|
347
|
+
onPaste: (e) => {
|
|
348
|
+
const pasted = e.clipboardData.getData("text");
|
|
349
|
+
const trimmed = pasted.trim();
|
|
350
|
+
const input = usernameInputRef.current;
|
|
351
|
+
if (input) {
|
|
352
|
+
const cur = config.username || "";
|
|
353
|
+
const start = input.selectionStart ?? cur.length;
|
|
354
|
+
const end = input.selectionEnd ?? cur.length;
|
|
355
|
+
const newValue = cur.slice(0, start) + trimmed + cur.slice(end);
|
|
356
|
+
if (trimmed !== pasted || newValue !== cur) {
|
|
357
|
+
e.preventDefault();
|
|
358
|
+
updateField("username", newValue);
|
|
359
|
+
requestAnimationFrame(() => {
|
|
360
|
+
input.setSelectionRange(start + trimmed.length, start + trimmed.length);
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
} else if (trimmed !== pasted) {
|
|
364
|
+
e.preventDefault();
|
|
365
|
+
updateField("username", trimmed);
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
onBlur: () => {
|
|
369
|
+
const cur = config.username ?? "";
|
|
370
|
+
const trimmed = cur.trim();
|
|
371
|
+
if (trimmed !== cur) updateField("username", trimmed);
|
|
372
|
+
},
|
|
373
|
+
disabled: connected || connecting,
|
|
374
|
+
autoComplete: "username",
|
|
375
|
+
style: inputStyle
|
|
376
|
+
})]
|
|
377
|
+
}),
|
|
378
|
+
/* @__PURE__ */ jsxs("div", {
|
|
379
|
+
style: fieldWrapperStyle,
|
|
380
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
381
|
+
htmlFor: `${baseId}-password`,
|
|
382
|
+
style: labelStyle,
|
|
383
|
+
children: "Password"
|
|
384
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
385
|
+
style: { position: "relative" },
|
|
386
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
387
|
+
ref: passwordInputRef,
|
|
388
|
+
id: `${baseId}-password`,
|
|
389
|
+
type: showPassword ? "text" : "password",
|
|
390
|
+
value: config.password || "",
|
|
391
|
+
onChange: (e) => updateField("password", e.target.value),
|
|
392
|
+
onPaste: (e) => {
|
|
393
|
+
const pasted = e.clipboardData.getData("text");
|
|
394
|
+
const trimmed = pasted.trim();
|
|
395
|
+
const input = passwordInputRef.current;
|
|
396
|
+
if (input) {
|
|
397
|
+
const cur = config.password || "";
|
|
398
|
+
const start = input.selectionStart ?? cur.length;
|
|
399
|
+
const end = input.selectionEnd ?? cur.length;
|
|
400
|
+
const newValue = cur.slice(0, start) + trimmed + cur.slice(end);
|
|
401
|
+
if (trimmed !== pasted || newValue !== cur) {
|
|
402
|
+
e.preventDefault();
|
|
403
|
+
updateField("password", newValue);
|
|
404
|
+
requestAnimationFrame(() => {
|
|
405
|
+
const pos = start + trimmed.length;
|
|
406
|
+
input.setSelectionRange(pos, pos);
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
} else if (trimmed !== pasted) {
|
|
410
|
+
e.preventDefault();
|
|
411
|
+
updateField("password", trimmed);
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
onBlur: () => {
|
|
415
|
+
const cur = config.password ?? "";
|
|
416
|
+
const trimmed = cur.trim();
|
|
417
|
+
if (trimmed !== cur) updateField("password", trimmed);
|
|
418
|
+
},
|
|
419
|
+
disabled: connected || connecting,
|
|
420
|
+
autoComplete: "current-password",
|
|
421
|
+
style: {
|
|
422
|
+
...inputStyle,
|
|
423
|
+
paddingRight: 36
|
|
424
|
+
}
|
|
425
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
426
|
+
type: "button",
|
|
427
|
+
onClick: () => setShowPassword((p) => !p),
|
|
428
|
+
style: {
|
|
429
|
+
position: "absolute",
|
|
430
|
+
right: 8,
|
|
431
|
+
top: "50%",
|
|
432
|
+
transform: "translateY(-50%)",
|
|
433
|
+
background: "none",
|
|
434
|
+
border: "none",
|
|
435
|
+
cursor: "pointer",
|
|
436
|
+
color: tokens.colors.text.tertiary,
|
|
437
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
438
|
+
minHeight: 32,
|
|
439
|
+
padding: `${tokens.spacing.xs} ${tokens.spacing.sm}`
|
|
440
|
+
},
|
|
441
|
+
children: showPassword ? "Hide" : "Show"
|
|
442
|
+
})]
|
|
443
|
+
})]
|
|
444
|
+
}),
|
|
445
|
+
/* @__PURE__ */ jsxs("div", {
|
|
446
|
+
style: {
|
|
447
|
+
gridColumn: "1 / -1",
|
|
448
|
+
...fieldWrapperStyle
|
|
449
|
+
},
|
|
450
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
451
|
+
htmlFor: `${baseId}-clientId`,
|
|
452
|
+
style: labelStyle,
|
|
453
|
+
children: "Client ID"
|
|
454
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
455
|
+
id: `${baseId}-clientId`,
|
|
456
|
+
type: "text",
|
|
457
|
+
value: config.clientId || "",
|
|
458
|
+
onChange: (e) => updateField("clientId", e.target.value),
|
|
459
|
+
disabled: connected || connecting,
|
|
460
|
+
placeholder: "auto-generated if empty",
|
|
461
|
+
style: inputStyle
|
|
462
|
+
})]
|
|
463
|
+
})
|
|
464
|
+
]
|
|
465
|
+
}),
|
|
466
|
+
error && /* @__PURE__ */ jsx("div", {
|
|
467
|
+
style: {
|
|
468
|
+
marginTop: tokens.spacing.sm,
|
|
469
|
+
padding: `${tokens.spacing.xs} ${tokens.spacing.sm}`,
|
|
470
|
+
fontSize: tokens.typography.fontSize.xs,
|
|
471
|
+
color: tokens.colors.status.critical,
|
|
472
|
+
backgroundColor: `${tokens.colors.status.critical}10`,
|
|
473
|
+
border: `1px solid ${tokens.colors.status.critical}20`,
|
|
474
|
+
borderRadius: tokens.borderRadius.sm
|
|
475
|
+
},
|
|
476
|
+
children: error
|
|
477
|
+
}),
|
|
478
|
+
/* @__PURE__ */ jsxs("div", {
|
|
479
|
+
style: {
|
|
480
|
+
display: "flex",
|
|
481
|
+
alignItems: "center",
|
|
482
|
+
gap: tokens.spacing.sm,
|
|
483
|
+
flexDirection: isMobile ? "column" : "row",
|
|
484
|
+
marginTop: tokens.spacing.md
|
|
485
|
+
},
|
|
486
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
487
|
+
type: "submit",
|
|
488
|
+
disabled: connecting || !config.host,
|
|
489
|
+
style: {
|
|
490
|
+
flex: 1,
|
|
491
|
+
padding: compact ? `8px ${tokens.spacing.md}` : `${tokens.spacing.sm} ${tokens.spacing.lg}`,
|
|
492
|
+
minHeight: 44,
|
|
493
|
+
fontSize: tokens.typography.fontSize.sm,
|
|
494
|
+
fontWeight: tokens.typography.fontWeight.semibold,
|
|
495
|
+
fontFamily: tokens.typography.fontFamily.primary,
|
|
496
|
+
color: tokens.colors.text.inverse || "#fff",
|
|
497
|
+
backgroundColor: connected ? tokens.colors.status.critical : tokens.colors.accent.primary,
|
|
498
|
+
border: "none",
|
|
499
|
+
borderRadius: tokens.borderRadius.md,
|
|
500
|
+
cursor: connecting || !config.host ? "not-allowed" : "pointer",
|
|
501
|
+
opacity: connecting || !config.host ? .6 : 1,
|
|
502
|
+
transition: tokens.animation.fast
|
|
503
|
+
},
|
|
504
|
+
children: connecting ? "Connecting..." : connected ? "Disconnect" : "Connect"
|
|
505
|
+
}), parseUrlParams && !connected && /* @__PURE__ */ jsx("button", {
|
|
506
|
+
type: "button",
|
|
507
|
+
title: "Copy share URL",
|
|
508
|
+
onClick: () => {
|
|
509
|
+
navigator.clipboard?.writeText(getShareUrl());
|
|
510
|
+
},
|
|
511
|
+
style: {
|
|
512
|
+
padding: compact ? "8px" : tokens.spacing.sm,
|
|
513
|
+
minHeight: 44,
|
|
514
|
+
width: isMobile ? "100%" : "auto",
|
|
515
|
+
fontSize: tokens.typography.fontSize.xs,
|
|
516
|
+
color: tokens.colors.text.tertiary,
|
|
517
|
+
backgroundColor: "transparent",
|
|
518
|
+
border: `1px solid ${tokens.colors.border.muted}`,
|
|
519
|
+
borderRadius: tokens.borderRadius.md,
|
|
520
|
+
cursor: "pointer",
|
|
521
|
+
fontFamily: tokens.typography.fontFamily.primary
|
|
522
|
+
},
|
|
523
|
+
children: "Share"
|
|
524
|
+
})]
|
|
525
|
+
})
|
|
526
|
+
]
|
|
527
|
+
});
|
|
492
528
|
});
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
//# sourceMappingURL=ConnectionForm.js.map
|
|
529
|
+
//#endregion
|
|
530
|
+
export { ConnectionForm, ConnectionForm as default };
|
|
531
|
+
|
|
532
|
+
//# sourceMappingURL=ConnectionForm.js.map
|