@orsetra/shared-ui 1.0.62 → 1.0.65
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.
|
@@ -30,4 +30,3 @@ export {
|
|
|
30
30
|
// Skeleton is exported from ../ui to avoid duplicate exports
|
|
31
31
|
export { RootLayoutWrapper, ibmPlexSans, ibmPlexMono } from './root-layout-wrapper'
|
|
32
32
|
export { LayoutContainer } from './layout-container'
|
|
33
|
-
export { PageWithSidePanel } from './page-with-side-panel'
|
|
@@ -82,7 +82,7 @@ function LayoutContent({ children, sidebarMenus, user, onSignOut, mode = 'expand
|
|
|
82
82
|
/>
|
|
83
83
|
|
|
84
84
|
<div className="flex-1 flex flex-col min-w-0">
|
|
85
|
-
<header className="h-14 bg-gray-50 flex-shrink-0">
|
|
85
|
+
<header className="h-14 bg-gray-50 border-b border-ui-border flex-shrink-0">
|
|
86
86
|
<div className="h-full px-4 md:px-6 flex items-center justify-between">
|
|
87
87
|
{/* Menu button - shown when sidebar is hidden (including on mobile) */}
|
|
88
88
|
{isHidden ? (
|
|
@@ -66,9 +66,12 @@ export function MainSidebar({
|
|
|
66
66
|
|
|
67
67
|
const handleSubMenuClick = (e: React.MouseEvent, href: string) => {
|
|
68
68
|
e.preventDefault()
|
|
69
|
+
console.log('handleSubMenuClick - href:', href)
|
|
69
70
|
const path = href.startsWith('http://') || href.startsWith('https://')
|
|
70
71
|
? new URL(href).pathname
|
|
71
72
|
: href
|
|
73
|
+
console.log('handleSubMenuClick - path:', path)
|
|
74
|
+
console.log('Redirecting to:', path)
|
|
72
75
|
window.location.href = path
|
|
73
76
|
setHoveredMenu(null)
|
|
74
77
|
}
|
|
@@ -83,14 +86,14 @@ export function MainSidebar({
|
|
|
83
86
|
)}
|
|
84
87
|
|
|
85
88
|
<div className={cn(
|
|
86
|
-
"fixed left-0 top-0 h-full bg-gray-
|
|
89
|
+
"fixed left-0 top-0 h-full bg-gray-30 border-r border-ui-border z-50 transform transition-all duration-300 ease-in-out",
|
|
87
90
|
isMinimized ? "w-16" : "w-64 shadow-xl",
|
|
88
91
|
isMinimized
|
|
89
92
|
? "translate-x-0"
|
|
90
93
|
: (isOpen ? "translate-x-0" : "-translate-x-full")
|
|
91
94
|
)}>
|
|
92
95
|
<div className={cn(
|
|
93
|
-
"flex items-center h-16 bg-gray-
|
|
96
|
+
"flex items-center h-16 border-b border-ui-border bg-gray-30",
|
|
94
97
|
isMinimized ? "justify-center px-2" : "justify-between px-4"
|
|
95
98
|
)}>
|
|
96
99
|
{!isMinimized && <Logo className="text-2xl font-semibold text-text-primary" />}
|
|
@@ -145,8 +148,8 @@ export function MainSidebar({
|
|
|
145
148
|
</button>
|
|
146
149
|
|
|
147
150
|
{isMinimized && hoveredMenu === item.id && sidebarMenus[item.id] && sidebarMenus[item.id].length > 0 && (
|
|
148
|
-
<div className="absolute left-full top-0 ml-2 bg-
|
|
149
|
-
<div className="px-4 py-2">
|
|
151
|
+
<div className="absolute left-full top-0 ml-2 bg-gray-30 border border-ui-border rounded-lg shadow-xl z-50 min-w-[200px] py-2">
|
|
152
|
+
<div className="px-4 py-2 border-b border-ui-border">
|
|
150
153
|
<h3 className="text-sm font-semibold text-text-primary">{item.label}</h3>
|
|
151
154
|
</div>
|
|
152
155
|
<div className="py-1">
|
|
@@ -204,7 +204,7 @@ function Sidebar({ currentMenu, onMainMenuToggle, sidebarMenus = {}, main_base_u
|
|
|
204
204
|
|| []
|
|
205
205
|
|
|
206
206
|
return (
|
|
207
|
-
<div className="h-screen sticky top-0 flex flex-col bg-gray-50
|
|
207
|
+
<div className="h-screen sticky top-0 flex flex-col bg-gray-50 border-r border-ui-border min-w-[var(--sidebar-width-icon)] transition-[width] duration-200"
|
|
208
208
|
style={{ width: state === "expanded" ? "var(--sidebar-width)" : "var(--sidebar-width-icon)" }}>
|
|
209
209
|
{/* Logo avec bouton de menu principal */}
|
|
210
210
|
<div className="h-14 flex items-center justify-between px-4 border-b border-ui-border">
|
|
@@ -272,10 +272,10 @@ function Sidebar({ currentMenu, onMainMenuToggle, sidebarMenus = {}, main_base_u
|
|
|
272
272
|
</nav>
|
|
273
273
|
|
|
274
274
|
{/* Footer - Menu Paramètres */}
|
|
275
|
-
<div className="relative
|
|
275
|
+
<div className="relative border-t border-ui-border px-3 py-3" ref={settingsRef}>
|
|
276
276
|
{/* Dropdown vers le haut */}
|
|
277
277
|
{settingsOpen && (
|
|
278
|
-
<div className="absolute bottom-full left-2 right-2 mb-1 bg-
|
|
278
|
+
<div className="absolute bottom-full left-2 right-2 mb-1 bg-gray-50 border border-ui-border rounded-none shadow-lg z-50">
|
|
279
279
|
<div className="py-1">
|
|
280
280
|
<Link
|
|
281
281
|
href={`${main_base_url}/organization`}
|
|
@@ -518,6 +518,7 @@ const SidebarGroupAction = React.forwardRef<
|
|
|
518
518
|
data-sidebar="group-action"
|
|
519
519
|
className={cn(
|
|
520
520
|
"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
521
|
+
// Increases the hit area of the button on mobile.
|
|
521
522
|
"after:absolute after:-inset-2 after:md:hidden",
|
|
522
523
|
"group-data-[collapsible=icon]:hidden",
|
|
523
524
|
className
|
|
@@ -663,6 +664,7 @@ const SidebarMenuAction = React.forwardRef<
|
|
|
663
664
|
data-sidebar="menu-action"
|
|
664
665
|
className={cn(
|
|
665
666
|
"absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0",
|
|
667
|
+
// Increases the hit area of the button on mobile.
|
|
666
668
|
"after:absolute after:-inset-2 after:md:hidden",
|
|
667
669
|
"peer-data-[size=sm]/menu-button:top-1",
|
|
668
670
|
"peer-data-[size=default]/menu-button:top-1.5",
|
|
@@ -4,28 +4,32 @@ import type { ReactNode } from "react"
|
|
|
4
4
|
|
|
5
5
|
interface PageHeaderProps {
|
|
6
6
|
title: string
|
|
7
|
+
description?: string
|
|
7
8
|
backLink?: string
|
|
8
9
|
actions?: ReactNode
|
|
9
10
|
statusNode?: ReactNode
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
export function PageHeader({ title, backLink, actions, statusNode}: PageHeaderProps) {
|
|
13
|
+
export function PageHeader({ title, description, backLink, actions, statusNode}: PageHeaderProps) {
|
|
13
14
|
return (
|
|
14
|
-
<div className="
|
|
15
|
-
<div className="flex items-center justify-between gap-4">
|
|
15
|
+
<div className="mb-4 sm:mb-8">
|
|
16
|
+
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
|
16
17
|
<div className="flex items-center space-x-3 min-w-0">
|
|
17
18
|
{backLink && (
|
|
18
19
|
<Link href={backLink} className="flex-shrink-0">
|
|
19
|
-
<ArrowLeft className="h-
|
|
20
|
+
<ArrowLeft className="h-5 w-5 sm:h-6 sm:w-6 text-text-secondary" />
|
|
20
21
|
</Link>
|
|
21
22
|
)}
|
|
22
|
-
<div className="
|
|
23
|
-
<
|
|
24
|
-
|
|
23
|
+
<div className="min-w-0">
|
|
24
|
+
<div className="flex items-center space-x-3">
|
|
25
|
+
<h1 className="text-xl sm:text-2xl font-semibold text-text-primary truncate">{title}</h1>
|
|
26
|
+
{statusNode && <div className="mt-2 flex-shrink-0">{statusNode}</div>}
|
|
27
|
+
</div>
|
|
28
|
+
{description && <p className="text-sm sm:text-base text-text-secondary line-clamp-2">{description}</p>}
|
|
25
29
|
</div>
|
|
26
30
|
</div>
|
|
27
|
-
{actions && <div className="flex items-center space-x-2 flex-shrink-0">{actions}</div>}
|
|
31
|
+
{actions && <div className="flex items-center space-x-2 sm:space-x-4 flex-shrink-0">{actions}</div>}
|
|
28
32
|
</div>
|
|
29
33
|
</div>
|
|
30
34
|
)
|
|
31
|
-
}
|
|
35
|
+
}
|