diff --git a/COMPONENT_GUIDE.md b/COMPONENT_GUIDE.md index 146f627..3876c2e 100644 --- a/COMPONENT_GUIDE.md +++ b/COMPONENT_GUIDE.md @@ -306,7 +306,7 @@ import { | Sidebar | Composable compound sidebar shell with icon-rail collapse mode. Sub-components: `Sidebar.Header`, `Sidebar.Section`, `Sidebar.Footer`, `Sidebar.FooterLink`. The app controls all content via children — the DS provides the frame. | | SidebarTree | Data-driven tree for sidebar sections. Accepts `nodes: SidebarTreeNode[]` with expand/collapse, starring, keyboard nav, search filter, and path-based selection highlighting. | | useStarred | Hook for localStorage-backed starred item IDs. Returns `{ starredIds, isStarred, toggleStar }`. | -| TopBar | Header bar with breadcrumb, search trigger, ButtonGroup status filters, time range selector, theme toggle, environment badge, user avatar | +| TopBar | Header bar with breadcrumb, search trigger, ButtonGroup status filters, time range selector, theme toggle, environment slot (`ReactNode` — pass a string for a static label or a custom dropdown for interactive selection), user avatar | ## Import Paths diff --git a/src/design-system/layout/TopBar/TopBar.tsx b/src/design-system/layout/TopBar/TopBar.tsx index 8ec8272..2b194d0 100644 --- a/src/design-system/layout/TopBar/TopBar.tsx +++ b/src/design-system/layout/TopBar/TopBar.tsx @@ -1,3 +1,4 @@ +import { type ReactNode } from 'react' import { Search, Moon, Sun, Power } from 'lucide-react' import styles from './TopBar.module.css' import { Breadcrumb } from '../../composites/Breadcrumb/Breadcrumb' @@ -14,7 +15,7 @@ import type { BreadcrumbItem } from '../../providers/BreadcrumbProvider' interface TopBarProps { breadcrumb: BreadcrumbItem[] - environment?: string + environment?: ReactNode user?: { name: string } onLogout?: () => void className?: string @@ -102,7 +103,7 @@ export function TopBar({ {theme === 'light' ? : } {environment && ( - {environment} +
{environment}
)} {user && (