@orsetra/shared-ui 1.1.33 → 1.1.34
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.
|
@@ -9,7 +9,7 @@ import { UserMenu, Button, type UserMenuConfig } from "../ui"
|
|
|
9
9
|
import { getMenuFromPath } from "../../lib/menu-utils"
|
|
10
10
|
import { useIsMobile } from "../../hooks/use-mobile"
|
|
11
11
|
import { cn } from "../../lib/utils"
|
|
12
|
-
import { Menu, ChevronDown } from "lucide-react"
|
|
12
|
+
import { Menu, ChevronDown, ChevronRight } from "lucide-react"
|
|
13
13
|
|
|
14
14
|
// ─── Dropdown Organisation / Projets ────────────────────────────────────────
|
|
15
15
|
|
|
@@ -90,19 +90,20 @@ function OrgProjectDropdown({
|
|
|
90
90
|
key={project.id}
|
|
91
91
|
onClick={() => { onProjectChange(project.id); setOpen(false) }}
|
|
92
92
|
className={cn(
|
|
93
|
-
"flex items-center
|
|
93
|
+
"flex items-center justify-between w-full px-4 py-2.5 text-left transition-colors",
|
|
94
94
|
isActive
|
|
95
|
-
? "bg-interactive/10
|
|
96
|
-
: "
|
|
95
|
+
? "bg-interactive/10"
|
|
96
|
+
: "hover:bg-ui-background"
|
|
97
97
|
)}
|
|
98
98
|
>
|
|
99
|
-
<div className=
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
? "
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
99
|
+
<div className="flex flex-col min-w-0">
|
|
100
|
+
<span className={cn(
|
|
101
|
+
"text-sm font-medium truncate",
|
|
102
|
+
isActive ? "text-interactive" : "text-text-primary"
|
|
103
|
+
)}>{project.name}</span>
|
|
104
|
+
<span className="text-xs text-text-secondary truncate">{project.id}</span>
|
|
105
|
+
</div>
|
|
106
|
+
<ChevronRight className="h-3.5 w-3.5 text-text-secondary flex-shrink-0 ml-2" />
|
|
106
107
|
</button>
|
|
107
108
|
)
|
|
108
109
|
})
|
|
@@ -83,24 +83,19 @@ export function PageWithSidePanel({
|
|
|
83
83
|
<>
|
|
84
84
|
<div
|
|
85
85
|
className={cn(
|
|
86
|
-
"hidden lg:flex flex-col flex-shrink-0 sticky top-0 self-start h-[calc(100vh-3.5rem)] overflow-hidden transition-[width
|
|
87
|
-
showBorder
|
|
88
|
-
showBorder && isOpen ? "border-ibm-gray-40" : "border-transparent",
|
|
86
|
+
"hidden lg:flex flex-col flex-shrink-0 sticky top-0 self-start h-[calc(100vh-3.5rem)] overflow-hidden transition-[width] duration-300 ease-in-out",
|
|
87
|
+
isOpen && showBorder && "border-l border-ibm-gray-40",
|
|
89
88
|
isOpen ? panelWidthClass : "w-0",
|
|
90
89
|
sidePanelClassName
|
|
91
90
|
)}
|
|
92
91
|
>
|
|
93
92
|
{/* Inner wrapper at fixed width to prevent content reflow during animation */}
|
|
94
|
-
<div className={
|
|
95
|
-
`flex flex-col h-full bg-white ${panelWidthClass}`,
|
|
96
|
-
"transition-opacity duration-200 ease-in-out",
|
|
97
|
-
isOpen ? "opacity-100 delay-100" : "opacity-0"
|
|
98
|
-
)}>
|
|
93
|
+
<div className={`flex flex-col h-full bg-white ${panelWidthClass}`}>
|
|
99
94
|
|
|
100
|
-
{/* Panel header
|
|
95
|
+
{/* Panel header */}
|
|
101
96
|
{(sidePanelHeader || closable) && (
|
|
102
97
|
<div className={cn(
|
|
103
|
-
"flex items-center justify-between h-14 flex-shrink-0 px-4",
|
|
98
|
+
"flex items-center justify-between h-14 flex-shrink-0 px-4 border-b border-ibm-gray-20",
|
|
104
99
|
sidePanelHeaderClassName
|
|
105
100
|
)}>
|
|
106
101
|
<div className="flex-1 min-w-0">
|
|
@@ -127,13 +122,10 @@ export function PageWithSidePanel({
|
|
|
127
122
|
</div>
|
|
128
123
|
|
|
129
124
|
{/* Toggle button — fixed keeps it vertically centered in the viewport */}
|
|
130
|
-
{closable && (
|
|
125
|
+
{closable && !isOpen && (
|
|
131
126
|
<button
|
|
132
|
-
onClick={
|
|
133
|
-
className=
|
|
134
|
-
"hidden lg:flex fixed top-1/2 right-0 -translate-y-1/2 items-center justify-center w-6 h-16 bg-white border border-ibm-gray-40 border-r-0 rounded-l-lg shadow-md hover:bg-ibm-gray-10 transition-[opacity,transform] duration-300 ease-in-out",
|
|
135
|
-
isOpen ? "opacity-0 pointer-events-none translate-x-2" : "opacity-100 translate-x-0"
|
|
136
|
-
)}
|
|
127
|
+
onClick={handleOpen}
|
|
128
|
+
className="hidden lg:flex fixed top-1/2 right-0 -translate-y-1/2 items-center justify-center w-6 h-16 bg-white border border-ibm-gray-40 border-r-0 rounded-l-lg shadow-md hover:bg-ibm-gray-10 transition-colors duration-200"
|
|
137
129
|
aria-label="Open side panel"
|
|
138
130
|
>
|
|
139
131
|
<ChevronLeft className="h-4 w-4 text-ibm-gray-70" />
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
Menu,
|
|
24
24
|
User,
|
|
25
25
|
ChevronUp,
|
|
26
|
+
ChevronRight,
|
|
26
27
|
} from "lucide-react"
|
|
27
28
|
import { Logo } from "../../ui/logo"
|
|
28
29
|
import { type SidebarMenus, type SubMenuItem, type OrgInfo } from "./data"
|
|
@@ -300,12 +301,13 @@ function Sidebar({ currentMenu, onMainMenuToggle, sidebarMenus = {}, main_base_u
|
|
|
300
301
|
{orgData?.nom?.charAt(0)?.toUpperCase() ?? 'O'}
|
|
301
302
|
</div>
|
|
302
303
|
)}
|
|
303
|
-
<div className="flex flex-col min-w-0">
|
|
304
|
+
<div className="flex flex-col min-w-0 flex-1">
|
|
304
305
|
<span className="text-xs text-text-secondary uppercase tracking-wide mb-1">Organisation</span>
|
|
305
306
|
<span className="text-base font-semibold text-text-primary truncate">
|
|
306
307
|
{orgLoading ? '…' : (orgData?.nom ?? 'Organisation')}
|
|
307
308
|
</span>
|
|
308
309
|
</div>
|
|
310
|
+
<ChevronRight className="h-4 w-4 text-text-secondary flex-shrink-0 opacity-40" />
|
|
309
311
|
</Link>
|
|
310
312
|
|
|
311
313
|
{/* Paramètres du compte */}
|
|
@@ -315,7 +317,8 @@ function Sidebar({ currentMenu, onMainMenuToggle, sidebarMenus = {}, main_base_u
|
|
|
315
317
|
className="flex items-center gap-3 px-5 py-3 text-sm text-text-secondary hover:bg-ui-background hover:text-text-primary transition-colors no-underline"
|
|
316
318
|
>
|
|
317
319
|
<User className="h-5 w-5 flex-shrink-0" />
|
|
318
|
-
<span>Paramètres du compte</span>
|
|
320
|
+
<span className="flex-1">Paramètres du compte</span>
|
|
321
|
+
<ChevronRight className="h-4 w-4 flex-shrink-0 opacity-40" />
|
|
319
322
|
</Link>
|
|
320
323
|
</div>
|
|
321
324
|
)}
|