@orsetra/shared-ui 1.0.16 → 1.0.17

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.
@@ -20,15 +20,13 @@ export interface SubMenuItem {
20
20
  name: string
21
21
  href: string
22
22
  icon: LucideIcon
23
- /** Fonction optionnelle pour transformer le href avant navigation */
24
- hrefTransform?: (href: string) => string
25
23
  }
26
24
 
27
25
  export interface SidebarMenus {
28
26
  [key: string]: SubMenuItem[]
29
27
  }
30
28
 
31
- // Menu principal (centralisé) - Structure commune à toutes les apps
29
+
32
30
  export const menuItems: MainMenuItem[] = [
33
31
  {
34
32
  id: "assets",
@@ -178,10 +178,8 @@ function Sidebar({ currentMenu, onMainMenuToggle, sidebarMenus = {} }: SidebarPr
178
178
  const pathname = usePathname()
179
179
  const { state } = useSidebar()
180
180
 
181
- // Déterminer quelle navigation afficher à partir des menus fournis par l'app
182
- const currentNavigation: SubMenuItem[] = currentMenu && sidebarMenus[currentMenu]
183
- ? sidebarMenus[currentMenu]
184
- : []
181
+ // Utilise 'items' comme clé standard pour toutes les micro apps
182
+ const currentNavigation: SubMenuItem[] = sidebarMenus['items'] || []
185
183
 
186
184
  return (
187
185
  <div className="h-screen sticky top-0 flex flex-col bg-white border-r border-ui-border min-w-[var(--sidebar-width-icon)] transition-[width] duration-200"
@@ -206,8 +204,8 @@ function Sidebar({ currentMenu, onMainMenuToggle, sidebarMenus = {} }: SidebarPr
206
204
  {currentMenu && menuLabels[currentMenu] && (
207
205
  <div className="px-4 py-3 border-b border-ui-border">
208
206
  <div className="flex items-center gap-2">
209
- {currentMenu === "assets" && <Rocket className="h-4 w-4 text-interactive" />}
210
- {currentMenu === "applications" && <Package className="h-4 w-4 text-interactive" />}
207
+ {currentMenu === "assets-manager" && <Rocket className="h-4 w-4 text-interactive" />}
208
+ {currentMenu === "applications-manager" && <Package className="h-4 w-4 text-interactive" />}
211
209
  {currentMenu === "api-manager" && <Settings className="h-4 w-4 text-interactive" />}
212
210
  {currentMenu === "access-manager" && <Shield className="h-4 w-4 text-interactive" />}
213
211
  <h2 className="text-sm font-semibold text-text-primary">
@@ -220,12 +218,11 @@ function Sidebar({ currentMenu, onMainMenuToggle, sidebarMenus = {} }: SidebarPr
220
218
  {/* Navigation principale avec espacements ajustés */}
221
219
  <nav className="flex-1 px-3 py-4 space-y-1 overflow-y-auto">
222
220
  {currentNavigation.map((item) => {
223
- const finalHref = item.hrefTransform ? item.hrefTransform(item.href) : item.href
224
- const isActive = pathname === finalHref || pathname.startsWith(`${finalHref}/`)
221
+ const isActive = pathname === item.href || pathname.startsWith(`${item.href}/`)
225
222
  return (
226
223
  <Link
227
224
  key={item.name}
228
- href={finalHref}
225
+ href={item.href}
229
226
  className={cn(
230
227
  "flex items-center px-3 py-2 text-sm rounded-md gap-x-3 transition-colors",
231
228
  isActive
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orsetra/shared-ui",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "Shared UI components for Orsetra platform",
5
5
  "main": "./index.ts",
6
6
  "types": "./index.ts",