@zendir/ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/LICENSE +21 -0
- package/README.md +589 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +421 -0
- package/dist/index.js.map +1 -0
- package/dist/react/3d/EarthViewer.d.ts +46 -0
- package/dist/react/3d/EarthViewer.js +836 -0
- package/dist/react/3d/EarthViewer.js.map +1 -0
- package/dist/react/3d/SolarSystemViewer.d.ts +43 -0
- package/dist/react/3d/SolarSystemViewer.js +372 -0
- package/dist/react/3d/SolarSystemViewer.js.map +1 -0
- package/dist/react/3d/ZenSpace3D.d.ts +16 -0
- package/dist/react/3d/ZenSpace3D.js +1253 -0
- package/dist/react/3d/ZenSpace3D.js.map +1 -0
- package/dist/react/3d/ZenSpace3DCesium.d.ts +9 -0
- package/dist/react/3d/ZenSpace3DCesium.js +186 -0
- package/dist/react/3d/ZenSpace3DCesium.js.map +1 -0
- package/dist/react/3d/ZenSpace3DShaders.d.ts +78 -0
- package/dist/react/3d/ZenSpace3DShaders.js +94 -0
- package/dist/react/3d/ZenSpace3DShaders.js.map +1 -0
- package/dist/react/3d/ZenSpace3DTypes.d.ts +614 -0
- package/dist/react/3d/ZenSpace3DUtils.d.ts +183 -0
- package/dist/react/3d/ZenSpace3DUtils.js +213 -0
- package/dist/react/3d/ZenSpace3DUtils.js.map +1 -0
- package/dist/react/3d/index.d.ts +23 -0
- package/dist/react/3d/threeLoader.d.ts +22 -0
- package/dist/react/3d/threeLoader.js +18 -0
- package/dist/react/3d/threeLoader.js.map +1 -0
- package/dist/react/astro/ClassificationBanner.d.ts +25 -0
- package/dist/react/astro/ClassificationBanner.js +83 -0
- package/dist/react/astro/ClassificationBanner.js.map +1 -0
- package/dist/react/astro/GlobalStatusBar.d.ts +42 -0
- package/dist/react/astro/GlobalStatusBar.js +165 -0
- package/dist/react/astro/GlobalStatusBar.js.map +1 -0
- package/dist/react/astro/MissionClock.d.ts +169 -0
- package/dist/react/astro/MissionClock.js +411 -0
- package/dist/react/astro/MissionClock.js.map +1 -0
- package/dist/react/astro/MonitoringIcon.d.ts +60 -0
- package/dist/react/astro/MonitoringIcon.js +369 -0
- package/dist/react/astro/MonitoringIcon.js.map +1 -0
- package/dist/react/astro/Notification.d.ts +42 -0
- package/dist/react/astro/Notification.js +156 -0
- package/dist/react/astro/Notification.js.map +1 -0
- package/dist/react/astro/Progress.d.ts +39 -0
- package/dist/react/astro/Progress.js +149 -0
- package/dist/react/astro/Progress.js.map +1 -0
- package/dist/react/astro/SimulationControls.d.ts +136 -0
- package/dist/react/astro/SimulationControls.js +668 -0
- package/dist/react/astro/SimulationControls.js.map +1 -0
- package/dist/react/astro/StatusIndicator.d.ts +34 -0
- package/dist/react/astro/StatusIndicator.js +189 -0
- package/dist/react/astro/StatusIndicator.js.map +1 -0
- package/dist/react/astro/UnifiedTimeline.d.ts +106 -0
- package/dist/react/astro/UnifiedTimeline.js +1768 -0
- package/dist/react/astro/UnifiedTimeline.js.map +1 -0
- package/dist/react/astro/index.d.ts +63 -0
- package/dist/react/cards/AccessCard.d.ts +37 -0
- package/dist/react/cards/AccessCard.js +410 -0
- package/dist/react/cards/AccessCard.js.map +1 -0
- package/dist/react/cards/OrbitCard.d.ts +31 -0
- package/dist/react/cards/OrbitCard.js +372 -0
- package/dist/react/cards/OrbitCard.js.map +1 -0
- package/dist/react/cards/SpacecraftCard.d.ts +54 -0
- package/dist/react/cards/SpacecraftCard.js +941 -0
- package/dist/react/cards/SpacecraftCard.js.map +1 -0
- package/dist/react/cards/TelemetryCard.d.ts +40 -0
- package/dist/react/cards/TelemetryCard.js +742 -0
- package/dist/react/cards/TelemetryCard.js.map +1 -0
- package/dist/react/cards/TelemetryStreamCard.d.ts +59 -0
- package/dist/react/cards/TelemetryStreamCard.js +309 -0
- package/dist/react/cards/TelemetryStreamCard.js.map +1 -0
- package/dist/react/cards/index.d.ts +13 -0
- package/dist/react/charts/GroundTrackMap.d.ts +112 -0
- package/dist/react/charts/GroundTrackMap.js +1123 -0
- package/dist/react/charts/GroundTrackMap.js.map +1 -0
- package/dist/react/charts/GroundTrackMapLeaflet.d.ts +26 -0
- package/dist/react/charts/GroundTrackMapLeaflet.js +571 -0
- package/dist/react/charts/GroundTrackMapLeaflet.js.map +1 -0
- package/dist/react/charts/groundTrackMapLeafletTiles.d.ts +22 -0
- package/dist/react/charts/groundTrackMapLeafletTiles.js +11 -0
- package/dist/react/charts/groundTrackMapLeafletTiles.js.map +1 -0
- package/dist/react/charts/groundTrackMapLeafletUtils.d.ts +24 -0
- package/dist/react/charts/groundTrackMapLeafletUtils.js +109 -0
- package/dist/react/charts/groundTrackMapLeafletUtils.js.map +1 -0
- package/dist/react/charts/index.d.ts +10 -0
- package/dist/react/charts/unified/AstroChart.d.ts +24 -0
- package/dist/react/charts/unified/AstroChart.js +1405 -0
- package/dist/react/charts/unified/AstroChart.js.map +1 -0
- package/dist/react/charts/unified/PowerOverviewChart.d.ts +73 -0
- package/dist/react/charts/unified/PowerOverviewChart.js +488 -0
- package/dist/react/charts/unified/PowerOverviewChart.js.map +1 -0
- package/dist/react/charts/unified/domain.d.ts +845 -0
- package/dist/react/charts/unified/domain.js +3168 -0
- package/dist/react/charts/unified/domain.js.map +1 -0
- package/dist/react/charts/unified/generators.d.ts +276 -0
- package/dist/react/charts/unified/generators.js +518 -0
- package/dist/react/charts/unified/generators.js.map +1 -0
- package/dist/react/charts/unified/index.d.ts +55 -0
- package/dist/react/charts/unified/presets.d.ts +290 -0
- package/dist/react/charts/unified/presets.js +999 -0
- package/dist/react/charts/unified/presets.js.map +1 -0
- package/dist/react/charts/unified/sync.d.ts +69 -0
- package/dist/react/charts/unified/sync.js +219 -0
- package/dist/react/charts/unified/sync.js.map +1 -0
- package/dist/react/charts/unified/theme.d.ts +447 -0
- package/dist/react/charts/unified/theme.js +562 -0
- package/dist/react/charts/unified/theme.js.map +1 -0
- package/dist/react/charts/unified/types.d.ts +826 -0
- package/dist/react/charts/unified/useChartStream.d.ts +58 -0
- package/dist/react/charts/unified/useChartStream.js +226 -0
- package/dist/react/charts/unified/useChartStream.js.map +1 -0
- package/dist/react/chatgpt/AppCard.d.ts +59 -0
- package/dist/react/chatgpt/AppCard.js +306 -0
- package/dist/react/chatgpt/AppCard.js.map +1 -0
- package/dist/react/chatgpt/ChatGPTCard.d.ts +6 -0
- package/dist/react/chatgpt/index.d.ts +167 -0
- package/dist/react/chatgpt/index.js +166 -0
- package/dist/react/chatgpt/index.js.map +1 -0
- package/dist/react/context/DisplaySettingsContext.d.ts +107 -0
- package/dist/react/context/DisplaySettingsContext.js +169 -0
- package/dist/react/context/DisplaySettingsContext.js.map +1 -0
- package/dist/react/context/index.d.ts +5 -0
- package/dist/react/core/ActivityPlanner.d.ts +45 -0
- package/dist/react/core/ActivityPlanner.js +532 -0
- package/dist/react/core/ActivityPlanner.js.map +1 -0
- package/dist/react/core/AppBar.d.ts +71 -0
- package/dist/react/core/AppBar.js +817 -0
- package/dist/react/core/AppBar.js.map +1 -0
- package/dist/react/core/AstroIcon.d.ts +84 -0
- package/dist/react/core/AstroIcon.js +1243 -0
- package/dist/react/core/AstroIcon.js.map +1 -0
- package/dist/react/core/Badge.d.ts +27 -0
- package/dist/react/core/Badge.js +134 -0
- package/dist/react/core/Badge.js.map +1 -0
- package/dist/react/core/Button.d.ts +26 -0
- package/dist/react/core/Button.js +306 -0
- package/dist/react/core/Button.js.map +1 -0
- package/dist/react/core/CardHeader.d.ts +34 -0
- package/dist/react/core/CardHeader.js +316 -0
- package/dist/react/core/CardHeader.js.map +1 -0
- package/dist/react/core/ChatPanel.d.ts +627 -0
- package/dist/react/core/ChatPanel.js +1144 -0
- package/dist/react/core/ChatPanel.js.map +1 -0
- package/dist/react/core/Checkbox.d.ts +26 -0
- package/dist/react/core/Checkbox.js +130 -0
- package/dist/react/core/Checkbox.js.map +1 -0
- package/dist/react/core/ColorPickerPanel.d.ts +25 -0
- package/dist/react/core/ColorPickerPanel.js +293 -0
- package/dist/react/core/ColorPickerPanel.js.map +1 -0
- package/dist/react/core/CommandBuilder.d.ts +74 -0
- package/dist/react/core/CommandBuilder.js +518 -0
- package/dist/react/core/CommandBuilder.js.map +1 -0
- package/dist/react/core/ConfirmDialog.d.ts +45 -0
- package/dist/react/core/ConfirmDialog.js +315 -0
- package/dist/react/core/ConfirmDialog.js.map +1 -0
- package/dist/react/core/ConnectionForm.d.ts +57 -0
- package/dist/react/core/ConnectionForm.js +496 -0
- package/dist/react/core/ConnectionForm.js.map +1 -0
- package/dist/react/core/Container.d.ts +51 -0
- package/dist/react/core/Container.js +670 -0
- package/dist/react/core/Container.js.map +1 -0
- package/dist/react/core/CopyButton.d.ts +39 -0
- package/dist/react/core/CopyButton.js +105 -0
- package/dist/react/core/CopyButton.js.map +1 -0
- package/dist/react/core/DataTable.d.ts +113 -0
- package/dist/react/core/DataTable.js +446 -0
- package/dist/react/core/DataTable.js.map +1 -0
- package/dist/react/core/DataValue.d.ts +64 -0
- package/dist/react/core/DataValue.js +545 -0
- package/dist/react/core/DataValue.js.map +1 -0
- package/dist/react/core/Dialog.d.ts +32 -0
- package/dist/react/core/Dialog.js +201 -0
- package/dist/react/core/Dialog.js.map +1 -0
- package/dist/react/core/FileExplorer.d.ts +65 -0
- package/dist/react/core/FileExplorer.js +520 -0
- package/dist/react/core/FileExplorer.js.map +1 -0
- package/dist/react/core/GlassCard.d.ts +129 -0
- package/dist/react/core/GlassCard.js +375 -0
- package/dist/react/core/GlassCard.js.map +1 -0
- package/dist/react/core/HeaderIconWithStatus.d.ts +39 -0
- package/dist/react/core/HeaderIconWithStatus.js +157 -0
- package/dist/react/core/HeaderIconWithStatus.js.map +1 -0
- package/dist/react/core/HexViewer.d.ts +143 -0
- package/dist/react/core/HexViewer.js +1106 -0
- package/dist/react/core/HexViewer.js.map +1 -0
- package/dist/react/core/Icon.d.ts +32 -0
- package/dist/react/core/Icon.js +142 -0
- package/dist/react/core/Icon.js.map +1 -0
- package/dist/react/core/ImageGallery.d.ts +41 -0
- package/dist/react/core/ImageGallery.js +320 -0
- package/dist/react/core/ImageGallery.js.map +1 -0
- package/dist/react/core/Input.d.ts +38 -0
- package/dist/react/core/Input.js +288 -0
- package/dist/react/core/Input.js.map +1 -0
- package/dist/react/core/LimitsBar.d.ts +51 -0
- package/dist/react/core/LimitsBar.js +200 -0
- package/dist/react/core/LimitsBar.js.map +1 -0
- package/dist/react/core/LogViewer.d.ts +61 -0
- package/dist/react/core/LogViewer.js +599 -0
- package/dist/react/core/LogViewer.js.map +1 -0
- package/dist/react/core/MessageStream.d.ts +58 -0
- package/dist/react/core/MessageStream.js +455 -0
- package/dist/react/core/MessageStream.js.map +1 -0
- package/dist/react/core/MissionCalendar.d.ts +81 -0
- package/dist/react/core/MissionCalendar.js +1049 -0
- package/dist/react/core/MissionCalendar.js.map +1 -0
- package/dist/react/core/NumberInput.d.ts +85 -0
- package/dist/react/core/NumberInput.js +507 -0
- package/dist/react/core/NumberInput.js.map +1 -0
- package/dist/react/core/PacketViewer.d.ts +73 -0
- package/dist/react/core/PacketViewer.js +431 -0
- package/dist/react/core/PacketViewer.js.map +1 -0
- package/dist/react/core/Pagination.d.ts +30 -0
- package/dist/react/core/Pagination.js +190 -0
- package/dist/react/core/Pagination.js.map +1 -0
- package/dist/react/core/PinInput.d.ts +41 -0
- package/dist/react/core/PinInput.js +210 -0
- package/dist/react/core/PinInput.js.map +1 -0
- package/dist/react/core/Popover.d.ts +55 -0
- package/dist/react/core/Popover.js +288 -0
- package/dist/react/core/Popover.js.map +1 -0
- package/dist/react/core/Select.d.ts +42 -0
- package/dist/react/core/Select.js +303 -0
- package/dist/react/core/Select.js.map +1 -0
- package/dist/react/core/SideNav.d.ts +103 -0
- package/dist/react/core/SideNav.js +551 -0
- package/dist/react/core/SideNav.js.map +1 -0
- package/dist/react/core/SidePanel.d.ts +33 -0
- package/dist/react/core/SidePanel.js +199 -0
- package/dist/react/core/SidePanel.js.map +1 -0
- package/dist/react/core/Tabs.d.ts +47 -0
- package/dist/react/core/Tabs.js +129 -0
- package/dist/react/core/Tabs.js.map +1 -0
- package/dist/react/core/Toast.d.ts +56 -0
- package/dist/react/core/Toast.js +229 -0
- package/dist/react/core/Toast.js.map +1 -0
- package/dist/react/core/Toggle.d.ts +22 -0
- package/dist/react/core/Toggle.js +151 -0
- package/dist/react/core/Toggle.js.map +1 -0
- package/dist/react/core/Tooltip.d.ts +19 -0
- package/dist/react/core/Tooltip.js +179 -0
- package/dist/react/core/Tooltip.js.map +1 -0
- package/dist/react/core/Typography.d.ts +127 -0
- package/dist/react/core/Typography.js +187 -0
- package/dist/react/core/Typography.js.map +1 -0
- package/dist/react/core/index.d.ts +108 -0
- package/dist/react/core/layout/Box.d.ts +77 -0
- package/dist/react/core/layout/Box.js +126 -0
- package/dist/react/core/layout/Box.js.map +1 -0
- package/dist/react/core/layout/Center.d.ts +20 -0
- package/dist/react/core/layout/Center.js +34 -0
- package/dist/react/core/layout/Center.js.map +1 -0
- package/dist/react/core/layout/Divider.d.ts +16 -0
- package/dist/react/core/layout/Divider.js +108 -0
- package/dist/react/core/layout/Divider.js.map +1 -0
- package/dist/react/core/layout/Flex.d.ts +30 -0
- package/dist/react/core/layout/Flex.js +128 -0
- package/dist/react/core/layout/Flex.js.map +1 -0
- package/dist/react/core/layout/Grid.d.ts +36 -0
- package/dist/react/core/layout/Grid.js +142 -0
- package/dist/react/core/layout/Grid.js.map +1 -0
- package/dist/react/core/layout/Spacer.d.ts +8 -0
- package/dist/react/core/layout/Spacer.js +31 -0
- package/dist/react/core/layout/Spacer.js.map +1 -0
- package/dist/react/core/layout/Stack.d.ts +54 -0
- package/dist/react/core/layout/Stack.js +74 -0
- package/dist/react/core/layout/Stack.js.map +1 -0
- package/dist/react/core/layout/index.d.ts +38 -0
- package/dist/react/core/layout/responsive.d.ts +23 -0
- package/dist/react/core/layout/responsive.js +26 -0
- package/dist/react/core/layout/responsive.js.map +1 -0
- package/dist/react/core/layout/useBreakpoint.d.ts +77 -0
- package/dist/react/core/layout/useBreakpoint.js +73 -0
- package/dist/react/core/layout/useBreakpoint.js.map +1 -0
- package/dist/react/core/propertyConfig.d.ts +443 -0
- package/dist/react/core/propertyConfig.js +399 -0
- package/dist/react/core/propertyConfig.js.map +1 -0
- package/dist/react/hooks/index.d.ts +21 -0
- package/dist/react/hooks/useAccessWindows.d.ts +66 -0
- package/dist/react/hooks/useCompactMode.d.ts +82 -0
- package/dist/react/hooks/useCompactMode.js +62 -0
- package/dist/react/hooks/useCompactMode.js.map +1 -0
- package/dist/react/hooks/useLiveSelection.d.ts +57 -0
- package/dist/react/hooks/useSimulationPlayback.d.ts +97 -0
- package/dist/react/hooks/useSimulationTime.d.ts +61 -0
- package/dist/react/hooks/useSpacecraftPosition.d.ts +50 -0
- package/dist/react/hooks/useSpacecraftPosition.js +89 -0
- package/dist/react/hooks/useSpacecraftPosition.js.map +1 -0
- package/dist/react/hooks/useTelemetry.d.ts +55 -0
- package/dist/react/hooks/useTelemetry.js +73 -0
- package/dist/react/hooks/useTelemetry.js.map +1 -0
- package/dist/react/hooks/useZendirSession.d.ts +109 -0
- package/dist/react/hooks/useZendirSession.js +148 -0
- package/dist/react/hooks/useZendirSession.js.map +1 -0
- package/dist/react/index.d.ts +74 -0
- package/dist/react/shared/ErrorBoundary.d.ts +63 -0
- package/dist/react/shared/ErrorBoundary.js +142 -0
- package/dist/react/shared/ErrorBoundary.js.map +1 -0
- package/dist/react/shared/Skeleton.d.ts +110 -0
- package/dist/react/shared/Skeleton.js +324 -0
- package/dist/react/shared/Skeleton.js.map +1 -0
- package/dist/react/shared/index.d.ts +12 -0
- package/dist/react/theme/ThemeProvider.d.ts +385 -0
- package/dist/react/theme/ThemeProvider.js +1096 -0
- package/dist/react/theme/ThemeProvider.js.map +1 -0
- package/dist/react/theme/astro-tokens.d.ts +153 -0
- package/dist/react/theme/cardAccent.d.ts +75 -0
- package/dist/react/theme/cardAccent.js +137 -0
- package/dist/react/theme/cardAccent.js.map +1 -0
- package/dist/react/theme/config.d.ts +39 -0
- package/dist/react/theme/index.d.ts +9 -0
- package/dist/react/types.d.ts +360 -0
- package/dist/react/types.js +58 -0
- package/dist/react/types.js.map +1 -0
- package/dist/react/utils/index.d.ts +247 -0
- package/dist/react/utils/index.js +423 -0
- package/dist/react/utils/index.js.map +1 -0
- package/dist/react/visualizations/EclipseTimerCard.d.ts +17 -0
- package/dist/react/visualizations/EclipseTimerCard.js +250 -0
- package/dist/react/visualizations/EclipseTimerCard.js.map +1 -0
- package/dist/react/visualizations/LinkBudgetCard.d.ts +50 -0
- package/dist/react/visualizations/LinkBudgetCard.js +444 -0
- package/dist/react/visualizations/LinkBudgetCard.js.map +1 -0
- package/dist/react/visualizations/NavBallCard.d.ts +17 -0
- package/dist/react/visualizations/NavBallCard.js +243 -0
- package/dist/react/visualizations/NavBallCard.js.map +1 -0
- package/dist/react/visualizations/PropulsionCard.d.ts +37 -0
- package/dist/react/visualizations/PropulsionCard.js +298 -0
- package/dist/react/visualizations/PropulsionCard.js.map +1 -0
- package/dist/react/visualizations/SensorFootprintCard.d.ts +33 -0
- package/dist/react/visualizations/SensorFootprintCard.js +326 -0
- package/dist/react/visualizations/SensorFootprintCard.js.map +1 -0
- package/dist/react/visualizations/ThermalHeatmapCard.d.ts +38 -0
- package/dist/react/visualizations/ThermalHeatmapCard.js +372 -0
- package/dist/react/visualizations/ThermalHeatmapCard.js.map +1 -0
- package/dist/react/visualizations/index.d.ts +17 -0
- package/dist/react.d.ts +1 -0
- package/dist/react.js +421 -0
- package/dist/react.js.map +1 -0
- package/dist/shaders/atmosphere.frag.js +5 -0
- package/dist/shaders/atmosphere.frag.js.map +1 -0
- package/dist/shaders/atmosphere.vert.js +5 -0
- package/dist/shaders/atmosphere.vert.js.map +1 -0
- package/dist/shaders/stars.frag.js +5 -0
- package/dist/shaders/stars.frag.js.map +1 -0
- package/dist/shaders/stars.vert.js +5 -0
- package/dist/shaders/stars.vert.js.map +1 -0
- package/dist/style.css +143 -0
- package/dist/tokens/index.d.ts +296 -0
- package/dist/tokens/index.js +263 -0
- package/dist/tokens/index.js.map +1 -0
- package/dist/tokens/tokens.css +155 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +220 -0
- package/sdk-stub.js +22 -0
|
@@ -0,0 +1,551 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useState, useEffect, useCallback, useContext, createContext } from "react";
|
|
3
|
+
import { safeAccentText } from "../utils/index.js";
|
|
4
|
+
import { Icon } from "./Icon.js";
|
|
5
|
+
import { useTheme } from "../theme/ThemeProvider.js";
|
|
6
|
+
const SIDENAV_STATUS_COLORS = {
|
|
7
|
+
off: "#a4abb6",
|
|
8
|
+
standby: "#2dccff",
|
|
9
|
+
normal: "#56f000",
|
|
10
|
+
caution: "#fce83a",
|
|
11
|
+
serious: "#ffb302",
|
|
12
|
+
critical: "#ff3838"
|
|
13
|
+
};
|
|
14
|
+
function NavStatusShape({ status, size = 8 }) {
|
|
15
|
+
const color = SIDENAV_STATUS_COLORS[status] ?? SIDENAV_STATUS_COLORS.off;
|
|
16
|
+
const glow = `${color}50`;
|
|
17
|
+
const style = { flexShrink: 0, filter: `drop-shadow(0 0 3px ${glow})` };
|
|
18
|
+
switch (status) {
|
|
19
|
+
case "caution":
|
|
20
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 12 12", width: size, height: size, style, "aria-hidden": "true", children: /* @__PURE__ */ jsx("rect", { x: "1", y: "1", width: "10", height: "10", fill: color }) });
|
|
21
|
+
case "serious":
|
|
22
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 12 12", width: size, height: size, style, "aria-hidden": "true", children: /* @__PURE__ */ jsx("polygon", { points: "6,1 11,6 6,11 1,6", fill: color }) });
|
|
23
|
+
case "critical":
|
|
24
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 12 12", width: size, height: size, style, "aria-hidden": "true", children: /* @__PURE__ */ jsx("polygon", { points: "6,11 1,2 11,2", fill: color }) });
|
|
25
|
+
case "standby":
|
|
26
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 12 12", width: size, height: size, style, "aria-hidden": "true", children: /* @__PURE__ */ jsx("circle", { cx: "6", cy: "6", r: "3.5", fill: "none", stroke: color, strokeWidth: "2" }) });
|
|
27
|
+
case "off":
|
|
28
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 12 12", width: size, height: size, style, "aria-hidden": "true", children: /* @__PURE__ */ jsx("circle", { cx: "6", cy: "6", r: "3", fill: color }) });
|
|
29
|
+
default:
|
|
30
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 12 12", width: size, height: size, style, "aria-hidden": "true", children: /* @__PURE__ */ jsx("circle", { cx: "6", cy: "6", r: "5", fill: color }) });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const SIDENAV_BREAKPOINTS = {
|
|
34
|
+
mobile: 768,
|
|
35
|
+
tablet: 1024
|
|
36
|
+
};
|
|
37
|
+
function getSideNavMode(width) {
|
|
38
|
+
if (width < SIDENAV_BREAKPOINTS.mobile) return "mobile";
|
|
39
|
+
if (width < SIDENAV_BREAKPOINTS.tablet) return "tablet";
|
|
40
|
+
return "desktop";
|
|
41
|
+
}
|
|
42
|
+
const SideNavContext = createContext({
|
|
43
|
+
collapsed: false,
|
|
44
|
+
mobileOpen: false,
|
|
45
|
+
mode: "desktop",
|
|
46
|
+
showCollapseToggle: true,
|
|
47
|
+
setMobileOpen: () => {
|
|
48
|
+
},
|
|
49
|
+
toggleCollapse: () => {
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
const SideNavRoot = memo(function SideNav2({
|
|
53
|
+
collapsed,
|
|
54
|
+
onCollapsedChange,
|
|
55
|
+
showCollapseToggle = true,
|
|
56
|
+
width = 260,
|
|
57
|
+
collapsedWidth = 64,
|
|
58
|
+
mobileVariant = "drawer",
|
|
59
|
+
children,
|
|
60
|
+
style
|
|
61
|
+
}) {
|
|
62
|
+
const { tokens, theme } = useTheme();
|
|
63
|
+
const isTransparentTheme = theme === "transparent" || theme === "transparent-bold" || theme === "transparent-minimal";
|
|
64
|
+
const [mobileOpen, setMobileOpen] = useState(false);
|
|
65
|
+
const [userCollapsed, setUserCollapsed] = useState(null);
|
|
66
|
+
const [viewMode, setViewMode] = useState(() => {
|
|
67
|
+
if (typeof window !== "undefined") return getSideNavMode(window.innerWidth);
|
|
68
|
+
return "desktop";
|
|
69
|
+
});
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
if (typeof window === "undefined") return;
|
|
72
|
+
let rafId;
|
|
73
|
+
const handleResize = () => {
|
|
74
|
+
cancelAnimationFrame(rafId);
|
|
75
|
+
rafId = requestAnimationFrame(() => setViewMode(getSideNavMode(window.innerWidth)));
|
|
76
|
+
};
|
|
77
|
+
window.addEventListener("resize", handleResize, { passive: true });
|
|
78
|
+
return () => {
|
|
79
|
+
window.removeEventListener("resize", handleResize);
|
|
80
|
+
cancelAnimationFrame(rafId);
|
|
81
|
+
};
|
|
82
|
+
}, []);
|
|
83
|
+
const effectiveMode = mobileVariant === "collapsed" && viewMode === "mobile" ? "tablet" : viewMode;
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
setUserCollapsed(null);
|
|
86
|
+
}, [effectiveMode]);
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (effectiveMode !== "mobile" && mobileOpen) setMobileOpen(false);
|
|
89
|
+
}, [effectiveMode, mobileOpen]);
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
if (!mobileOpen) return;
|
|
92
|
+
const handleEsc = (e) => {
|
|
93
|
+
if (e.key === "Escape") setMobileOpen(false);
|
|
94
|
+
};
|
|
95
|
+
document.addEventListener("keydown", handleEsc);
|
|
96
|
+
return () => document.removeEventListener("keydown", handleEsc);
|
|
97
|
+
}, [mobileOpen]);
|
|
98
|
+
const autoCollapsed = effectiveMode === "tablet";
|
|
99
|
+
const isCollapsed = collapsed !== void 0 ? collapsed : userCollapsed !== null ? userCollapsed : autoCollapsed;
|
|
100
|
+
const isMobile = effectiveMode === "mobile";
|
|
101
|
+
const navWidth = isCollapsed ? collapsedWidth : width;
|
|
102
|
+
const handleToggleCollapse = useCallback(() => {
|
|
103
|
+
const next = !isCollapsed;
|
|
104
|
+
setUserCollapsed(next);
|
|
105
|
+
onCollapsedChange == null ? void 0 : onCollapsedChange(next);
|
|
106
|
+
}, [isCollapsed, onCollapsedChange]);
|
|
107
|
+
const navStyle = {
|
|
108
|
+
display: "flex",
|
|
109
|
+
flexDirection: "column",
|
|
110
|
+
width: isMobile ? 280 : navWidth,
|
|
111
|
+
height: "100%",
|
|
112
|
+
backgroundColor: isTransparentTheme ? "rgba(15, 12, 30, 0.7)" : tokens.colors.background.surface,
|
|
113
|
+
borderRight: `1px solid ${tokens.colors.border.muted}`,
|
|
114
|
+
transition: "width 0.25s ease, transform 0.25s ease",
|
|
115
|
+
overflowX: "hidden",
|
|
116
|
+
overflowY: "auto",
|
|
117
|
+
flexShrink: 0,
|
|
118
|
+
fontFamily: tokens.typography.fontFamily.primary,
|
|
119
|
+
...isTransparentTheme ? {
|
|
120
|
+
backdropFilter: "blur(16px)",
|
|
121
|
+
WebkitBackdropFilter: "blur(16px)"
|
|
122
|
+
} : {},
|
|
123
|
+
...style
|
|
124
|
+
};
|
|
125
|
+
const contextValue = { collapsed: isCollapsed, mobileOpen, mode: effectiveMode, showCollapseToggle, setMobileOpen, toggleCollapse: handleToggleCollapse };
|
|
126
|
+
if (isMobile) {
|
|
127
|
+
return /* @__PURE__ */ jsxs(SideNavContext.Provider, { value: contextValue, children: [
|
|
128
|
+
/* @__PURE__ */ jsx(
|
|
129
|
+
"button",
|
|
130
|
+
{
|
|
131
|
+
"aria-label": "Open navigation",
|
|
132
|
+
onClick: () => setMobileOpen(true),
|
|
133
|
+
style: {
|
|
134
|
+
position: "fixed",
|
|
135
|
+
top: tokens.spacing.sm,
|
|
136
|
+
left: tokens.spacing.sm,
|
|
137
|
+
zIndex: 1001,
|
|
138
|
+
display: "flex",
|
|
139
|
+
alignItems: "center",
|
|
140
|
+
justifyContent: "center",
|
|
141
|
+
width: 44,
|
|
142
|
+
height: 44,
|
|
143
|
+
border: `1px solid ${tokens.colors.border.muted}`,
|
|
144
|
+
borderRadius: tokens.borderRadius.md,
|
|
145
|
+
backgroundColor: tokens.colors.background.elevated,
|
|
146
|
+
color: tokens.colors.text.primary,
|
|
147
|
+
cursor: "pointer",
|
|
148
|
+
transition: tokens.animation.fast
|
|
149
|
+
},
|
|
150
|
+
children: /* @__PURE__ */ jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", children: [
|
|
151
|
+
/* @__PURE__ */ jsx("line", { x1: "3", y1: "6", x2: "21", y2: "6" }),
|
|
152
|
+
/* @__PURE__ */ jsx("line", { x1: "3", y1: "12", x2: "21", y2: "12" }),
|
|
153
|
+
/* @__PURE__ */ jsx("line", { x1: "3", y1: "18", x2: "21", y2: "18" })
|
|
154
|
+
] })
|
|
155
|
+
}
|
|
156
|
+
),
|
|
157
|
+
/* @__PURE__ */ jsx(
|
|
158
|
+
"div",
|
|
159
|
+
{
|
|
160
|
+
"aria-hidden": "true",
|
|
161
|
+
style: {
|
|
162
|
+
position: "fixed",
|
|
163
|
+
inset: 0,
|
|
164
|
+
zIndex: 1002,
|
|
165
|
+
backgroundColor: `${tokens.colors.background.base}99`,
|
|
166
|
+
backdropFilter: "blur(4px)",
|
|
167
|
+
opacity: mobileOpen ? 1 : 0,
|
|
168
|
+
pointerEvents: mobileOpen ? "auto" : "none",
|
|
169
|
+
transition: "opacity 0.25s ease"
|
|
170
|
+
},
|
|
171
|
+
onClick: () => setMobileOpen(false)
|
|
172
|
+
}
|
|
173
|
+
),
|
|
174
|
+
/* @__PURE__ */ jsx(
|
|
175
|
+
"nav",
|
|
176
|
+
{
|
|
177
|
+
role: "navigation",
|
|
178
|
+
"aria-label": "Main navigation",
|
|
179
|
+
style: {
|
|
180
|
+
...navStyle,
|
|
181
|
+
position: "fixed",
|
|
182
|
+
top: 0,
|
|
183
|
+
left: 0,
|
|
184
|
+
zIndex: 1003,
|
|
185
|
+
transform: mobileOpen ? "translateX(0)" : "translateX(-100%)",
|
|
186
|
+
boxShadow: mobileOpen ? tokens.shadows.xl : "none"
|
|
187
|
+
},
|
|
188
|
+
children
|
|
189
|
+
}
|
|
190
|
+
)
|
|
191
|
+
] });
|
|
192
|
+
}
|
|
193
|
+
return /* @__PURE__ */ jsx(SideNavContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx("nav", { role: "navigation", "aria-label": "Main navigation", style: navStyle, children }) });
|
|
194
|
+
});
|
|
195
|
+
function CollapseToggleButton() {
|
|
196
|
+
const { tokens } = useTheme();
|
|
197
|
+
const { collapsed, toggleCollapse } = useContext(SideNavContext);
|
|
198
|
+
const [hovered, setHovered] = useState(false);
|
|
199
|
+
return /* @__PURE__ */ jsx(
|
|
200
|
+
"button",
|
|
201
|
+
{
|
|
202
|
+
type: "button",
|
|
203
|
+
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
204
|
+
onClick: toggleCollapse,
|
|
205
|
+
onMouseEnter: () => setHovered(true),
|
|
206
|
+
onMouseLeave: () => setHovered(false),
|
|
207
|
+
style: {
|
|
208
|
+
display: "flex",
|
|
209
|
+
alignItems: "center",
|
|
210
|
+
justifyContent: "center",
|
|
211
|
+
width: 28,
|
|
212
|
+
height: 28,
|
|
213
|
+
border: `1px solid ${hovered ? tokens.colors.border.focus : tokens.colors.border.muted}`,
|
|
214
|
+
borderRadius: tokens.borderRadius.md,
|
|
215
|
+
backgroundColor: hovered ? `${tokens.colors.accent.primary}15` : "transparent",
|
|
216
|
+
color: hovered ? tokens.colors.accent.primary : tokens.colors.text.tertiary,
|
|
217
|
+
cursor: "pointer",
|
|
218
|
+
flexShrink: 0,
|
|
219
|
+
padding: 0,
|
|
220
|
+
transition: tokens.animation.fast,
|
|
221
|
+
outline: "none"
|
|
222
|
+
},
|
|
223
|
+
children: /* @__PURE__ */ jsx(
|
|
224
|
+
"svg",
|
|
225
|
+
{
|
|
226
|
+
width: "14",
|
|
227
|
+
height: "14",
|
|
228
|
+
viewBox: "0 0 24 24",
|
|
229
|
+
fill: "none",
|
|
230
|
+
stroke: "currentColor",
|
|
231
|
+
strokeWidth: "2",
|
|
232
|
+
strokeLinecap: "round",
|
|
233
|
+
strokeLinejoin: "round",
|
|
234
|
+
style: {
|
|
235
|
+
transition: "transform 0.25s ease",
|
|
236
|
+
transform: collapsed ? "rotate(180deg)" : "rotate(0deg)"
|
|
237
|
+
},
|
|
238
|
+
children: /* @__PURE__ */ jsx("polyline", { points: "15 18 9 12 15 6" })
|
|
239
|
+
}
|
|
240
|
+
)
|
|
241
|
+
}
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
const SideNavHeader = memo(function SideNavHeader2({
|
|
245
|
+
logo,
|
|
246
|
+
collapsedLogo,
|
|
247
|
+
title,
|
|
248
|
+
subtitle,
|
|
249
|
+
badge,
|
|
250
|
+
badgeVariant = "info",
|
|
251
|
+
children
|
|
252
|
+
}) {
|
|
253
|
+
const { tokens } = useTheme();
|
|
254
|
+
const { collapsed, mode, showCollapseToggle, toggleCollapse } = useContext(SideNavContext);
|
|
255
|
+
const displayLogo = collapsed && collapsedLogo ? collapsedLogo : logo;
|
|
256
|
+
const showToggle = showCollapseToggle && mode !== "mobile";
|
|
257
|
+
const badgeColors = {
|
|
258
|
+
info: tokens.colors.accent.primary,
|
|
259
|
+
success: tokens.colors.status.normal,
|
|
260
|
+
warning: tokens.colors.status.caution,
|
|
261
|
+
caution: tokens.colors.status.serious
|
|
262
|
+
};
|
|
263
|
+
return /* @__PURE__ */ jsx("div", { style: {
|
|
264
|
+
display: "flex",
|
|
265
|
+
alignItems: "center",
|
|
266
|
+
gap: tokens.spacing.sm,
|
|
267
|
+
padding: collapsed ? `${tokens.spacing.md} ${tokens.spacing.sm}` : `0 16px 0 15px`,
|
|
268
|
+
minHeight: 91,
|
|
269
|
+
borderBottom: `1px solid ${tokens.colors.border.muted}`,
|
|
270
|
+
flexShrink: 0,
|
|
271
|
+
justifyContent: collapsed ? "center" : "flex-start",
|
|
272
|
+
boxSizing: "border-box"
|
|
273
|
+
}, children: children ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
274
|
+
displayLogo && /* @__PURE__ */ jsx("div", { style: { flexShrink: 0, cursor: collapsed && showToggle ? "pointer" : void 0 }, onClick: collapsed && showToggle ? toggleCollapse : void 0, children: displayLogo }),
|
|
275
|
+
!collapsed && /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
276
|
+
title && /* @__PURE__ */ jsx("div", { style: {
|
|
277
|
+
fontSize: tokens.typography.fontSize.sm,
|
|
278
|
+
fontWeight: tokens.typography.fontWeight.bold,
|
|
279
|
+
color: tokens.colors.text.primary,
|
|
280
|
+
lineHeight: tokens.typography.lineHeight.tight,
|
|
281
|
+
whiteSpace: "nowrap",
|
|
282
|
+
overflow: "hidden",
|
|
283
|
+
textOverflow: "ellipsis"
|
|
284
|
+
}, children: title }),
|
|
285
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: tokens.spacing.xs, marginTop: "2px" }, children: [
|
|
286
|
+
subtitle && /* @__PURE__ */ jsx("span", { style: {
|
|
287
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
288
|
+
color: tokens.colors.text.tertiary
|
|
289
|
+
}, children: subtitle }),
|
|
290
|
+
badge && /* @__PURE__ */ jsx("span", { style: {
|
|
291
|
+
fontSize: "0.6rem",
|
|
292
|
+
fontWeight: tokens.typography.fontWeight.bold,
|
|
293
|
+
color: badgeColors[badgeVariant] || safeAccentText(tokens.colors.accent.primary),
|
|
294
|
+
backgroundColor: `${badgeColors[badgeVariant] || tokens.colors.accent.primary}18`,
|
|
295
|
+
border: `1px solid ${badgeColors[badgeVariant] || tokens.colors.accent.primary}30`,
|
|
296
|
+
padding: "1px 6px",
|
|
297
|
+
borderRadius: tokens.borderRadius.sm,
|
|
298
|
+
textTransform: "uppercase",
|
|
299
|
+
letterSpacing: "0.05em"
|
|
300
|
+
}, children: badge })
|
|
301
|
+
] })
|
|
302
|
+
] }),
|
|
303
|
+
showToggle && /* @__PURE__ */ jsx(CollapseToggleButton, {})
|
|
304
|
+
] }) });
|
|
305
|
+
});
|
|
306
|
+
const TAG_COLORS = {
|
|
307
|
+
default: { bg: "#ffffff10", fg: "#9590a8", border: "#ffffff15" },
|
|
308
|
+
info: { bg: "#8a2be218", fg: "#c4a0ff", border: "#8a2be230" },
|
|
309
|
+
success: { bg: "#56f00018", fg: "#56f000", border: "#56f00030" },
|
|
310
|
+
warning: { bg: "#fce83a18", fg: "#fce83a", border: "#fce83a30" },
|
|
311
|
+
danger: { bg: "#ff383818", fg: "#ff3838", border: "#ff383830" }
|
|
312
|
+
};
|
|
313
|
+
const SideNavItem = memo(function SideNavItem2({
|
|
314
|
+
icon,
|
|
315
|
+
label,
|
|
316
|
+
description,
|
|
317
|
+
tag,
|
|
318
|
+
tagVariant = "default",
|
|
319
|
+
href,
|
|
320
|
+
onClick,
|
|
321
|
+
active = false,
|
|
322
|
+
disabled = false,
|
|
323
|
+
badge,
|
|
324
|
+
external = false,
|
|
325
|
+
status,
|
|
326
|
+
statusLabel,
|
|
327
|
+
suffix
|
|
328
|
+
}) {
|
|
329
|
+
const { tokens } = useTheme();
|
|
330
|
+
const { collapsed, setMobileOpen } = useContext(SideNavContext);
|
|
331
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
332
|
+
const handleClick = useCallback(() => {
|
|
333
|
+
if (disabled) return;
|
|
334
|
+
setMobileOpen(false);
|
|
335
|
+
onClick == null ? void 0 : onClick();
|
|
336
|
+
}, [disabled, onClick, setMobileOpen]);
|
|
337
|
+
const statusColor = status ? SIDENAV_STATUS_COLORS[status] ?? void 0 : void 0;
|
|
338
|
+
const accentColor = statusColor && active ? statusColor : safeAccentText(tokens.colors.accent.primary);
|
|
339
|
+
const hasDescription = !!description && !collapsed;
|
|
340
|
+
const iconElement = typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon, size: hasDescription ? 22 : 20, color: active ? accentColor : tokens.colors.text.secondary }) : icon;
|
|
341
|
+
const itemStyle = {
|
|
342
|
+
display: "flex",
|
|
343
|
+
alignItems: hasDescription ? "flex-start" : "center",
|
|
344
|
+
gap: tokens.spacing.sm,
|
|
345
|
+
padding: collapsed ? `${tokens.spacing.sm} 0` : hasDescription ? `10px 16px 10px 12px` : `${tokens.spacing.sm} 16px ${tokens.spacing.sm} 12px`,
|
|
346
|
+
justifyContent: collapsed ? "center" : "flex-start",
|
|
347
|
+
color: active ? accentColor : disabled ? tokens.colors.text.tertiary : tokens.colors.text.secondary,
|
|
348
|
+
backgroundColor: active ? `${accentColor}12` : isHovered && !disabled ? `${accentColor}08` : "transparent",
|
|
349
|
+
fontSize: tokens.typography.fontSize.sm,
|
|
350
|
+
fontWeight: active ? tokens.typography.fontWeight.semibold : tokens.typography.fontWeight.normal,
|
|
351
|
+
fontFamily: tokens.typography.fontFamily.primary,
|
|
352
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
353
|
+
textDecoration: "none",
|
|
354
|
+
borderTop: "none",
|
|
355
|
+
borderRight: "none",
|
|
356
|
+
borderBottom: "none",
|
|
357
|
+
borderLeft: active ? `3px solid ${accentColor}` : "3px solid transparent",
|
|
358
|
+
outline: "none",
|
|
359
|
+
width: "100%",
|
|
360
|
+
boxSizing: "border-box",
|
|
361
|
+
transition: tokens.animation.fast,
|
|
362
|
+
position: "relative",
|
|
363
|
+
opacity: disabled ? 0.5 : 1
|
|
364
|
+
};
|
|
365
|
+
const tagColors = TAG_COLORS[tagVariant] ?? TAG_COLORS.default;
|
|
366
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
367
|
+
iconElement && /* @__PURE__ */ jsxs("span", { style: { flexShrink: 0, display: "flex", position: "relative", marginTop: hasDescription ? "2px" : 0 }, children: [
|
|
368
|
+
iconElement,
|
|
369
|
+
collapsed && status && /* @__PURE__ */ jsx(
|
|
370
|
+
"span",
|
|
371
|
+
{
|
|
372
|
+
style: {
|
|
373
|
+
position: "absolute",
|
|
374
|
+
top: -3,
|
|
375
|
+
left: -4,
|
|
376
|
+
lineHeight: 0
|
|
377
|
+
},
|
|
378
|
+
title: statusLabel ?? status,
|
|
379
|
+
children: /* @__PURE__ */ jsx(NavStatusShape, { status, size: 7 })
|
|
380
|
+
}
|
|
381
|
+
)
|
|
382
|
+
] }),
|
|
383
|
+
!collapsed && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
384
|
+
/* @__PURE__ */ jsxs("span", { style: { flex: 1, minWidth: 0, overflow: "hidden" }, children: [
|
|
385
|
+
/* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
386
|
+
/* @__PURE__ */ jsx("span", { style: { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: label }),
|
|
387
|
+
tag && /* @__PURE__ */ jsx("span", { style: {
|
|
388
|
+
fontSize: "0.6rem",
|
|
389
|
+
fontWeight: tokens.typography.fontWeight.bold,
|
|
390
|
+
color: tagColors.fg,
|
|
391
|
+
backgroundColor: tagColors.bg,
|
|
392
|
+
border: `1px solid ${tagColors.border}`,
|
|
393
|
+
padding: "1px 5px",
|
|
394
|
+
borderRadius: tokens.borderRadius.sm,
|
|
395
|
+
textTransform: "uppercase",
|
|
396
|
+
letterSpacing: "0.04em",
|
|
397
|
+
flexShrink: 0,
|
|
398
|
+
lineHeight: "1.3",
|
|
399
|
+
whiteSpace: "nowrap"
|
|
400
|
+
}, children: tag })
|
|
401
|
+
] }),
|
|
402
|
+
description && /* @__PURE__ */ jsx("span", { style: {
|
|
403
|
+
display: "block",
|
|
404
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
405
|
+
color: tokens.colors.text.tertiary,
|
|
406
|
+
lineHeight: tokens.typography.lineHeight.normal,
|
|
407
|
+
marginTop: "2px",
|
|
408
|
+
whiteSpace: "nowrap",
|
|
409
|
+
overflow: "hidden",
|
|
410
|
+
textOverflow: "ellipsis",
|
|
411
|
+
fontWeight: tokens.typography.fontWeight.normal
|
|
412
|
+
}, children: description })
|
|
413
|
+
] }),
|
|
414
|
+
(badge !== void 0 && badge > 0 || status || suffix || external) && /* @__PURE__ */ jsxs("span", { style: {
|
|
415
|
+
display: "inline-flex",
|
|
416
|
+
alignItems: "center",
|
|
417
|
+
gap: 8,
|
|
418
|
+
flexShrink: 0,
|
|
419
|
+
marginTop: hasDescription ? "2px" : 0
|
|
420
|
+
}, children: [
|
|
421
|
+
badge !== void 0 && badge > 0 && /* @__PURE__ */ jsx("span", { style: {
|
|
422
|
+
fontSize: "0.65rem",
|
|
423
|
+
fontWeight: tokens.typography.fontWeight.bold,
|
|
424
|
+
color: "#fff",
|
|
425
|
+
backgroundColor: tokens.colors.status.critical,
|
|
426
|
+
borderRadius: tokens.borderRadius.full,
|
|
427
|
+
minWidth: "18px",
|
|
428
|
+
height: "18px",
|
|
429
|
+
display: "inline-flex",
|
|
430
|
+
alignItems: "center",
|
|
431
|
+
justifyContent: "center",
|
|
432
|
+
padding: "0 5px",
|
|
433
|
+
flexShrink: 0,
|
|
434
|
+
lineHeight: 1,
|
|
435
|
+
boxSizing: "border-box"
|
|
436
|
+
}, children: badge > 99 ? "99+" : badge }),
|
|
437
|
+
status && /* @__PURE__ */ jsx(
|
|
438
|
+
"span",
|
|
439
|
+
{
|
|
440
|
+
style: { display: "inline-flex", alignItems: "center", flexShrink: 0 },
|
|
441
|
+
role: "status",
|
|
442
|
+
"aria-label": `Status: ${statusLabel ?? status}`,
|
|
443
|
+
title: statusLabel ?? status,
|
|
444
|
+
children: /* @__PURE__ */ jsx(NavStatusShape, { status, size: 8 })
|
|
445
|
+
}
|
|
446
|
+
),
|
|
447
|
+
suffix && /* @__PURE__ */ jsx("span", { style: { flexShrink: 0, display: "inline-flex", alignItems: "center" }, children: suffix }),
|
|
448
|
+
external && /* @__PURE__ */ jsxs("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", style: { flexShrink: 0, opacity: 0.5 }, children: [
|
|
449
|
+
/* @__PURE__ */ jsx("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
|
|
450
|
+
/* @__PURE__ */ jsx("polyline", { points: "15 3 21 3 21 9" }),
|
|
451
|
+
/* @__PURE__ */ jsx("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
|
|
452
|
+
] })
|
|
453
|
+
] })
|
|
454
|
+
] })
|
|
455
|
+
] });
|
|
456
|
+
const props = {
|
|
457
|
+
style: itemStyle,
|
|
458
|
+
onMouseEnter: () => setIsHovered(true),
|
|
459
|
+
onMouseLeave: () => setIsHovered(false),
|
|
460
|
+
title: collapsed ? label : void 0,
|
|
461
|
+
"aria-current": active ? "page" : void 0,
|
|
462
|
+
"aria-disabled": disabled
|
|
463
|
+
};
|
|
464
|
+
if (href && !disabled) {
|
|
465
|
+
return /* @__PURE__ */ jsx("a", { href, onClick: handleClick, target: external ? "_blank" : void 0, rel: external ? "noopener noreferrer" : void 0, ...props, children: content });
|
|
466
|
+
}
|
|
467
|
+
return /* @__PURE__ */ jsx("button", { type: "button", onClick: handleClick, disabled, ...props, children: content });
|
|
468
|
+
});
|
|
469
|
+
const SideNavSection = memo(function SideNavSection2({
|
|
470
|
+
title,
|
|
471
|
+
children
|
|
472
|
+
}) {
|
|
473
|
+
const { tokens } = useTheme();
|
|
474
|
+
const { collapsed } = useContext(SideNavContext);
|
|
475
|
+
return /* @__PURE__ */ jsxs("div", { style: { marginTop: tokens.spacing.sm }, children: [
|
|
476
|
+
title && !collapsed && /* @__PURE__ */ jsx("div", { style: {
|
|
477
|
+
padding: `${tokens.spacing.xs} 16px ${tokens.spacing.xs} 15px`,
|
|
478
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
479
|
+
fontWeight: tokens.typography.fontWeight.bold,
|
|
480
|
+
color: tokens.colors.text.tertiary,
|
|
481
|
+
textTransform: "uppercase",
|
|
482
|
+
letterSpacing: "0.08em"
|
|
483
|
+
}, children: title }),
|
|
484
|
+
collapsed && title && /* @__PURE__ */ jsx("div", { style: {
|
|
485
|
+
width: "60%",
|
|
486
|
+
height: "1px",
|
|
487
|
+
backgroundColor: tokens.colors.border.muted,
|
|
488
|
+
margin: `${tokens.spacing.xs} auto`
|
|
489
|
+
} }),
|
|
490
|
+
children
|
|
491
|
+
] });
|
|
492
|
+
});
|
|
493
|
+
const SideNavDivider = memo(function SideNavDivider2({
|
|
494
|
+
label
|
|
495
|
+
}) {
|
|
496
|
+
const { tokens } = useTheme();
|
|
497
|
+
const { collapsed } = useContext(SideNavContext);
|
|
498
|
+
if (collapsed) {
|
|
499
|
+
return /* @__PURE__ */ jsx("div", { style: {
|
|
500
|
+
width: "60%",
|
|
501
|
+
height: "1px",
|
|
502
|
+
backgroundColor: tokens.colors.border.muted,
|
|
503
|
+
margin: `${tokens.spacing.sm} auto`
|
|
504
|
+
} });
|
|
505
|
+
}
|
|
506
|
+
if (label) {
|
|
507
|
+
return /* @__PURE__ */ jsxs("div", { style: {
|
|
508
|
+
display: "flex",
|
|
509
|
+
alignItems: "center",
|
|
510
|
+
gap: tokens.spacing.sm,
|
|
511
|
+
padding: `${tokens.spacing.sm} 16px ${tokens.spacing.sm} 15px`
|
|
512
|
+
}, children: [
|
|
513
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1, height: "1px", backgroundColor: tokens.colors.border.muted } }),
|
|
514
|
+
/* @__PURE__ */ jsx("span", { style: {
|
|
515
|
+
fontSize: tokens.typography.fontSize.xxs,
|
|
516
|
+
color: tokens.colors.text.tertiary,
|
|
517
|
+
textTransform: "uppercase",
|
|
518
|
+
letterSpacing: "0.06em",
|
|
519
|
+
whiteSpace: "nowrap"
|
|
520
|
+
}, children: label }),
|
|
521
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1, height: "1px", backgroundColor: tokens.colors.border.muted } })
|
|
522
|
+
] });
|
|
523
|
+
}
|
|
524
|
+
return /* @__PURE__ */ jsx("div", { style: {
|
|
525
|
+
height: "1px",
|
|
526
|
+
backgroundColor: tokens.colors.border.muted,
|
|
527
|
+
margin: `${tokens.spacing.sm} 16px ${tokens.spacing.sm} 15px`
|
|
528
|
+
} });
|
|
529
|
+
});
|
|
530
|
+
const SideNavFooter = memo(function SideNavFooter2({
|
|
531
|
+
children
|
|
532
|
+
}) {
|
|
533
|
+
const { tokens } = useTheme();
|
|
534
|
+
return /* @__PURE__ */ jsx("div", { style: {
|
|
535
|
+
marginTop: "auto",
|
|
536
|
+
borderTop: `1px solid ${tokens.colors.border.muted}`,
|
|
537
|
+
paddingTop: tokens.spacing.xs,
|
|
538
|
+
paddingBottom: tokens.spacing.xs
|
|
539
|
+
}, children });
|
|
540
|
+
});
|
|
541
|
+
const SideNav = Object.assign(SideNavRoot, {
|
|
542
|
+
Header: SideNavHeader,
|
|
543
|
+
Item: SideNavItem,
|
|
544
|
+
Section: SideNavSection,
|
|
545
|
+
Divider: SideNavDivider,
|
|
546
|
+
Footer: SideNavFooter
|
|
547
|
+
});
|
|
548
|
+
export {
|
|
549
|
+
SideNav
|
|
550
|
+
};
|
|
551
|
+
//# sourceMappingURL=SideNav.js.map
|