@orsetra/shared-ui 1.0.46 → 1.0.47
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.
|
@@ -40,36 +40,43 @@ export function MainSidebar({
|
|
|
40
40
|
const handleMenuClick = (menuId: string) => {
|
|
41
41
|
onMenuSelect(menuId)
|
|
42
42
|
|
|
43
|
-
// En mode minimized, ne pas ouvrir le sidebar secondaire
|
|
44
43
|
if (!isMinimized && onSecondarySidebarOpen) {
|
|
45
44
|
onSecondarySidebarOpen()
|
|
46
45
|
}
|
|
47
46
|
|
|
48
|
-
// Rediriger vers le premier sous-menu ou vers l'app directement
|
|
49
47
|
const subMenus = sidebarMenus[menuId]
|
|
50
48
|
if (subMenus && subMenus.length > 0) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
const targetUrl = subMenus[0].href
|
|
50
|
+
if (targetUrl.startsWith('http://') || targetUrl.startsWith('https://')) {
|
|
51
|
+
window.location.href = targetUrl
|
|
52
|
+
} else {
|
|
53
|
+
router.push(targetUrl)
|
|
54
|
+
}
|
|
54
55
|
} else {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
const targetUrl = `${main_base_url}/${menuId}`
|
|
57
|
+
if (targetUrl.startsWith('http://') || targetUrl.startsWith('https://')) {
|
|
58
|
+
window.location.href = targetUrl
|
|
59
|
+
} else {
|
|
60
|
+
router.push(targetUrl)
|
|
61
|
+
}
|
|
58
62
|
}
|
|
59
63
|
|
|
60
64
|
if (!isMinimized) {
|
|
61
|
-
onToggle()
|
|
65
|
+
onToggle()
|
|
62
66
|
}
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
const handleSubMenuClick = (href: string) => {
|
|
66
|
-
|
|
70
|
+
if (href.startsWith('http://') || href.startsWith('https://')) {
|
|
71
|
+
window.location.href = href
|
|
72
|
+
} else {
|
|
73
|
+
router.push(href)
|
|
74
|
+
}
|
|
67
75
|
setHoveredMenu(null)
|
|
68
76
|
}
|
|
69
77
|
|
|
70
78
|
return (
|
|
71
79
|
<>
|
|
72
|
-
{/* Overlay - seulement en mode expanded */}
|
|
73
80
|
{isOpen && !isMinimized && (
|
|
74
81
|
<div
|
|
75
82
|
className="fixed inset-0 bg-black/50 z-40"
|
|
@@ -77,7 +84,6 @@ export function MainSidebar({
|
|
|
77
84
|
/>
|
|
78
85
|
)}
|
|
79
86
|
|
|
80
|
-
{/* Main Sidebar */}
|
|
81
87
|
<div className={cn(
|
|
82
88
|
"fixed left-0 top-0 h-full bg-white border-r border-ui-border z-50 transform transition-all duration-300 ease-in-out",
|
|
83
89
|
isMinimized ? "w-16" : "w-64 shadow-xl",
|
|
@@ -85,7 +91,6 @@ export function MainSidebar({
|
|
|
85
91
|
? "translate-x-0"
|
|
86
92
|
: (isOpen ? "translate-x-0" : "-translate-x-full")
|
|
87
93
|
)}>
|
|
88
|
-
{/* Header avec logo Orchestra */}
|
|
89
94
|
<div className={cn(
|
|
90
95
|
"flex items-center h-16 border-b border-ui-border bg-white",
|
|
91
96
|
isMinimized ? "justify-center px-2" : "justify-between px-4"
|
|
@@ -105,7 +110,6 @@ export function MainSidebar({
|
|
|
105
110
|
)}
|
|
106
111
|
</div>
|
|
107
112
|
|
|
108
|
-
{/* Menu Items */}
|
|
109
113
|
<div className={cn(
|
|
110
114
|
"overflow-y-auto h-full",
|
|
111
115
|
isMinimized ? "p-2" : "p-3"
|
|
@@ -142,7 +146,6 @@ export function MainSidebar({
|
|
|
142
146
|
{!isMinimized && <span className="text-base">{item.label}</span>}
|
|
143
147
|
</button>
|
|
144
148
|
|
|
145
|
-
{/* Submenu au survol en mode minimized */}
|
|
146
149
|
{isMinimized && hoveredMenu === item.id && sidebarMenus[item.id] && sidebarMenus[item.id].length > 0 && (
|
|
147
150
|
<div className="absolute left-full top-0 ml-2 bg-white border border-ui-border rounded-lg shadow-xl z-50 min-w-[200px] py-2">
|
|
148
151
|
<div className="px-4 py-2 border-b border-ui-border">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orsetra/shared-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.47",
|
|
4
4
|
"description": "Shared UI components for Orsetra platform",
|
|
5
5
|
"main": "./index.ts",
|
|
6
6
|
"types": "./index.ts",
|
|
@@ -93,4 +93,4 @@
|
|
|
93
93
|
"next": "^16.0.7",
|
|
94
94
|
"typescript": "^5"
|
|
95
95
|
}
|
|
96
|
-
}
|
|
96
|
+
}
|