+ {!forceExpanded && (
+
+
+
+
+
+ {collapsed ? 'Expandir' : 'Colapsar'}
+
+
+ )}
+
{!collapsed && (
-
+
SIG-CM 2.0
)}
@@ -107,32 +131,6 @@ export function SidebarNav({ forceExpanded = false }: SidebarNavProps) {
>
)}
-
- {/* Collapse toggle — visible only on desktop (no en Sheet) */}
- {!forceExpanded && (
-
-
-
- )}
)
}
@@ -151,12 +149,13 @@ function NavRow({ item, collapsed, active }: NavRowProps) {
const Icon = item.icon
const baseClasses = cn(
- 'group/item relative flex items-center rounded-md text-sm transition-colors',
- collapsed ? 'justify-center h-10 px-0' : 'gap-3 px-3 py-2',
+ 'relative flex items-center rounded-md text-sm transition-colors',
+ collapsed ? 'justify-center h-10 w-10 mx-auto' : 'gap-3 px-3 py-2',
)
+ // Disabled item
if (item.disabled) {
- return (
+ const content = (
>
)}
- {collapsed && {item.label} · Próximamente}
)
+
+ if (!collapsed) return content
+ return (
+
+ {content}
+
+ {item.label}{' '}
+ · Próximamente
+
+
+ )
}
- return (
+ // Active link
+ const link = (
- {/* Active indicator bar (left edge) — sutil cuando expanded, dot cuando collapsed */}
+ {/* Active indicator bar (left edge) when expanded */}
{active && !collapsed && (
)}
{!collapsed && {item.label}}
- {collapsed && {item.label}}
)
+
+ if (!collapsed) return link
+ return (
+
+ {link}
+ {item.label}
+
+ )
}
function SectionLabel({
@@ -208,9 +225,7 @@ function SectionLabel({
children: React.ReactNode
}) {
if (collapsed) {
- return (
-
- )
+ return
}
return (
@@ -220,25 +235,3 @@ function SectionLabel({
)
}
-
-/**
- * Custom tooltip que aparece a la derecha del item cuando el sidebar está collapsed.
- * Sin radix dep — pure CSS hover + group selector. Se posiciona absolute fuera del sidebar.
- */
-function SidebarTooltip({ children }: { children: React.ReactNode }) {
- return (
-
- {children}
-
- )
-}
diff --git a/src/web/src/components/ui/tooltip.tsx b/src/web/src/components/ui/tooltip.tsx
new file mode 100644
index 0000000..f470f1b
--- /dev/null
+++ b/src/web/src/components/ui/tooltip.tsx
@@ -0,0 +1,33 @@
+import * as React from 'react'
+import * as TooltipPrimitive from '@radix-ui/react-tooltip'
+
+import { cn } from '@/lib/utils'
+
+const TooltipProvider = TooltipPrimitive.Provider
+const Tooltip = TooltipPrimitive.Root
+const TooltipTrigger = TooltipPrimitive.Trigger
+
+const TooltipContent = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, sideOffset = 8, ...props }, ref) => (
+
+
+
+))
+TooltipContent.displayName = TooltipPrimitive.Content.displayName
+
+export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }